| |||
| Home > ARM and Thumb Instructions > Branch and control instructions > CBZ and CBNZ | |||
Compare and Branch on Zero, Compare and Branch on Non-Zero.
CBZRn,label
CBNZRn,label
where:
Rnis the register holding the operand.
labelis the branch destination.
You can use the CBZ or CBNZ instructions
to avoid changing the condition code flags and to reduce the number
of instructions.
Except that it does not change the condition code flags, CBZ
Rn, label is equivalent to:
CMP Rn, #0
BEQ label
Except that it does not change the condition code 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.