X86 Calling Conventions
This article describes the calling conventions used on the x86 architecture.
Calling conventions describe the interface of called code:
- The order in which atomic (scalar) parameters, or individual parts of a complex parameter, are allocated
- How parameters are passed (pushed on the stack, placed in registers, or a mix of both)
- Which registers may be used by the callee without first being saved (i.e. pushed)
- How the task of setting up for and restoring the stack after a function call is divided between the caller and the callee
This is intimately related with the assignment of sizes and formats to programming-language types. Another closely related topic is name mangling, which determines how symbol names in the code map to symbol names used by the linker. Calling conventions, type representations, and name mangling are all part of what is known as an Application Binary Interface (ABI).
There are often subtle differences in how various compilers implement these conventions, so it is often difficult to interface code which is compiled by different compilers. On the other hand, conventions which are used as an API standard (such as stdcall) are very uniformly implemented.
Read more about X86 Calling Conventions: Historical Background, Caller Clean-up, Callee Clean-up, Intel ABI, List of X86 Calling Conventions
Famous quotes containing the words calling and/or conventions:
“At length, having come up fifty rods off, he uttered one of those prolonged howls, as if calling on the god of loons to aid him, and immediately there came a wind from the east and rippled the surface, and filled the whole air with misty rain, and I was impressed as if it were the prayer of the loon answered, and his god was angry with me; and so I left him disappearing far away on the tumultuous surface.”
—Henry David Thoreau (18171862)
“Why does almost everything seem to me like its own parody? Why must I think that almost all, no, all the methods and conventions of art today are good for parody only?”
—Thomas Mann (18751955)