The CDECL call interface convention is used by many Windows C and C++ systems. With CDECL, all general-purpose registers are preserved except for EAX, ECX, and EDX.
The following rules apply to CDECL:
| Size of item in bytes | Value returned in | Comment |
|---|---|---|
| 8 | EAX-EDX pair | |
| 5-7 | EAX | The address for return values is passed as a hidden parameter to EAX. |
| 4 | EAX | |
| 3 | EAX | The address for return values is passed as a hidden parameter to EAX. |
| 2 | AX | |
| 1 | AL |
For programs that return items that are 5, 6, 7, or more than 8 bytes in size, the address for the return values is passed as a hidden parameter, and the address is passed back in EAX.
When you build export or import lists in module definition files, use the decorated version of the name. If you use undecorated names in the module definition file, you must give the object files to the ILIB utility along with the module definition file. ILIB will use the object files to determine how each name ended up after decoration.
related tasks
Calling between COBOL and C/C++ programs
Creating module definition files
related references
CALLINT
ENTRYINT
Compiler-directing statements