A status register
(also: flag register
or condition code register (CCR)
) is a collection of flag bits
for a processor
. A popular example of a status register is the FLAGS register
of x86 architecture
Common status register flags
- Z — Zero flag. Indicates that the result of a mathematical or logical operation was zero.
- C — Carry flag. Indicates that the result of an operation produced an answer greater than the number of available bits. (This flag may also be set before a mathematical operation as an extra operand to certain instructions, e.g. "add with carry".)
- X — Extend bit.
- N (or S) — Negative or Sign flag. Indicates that the result of a mathematical operation is negative. In some processors, the N and S flags have different meanings: the S flag indicates whether a subtraction or addition has taken place, whereas the N flag indicates whether the last operation result is positive or negative.
- V (or O or W) — Overflow flag. Indicates that the result of an operation has overflowed according to the CPU's word representation, similar to the carry flag but for signed operations.
- I (or E) — Interrupt enable flag. Interrupts can be enabled or disabled by respectively setting or clearing this flag. Modifying this flag may be restricted to programs executing in supervisor mode.
- P — Parity flag. Indicate that the number of bits of the result is odd or even.
- D (or T) — Debug or Trap flag. Specifies that a special tracing interrupt is generated immediately after each single instruction is executed. This is used to implement program code debuggers.