SlideShare a Scribd company logo
1 of 17
FLAG REGISTER OF 8086
PRESENTED BY:
M.ASRITHA(16711A0540)
WHAT IS FLAGS REGISTER??
THE FLAGS REGISTER IS THE STATUS REGISTER IN INTEL X86
MICROPROCESSORS THAT CONTAINS THE CURRENT STATE OF
THE PROCESSOR. THIS REGISTER IS 16 BITS WIDE. ITS
SUCCESSORS, THE EFLAGS AND RFLAGS REGISTERS, ARE 32
BITS AND 64 BITS WIDE, RESPECTIVELY. THE WIDER REGISTERS
RETAIN COMPATIBILITY WITH THEIR SMALLER PREDECESSORS.
WE ARE GOING TO DISCUSS ABOUT THE FLAGS REGISTERS
HERE.
CATEGORY OF FLAGS REGISTERS
THERE ARE 2 TYPES OF FLAGS REGISTER.
• STATUS FLAGS
• CONTROL FLAGS.
THIS REGISTER IS 16 BITS WIDE. THE STATUS FLAGS ARE LOCATED
IN 0, 2, 4, 6, 7 AND 11 BITS. CONTROL FLAGS ARE LOCATED IN 8, 9
AND 10 BITS AND THE SYSTEM FLAGS ARE LOCATED IN 12,13 AND
14 BITS AND OTHERS LEFT BITS ARE RESERVED BITS.
STATUS FLAGS THERE ARE 6 STATUS FLAGS IN
8086 PROCESSOR.
• CARRY FLAG
• PARITY FLAG
• AUXILIARY FLAG
• ZERO FLAG
• SIGN FLAG
• OVERFLOW FLAG
CARRY FLAG
IN 8086 PROCESSORS THE CARRY FLAG IS A SINGLE BIT IN A SYSTEM
STATUS REGISTER USED TO INDICATE WHEN AN ARITHMETIC CARRY OR
BORROW HAS BEEN GENERATED OUT OF THE MOST SIGNIFICANT ALU BIT
POSITION. THE CARRY FLAG ENABLES NUMBERS LARGER THAN A SINGLE
ALU WIDTH TO BE ADDED/SUBTRACTED BY CARRYING A BINARY DIGIT
FROM A PARTIAL ADDITION/SUBTRACTION TO THE LEAST SIGNIFICANT BIT
POSITION OF A MORE SIGNIFICANT WORD. IT IS LOCATED IN THE 0 BITS IF
A 8086 PROCESSOR.
PARITY FLAG
IN 8086 PROCESSORS THE PARITY FLAG INDICATES IF THE NUMBER OF SET
BITS IS ODD OR EVEN IN THE BINARY REPRESENTATION OF THE RESULT OF
THE LAST OPERATION. IT IS NORMALLY A SINGLE BIT(2) IN A PROCESSOR
STATUS REGISTER. FOR EXAMPLE, ASSUME A MACHINE WHERE A SET
PARITY FLAG INDICATES EVEN PARITY. IF THE RESULT OF THE LAST
OPERATION WERE 26 (11010 IN BINARY), THE PARITY FLAG WOULD BE 0
SINCE THE NUMBER OF SET BITS IS ODD. SIMILARLY, IF THE RESULT WERE
102 (1100110 IN BINARY) THEN THE PARITY FLAG WOULD BE 1.
AUXILIARY FLAG
THE AUXILIARY FLAG IS A FLAG STORED IN THE FLAGS
REGISTER ON ALL 8086 PROCESSORS. IT IS BIT 4. IT IS USED
TO INDICATE WHEN AN ARITHMETIC CARRY OR BORROW HAS
BEEN GENERATED OUT OF THE 4 LEAST SIGNIFICANT BITS. IT
IS PRIMARILY USED IN BCD ARITHMETIC.
 AUXILIARY FLAG IS SET (AF=1) IF THERE IS A CARRY FROM
LOW NIBBLE TO HIGH NIBBLE OR A BORROW FROM A HIGH
NIBBLE TO LOW NIBBLE OF THE LOW ORDER 8- BIT OF A 16-
BIT NUMBER.
ZERO FLAG
THE ZERO FLAG IS A SINGLE BIT FLAG LOCATED IN 6 BIT OF A 8086
PROCESSOR. THE ZERO FLAG IS USED TO CHECK THE RESULT OF AN
ARITHMETIC OPERATION, INCLUDING BITWISE LOGICAL INSTRUCTIONS.
IT IS SET IF AN ARITHMETIC RESULT IS ZERO, AND RESET OTHERWISE.
THIS INCLUDES RESULTS WHICH ARE NOT STORED, AS MOST
TRADITIONAL INSTRUCTION SETS IMPLEMENT THE COMPARE
INSTRUCTION AS A SUBTRACT WHERE THE RESULT IS DISCARDED. IT IS
ALSO COMMON THAT PROCESSORS HAVE A BITWISE AND-
INSTRUCTION THAT DOES NOT STORE THE RESULT. IN MOST
PROCESSORS, THE ZERO FLAG IS MAINLY USED IN CONDITIONAL
BRANCH INSTRUCTIONS, WHICH ALTER CONTROL FLOW ON PREVIOUS
INSTRUCTION RESULTS, BUT THERE ARE OFTEN OTHER USES AS WELL.
SIGN FLAG
IN A 8086 PROCESSOR THE SIGN FLAG OR NEGATIVE FLAG IS A SINGLE
BIT IN A SYSTEM STATUS (FLAG) REGISTER USED TO INDICATE
WHETHER THE RESULT OF THE LAST MATHEMATICAL OPERATION
RESULTED IN A VALUE WHOSE MOST SIGNIFICANT BIT WAS SET. IN A
TWO'S COMPLEMENT INTERPRETATION OF THE RESULT, THE NEGATIVE
FLAG IS SET IF THE RESULT WAS NEGATIVE. FOR EXAMPLE, IN AN 8-BIT
SIGNED NUMBER SYSTEM, -37 WILL BE REPRESENTED AS 1101 1011 IN
BINARY (THE MOST SIGNIFICANT BIT IS 1), WHILE +37 WILL BE
REPRESENTED AS 0010 0101 (THE MOST SIGNIFICANT BIT IS 0).
OVERFLOW FLAG
IN 8086 PROCESSORS, THE OVERFLOW FLAG (SOMETIMES
CALLED V FLAG) IS USUALLY A SINGLE BIT IN A SYSTEM
STATUS REGISTER USED TO INDICATE WHEN AN ARITHMETIC
OVERFLOW HAS OCCURRED IN AN OPERATION, INDICATING
THAT THE SIGNED TWO'S-COMPLEMENT RESULT WOULD NOT
FIT IN THE NUMBER OF BITS USED FOR THE OPERATION (THE
ALU WIDTH). SOME ARCHITECTURES MAY BE CONFIGURED
TO AUTOMATICALLY GENERATE AN EXCEPTION ON AN
OPERATION RESULTING IN OVERFLOW.
CONTROL FLAGS
THERE ARE 3 CONTROL FLAGS IN 8086
PROCESSOR.
• TRAP FLAG
• INTERRUPT ENABLE FLAG
• DIRECTION FLAG .
TRAP FLAG
A TRAP FLAG PERMITS OPERATION OF A PROCESSOR IN
SINGLE-STEP MODE. IF SUCH A FLAG IS AVAILABLE,
DEBUGGERS CAN USE IT TO STEP THROUGH THE EXECUTION
OF A COMPUTER PROGRAM. THE 8086 HAS NO INSTRUCTION
TO DIRECTLY SET OR RESET THE TRAP FLAG. THESE
OPERATIONS ARE DONE BY PUSHING THE FLAG REGISTER
ON THE STACK, CHANGING THE TRAP FLAG BIT TO WHAT THE
PROGRAMMER WANTS IT TO BE, AND THEN POPPING THE
FLAG REGISTER BACK OFF THE STACK.
INTERRUPT FLAG
 THE BIT, WHICH IS BIT 9 OF THE FLAGS REGISTER, MAY BE SET OR
CLEARED BY PROGRAMS WITH SUFFICIENT PRIVILEGES, AS USUALLY
DETERMINED BY THE OPERATING SYSTEM. IF THE FLAG IS SET TO 1,
MASKABLE HARDWARE INTERRUPTS WILL BE HANDLED. IF CLEARED
(SET TO 0), SUCH INTERRUPTS WILL BE IGNORED. IF DOES NOT AFFECT
THE HANDLING OF NON- MASKABLE INTERRUPTS OR SOFTWARE
INTERRUPTS GENERATED BY THE INT INSTRUCTION.
INTERRUPT FLAG IS A SYSTEM FLAG BIT IN THE 8086 PROCESSOR’S
FLAGS REGISTER, WHICH DETERMINES WHETHER OR NOT THE CPU
WILL HANDLE MASKABLE HARDWARE INTERRUPTS.
DIRECTION FLAG
THE DIRECTION FLAG IS A FLAG THAT CONTROLS THE LEFT-TO- RIGHT OR RIGHT-
TO-LEFT DIRECTION OF STRING PROCESSING, STORED IN THE FLAGS REGISTER ON
ALL 8086 PROCESSORS. IT IS BIT NUMBER 10.
WHEN IT IS SET TO 0 (USING THE CLEAR-DIRECTION-FLAG INSTRUCTION CLD),IT
MEANS THAT INSTRUCTIONS THAT AUTO INCREMENT THE SOURCE INDEX AND
DESTINATION INDEX (LIKE MOVS) WILL INCREASE BOTH OF THEM. IN CASE IT IS SET
TO 1 (USING THE SET-DIRECTION-FLAG INSTRUCTION STD), THE INSTRUCTION WILL
DECREASE THEM.
THIS FLAG IS USED TO DETERMINE THE DIRECTION (FORWARD OR BACKWARD) IN
WHICH SEVERAL BYTES OF DATA WILL BE COPIED FROM ONE PLACE IN THE MEMORY.
THANK YOU

More Related Content

What's hot

Flag register 8086 assignment
Flag register 8086 assignmentFlag register 8086 assignment
Flag register 8086 assignmentZia3130
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051Muthu Manickam
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessorDiponkor Bala
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motorPRADEEP
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontrollerAnkit Bhatnagar
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller pptRahul Kumar
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram descriptionAkhil Singal
 
Memory banking-of-8086-final
Memory banking-of-8086-finalMemory banking-of-8086-final
Memory banking-of-8086-finalEstiak Khan
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directivesSARITHA REDDY
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerbhadresh savani
 

What's hot (20)

Flag register 8086 assignment
Flag register 8086 assignmentFlag register 8086 assignment
Flag register 8086 assignment
 
program status word
program status wordprogram status word
program status word
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
 
3 jump, loop and call instructions
3 jump, loop and call instructions3 jump, loop and call instructions
3 jump, loop and call instructions
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motor
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontroller
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram description
 
Memory banking-of-8086-final
Memory banking-of-8086-finalMemory banking-of-8086-final
Memory banking-of-8086-final
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directives
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontroller
 
8086
80868086
8086
 

Similar to flag register of 8086

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
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorNikhil Kumar
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorNikhil Kumar
 
Intel Microprocessors 8086 Documentation
Intel Microprocessors 8086 DocumentationIntel Microprocessors 8086 Documentation
Intel Microprocessors 8086 DocumentationAdeel Rasheed
 
ECE 310 22232 Unit II.pptx
ECE 310 22232 Unit II.pptxECE 310 22232 Unit II.pptx
ECE 310 22232 Unit II.pptxAkhilNameirakpam
 
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Randa Elanwar
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085RAHULNOUGHTY
 
microprocessor_part_3_compressed_1588259301.pdf
microprocessor_part_3_compressed_1588259301.pdfmicroprocessor_part_3_compressed_1588259301.pdf
microprocessor_part_3_compressed_1588259301.pdfssuserd21262
 
Mmai ppt
Mmai pptMmai ppt
Mmai pptGIT
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessorsavitamhaske
 
Microprocessor VIVA.pptx
Microprocessor VIVA.pptxMicroprocessor VIVA.pptx
Microprocessor VIVA.pptxShaurya Tyagi
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerNitin Ahire
 
8051 microcontrolle rclass1
8051 microcontrolle rclass18051 microcontrolle rclass1
8051 microcontrolle rclass1Nitin Ahire
 
8051 (microcontroller)class1
8051 (microcontroller)class18051 (microcontroller)class1
8051 (microcontroller)class1Nitin Ahire
 

Similar to flag register of 8086 (20)

Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processor
 
Flagsregistor
Flagsregistor Flagsregistor
Flagsregistor
 
Microprocessor- Flaf registor
Microprocessor- Flaf registorMicroprocessor- Flaf registor
Microprocessor- Flaf registor
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
 
Register & flags
Register & flagsRegister & flags
Register & flags
 
Intel Microprocessors 8086 Documentation
Intel Microprocessors 8086 DocumentationIntel Microprocessors 8086 Documentation
Intel Microprocessors 8086 Documentation
 
ECE 310 22232 Unit II.pptx
ECE 310 22232 Unit II.pptxECE 310 22232 Unit II.pptx
ECE 310 22232 Unit II.pptx
 
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085
 
microprocessor_part_3_compressed_1588259301.pdf
microprocessor_part_3_compressed_1588259301.pdfmicroprocessor_part_3_compressed_1588259301.pdf
microprocessor_part_3_compressed_1588259301.pdf
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Mmai ppt
Mmai pptMmai ppt
Mmai ppt
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Blockdiagramof8085.ppt
Blockdiagramof8085.pptBlockdiagramof8085.ppt
Blockdiagramof8085.ppt
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Microprocessor VIVA.pptx
Microprocessor VIVA.pptxMicroprocessor VIVA.pptx
Microprocessor VIVA.pptx
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
8051 microcontrolle rclass1
8051 microcontrolle rclass18051 microcontrolle rclass1
8051 microcontrolle rclass1
 
8051 (microcontroller)class1
8051 (microcontroller)class18051 (microcontroller)class1
8051 (microcontroller)class1
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 

flag register of 8086

  • 1. FLAG REGISTER OF 8086 PRESENTED BY: M.ASRITHA(16711A0540)
  • 2. WHAT IS FLAGS REGISTER?? THE FLAGS REGISTER IS THE STATUS REGISTER IN INTEL X86 MICROPROCESSORS THAT CONTAINS THE CURRENT STATE OF THE PROCESSOR. THIS REGISTER IS 16 BITS WIDE. ITS SUCCESSORS, THE EFLAGS AND RFLAGS REGISTERS, ARE 32 BITS AND 64 BITS WIDE, RESPECTIVELY. THE WIDER REGISTERS RETAIN COMPATIBILITY WITH THEIR SMALLER PREDECESSORS. WE ARE GOING TO DISCUSS ABOUT THE FLAGS REGISTERS HERE.
  • 3. CATEGORY OF FLAGS REGISTERS THERE ARE 2 TYPES OF FLAGS REGISTER. • STATUS FLAGS • CONTROL FLAGS. THIS REGISTER IS 16 BITS WIDE. THE STATUS FLAGS ARE LOCATED IN 0, 2, 4, 6, 7 AND 11 BITS. CONTROL FLAGS ARE LOCATED IN 8, 9 AND 10 BITS AND THE SYSTEM FLAGS ARE LOCATED IN 12,13 AND 14 BITS AND OTHERS LEFT BITS ARE RESERVED BITS.
  • 4. STATUS FLAGS THERE ARE 6 STATUS FLAGS IN 8086 PROCESSOR. • CARRY FLAG • PARITY FLAG • AUXILIARY FLAG • ZERO FLAG • SIGN FLAG • OVERFLOW FLAG
  • 5.
  • 6. CARRY FLAG IN 8086 PROCESSORS THE CARRY FLAG IS A SINGLE BIT IN A SYSTEM STATUS REGISTER USED TO INDICATE WHEN AN ARITHMETIC CARRY OR BORROW HAS BEEN GENERATED OUT OF THE MOST SIGNIFICANT ALU BIT POSITION. THE CARRY FLAG ENABLES NUMBERS LARGER THAN A SINGLE ALU WIDTH TO BE ADDED/SUBTRACTED BY CARRYING A BINARY DIGIT FROM A PARTIAL ADDITION/SUBTRACTION TO THE LEAST SIGNIFICANT BIT POSITION OF A MORE SIGNIFICANT WORD. IT IS LOCATED IN THE 0 BITS IF A 8086 PROCESSOR.
  • 7. PARITY FLAG IN 8086 PROCESSORS THE PARITY FLAG INDICATES IF THE NUMBER OF SET BITS IS ODD OR EVEN IN THE BINARY REPRESENTATION OF THE RESULT OF THE LAST OPERATION. IT IS NORMALLY A SINGLE BIT(2) IN A PROCESSOR STATUS REGISTER. FOR EXAMPLE, ASSUME A MACHINE WHERE A SET PARITY FLAG INDICATES EVEN PARITY. IF THE RESULT OF THE LAST OPERATION WERE 26 (11010 IN BINARY), THE PARITY FLAG WOULD BE 0 SINCE THE NUMBER OF SET BITS IS ODD. SIMILARLY, IF THE RESULT WERE 102 (1100110 IN BINARY) THEN THE PARITY FLAG WOULD BE 1.
  • 8. AUXILIARY FLAG THE AUXILIARY FLAG IS A FLAG STORED IN THE FLAGS REGISTER ON ALL 8086 PROCESSORS. IT IS BIT 4. IT IS USED TO INDICATE WHEN AN ARITHMETIC CARRY OR BORROW HAS BEEN GENERATED OUT OF THE 4 LEAST SIGNIFICANT BITS. IT IS PRIMARILY USED IN BCD ARITHMETIC.  AUXILIARY FLAG IS SET (AF=1) IF THERE IS A CARRY FROM LOW NIBBLE TO HIGH NIBBLE OR A BORROW FROM A HIGH NIBBLE TO LOW NIBBLE OF THE LOW ORDER 8- BIT OF A 16- BIT NUMBER.
  • 9. ZERO FLAG THE ZERO FLAG IS A SINGLE BIT FLAG LOCATED IN 6 BIT OF A 8086 PROCESSOR. THE ZERO FLAG IS USED TO CHECK THE RESULT OF AN ARITHMETIC OPERATION, INCLUDING BITWISE LOGICAL INSTRUCTIONS. IT IS SET IF AN ARITHMETIC RESULT IS ZERO, AND RESET OTHERWISE. THIS INCLUDES RESULTS WHICH ARE NOT STORED, AS MOST TRADITIONAL INSTRUCTION SETS IMPLEMENT THE COMPARE INSTRUCTION AS A SUBTRACT WHERE THE RESULT IS DISCARDED. IT IS ALSO COMMON THAT PROCESSORS HAVE A BITWISE AND- INSTRUCTION THAT DOES NOT STORE THE RESULT. IN MOST PROCESSORS, THE ZERO FLAG IS MAINLY USED IN CONDITIONAL BRANCH INSTRUCTIONS, WHICH ALTER CONTROL FLOW ON PREVIOUS INSTRUCTION RESULTS, BUT THERE ARE OFTEN OTHER USES AS WELL.
  • 10. SIGN FLAG IN A 8086 PROCESSOR THE SIGN FLAG OR NEGATIVE FLAG IS A SINGLE BIT IN A SYSTEM STATUS (FLAG) REGISTER USED TO INDICATE WHETHER THE RESULT OF THE LAST MATHEMATICAL OPERATION RESULTED IN A VALUE WHOSE MOST SIGNIFICANT BIT WAS SET. IN A TWO'S COMPLEMENT INTERPRETATION OF THE RESULT, THE NEGATIVE FLAG IS SET IF THE RESULT WAS NEGATIVE. FOR EXAMPLE, IN AN 8-BIT SIGNED NUMBER SYSTEM, -37 WILL BE REPRESENTED AS 1101 1011 IN BINARY (THE MOST SIGNIFICANT BIT IS 1), WHILE +37 WILL BE REPRESENTED AS 0010 0101 (THE MOST SIGNIFICANT BIT IS 0).
  • 11. OVERFLOW FLAG IN 8086 PROCESSORS, THE OVERFLOW FLAG (SOMETIMES CALLED V FLAG) IS USUALLY A SINGLE BIT IN A SYSTEM STATUS REGISTER USED TO INDICATE WHEN AN ARITHMETIC OVERFLOW HAS OCCURRED IN AN OPERATION, INDICATING THAT THE SIGNED TWO'S-COMPLEMENT RESULT WOULD NOT FIT IN THE NUMBER OF BITS USED FOR THE OPERATION (THE ALU WIDTH). SOME ARCHITECTURES MAY BE CONFIGURED TO AUTOMATICALLY GENERATE AN EXCEPTION ON AN OPERATION RESULTING IN OVERFLOW.
  • 12. CONTROL FLAGS THERE ARE 3 CONTROL FLAGS IN 8086 PROCESSOR. • TRAP FLAG • INTERRUPT ENABLE FLAG • DIRECTION FLAG .
  • 13.
  • 14. TRAP FLAG A TRAP FLAG PERMITS OPERATION OF A PROCESSOR IN SINGLE-STEP MODE. IF SUCH A FLAG IS AVAILABLE, DEBUGGERS CAN USE IT TO STEP THROUGH THE EXECUTION OF A COMPUTER PROGRAM. THE 8086 HAS NO INSTRUCTION TO DIRECTLY SET OR RESET THE TRAP FLAG. THESE OPERATIONS ARE DONE BY PUSHING THE FLAG REGISTER ON THE STACK, CHANGING THE TRAP FLAG BIT TO WHAT THE PROGRAMMER WANTS IT TO BE, AND THEN POPPING THE FLAG REGISTER BACK OFF THE STACK.
  • 15. INTERRUPT FLAG  THE BIT, WHICH IS BIT 9 OF THE FLAGS REGISTER, MAY BE SET OR CLEARED BY PROGRAMS WITH SUFFICIENT PRIVILEGES, AS USUALLY DETERMINED BY THE OPERATING SYSTEM. IF THE FLAG IS SET TO 1, MASKABLE HARDWARE INTERRUPTS WILL BE HANDLED. IF CLEARED (SET TO 0), SUCH INTERRUPTS WILL BE IGNORED. IF DOES NOT AFFECT THE HANDLING OF NON- MASKABLE INTERRUPTS OR SOFTWARE INTERRUPTS GENERATED BY THE INT INSTRUCTION. INTERRUPT FLAG IS A SYSTEM FLAG BIT IN THE 8086 PROCESSOR’S FLAGS REGISTER, WHICH DETERMINES WHETHER OR NOT THE CPU WILL HANDLE MASKABLE HARDWARE INTERRUPTS.
  • 16. DIRECTION FLAG THE DIRECTION FLAG IS A FLAG THAT CONTROLS THE LEFT-TO- RIGHT OR RIGHT- TO-LEFT DIRECTION OF STRING PROCESSING, STORED IN THE FLAGS REGISTER ON ALL 8086 PROCESSORS. IT IS BIT NUMBER 10. WHEN IT IS SET TO 0 (USING THE CLEAR-DIRECTION-FLAG INSTRUCTION CLD),IT MEANS THAT INSTRUCTIONS THAT AUTO INCREMENT THE SOURCE INDEX AND DESTINATION INDEX (LIKE MOVS) WILL INCREASE BOTH OF THEM. IN CASE IT IS SET TO 1 (USING THE SET-DIRECTION-FLAG INSTRUCTION STD), THE INSTRUCTION WILL DECREASE THEM. THIS FLAG IS USED TO DETERMINE THE DIRECTION (FORWARD OR BACKWARD) IN WHICH SEVERAL BYTES OF DATA WILL BE COPIED FROM ONE PLACE IN THE MEMORY.