You copied the Doc URL to your clipboard.

CBNZ, CBZ

Compare and Branch on Nonzero and Compare and Branch on Zero compare the value in a register with zero, and conditionally branch forward a constant value. They do not affect the condition flags.

T1

1514131211109876543210
1011op0i1imm5Rn

CBNZ (op == 1)

CBNZ{<q>} <Rn>, <label>

CBZ (op == 0)

CBZ{<q>} <Rn>, <label>

n = UInt(Rn);  imm32 = ZeroExtend(i:imm5:'0', 32);  nonzero = (op == '1');
if InITBlock() then UNPREDICTABLE;

For more information about the constrained unpredictable behavior, see Architectural Constraints on UNPREDICTABLE behaviors.

Assembler Symbols

<q>

See Standard assembler syntax fields.

<Rn>

Is the general-purpose register to be tested, encoded in the "Rn" field.

<label>

Is the program label to be conditionally branched to. Its offset from the PC, a multiple of 2 and in the range 0 to 126, is encoded as "i:imm5" times 2.

Operation

EncodingSpecificOperations();
if nonzero != IsZero(R[n]) then
    BranchWritePC(PC + imm32, BranchType_DIR);
Was this page helpful? Yes No