add link to main article on leaf functions
← Previous revision | Revision as of 01:44, 12 July 2025 | ||
Line 44: | Line 44: | ||
=== x86 (32-bit) === |
=== x86 (32-bit) === |
||
{{Main|x86 calling conventions}} |
{{Main|x86 calling conventions}} |
||
The 32-bit version of the [[x86 architecture]] is used with many different calling conventions. Due to the small number of architectural registers, and historical focus on simplicity and small code-size, many x86 calling conventions pass arguments on the stack. The return value (or a pointer to it) is returned in a register. Some conventions use registers for the first few parameters which may improve performance, especially for short and simple leaf-routines very frequently invoked (i.e. routines that do not call other routines). |
The 32-bit version of the [[x86 architecture]] is used with many different calling conventions. Due to the small number of architectural registers, and historical focus on simplicity and small code-size, many x86 calling conventions pass arguments on the stack. The return value (or a pointer to it) is returned in a register. Some conventions use registers for the first few parameters which may improve performance, especially for short and simple [[leaf subroutine|leaf-routine]]s very frequently invoked (i.e. routines that do not call other routines). |
||
Example call: |
Example call: |