On May 11, 5:44 pm, "cr88192" <cr88...@[EMAIL PROTECTED]
> wrote:
> now, what kind of convention would I be imagining:
> well, basically, it would be a hybrid of the existing conventions, and
the
> good old 32-bit x86 convention.
>
> in particular, arguments would be passed on the stack (in good old
linear
> right-to-left ordering).
That's kind of what I did in the Flaming Thunder compiler (which
sup****ts the x86 and x86-64 versions of FreeBSD, Linux, Mac OS X and
Windows).
Some differences:
The calling convention is left-to-right (since I was making my own
calling convention, I figured I might as well fix the old right-to-
left holdover and use the stack the way the stack should be used ---
left-to-right). Left-to-right means the arguments are evaluated in
the order that users expect them to be. If the function is vararg,
then I push the argument count on the stack last.
When I need to access a system service, I translate my stack layout to
the Windows/Mac/Linux/FreeBSD/32/64 layout, then call the system.


|