Question

Write a MIPS program that negates a positive number using 2s complement. E.g.: 0x00000003 is converted...

Write a MIPS program that negates a positive number using 2s complement. E.g.: 0x00000003 is converted into 0xFFFFFFFD.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
.data
   string:    .asciiz "Enter a number: "
   result: .asciiz "2's complement is "

.text

   la $a0, string
   li $v0, 4
   syscall

   li $v0, 5
   syscall

   sub $t0, $zero, $v0

   la $a0, result
   li $v0, 4
   syscall

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

   li $v0, 10
   syscall
Add a comment
Know the answer?
Add Answer to:
Write a MIPS program that negates a positive number using 2s complement. E.g.: 0x00000003 is converted...
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