User Guide
36 General-Purpose Programming
AMD64 Technology 24592—Rev. 3.15—November 2009
to 0 specifies incrementing the data pointer. The pointers are stored in the rSI or rDI register. Software
can set or clear the flag with the STD and CLD instructions, respectively.
Overflow Flag (OF). Bit 11. Hardware sets the overflow flag to 1 to indicate that the most-significant
(sign) bit of the result of the last signed integer operation differed from the signs of both source
operands. Otherwise, hardware clears the flag to 0. A set overflow flag means that the magnitude of the
positive or negative result is too big (overflow) or too small (underflow) to fit its defined data type.
The OF flag is undefined after the DIV instruction and after a shift of more than one bit. Logical
instructions clear the overflow flag.
3.1.5 Instruction Pointer Register
The instruction pointer register—IP, EIP, or RIP, or simply rIP for any of the three depending on the
context—is used in conjunction with the code-segment (CS) register to locate the next instruction in
memory. See Section 2.5, “Instruction Pointer,” on page 20 for details.
3.2 Operands
Operands are either referenced by an instruction's encoding or included as an immediate value in the
instruction encoding. Depending on the instruction, referenced operands can be located in registers,
memory locations, or I/O ports.
3.2.1 Data Types
Figure 3-6 on page 37 shows the register images of the general-purpose d ata types. In the general-
purpose programming environment, these data types can be interpreted by instruction syntax or the
software context as the following types of numbers and strings:
• Signed (two's-complement) integers.
• Unsigned integers.
• BCD digits.
• Packed BCD digits.
• Strings, including bit strings.
The double quadword data type is supported in the RDX:RAX registers by the MUL, IMUL, DIV,
IDIV, a nd CQO instructions. Software can interpret the data types in ways other than those shown in
Figure 3-6 on page 37 but the AMD64 instruction set does not directly support such interpretations
and software must handle them entirely on its own.
Table 3-2 on page 37 shows the range of representable values for the general-purpose data types.