Procedure Calling in RISC-V

  1. Place parameters in registers x10 to x17 (a0 ~ a7)
  2. Transfer control to procedure, saving the return address ra (x1)
  3. Acquire storage for procedure (stack)
  4. Perform procedure’s operations
  5. Place result in register a0 and a1 for caller (x10, x11)
  6. Return to the next instruction of call (ra)

Memory Reserve: Stack