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

Error: UNRESOLVED EXTERNAL SYMBOL and REFERENCE MADE TO UNRESOLVED EXTERNAL

Hello everyone,

I am using Keil uVision2 to write my assembler code. I am always getting the same error. I searhed on Google and everbody says the solution is in the Keil manual but I could not find anything. To make it clear, I would want to say what I did so far.

1. Created a project,
2. Selected Atmel T89C51CC01,
3. Clicked new button and wrote my assembler code,
4. I added .asm code in the project.
5. Compile it and get the warnings.

Here is .plg file:

Build target 'Target 1'
assembling STARTUP.A51...
assembling defa.asm...
linking...

*** 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: 000DH
Program Size: data=9.0 xdata=0 code=4131
creating hex file from "my"...
"my" - 0 Error(s), 2 Warning(s).

Parents
  • Yes I want to write .asm codes but it doesn't matter whether in C or not. Now I am supposed to see some leds are on but not. Could you please clarify me why this is happening?

    Here is my code:

    void main(void)
    {
    #pragma ASM
                     mov    18h,#01001010b
                     mov    20h,#00100100b
                     mov    28h,#01010010b
                     mov    30h,#01111111b
                     mov    38h,#00110110b
    #pragma ENDASM
    }
    

    I can compile it successfully and I upload my .hex file to the microcontroller. Now I read from microcontroller and what I see is

    Addr 000200 02 00 10 FF FF FF FF FF FF ...

    It generates just 02 00 10 for my whole .hex file. Why it is so small? By the way I set CSEG AT 200h.

Reply
  • Yes I want to write .asm codes but it doesn't matter whether in C or not. Now I am supposed to see some leds are on but not. Could you please clarify me why this is happening?

    Here is my code:

    void main(void)
    {
    #pragma ASM
                     mov    18h,#01001010b
                     mov    20h,#00100100b
                     mov    28h,#01010010b
                     mov    30h,#01111111b
                     mov    38h,#00110110b
    #pragma ENDASM
    }
    

    I can compile it successfully and I upload my .hex file to the microcontroller. Now I read from microcontroller and what I see is

    Addr 000200 02 00 10 FF FF FF FF FF FF ...

    It generates just 02 00 10 for my whole .hex file. Why it is so small? By the way I set CSEG AT 200h.

Children