C Language and Libraries Help (clang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
__fastcall
◄Up► ◄Contents► ◄Index► ◄Back►
─────C/C++ Language─────────────────────────────────────────────────────────
Keyword: __fastcall
Syntax: __fastcall declarator
Summary: Specifies that the function uses a calling convention that
passes arguments in registers rather than on the stack,
resulting in faster code.
See also: __cdecl, __pascal, __fortran, __interrupt
The choice of registers depends on the type of arguments:
Type Register Candidates
char / unsigned char AL, DL, BL
int / unsigned int AX, DX, BX
long / unsigned long DX:AX
near pointer BX, AX, DX
far or huge pointer passed on the stack
Arguments are allocated to suitable registers if available, and
are pushed onto the stack otherwise. Structs, unions, and all
floating-point types are always pushed onto the stack.
Return values of four bytes or smaller, including structs and
unions, are placed in the registers as follows:
Size Register
1 byte AL
2 bytes AX
4 bytes DX:AX
Floating-point values are returned on the floating-point stack.
To return structs or unions larger than four bytes, the calling
program pushes a hidden last parameter, which is a near pointer
to a buffer in which the value is to be returned. A far pointer
to SS:hidden-param must be returned in DX:AX.
The __fastcall calling convention cannot be used with functions
having variable-length parameter lists or with functions having any
of the following attributes: __cdecl, __export, __fortran,
__interrupt, __pascal, __saveregs.
-♦-