LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-12-2007, 05:44 AM   #1
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Rep: Reputation: 15
inserting assembeled functions into c


hi, i am currently writing a c program. it would be really useful for me if i was able to compile to assembly a function in the c code and put it back into the program in that form. is this possible?
i.e. i want to get one of the functions in my program and compile it to assembly then put that assembly into the place where the function was.
if this is possible then it be very grateful for any help. thanks
 
Old 01-12-2007, 09:56 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, again -

I thought you already got the answer to that question. For example, the syntax for adding in-line assembly using the GNU C compiler is discussed here:

DeveloperWorks: Inlining Assembly for C

If you want to see the assembly generated by the compiler, simply use the "-S" switch:
Quote:
gcc -S ...
'Hope that helps .. PSM
 
Old 01-12-2007, 01:59 PM   #3
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Original Poster
Rep: Reputation: 15
its not quite as simple as just plonking the assembeled code in i dont think and i wondered if anyone had any advice. cheers anyhow
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Inserting Manpages bhandu Linux - Software 2 03-20-2006 10:25 AM
inserting nvidia? lilili Slackware 32 01-15-2006 06:12 AM
Converting php5 socket functions to php3 socket functions mrobertson Programming 0 06-23-2005 09:11 AM
Inserting modules wgodois Linux - Hardware 0 08-03-2003 09:37 AM
pointers to functions/member functions champ Programming 2 03-28-2003 06:22 PM

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

All times are GMT -5. The time now is 06:55 PM.

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