0
0
ARM Architectureknowledge~5 mins

Branch and link (BL) for subroutines in ARM Architecture - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the BL instruction do in ARM architecture?
The BL (Branch and Link) instruction jumps to a subroutine address and saves the return address in the link register (LR) so the program can return after the subroutine finishes.
Click to reveal answer
beginner
Why is the link register (LR) important when using BL?
LR stores the address to return to after the subroutine completes, allowing the program to continue from where it left off.
Click to reveal answer
beginner
How does BL differ from a simple branch (B) instruction?
BL saves the return address in LR before jumping, while B just jumps without saving the return point.
Click to reveal answer
intermediate
What happens if you forget to use BL and use B instead for a subroutine call?
The program will jump to the subroutine but won’t save the return address, so it cannot return properly, causing errors or crashes.
Click to reveal answer
beginner
How do you return from a subroutine called with BL in ARM?
You return by branching to the address stored in the link register (LR), usually with the instruction 'BX LR' or 'MOV PC, LR'.
Click to reveal answer
What does the BL instruction do in ARM?
APerforms arithmetic addition
BOnly jumps to a new address without saving return
CJumps to a subroutine and saves return address
DLoads a value into a register
Where is the return address stored after a BL instruction?
ALink Register (LR)
BStack Pointer (SP)
CProgram Counter (PC)
DGeneral Purpose Register R0
Which instruction is used to return from a subroutine called by BL?
AB LR
BBX LR
CBL LR
DMOV PC, LR
What happens if you use B instead of BL to call a subroutine?
ASubroutine runs and returns correctly
BProgram crashes immediately
CNothing happens
DSubroutine runs but return address is lost
BL instruction is mainly used for:
ACalling subroutines
BLooping
CData transfer
DArithmetic operations
Explain how the BL instruction works and why the link register is important.
Think about how the program remembers where to come back after a subroutine.
You got /3 concepts.
    Describe what could go wrong if you use a branch (B) instruction instead of BL for calling a subroutine.
    Consider what happens when the program tries to return without knowing where to go.
    You got /3 concepts.