2014-07-10 05:31:11 +00:00
|
|
|
.syntax unified
|
2020-04-24 05:45:00 +00:00
|
|
|
.text
|
2014-03-08 16:21:16 +00:00
|
|
|
|
2021-03-18 14:28:40 +00:00
|
|
|
/*
|
|
|
|
* Arguments:
|
|
|
|
* r0 - source memory ptr
|
|
|
|
* r1 - target memory ptr
|
|
|
|
* r2 - count of bytes
|
|
|
|
* r3 - flash register offset
|
|
|
|
*/
|
|
|
|
|
2020-04-29 14:40:06 +00:00
|
|
|
.global copy
|
|
|
|
copy:
|
|
|
|
loop:
|
2020-04-24 05:45:00 +00:00
|
|
|
# copy 4 bytes
|
2021-03-18 14:28:40 +00:00
|
|
|
ldr r4, [r0]
|
|
|
|
str r4, [r1]
|
2014-03-08 16:21:16 +00:00
|
|
|
|
2021-03-18 14:28:40 +00:00
|
|
|
# increment address
|
|
|
|
add r0, r0, #4
|
|
|
|
add r1, r1, #4
|
2014-03-08 16:21:16 +00:00
|
|
|
|
2021-03-18 14:28:40 +00:00
|
|
|
# loop if count > 0
|
|
|
|
subs r2, r2, #4
|
|
|
|
bgt loop
|
2014-03-08 16:21:16 +00:00
|
|
|
|
2020-04-29 14:40:06 +00:00
|
|
|
exit:
|
2020-04-24 05:45:00 +00:00
|
|
|
bkpt
|