Name: Anonymous 2011-03-09 1:33
A section from the ASM guide I'm reading:
"MOV AX,51h
MOV BX,4Fh
XCHG AX,BX
PUSH AX
MOV AX,34h
POP BX
PUSH BX
POP AX
First AX is equal to 51h and BX to 4Fh, than the 2 get exchanged. Now we got
AX = 4Fh and BX = 51h. AX gets pushed on the stack, then set to 34h:
AX = 34h and BX = 51h. BX gets poped, than pushed:
AX = 34h and BX = 4Fh. Finally AX gets poped. So the final result is:
AX = 4Fh and BX = 4Fh"
Can someone please explain why AX= 4Fh and not 34h?? That's the last value that was copied to it.
"MOV AX,51h
MOV BX,4Fh
XCHG AX,BX
PUSH AX
MOV AX,34h
POP BX
PUSH BX
POP AX
First AX is equal to 51h and BX to 4Fh, than the 2 get exchanged. Now we got
AX = 4Fh and BX = 51h. AX gets pushed on the stack, then set to 34h:
AX = 34h and BX = 51h. BX gets poped, than pushed:
AX = 34h and BX = 4Fh. Finally AX gets poped. So the final result is:
AX = 4Fh and BX = 4Fh"
Can someone please explain why AX= 4Fh and not 34h?? That's the last value that was copied to it.