loco 9 stod iend loco 0 stod ista loco 0 stod sum
init:
lodd ista stod i loco 1
loop:
stod incr /make it generał so we can change ?incrementJ lodd i
subd iend /and if this is ’neg’ or >0’ do loop again jneg loopbody jzer loopbody
loopbody:
jump end /i > iend, so ue’re finished loco array /N.B. loco! addd i / base address + i
pshi / push array[i], i.e. M[base addr + i]
iterate:
/ this is the only uay we can get indirect addressing pop / AC <- array[i] addd sum stod sum lodd i addd incr stod i jump loop