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.
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.
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.
"I'd suggest the file STARTUP.A51 in the lib directory. This file is the equivalent of the C runtime system"
No, that's not true!
STARTUP.A51 is the user-customisable part of the 'C' startup - it then calls the rest of the startup which, in turn, calls main().