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?
✗ Incorrect
The link register (r14) holds the return address so the subroutine knows where to return after finishing.
How are more than four arguments passed to a subroutine in AAPCS?
✗ Incorrect
Only the first four arguments use registers r0 to r3; any additional arguments are passed on the stack.
Which registers are caller-saved in AAPCS?
✗ Incorrect
Registers r0 to r3 and r12 are caller-saved, meaning the caller must save them if needed after the call.
What must a subroutine do with callee-saved registers before modifying them?
✗ Incorrect
Callee-saved registers must be preserved by saving their values on the stack and restoring them before returning.
Where is the stack pointer stored in ARM architecture under AAPCS?
✗ Incorrect
The stack pointer is stored in register r13.
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.