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.
I recall that with some of the many compilers I use, use of in-line assembly interferes with the compiler's optimizer because a compiler may not look at the assembly code to know what registers have/haven't been modified, and thus generates code assuming the worst, that registers have been modified, and generates inefficent code accordingly. I don't recall if this is the case with Keil C. I'd appreciate it if someone could elaborate on C51's performance in this area, otherwise I'll have to generate test cases. Thanks, --Dan Henry
Yep, This is the case with the Keil tools as well. Jon
Thanks, Jon. You saved me a bunch of test case time. This is not too much of a problem for me. C51 generates great code and in the past, whenever I've needed to do better, I just do it in a separate assembler module. The Salvo port I mentioned in another thread uses some in-line assembly to accomodate the stackless PIC MCU, but I think I'll be able to implement equivalent functionality in C51, since I can manipulate the stack pointer on 8051 derivatives directly in C. --Dan Henry
This restriction seems to have been removed now: http://www.keil.com/forum/docs/thread1657.asp#msg6654