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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started