LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2008, 03:57 AM   #1
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Rep: Reputation: 15
gcc assembly


does anyone know where i can find out how gcc passes variables through function calls? more specifically, which registers is puts variables in when its not using the stack. thanks vary much
 
Old 04-24-2008, 06:14 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
You can transform a c file into its assembly code with "gcc -S"
 
Old 04-24-2008, 10:47 AM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
You are basically asking about the calling convention for your specific arch. For most archs, there is an ABI which extends SVID, and details the calling convention. Usually, gcc tries to follow that ABI.

Here is a nice document which details the default calling conventions of various compilers for the x86 and x86_64 architectures.
 
Old 04-25-2008, 04:10 AM   #4
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Original Poster
Rep: Reputation: 15
thnaks very much, thats perfect
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
generating mips assembly from c code with gcc? lilili Programming 4 05-11-2006 08:37 PM
gcc/Assembly code gigantas1985 Programming 0 02-28-2006 05:52 AM
inline assembly in gcc gursev Programming 2 03-04-2005 02:17 AM
How may I tell gcc to generate an assembly file? LongName Programming 4 08-30-2004 02:31 AM
subrouine_call in gcc inline assembly sakeeb Programming 4 08-15-2002 10:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration