0
0
ARM Architectureknowledge~10 mins

Loop implementation in assembly in ARM Architecture - Interactive Code Practice

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

Complete the code to initialize the loop counter register.

ARM Architecture
MOV R0, [1]
Drag options to blanks, or click blank then click option'
A#10
BR1
C#0
DR2
Attempts:
3 left
💡 Hint
Common Mistakes
Using another register instead of an immediate value to initialize the counter.
Forgetting the '#' symbol before the number.
2fill in blank
medium

Complete the code to decrement the loop counter register.

ARM Architecture
SUB [1], [1], #1
Drag options to blanks, or click blank then click option'
AR0
BR3
CR2
DR1
Attempts:
3 left
💡 Hint
Common Mistakes
Using different registers for destination and operand.
Using the wrong register that was not initialized as the counter.
3fill in blank
hard

Fix the error in the loop condition check instruction.

ARM Architecture
CMP [1], #0
Drag options to blanks, or click blank then click option'
AR1
BR0
C#0
DR2
Attempts:
3 left
💡 Hint
Common Mistakes
Comparing an immediate value to another immediate value.
Using a register that is not the loop counter.
4fill in blank
hard

Fill both blanks to create a loop that repeats until the counter reaches zero.

ARM Architecture
BNE [1]
MOV [2], #0
Drag options to blanks, or click blank then click option'
Aloop_start
BR0
CR1
Dend_loop
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong label name in the branch instruction.
Resetting the wrong register after the loop.
5fill in blank
hard

Fill all three blanks to implement a complete loop that counts down from 5 to 1.

ARM Architecture
loop_start:
MOV [1], [2]
SUB [3], [3], #1
CMP [3], #0
BNE loop_start
Drag options to blanks, or click blank then click option'
AR0
B#5
DR1
Attempts:
3 left
💡 Hint
Common Mistakes
Using different registers inconsistently for the counter.
Not initializing the counter before the loop.