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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AMD64 Technology 24594 Rev. 3.10 February 2005In 64-bit mode, most instructions default to a 32-bit oper<strong>and</strong>size. For these instructions, a REX prefix (page 16) can specifya 64-bit oper<strong>and</strong> size, <strong>and</strong> a 66h prefix specifies a 16-bit oper<strong>and</strong>size. The REX prefix takes precedence over the 66h prefix.However, if an instruction defaults to a 64-bit oper<strong>and</strong> size, itdoes not need a REX prefix <strong>and</strong> it can only be overridden to a16-bit oper<strong>and</strong> size. It cannot be overridden to a 32-bit oper<strong>and</strong>size, because there is no 32-bit oper<strong>and</strong>-size override prefix in64-bit mode. Two groups of instructions have a default 64-bitoper<strong>and</strong> size in 64-bit mode:• Near branches. For details, see “Near Branches in 64-BitMode” in <strong>Volume</strong> 1.• All instructions, except far branches, that implicitlyreference the RSP. For details, see “Stack Operation” in<strong>Volume</strong> 1.<strong>Instructions</strong> that Cannot Use the Oper<strong>and</strong>-Size Prefix. The oper<strong>and</strong>-sizeprefix should be used only with general-purpose instructions<strong>and</strong> the x87 FLDENV, FNSTENV, FNSAVE, <strong>and</strong> FRSTORinstructions, in which the prefix selects between 16-bit <strong>and</strong> 32-bit oper<strong>and</strong> size. The prefix is ignored by all other x87instructions <strong>and</strong> by 64-bit media floating-point (3DNow!)instructions.When used with 64-bit media integer instructions, the 66h prefixacts in a special way to modify the opcode. This modificationtypically causes an access to an XMM register or 128-bitmemory oper<strong>and</strong> <strong>and</strong> thereby converts the 64-bit mediainstruction into its comparable 128-bit media instruction. Theresult of using an F2h or F3h repeat prefix along with a 66hprefix in 128-bit or 64-bit media instructions is unpredictable.Oper<strong>and</strong>-Size <strong>and</strong> REX Prefixes. The REX oper<strong>and</strong>-size prefix takesprecedence over the 66h prefix. See “REX.W: Oper<strong>and</strong> Width”on page 16 for details.1.2.3 Address-SizeOverride PrefixThe default address size for instructions that access non-stackmemory is determined by the current operating mode, as shownin Table 1-3. The address-size override prefix (67h) selects thenon-default address size. Depending on the operating mode,this prefix allows mixing of 16-bit <strong>and</strong> 32-bit, or of 32-bit <strong>and</strong> 64-bit addresses, on an instruction-by-instruction basis. The prefixchanges the address size for memory oper<strong>and</strong>s. It also changes6 Chapter 1: Instruction Formats

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

Saved successfully!

Ooh no, something went wrong!