Slide 10.2: The runtime stack Slide 10.4: Other push and pop instructions Home |
PUSH
and POP
Instructions
PUSH
instruction first decrements ESP
and then copies either a 16- or 32- bit source operand into the stack.
A 16-bit operand causes ESP
to be decremented by 2.
A 32-bit operand causes ESP
to be decremented by 4.
PUSH — Push Word(s) onto Stack |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
POP
instruction removes a value from the stack and places it in a register or variable. After the value is popped from the stack, the stack pointer is incremented to point to the next-highest location in the stack.
POP — Push Word(s) off Stack |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|