[Mothers Against Drunk Driving]
The mips command MADD is a Multiply then add command. How to use it is the question. If you have watched Leet's tutorials on multiplying and division then this will be relatively easy for you. Okay here is my example:
$LO & $HI
These registers store the multiplying and division in the $LO & if your division has a remainder then it stores it in the $HI register.
So if I write this little routine:
Madd t1 = t1 x t2 + t3
So what happened was 4 x 8 = 32 + 2 = 34 and 34 is stored into t1.
With madd command you don't need to retrieve the result from the $LO because of the add command
Hope I helped out,
-Emu
The mips command MADD is a Multiply then add command. How to use it is the question. If you have watched Leet's tutorials on multiplying and division then this will be relatively easy for you. Okay here is my example:
$LO & $HI
These registers store the multiplying and division in the $LO & if your division has a remainder then it stores it in the $HI register.
So if I write this little routine:
Code:
lui t0, $0880
Addi t1, zero, $4
Addi t2, zero, $8
Addi t3, zero, $2
Madd t1, t1, t2, t3
Sw t1, $0000(t0)
Jr ra
nop
So what happened was 4 x 8 = 32 + 2 = 34 and 34 is stored into t1.
With madd command you don't need to retrieve the result from the $LO because of the add command
Hope I helped out,
-Emu