-------- Message original --------
Sujet:  MSPGCC3.2.3/MSPGCC4 ?
Date :  Mon, 13 Sep 2010 12:20:06 +0200
De :    thln <[email protected]>
Pour :  mspgcc-users <[email protected]>



 Hello

I used from now GCC 3.2.3 / Binutils 2.19 for MSP430F2274&  MSP430F4783
without any problems.
I will use for a new project, the MSP430F5418 MCU (with extended
instructions).

So I just try to compile this little test far section (above 64k):

#define far __attribute__((section(".fartext")))

far unsigned int TEST_fartext = 0x1234;

int main(void)
{

if (TEST_fartext!=0x1234)
    {
    while (1);
    }
  }
return 0;
}

I defined section "fartext" like this:

  fartext(rx)       : ORIGIN = 0x10c00,    LENGTH = 0x15000

The assembly code produced (listing file):

if (TEST_fartext!=0x1234)
    60b2:    b2 90 34 12     cmp    #4660,&0x0c00    ;#0x1234
    60b6:    00 0c
    60b8:    01 24           jz    $+4          ;abs 0x60bc
    {
    while (1);
    60ba:    ff 3f           jmp    $+0          ;abs 0x60ba
    }
The instructions do not use X!, instruction should be:
    cmpx    #4660,&0x10c00    ;#0x1234

OK, well, I'll try to make a "peek" routine to test it, like this:

extern unsigned char peek_ (unsigned char page, unsigned int addr);
page: high address bits 19-16
addr: low address bits 15-0

peek_:
        clrc
        rrum.a        #1,r15        ; pour la carry
        rrum.a        #4,r15        ; bit 19-16
        addx.a        r15,r14        ; ajoute l'adresse basse
        movx.b        @r14,r15
        ret

The assembly code produced (listing file):

00006080<peek_>:
    6080:    12 c3           clrc
    6082:    4f 03           rrum.a    #1,    r15
    6084:    4f 0f           rrum.a    #4,    r15
    6086:    00 18 4e 5f     rlax.a    r14
    608a:    40 18 6f 4e     movx.b    @r14,    r15
    608e:    30 41           ret

Strange, the instruction "addx.a r15, r14" turned into "rlax.a r14"!

Same thing with the version mspgcc4!

I am a bit lost :( !
Furthermore, following my old posts last week, I was surprised to see
that the registers definitions seem to be abandoned!

1) Is there a MSPGCC version that can compile code for MSP430X using all
the memory (20-bit addressing).

2) Which version of GCC / Binutils should I use ?

3) Then, which version of the registers definitions should I use ?

Thank you for reply, Thierry



Reply via email to