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.
There is a section in the Manual specifically titled "Interfacing 'C' to Assembler"...
the easy way
write a 'skeleton' function in C compile it using SRC use the generated assembler as a base for your code
Erik
thanks you for your answer,
but when I modify the option of my main program (with a double click on SRC and assembler), I have 2 warnings:
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP)
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) ADDRESS: 0834H
and this warning came without any assembler code in my programm
what can I do for this?
thanks.
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().
View all questions in Keil forum