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 2005Table A-15.ModRM Memory References, 32-Bit and 64-Bit Addressing (continued)ModRMEffective Address 1ModRM reg Field 3modField/0 /1 /2 /3 /4 /5 /6 /7REX.B = 0 REX.B = 1 (binary) Complete ModRM Byte (hex)AL/rAX/MMX0/XMM0r8/MMX0/XMM8ModRMr/mField(binary)C0 C8 D0 D8 E0 E8 F0 F8 000CL/rCX/MMX1/XMM1 r9/MMX1/XMM9 C1 C9 D1 D9 E1 E9 F1 F9 001DL/rDX/MMX2/XMM2 r10/MMX2/XMM10 C2 CA D2 DA E2 EA F2 FA 010BL/rBX/MMX3/XMM3 r11/MMX3/XMM11 C3 CB D3 DB E3 EB F3 FB 01111AH/SPL/rSP/MMX4/XMM4 r12/MMX4/XMM12 C4 CC D4 DC E4 EC F4 FC 100CH/BPL/rBP/MMX5/XMM5 r13/MMX5/XMM13 C5 CD D5 DD E5 ED F5 FD 101DH/SIL/rSI/MMX6/XMM6 r14/MMX6/XMM14 C6 CE D6 DE E6 EE F6 FE 110BH/DIL/rDI/MMX7/XMM7 r15/MMX7/XMM15 C7 CF D7 DF E7 EF F7 FF 111Note:1. In these combinations, “disp8” and “disp32” indicate an 8-bit or 32-bit signed displacement.2. In 64-bit mode, the effective address is [RIP+disp32]. In all other modes, the effective address is [disp32]. If the address-size prefixis used in 64-bit mode to override 64-bit addressing, the [RIP+disp32] effective address is truncated after computation to 64 bits.3. See Table A-14 for complete specification of ModRM “reg” field.4. An SIB byte follows the ModRM byte to identify the memory operand.A.3.2 SIB OperandReferencesFigure A-3 on page 409 shows the format of a scale-index-base(SIB) byte. Some instructions have an SIB byte following theirModRM byte to define memory addressing for the complexaddressingmodes described in “Effective Addresses” inVolume 1. The SIB byte has three fields—scale, index, andbase—that define the scale factor, index-register number, andbase-register number for 32-bit and 64-bit complex addressingmodes. In 64-bit mode, the REX.B and REX.X bits extend theencoding of the SIB byte’s base and index fields.408 Appendix A: Opcode and Operand Encodings

24594 Rev. 3.10 February 2005 AMD64 TechnologyBits:7 6 5 4 3 2 1 0scale index base SIBREX.X bit of REX prefix canextend this field to 4 bitsREX.B bit of REX prefix canextend this field to 4 bits513-306.epsFigure A-3.SIB Byte FormatTable A-16.REX.B Bit01Table A-16 shows the encodings for the SIB byte’s base field,which specifies the base register for addressing. Table A-17 onpage 410 shows the encodings for the effective addressreferenced by a complete SIB byte, including its scale and indexfields. The /0 through /7 notation for the SIB base field meansthat the three-bit field contains a value between zero (binary000) and 7 (binary 111).SIB base Field ReferencesModRM mod Field00SIB base Field/0 /1 /2 /3 /4 /5 /6 /7disp3201 rAX rCX rDX rBX rSP rBP+disp810 rBP+disp3200disp3201 r8 r9 r10 r11 r12 r13+disp810 r13+disp32rSIr14rDIr15Appendix A: Opcode and Operand Encodings 409

AMD64 Technology 24594 Rev. 3.10 February 2005Table A-15.ModRM Memory References, 32-Bit <strong>and</strong> 64-Bit Addressing (continued)ModRMEffective Address 1ModRM reg Field 3modField/0 /1 /2 /3 /4 /5 /6 /7REX.B = 0 REX.B = 1 (binary) Complete ModRM Byte (hex)AL/rAX/MMX0/XMM0r8/MMX0/XMM8ModRMr/mField(binary)C0 C8 D0 D8 E0 E8 F0 F8 000CL/rCX/MMX1/XMM1 r9/MMX1/XMM9 C1 C9 D1 D9 E1 E9 F1 F9 001DL/rDX/MMX2/XMM2 r10/MMX2/XMM10 C2 CA D2 DA E2 EA F2 FA 010BL/rBX/MMX3/XMM3 r11/MMX3/XMM11 C3 CB D3 DB E3 EB F3 FB 01111AH/SPL/rSP/MMX4/XMM4 r12/MMX4/XMM12 C4 CC D4 DC E4 EC F4 FC 100CH/BPL/rBP/MMX5/XMM5 r13/MMX5/XMM13 C5 CD D5 DD E5 ED F5 FD 101DH/SIL/rSI/MMX6/XMM6 r14/MMX6/XMM14 C6 CE D6 DE E6 EE F6 FE 110BH/DIL/rDI/MMX7/XMM7 r15/MMX7/XMM15 C7 CF D7 DF E7 EF F7 FF 111Note:1. In these combinations, “disp8” <strong>and</strong> “disp32” indicate an 8-bit or 32-bit signed displacement.2. In 64-bit mode, the effective address is [RIP+disp32]. In all other modes, the effective address is [disp32]. If the address-size prefixis used in 64-bit mode to override 64-bit addressing, the [RIP+disp32] effective address is truncated after computation to 64 bits.3. See Table A-14 for complete specification of ModRM “reg” field.4. An SIB byte follows the ModRM byte to identify the memory oper<strong>and</strong>.A.3.2 SIB Oper<strong>and</strong>ReferencesFigure A-3 on page 409 shows the format of a scale-index-base(SIB) byte. Some instructions have an SIB byte following theirModRM byte to define memory addressing for the complexaddressingmodes described in “Effective Addresses” in<strong>Volume</strong> 1. The SIB byte has three fields—scale, index, <strong>and</strong>base—that define the scale factor, index-register number, <strong>and</strong>base-register number for 32-bit <strong>and</strong> 64-bit complex addressingmodes. In 64-bit mode, the REX.B <strong>and</strong> REX.X bits extend theencoding of the SIB byte’s base <strong>and</strong> index fields.408 Appendix A: Opcode <strong>and</strong> Oper<strong>and</strong> Encodings

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

Saved successfully!

Ooh no, something went wrong!