0
8.8kviews
Explain the flag register of 8086 microprocessor.
1 Answer
0
311views

It has 9 Flags. These flags are of two types: 6-Status (Condition) Flags and 3-Control Flags. Status flags are affected by the ALU, after every arithmetic or logic operation. They give the status of the current result. The Control flags are used to control certain operations. They are changed by the programmer.

Flag Register

Status Flags

  1. Carry flag (CY): It is set whenever there is a carry {or borrow} out of the MSB of a the result (D7 bit for an 8-bit operation and D15 bit for a 16-bit operation).
  2. Parity Flag (PF): It is set if the result has even parity.
  3. Auxiliary Carry Flag (AC): It is set if a carry is generated out of the Lower Nibble. It is used only in 8-bit operations like DAA and DAS.
  4. Zero Flag (ZF): It is set if the result is zero.
  5. Sign Flag (SF): It is set if the MSB of the result is 1. For signed operations, such a number is treated as –ve.
  6. Overflow Flag (OF): It will be set if the result of a signed operation is too large to fit in the number of bits available to represent it. It can be checked using the instruction INTO (Interrupt on Overflow).

Control Flags

  1. Trap Flag (TF): It is used to set the Trace Mode i.e. start Single Stepping Mode. Here the µP is interrupted after every instruction so that, the program can be debugged.
  2. Interrupt Enable Flag (IF): It is used to mask (disable) or unmask (enable) the INTR interrupt.
  3. Direction Flag (DF): If this flag is set, SI and DI are in auto-decrementing mode in String Operations.
Please log in to add an answer.