CBZ and CBNZ
Compare and Branch on Zero, Compare and Branch on Non-Zero.
CBZ Rn, label
CBNZ Rn, label
is the register holding the operand.
is the branch destination.
You can use the CBZ or CBNZ instructions to avoid changing the condition flags and to reduce the number of instructions.
Except that it does not change the condition flags, CBZ Rn, label is equivalent to:
CMP Rn, #0 BEQ label
Except that it does not change the condition flags, CBNZ Rn, label is equivalent to:
CMP Rn, #0 BNE label
The branch destination must be within 4 to 130 bytes after the instruction and in the same execution state.
These instructions must not be used inside an IT block.
These instructions do not change the flags.
These 16-bit Thumb instructions are available in ARMv6T2 and above.
There are no ARM or 32-bit Thumb encodings of these instructions.