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

LJMP in C?

What's the best way to do this in C?

#pragma ASM
LJMP APP_START; //Run app
#pragma ENDASM

..or, is that it?

APP_START does not exist. This is the launch point of an application loader. The actual app will be done as an entirely different project to be loaded higher in memory at a later time.

Thanks.

Parents
  • I just bumped into this thread and noted there is a mistake in the C version of the call sugested by Jay.

    He wrote:
    ((void (*) (void))0xXXXX)();

    It should be:
    (*(void (*) (void))0xXXXX)();

    Where 0xXXXX is the fixed address where you want your code to go to.

    Hope that helps others.
    -Howard

Reply
  • I just bumped into this thread and noted there is a mistake in the C version of the call sugested by Jay.

    He wrote:
    ((void (*) (void))0xXXXX)();

    It should be:
    (*(void (*) (void))0xXXXX)();

    Where 0xXXXX is the fixed address where you want your code to go to.

    Hope that helps others.
    -Howard

Children
  • noted there is a mistake in the C version of the call sugested by Jay

    There is no mistake. Jay's and your version should do exactly the same thing.
    In C, you don't have to, although are allowed to, dereference a pointer to a function before calling it using the parentheses operator.

    - mike