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.
Dear all, When I am writing some ASM function, I always need to PUSH the accumulator and all register I have used inside the function. I am wondering if this ASM function is to be called by other C function, do I still need to PUSH the accumulator and the register? It seems that the C compiler will avoid saving some useful data into the accumulator and the register that may need to be retrived after the ASM function call. Best Regards, H.K. Chan
You need to read the C51 Manual to determine its requirements for register usage etc. The section titled "Interfacing C to Assembler" would seem like an obvious place to start... http://www.keil.com/support/man/docs/c51/c51_ap_ctoasm.htm
Or even more directly: http://www.keil.com/support/man/docs/c51/c51_ap_regusage.htm Though it's probably a good idea to read that whole section of the manual.