CDecl Directive
The
cdecl
directive tells the compiler to use C-style
calling conventions for the function or procedure. The caller of the
subroutine pushes arguments onto the stack, starting with the
rightmost argument. After the subroutine returns, the caller pops the
arguments from the stack.
Functions return ordinal values, pointers, and small records or sets
in EAX
and floating-point values on the FPU stack.
Strings, dynamic arrays, Variant
s, and large
records and sets are passed as a hidden var
parameter. This hidden parameter is the first parameter, so it is
pushed last onto the stack. If the subroutine is a method,
Self
is pushed just before the function’s
var
result (if one is needed).