8-Bit AVR® Status Register

The Status register contains information about the result of the most recently executed arithmetic instruction. This information can be used for altering program flow in order to perform conditional operations. The Status register is updated after all the Arithmetic Logical Unit (ALU) operations. This will, in many cases, remove the need for using the dedicated compare instructions, resulting in faster and more compact code.

The Status register is not automatically stored when entering an interrupt routine and restored when returning from an interrupt. This must be handled by the software.

When addressing I/O Registers as data space using LD and ST instructions, the provided offset must be used. When using the I/O specific commands IN and OUT, the offset is reduced by 0x20, resulting in an I/O address offset within 0x00-0x3F.

STATUS: Status Register

R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0
bit 7 bit 0

bit 7

I : Global Interrupt Enable: The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the Global Interrupt Enable register is cleared, none of the interrupts are enabled independently of the individual interrupt enable settings. The I-bit (bit 7) is cleared by hardware after an interrupt has occurred and is set by the Return from Interrupt (RETI) instruction to enable subsequent interrupts. The I-bit can also be set and cleared by the application with the Set Global Interrupt Flag (SEI) and Clear Global Interrupt Flag (CLI) instructions, as described in the instruction set reference.

bit 6

T : Copy Storage: The Bit Copy instructions Bit Load (BLD) and Bit Store (BST) use the T-bit as a source or destination for the operated bit. A bit from a register in the register file can be copied into T by the BST instruction and a bit in T can be copied into a bit in a register in the register file by the BLD instruction.

bit 5

H : Half Carry Flag: The Half Carry Flag, H, indicates a half carry in some arithmetic operations. It is useful in Binary Code Decimal (BCD) arithmetic.

bit 4

S : Sign Flag, S = N xor V: The S-bit is always an exclusive or between the Negative Flag and the Two’s Complement Overflow Flag.

bit 3

V : Two's Compliment Overflow Flag: The Two’s Complement Overflow Flag, V, supports two’s complement arithmetic.

bit 2

N : Negative Flag: The Negative Flag, N, indicates a negative result in an arithmetic or logic operation.

bit 1

Z : Zero Flag: The Zero Flag, Z, indicates a zero result in an arithmetic or logic operation.

bit 0

C : Carry Flag: The Carry Flag, C, indicates a carry in an arithmetic or logic operation.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.