473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

linking assembler code to C via C library

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
4 3800
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
16
by: Jan Stap | last post by:
Hi, I am writing a wrapper in C for an existing program. The wrapper maintains a run file that is created for one invocation of the program and is removed for another. My idea of making the last...
1
by: Markus Neff | last post by:
Dear MS VS .NET 2003 users, so far I used MS VS 6.0 SP5 for a rather large C++ project. Now I want to migrate to MS VS .NET 2003. First tests however showed that compilation and most notably...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
14
by: spamtrap | last post by:
Mostly for testing reasons I'd like to see if it makes sense to chose the following approach for just-in-time compilation of shaders for a renderer: Seeing as the shaders themsefs consist mostly...
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
1
by: Andrew Wan | last post by:
I am having problems linking an assembly object with my C object files. Am getting: Linker Warning: DOSSEG directive ignored in module asm.asm Linker Error: Undefined symbol _ASMClsV in module...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.