<<< Saving Flags on the Stack | Index | >>> |
PUSHA and POPA instructions push or pop all 16-bit general-purpose registers with only one instruction.
These instructions save the status of all registers before a procedure call and restore them after the return.
Using PUSHA and POPA is significantly faster and takes fewer bytes of code than pushing and popping each register individually.
The processor pushes the registers in the following order: AX, CX, DX, BX, SP, BP, SI, and DI. The SP word pushed is the value before the first register is pushed.
The processor pops the registers in the opposite order.
The 32-bit versions of these instructions are PUSHAD and POPAD.
Order of registers pushed with PUSHA and PUSHAD instructions:
Order of registers popped with POPA and POPAD instructions
Loading all GP registers with POPA
<<< Saving Flags on the Stack | Index | >>> |