stack frame with function call in interrupt

I call a short and easy function out of an timer interrupt. This causes the c51 compiler to push all registers (A, B, DPH, DPL, PSW AR0..AR7) to the stack without any necessarity (they are not changed in this function). The fuction I call is in a seperate *.c file. How can I tell the C51-Compiler not to do this to save dataRAM and runtime? I can not use the using functionality because of register access.

  • You could consider assembler for the interrupt - Then you can be totally explicit about what you push and pop.

    You say the function you call does not change certain registers - But what happens if you modify the function, or use a newer/different version of the compiler? A different combination of registers might end up being used and you would have to change your interrupt accordingly.

More questions in this forum