I have seen that if I use the #pragma interrupt (together with the interruptss dispatcher) an assembler instruction is generated while the register values are being saved, which changes the value of the MODE1 register (I think this sets the RND32 bit in MODE1):
|bit set mode1 65536;|
The previous value of the MODE 1 register is not saved anywhere before changing it, and therefore it is not restored when the ISR returns to the code that was running before the interrupt was generated.
Why is the compiler generating this instruction? Is there any way to avoid this, or to restore the original value of the changed bit?