13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyA.2.4 ModRMExtensions to One-Byte <strong>and</strong> Two-ByteOpcodesThe ModRM byte, which immediately follows the last opcodebyte, is used in certain instruction encodings to provideadditional opcode bits with which to define the function of theinstruction. ModRM bytes have three fields—mod, reg, <strong>and</strong> r/m,as shown in Figure A-1.Bits:7 6 5 4 3 2 1 0mod reg r/m ModRM513-325.epsFigure A-1.ModRM-Byte FieldsIn most cases, the reg field (bits 5–3) provides the additionalbits with which to extend the encodings of the first one or twoopcode bytes. In the case of the x87 floating-point instructions,the entire ModRM byte is used to extend the opcode encodings.Table A-6 on page 388 shows how the ModRM reg field is used toextend the range of one-byte <strong>and</strong> two-byte opcodes. The opcoderanges are organized into groups of opcode extensions. Thegroup number is shown in the left-most column of Table A-6.These groups are referenced in the opcodes shown in Table A-1on page 378 through Table A-4 on page 383. An entry of “n.a.”in the Prefix column means that prefixes are not applicable tothe opcodes in that row. Prefixes only apply to certain 128-bitmedia, 64-bit media, <strong>and</strong> a few other instructions introducedwith the SSE or SSE2 technologies.The /0 through /7 notation for the ModRM reg field (bits 5–3)means that the three-bit field contains a value from zero (binary000) to 7 (binary 111).Appendix A: Opcode <strong>and</strong> Oper<strong>and</strong> Encodings 387

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

Saved successfully!

Ooh no, something went wrong!