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.

How to split a large assembly code into several .h and .asm files

Hi team,


I'm sorry to ask for so basics questions but  I browsed the forum without find a solution.

I work on a (too) big assembly code main.asm in CCS V6.1.

This assembly code compiles and works fine.

I would like to split this main.asm into a main.asm file and some .h and .asm subfiles.

I did that, calling the .h and .asm files with .include directives in main.asm, AFTER the ".cdecls C,LIST,"msp430.h"" directive.

Unfortunately, this way, main.asm don't compile because, for example, in lcd.asm subfile, items declared in msp430.h are not seen.

So, a lot of such a following error:

"../lcd.asm", ERROR!   at line 35: [E0200] Unable to resolve this relocatable expression; relocation support for arbitrary expressions is not available in the C6000 EABI
                bis.w    #LCDCPEN | LCDREFEN | VLCD_6,&LCDVCTL

Voilà ;)

Any idea ?

regards

Claude

  • In IAR you split it up in modules. CCS probably does it the same way
    I just select "add file" to project in IAR menu and I don't have to use #include module_name
    If you don't have a file yet, just select File/new/file that you edit and save and then do add file to project

             NAME    myname		    ; module name
    	     #include "msp430.h"    ; #define controlled include file
             PUBLIC  my1label	    ; make the this modules label visible outside this module
             RSEG    CODE		    ; place program in 'CODE' segment
    
    my1label mov.w #0,&spilen       ; example
    ...
    ...
             END
    

**Attention** This is a public forum