#Add a column of input values and produce the sum as #output. The first input value - the number of values #that follow as input to be added. LDA ZERO STO SUM #initialize sum to zero IN #input the count STO COUNT #save it NEXT IN #input a number ADD SUM STO SUM #add to sum and store sum LDA COUNT SUB ONE #decrement count by 1 STO COUNT BRZ END #done - output result BR NEXT #not done - ready for next input END LDA SUM OUT #output result HLT ZERO DAT 000 #constant 0 ONE DAT 001 #constant 1 SUM DAT 000 COUNT DAT 000