SVC is a privileged instruction in ARM architecture that generates a software interrupt for requesting system services.

Key Characteristics:

How it Works:

  1. User code executes the SVC instruction with a parameter
  2. Processor automatically:

Common Uses:

Creating SVC Services in arm gcc (cubeide)

<aside> πŸ’‘

TheΒ stackΒ is a region of memory used for temporary storage during program execution. It operates in a "last in, first out" (LIFO) manner. The stack is used to store function parameters, local variables, return addresses, and to save CPU registers during function calls and interrupts. Each function call pushes data onto the stack, and data is popped off when the function returns.

The stack grows downward in memory

The stack grows downward in memory

</aside>

image.png

image.png

<aside> πŸ’‘

ARM GCC calling convention (AAPCS, ARM Architecture Procedure Call Standard):

Argument Passing

Return Values

Register Usage

Stack Alignment

Function Prologue/Epilogue

Special Registers

Example

int foo(int a, int b, int c, int d, int e);
// a β†’ r0, b β†’ r1, c β†’ r2, d β†’ r3, e β†’ stack

References:

Let me know if you want details for a specific ARM variant or ABI!

</aside>