Volume 3: General-Purpose and System Instructions - Stanford ...
Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...
AMD64 Technology 24594 Rev. 3.10 February 2005PUSHAxPUSHADPush All GPRs onto StackPushes the contents of the eAX, eCX, eDX, eBX, eSP (original value), eBP, eSI, andeDI general-purpose registers onto the stack in that order. This instruction decrementsthe stack pointer by 16 or 32 depending on operand size.Using the PUSHA or PUSHAD instruction in 64-bit mode generates an invalid-opcodeexception.Mnemonic Opcode DescriptionPUSHA 60PUSHAD 60Push the contents of the AX, CX, DX, BX, original SP, BP, SI, andDI registers onto the stack.(Invalid in 64-bit mode.)Push the contents of the EAX, ECX, EDX, EBX, original ESP, EBP,ESI, and EDI registers onto the stack.(Invalid in 64-bit mode.)Related InstructionsPOPA, POPADrFLAGS AffectedNoneExceptionsException RealVirtual8086 Protected Cause of ExceptionInvalid opcode, #UD X This instruction was executed in 64-bit mode.Stack, #SS X X X A memory address exceeded the stack segment limit.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference was performed while alignmentchecking was enabled.236 PUSHAx
24594 Rev. 3.10 February 2005 AMD64 TechnologyPUSHFxPUSHFDPUSHFQPush rFLAGS onto StackDecrements the rSP register and copies the rFLAGS register (except for the VM andRF flags) onto the stack. The instruction clears the VM and RF flags in the rFLAGSimage before putting it on the stack.The instruction pushes 2, 4, or 8 bytes, depending on the operand size.In 64-bit mode, this instruction defaults to a 64-bit operand size and there is no prefixavailable to encode a 32-bit operand size.In virtual-8086 mode, if system software has set the IOPL field to a value less than 3, ageneral-protection exception occurs if application software attempts to executePUSHFx or POPFx while VME is not enabled or the operand size is not 16-bit.Mnemonic Opcode DescriptionPUSHF 9C Push the FLAGS word onto the stack.PUSHFDAction// See “Pseudocode Definitions” on page 49.PUSHF_START:IF (REAL_MODE)PUSHF_REALELSIF (PROTECTED_MODE)PUSHF_PROTECTEDELSE // (VIRTUAL_MODE)PUSHF_VIRTUAL9CPush the EFLAGS doubleword onto stack. (No prefix encodingthis in 64-bit mode.)PUSHFQ 9C Push the RFLAGS quadword onto stack.PUSHF_REAL:PUSH.v old_RFLAGSEXITPUSHF_PROTECTED:PUSH.v old_RFLAGSEXIT// Pushed with RF and VM cleared.// Pushed with RF cleared.PUSHFx 237
- Page 216 and 217: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 218 and 219: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 220 and 221: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 222 and 223: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 224 and 225: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 226 and 227: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 228 and 229: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 230 and 231: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 232 and 233: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 234 and 235: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 236 and 237: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 238 and 239: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 240 and 241: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 242 and 243: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 244 and 245: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 246 and 247: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 248 and 249: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 250 and 251: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 252 and 253: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 254 and 255: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 256 and 257: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 258 and 259: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 260 and 261: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 262 and 263: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 264 and 265: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 268 and 269: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 270 and 271: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 272 and 273: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 274 and 275: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 276 and 277: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 278 and 279: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 280 and 281: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 282 and 283: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 284 and 285: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 286 and 287: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 288 and 289: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 290 and 291: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 292 and 293: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 294 and 295: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 296 and 297: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 298 and 299: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 300 and 301: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 302 and 303: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 304 and 305: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 306 and 307: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 308 and 309: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 310 and 311: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 312 and 313: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 314 and 315: AMD64 Technology 24594 Rev. 3.10 Fe
AMD64 Technology 24594 Rev. 3.10 February 2005PUSHAxPUSHADPush All GPRs onto StackPushes the contents of the eAX, eCX, eDX, eBX, eSP (original value), eBP, eSI, <strong>and</strong>eDI general-purpose registers onto the stack in that order. This instruction decrementsthe stack pointer by 16 or 32 depending on oper<strong>and</strong> size.Using the PUSHA or PUSHAD instruction in 64-bit mode generates an invalid-opcodeexception.Mnemonic Opcode DescriptionPUSHA 60PUSHAD 60Push the contents of the AX, CX, DX, BX, original SP, BP, SI, <strong>and</strong>DI registers onto the stack.(Invalid in 64-bit mode.)Push the contents of the EAX, ECX, EDX, EBX, original ESP, EBP,ESI, <strong>and</strong> EDI registers onto the stack.(Invalid in 64-bit mode.)Related <strong>Instructions</strong>POPA, POPADrFLAGS AffectedNoneExceptionsException RealVirtual8086 Protected Cause of ExceptionInvalid opcode, #UD X This instruction was executed in 64-bit mode.Stack, #SS X X X A memory address exceeded the stack segment limit.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference was performed while alignmentchecking was enabled.236 PUSHAx