Forum: ARM programming with GCC/GNU tools Code Generation

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

Rate this post
0 useful
not useful
I'm trying out yagarto for an LPC2388.  I define a value for the PINSEL0 
register as follows:
#define PINSEL0 (*(volatile unsigned long *)(0xE002C000))
In main I have a statement like
PINSEL0 = (1<<3) ;
I look in the listing file to see the generated code
74:src/main.c    ****   PINSEL0 = (0x01 << 3) ;
  83                  .loc 1 74 0
  84 0008 0E32A0E3     mov  r3, #-536870912  @ D.3582,
  85 000c 0B3983E2     add  r3, r3, #180224  @ D.3582, D.3582,
  86 0010 0820A0E3     mov  r2, #8  @ tmp141,
  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
0 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
0 useful
not useful
OK.  That makes sense.  Is there any way to get the listing to go the 
other way?


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.