jal

Jump and link

Jump to a PC-relative offset and store the return address in xd.

Assembly format

jal xd, imm

Decode Variables

signed Bits<21> imm = sext({$encoding[31], $encoding[19:12], $encoding[20], $encoding[30:21], 1'd0}, 21);
Bits<5> xd = $encoding[11:7];

Execution

XReg return_addr = $pc + 4;
X[xd] = return_addr;
jump_halfword($pc + $signed(imm));

Exceptions

This instruction may result in the following synchronous exceptions:

  • InstructionAddressMisaligned

Encoding

svg

Defining extension

I

Access

M

Always

Containing profiles

  • Mandatory: RVA20S64, RVA20U64, RVA22S64, RVA22U64, RVA23S64, RVA23U64, RVB23S64, RVB23U64, RVI20U32, RVI20U64

  • Optional: None