Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: x86-64 and ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 17 Topic 2419 of 2472
Post > Topic >>

Re: x86-64 and calling conventions

by Dave Parker <daveparker@[EMAIL PROTECTED] > May 12, 2008 at 08:10 PM

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.
 




 17 Posts in Topic:
x86-64 and calling conventions
"cr88192" <c  2008-05-12 09:44:42 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-12 20:10:59 
Re: x86-64 and calling conventions
Bart <bc@[EMAIL PROTEC  2008-05-14 19:22:59 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-15 15:44:11 
Re: x86-64 and calling conventions
James Harris <james.ha  2008-05-12 04:12:03 
Re: x86-64 and calling conventions
James Harris <james.ha  2008-05-14 03:38:42 
Re: x86-64 and calling conventions
James Harris <james.ha  2008-05-14 11:37:05 
Re: x86-64 and calling conventions
Vidar Hokstad <vidar.h  2008-05-12 05:48:02 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-13 18:19:29 
Re: x86-64 and calling conventions
Dave Parker <daveparke  2008-05-12 20:10:58 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-13 17:51:07 
Re: x86-64 and calling conventions
glen herrmannsfeldt <g  2008-05-13 01:28:57 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-15 07:44:35 
Re: x86-64 and calling conventions
Boleslaw Ciesielski <b  2008-05-23 12:05:14 
Re: x86-64 and calling conventions
glen herrmannsfeldt <g  2008-05-29 13:56:05 
Re: x86-64 and calling conventions
Vidar Hokstad <vidar.h  2008-05-14 08:20:27 
Re: x86-64 and calling conventions
"cr88192" <c  2008-05-15 06:46:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 14:40:11 CDT 2008.