Think about what registers typically do in a CPU during calculations.
General purpose registers R0 to R12 are used to hold temporary data and intermediate results while the CPU executes instructions. They are versatile and not dedicated to special functions like the program counter or stack pointer.
Consider the first few registers used for passing data to functions.
In ARM calling conventions, registers R0 to R3 are used to pass the first four arguments to functions. This allows fast access without using memory.
Think about how system calls are made in ARM Linux.
In many ARM-based operating systems like Linux, R7 is used to hold the system call number before invoking a system call. This helps the kernel identify which service is requested.
Recall the special registers related to stack and program flow.
R12 is a general purpose register often called the Intra-Procedure-call scratch register, while R13 is reserved as the stack pointer (SP) in ARM architecture.
Think about which registers are caller-saved and which are callee-saved.
According to the ARM Procedure Call Standard, registers R0 to R3 are caller-saved (used for passing arguments and can be overwritten), while R4 to R11 are callee-saved and must be preserved by the called function if used.
