> For the complete documentation index, see [llms.txt](https://www.ctfrecipes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.ctfrecipes.com/pwn/architectures/aarch64/calling-convention.md).

# Calling convention

The AArch64 instruction set, which is used on ARM processors, supports several different calling conventions, which define how functions are called and how arguments are passed between functions in a program. Some of the most commonly used calling conventions on the AArch64 instruction set include:

* **AAPCS64**: This is the default calling convention for the AArch64 instruction set. It is used for functions written in C or C++ and is based on the ARM Procedure Call Standard. In this convention, arguments are passed to the function in registers, and any additional arguments are passed on the stack. The return value is stored in the X0 register.
* **AAPCS64-VFP**: This calling convention is an extension of the AAPCS64 convention and is used for functions that use the VFP (Vector Floating Point) unit. It is similar to the AAPCS64 convention, but it includes additional rules for passing arguments that are stored in the VFP registers.
* **System V ABI**: This calling convention is based on the System V Application Binary Interface and is used for functions that are compiled for the AArch64 instruction set. It is similar to the AAPCS64 convention, but it includes additional rules for handling certain types of arguments, such as structures and unions.

Overall, the AArch64 instruction set supports a number of different calling conventions, which allows it to be used in a variety of programming languages and environments. The specific calling convention that is used can affect the performance and compatibility of a program, as well as the interactions between functions and libraries.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.ctfrecipes.com/pwn/architectures/aarch64/calling-convention.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
