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

this is the problem

Now I will explain the problem OK.

I have to find a way of calling a function before main.

How can I do it? can i use a pointer?

Give all the possible solutions as soon as you can.

See you soon,

Necra

Parents
  • Will this work ?

    NO!

    Take a close look and understand the previous answers.

    The processor actually runs code from the startup.a51 (or similar) assembly file before the call to main. Look at the map file from the build to see this. look in the startup code to find a LJMP to c_start or _main or something.

    Why does it matter if you function is called before the call to main? why not just make it the first call in main? Smells to me like you might be doing it wrong or don't quite understand what you are trying to do.

    ND

Reply
  • Will this work ?

    NO!

    Take a close look and understand the previous answers.

    The processor actually runs code from the startup.a51 (or similar) assembly file before the call to main. Look at the map file from the build to see this. look in the startup code to find a LJMP to c_start or _main or something.

    Why does it matter if you function is called before the call to main? why not just make it the first call in main? Smells to me like you might be doing it wrong or don't quite understand what you are trying to do.

    ND

Children