This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error: Building assembly only project

Hi there!

 

We have to build an assembly only project in our school. When we try to build our code, we get some errors.

What we did:

 

  • Build a new CCS Project
  • Selected the checkbox "Treat as an Assembly-only project"
  • Choosen the linker command file "lnk.cmd"
  • Added a new file named "main.asm"

 

Code inside main.asm:

main:
    mov #1000, AR0
loop1:
    rpt    #65000
    nop
    sub #1, AR0
    bcc loop1, AR0 != 0
    xor #0x2000, st1_55
    B main
.end

 

When we build it we get this command output:


**** Build of configuration Debug for project BlinkLED ****

C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
'Building file: ../main.asm'
'Invoking: C5500 Compiler'
"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -v5505 -g --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/include" --diag_warning=225 --sat_reassoc=off --ptrdiff_size=32 --fp_reassoc=off --memory_model=huge --asm_source=mnemonic  --preproc_with_compile --preproc_dependency="main.pp" "../main.asm"
"..\main.asm", WARNING! at line 8: [W9999] Using MMR address
        xor #0x2000, st1_55

No Assembly Errors, 1 Assembly Warning
'Finished building: ../main.asm'
' '
'Building target: BlinkLED.out'
'Invoking: C5500 Linker'
"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -z -m"BlinkLED.map" --stack_size=0 --heap_size=0 --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/include" --reread_libs -o "BlinkLED.out"  "./main.obj" "../lnk.cmd"
<Linking>

 undefined first referenced                                                                          
  symbol       in file                                                                               
 --------- ----------------                                                                          
 _main     C:\Program Files\Texas Instruments\ccsv4\tools\compiler\c5500\lib\rts55h.lib<args_main.obj>

error: unresolved symbols remain
error: errors encountered during linking; "BlinkLED.out" not built

>> Compilation failure
C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [BlinkLED.out] Error 1
C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.
Build complete for project BlinkLED

 

Has anybody an idea why it don't run correctly. Is so boring. We didn't found a tutorial or other discription

on TI website!!

 

Thanks.

Mike

  • Hello Mike,

    I usually use C, so I am not sure if this will work:

    Try to rename main to _main and add " .def _main" to main.asm.

    Jiri

  • Hi Jiri

    I tried it out. But there are still errors. The new main.asm:

     

    .def _main

    _main:
        mov #1000, AR0
    loop1:
        rpt    #65000
        nop
        sub #1, AR0
        bcc loop1, AR0 != 0
        xor #0x2000, st1_55
        B _main
    .end

     

    and the errors:


    **** Build of configuration Debug for project BlinkLED ****

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
    'Building file: ../main.asm'
    'Invoking: C5500 Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -v5505 -g --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c5500/include" --diag_warning=225 --sat_reassoc=off --ptrdiff_size=32 --fp_reassoc=off --memory_model=huge --asm_source=mnemonic  --preproc_with_compile --preproc_dependency="main.pp" "../main.asm"
    "..\main.asm", ERROR!   at line 1: [E9999] Syntax Error
        .def _main

    "..\main.asm", ERROR!   at line 1: [E9999] Invalid mnemonic specified
        .def _main

    "..\main.asm", WARNING! at line 10: [W9999] Using MMR address
            xor #0x2000, st1_55


    Errors in Source - Assembler Aborted
    2 Assembly Errors, 1 Assembly Warning

    >> Compilation failure

    >> Compilation failure
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [main.obj] Error 1
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.
    Build complete for project BlinkLED

     

    Mike

  • Hi Mike,

    there has to be a space before .def.

    Jiri

  • Hi Jiri

    Thanks a lot. It runs now!

    The source for main.asm:

    ;******************************************************************
    ;    desc: simple demo blink code
    ;    autor: Mike Meier
    ;    date: 27.05.2010
    ;
    ;    additional information:
    ;    with standard lnk.cmd builded (all lines begins with '-' commented for asm!)
    ;******************************************************************


     .def start_up        ;define a start function definieren (entry-point) / important: space before point
     
     .text                       ;save the following code in  ROM    PAGE 0 / important: space before point
    start_up:
        mov #1000, AR0
    loop1:
        rpt    #65000
        nop
        sub #1, AR0
        bcc loop1, AR0 != 0
        xor #0x2000, st1_55
        B start_up
    .end

     

    AND write under Project Properties ( [Tool Setting] > [C5500 Linker] > [Symbol Management:] > [Specify program entry point…]) your
    start function name (ex. start_up)

    Mike