ra/naloga_10/vaja_03.s
Gašper Dobrovoljc 4b6ea9f800
naloga_10
2024-01-07 18:06:17 +01:00

38 lines
436 B
ArmAsm

.text
.org 0x20
tabela: .byte 192, 155, 224, 48, 0, 128, 99, 147, 177, 100
rezultat: .space 2
@ r0 - addr
@ r1 - > 100 count
@ r2 - index
@ r3 - tmp
@ r4 - sum
.global _start
_start:
adr r0, tabela
mov r1, #0
mov r2, #0
mov r4, #0
loop:
ldrb r3, [r0, r2]
add r4, r3
cmp r3, #100
addhi r1, #1
cmp r2, #9
add r2, #1
bls loop
adr r0, rezultat
strh r4, [r0]
_end:
b _end