RISC-V Topic Guide

Stack Frame

RISC-V stack frames follow the psABI: sp is 16-byte aligned at procedure entry and remains aligned during execution, prologue/epilogue code typically allocates and frees stack space, saves ra and callee-saved registers when needed, and may use s0/fp to form an optional frame-pointer chain.

sprafps0s0-s11ADDISDLDSWLW16-byte alignmentstack frameprologueepilogue