In: Computer Science
If this program below has an initial Stack Pointer value of (ESP=2000 2090h), what is the value of the Stack Pointer (ESP) after the last instruction (pop ax) is finished.
mov bx, 09h
mov ax, 0h
push bx
pop ax
Question 3 options:
ESP = 2000 2094h |
|
ESP = 2000 2090h |
|
ESP = 2000 2092h |
|
ESP = 2000 208Eh |
EXPLANATION:
INSTRUCTIONS:
mov bx, 09h ; Moving the 09h value in b register , (ESP=2000 2090h)
mov ax, 0h ; Moving the 0h value in a register , (ESP=2000 2090h)
push bx ; Pushing b register value in Stack Pointer , (ESP=2000 208Eh)
pop ax ; Popping the 2 bytes values from Stack to a register, (ESP=2000 2090h)
ANSWER:
Hence the value of the Stack Pointer (ESP) after the last instruction (pop ax) is finished will be ESP=2000 2090h