RISC-V beqz Pseudo-Instruction Details
Assembler pseudo-instructionBranch if equal zero pseudo-instruction, expands to beq rs, x0, offset. Branches when a register equals zero. Common for null pointer checks, loop termination, and flag testing.
What This Pseudo Instruction Is Saving You From Writing
More naturally expresses 'branch if zero' control flow than beq rs, x0, offset. The assembler provides it as an alias to simplify code reading and writing.
Official Semantics Checklist
How To Read The Expansion
What You May See In objdump / Disassembly
Official References And Reading Order
This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.
When To Think Of It First
Pitfalls / Common Confusions
FAQ
Is beqz a real RISC-V instruction?
beqz is an assembler pseudo-instruction or alias, not a separate hardware opcode. The “Typical Real Expansion” section lists the official expansion, and behavior is defined by the expanded ISA instructions.
What is the main trap when using beqz?
Branch range is only ±4 KiB (B-type immediate limit) — far branches need beqz + j combo