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

calling an assembler fonction from c program

I do my main program in c.
I want to call in this c program a fonction (procedure) in assembler.
How can I do this ?
with a #include <xxxx.a51> ?
how can I do a mix program with c and assembler procedure?

thanks for your answer.

Parents
  • this warning came without any assembler code

    Well, then, better add some assembler code to your program. I'd suggest the file STARTUP.A51 in the lib directory.

    This file is the equivalent of the C runtime system, which in the case of C51 is pretty minimal. The provided code mostly initializes RAM to zero and jumps to main. ?C_STARTUP is the entry point to this code. (?C_START is effectively main()).

    If you use global initializers, you'll also want INIT.A51, which copies the initializer from code memory to the RAM space at init time.

Reply
  • this warning came without any assembler code

    Well, then, better add some assembler code to your program. I'd suggest the file STARTUP.A51 in the lib directory.

    This file is the equivalent of the C runtime system, which in the case of C51 is pretty minimal. The provided code mostly initializes RAM to zero and jumps to main. ?C_STARTUP is the entry point to this code. (?C_START is effectively main()).

    If you use global initializers, you'll also want INIT.A51, which copies the initializer from code memory to the RAM space at init time.

Children