I have to write a program using the IAS instruction set that will loop through two arrays and add each element of the one to the other and store the result in a thrid array. So for example I have to take A(1) + B(1) and store it in C(1) and then take A(2) + B(2) and store in C(2) and so on until I get to A(20) + B(20) stored in C(20). But I don’t know how to create a counter controlled loop in IAS… anyways… here is what I have done.. but it doesn’t work 🙂
00000001 LOAD M(A[1]) Transfer M(A[1]) to the accumulator
00000101 ADD M(B[1]) Add M(B[1]) to AC and store result in AC
00100001 STOR M(C[1]) Transfer contents of accumulator to memory location C[1]
thanks for any help 🙂
For anyone in the future. There are actually numerous solutions to this question, this is the one I went with (it may need some elaboration):