Bird
0
0

Identify the error in this ARM assembly snippet:

medium📝 Analysis Q6 of 15
ARM Architecture - Control Flow Instructions
Identify the error in this ARM assembly snippet:
BL subroutine
MOV R0, #1
subroutine:
MOV R0, #2
B LR
AMOV instruction cannot follow BL
BMissing label after BL instruction
CBL cannot call subroutines with MOV
DIncorrect use of B LR instead of BX LR to return
Step-by-Step Solution
Solution:
  1. Step 1: Check return instruction

    To return from subroutine, BX LR must be used to branch to address in LR.
  2. Step 2: Identify error

    B LR branches to label LR, which likely does not exist, causing error.
  3. Final Answer:

    Incorrect use of B LR instead of BX LR to return -> Option D
  4. Quick Check:

    Return from subroutine requires BX LR [OK]
Quick Trick: Use BX LR, not B LR, to return from subroutine [OK]
Common Mistakes:
  • Using B LR instead of BX LR
  • Assuming B LR returns correctly
  • Confusing branch instructions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes