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 Technology1.2.4 Segment-Override PrefixesSegment overrides can be used only with instructions thatreference non-stack memory. Most instructions that referencememory are encoded with a ModRM byte (page 20). The defaultsegment for such memory-referencing instructions is implied bythe base register indicated in its ModRM byte, as follows:• <strong>Instructions</strong> that Reference a Non-Stack Segment—If aninstruction encoding references any base register other thanrBP or rSP, or if an instruction contains an immediate offset,the default segment is the data segment (DS). Theseinstructions can use the segment-override prefix to selectone of the non-default segments, as shown in Table 1-5.• String <strong>Instructions</strong>—String instructions reference twomemory oper<strong>and</strong>s. By default, they reference both the DS<strong>and</strong> ES segments (DS:rSI <strong>and</strong> ES:rDI). These instructionscan override their DS-segment reference, as shown inTable 1-5, but they cannot override their ES-segmentreference.• <strong>Instructions</strong> that Reference the Stack Segment—If aninstruction’s encoding references the rBP or rSP baseregister, the default segment is the stack segment (SS). Allinstructions that reference the stack (push, pop, call,interrupt, return from interrupt) use SS by default. Theseinstructions cannot use the segment-override prefix.Table 1-5.MnemonicSegment-Override PrefixesPrefix Byte(Hex)DescriptionCS 1 2E Forces use of current CS segment for memory oper<strong>and</strong>s.DS 1 3E Forces use of current DS segment for memory oper<strong>and</strong>s.ES 1 26 Forces use of current ES segment for memory oper<strong>and</strong>s.FS 64 Forces use of current FS segment for memory oper<strong>and</strong>s.GS 65 Forces use of current GS segment for memory oper<strong>and</strong>s.SS 1 36 Forces use of current SS segment for memory oper<strong>and</strong>s.Note:1. In 64-bit mode, the CS, DS, ES, <strong>and</strong> SS segment overrides are ignored.Chapter 1: Instruction Formats 9

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

Saved successfully!

Ooh no, something went wrong!