Bird
0
0

Given a function call in ARM with parameters (5, 10, 15, 20), which registers hold these values before the call?

medium📝 Analysis Q4 of 15
ARM Architecture - Subroutines and Stack
Given a function call in ARM with parameters (5, 10, 15, 20), which registers hold these values before the call?
AR0=5, R1=10, R2=15, R3=20
BR4=5, R5=10, R6=15, R7=20
CR0=20, R1=15, R2=10, R3=5
DR1=5, R2=10, R3=15, R4=20
Step-by-Step Solution
Solution:
  1. Step 1: Recall parameter passing order

    ARM passes parameters in order using R0 to R3 registers.
  2. Step 2: Assign values to registers

    First parameter 5 in R0, second 10 in R1, third 15 in R2, fourth 20 in R3.
  3. Final Answer:

    R0=5, R1=10, R2=15, R3=20 -> Option A
  4. Quick Check:

    Parameters in R0-R3 in order [OK]
Quick Trick: Parameters fill R0 to R3 in call order [OK]
Common Mistakes:
  • Reversing parameter order
  • Using wrong registers for parameters
  • Starting from R1 instead of R0

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes