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

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

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005Mnemonic Opcode DescriptionOUTSBOUTSWOUTSDRelated InstructionsIN, INSx, OUTrFLAGS AffectedNoneExceptions6E6F6FOutput the byte in DS:rSI to the port specified in DX, thenincrement or decrement rSI.Output the word in DS:rSI to the port specified in DX, thenincrement or decrement rSI.Output the doubleword in DS:rSI to the port specified in DX, thenincrement or decrement rSI.Exception RealVirtual8086 Protected Cause of ExceptionStack, #SS X X X A memory address exceeded the stack segment limit or was noncanonical.General protection,#GPXXXA memory address exceeded a data segment limit or was non-canonical.XA null data segment was used to reference memory.XOne or more I/O permission bits were set in the TSS for the accessedport.X The CPL was greater than the IOPL and one or more I/O permissionbits were set in the TSS for the accessed port.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference is performed while alignmentchecking was enabled.222 OUTSx

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 and 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 operand-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 operand 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 and 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 and Registers” on page 82.In 64-bit mode, the POP operand size defaults to 64 bits and there is no prefixavailable to encode a 32-bit operand 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

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!