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.

AMD64 Technology 24594 Rev. 3.10 February 2005PUSHPush onto StackDecrements the stack pointer <strong>and</strong> then copies the specified immediate value or thevalue in the specified register or memory location to the top of the stack (the memorylocation pointed to by SS:rSP).The oper<strong>and</strong>-size attribute determines the number of bytes pushed to the stack. Thestack-size attribute determines whether SP, ESP, or RSP is the stack pointer. Theaddress-size attribute is used only to locate the memory oper<strong>and</strong> when pushing amemory oper<strong>and</strong> to the stack.If the instruction pushes the stack pointer (rSP), the resulting value on the stack isthat of rSP before execution of the instruction.There is a PUSH CS instruction but no corresponding POP CS. The RET (Far)instruction pops a value from the top of stack into the CS register as part of itsoperation.In 64-bit mode, the oper<strong>and</strong> size of all PUSH instructions defaults to 64 bits, <strong>and</strong> thereis no prefix available to encode a 32-bit oper<strong>and</strong> size. Using the PUSH CS, PUSH DS,PUSH ES, or PUSH SS instructions in 64-bit mode generates an invalid-opcodeexception.Pushing an odd number of 16-bit oper<strong>and</strong>s when the stack address-size attribute is 32results in a misaligned stack pointer.Mnemonic Opcode DescriptionPUSH reg/mem16 FF /6PUSH reg/mem32 FF /6PUSH reg/mem64 FF /6Push the contents of a 16-bit register or memory oper<strong>and</strong> ontothe stack.Push the contents of a 32-bit register or memory oper<strong>and</strong> ontothe stack. (No prefix for encoding this in 64-bit mode.)Push the contents of a 64-bit register or memory oper<strong>and</strong> ontothe stack.PUSH reg16 50 +rw Push the contents of a 16-bit register onto the stack.PUSH reg3250 +rdPush the contents of a 32-bit register onto the stack. (No prefixfor encoding this in 64-bit mode.)PUSH reg64 50 +rq Push the contents of a 64-bit register onto the stack.PUSH imm86APush an 8-bit immediate value (sign-extended to 16, 32, or 64bits) onto the stack.234 PUSH

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

Saved successfully!

Ooh no, something went wrong!