I have some code that does not seem to work.
I'm using gcc-3.2.3 patched with the latest CVS source for the msp-430.
The problem seems to be when we want a pointer to a structure and it
gets put into R14.
This seems to be fixed in gcc-3.4.0 patched with the CVS from gcc-current.
here is the generated code
0000118e <prob>:
118e: 04 12 push r4 ;
1190: 31 80 06 00 sub #6, r1 ;#0x0006
1194: 04 41 mov r1, r4 ;
1196: 0f 44 mov r4, r15 ;
1198: b0 12 7a 11 call #4474 ;#0x117a
119c: 04 12 push r4 ;
119e: 5f 42 04 02 mov.b &0x0204,r15 ;0x0204
11a2: 8f 11 sxt r15 ;
11a4: 0e 4f mov r15, r14 ;
11a6: 0e 5e rla r14 ;
11a8: 0e 5e rla r14 ;
11aa: 0f 5f rla r15 ;
11ac: 0e 5f add r15, r14 ;
11ae: 0e 5f add r15, r14 ;
11b0: 0e 5f add r15, r14 ;
11b2: 1e 12 64 11 push 4452(r14) ;
11b6: b0 12 d8 11 call #4568 ;#0x11d8
11ba: 21 52 add #4, r1 ;r2 As==10
11bc: 31 50 06 00 add #6, r1 ;#0x0006
11c0: 34 41 pop r4 ;
11c2: 30 41 ret
is msp430-gcc 3.4.0 safe to use?
--
Peter Jansen
STS
Australian Antarctic Division
Channel Highway
Kingston
TAS 7050
AUSTRALIA
Ph (03) 62 323 533
Fax (03) 62 323 351