# `call`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/call

Pseudo-instruction

Category: Control flow

Calls the subroutine at label, even when it is too far away for a single jump, and saves the return address in ra.

[RISC-V manual: jalr](https://docs.riscv.org/reference/isa/v20260120/unpriv/rv32.html#norm:jalr_op)

## Forms

- `call label`
  - `call label` → `auipc t1, pcrel_hi(label)`; `jalr ra, t1, pcrel_lo(label)`

## Operands

- `label`: A named address in the program, such as the start of a loop or a variable in `.data`.

## Example

```riscv
# call saves the next instruction address (0x0040000c) in ra. link_marker is that skipped instruction; t2 ends at 1.
.text
li t2, 0
call done
link_marker:
addi t2, t2, 100
done:
addi t2, t2, 1
```
