C.JAL

Compressed Jump and Link

C.JAL offset

Performs a PC-relative jump and stores return address in x1 (ra). RV32 only.

Encoding

Binary Layout
?
31:16
001
15:13
c_imm12
12:2
01
1:0
 
Format CJ
Opcode 0x00002001
Extension C

Operands

  • offset
    Jump Target

Example

C.JAL func

// Compressed function call.

Related

More in C

Description

Performs a PC-relative jump and saves the return address in x1 (RV32 only).

Operation

R[1] = PC + 2; PC += sext(offset);