Procedure Calling in RISC-V
- Place parameters in registers x10 to x17 (a0 ~ a7)
- Transfer control to procedure, saving the return address ra (x1)
- Acquire storage for procedure (stack)
- Perform procedure’s operations
- Place result in register a0 and a1 for caller (x10, x11)
- Return to the next instruction of call (ra)