pop

8086 and later

Pop a Value from the Stack

pop es | pop cs | pop ss | pop ds | pop fs | pop gs | pop reg16 | pop reg32 | pop reg64 | pop r/m16 | pop r/m32 | pop r/m64 | pop reg64, reg64 | pop reg64:reg64

POP loads a value from the stack (from [SS:SP] or [SS:ESP]) and then increments the stack pointer.

The address-size attribute of the instruction determines whether SP or ESP is used as the stack pointer: to deliberately override the default given by the BITS setting, you can use an a16 or a32 prefix.

The operand-size attribute of the instruction determines whether the stack pointer is incremented by 2 or 4: this means that segment register pops in BITS 32 mode will pop 4 bytes off the stack and discard the upper two of them. If you need to override that, you can use an o16 or o32 prefix.

The above opcode listings give two forms for general-purpose register pop instructions: for example, POP BX has the two forms 5B and 8F C3. NASM will always generate the shorter form when given POP BX. NDISASM will disassemble both.

POP CS is not a documented instruction, and is not supported on any processor above the 8086 (since they use 0Fh as an opcode prefix for instruction set extensions). However, at least some 8086 processors do support it, and so NASM generates it for completeness.

Loading...

Forms

Every form of pop the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
pop es8086nolong
pop cs8086nolongundocobsolete
pop ss8086nolong
pop ds8086nolong
pop fs386
pop gs386
pop reg168086
pop reg32386
pop reg64x86-64long
pop r/m168086
pop r/m32386
pop r/m64x86-64long
pop reg64, reg64x86-64apxlong
pop reg64:reg64x86-64apxlong