Definition
sp ( RISC-V)
spis the RISC-V integer registerx2, designated as the stack pointer. It holds the address of the current stack frame’s top, pointing to the most recently pushed element on the call stack.The stack grows downward in memory (toward lower addresses). The
pushoperation (implemented via a store instruction decrementingsp) and thepopoperation (implemented via a load instruction incrementingsp) maintain the stack.spmust be correctly initialised at program entry and preserved across function calls according to the RISC-V calling convention.