AREA BlockCopy, CODE, READONLY
ENTRY
start
num EQU 0x14
LDR R0,=src
LDR R1,=dst
MOV R2,#num
MOV R13,#0x400
blockcopy MOVS R3,R2,LSR #0x03
BEQ copywords
STMFD SP!,{R4-R11}
octcopy LDMIA R0!,{R4-R11}
STMIA R1!,{R4-R11}
SUBS R3,R3,#0x01
BNE octcopy
LDMFD SP!,{R4-R11}
copywords ANDS R2,R2,#0x07
BEQ stop
wordcopy LDR R3,[R0],#0x04
STR R3,[R1],#0x04
SUBS R2,R2,#0x01
BNE wordcopy
stop MOV R0,#0x18
LDR R1,=0x20025
SWI 0x123456
AREA BlockData, DATA, READWRITE
src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4
dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END