Assembly

eu tenho um codigo em c

(a1 + a2) . n

em linguagem mips as variaveis a1 = $t0 s2 =$t1 e n = $t2

como ficaria a parte da multiplicação usando um sll?

a soma ficaria

add $t3,$t0,$t1 (t3 = a1 + a2)

sll $t3, $t3 … essa parte que eu nao consigo

Pesquisa básica e o google jogou isso:

Shift left logical

sll $1,$2,CONST
$1 = $2 << CONST
shifts CONST number of bits to the left (multiplies by 2^n )

No link tem uma tabela mostrando todas as operações.

eu tava em duvida se poderia colocar esse 2^n

A propósito, usar shift + add é uma solução particular para alguns valores de n. Por exemplo, para multiplicar um número por 10, você faz algo como:

x = (((x << 2) + x) << 1;