If an interrupt service routine calls another function, the normal functions' temporary data section (which is named .tmpdata) should be saved using a save=section(".tmpdata") qualifier on the interrupt pragma command. For example: #pragma interrupt high_interrupt_service_routine save=section(".tmpdata")
2. Local Variable 不一定放在 Stack 裡,也有可能放在沒有用到的 RAM 裡,這要看你在 compiler 時的選擇,
Project-->project-->MPLAB C18 --> Default Storage Class 中設定要 Stack or overlay