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 am using inline assembly in C but i am getting a warning as "UNRESOLVED EXTERNAL SYMBOL".The code is executing but i am getting only the warning. I set all these options: Generate assembler SRC file Assemble SRC file Include in Target Build I have attached my code below
main() { #pragma asm mov a,#24 mov r1,#23 add a,r1 here: ajmp here #pragma endasm }
Search the knowledgebase - this is well documented!
The trouble is, you are converting your 'C' file to assembler - so the Linker only sees an assembler project, and doesn't automatically include the necessary 'C' runtime support!
The trouble is, you are converting your 'C' file to assembler I bungled my way through that one in a mixed (C and assembly) projct. What I found was that you can mix and match as much as you want, as long as main() is C. Since the mixed project was intended for an assembler 'main' I overcame by writing this
main.c:
void main(void) { assemblerMain(); }
worlkoop.a51:
assemblerMain: ... ... ljmp assemblerMain
Note: assemblerMain called many C functions as well
Erik