linking assembler code to C via C library

N

Neil Morris

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
 
L

Les Cargill

Neil said:
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.
 
M

Mark Gordon

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.
 
J

Joe Wright

Neil said:
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.
 
G

glen herrmannsfeldt

Neil said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top