28 lines
340 B
ArmAsm
28 lines
340 B
ArmAsm
|
.syntax unified
|
||
|
.cpu cortex-m4
|
||
|
.thumb
|
||
|
|
||
|
.section .data
|
||
|
test_string: .asciz "Hello"
|
||
|
|
||
|
.section .text
|
||
|
|
||
|
lab1_v2:
|
||
|
sub sp, #6
|
||
|
ldr r0, =test_string
|
||
|
mov r1, #5
|
||
|
|
||
|
copy_loop:
|
||
|
ldrb r2, [r0, r1]
|
||
|
strb r2, [sp, r1]
|
||
|
subs r1, #1
|
||
|
bpl copy_loop
|
||
|
|
||
|
mov r1, sp
|
||
|
mov r0, 0x04
|
||
|
bkpt 0xAB
|
||
|
|
||
|
add sp, #6
|
||
|
|
||
|
mov pc, lr
|