SPRU514Z July 2001 – October 2023 SM320F28335-EP
If a C/C++ interrupt routine does not call any other functions, only those registers that the interrupt handler uses are saved and restored. However, if a C/C++ interrupt routine does call other functions, these functions can modify unknown registers that the interrupt handler does not use. For this reason, the compiler saves all the save-on-call registers if any other functions are called.
However, if a --float_support=fpu32/fpu64 option is used, the STF register is saved and restored. Any STF flag modifications performed by the interrupt routine will be undone when the routine returns.
A C/C++ interrupt routine is like any other C/C++ function in that it can have local variables and register variables; however, it should be declared with no arguments and should return void. Interrupt handling functions should not be called directly.
Interrupts can be handled directly with C/C++ functions by using the INTERRUPT pragma or the __interrupt keyword. For information about the INTERRUPT pragma, see Section 6.9.15. For information about the __interrupt keyword, see Section 6.5.3.