call

RISC-V call Pseudo-Instruction Details

Assembler pseudo-instruction

Chapter 26 of the RISC-V Assembly Programmer's Manual lists call symbol and call rd, symbol as assembler pseudoinstructions for calling a far-away subroutine. call symbol implicitly uses ra as the link register to save the return address, while call rd, symbol uses the specified rd instead. The psABI associates the AUIPC+JALR pair generated by CALL with R_RISCV_CALL or R_RISCV_CALL_PLT.

What You Write
call symbol call rd, symbol
Typical Real Expansion
auipc ra, 0 jalr ra, ra, 0

What This Pseudo Instruction Is Saving You From Writing

Chapter 26 of the RISC-V Assembly Programmer's Manual provides call as assembler syntax for calling a far-away subroutine: the default form implicitly uses ra as the link register, while the explicit form uses the specified rd to save the return address.

How To Read The Expansion

Step 1
The psABI call symbol example begins with auipc ra, 0 carrying an R_RISCV_CALL relocation.
Step 2
It then uses jalr ra, ra, 0; Chapter 26 of the RISC-V Assembly Programmer's Manual says call symbol implicitly uses ra for the return address, while call rd, symbol uses rd.

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.

Pitfalls / Common Confusions

The psABI marks R_RISCV_CALL as deprecated and suggests R_RISCV_CALL_PLT; the AUIPC instruction has an additional R_RISCV_RELAX relocation only when linker relaxation is enabled.

FAQ

Is call a separate hardware opcode?

No. Chapter 26 of the RISC-V Assembly Programmer's Manual lists call as a pseudoinstruction, and the psABI describes the AUIPC+JALR pair it generates.