CBZ and CBNZ

Compare and Branch on Zero, Compare and Branch on Non-Zero.

Show/hideSyntax

CBZ Rn, label
CBNZ Rn, label

where:

Rn

is the register holding the operand.

label

is the branch destination.

Show/hideUsage

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

Show/hideRestrictions

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.

Show/hideCondition flags

These instructions do not change the flags.

Show/hideArchitectures

These 16-bit Thumb instructions are available in ARMv6T2 and above.

There are no ARM or 32-bit Thumb versions of these instructions.

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0489E
Non-ConfidentialID071611