We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I encountered the following phenomena during my work: I dont know if its supposed to be this way but I'm sure it made me a lot of trouble. I had a working program and I built a bootloader for it.The interrupts were inside the bootloader (never mind the details..) but what's important is that it was made out of one C file. The interrupt handlers were written before the interrupt function themselves since there was no prototype function. What happened is that everything went crazy and the interrupts didn't work right...THE PROBLEM was that the compiler didn't add the save\restore PSW assembly code in the interrupt function for some reason. Any explanations or a is it a bug?
"is there something I'm missing?"
No.
C51 prohibits calling interrupt functions directly - so there would be no point in having a prototype...
See: http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm (3rd bullet point at the bottom of the page)