User Guide

34 General-Purpose Programming
AMD64 Technology 24592—Rev. 3.15—November 2009
Figure 3-5. rFLAGS Register—Flags Visible to Application Software
The low 16 bits (FLAGS portion) of rFLAGS are accessible by application software and hold the
following flags:
One control flag (the direction flag DF).
Six status flags (carry flag CF, parity flag PF, auxiliary carry flag AF, zero flag ZF, sign flag SF,
and overflow flag OF).
The direction flag (DF) flag controls the direction of string operations. The status flags provide result
information from logical and arithmetic operations and control information for conditional move and
jump instructions.
Bits 31–16 of the rFLAGS register contain flags that are accessible only to system software. These
flags are described in “System Registers” i n Volume 2. The highest 32 bits of RFLAGS are reserved.
In 64-bit mode, writes to these bits are ignored. They are read as zeros (RAZ). The rFLAGS register is
initialized to 02h on reset, so that all of the programmable bits are cleared to zero.
The effects that rFLAGS bit-values have on instructions are summarized in the following places:
Conditional Moves (CMOVcc)—Table 3-4 on page 43.
Conditional Jumps (Jcc)—Table 3-5 on page 55.
Conditional Sets (SETcc)—Table 3-6 on page 59.
The effects that instructions have on rFLAGS bit-values are summarized in “Instruction Effects on
RFLAGS” in Volume 3.
63 32
Reserved, RAZ
31 1211109876543210
See Volume 2 for System Flags
O
F
D
F
S
F
Z
F
A
F
P
F
C
F
Bits Mnemonic Description R/W
11 OF Overflow Flag R/W
10 DF Direction Flag R/W
7 SF Sign Flag R/W
6 ZF Zero Flag R/W
4 AF Auxiliary Carry Flag R/W
2 PF Parity Flag R/W
0 CF Carry Flag R/W