<<< POP Pop Top of Stack into Operand     Index     POPF Pop Top of Stack into Flags >>>


POPA Pop All 16-Bit Registers (286+)

Flags affected:

        O D I T S Z A P C  OF: Overflow flag  TF: Trap flag AF: Aux carry
        F F F F F F F F F  DF: Direction flag SF: Sign flag PF: Parity flag
             <none>        IF: Interrupt flag ZF: Zero flag CF: Carry flag

Legal forms:

        POPA

Examples:

        POPA

Notes:

PUSHA pushes all 16-bit general-purpose registers onto the stack. This instruction is present on the 286 and later CPUs and is not available in the 8086/8088.

The 16-bit general-purpose registers are popped in this order:

  • DI, SI, BP, SP, BX, DX, CX, AX

There's one wrinkle here: The SP value popped off the stack is not popped back into SP! (That would be insane, since we're using SP to manage the stack as we pop values off of it.) The value in SP's position on the stack is simply discarded when instruction execution reaches it.

POPA is usually used in conjunction with PUSHA, but nothing guarantees this. If you pop garbage values off the stack into the general registers, well, interesting things (in the sense of the old Chinese curse) can and probably will happen.

        r8 = AL AH BL BH CL CH DL DH        r16 = AX BX CX DX BP SP SI DI
        sr = CS DS SS ES FS GS              r32 = EAX EBX ECX EDX EBP ESP ESI EDI
        m8 = 8-bit memory data              m16 = 16-bit memory data
        m32 = 32-bit memory data            i8 = 8-bit immediate data
        i16 = 16-bit immediate data         i32 = 32-bit immediate data
        d8 = 8-bit signed displacement      d16 = 16-bit signed displacement
        d32 = 32-bit unsigned displacement


<<< POP Pop Top of Stack into Operand     Index     POPF Pop Top of Stack into Flags >>>