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
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
A calling convention specifies which registers hold arguments, where return values go, which registers the callee may clobber and how the stack is used.
What is the main purpose of defining a calling convention?In the standard RISC-V calling convention, up to eight integer arguments are passed in a0-a7 (x10-x17), and the return value comes back in a0, or in a0 and a1 for values such as 64-bit integers on RV32.
In the standard RISC-V calling convention, which registers …They also have aliases such as ra, sp and a0, whose roles are set by the calling convention.
Which describes the general-purpose integer registers of RI…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