Let's say I have:
main:
// stuff
jal function_a
function_a:
// function_a stuff
jal function_b
jr $ra
function_b:
// function_b stuff
jr $ra
From what I understand, main saves the appropriate return address in $ra when it does jal function_a, but then function_a overwrites $ra when it does jal function_b, so obviously $ra needs to be saved at some point. But I can't find anything that actually says what the convention is for doing this. Do I store $ra on the stack while in function_a before calling jal function_b? Do I store $ra in an s-register before calling jal function_b, and then save that s-register at the beginning of function_b (which I think was implied here)? Something different? Does it matter?