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 2005Table B-5.Instructions Defaulting to 64-Bit Operand Size (continued)MnemonicThe 64-bit default operand size can be overridden to 16 bitsusing the 66h operand-size override. However, it is not possibleto override the operand size to 32 bits because there is no 32-bitoperand-size override prefix for 64-bit mode. See “Operand-Size Override Prefix” on page 5 for details.B.5 Single-Byte INC and DEC Instructions in 64-Bit ModeB.6 NOP in 64-Bit ModePUSH GS 0F A8 yesPUSHF, PUSHFD,PUSHFQOpcode(hex)9CImplicitlyReferenceRSPPush GS Segment Register ontoStackIn 64-bit mode, the legacy encodings for the 16 single-byte INCand DEC instructions (one for each of the eight GPRs) are usedto encode the REX prefix values, as described in “REXPrefixes” on page 14. Therefore, these single-byte opcodes forINC and DEC are not available in 64-bit mode, although theyare available in legacy and compatibility modes. Thefunctionality of these INC and DEC instructions is stillavailable in 64-bit mode, however, using the ModRM forms ofthose instructions (opcodes FF/0 and FF/1).Programs written for the legacy x86 architecture commonly useopcode 90h (the XCHG EAX, EAX instruction) as a one-byteNOP. In 64-bit mode, the processor treats opcode 90h speciallyin order to preserve this legacy NOP use. Without specialhandling in 64-bit mode, the instruction would not be a true nooperation.Therefore, in 64-bit mode the processor treats XCHGEAX, EAX as a true NOP, regardless of operand size.This special handling does not apply to the two-byte ModRMform of the XCHG instruction. Unless a 64-bit operand size isspecified using a REX prefix byte, using the two byte form of448 Appendix B: General-Purpose Instructions in 64-Bit ModeyesDescriptionPush rFLAGS Word,Doubleword, or Quadwordonto StackRET C2, C3 yes Return From Call (near)
24594 Rev. 3.10 February 2005 AMD64 TechnologyXCHG to exchange a register with itself will not result in a nooperationbecause the default operation size is 32 bits in 64-bitmode.B.7 Segment Override Prefixes in 64-Bit ModeIn 64-bit mode, the CS, DS, ES, SS segment-override prefixeshave no effect. These four prefixes are no longer treated assegment-override prefixes in the context of multiple-prefixrules. Instead, they are treated as null prefixes.The FS and GS segment-override prefixes are treated as truesegment-override prefixes in 64-bit mode. Use of the FS and GSprefixes cause their respective segment bases to be added tothe effective address calculation. See “FS and GS Registers in64-Bit Mode” in Volume 2 for details.Appendix B: General-Purpose Instructions in 64-Bit Mode 449
- Page 428 and 429: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 430 and 431: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 432 and 433: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 434 and 435: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 436 and 437: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 438 and 439: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 440 and 441: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 442 and 443: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 444 and 445: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 446 and 447: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 448 and 449: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 450 and 451: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 452 and 453: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 454 and 455: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 456 and 457: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 458 and 459: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 460 and 461: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 462 and 463: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 464 and 465: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 466 and 467: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 468 and 469: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 470 and 471: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 472 and 473: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 474 and 475: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 476 and 477: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 480 and 481: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 482 and 483: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 484 and 485: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 486 and 487: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 488 and 489: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 490 and 491: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 492 and 493: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 494 and 495: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 496 and 497: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 498 and 499: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 500 and 501: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 502 and 503: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 504 and 505: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 506 and 507: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 508 and 509: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 510 and 511: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 512 and 513: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 514 and 515: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 516 and 517: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 518 and 519: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 520 and 521: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 522 and 523: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 524 and 525: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 526 and 527: AMD64 Technology 24594 Rev. 3.10 Fe
AMD64 Technology 24594 Rev. 3.10 February 2005Table B-5.<strong>Instructions</strong> Defaulting to 64-Bit Oper<strong>and</strong> Size (continued)MnemonicThe 64-bit default oper<strong>and</strong> size can be overridden to 16 bitsusing the 66h oper<strong>and</strong>-size override. However, it is not possibleto override the oper<strong>and</strong> size to 32 bits because there is no 32-bitoper<strong>and</strong>-size override prefix for 64-bit mode. See “Oper<strong>and</strong>-Size Override Prefix” on page 5 for details.B.5 Single-Byte INC <strong>and</strong> DEC <strong>Instructions</strong> in 64-Bit ModeB.6 NOP in 64-Bit ModePUSH GS 0F A8 yesPUSHF, PUSHFD,PUSHFQOpcode(hex)9CImplicitlyReferenceRSPPush GS Segment Register ontoStackIn 64-bit mode, the legacy encodings for the 16 single-byte INC<strong>and</strong> DEC instructions (one for each of the eight GPRs) are usedto encode the REX prefix values, as described in “REXPrefixes” on page 14. Therefore, these single-byte opcodes forINC <strong>and</strong> DEC are not available in 64-bit mode, although theyare available in legacy <strong>and</strong> compatibility modes. Thefunctionality of these INC <strong>and</strong> DEC instructions is stillavailable in 64-bit mode, however, using the ModRM forms ofthose instructions (opcodes FF/0 <strong>and</strong> FF/1).Programs written for the legacy x86 architecture commonly useopcode 90h (the XCHG EAX, EAX instruction) as a one-byteNOP. In 64-bit mode, the processor treats opcode 90h speciallyin order to preserve this legacy NOP use. Without specialh<strong>and</strong>ling in 64-bit mode, the instruction would not be a true nooperation.Therefore, in 64-bit mode the processor treats XCHGEAX, EAX as a true NOP, regardless of oper<strong>and</strong> size.This special h<strong>and</strong>ling does not apply to the two-byte ModRMform of the XCHG instruction. Unless a 64-bit oper<strong>and</strong> size isspecified using a REX prefix byte, using the two byte form of448 Appendix B: <strong>General</strong>-<strong>Purpose</strong> <strong>Instructions</strong> in 64-Bit ModeyesDescriptionPush rFLAGS Word,Doubleword, or Quadwordonto StackRET C2, C3 yes Return From Call (near)