Bird
0
0

What will be the output value in register r3 after executing:

medium📝 Analysis Q5 of 15
ARM Architecture - Control Flow Instructions
What will be the output value in register r3 after executing:
CMP r4, #10
BLT less_than_ten
MOV r3, #100
B end
less_than_ten:
MOV r3, #50
end:

if r4 contains 8?
A0
B100
C8
D50
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate CMP and BLT

    CMP compares r4 with 10; since r4=8, less than 10, BLT branch is taken to less_than_ten.
  2. Step 2: Follow branch instructions

    At less_than_ten, MOV r3, #50 executes; the instruction MOV r3, #100 is skipped.
  3. Final Answer:

    r3 will be 50 -> Option D
  4. Quick Check:

    r4 < 10 triggers BLT, sets r3=50 [OK]
Quick Trick: BLT branches if less, sets r3=50 here [OK]
Common Mistakes:
  • Ignoring branch and setting r3=100
  • Confusing BLT with BGT
  • Assuming r3 keeps old value

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes