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.
Hello. I have an existing ASM progrom which I am going to convert, as needed, to C. I was succesful at overriding the UART interrupt function (in C). Now, in my main ASM loop I need to check for recieved chars which I will doing in C. When I call my C func from the MAIN func in ASM the 8051 appears to go into a reset loop and will not successfully boot. =============================== My C Func: code void CheckForRx (void) { if (RxCount!=0) //C global inc'd in INT DoSomething(); } ============================== My ASM Main: extern code (CheckForRx) Start: ;Do alotta other stuff lcall CheckForRx jmp Start ================================ I get no linker warnings (it finds my C func) however that call will not work. Remove the lcall CheckForRx and the system works again. Any ideas of what I have most likely looked over? Thanks, Chris
probably ";Do alotta other stuff" blow up because it depend on the C fumction not changing registers. a C function may change any register and there is not guarantee that changing release, optimization or whatever will not change which registers do not rely on stupid so called "testing" to see what has changed, save EVERYTHING, the next time you touch the C the registers changed will, most likely, change. Erik