Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Status register

Status register

Overview
A status register (also: flag register or condition code register (CCR)) is a collection of flag
Flag (computing)
In computer programming, flag refers to one or more bits that are used to store a binary value or code that has an assigned meaning. Flags are typically found as members of a defined data structure, such as a database record, and the meaning of the value contained in a flag will generally be...

 bit
Bit
In computing and telecommunications a bit is a basic unit of information storage and communication . It is the maximum amount of information that can be stored by a device or other physical system that can normally exist in only two distinct states...

s for a processor
Central processing unit
The Central Processing Unit or processor is the portion of a computer system that carries out the instructions of a computer program, and is the primary element carrying out the computer's functions. This term has been in use in the computer industry at least since the early 1960s...

. A popular example of a status register is the FLAGS register
FLAGS register (computing)
The FLAGS register is the status register in Intel x86 microprocessors that contains the current state of the processor. This register is 16-bits wide. Its successors, the EFLAGS and RFLAGS registers are 32-bits and 64-bits wide, respectively...

 of x86 architecture
X86 architecture
The term x86 refers to a family of instruction set architectures based on the Intel 8086. The term derived from the fact that many early processors backward compatible with the 8086 also had names ending in "86". Many additions and extensions have been added to the x86 instruction set over the...

 based microprocessors.
Discussion
Ask a question about 'Status register'
Start a new discussion about 'Status register'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
A status register (also: flag register or condition code register (CCR)) is a collection of flag
Flag (computing)
In computer programming, flag refers to one or more bits that are used to store a binary value or code that has an assigned meaning. Flags are typically found as members of a defined data structure, such as a database record, and the meaning of the value contained in a flag will generally be...

 bit
Bit
In computing and telecommunications a bit is a basic unit of information storage and communication . It is the maximum amount of information that can be stored by a device or other physical system that can normally exist in only two distinct states...

s for a processor
Central processing unit
The Central Processing Unit or processor is the portion of a computer system that carries out the instructions of a computer program, and is the primary element carrying out the computer's functions. This term has been in use in the computer industry at least since the early 1960s...

. A popular example of a status register is the FLAGS register
FLAGS register (computing)
The FLAGS register is the status register in Intel x86 microprocessors that contains the current state of the processor. This register is 16-bits wide. Its successors, the EFLAGS and RFLAGS registers are 32-bits and 64-bits wide, respectively...

 of x86 architecture
X86 architecture
The term x86 refers to a family of instruction set architectures based on the Intel 8086. The term derived from the fact that many early processors backward compatible with the 8086 also had names ending in "86". Many additions and extensions have been added to the x86 instruction set over the...

 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
Carry flag
In computer processors the carry flag is a single bit in a system status register used to indicate when an arithmetic carry or borrow has been generated out of the most significant ALU bit position. When used after an arithmetic operation it could be considered to be the unsigned equivalent of...

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
Negative flag
In computer processor the negative flag or sign flag is a single bit in a system status register used to indicate whether the result of last mathematic operation resulted in a value whose most significant bit was set...

 / 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 / O / W Overflow flag
Overflow flag
In computer processors, the overflow flag is usually a single bit in a system status register used to indicate when an arithmetic overflow has occurred in an operation....

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
Parity flag
In computer processors the parity flag indicates if the number of set bits is odd or even in the binary representation of the result of the last operation. It is normally a single bit in a processor status register....

Indicate that the number of bits of the result is odd or even.
D / T Debug / Trap flag
Trap flag
A trap is caused by the Trap Flag being set in the flags image, or using the debug registers to generate data breakpoints. In this case the return address is the instruction following the trap. Faults are generated by setting the debug registers for code execution breakpoints. As with all faults,...

Specifies that a special tracing interrupt is generated immediately after each single instruction is executed. This is used to implement program code debugger
Debugger
A debugger is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which will typically be...

s.

See also

  • Flag byte
    Flag byte
    A flag word is a generic term for a word used to indicate conditions within a binary computer. In particular, the byte can be used to show up to 8 discrete conditions...

  • Flag (computing)
    Flag (computing)
    In computer programming, flag refers to one or more bits that are used to store a binary value or code that has an assigned meaning. Flags are typically found as members of a defined data structure, such as a database record, and the meaning of the value contained in a flag will generally be...

  • FLAGS register (computing)
    FLAGS register (computing)
    The FLAGS register is the status register in Intel x86 microprocessors that contains the current state of the processor. This register is 16-bits wide. Its successors, the EFLAGS and RFLAGS registers are 32-bits and 64-bits wide, respectively...

  • Program status word
    Program status word
    In computers, the program status word is an area of memory or a hardware register which contains information about program state used by the operating system and the underlying hardware. It will normally include a pointer to the next instruction to be executed...

  • Control register
    Control register
    A control register is a processor register which changes or controls the general behavior of a CPU or other digital device. Common tasks performed by control registers include interrupt control, switching the addressing mode, paging control, and coprocessor control.-CR0:The CR0 register is 32 bits...