B.2 Calling and Naming Convention Modifiers

The modifiers described in this section affect the function “calling conventions” and “naming conventions.” Calling conventions determine how functions are called; naming conventions determine how external names are treated. Calling and naming conventions are composed of the following elements:

Element Description

Argument-passing order Some conventions pass arguments to functions from right to left; others from left to right.
Argument-passing convention In some calling conventions, the default argument-passing convention is by value; in others, it is by reference.
Stack-maintenance responsibility Because arguments are pushed on the stack for communication with the function, either the called function or the caller must adjust the stack.
Name-decoration convention Some calling conventions add characters to the name as it is declared in the program. This is called “name decoration.”
Case-translation convention Some calling conventions require case translation to uppercase.
Return-value convention Some calling conventions return values in registers; others return values on the stack. Most return values both ways, depending on the size of the value to be returned.