You copied the Doc URL to your clipboard.

CBZ and CBNZ

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

Syntax

CBZ Rn, label

CBNZ Rn, label

where:

Rn

is the register holding the operand.

label

is the branch destination.

Usage

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

Restrictions

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.

Condition flags

These instructions do not change the flags.

Architectures

These 16-bit instructions are available in T32 only.

There are no A32 or 32-bit T32 encodings of these instructions.

Related reference

Was this page helpful? Yes No