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.
Where does the pushing of registers occur?
What, exactly, causes it?
"without any necessarity"
Remember that code generated by the compiler has to be completely general - although you can see that there may be no neccessity in your specific case, the compiler's generated code has to cope with all cases...
Taking advantage of such "insider information" is, of course, one of the key ways that an assembler programmer can beat a compiler!
"How can I tell the C51-Compiler not to do this"
Have you looked at:
http://www.keil.com/support/man/docs/c51/c51_le_regbankspec.htm
See also: http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm
http://www.keil.com/support/man/docs/c51/c51_ap_regusage.htm
Hello Anrew, thanks for your help, I solved the problem with the "global register coloring" and it works!