Using what I know about and use, which is 16-bit ASM as an example,
which can be appliied to 4-byte words by extension,
If I call procedure W(a,b,c,d) as a function, then the MS standard
calling convention provides
SP+18 has the address of a
SP+14 has the address of b
SP+10 has the address of c
SP+06 has the address of d
The value of the result, or the address of this if not an integer, is
in AX (read eax)
And the return executed, unless the stack is going to be cleaned up by
the caller, should be
RET 16
or 4 times the number of argument addresses.


|