Flag Register of 8086 Microprocessor

 

Flag Register:

   




 

                        8086 microprocessor contains a 16 bit flag register. Out of these 16 bits only 9 flags are active (used). The 9 flags are classified into 2 types.


CONDITIONAL FLAGS:

These are 6 flags in this category. These flags are set (logic ‘1’) or reset (logic ‘0’) by microprocessor depending upon the result produced by the execution of arithmetic or logical instruction. The 6 conditional flags are.

1)      Carry Flag (CF) – The flag is set 1 (CF=1) when there is carry out of BIT- 7 or BIT- 15 (MSB).

2)      Auxiliary carry flag (AF) – This flag is set 1 (AF=1) when there is a carry out of BIT- 3 to BIT- 4 or BIT- 7 to BIT- 8.

3)      Sign flag (SF) – Sign Flag is equal to MSB bit. If MSB = 1 means result is negative & MSB = 0 then result is positive.

4)      Zero flag (ZF) – This flag set 1 when result of an operation is zero.

5)      Parity flag (PF) – Parity is counts of ones in result number. PF = 0 for ODD parity & PF = 1 for EVEN parity.

6)      Overflow flag – This flag is set when the result crosses its boundary or out of range.

CONTROL FLAGS :

                              These flags are set or reset by users to control the operation of 8086. These flags are set or reset with specific instruction using in the program. The 3 control flags are:

1)      Interrupt Flag (IF) – When this flag is set it means that 8086 can accept interrupt request from i/o device during the execution of program.

2)      Trap flag (TF) – When this flag is set to 1 then 8086 enter in single stepping mode. In single stepping mode 8086 executes only 1 instruction & wait for user.

3)      Direction Flag (DF) – This flag is used in case of string instructions to auto increment or auto decrement operation of SI & DI register

Post a Comment

0 Comments