<<< The Stack Segment and .STACK directive | Index | ESP register >>> |
The PUSH instruction stores its operand on the stack.
The POP instruction retrieves the most recent pushed value.
ESP register always points to the top of the stack.
The PUSH and POP instructions use the ESP register to keep track of the current position.
The operand can be a register 16, a register 32, a segment register, a word in memory, a doubleword in memory, an immediate byte, an immediate word, or an immediate doubleword.
It is impossible to push an 8-bit item onto the stack.
When an immediate byte-size operand is pushed, multiple bytes are pushed on the stack accordingly to the current mode:
In 16-bit modes stack items are WORD-size (2 bytes) at address SS:SP.
In 32-bit modes the top of the stack is the DWORD addressed by [ ESP ].
Execution of PUSH AX instruction:
<<< The Stack Segment and .STACK directive | Index | ESP register >>> |