/Evan O'Keeffe
/10324289
/5x5 matrix adder
/initialize routine
ORG 100
load stmp
add sm1 / adding the address of matrix one
store strcmd
CLEAR
/input for the first matrix
loop1, input
store datatemp
jns stri
load count1
subt one
store count1
clear
load count1
skipcond 400
jump loop1
/this is the second matrix
clear
load stmp
add sm2 /adding the address of the second matrix
store strcmd
CLEAR
loop2, input
store datatemp
jns stri
load count2
subt one
store count2
clear
load count2
skipcond 400
jump loop2
/this is the routine to add the two matrices
load stmp
add sm3 /adding the address of the third matrix
store strcmd
load sm1
store tmp1
load sm2
store tmp2
loop3, clear
addi tmp1
addi tmp2
skipcond 000
jump I
jump error
I, store datatemp
jns stri
load tmp1
add one
store tmp1
load tmp2
add one
store tmp2
clear
load count3
subt one
store count3
clear
load count3
skipcond 400
jump loop3
/routine to print out results
load sm3
store addr
loop4, clear
addi addr
output
load addr
add one
store addr
clear
load count4
subt one
store count4
skipcond 400
jump loop4
jump end
/routine to print out the over flow error message
error, load em
store addr
error1, clear
addi addr
output
load addr
add one
store addr
clear
load count5
subt one
store count5
skipcond 400
jump error1
jump end
end, halt
/store indirect routine for the first 3 loops
stri, hex 0 /this contains the address from the jns
load datatemp
strcmd, hex 0
load strcmd
add one
store strcmd
jumpi stri
/end of sub routine
/VARIABLES
addr, hex 0
count1, DEC 4
count2, DEC 4
count3, DEC 4
count4, DEC 4
count5, dec 16
one, DEC 1
tmp, hex 0
tmp1, hex 140
tmp2, hex 200
stmp, hex 2000
sm1, hex 170
sm2, hex 189
sm3, hex 1A2
em, hex 1BC
datatemp, hex 0
matrix1, hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
matrix2, hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
matrix3, hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
hex 0
message, hex 0
emessage, dec 79/o
dec 86/v
dec 69/e
dec 82/r
dec 13/carriage return
dec 70/f
dec 76/l
dec 79/o
dec 87/w
dec 13/carraige return
dec 69/e
dec 82/r
dec 82/r
dec 79/o
dec 82/r
dec 0