This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

EJMP to a function instead of ECALL, in C language

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

Parents
  • Hi Ioan!
    I'm a begginer, but if I were in your place, I would try to use the "barbarian" goto. I mean that I would try to put a label at the beginning of Function() like:
    void function (void)
    label:
    { ...
    }

    and use the
    goto label; // when I want to go somewhere I will // never come back from
    It is completely wrong?
    Adrian

Reply
  • Hi Ioan!
    I'm a begginer, but if I were in your place, I would try to use the "barbarian" goto. I mean that I would try to put a label at the beginning of Function() like:
    void function (void)
    label:
    { ...
    }

    and use the
    goto label; // when I want to go somewhere I will // never come back from
    It is completely wrong?
    Adrian

Children