Multiplying a register value by a constant in MIPS?

Viewed 18032

I'm learning how to do MIPS and i'm confused on multiplication. Let's say I was converting the following C Code into MIPS.

c = b + a*3 

with a,b,c stored in registers $s1,$s2,$s3 respectively. How am I supposed to write a*3 in MIPS? Is there an addi type instruction for multiplication or do I store 3 in a temporary register and use the mult operator like this?

addi $t0, $zero, 3
mult $s1,$t0

If so how do I get the final value or product of this operation to complete my C code?

1 Answers
Related