Interrupt functions on the MCore use different calling conventions than normal functions. Specifically:
You can make the compiler follow these conventions for a particular function in C or C++ by inserting the #pragma ghs interrupt instruction immediately after the opening curly brace.
Alternatively, the keyword __interrupt may be placed at the beginning of a function definition:
__interrupt void func(void)
Non-interrupt routines only save and restore permanent registers used, but an interrupt routine also saves and restores any temporary registers if they are used. If an interrupt routine has a function call, then all temporary and permanent registers will be saved, even if they are not used in the interrupt function.