0
0
ARM Architectureknowledge~10 mins

Parameter passing in registers 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 identify the register used for the first parameter in ARM calling convention.

ARM Architecture
The first parameter is passed in register [1].
Drag options to blanks, or click blank then click option'
Ar0
Br4
Cr7
Dr12
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing r0 with r4 which is used for other purposes.
Assuming parameters are passed on the stack instead of registers.
2fill in blank
medium

Complete the code to specify how many parameters are passed in registers in ARM calling convention.

ARM Architecture
Up to [1] parameters are passed in registers before using the stack.
Drag options to blanks, or click blank then click option'
A4
B2
C6
D8
Attempts:
3 left
💡 Hint
Common Mistakes
Assuming only 2 parameters are passed in registers.
Thinking all parameters are passed in registers regardless of count.
3fill in blank
hard

Fix the error in the statement about parameter passing registers in ARM.

ARM Architecture
The fifth parameter is passed in register [1].
Drag options to blanks, or click blank then click option'
Ar4
Br0
Cr5
Dstack
Attempts:
3 left
💡 Hint
Common Mistakes
Assuming the fifth parameter uses r4 or r5 register.
Not knowing that parameters beyond four go to the stack.
4fill in blank
hard

Fill both blanks to complete the description of ARM parameter passing.

ARM Architecture
Parameters [1] to [2] are passed in registers r0 to r3.
Drag options to blanks, or click blank then click option'
A1
B3
C4
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Starting count from 0 instead of 1.
Including parameter 5 as passed in registers.
5fill in blank
hard

Fill all three blanks to complete the ARM parameter passing code snippet.

ARM Architecture
void func(int a, int b, int c, int d, int e) {
  int reg_params[] = { [1], [2], [3], d };
  // e is passed on the stack
}
Drag options to blanks, or click blank then click option'
Aa
Bb
Cc
De
Attempts:
3 left
💡 Hint
Common Mistakes
Including parameter e in the register array.
Mixing the order of parameters.