For a procedure to be unwindable, the callee-saves registers must be stored in
the correct location within the stack frame. The registers will be stored in
the correct locations when the standard entry and exit sequences generated by
the .ENTER and .LEAVE are used. The stack unwinding utilities may
fail if an interrupt occurs on an instruction in a non-standard entry or exit
sequence. For this reason, it is advisable that assembly programmers use
.ENTER and .LEAVE rather than create their own entry and exit
sequences.
If you don't use the .ENTER and .LEAVE directives, then
callee-saves registers should be saved within the procedure's stack frame as
follows:
Any floating-point registers are saved starting at the double-word
at the bottom of the current stack frame, the address in SP on entry
to the procedure. Register fr12 should be stored at this location,
with subsequent callee-saves registers saved in numeric order in the
double-words immediately following.
Any general registers are saved starting at the first word after
the last callee-saves floating-point register is saved. Register gr3
should be stored first, with subsequent registers saved in numeric
order in the words immediately following.
Callee-saves space register sr3 is saved by moving its contents to
a general register with an MFSP instruction and then storing it in
the first double-word aligned address immediately following the last
callee-saves general register. (Note that if an odd number of general
registers are spilled, there will be an unused word of memory between
the last general register spilled and the saved sr3 value.)