MIPS that multiplies $a0 (integer) by 16
Clash Royale CLAN TAG #URR8PPP MIPS that multiplies $a0 (integer) by 16 I am trying to figure out how the code below works and would gladly accept any help I can get. The question (with the solution) is posted below and I don't understand why they use sll and not mult (which I would). I have also posted my code but I assume that it is wrong. sll mult Question: Implement (code) an operation (function) that multiplies $a0 (integer) by 16 using native MIPS instructions (shifts, adds, subs, etc.). The result should be stored in $v0. You may use $t0, $t1, $t2 as scrap registers. Their solution: sll $v0, $a0, 4 0 sll $v0, $a0, 4 0 My solution : li $a0, 4 li $vo, 0 mult $a0, $a1 division and multiplication by power of 2. In higher level languages you'll use a left shift operator like << – phuclv 3 mins ago << ...