Question

Please code in ARM cm4Problem 5 Write a program that corresponds to the following C code: if (a > b) c = c + 5; if (a < b) c = c - 5; if (a == b) c

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

      CMP A0, B0 ; compare a and b
      BEQ equal ; go to 'equal' if a=b
      BLT less ; go to 'less' if a<b
      ADD C0, C0, #5 ; otherwise: c=c+5
less  SUB C0, C0, #5 ; c=c-5
equal ADD C0, C0, #10 ; (else a must be equal to b, hence c=c+10)
Add a comment
Know the answer?
Add Answer to:
Please code in ARM cm4 Problem 5 Write a program that corresponds to the following C...
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