Yahoo Groups archive

Lpc2000

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

Message

Re: Strange GCC compiler assembler output

2006-05-03 by jayasooriah

--- In lpc2000@yahoogroups.com, Jan Thogersen <jan@...> wrote:

>        E3A0220E   mov r2, #0xE0000000
>        E2822901   add r2, r2, #0x00004000
>        E2822018   add r2, r2, #0x00000018
...
> How come it takes 3 instruction to load the correct address into r2. 

My guess is that you are generating 16-bit code with and compiler is
minimising code size.  The above three instructions then would occupy
three 16-bit locations in memory, while the replacement
 
>        ldr r2 #e0004018

would require one 32-bit instruction and another 32-bit to store the
constant.

Jaya

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.