Question

Write a mips program which finds if the sum of two integers is multiple of 8.and...

Write a mips program which finds if the sum of two integers is multiple of 8.and set the value of register vi to 1 if it is and to -1 if its not.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the code below::

.text
#setting value for testing purpose
li $s0,4 #save 4 to s0
li $s1,7 #save 7 to s1
add $s0,$s0,$s1 #get the sum
div $s0,$s0,8 #divide by 8
mfhi $s0 #get reminder to s0
beqz $s0,divideByZero
li $v1,-1
j exit
divideByZero:
li $v1,1
exit:

Add a comment
Know the answer?
Add Answer to:
Write a mips program which finds if the sum of two integers is multiple of 8.and...
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