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 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
- Page 388 and 389: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 390 and 391: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 392 and 393: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 394 and 395: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 396 and 397: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 398 and 399: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 400 and 401: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 402 and 403: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 404 and 405: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 406 and 407: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 408 and 409: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 410 and 411: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 412 and 413: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 414 and 415: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 416 and 417: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 418 and 419: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 420 and 421: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 422 and 423: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 424 and 425: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 426 and 427: AMD64 Technology 24594 Rev. 3.10 Fe
- 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 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 478 and 479: 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
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