mult
Multiply signed
Multiplies $t1 by $t2 as signed 32-bit integers and leaves the 64-bit product in HI and LO.
Used in
- Arithmetic, logic and bitsMIPS assembly
- Multiply and divide with hi and loMIPS assembly
Forms
mult ,
Operands
$t1- Any general-purpose register,
$0to$31, using its numeric or named spelling, such as$8or$t0($zerois$0;$rais$31). $t2- A general-purpose register. It may be the same register as
$t1.
The 64-bit product is split: the upper 32 bits go into the HI register and the lower 32 bits go into the LO register. Use 'mfhi' to read HI and 'mflo' to read LO.
# Multiply 6 by 7. Inspect HI:LO: 42 (HI=0, LO=42).
li $t0, 6
li $t1, 7
mult $t0, $t1
mflo $t2
mfhi $t3