SPRAB89A September 2011 – March 2014
Many functions save and restore all the callee-saved registers, and the code to do this is fairly large. Instead of having the code to do this in the prolog and epilog of every function, there are functions in the runtime library that can be called instead. These functions use a special calling convention to avoid corrupting the registers they will save. The call to save all of the callee-saved registers looks like this:
CALLP __C6000_push_rts, A3 ; CALLP puts the return address in A3
The code to restore them is:
CALLP __C6000_pop_rts, A3 ; A3 is unused
; Returns to the location saved from B3 by __C6000_push_rts
Before _ _C6000_push_rts is called, the stack looks like this:
The _ _C6000_push_rts stores all the callee-saved registers, resulting in: