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

Warning while using inline assembly

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
}

Parents
  • 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

Reply
  • 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

Children
No data