RISC-V jr Pseudo-Instruction Details
Assembler pseudo-instructionRegister-indirect jump pseudo-instruction, commonly expanded as jalr x0, 0(rs). It does not save a return address; it only transfers control to the target address held in a register.
What This Pseudo Instruction Is Saving You From Writing
Expresses unlinked indirect-jump semantics more clearly than jalr x0, 0(rs). Unlike ret, jr is a general indirect jump; ret specifically returns via ra.
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 jr a real RISC-V instruction?
jr 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 jr?
jr does not write a return address; use a linking JALR form for an indirect call that must return