Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Beginner questions

2005-08-26 by y4krys

What is the mode your compiler is set to?  In THUMB mode all data 
must be 16 bits long.  ARM can add shifts to load some 32-bit values 
to registers, but not always.

Krys

--- In lpc2000@yahoogroups.com, "Brian C. Lane" <brian@s...> wrote:
> Hey guys, I've started working with the LPC2138. I'm still working 
> through the docs, but one question I have is this:
> 
> PLLCFG  = (4 + (2 << 5));
>    E3A0320E   mov r3, #0xE0000000
>    E283397F   add r3, r3, #0x001FC000
>    E2833084   add r3, r3, #0x00000084
>    E3A02044   mov r2, #0x00000044
>    E5C32000   strb r2, [r3]
> 
> I'm using CrossWorks with a Olimex JTAG (works great so far BTW) 
with 
> optimization turned off.
> 
> ARM assembly still isn't clear to me yet, so this is probably 
buried in 
> the technical docs somewhere.
> 
> Why doesn't this compile to something like:
> 
> mov r3, #0xE01FC084
> mov r2, #0x00000044
> strb r2, [r3]
> 
> Can't the ARM load a 32 bit immediate?
> 
> Thanks,
> 
> Brian
> 
> -- 
> -----------------------------------------------------
> Brian C. Lane (W7BCL)                      Programmer
> www.shinemicro.com   RF, DSP & Microcontroller Design

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.