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 TechnologyTable 1-12.Special REX Encodings for RegistersModRM <strong>and</strong> SIBEncodings 2Meaning in Legacy <strong>and</strong>Compatibility ModesImplications in Legacy<strong>and</strong> Compatibility ModesAdditional REXImplicationsModRM Byte:• mod≠ 11• r/m 1 = 100 (ESP)SIB byte is present.SIB byte is required forESP-based addressing.REX prefix adds a fourth bit(b), which is decoded <strong>and</strong>modifies the base registerin the SIB byte. Therefore,the SIB byte is alsorequired for R12-basedaddressing.ModRM Byte:• mod =00• r/m 1 =x101 (EBP)Base register is not used.Using EBP without adisplacement must bedone by setting mod = 01with a displacement of 0(with or without an indexregister).REX prefix adds a fourth bit(x), which is not decoded(don’t care). Therefore,using RBP or R13 without adisplacement must bedone via mod = 01 with adisplacement of 0.SIB Byte:• index 1 = x100 (ESP)Index register is not used.ESP cannot be used as anindex register.REX prefix adds a fourth bit(x), which is decoded.Therefore, there are noadditional implications.The exp<strong>and</strong>ed index field isused to distinguish RSPfrom R12, allowing R12 tobe used as an index.SIB Byte:• base = b101 (EBP)• ModRM.mod = 00Base register is not used ifModRM.mod = 00.Base register depends onmod encoding. Using EBPwith a scaled index <strong>and</strong>without a displacementmust be done by settingmod = 01 with adisplacement of 0.REX prefix adds a fourth bit(b), which is not decoded(don’t care). Therefore,using RBP or R13 without adisplacement must bedone via mod = 01 with adisplacement of 0 (with orwithout an index register).Notes:1. The REX-prefix bit is shown in the fourth (most-significant) bit position of the encodings for the ModRM r/m, SIB index, <strong>and</strong> SIBbase fields. The lower-case “x” for ModRM r/m (rather than the upper-case “B” shown in Figure 1-3 on page 18) indicates thatthe REX-prefix bit is not decoded (don’t care).2. For a description of the ModRM <strong>and</strong> SIB bytes, see “ModRM <strong>and</strong> SIB Bytes” on page 20.Chapter 1: Instruction Formats 19

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

Saved successfully!

Ooh no, something went wrong!