Status register

From Wikipedia, the free encyclopedia

  (Redirected from Condition Code Register)
Jump to: navigation, search

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 based microprocessors.

[edit] Common status register flags

Flag Name Description
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 flag (?)
N / S Negative / Sign flag Indicates that the result of a mathematical operation is negative. In some processors[1], 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 / O / 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 / 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 / T Debug / 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.

[edit] See also

[edit] References

  1. ^ Toshiba 900 Operation Manual, chap. 3