Bird
0
0

Consider a function call in ARM with six integer parameters. Which registers and memory locations hold these parameters?

medium📝 Analysis Q13 of 15
ARM Architecture - Subroutines and Stack
Consider a function call in ARM with six integer parameters. Which registers and memory locations hold these parameters?
Ar0, r1 hold first two; r2 to r5 hold next four
Br0, r1, r2, r3 hold first four; stack holds 5th and 6th
CStack holds all six parameters
Dr0 to r5 hold all six parameters
Step-by-Step Solution
Solution:
  1. Step 1: Identify register usage for parameters

    ARM passes first four parameters in r0 to r3 registers.
  2. Step 2: Determine location for extra parameters

    Parameters beyond the fourth (5th and 6th) are passed on the stack.
  3. Final Answer:

    r0, r1, r2, r3 hold first four; stack holds 5th and 6th -> Option B
  4. Quick Check:

    Extra params after 4th go to stack [OK]
Quick Trick: First 4 params in r0-r3; rest on stack [OK]
Common Mistakes:
  • Assuming registers beyond r3 hold parameters
  • Ignoring stack usage for extra parameters
  • Mixing register order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes