
88
Chapter 3: General-Purpose Programming
AMD 64-Bit Technology
24593—Rev. 3.09—September 2003
Table 3-3 on page 45 shows the operand-size overrides for all
operating modes. In 64-bit mode, the default operand size for
most general-purpose instructions is 32 bits. A REX prefix
(described in “REX Prefixes” on page 89) specifies a 64-bit
operand size, and a 66h prefix specifies a 16-bit operand size.
The REX prefix takes precedence over the 66h prefix.
Table 2-1 on page 21 shows the address-size overrides for all
operating modes. In 64-bit mode, the default address size is 64
bits. The address size can be overridden to 32 bits. 16-bit
addresses are not supported in 64-bit mode. In compatibility
mode, the address-size prefix works the same as in the legacy
x86 architecture.
For further details on these prefixes, see “Operand-Size
Override Prefix” in Volume 3 and “Address-Size Override
Prefix” in Volume 3.
Segment Override Prefix.
The DS segment is the default segment
for most memory operands. Many instructions allow this default
data segment to be overridden using one of the six segment-
override prefixes shown in Table 3-7. Data-segment overrides
will be ignored when accessing data in the following cases:
When a stack reference is made that pushes data onto or
pops data off of the stack. In those cases, the SS segment is
always used.
When the destination of a string is memory it is always
referenced using the ES segment.
Instruction fetches from the CS segment cannot be overridden.
However, the CS segment-override prefix can be used to access
instructions as data objects and to access data stored in the
code segment.
For further details on these prefixes, see “Segment-Override
Prefixes” in Volume 3.
Lock Prefix.
The LOCK prefix causes certain read-modify-write
instructions that access memory to occur atomically. The
mechanism for doing so is implementation-dependent (for
example, the mechanism may involve locking of data-cache
lines that contain copies of the referenced memory operands,
and/or bus signaling or packet-messaging on the bus). The
prefix is intended to give the processor exclusive use of shared
memory operands in a multiprocessor system.