Delbert Martin wrote:
OK here is the code I am using:
#-----------------------------BEGIN 
test.S-----------------------------------------
#include <io.h>
#include <signal.h>

        .section .text
RESET:
                mov.w   #0x0A00,R1
                mov.w   #5A80,&WDTCTL
                
        call #SetupPorts
        call #InitColors
        bis.w   #GIE,R2
L1:     
        JMP     L1
        
SetupPorts:
        mov.b   #0x00,&P1SEL
        mov.b   #0xFF,&P1DIR        ;All Outputs    
        mov.b   #0x00,&P1OUT
        

        mov.b   #0x00,&P4SEL
        mov.b   #0xFF,&P4DIR
        mov.b   #0x00,&P4OUT

        bic.b   #0x80,&P2DIR        ;2.7 Input
        bic.b   #0x80,&P2SEL
        bis.b   #0x80,&P2IE ;2.7 Int Enable
        bic.b   #0x80,&P2IES        ;Low to high Transition
        RET


InitColors:
        mov.b   #0x07,&P1OUT        ;This should light all LED's
        bis.b   #0x04,&P4OUT
        RET

        
P2_ISR:
        xor.b   #0x04,&P4OUT
        bic.b   #0x80,&P2IFG
        xor.b   #0x07,&P1OUT
        RETI                            
        
;---------------------------------------------------------------
; RESET ... VECTORS
;---------------------------------------------------------------        
        .section .vectors
        .word   RESET
        .word   P2_ISR
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
        .word   RESET
#--------------------------------END test.S------------------------------
My Makefile:
#--------------------------------BEGIN Makefile--------------------------
#Makefile for an MSP430x14x

MSP_PF = /usr/local/msp430
MSP_BIN = $(MSP_PF)/bin

CC = $(MSP_BIN)/msp430-gcc
AS = $(MSP_BIN)/msp430-as
LD = $(MSP_BIN)/msp430-ld

CFLAGS = -I$(MSP_PF)/include -02 -mmcu=msp430x149 -D_GNU_ASSEMBLER_ -nostartfiles -nostdlibs
all:
        $(CC) $(CFLAGS) test.S -o test

clean:
        rm -f test
#---------------------------END 
Makefile-------------------------------------------


works for me:

msp430-objdump -D test

test:     file format elf32-msp430

Disassembly of section .text:

00001100 <__ctors_end>:
    1100:       31 40 00 0a     mov     #2560,  r1      ;#0x0a00
    1104:       b2 40 05 00     mov     #5,     &0x0120     ;#0x0005
    1108:       20 01
    110a:       b0 12 16 11     call    #4374           ;#0x1116
    110e:       b0 12 4c 11     call    #4428           ;#0x114c
    1112:       32 d2           eint                    

00001114 <L1>:
    1114:       ff 3f           jmp     $+0             ;abs 0x1114

00001116 <SetupPorts>:
    1116:       c2 43 26 00     mov.b   #0,     &0x0026     ;r3 As==00
    111a:       f2 40 ff 00     mov.b   #255,   &0x0022     ;#0x00ff
    111e:       22 00
    1120:       c2 43 21 00     mov.b   #0,     &0x0021     ;r3 As==00
    1124:       c2 43 1f 00     mov.b   #0,     &0x001f     ;r3 As==00
    1128:       f2 40 ff 00     mov.b   #255,   &0x001e     ;#0x00ff
    112c:       1e 00
    112e:       c2 43 1d 00     mov.b   #0,     &0x001d     ;r3 As==00
    1132:       f2 c0 80 00     bic.b   #128,   &0x002a     ;#0x0080
    1136:       2a 00
    1138:       f2 c0 80 00     bic.b   #128,   &0x002e     ;#0x0080
    113c:       2e 00
    113e:       f2 d0 80 00     bis.b   #128,   &0x002d     ;#0x0080
    1142:       2d 00
    1144:       f2 c0 80 00     bic.b   #128,   &0x002c     ;#0x0080
    1148:       2c 00
    114a:       30 41           ret                     

0000114c <InitColors>:
    114c:       f2 40 07 00     mov.b   #7,     &0x0021     ;#0x0007
    1150:       21 00
    1152:       e2 d2 1d 00     bis.b   #4,     &0x001d     ;r2 As==10
    1156:       30 41           ret                     

00001158 <P2_ISR>:
    1158:       e2 e2 1d 00     xor.b   #4,     &0x001d     ;r2 As==10
    115c:       f2 c0 80 00     bic.b   #128,   &0x002b     ;#0x0080
    1160:       2b 00
    1162:       f2 e0 07 00     xor.b   #7,     &0x0021     ;#0x0007
    1166:       21 00
    1168:       00 13           reti                    
Disassembly of section .vectors:

0000ffe0 <_vectors_end-0x20>:
    ffe0:       00 11           interrupt service routine at 0x1100
    ffe2:       58 11           interrupt service routine at 0x1158
    ffe4:       00 11           interrupt service routine at 0x1100
    ffe6:       00 11           interrupt service routine at 0x1100
    ffe8:       00 11           interrupt service routine at 0x1100
    ffea:       00 11           interrupt service routine at 0x1100
    ffec:       00 11           interrupt service routine at 0x1100
    ffee:       00 11           interrupt service routine at 0x1100
    fff0:       00 11           interrupt service routine at 0x1100
    fff2:       00 11           interrupt service routine at 0x1100
    fff4:       00 11           interrupt service routine at 0x1100
    fff6:       00 11           interrupt service routine at 0x1100
    fff8:       00 11           interrupt service routine at 0x1100
    fffa:       00 11           interrupt service routine at 0x1100
    fffc:       00 11           interrupt service routine at 0x1100
    fffe:       00 11           interrupt service routine at 0x1100

msp430-gcc -v
Reading specs from /cygdrive/c/mspgcc/bin/../lib/gcc-lib/msp430/3.2.3/specs
Configured with: ./configure --target=msp430 --prefix=/c/daten/mspgcc/build/installed --disable-nls
Thread model: single
gcc version 3.2.3

msp430-ld -v
GNU ld version 040527 20040527

i'm using the version of the latest windows installer

chris

Reply via email to