This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hal_platform_setup memory copying code


On Mon, 2005-01-31 at 14:07 -0800, ecosrtos ecosrtos wrote:
> Hi
> How do r1 and r0 get incremented in the following code. Is it implicit
> in some instruction?
> 
> #if defined(CYG_HAL_STARTUP_ROMRAM)
>         ldr     r0,=0x01000000          // Relocate FLASH/ROM to on-chip RAM
>         ldr     r1,=0x02000000          // RAM base & length
>         ldr     r2,=0x02010000
> 20:     ldr     r3,[r0],#4
>         str     r3,[r1],#4
>         cmp     r1,r2
>         bne     20b
>         ldr     r0,=30f
>         mov     pc,r0
> 30:
> #endif

Yes, the address form [r0],#4 is the same as the C construct *ptr++
It [post] increments the value in register r0.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]