Question

Please write a MIPS program to prompt the user to input three positive integers and then print out their greatest common prime factor.

Please write a MIPS program to prompt the user to input three positive integers and then print out their greatest common prime factor.
What to submit:
1. Your MIPS program file.
2. The log file of simulation in SPIM. The log file should contain the Registers,  Text Segments, Data Segments, and Console.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
cd:
  # k0  k1 and k2 are the three integer 
  # return value is in v0
  move $t0, $k0
  move $t1, $k1
  move $t2, $k2
loop:
  beq $t1, $0, done
  div $t0, $t1
  move $t0, $t1
  mfhi $t1
  j loop
done:
  move $v0, $t0
  jr $ra


answered by: gavin
Add a comment
Know the answer?
Add Answer to:
Please write a MIPS program to prompt the user to input three positive integers and then print out their greatest common prime factor.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT