I read the x86 instruction reference. It is clear to me that pusha
will decrement sp by 16. But it sounds like popa will increment sp by
only 14. Is that correct?
The text of the reference for popa says:size
Pops doublewords (POPAD) or words (POPA) from the stack into the general-purpose registers. The registers are loaded in the following
order: EDI, ESI, EBP, EBX, EDX, ECX, and EAX (if the operand-size
attribute is 32) and DI, SI, BP, BX, DX, CX, and AX (if the operand-
attribute is 16). (These instructions reverse the operation of the PUSHA/PUSHAD instructions.) The value on the stack for the ESP or SP
register is ignored. Instead, the ESP or SP register is incremented
after each register is loaded.
I read the x86 instruction reference. It is clear to me that pusha
will decrement sp by 16. But it sounds like popa will increment sp by
only 14. Is that correct?
The text of the reference for popa says:
Pops doublewords (POPAD) or words (POPA) from the stack into the general-purpose registers. The registers are loaded in the following
order: EDI, ESI, EBP, EBX, EDX, ECX, and EAX (if the operand-size
attribute is 32) and DI, SI, BP, BX, DX, CX, and AX (if the operand-size attribute is 16). (These instructions reverse the operation of the PUSHA/PUSHAD instructions.) The value on the stack for the ESP or SP
register is ignored.
Instead, the ESP or SP register is incremented
after each register is loaded.
I read the x86 instruction reference. It is clear to me that pusha
will decrement sp by 16. But it sounds like popa will increment sp by
only 14. Is that correct?
The text of the reference for popa says:
Pops doublewords (POPAD) or words (POPA) from the stack into the general-purpose registers. The registers are loaded in the following
order: EDI, ESI, EBP, EBX, EDX, ECX, and EAX (if the operand-size
attribute is 32) and DI, SI, BP, BX, DX, CX, and AX (if the
operand-size attribute is 16). (These instructions reverse the
operation of the PUSHA/PUSHAD instructions.) The value on the stack
for the ESP or SP register is ignored. Instead, the ESP or SP
register is incremented after each register is loaded.
I read the x86 instruction reference. It is clear to me that pusha
will decrement sp by 16. But it sounds like popa will increment sp by
only 14. Is that correct?
The text of the reference for popa says:
Pops doublewords (POPAD) or words (POPA) from the stack into the general-purpose registers. The registers are loaded in the following
order: EDI, ESI, EBP, EBX, EDX, ECX, and EAX (if the operand-size
attribute is 32) and DI, SI, BP, BX, DX, CX, and AX (if the operand-size attribute is 16). (These instructions reverse the operation of the PUSHA/PUSHAD instructions.) The value on the stack for the ESP or SP
register is ignored. Instead, the ESP or SP register is incremented
after each register is loaded.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 294 |
Nodes: | 16 (2 / 14) |
Uptime: | 244:08:52 |
Calls: | 6,626 |
Calls today: | 2 |
Files: | 12,175 |
Messages: | 5,320,335 |