0
0
ARM Architectureknowledge~5 mins

Subroutine call convention (AAPCS) in ARM Architecture - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does AAPCS stand for in ARM architecture?
AAPCS stands for ARM Architecture Procedure Call Standard. It defines rules for how functions receive parameters, return values, and manage registers.
Click to reveal answer
beginner
Which registers are used to pass the first four arguments to a subroutine in AAPCS?
The first four arguments are passed using registers r0, r1, r2, and r3.
Click to reveal answer
beginner
How does AAPCS specify the handling of the return value from a subroutine?
The return value is placed in register r0. For larger data, r1 may also be used.
Click to reveal answer
intermediate
What is the role of the stack in the AAPCS calling convention?
The stack is used to store additional arguments beyond the first four, save registers that must be preserved, and manage local variables.
Click to reveal answer
intermediate
Which registers must a subroutine preserve according to AAPCS?
Registers r4 to r11 and the stack pointer (sp) must be preserved by the called subroutine. These are called callee-saved registers.
Click to reveal answer
In AAPCS, which register holds the return address when a subroutine is called?
Ar14 (link register)
Br15 (program counter)
Cr13 (stack pointer)
Dr0
How are more than four arguments passed to a subroutine in AAPCS?
AAll arguments are passed in registers
BExtra arguments are passed on the stack
CExtra arguments are ignored
DExtra arguments are passed in special memory
Which registers are caller-saved in AAPCS?
Ar0 to r3 and r12
Br4 to r11
Cr13 to r15
DAll registers
What must a subroutine do with callee-saved registers before modifying them?
ANothing, they can be freely modified
BUse different registers instead
CPass them to the caller
DSave them on the stack and restore before returning
Where is the stack pointer stored in ARM architecture under AAPCS?
Ar15
Br14
Cr13
Dr12
Explain how arguments and return values are handled in the AAPCS calling convention.
Think about registers used for input and output of subroutines.
You got /4 concepts.
    Describe the difference between caller-saved and callee-saved registers in AAPCS and why this matters.
    Consider who is responsible for saving which registers.
    You got /4 concepts.