Home

msfastcall

Msfastcall is a calling convention used on 32-bit x86 Windows, primarily associated with Microsoft toolchains and some assemblers. It is a variant of the fastcall family designed to improve call efficiency by placing the initial arguments in registers rather than on the stack.

Under msfastcall, the first two parameters are passed in CPU registers, typically ECX and EDX. Any additional

The responsibility for cleaning up the stack falls to the callee in msfastcall. The function being called

Compatibility and usage notes: msfastcall is largely associated with older Windows toolchains and 32-bit code. It

arguments
are
passed
on
the
stack
in
right-to-left
order,
similar
to
other
32-bit
conventions
for
stack-passed
parameters.
The
exact
rules
for
which
parameter
types
are
placed
in
registers
can
vary
slightly
between
compilers,
but
the
general
approach
is
to
reduce
stack
usage
and
improve
speed
for
common
call
patterns.
must
remove
the
stack-based
arguments
from
the
stack
frame
before
returning.
In
addition,
callee-saved
registers
must
be
preserved
across
calls,
with
registers
such
as
EBX,
ESI,
EDI,
and
EBP
typically
required
to
be
preserved
by
the
callee.
is
not
a
universal
standard
and
is
not
portable
to
non-Microsoft
compilers
in
the
same
way
as
more
widely
adopted
conventions.
Modern
64-bit
Windows
uses
a
different
Application
Binary
Interface,
and
many
developers
rely
on
the
broader,
standardized
x86-64
calling
conventions.
For
code
portability,
it
is
common
to
limit
reliance
on
msfastcall
to
specific
project
targets
and
compiler
versions,
referring
to
the
respective
compiler
documentation
for
exact
semantics.