Question

Accept 2 numbers from user add them and print the sum using MARS mips

Accept 2 numbers from user add them and print the sum using MARS mips

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

.data
msg_first: .asciiz " Input first number: \n"
msg_second: .asciiz "Input second number: \n"
msg_sum: .asciiz "\nThe result of addition is: "

.text
main:
li $v0,4
la $a0,msg_first
syscall

li $v0,5
syscall

move $t2,$v0

li $v0,4
la $a0,msg_second
syscall

li $v0,5
syscall

move $t3,$v0

add $t4,$t2,$t3

li $v0,4
la $a0,msg_sum
syscall

li $v0,1
move $a0,$t4
syscall

li $v0,10
syscall

Add a comment
Know the answer?
Add Answer to:
Accept 2 numbers from user add them and print the sum using MARS mips
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