0
0
ARM Architectureknowledge~10 mins

Why subroutines enable modular assembly code in ARM Architecture - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to call a subroutine named 'process_data'.

ARM Architecture
BL [1]
Drag options to blanks, or click blank then click option'
Astart
Bmain_loop
Cend_program
Dprocess_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using a label that is not a subroutine.
Confusing BL with other branch instructions.
2fill in blank
medium

Complete the code to return from a subroutine.

ARM Architecture
[1]
Drag options to blanks, or click blank then click option'
ABX LR
BMOV PC, R0
CB main
DBLX R1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a branch to a fixed label instead of LR.
Confusing return with a call instruction.
3fill in blank
hard

Fix the error in the subroutine call to correctly save the return address.

ARM Architecture
BL [1]
Drag options to blanks, or click blank then click option'
Amain
Bstart_loop
Cprocess_data
Dreturn
Attempts:
3 left
💡 Hint
Common Mistakes
Using a label that is not a subroutine.
Using a branch instruction that does not save the return address.
4fill in blank
hard

Fill both blanks to create a subroutine that saves and restores registers.

ARM Architecture
PUSH [1]
...
POP [2]
Drag options to blanks, or click blank then click option'
A{LR}
B{R4-R7}
C{R0-R3}
D{PC}
Attempts:
3 left
💡 Hint
Common Mistakes
Saving and restoring different registers.
Not saving registers that the subroutine modifies.
5fill in blank
hard

Fill all three blanks to define a modular subroutine that takes input, processes it, and returns.

ARM Architecture
MOV R0, [1]
BL [2]
[3]
Drag options to blanks, or click blank then click option'
Ainput_value
Bprocess_data
CBX LR
DR1
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong register for input.
Forgetting to return properly from the subroutine.