From: Jose L. H. L. <jos...@gm...> - 2013-02-05 21:33:49
|
I just installed the latest mspgcc version (4.7 20120911) and I'm having trouble placing variables in specific memory locations with the __asm__ attribute. I've written a simple test program: #include <msp430.h> volatile unsigned int flag __asm__("0x2300"); int main(void) { WDTCTL = WDTPW + WDTHOLD; if(flag) { P1SEL &= ~BIT0; P1DIR |= BIT0; P1OUT |= BIT0; } LPM3; return 0; } Compiled it with: msp430-gcc -mmcu=msp430f5529 -save-temps -mmemory-model=small src/main.c The error message I get is: main.s: Assembler messages: main.s:7: Error: expected symbol name And the generated assembler looks like this: .file "main.c" .arch msp430f5529 .cpu 430xv2 .mpy 32dw .cpux_target sr20 .comm 0x2300,2,2 .section .init9,"ax",@progbits .p2align 1,0 .global main .type main, @function /*********************** * Function `main' ***********************/ main: mov r1, r4 add #4, r4 mov #23168, &__WDTCTL mov &0x2300, r15 cmp #0, r15 jeq .L2 mov.b &__PASEL_L, r15 and.b #-2, r15 mov.b r15, &__PASEL_L mov.b &__PADIR_L, r15 bis.b #1, r15 mov.b r15, &__PADIR_L mov.b &__PAOUT_L, r15 bis.b #1, r15 mov.b r15, &__PAOUT_L .L2: bis #208, r2 mov #0, r15 .LIRD0: .size main, .-main .ident "GCC: (GNU) 4.7.0 20120322 (mspgcc dev 20120911)" The versions of the tools I'm using: msp430-gcc (GCC) 4.7.0 20120322 (mspgcc dev 20120911) GNU assembler (GNU Binutils) 2.22 (mspgcc dev 20120911) I'm not familiar at all with the 20-bit series, but I'd like to know if I'm missing a command line option or something else. Kind regards, Jose |