Torgeir Moringen wrote:
I have problem compiling a asm fil in my msp-gcc project. The #define
P1Out dont work. I get: "undefined reference to `P1OUT'"
If I replaces &P1OUT with 0x0021 in the code it will work! This shuld
not be a big problem...
you may need to specify "-x assembler-with-cpp" and use gcc to call as:
msp430-gcc -x assembler-with-cpp -D_GNU_ASSEMBLER_ -mmcu=msp430x1121
-c file.s -o file.o
also note that you'd define _GNU_ASSEMBLER_ on the command line and not
in the file itself. that way you can write files that work with c and
assembler.
then you can include io.h and have all the defines from the compiler, no
need to do it by hand..
for an example using asm + c and a makefile:
http://cvs.sourceforge.net/viewcvs.py/mspgcc/examples/gfx_lcd/
chris
Torgeir Moringen
-------file start--------
;*****
; Port1.s43
;****
#define _GNU_ASSEMBLER_
#define P1OUT 0x0021
.file "port1.s"
.global set_port
;==============
; set_port
;==============ยจ
.section ".text"
set_port:
xor.b #01h,&P1OUT
ret
-------file end-----------