13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyPOPPop StackCopies the value pointed to by the stack pointer (SS:rSP) to the specified register ormemory location <strong>and</strong> then increments the rSP by 2 for a 16-bit pop, 4 for a 32-bit pop,or 8 for a 64-bit pop.The oper<strong>and</strong>-size attribute determines the amount by which the stack pointer isincremented (2,4 or 8 bytes). The stack-size attribute determines whether SP, ESP, orRSP is incremented.For forms of the instruction that load a segment register (POP DS, POP ES, POP FS,POP GS, POP SS), the source oper<strong>and</strong> must be a valid segment selector. When asegment selector is popped into a segment register, the processor also loads allassociated descriptor information into the hidden part of the register <strong>and</strong> validates it.It is possible to pop a null segment selector value (0000–0003h) into the DS, ES, FS, orGS register. This action does not cause a general protection fault, but a subsequentreference to such a segment does cause a #GP exception. For more information aboutsegment selectors, see “Segment Selectors <strong>and</strong> Registers” on page 82.In 64-bit mode, the POP oper<strong>and</strong> size defaults to 64 bits <strong>and</strong> there is no prefixavailable to encode a 32-bit oper<strong>and</strong> size. Using POP DS, POP ES, or POP SSinstruction in 64-bit mode generates an invalid-opcode exception.This instruction cannot pop a value into the CS register. The RET (Far) instructionperforms this function.Mnemonic Opcode DescriptionPOP reg/mem16 8F /0 Pop the top of the stack into a 16-bit register or memory location.POP reg/mem32 8F /0Pop the top of the stack into a 32-bit register or memory location.(No prefix for encoding this in 64-bit mode.)POP reg/mem64 8F /0 Pop the top of the stack into a 64-bit register or memory location.POP reg16 58 +rw Pop the top of the stack into a 16-bit register.POP reg3258 +rdPop the top of the stack into a 32-bit register.(No prefix for encoding this in 64-bit mode.)POP reg64 58 +rq Pop the top of the stack into a 64-bit register.POP DS1FPop the top of the stack into the DS register.(Invalid in 64-bit mode.)POP 223

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!