BUT2/SCR/SCR1.2/TP16-ARM/small-loop.s

26 lines
222 B
ArmAsm
Raw Normal View History

2023-10-23 13:23:36 +02:00
.equ SYS_EXIT, 93
.data
int: .word 12
.text
.globl _start
_start:
adr x1,int
ldr w0,[x1]
mov w1,#0
mov w2,#1
bcl: cmp w2,w0
b.gt fin
add w1,w1,w2
add w2,w2,#1
b bcl
fin:
mov x0, x1
mov w8,#SYS_EXIT
svc #0
.end