Jump to content

Status register: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 44: Line 44:


==See also==
==See also==
*[[Flag byte]]
*[[Flag byt
*[[Flag (computing)]]
*[[Flag (computing)]]
*[[FLAGS register (computing)]]
*[[FLAGS register (computing)]]

Revision as of 11:07, 15 September 2010

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.

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 Masks the XIRQ request when set. It is set by the hardware and cleared by the software as well is set by unmaskable XIRQ.
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 or exception is generated immediately after each single instruction is executed. This is used to implement program code debuggers.

See also

References