CAP/TP01/riscv/sum.s
2024-09-23 13:39:04 +02:00

20 lines
261 B
ArmAsm

.globl main
main:
addi sp,sp,-16
sd ra,8(sp)
addi t0, zero, 0
addi t1, zero, 0
addi t2, zero, 9
loop:
beq t1, t2, end
addi t1, t1, 1
add t0, t0, t1
j loop
end:
addi a0, t0, 0
call print_int
call newline
ld ra,8(sp)
addi sp,sp,16
ret