I am writing an assembler procedure to handle the external / decrement 0x500 exception in the PowerPC embedded EBCI application.
In my assembler routine, called from a 0x500 vector point, I want to use some memory for context saving registers before going to the handler function in 'C'.
Since i) the exception model ensures that the previous instructions will be completed by the time the exception handler starts up. ALSO ii) the calling convention appears to update the stack pointer (r1) first when introducing a new function before using the new stack space freed by it move (and move the stack pointer to where it was last at the end of the function)
it seems to me that I can safely use r1 to give myself more space in the normal stack in exception handling procedures, provided that I adhere to the calling agreement and return it back as I found it, and make sure that SRR0 and SRR1 are not modified.
I will not allow exceptions that use the stack in their processing for the socket (although in fact using this method I'm not sure if a problem will arise).
Do you think this is a reasonable approach or should I use a separate stack to handle exceptions? “I think this could lead to his own problems.”
source
share