User Guide
72 General-Purpose Programming
AMD64 Technology 24592—Rev. 3.15—November 2009
Operand-Size and Address-Size Prefixes. The operand-size and address-size prefixes allow
mixing o f data and address sizes on an instruction-by-instruction basis. An instruction’s default
address size can be overridden in any operating mode by using the 67h address-size prefix.
Table 3-3 on page 39 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 74) 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 18 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 s ame as in the
legacy x86 architecture.
For further details on these prefixes, see “Operand-Size Override Prefix” and “Address-Size Override
Prefix” in Volume 3.
Table 3-7. Legacy Instruction Prefixes
Prefix Group Mnemonic
Prefix Code
(Hex)
Description
Operand-Size
Override
none 66
1
Changes the default operand size of a memory or register
operand, as shown in Table 3-3 on page 39.
Address-Size
Override
none 67
Changes the default address size of a memory operand,
as shown in Table 2-1 on page 18.
Segment
Override
CS 2E Forces use of the CS segment for memory operands.
DS 3E Forces use of the DS segment for memory operands.
ES 26 Forces use of the ES segment for memory operands.
FS 64 Forces use of the FS segment for memory operands.
GS 65 Forces use of the GS segment for memory operands.
SS 36 Forces use of the SS segment for memory operands.
Lock LOCK F0
Causes certain read-modify-write instructions on memory
to occur atomically.
Repeat
REP
F3
1
Repeats a string operation (INS, MOVS, OUTS, LODS,
and STOS) until the rCX register equals 0.
REPE or
REPZ
Repeats a compare-string or scan-string operation
(CMPSx and SCASx) until the rCX register equals 0 or
the zero flag (ZF) is cleared to 0.
REPNE or
REPNZ
F2
1
Repeats a compare-string or scan-string operation
(CMPSx and SCASx) until the rCX register equals 0 or
the zero flag (ZF) is set to 1.
Note:
1. When used with 128-bit or 64-bit media instructions, this prefix acts in a special-purpose way to modify the opcode.