-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmultV2.ass
39 lines (26 loc) · 1008 Bytes
/
multV2.ass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
startSwilhe:
SLT $a0, $s6, $s1 ; a_control < tam
BEQZ $a0, endSwilhe ; while
ADD $t0, $zero, $s4 ; i = i_start
SLT $a0, $t0, $s3 ; i < loop_control
BEQZ $a0, endTwilhe ; while
; matrixC[i] += matrixA[a_control] * matrixB[b_control]
LB $a1, matrixA($s6) ; matrixA[a_control]
LB $a2, matrixB($s5) ; matrixB[b_control]
MULT $a1, $a2
MFLO $a1
LB $a2, matrixR($t0)
ADD $a2, $a2, $a1
SW $a2, matrixR($t0)
ADDI $s6, $s6, 0x4 ; a_control += 4
ADDI $t0, $t0, 0x4 ; i += 4
startSwilhe
endTwilhe:
endSwilhe:
ADD $s3, $s3, $s0 ; loop_control += ordem
ADD $s4, $s4, $s0 ; i_start += ordem
ADD $s6, $s6, $zero ; a_control = 0
ADDI $s2, $s2, 0x4 ; column_control += 4
B startFwilhe
endFwilhe:
SYSCALL 0