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►
────────────────────────────────────────────────────────────────────────────
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, _export, _fortran, _interrupt, _pascal, _saveregs
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 ES:BX
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 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 functions having any of
the following attributes: _cdecl, _export, _fortran, _interrupt,
_pascal, _saveregs_.
-♦-