lab2: simplify string printout

This commit is contained in:
ІО-23 Шмуляр Олег 2025-02-08 22:12:20 +02:00
parent 86de75098a
commit 54ce3caccb
1 changed files with 10 additions and 15 deletions

View File

@ -2,26 +2,21 @@
.cpu cortex-m4
.thumb
.macro BKPT_WRITE addr_src
mov r0, 0x4
mov r1, \addr_src
bkpt 0xAB
.endm
.section .data
test_string: .asciz "Hello"
.section .text
lab1_v2:
sub sp, #6
ldr r0, =test_string
mov r1, #5
push {lr}
copy_loop:
ldrb r2, [r0, r1]
strb r2, [sp, r1]
subs r1, #1
bpl copy_loop
ldr r1, =test_string
BKPT_WRITE r1
mov r1, sp
mov r0, 0x04
bkpt 0xAB
add sp, #6
mov pc, lr
pop {pc}