C SYSCALL STDCALL BASIC FORTRAN PASCAL
+-------+-------+-------+-------+-------+-------+
Leading Underscore | X | | X | | | |
|-------+-------+-------+-------+-------+-------|
Capitalize All | | | | X | X | X |
|-------+-------+-------+-------+-------+-------|
Arguments Left to Right | | | | X | X | X |
|-------+-------+-------+-------+-------+-------|
Arguments Right to Left | X | X | X | | | |
|-------+-------+-------+-------+-------+-------|
Caller Stack Cleanup | X | | * | | | |
|-------+-------+-------+-------+-------+-------|
BP Saved | | | | X | X | X |
|-------+-------+-------+-------+-------+-------|
:VARARG Allowed | X | X | X | | | |
+-------+-------+-------+-------+-------+-------+
* The STDCALL language type uses caller stack cleanup if the :VARARG
parameter is used. Otherwise, the called routine must clean up the
stack.
The language type (langtype) determines the naming and calling conventions
used by the assembler. This allows you to share code and data with
modules written with other languages. Set the language type with the
.MODEL or OPTION LANGTYPE: directives or with the /G<x> command-line
option. Several directives allow you to specify a langtype
parameter to temporarily override the language type.
You can use the /H command-line option to limit the length of names
sent to the object file. Use this option to work with languages that
limit the maximum length of identifiers.
-o-
in BCB
Calling Convention options tell the compiler which calling sequences to generate for function calls. The C, Pascal, and Register calling conventions differ in the way each handles stack cleanup, order of parameters, case, and prefix of global identifiers.
You can use the ___cdecl, ___pascal, ___fastcall, or ___stdcall keywords to override the default calling convention on specific functions.
In C++Builder code, you will normally use the default C calling convention.
MSVC __fastcall
(Command-line switch: -pm)
This option tells the compiler to substitute the __msfastcall calling convention for any function without an explicitly declared calling convention.
C
(Command-line switch: -pc, -p-)
This option tells the compiler to generate a C calling sequence for function calls (generate underbars, case sensitive, push parameters right to left). This is the same as declaring all subroutines and functions with the ___cdecl keyword. Functions declared using the C calling convention can take a variable parameter list (the number of parameters does not need to be fixed).
You can use the ___pascal, ___fastcall, or ___stdcall keywords to specifically declare a function or subroutine using another calling convention.
Pascal
(Command-line switch: -p)
This option tells the compiler to generate a Pascal calling sequence for function calls (do not generate underbars, all uppercase, calling function cleans stack, pushes parameters left to right). This is the same as declaring all subroutines and functions with the
___pascal keyword. The resulting function calls are usually smaller and faster than those made with the C (-pc) calling convention. Functions must pass the correct number and type of arguments.
You can use the ___cdecl, ___fastcall, or ___stdcall keywords to specifically declare a function or subroutine using another calling convention.
Register
(Command-line switch: -pr)
This option forces the compiler to generate all subroutines and all functions using the Register parameter-passing convention, which is equivalent to declaring all subroutine and functions with the ___fastcall keyword. With this option enabled, functions or routines expect parameters to be passed in registers.
You can use the ___pascal, ___cdecl, or ___stdcall keywords to specifically declare a function or subroutine using another calling convention.
Standard Call
(Command-line switch: -ps)
This option tells the compiler to generate a Stdcall calling sequence for function calls (does not generate underscores, preserve case, called function pops the stack, and pushes parameters right to left). This is the same as declaring all subroutines and functions with the ___stdcall keyword. Functions must pass the correct number and type of arguments.
You can use the ___cdecl, ___pascal, ___fastcall keywords to specifically declare a function or subroutine using another calling convention.