Question: Write a MIPS assembly language subroutine called multiply that multiplies two signed integers passed into the routine in registers $a0 and $a1, and returns the

Write a MIPS assembly language subroutine called multiply that multiplies two signed integers passed into the routine in registers $a0 and $a1, and returns the product in $v0. Assume the result will not overflow 32-bits. Your routine must adhere to the MIPS software convention. You can NOT use the native MIPS instructions mult and multu.

I started some of the code already so you can use what already have. I know you have to do some form of loop since I cannot use the native mips instructions mult and multu but everything else must be written using native MIPS instructions.

.globl main

.text

main:

addi $a0, $0, 999

addi $a1, $0, 321

jal multiply

add $0,$0,$0

addi $a0, $0, -15

addi $a1, $0, 22

jal multiply

add $0,$0,$0

addi $v0, $0, 10

syscall

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!