JAL
Jump and Link
JAL rd, offset
Jumps to an offset relative to PC and saves the return address (PC+4) to rd.
Encoding
Binary Layout
jimm20
31:12
rd
11:7
1101111
6:0
Operands
-
rd
Return Address Dest -
offset
20-bit PC-relative Offset
Example
JAL x1, loop_target
// Jump to 'loop_target' and save return address in x1 (ra).
Related
More in RV32I
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
JAL (Jump and Link) adds the sign-extended J-immediate (encoded in multiples of 2 bytes) to the PC of the JAL instruction to form the jump target, stores PC+4 into rd as a return address, then jumps. Plain unconditional jumps use rd=x0.
Operation
R[rd] = PC + 4; PC += sext(offset);