Bird
0
0

Why is the SUBS instruction preferred over SUB in ARM assembly loops?

hard📝 Conceptual Q10 of 15
ARM Architecture - Control Flow Instructions
Why is the SUBS instruction preferred over SUB in ARM assembly loops?
ABecause SUBS updates condition flags needed for branch decisions
BBecause SUBS executes faster than SUB
CBecause SUBS stores the result in memory
DBecause SUBS can only subtract 1
Step-by-Step Solution
Solution:
  1. Step 1: Understand difference between SUB and SUBS

    SUBS subtracts and updates condition flags; SUB does not update flags.
  2. Step 2: Importance of flags in loops

    Branch instructions like BNE rely on flags set by SUBS to decide looping.
  3. Final Answer:

    Because SUBS updates condition flags needed for branch decisions -> Option A
  4. Quick Check:

    SUBS updates flags for branching [OK]
Quick Trick: SUBS updates flags; SUB does not [OK]
Common Mistakes:
  • Thinking SUBS is faster
  • Believing SUBS stores to memory
  • Assuming SUBS only subtracts 1

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes