Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] Strange GCC compiler assembler output

2006-05-03 by Dominic Rath

On Wednesday 03 May 2006 14:19, Jan Thogersen wrote:
> How come it takes 3 instruction to load the correct address into r2.
> First it moves #0xE0000000 to r2, then adds #0x00004000 and finally adds
> #0x00000018 to end up with #0xE0004018 which is the address of T0MR0.
> But why don't it just move #0xE0004018 into the r2 in the first
> instruction?

You can't have an opcode + 32-bit operand when your instruction is only 32-bit 
wide. Move immediate takes a 12-bit operand, consisting of an 8-bit value and 
a 4-bit rotating constant, allowing you to shift the 8-bit to any even bit 
location.

Regards,

Dominic

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.