Slide 4.13: Integer constants
Slide 4.15: ADD instruction
Home

Control and Status Flags


Flags register consists of individual binary bits that either control the operation of the CPU or reflect the outcome of some CPU operation.
Flag Description
Overflow (O/OF) Flag is set wen the result of a signed arithmetic operation is too wide to fit into the destination.
Direction (D) Affects block data transfer instructions such as MOVS, CMPS, and SCAS.
Interrupt (I) Indicates whether or not system interrupts can occur.
Sign (SF/S) Flag is set when the result of an arithmetic or logical operation generates a negative result.
Zero (ZF/Z) Flag is set when the result of an arithmetic or logical operation generates a result of zero.
Auxiliary Carry (A) Flag is set when an arithmetic operation causes a carry from bit 3 to bit 4 in an 8-bit operand.
Parity (P) Flag sums the number of bits that are set in a number, and indicates whether the sum is odd or even.
Carry (CF/C) Flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination.

The table below shows instances of flags and the table on the right gives the explanations of the results.

 Flag O D I S Z A P C
 Result ?     * 1 ? * 0
 
Result Description
1 Set the flag.
0 Clear the flag.
? May change the flag to an undetermined value.
  The flag is not changed.
* Changes the flag according to specific rules associated with the flag.