mirror of
https://github.com/GnoConsortium/gno.git
synced 2025-01-08 02:30:45 +00:00
ddb82cb2e0
Maybe someday I'll become adept at using cvs...
17 lines
413 B
NASM
17 lines
413 B
NASM
# print sum of input numbers (terminated by zero)
|
|
|
|
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
|