- Application Binary Interface.
- It is a set of rules and conventions that define how software components interact with each other at the binary level.
- The ABI specifies details such as the format of executable files, the calling conventions for functions, the layout of data structures, and the system-level services used by the application.
- The ABI ensures the following:
- Parameter Passing: The ABI defines how the parameters are passed to the function. For example, on x86 systems, the first parameter might be passed in a register like
EAX
, and the second parameter could be pushed onto the stack.
- Calling Convention: The ABI specifies the rules for how a function is called, including how parameters are passed and how return values are retrieved. For instance, on x86 systems, the caller might push the parameters onto the stack and then invoke the function using the
CALL
instruction.
- Register Usage: The ABI defines which registers should be preserved by the function and which registers are free to be used. This ensures that the function and the caller don’t overwrite important register values.
- Return Value: The ABI specifies how the function’s return value is returned to the caller. It might be passed in a register or stored in a specific memory location.