The status register is a hardware register which contains information about the state of the processor. Individual bits are implicitly or explicitly read and/or written by the machine code instructions executing on the processor. The status register in a traditional processor design includes at least three central flags: Zero, Carry, and Overflow, which are set or cleared automatically as effects of arithmetic and bit manipulation operations. One or more of the flags may then be read by a subsequent conditional jump instruction (including conditional calls, returns, etc. in some machines) or by some arithmetic, shift/rotate or bitwise operation, typically using the carry flag as input in addition to any explicitly given operands. There are also processors where other classes of instructions may read or write the fundamental zero, carry or overflow flags, such as block-, string- or dedicated input/output instructions, for instance.

Some CPU architectures, such as the MIPS and Alpha, do not use a dedicated flag register. Others do not implicitly set and/or read flags. Such machines either do not pass implicit status information between instructions at all, or they pass it in an explicitly selected general purpose register.

A status register may often have other fields as well, such as more specialized flags, interrupt enable bits, and similar types of information. During an interrupt, the status of the thread currently executing can be preserved (and later recalled) by storing the current value of the status register along with the program counter and other active registers into the machine stack or some other reserved area of memory.

Enables numbers larger than a single word to be added/subtracted by carrying a binary digit from a less significant word to the least significant bit of a more significant word as needed. It is also used to extend bit shifts and rotates in a similar manner on many processors (sometimes done via a dedicated X flag).

Indicates that the result of a mathematical operation is negative. In some processors,[1] the N and S flags are distinct with different meanings and usage: One indicates whether the last result was negative whereas the other indicates whether a subtraction or addition has taken place.

Indicates that a bit carry was produced between the nibbles (typically between the 4-bit halves of a byte operand) as a result of the last arithmetic operation. Such a flag is generally useful for implementing BCD arithmetic operations on binary hardware.

On some architectures, indicates that an interrupt is currently active, and that the currently executing code is part of an interrupt handler routine. On other architectures, indicates whether interrupts are enabled or masked.[2]

S

Supervisor flag

Indicates that CPU is operating in supervisor mode, having enhanced permissions enabled and access to special instructions typically reserved for the operating system itself, as opposed to the normal "user" instruction set.

Some RISC instruction set architectures dispose of centrally located arithmetic result status bits. The reasons cited are interlocking between commands setting/accessing status flag, which either leads to performance degradation or need of extra hardware to work around problems in pipelined, superscalar, and speculative processors.[3]MIPS, DEC Alpha, and AMD 29000 are examples of such architectures. Instead of most arithmetic/logical operations setting status flags implicitly, they provide explicit comparison instructions which store result in a general-purpose register as true/false (represented by a single bit or 0/1 integer). Conditional branches test true/false value in a general purpose register. Sometimes, compare and jump operations are combined in one instruction (e.g., compare two registers and jump if their values are equal).

Usually, comparison instructions provided for arithmetic equalities and inequalities. Testing other conditions like Carry or Overflow can be achieved employing equivalence formulas. For example, on MIPS, double-word (and generally, arbitrary-precision) addition can be achieved with the following assembly code:[3]

"sltu" instruction is "set 1 if less than, 0 otherwise". In the code above, it effectively calculates carry flag from alow + blow addition, using following equivalence expression: result of addition should be greater-or-equal than either operand; if it is less instead, it means that (two-complements) overflow occurred, i.e. a carry out.