ARM CPU Flags

Code Suffix Flags Meaning
0: EQ Z=1 equal (zero) (same)
1: NE Z=0 not equal (nonzero) (not same)
2: CS/HS C=1 unsigned higher or same (carry set)
3: CC/LO C=0 unsigned lower (carry cleared)
4: MI N=1 negative (minus)
5: PL N=0 positive or zero (plus)
6: VS V=1 overflow (V set)
7: VC V=0 no overflow (V cleared)
8: HI C=1 and Z=0 unsigned higher
9: LS C=0 or Z=1 unsigned lower or same
A: GE N=V greater or equal
B: LT N<>V less than
C: GT Z=0 and N=V greater than
D: LE Z=1 or N<>V less or equal
E: AL - always (the “AL” suffix can be omitted)
F: NV - never (ARMv1,v2 only) (Reserved ARMv3 and up)

Current Program Status Register (CPSR)

Bit Explanation Extra
31 N - Sign Flag (0=Not Signed, 1=Signed) ;\
30 Z - Zero Flag (0=Not Zero, 1=Zero) ; Condition
29 C - Carry Flag (0=Borrow/No Carry, 1=Carry/No Borrow) ; Code Flags
28 V - Overflow Flag (0=No Overflow, 1=Overflow) ;/
27 Q - Sticky Overflow (1=Sticky Overflow, ARMv5TE and up only)  
26-8 Reserved (For future use) - Do not change manually!  
7 I - IRQ disable (0=Enable, 1=Disable) ;\
6 F - FIQ disable (0=Enable, 1=Disable) ; Control
5 T - State Bit (0=ARM, 1=THUMB) - Do not change manually! ; Bits
4-0 M4-M0 - Mode Bits (See below) ;/

Bit 31-28: Condition Code Flags (N,Z,C,V)

Bit 27: Sticky Overflow Flag (Q)

Bit 27-8: Reserved Bits

Bit 7-0: Control Bits (I,F,T,M4-M0)

Binary Hex Dec Explanation
0xx00b 00h 0 - Old User
0xx01b 01h 1 - Old FIQ
0xx10b 02h 2 - Old IRQ
0xx11b 03h 3 - Old Supervisor
10000b 10h 16 - User (non-privileged)
10001b 11h 17 - FIQ
10010b 12h 18 - IRQ
10011b 13h 19 - Supervisor (SWI)
10111b 17h 23 - Abort
11011b 1Bh 27 - Undefined
11111b 1Fh 31 - System (privileged ‘User’ mode) (ARMv4 and up)

Writing any other values into the Mode bits is not allowed.

Saved Program Status Registers

Go back