SlideShare a Scribd company logo
1 of 13
Download to read offline
 The rightmost five flags and the overflow
flag change after many arithmetic and
logic instructions execute.
 flags never change for any data transfer
or program control operation
 Some of the flags are also used to
control features found in the
microprocessor.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- NT IOPL OF DF IF TF SF ZF - AF - PF - CF
Carry Flag (Bit 0)
 holds the carry after addition or the
borrow after subtraction.
 indicates error conditions, as dictated by
some programs and procedures.
Parity Flag (Bit 2)
 PF = 1 even number of 1’s
 PF = 0 odd number of 1’s
Auxiliary Flag (Bit 4)
 holds the carry (half-carry) after addition or
the borrow after subtraction between bits
positions 3 and 4 of the result
Addition:
Bit 3 – Bit4
AF = 1 > Carry
AF = 0 > No Carry
Subtraction:
Bit 4 – Bit 3
AF = 1 > Borrow
AF = 0 > No Borrow
Zero Flag (Bit 6)
 shows that the result of an arithmetic or
logic operation is zero
 memory or register is equal to zero, Z=1
 Z = 0, the result is not zero or greater
than zero
Sign Flag (Bit 7)
 2’s complement
 Sign bit = 1, negative # in 2’s
complement
Trap Flag
 enables trapping through an on-chip-
debugging feature
 T =1, microprocessor interrupts the flow
of the program on conditions as
indicated by the debug registers and
control registers.
 T=0, the trapping (debugging) feature is
disabled.
Interrupt Flag
 controls the operation of the INTR
(interrupt request) input pin
 IF=1, INTR is enabled
 IF=0, INTR pin is disabled
 state of the flag bit is controlled by the
STI (set I flag) and CLI (clear I flag)
instructions.
Direction Flag
 selects either the increment or
decrement mode for the DI and/or SI
registers during string instructions
 D=1, registers decrement (Backward
Branching)
 D=0, registers increment (Forward
Branching)
 set with the STD (set direction)
 cleared with the CLD (clear direction)
instructions
Overflow Flag
 occurs when signed numbers are added
or subtracted
 indicates that the result has exceeded
the capacity of the machine.
 For signed numbers
OF = 1, exceed the limit
OF = 0, did not exceed the limit
INPUT/OUTPUT PRIVILEGE LEVEL
 Priority of current task
NESTED TASK
 indicates if current task is nested

More Related Content

What's hot

Embedded system (Chapter )
Embedded system (Chapter )Embedded system (Chapter )
Embedded system (Chapter )
Ikhwan_Fakrudin
 
Team fortress 2 city 17 pictures, july 2011
Team fortress 2 city 17 pictures, july 2011Team fortress 2 city 17 pictures, july 2011
Team fortress 2 city 17 pictures, july 2011
onefreeman192
 
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
SANTIAGO PABLO ALBERTO
 

What's hot (11)

Interfacing with LCD
Interfacing with LCDInterfacing with LCD
Interfacing with LCD
 
Embedded system (Chapter )
Embedded system (Chapter )Embedded system (Chapter )
Embedded system (Chapter )
 
Team fortress 2 city 17 pictures, july 2011
Team fortress 2 city 17 pictures, july 2011Team fortress 2 city 17 pictures, july 2011
Team fortress 2 city 17 pictures, july 2011
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
 
Interesting facts on c
Interesting facts on cInteresting facts on c
Interesting facts on c
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architecture
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
Computer Organization
Computer Organization Computer Organization
Computer Organization
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programming
 
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
PLC y Electroneumática: Controladores lógicos programables por W. Bolton 4 ed...
 

Similar to Cpe103 03 [processor flags]

Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
aviban
 
Flag Register in 8086.pptx with the notenot
Flag Register in 8086.pptx with the notenotFlag Register in 8086.pptx with the notenot
Flag Register in 8086.pptx with the notenot
gaherwarsaloni1234
 
Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processor
Fazle Akash
 

Similar to Cpe103 03 [processor flags] (20)

Instructions
InstructionsInstructions
Instructions
 
Lecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptxLecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptx
 
input
inputinput
input
 
Assembly language programming intro
Assembly language programming introAssembly language programming intro
Assembly language programming intro
 
Dsp Datapath
Dsp DatapathDsp Datapath
Dsp Datapath
 
COA Module 3 PART 2.pptx
COA Module 3 PART 2.pptxCOA Module 3 PART 2.pptx
COA Module 3 PART 2.pptx
 
Lecture7
Lecture7Lecture7
Lecture7
 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt
 
DPA
DPADPA
DPA
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
 
Flag Register in 8086.pptx with the notenot
Flag Register in 8086.pptx with the notenotFlag Register in 8086.pptx with the notenot
Flag Register in 8086.pptx with the notenot
 
Registers
RegistersRegisters
Registers
 
Interrupt.pptx
Interrupt.pptxInterrupt.pptx
Interrupt.pptx
 
Reversing malware analysis training part6 practical reversing
Reversing malware analysis training part6 practical reversingReversing malware analysis training part6 practical reversing
Reversing malware analysis training part6 practical reversing
 
Blockdiagramof8085.ppt
Blockdiagramof8085.pptBlockdiagramof8085.ppt
Blockdiagramof8085.ppt
 
Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processor
 
Interrupt in 8051
Interrupt in 8051Interrupt in 8051
Interrupt in 8051
 
Microprocessor- Flaf registor
Microprocessor- Flaf registorMicroprocessor- Flaf registor
Microprocessor- Flaf registor
 
Design of microcontroller CPU.pdf
Design of microcontroller CPU.pdfDesign of microcontroller CPU.pdf
Design of microcontroller CPU.pdf
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
 

Recently uploaded

+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 

Recently uploaded (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 

Cpe103 03 [processor flags]

  • 1.
  • 2.  The rightmost five flags and the overflow flag change after many arithmetic and logic instructions execute.  flags never change for any data transfer or program control operation  Some of the flags are also used to control features found in the microprocessor. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - NT IOPL OF DF IF TF SF ZF - AF - PF - CF
  • 3. Carry Flag (Bit 0)  holds the carry after addition or the borrow after subtraction.  indicates error conditions, as dictated by some programs and procedures.
  • 4. Parity Flag (Bit 2)  PF = 1 even number of 1’s  PF = 0 odd number of 1’s
  • 5. Auxiliary Flag (Bit 4)  holds the carry (half-carry) after addition or the borrow after subtraction between bits positions 3 and 4 of the result Addition: Bit 3 – Bit4 AF = 1 > Carry AF = 0 > No Carry Subtraction: Bit 4 – Bit 3 AF = 1 > Borrow AF = 0 > No Borrow
  • 6. Zero Flag (Bit 6)  shows that the result of an arithmetic or logic operation is zero  memory or register is equal to zero, Z=1  Z = 0, the result is not zero or greater than zero
  • 7. Sign Flag (Bit 7)  2’s complement  Sign bit = 1, negative # in 2’s complement
  • 8. Trap Flag  enables trapping through an on-chip- debugging feature  T =1, microprocessor interrupts the flow of the program on conditions as indicated by the debug registers and control registers.  T=0, the trapping (debugging) feature is disabled.
  • 9. Interrupt Flag  controls the operation of the INTR (interrupt request) input pin  IF=1, INTR is enabled  IF=0, INTR pin is disabled  state of the flag bit is controlled by the STI (set I flag) and CLI (clear I flag) instructions.
  • 10. Direction Flag  selects either the increment or decrement mode for the DI and/or SI registers during string instructions  D=1, registers decrement (Backward Branching)  D=0, registers increment (Forward Branching)  set with the STD (set direction)  cleared with the CLD (clear direction) instructions
  • 11. Overflow Flag  occurs when signed numbers are added or subtracted  indicates that the result has exceeded the capacity of the machine.  For signed numbers OF = 1, exceed the limit OF = 0, did not exceed the limit
  • 12. INPUT/OUTPUT PRIVILEGE LEVEL  Priority of current task
  • 13. NESTED TASK  indicates if current task is nested