tbz

Test Bit Zero

TBZ <Wt|Xt>, #<imm>, <label>

Branches if specified bit is 0.

Pseudocode Operation

bit_index ← (b5 << 5) | imm14; if (Wt|Xt)[bit_index] == 0 then PC ← label

Example

TBZ Wt, #16, label

Encoding

Binary Layout
b5
31
011011
30:25
0
24
b40
23:19
imm14
18:5
Rt
4:0
 
Format Branch
Opcode 0x36000000
Extension Base

Operands

  • Wt
    Reg
  • imm
    Bit
  • label
    Label

Related

More in Base

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x36000000 TBZ <R><t>, #<imm>, <label> A64 b5 | 011011 | 0 | b40 | imm14 | Rt

Description

Test bit and Branch if Zero compares the value of a test bit with zero, and conditionally branches to a label at a PC-relative offset if the comparison is equal. It provides a hint that this is not a subroutine call or return. This instruction does not affect condition flags.

Operation

bits(datasize) operand = X[t, datasize];
if operand<bit_pos> == op then
    BranchTo(PC64 + offset, BranchType_DIR, TRUE);
else
    BranchNotTaken(BranchType_DIR, TRUE);