8086 Flags
|---------------- 8086 Flags Register (16-bits) ----------------|
--
--
--
--
OF
DF
IF
TF
SF
ZF
--
AF
--
PF
--
CF
OF - Overflow Flag
Set if signed number exceeds capacity of result
AKA: If carry out of number is not the same as carry to most significant bit
DF - Direction Flag
Set by user to indicate a direction (0=forward, 1=backward)
Used mainly with String Instructions (in a later lecture)
IF - Interrupt Flag
Set by user to disable hardware interrupts temporarilly
ALWAYS BE SURE TO REENABLE THEM SOON!
TF - Trap Flag
Used by debuggers
SF - Sign Flag
A copy of the result's sign bit
After a subtract/compare represents signed "less-than" (if OF=1, SF is wrong)
ZF - Zero Flag
Set if the result is zero
After a subtract/compare represents equality
AF - Aux. Carry Flag
Not dealt with in this course
PF - Parity Flag
Not dealt with in this course
CF - Carry Flag
Set if unsigned number exceeds capacity of result
AKA: Set to indicate a carry or borrow out of the number
Also used by some shift/rotate instructions
After a subtract/compare represents unsigned "less-than"
Flags Instructions
CLI - Clear Interrupt Flag
CLD - Clear Direction Flag
CLC - Clear Carry Flag
STC - Set Interrupt Flag
STD - Set Direction Flag
STC - Set Carry Flag