Flags Register

From CPUDev Wiki
Jump to: navigation, search

The flags register is a register present in many ISAs. It keeps track of various conditions that were true or false after executing the last instruction.

Common Flags

  • Zero flag - Whether the result is zero.
  • Sign flag - Whether the result is negative.
  • Carry flag - Used as an extension bit for various arithmetic operations. For example, as a "carry" bit for ADD or a "borrow" bit for SUB.
  • Overflow flag - Whether the last operation overflowed.


  • Easier to keep track of various conditions
  • Easier to do multiword arithmetic - Specifically the carry and/or overflow flag(s) allow to easily keep track and propagate carry values from one word to another word. While it does solve the problem for addition, subtraction and possibly shifts by one bit, it doesn't solve the problem for multiplication and division.


  • More complex circuitry - The gates used for determining conditions plus the flags register itself take up space.
  • Potentially slower circuitry - Determining flag values imposes a delay when determining dependencies for Out-of-Order Execution.