This is a list of the most common CPU status register flags, implemented in almost all modern processors.
On some processors, the status register also contains flags such as these:
Status flags enable an instruction to act based on the result of a previous instruction. In pipelined processors, such as superscalar and speculative processors, this can create hazards that slow processing or require extra hardware to work around them.4
Some very long instruction word processors dispense with the status flags. A single instruction both performs a test and indicates on which outcome of that test to take an action, such as Compare a with b and Jump to c if Equal. The result of the test is not saved for subsequent instructions.
Another alternative to the status register is for processor instructions to deposit status information in a general-purpose register when the program requests it. MIPS, AMD 29000, DEC Alpha, and RISC-V are examples of architectures that provide comparison instructions that store the comparison result in a general-purpose register, as a single bit or a numeric value of 0 or 1. Conditional branches act based on the value in the general-purpose register.
Usually, comparison instructions test equality or signed/unsigned magnitude. To test for other conditions, a program uses an equivalence formula. For example, MIPS has no "carry bit" but a program performing multiple-word addition can test whether a single-word addition of registers overflowed by testing whether the sum is lower than an operand:5
The sltu instruction sets tmp to 1 or 0 based on the specified comparison of its two other operands. (Here, the general-purpose register tmp is not used as a status register to govern a conditional jump; rather, the possible value of 1, indicating carry from the low-order addition, is added to the high-order word.)
This scheme becomes less convenient when adding three or more words, as there are two additions when computing b + c + tmp, either of which may generate a carry, which must be detected with two sltu instructions. Fortunately, those two carries may be added to each other without risk of overflow, so the situation stabilizes at five instructions per word added.
"ARM Information Center". infocenter.arm.com. Retrieved 2019-05-18. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/Babcfejg.html ↩
"Toshiba 900 Operation Manual, chap. 3" (PDF). Archived from the original (PDF) on 2006-01-15. https://web.archive.org/web/20060115084555/http://www.semicon.toshiba.co.jp/eng/prd/micro/td/900family/900l/kyoutu/pdf/e_900l_chap3_cpu.pdf ↩
"Atmel 8-Bit Microcontroller With 4/8/16/32KBytes In-system Programmable Flash - Datasheet" (PDF). Microchip Technology. http://ww1.microchip.com/downloads/en/devicedoc/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf ↩
Mashey, John (1996-06-04). "Carry bits; The Architect's Trap". Retrieved 2013-10-05. http://yarchive.net/comp/carry_bit.html ↩