Bird
0
0

Identify the error in this nested subroutine call sequence:

medium📝 Analysis Q6 of 15
ARM Architecture - Subroutines and Stack
Identify the error in this nested subroutine call sequence:
funcX:
  BL funcY
  BX LR

funcY:
  BL funcZ
  BX R14

funcZ:
  BX LR
AMissing MOV instruction before BL
BNo error present
CIncorrect label names
DUsing BX R14 instead of BX LR in funcY
Step-by-Step Solution
Solution:
  1. Step 1: Understand return instruction conventions

    Return from subroutine uses BX LR, where LR holds the return address.
  2. Step 2: Verify register usage

    R14 is the link register (LR) alias; BX R14 is equivalent to BX LR and functions correctly in nested calls.
  3. Final Answer:

    No error present -> Option B
  4. Quick Check:

    BX R14 == BX LR, fully valid [OK]
Quick Trick: BX LR or BX R14 both valid for return [OK]
Common Mistakes:
  • Thinking BX R14 is invalid
  • Assuming only LR symbolic name is permitted

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes