Question: Write a MIPS code for your program . In the program you prompt the user to enter two numbers and performs multiplication, and division on
Write a MIPS code for your program In the program you prompt the user to enter
two numbers and performs multiplication, and division on two numbers and output the results
Sample output could look like:
Please input the two numbers?
Product is:
Quotient is:
Remainder is:
Do not use mul, must use mult, also do not use move
Sample code for mult
data
space: asciiz
text
main:
li $s
li $s
mult $s $s #multiply $s by $s and place the results
#into lo and hi
mfhi $t #move the value of hi register into $t
mflo $t #move the value of lo register into $t
li $v
add $a $t $
syscall
li $v
syscall
Sample code for div
main:
li $s
li $s
div $s $s #divide $s by $s and place the quotient
#into lo and remainder in hi registers
mfhi $t #move the value of hi register into $t
mflo $t #move the value of lo register into $t
li $v
add $a $t $
syscall
li $v
la $a space
syscall
li $v
add $a $t $
syscall
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
