Flag Register
The flag register is also called as status register. It is a 16-bit register which is a set of flip-flops. There are nine flags in this register.
The flag register is classified into two categories:
Conditional Flags
These flags are used to hold the result obtained by ALU i.e., by arithmetical and logical operations. There are six conditional flags:
- Carry Flag(CF): If any arithmetic operation results in the production of carry in the MSB position then this extra bit is stored in the carry flag. The carry flag is set i.e. 1 when the carry is generated, otherwise is reset, i.e. 0.
- Auxiliary Carry Flag(AF): If the carry is generated in the 4th bit from the LSB then that carry is called as auxiliary carry. The auxiliary carry flag is set i.e. 1 when the auxiliary carry carry is generated, otherwise is reset, i.e. 0.
- Parity Flag(PF): This flag is used to store the parity of the result of any arithmetic and logical operation. The value of parity flag is 1 (i.e., set) when the result is of even parity(the number of 1’s in result is odd) whereas the value of parity flag is 0(i.e., reset) when the result is of odd parity(the number of 1’s in result is even).
- Zero Flag(ZF): If the result of any arithmetic and logical operations results in zero, then this flag is set otherwise reset.
- Sign Flag(SF): The value of sign flag is 1 (i.e., set) when the result of any operation performed by ALU results in a negative number, whereas its value is 0 (i.e., reset) when the result is a positive number.
- Overflow Flag(OF): If the result is within the capacity of the register then overflow flag is reset, whereas if the result exceeds the value of the register then the flag is set.
Control Flags
These flags are used to control some specific operations of the processor with the help of some specific instructions. The 8086 microprocessor provides three control flags:
- Trap Flag(TF): When the trap flag is set then the processor will execute the whole program at once, whereas the trap flag is reset the program will be executed in step-by-step sequence.
- Interrupt Flag(IF): This flag is set when the maskable interrupt is enabled, whereas it is reset when the the maskable interrupt is disabled.
- Direction Flag(DF): This flag is reset when the bits are accessed from higher memory address to lower memory address, whereas the direction flag is reset when the bits are accessed from lower memory address to higher memory address.
Types of Registers in 8086 Microprocessor
A microprocessor is a register-based clock-driven digital device that is used for data processing. It is a multipurpose device that is capable of producing outputs when provided binary data as input. In computers, the microprocessor is like the brain, handling tasks and calculations. Inside the microprocessor are tiny storage units called registers.
An 8086 microprocessor is 40 pin microprocessor, which was designed by INTEL in 1976. It is a 16-bit microprocessor that has 20 address lines and provides storage up to 1MB. It provides two modes of operation:
- Minimum Mode, suitable for systems having multiple processors
- Maximum Mode, suitable for systems having single processors.
Table of Content
- Types of Registers in 8086 Microprocessor
- General Purpose Registers
- Segment Registers
- Special Purpose Registers
- Flag Register
Contact Us