Using ECInvoke
ECInvoke
was primarily developed for the ml64 compiler as it
does not have
the Invoke
directive. However, it also
may be used with JWasm, UAsm64,
AsmC
and PoAsm
with 64-bit projects, although it
is better to use their own Invoke
when
possible. ECInvoke
works like Invoke
but it does not make any parameter
checking. The use of ECInvoke
makes sure
that the stack pointer (Rsp)
will always
be 16-byte aligned, avoiding unpleasant crashes when calling API
functions.
For ml64, AsmC, JWasm
and UAsm64
you can use ECInvoke
as
you did with Invoke,
but for PoAsm there is a
difference you must take into account. Complex arguments have to
be between angle brackets, for example:
ECInvoke
SetWindowText,
hWnd, <TextStr("Hello")>
ECInvoke
GetSystemDirectory,
lpszBuffer,
<MAX_PATH - 1>
All arguments having characters like (, ), ", ', +, -, etc., must be between angle brackets. Otherwise, PoAsm will fire the corresponding error.
REMARKS:
Please remember that ECInvoke
is only available for Masm, JWasm,
UAsm64, AsmC and
PoAsm 64-bit projects, and angle brackets are only
needed for the PoAsm compiler.