← Home

c.jal

Jump and Link

C.JAL is an RV32C-only instruction that performs the same operation as C.J, but additionally writes the address of the instruction following the jump (pc+2) to the link register, x1. It expands to `jal` `x1, offset`.

Assembly format

c.jal imm

Encoding

1514131211109876543210
001imm01

Decode variables

VariableBitsWidth
imm[12], [8], [10:9], [6], [7], [2], [11], [5:3]11

Execution

if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
  reserved_instruction($encoding);
}

XReg return_addr = $pc + 2;

X[1] = return_addr;
jump_halfword($pc + $signed(imm));

Defined by

RV32 and Zca

Access

SUVSVU
AlwaysAlwaysAlwaysAlways

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.