I'm having trouble getting the msp430-gcc assembler to emit working code in 
this example (target is MSP430F1232) - it appears the symbol U0TXBUF (which 
should point to the UART transmit data register) is getting assembled as 0, not 
hex 77 (I don't think this is unique to U0TXBUF or my target - I am sure this 
is an operator problem (me) but so far I'm stumped...)

Here is the source code fragment given to msp430-gcc (with command line 
msp430-gcc -c f.s -o f.out):

    .arch msp430x1232
    #include    
    .org    0xE000
    .text
main:    mov.b    #0x42, &U0TXBUF

>From this source code, I end up with this non-working binary:

      F2 40 42 00 00 00

The problem appears to be &U0TXBUF getting assembled as hex bytes 00 00 rather 
than hex bytes 77 00.

However, if I try this:

    .arch msp430x1232
    #include    
    .org    0xE000
    .text
main:    mov.b    #0x42, &0x77

I end up with the binary I expected:

      F2 40 42 00 77 00

I'm very much a beginner with msp430-gcc (and gcc in general), and trying to 
get a working command-line development environment (no IDE) on Linux.

Thanks very much,

Dave


_________________________________________________________________
Get your vacation photos on your phone!
http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM

Reply via email to