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 2011onefreeman192
 
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...Sivaranjan Goswami
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsZeeshan Ahmed
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architectureAhmad Sidik
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086asrithak
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programmingsergeiseq
 
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]

Lecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptxLecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptxImranBhatti58
 
COA Module 3 PART 2.pptx
COA Module 3 PART 2.pptxCOA Module 3 PART 2.pptx
COA Module 3 PART 2.pptxnishu chaudhary
 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.pptnotagain0712
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setaviban
 
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 notenotgaherwarsaloni1234
 
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 reversingCysinfo Cyber Security Community
 
Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processorFazle Akash
 
Microprocessor- Flaf registor
Microprocessor- Flaf registorMicroprocessor- Flaf registor
Microprocessor- Flaf registorEsha Abbas
 
Design of microcontroller CPU.pdf
Design of microcontroller CPU.pdfDesign of microcontroller CPU.pdf
Design of microcontroller CPU.pdfssuserbefd221
 
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 1KanchanPatil34
 

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

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 - VDineshKumar4165
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
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.pdfsmsksolar
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
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 SARKARKOUSTAV SARKAR
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
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 equationBhangaleSonal
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 

Recently uploaded (20)

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
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
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
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
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
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
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
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 

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