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 write some code for a microcontroller (251 family) in C language. depending on some stuff, i will continue in a way or another way, so i will call the desired function as Function(); This will lead to an ECALL in asm, which mean PC up on the stack.. How can i explain to compiler that a EJMP is desired in my case, i do not need to come back ever, i do not need the PC on the stack (remember, i do this in C...) The function called is (also) in another C file (not the same file), where there are more files into one project. Any suggestion would be appreciated, thanX
the function I want to EJMP instead of ECALL is in another C file
That shouldn't make any difference. The change from CALL to JMP can be decided on by the compiling seeing only the calling function and a prototype declaration of the called one. And the called function has to have the same return type as the called one --- preferrably void.