Original Post
I need a little help understanding the following code for the IBM circa machine, from the 1950's. The first line is simply declaring a constant of value 0, but what does the next line do? index, i ? Does anybody know what this means ? I have tried searching google for documentation but I cannot find any.
+0 000 000 000 (loc 0) constant 0
+0 000 000 000 (loc 1) index, i
+0 000 000 000 (loc 2) sum of array
+0 000 000 000 (loc 3) average of array
+0 000 000 000 (loc 4) number of elements in array
+0 000 000 000 (loc 5) temporary location
+0 000 000 000 (loc 6-999) the array
+9 999 999 999 end of initial data
+8 000 000 004 (loc 0) read number of elements
+8 000 000 005 (loc 1) read data into temp
+5 005 000 004 (loc 2) if positive, skip
-1 000 005 005 (loc 3) else negate
-6 005 006 001 (loc 4) move temp into array sub i
+7 001 004 001 (loc 5) incr. i, test with n, loop to loc. 1
+0 000 000 001 (loc 6) reinitialize i to zero
+6 006 001 005 (loc 7) add array sub i
+1 005 002 002 (loc 8) to sum
+7 001 004 007 (loc 9) incr. i, test with n, loop to loc. 7
-2 002 004 003 (loc 10) sum / number of elements -> avg.
-8 003 000 000 (loc 11) print average
+9 000 000 000 (loc 12) stop
+9 999 999 999 end program
+0 000 000 010 number of input values
input data