26 lines
222 B
ArmAsm
26 lines
222 B
ArmAsm
.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
|