Interrupt functions have to be marked with #pragma TRAP_PROC or using the interrupt keyword.
#ifdef __HIWARE__ #pragma TRAP_PROC void MyTrapProc(void) #else /* other compiler-vendor non-ANSI declaration of interrupt function */ @interrupt void MyTrapProc(void) #endif { /* code follows here */ }