RISC-V zext-b Pseudo-Instruction Details
Assembler pseudo-instructionZero-extend-byte pseudo-instruction, expressible per the official assembly manual as andi rd, rs, 255. It keeps the low 8 bits and clears the high bits.
What This Pseudo Instruction Is Saving You From Writing
Byte data often needs conversion to an unsigned integer; zext.b states “keep the low 8 bits and clear the high bits” more directly than andi 255.
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 zext-b a real RISC-V instruction?
zext-b 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 zext-b?
This is zero extension and does not preserve sign; signed bytes need a sign-extension path