Bird
0
0

What is wrong with this nested call sequence?

medium📝 Analysis Q7 of 15
ARM Architecture - Subroutines and Stack
What is wrong with this nested call sequence?
func1:
  BL func2
  BX LR

func2:
  BL func3
  BX LR

func3:
  BX func1
Afunc3 should return with BX LR, not BX func1
Bfunc1 should not call func2
Cfunc2 should not call func3
DNo error, this is valid
Step-by-Step Solution
Solution:
  1. Step 1: Check return instructions in nested calls

    Each subroutine should return to its caller using BX LR.
  2. Step 2: Identify incorrect return in func3

    func3 uses BX func1, which jumps directly to func1 instead of returning properly.
  3. Final Answer:

    func3 should return with BX LR, not BX func1 -> Option A
  4. Quick Check:

    Return must use BX LR, not jump to label [OK]
Quick Trick: Return with BX LR, never jump directly to caller label [OK]
Common Mistakes:
  • Using BX label instead of BX LR to return
  • Confusing jump and return instructions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes