Friday, August 26, 2016

Flags in Microprocessor (8085 and 8086)


Flags is an status register containing flip-flops that shows the current status of the processor. Flags helps the processor to determine the changes made by any Arithmetic Operation.
8085 microprocessor has an 8-bit flags register with 5- bit positions. Flags namely,
  • Sign Flag
  • Zero Flag
  • Auxiliary Carry Flag
  • Parity Flag
  • Carry Flag
are present in 8085.


Sign Flag (S): It is set (1) when the result of an operation is less than 0 or the answer is negative.

Zero Flag (Z): It is set when the result obtained is zero.

Axuiliary Carry Flag (AC): It is set when there is an carry from the lower nibble to the upper nibble.

Parity Carry (P): It is set when there is an even number of 1's.

Carry Flag (C): It is set when there is an carry or borrow during an addition or subtraction operation.

8086 Microprocessor has 16-bit status register with 9-bit postions that includes all the flags provided by 8085 with the addition of 4 other flags for string manupulation, interrupt handling and debugging. The flags in 8086 microprocessor are,
  • OverFlow Flag
  • Direction Flag
  • Interrupt Flag
  • Trap Flag
  • Sign Flag
  • Zero Flag
  • Auxiliary Carry Flag
  • Parity Flag
  • Carry Flag

Overflow Flag (OF): It is set (1) when the result of an operation exceeds / overflows the capacity.

Direction Flag (DF): It is set by the user to specify the direction in which data is read. It is used in string manipulation.

Interrupt Flag (IF): It is set to disable the hardware interrupt temporarily.

Trap Flag (TF): It is used to change the exection process to Single Step Execution. It is used by debuggers for debugging process as it helps to find the source of error.

The Sign Flag (SF), Zero Flag (ZF), Auxiliary Carry Flag(AC), Parity Flag (PF) and Carry Flag (CF) has the same functionalities as the flags in 8085.

No comments:

Post a Comment