
46
Chapter 3: General-Purpose Programming
AMD 64-Bit Technology
24593—Rev. 3.09—September 2003
Immediate Operand Size.
In legacy mode and compatibility modes,
the size of immediate operands can be 8, 16, or 32 bits,
depending on the instruction. In 64-bit mode, the maximum size
of an immediate operand is also 32 bits, except that 64-bit
immediates can be copied into a 64-bit GPR using the MOV
instruction.
When the operand size of a MOV instruction is 64 bits, the
processor sign-extends immediates to 64 bits before using them.
Support for true 64-bit immediates is accomplished by
expanding the semantics of the
MOV reg, imm16/32
instructions.
In legacy and compatibility modes, these instructions—opcodes
B8h through BFh—copy a 16-bit or 32-bit immediate
(depending on the effective operand size) into a GPR. In 64-bit
mode, if the operand size is 64 bits (requires a REX prefix),
these instructions can be used to copy a true 64-bit immediate
into a GPR.
3.2.3
Operand
Addressing
Operands for general-purpose instructions are referenced by
the instruction's syntax or they are incorporated in the
instruction as an immediate value. Referenced operands can be
in registers, memory, or I/O ports.
Register Operands.
Most general-purpose instructions that take
register operands reference the general-purpose registers
(GPRs). A few general-purpose instructions reference operands
in the RFLAGS register, XMM registers, or MMX registers.
The type of register addressed is specified in the instruction
syntax. When addressing GPRs or XMM registers, the REX
instruction prefix can be used to access the extended GPRs or
XMM registers, as described in Section 3.5, “Instruction
Prefixes,” on page 85.
Memory Operands.
Many general-purpose instructions can access
operands in memory. Section 2.2, “Memory Addressing,” on
page 16 describes the general methods and conditions for
addressing memory operands.
I/O Ports.
Operands in I/O ports are referenced according to the
conventions described in Section 3.8, “Input/Output,” on
page 109.
Immediate Operands.
In certain instructions, a source operand—
called an
immediate operand
, or simply
immediate
—is included