qse/ase/cmd/awk/asm.s
2008-03-21 03:49:53 +00:00

15 lines
310 B
ArmAsm

ld zero # initialize sum to zero
st sum
loop get # read a number
jz done # no more input if number is zero
add sum # add in accumulated sum
st sum # store new value back in sum
j loop # go back and read another number
done ld sum # print sum
put
halt
zero const 0
sum const