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.

Need help with build from asm files

Other Parts Discussed in Thread: MSP430G2231

I'm a newbie with MSP-EXP430G2 Launchpad.  Have successfully used C sample files, but can't build from sample *.asm files. Below is a TI demo file I've copied into a file I've named "Butterfinger1.asm."  Pasted afterwards are error messages.  I speculate that CCS is trying to compile a C program because there is mention of an unresolved symbol "main."  What am I doing wrong?  Is there a tutorial that would coach me through an assembly exercise?

Thanks very much,

Steve Scholl

;*******************************************************************************
;   MSP430G2xx1 Demo - Software Poll P1.4, Set P1.0 if P1.4 = 1
;
;   Description: Poll P1.4 in a loop, if hi P1.0 is set, if low, P1.0 reset.
;   ACLK = n/a, MCLK = SMCLK = default DCO
;
;                MSP430G2xx1
;             -----------------
;         /|\|              XIN|-
;          | |                 |
;          --|RST          XOUT|-
;      /|\   |                 |
;       --o--|P1.4        P1.0|-->LED
;      \|/
;
;   D. Dang
;   Texas Instruments Inc.
;   October 2010
;   Built with Code Composer Essentials Version: 4.2.0
;*******************************************************************************
  .cdecls C,LIST,  "msp430g2231.h"
;------------------------------------------------------------------------------
            .text                           ; Program Start
;------------------------------------------------------------------------------
RESET       mov.w   #0280h,SP               ; Initialize stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
SetupP1     bis.b   #001h,&P1DIR            ; P1.0 output
                                            ;                 
Mainloop    bit.b   #010h,&P1IN             ; P1.4 hi/low?
            jc      ON                      ; jmp--> P1.4 is set
                                            ;
OFF         bic.b   #001h,&P1OUT            ; P1.0 = 0 / LED OFF
            jmp     Mainloop                ;
ON          bis.b   #001h,&P1OUT            ; P1.0 = 1 / LED ON
            jmp     Mainloop                ;
                                            ;
;------------------------------------------------------------------------------
;           Interrupt Vectors
;------------------------------------------------------------------------------
            .sect   ".reset"                ; MSP430 RESET Vector
            .short  RESET                   ;
            .end


**** Build of configuration Debug for project BCH ****

C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
'Building target: BCH.out'
'Invoking: Linker'
"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/msp430/bin/cl430" -vmsp -g --define=__MSP430G2231__

--diag_warning=225 --printf_support=minimal -z -m"BCH.map" --stack_size=50 --heap_size=0 --warn_sections

-i"C:/Program Files/Texas Instruments/ccsv4/msp430/include" -i"C:/Program Files/Texas

Instruments/ccsv4/tools/compiler/msp430/lib" -i"C:/Program Files/Texas

Instruments/ccsv4/tools/compiler/msp430/include" --reread_libs --rom_model -o "BCH.out"  "./Butterfinger1.obj"

-l"libc.a" "../lnk_msp430g2231.cmd"
<Linking>
"../lnk_msp430g2231.cmd", line 87: error: placement fails for object ".reset",
   size 0x4 (page 0).  Available ranges:
   RESET        size: 0x2          unused: 0x2          max hole: 0x2      

 undefined first referenced                                                                      
  symbol       in file                                                                           
 --------- ----------------                                                                      
 main      C:\Program Files\Texas Instruments\ccsv4\tools\compiler\msp430\lib\rts430.lib<boot.obj>

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

>> Compilation failure
gmake: *** [BCH.out] Error 1
gmake: Target `all' not remade because of errors.
Build complete for project BCH


Severity and Description Path Resource Location Creation Time Id
errors encountered during linking; "BCH.out" not built  BCH line 0 1296444904828 65
placement fails for object ".reset", size 0x4 (page 0).  Available ranges: RESET        size: 0x2          unused:

0x2          max hole: 0x2  BCH line 0 1296444904828 63
unresolved symbol main, first referenced in C:\Program  BCH line 0 1296444904828 64