title: How can I perform multiplication in MIPS assembly using shift and add?
body: <p>Please help, I've spent over 5 hours trying to figure out this simple problem and I cannot for the life of me figure out how the hell you do it.</p>
  
  <p>I am supposed to do some problem like 7 * 5 and return the result in MIPS assembly, but I HAVE to do it using shift and add. I cannot figure out how to use the hint we were given and turn it into MIPS code. Like I understand 100% how the picture below works and the logic behind it, but I CANNOT turn it into MIPS assembly code, thats what I've spent over 5 hours trying to do.</p>
  
  <p><a href="https://i.stack.imgur.com/lv0oM.png" rel="nofollow noreferrer">here is what we were given as a hint</a></p>
  
  <p>I understand how shifting works, I understand how adding works in MIPS, I just don't know how I can do what is shown in that image, in MIPS assembly language. (I don't know how to turn the english into code that does that stuff. MIPS is too barebones for this!)</p>
  
  <p>I SHOULD CLARIFY!: Both numbers are VARIABLES. I don't know how to write the code that takes two differing numbers each time and gets the result, using shift and add. 7*5, 6*9, 17*3, etc. Whatever the user enters for those two numbers as long as they are non-negative, the code must get the result.</p>