_           _                 
 | |_ ___  __| |____  ___ _   _ 
 | __/ _ \/ _` |_  / / _ \ | | |
 | ||  __/ (_| |/ / |  __/ |_| |
  \__\___|\__,_/___(_)___|\__,_|

ARM Cortex-M0+ assembly language array copy

https://cpulator.01xz.net/?sys=arm

.syntax unified
//.cpu cortex-m0plus // comment this for online simulator

.global _start

_start:
    movs R3,#4

    ldr R0,=src
    ldr R1,=dest
while_loop:
    ldr R2,[R0]
    str R2,[R1]
    subs R3,#1
    beq exit
    adds R0,#4
    adds R1,#4
    b while_loop

exit:
    B .

.align 4
.data
dest: .word 0,0,0,0

.text
src: .word 1,2,3,4