flat assembler
Message board for the users of flat assembler.

Index > Linux > gcc passing parameters

Author
Thread Post new topic Reply to topic
chorus



Joined: 16 Mar 2004
Posts: 23
chorus 20 Dec 2005, 03:24
Hi all. I'm trying to get a mixed C/ASM project going under linux x86_64. My "problem" is that GCC uses the fastcall calling convention for 64-bit (but not for 32 bit... ??). So my params are coming into asm in rdi,rsi,rdx,rcx, etc. instead of on the stack. Anyone know how to disable "fastcall" in GCC??

And yeah I know it's faster this way... I'd still rather have them on the stack

Thanks for any help
--Chorus
Post 20 Dec 2005, 03:24
View user's profile Send private message Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 20 Jan 2006, 02:30
Quote:
GCC can be made to use a register calling convention by compiling with gcc -mregparm=NNN ...
See the GCC documentation for details.


got that from google, so its probably in the GCC readme/doc

_________________
redghost.ca
Post 20 Jan 2006, 02:30
View user's profile Send private message AIM Address MSN Messenger Reply with quote
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509 23 Jan 2006, 01:41
gcc on x86-64 (aka AMD64) uses the x86-64 ABI v0.96 for parameter passing by default. IIRC, there is no easy way to tell gcc to use the 32bit ABI (stack based passing) for 64bit apps.

You might want to try one of the gcc newsgroups for further information.


Description: 64bit ABI (remove .txt from end to read)
Download
Filename: abi-0.96.pdf.txt
Filesize: 334.76 KB
Downloaded: 798 Time(s)

Post 23 Jan 2006, 01:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.