Application binary interface 2026-11-05
An application binary interface specifies the conventions that separately compiled program components must share to cooperate at the binary level. It includes a calling convention, representations and layout of data, and platform conventions for object files. A common source-language declaration alone does not ensure that the generated machine instructions agree on where arguments and results reside.
For example, Microsoft's x64 calling convention passes the first two integer arguments in the processor registers
RCX and RDX, and returns a suitable scalar integer result in RAX.[ref]x64 Calling Convention by Microsoft. Parameter passing, integer row; Return values, scalar values fitting in 64 bits
A caller placing 7 and 5 in different processor registers from those expected by the called function can obtain the wrong result even if both sides describe an addition function. Matching the application binary interface allows a compiler and hand-written assembly language to cooperate; it does not require them to use the same internal implementation.