# Calling convention

The MIPS architecture 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 MIPS architecture include:

* **O32**: This is the default calling convention for the MIPS architecture. It is used for functions written in C or C++. 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 $v0 and $v1 registers.
* **N32**: This calling convention is similar to the O32 convention, but it is used for functions that return values that are larger than 64 bits up to 128 bits. In this convention, the return value is stored in a pair of registers, $f0 and $f1.

Overall, the MIPS architecture 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 of a program, as well as the compatibility of functions with different compilers and libraries.


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
