EmbDev.net

Forum: ARM programming with GCC/GNU tools Code Generation


von Bruce G. (Company: Wadia) (papabravo)


Rate this post
useful
not useful
I'm trying out yagarto for an LPC2388.  I define a value for the PINSEL0 
register as follows:
1
#define PINSEL0 (*(volatile unsigned long *)(0xE002C000))
In main I have a statement like
1
PINSEL0 = (1<<3) ;
I look in the listing file to see the generated code
1
74:src/main.c    ****   PINSEL0 = (0x01 << 3) ;
2
  83                  .loc 1 74 0
3
  84 0008 0E32A0E3     mov  r3, #-536870912  @ D.3582,
4
  85 000c 0B3983E2     add  r3, r3, #180224  @ D.3582, D.3582,
5
  86 0010 0820A0E3     mov  r2, #8  @ tmp141,
6
  87 0014 002083E5     str  r2, [r3, #0]  @ tmp141,* D.3582
The instruction at offset 0008, 0x0E.... does not appear to be a mov 
instruction, rather it looks like a CDP coprocessor instruction, and the 
instruction at offset 000c, 0B.... does not appear to be an add 
instruction.  I tried THUMB instructions but that doesn't seem to be a 
useful path either.  Any clue as to what is going on?

von Andreas B. (Guest)


Rate this post
useful
not useful
The listing has the instruction word jumbled (endianness is wrong).

E3A0320E is a "mov r3, #0xE0000000" and so on.

von Bruce G. (Company: Wadia) (papabravo)


Rate this post
useful
not useful
OK.  That makes sense.  Is there any way to get the listing to go the 
other way?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.