3-13
BASIC EXECUTION ENVIRONMENT
3.6.3.2.DF FLAG
The direction flag (DF, located in bit 10 of the EFLAGS register) controls the string instructions
(MOVS, CMPS, SCAS, LODS, and STOS). Setting the DF flag causes the string instructions to
auto-decrement (that is, to process strings from high addresses to low addresses). Clearing the
DF flag causes the string instructions to auto-increment (process strings from low addresses
to high addresses).
The STD and CLD instructions set and clear the DF flag, respectively.
3.6.4.System Flags and IOPL Field
The system flags and IOPL field in the EFLAGS register control operating-system or executive
operations. They should not be modified by application programs. The functions of the
system flags are as follows:
IF (bit 9)
Interrupt enable flag. Controls the response of the processor to
maskable interrupt requests. Set to respond to maskable interrupts;
cleared to inhibit maskable interrupts.
TF (bit 8)
Trap flag. Set to enable single-step mode for debugging; clear to
disable single-step mode.
IOPL (bits 12, 13)I/O privilege
level field. Indicates the I/O privilege level
of the currently
running program or task. The current privilege level (CPL) of the
currently running program or task must be less than or equal to the
I/O privilege level to access the I/O address space. This field can only
be modified by the POPF and IRET instructions when operating at a
CPL of 0.
NT (bit 14)
Nested task flag. Controls the chaining of interrupted and called
tasks. Set when the current task is linked to the previously executed
task; cleared when the current task is not linked to another task.
RF (bit 16)
Resume flag. Controls the processors response to debug exceptions.
VM (bit 17)
Virtual-8086 mode flag. Set to enable virtual-8086 mode; clear to
return to protected mode.
AC (bit 18)
Alignment check flag. Set this flag and the AM bit in the CR0
register to enable alignment checking of memory references; clear
the AC flag and/or the AM bit to disable alignment checking.
VIF (bit 19)
Virtual interrupt flag. Virtual image of the IF flag. Used in
conjunction with the VIP flag. (To use this flag and the VIP flag the
virtual mode extensions are enabled by setting the VME flag in
control register CR4.)
VIP (bit 20)
Virtual interrupt pending flag. Set to indicate pending interrupts;
or clear when no interrupts are pending. (Software sets and clears this