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 20052.3 Summary of Registers and Data TypesThis section summarizes the registers available to softwareusing the five instruction subsets described in “InstructionSubsets” on page 27. For details on the organization and use ofthese registers, see their respective chapters in volumes 1 and 2.2.3.1 General-PurposeInstructionsRegisters. The size and number of general-purpose registers(GPRs) depends on the operating mode, as do the size of theflags and instruction-pointer registers. Figure 2-2 shows theregisters available in legacy and compatibility modes.registerencodinghigh8-bitlow8-bit16-bit32-bit0AH (4)ALAXEAX3BH (7)BLBXEBX1CH (5)CLCXECX2DH (6)DLDXEDX6SISIESI7DIDIEDI5BPBPEBP4SPSPESP31 16 15 0FLAGSIP31 0FLAGSIPEFLAGSEIP513-311.epsFigure 2-2.General Registers in Legacy and Compatibility ModesFigure 2-3 on page 31 shows the registers accessible in 64-bitmode. Compared with legacy mode, registers become 64 bitswide, eight new data registers (R8–R15) are added and the lowbyte of all 16 GPRs is available for byte operations, and the fourhigh-byte registers of legacy mode (AH, BH, CH, and DH) arenot available if the REX prefix is used. The high 32 bits of30 Chapter 2: Instruction Overview
24594 Rev. 3.10 February 2005 AMD64 Technologydoubleword operands are zero-extended to 64 bits, but the highbits of word and byte operands are not modified by operationsin 64-bit mode. The RFLAGS register is 64 bits wide, but thehigh 32 bits are reserved. They can be written with anything butthey read as zeros (RAZ).not modified for 8-bit operandsnot modified for 16-bit operandsregisterencodingzero-extendedfor 32-bit operandslow8-bit16-bit 32-bit 64-bit0AH*ALAXEAXRAX3BH*BLBXEBXRBX1CH*CLCXECXRCX2DH*DLDXEDXRDX6SIL**SIESIRSI7DIL**DIEDIRDI5BPL**BPEBPRBP4SPL**SPESPRSP8R8BR8WR8DR89R9BR9WR9DR910R10BR10WR10DR1011R11BR11WR11DR1112R12BR12WR12DR1213R13BR13WR13DR1314R14BR14WR14DR1415R15BR15WR15DR1563 32 31 16 15 8 7 0Figure 2-3.063 32 31 0General Registers in 64-Bit ModeRFLAGSRIP513-309.eps* Not addressable whena REX prefix is used.** Only addressable whena REX prefix is used.Chapter 2: Instruction Overview 31
- Page 12 and 13: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 14 and 15: AMD64 Technology 24594—Rev. 3.10
- Page 16 and 17: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 18 and 19: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 20 and 21: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 22 and 23: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 24 and 25: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 26 and 27: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 28 and 29: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 30 and 31: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 32 and 33: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 34 and 35: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 36 and 37: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 38 and 39: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 40 and 41: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 42 and 43: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 44 and 45: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 46 and 47: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 48 and 49: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 50 and 51: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 52 and 53: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 54 and 55: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 56 and 57: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 58 and 59: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 62 and 63: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 64 and 65: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 66 and 67: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 68 and 69: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 70 and 71: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 72 and 73: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 74 and 75: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 76 and 77: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 78 and 79: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 80 and 81: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 82 and 83: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 84 and 85: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 86 and 87: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 88 and 89: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 90 and 91: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 92 and 93: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 94 and 95: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 96 and 97: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 98 and 99: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 100 and 101: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 102 and 103: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 104 and 105: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 106 and 107: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 108 and 109: AMD64 Technology 24594 Rev. 3.10 Fe
AMD64 Technology 24594 Rev. 3.10 February 20052.3 Summary of Registers <strong>and</strong> Data TypesThis section summarizes the registers available to softwareusing the five instruction subsets described in “InstructionSubsets” on page 27. For details on the organization <strong>and</strong> use ofthese registers, see their respective chapters in volumes 1 <strong>and</strong> 2.2.3.1 <strong>General</strong>-<strong>Purpose</strong><strong>Instructions</strong>Registers. The size <strong>and</strong> number of general-purpose registers(GPRs) depends on the operating mode, as do the size of theflags <strong>and</strong> instruction-pointer registers. Figure 2-2 shows theregisters available in legacy <strong>and</strong> compatibility modes.registerencodinghigh8-bitlow8-bit16-bit32-bit0AH (4)ALAXEAX3BH (7)BLBXEBX1CH (5)CLCXECX2DH (6)DLDXEDX6SISIESI7DIDIEDI5BPBPEBP4SPSPESP31 16 15 0FLAGSIP31 0FLAGSIPEFLAGSEIP513-311.epsFigure 2-2.<strong>General</strong> Registers in Legacy <strong>and</strong> Compatibility ModesFigure 2-3 on page 31 shows the registers accessible in 64-bitmode. Compared with legacy mode, registers become 64 bitswide, eight new data registers (R8–R15) are added <strong>and</strong> the lowbyte of all 16 GPRs is available for byte operations, <strong>and</strong> the fourhigh-byte registers of legacy mode (AH, BH, CH, <strong>and</strong> DH) arenot available if the REX prefix is used. The high 32 bits of30 Chapter 2: Instruction Overview