BEQZ

Branch if Equal to Zero

BEQZ rs, offset

Branches if the register is zero.

Details

BEQZ branches to the target if rs1 equals zero. It is a pseudoinstruction for BEQ rs1, x0, offset.

Pseudocode Operation

if (R[rs] == 0) PC += offset;

Example

BEQZ x10, exit

Encoding

Binary Layout
imm[12]
31
imm[10:5]
30:25
00000
24:20
rs1
19:15
000
14:12
imm[4:1]
11:8
imm[11]
7
1100011
6:0
 
Format B-Type
Opcode 0x63
Extension Pseudo

Operands

  • rs
    Source
  • offset
    Label