// This is the matrix multiplication program 
// Initialize all the variables
00100000 00000100 00000000 00011000 // addi R4, R0, 24  - Store Stride 
00100000 00010100 00000000 00000000 // addi R20, R0, 0  -  Base A
00100000 00010101 00000000 10010000 // addi R21, R0, 144 - Base B
00100000 00010110 00000001 00100000 // addi R22, R0, 288 - Base C
00100000 00010111 00000000 00000110 // addi R23, R0, 6 - Store max value
00000000 00000000 00001000 00100000 // add R1, R0, R0 - Initialize i
00000000 00000000 00010000 00100000 // add R2, R0, R0 - Initialize j
00000000 00000000 00011000 00100000 // add R3, R0, R0 - Initialize k

00000000 01100100 00101000 00011000 // mul R5, R3, R4 - Stride along k
00000000 01000000 00110000 10000000 // sll R6, R2, 2  - Stride along j
00000000 10100110 00110000 00100000 // add R6, R5, R6 - Offset for B
00000000 11010101 00111000 00100000 // add R7, R21, R6 - Address of B[k][j]
10001100 11101000 00000000 00000000 // lw  0(R7), R8   - Load value at B[k][j]

00000000 00100100 01001000 00011000 // mul R9, R1, R4 - Stride along i
00000000 01100000 01010000 10000000 // sll R10, R3, 2  - Stride along k
00000001 01001001 01010000 00100000 // add R10, R9, R10 - Offset for A
00000010 10001010 01011000 00100000 // add R11, R20, R10 - Address of A[i][k]
10001101 01101100 00000000 00000000 // lw  0(R11), R12   - Load value at A[i][k]

00000000 01000000 00110000 10000000 // sll R6, R2, 2  - Stride along j
00000001 00100110 01110000 00100000 // add R14, R9, R6 - Offset for C
00000001 11010110 01111000 00100000 // add R15, R14, R22 - Address of C[i][j]
10001101 11110000 00000000 00000000 // lw  0(R15), R16   - Load value at C[i][j]

00000001 10001000 01000000 00011000 // mul R8, R12, R8 - A[i][k] * B[k][j]
00000001 00010000 10000000 00100000 // add R16, R8, R16 - add C[i][j] 
10101101 11110000 00000000 00000000 // sw  0(R15),R16   - store the result back 

00100000 01100011 00000000 00000001 // addi R3, R3, #1 - increment k
00000010 11100011 11000000 00100010 // sub  R24, R23, R3 - done ??
00010111 00000000 11111111 10110000 // bnez R24, No change required since this is an offset 

00100000 01000010 00000000 00000001 // addi R2, R2, #1 - increment j
00000010 11100010 11000000 00100010 // sub R24, R23, R2 - done ??
00010111 00000000 11111111 10100000 // bnez R24, changed last 16 bits (2's complement offset)

00100000 00100001 00000000 00000001 // addi R1, R1, #1 - increment i
00000010 11100001 11000000 00100010 // sub R24, R23, R1 - done ??
00010111 00000000 11111111 10010000 // bnez R24, changed last 16 bits (2's complement offset)

00110100 00000000 00000000 00000000 // hlt
