What is Calling convention?

The agreement on how arguments and return values are passed in registers or on the stack, and who saves which registers, when calling a function. It is a key part of the ABI.

Field: ISA & Assembly

Calling convention in the explanations

Questions that mention Calling convention (9)

  1. What is the main purpose of defining a calling convention?
  2. In the standard RISC-V calling convention, which registers pass integer arguments and return values?
  3. In the standard RISC-V calling convention, when calling a function with ten integer arguments, where are the ninth and tenth passed?
  4. In the RISC-V calling convention, s0-s11 are callee-saved registers. What does that mean?
  5. In the RISC-V calling convention, t0-t6 are caller-saved. If a function wants to keep using a value in t0 after calling another function, what should it do?
  6. The standard RISC-V calling convention requires sp to be a multiple of 16 bytes on function entry. What is the main reason?
  7. Which describes the general-purpose integer registers of RISC-V RV32I (the 32-bit base integer instruction set)?
  8. What does the RISC-V instruction "jal ra, func" do?
  9. Which correctly describes an ABI (application binary interface)?

Related terms

Application binary interface (ABI) Stack pointer Return address Pseudo-instruction Instruction set architecture (ISA) Addressing mode Assembler Branch delay slot Callee-saved register Caller-saved register

Back to the glossary