Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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