Flag Register in 8086.pptx with the notenot

648 views 7 slides Mar 21, 2024
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

notes


Slide Content

Flag Register in 8086 Microprocessor Presented by Khairnar sayali

What is a flag register in 8086 microprocessor? 8086 has 16-bit flag dividing two parts : 16-bit flag :- 1) 9 flag = i ) status flag ii) control flag 2) 6 flag=unused Flag register is a 16-bit register, but there are only 9 flags avalaiable in the 8086 microprocessor.

Flag register of 8086

Types of flags of flag register in 8086 microprocessor flags:-There are two types of flags of flag register in 8086 microprocessor: 1) status flags 2) control flags Status flags In the flag register, 6 out of 9 flags are used as status flags. When the microprocessor performs an arithmetic or logical operation in ALU, then depending upon the status of the result, the microprocessor will store corresponding status bits 0 or 1 in status flags. The status flags are, Carry flag (CF) Parity flag (PF) Auxiliary carry flag (AF) Zero flag (ZF) Sign flag (SF), and Overflow flag (OF).

CF : It stands for carry flag.  If CF = 1 ; it means carry is generated from the MSB. If CF = 0 ; no carry is generated out of MSB. E xample : PF: it stands for parity flag. If PF =1 ; it means it is even parity in the result (there are even numbers of 1’s). If PF =0; it means it is odd parity. In example 1, there are 4 ones’ which is even , in the second example there are 5 ones’ which is odd in count .

AF AF stands for auxiliary flag. As 8-bits form a byte, similarly 4 bits form a nibble. So in 16 bit operations there are 4 nibbles. If AF = 1 ; there is a carry out from lower nibble. If AF = 0 ;no carry out of lower nibble. ZF : This is zero flag. Whenever the output is  0  this flag is 1. If ZF = 1 ; output is zero. If ZF = 0 ; output is non zero. OF: OF stands for overflow flag. The are two types of numbers  1.Signed 2.Unsigned SF: If the result after performing any arithmetic or logic operation in the given instruction is negative ,then the sign flag is set to 1. Else,for a positive result ,the sign flag remains reset.

Control flag : There are three types of control flags,: TF:This stands for trap flag. Generally processors give output after the complete program, but when TF = 1, output is given after every instruction.This is useful to check logical errors, when the program is too long .
Tags