Processor Status and the FLAGS Register Module 5
CS 272
Sam Houston State University
Dr. Tim McGuire
FLAGS Register FLAG Register Bits
 
Bit Name Symbol
0 Carry flag cf
2 Parity flag pf
4 Auxiliary carry flag af
6 Zero flag zf
7 Sign flag sf
8 Trace flag tf
9 Interrupt flag if
10 Direction flag df
11 Overflow flag of

Control Flags

Status Flags The Carry Flag (CF) The Parity Flag (PF) The Auxiliary Carry Flag (AF) The Zero Flag (ZF) The Sign Flag (SF) The Overflow Flag (OF) (Signed) Overflow Signed Overflow Example   10010110
+ 10100011
  00111001

Carry in = 0, Carry out = 1
Neg+Neg=Pos
Signed overflow occurred
OF = 1 (set)

  00110110
+ 01100011
  10011001

Carry in = 1, Carry out = 0
Pos+Pos=Neg
Signed overflow occurred
OF = 1 (set)

Examples of No Signed Overflow   10010110
+ 01100011
  11111001

Carry in = 0, Carry out = 0
Neg+Pos=Neg
No Signed overflow occurred
OF = 0 (clear)

  10010110
+ 11110011
  10001001

Carry in = 1, Carry out = 1
Neg+Neg=Neg
No Signed overflow occurred
OF = 0 (clear)

Unsigned Overflow   10010110
+ 11110011
  10001001

Carry out = 1
Unsigned overflow occurred
CF = 1 (set)

Instructions and Flags