;******************************************************** ;* Copy and paste RW data/zero initialized data * ;******************************************************** LDR r0, =|Image$$RO$$Limit| ; Get pointer to ROM data LDR r1, =|Image$$RW$$Base| ; and RAM copy LDR r3, =|Image$$ZI$$Base| ;Zero init base => top of initialised data
CMP r0, r1 ; Check that they are different BEQ %F1 0 CMP r1, r3 ; Copy init data LDRCC r2, [r0], #4 ;--> LDRCC r2, [r0] + ADD r0, r0, #4 [r0]-->r2 , r0+4-->r0 STRCC r2, [r1], #4 ;--> STRCC r2, [r1] + ADD r1, r1, #4 r2-->[r1] , r1+4-->r1 BCC %B0 1 LDR r1, =|Image$$ZI$$Limit| ; Top of zero init segment MOV r2, #0 2 CMP r3, r1 ; Zero init STRCC r2, [r3], #4 BCC %B2
[em06]