Register Directive
The register
directive tells the compiler to use
Borland’s fast register calling convention for the function or
procedure. The caller stores the first three arguments in the
registers EAX
, EDX
, and
ECX
, and pushes the remaining arguments onto the
stack, starting with the leftmost argument. Parameters that do not
fit into a 32-bit register (such as Double
) are
pushed onto the stack, so the registers contain the first three
arguments that are not on the stack. Before the subroutine returns,
it 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 last parameter. If the
subroutine is a method, Self
is passed in
EAX
.