By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,167 Members | 995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,167 IT Pros & Developers. It's quick & easy.

linking assembler code to C via C library

P: n/a
Hi
I would like to know what the standard way to write a custom C library
that links to assembler code?
The reason is that, apart of been curious, I would like to know what format
the C language uses to sent and receive data
between assembler and after langauges?

thanks
Neil Morris

--
my IE6 favorites for import into Netscape/Internet Explorer
www.neilmorris.btinternet.co.uk/bookmark.htm
http://www.neilmorris.btinternet.co.uk/
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Neil Morris wrote:

Hi
I would like to know what the standard way to write a custom C library
that links to assembler code?
The reason is that, apart of been curious, I would like to know what format
the C language uses to sent and receive data
between assembler and after langauges?

Dunno how standard it is, but a way is to compile 'C' that implements the
headers for the assembly routines into assembler, then borrow from that for
how parameters are organized on the stack.
thanks
Neil Morris

--
my IE6 favorites for import into Netscape/Internet Explorer
www.neilmorris.btinternet.co.uk/bookmark.htm
http://www.neilmorris.btinternet.co.uk/

--
Les Cargill
Nov 13 '05 #2

P: n/a
On Sun, 30 Nov 2003 17:44:57 +0000 (UTC)
"Neil Morris" <Ne********@btinternet.com> wrote:
Hi
I would like to know what the standard way to write a custom C
library
that links to assembler code?
The reason is that, apart of been curious, I would like to know what
format the C language uses to sent and receive data
between assembler and after langauges?


There is no standard way to do it so you will have to look in to the
specifics of your implementation. These specifics are not topical here,
so ask in a group dedicated to your implementation.
--
Mark Gordon
Paid to be a Geek & a Senior Software Developer
Although my email address says spamtrap, it is real and I read it.
Nov 13 '05 #3

P: n/a
Neil Morris wrote:

Hi
I would like to know what the standard way to write a custom C library
that links to assembler code?
The reason is that, apart of been curious, I would like to know what format
the C language uses to sent and receive data
between assembler and after langauges?

No, there isn't. The C language doesn't know anything at all about any
other language. Nada. Nothing. Not even assembler.
--
Joe Wright http://www.jw-wright.com
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 13 '05 #4

P: n/a
Neil Morris wrote:
I would like to know what the standard way to write a custom C library
that links to assembler code?
The reason is that, apart of been curious, I would like to know what format
the C language uses to sent and receive data
between assembler and after langauges?


Write a C program with a similar effect to the desired assembly program,
or at least takes the same arguments and returns the same type of value.

Compile it with a C compiler that will print the generated assembly
code. As you presumably know how to write assembly code for the
desired machine, it shouldn't be hard to read it. Write the new code to
match the calling sequence in the compiled C code.

Most other answers will be off topic for this newsgroup.

-- glen

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.