Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C with ASM

2 views
Skip to first unread message

Xavier VASSOR

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to
Hi,

I would like to know how to link C code with assembly code.
Can someone help me ?

Thanks in advance.

Thomas

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to

This depends upon your compiler/linker. Assembly code is platform specific.

Some compilers allow assembly language within C functions.

Just be aware of how the compiler requires parameters passed and how it wants
values returned.

Read your compiler manual.

--
Thomas Matthews
email: mat...@stamps.stortek.com

Xavier VASSOR

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to
> >
> > Hi,
> >
> > I would like to know how to link C code with assembly code.
> > Can someone help me ?
> >
> > Thanks in advance.
>
> This depends upon your compiler/linker. Assembly code is platform specific.

I have Turbo C 2.0 and i can't do it for now.. I have DJGPP too, but i
still didn't look a lot at it..
And I can use TASM (5.0 I think).

Thanks

Jack Klein

unread,
Dec 24, 1998, 3:00:00 AM12/24/98
to
On Thu, 24 Dec 1998 19:18:41 +0100, Xavier VASSOR <xva...@mail.dotcom.fr>
wrote:

<Jack>

The C language standard itself does not define how to link C code to that
written in any other language.

For help with Borland specific compilers and Turbo Assembler you need to ask
in the excellent Borland support newsgroups, news:borland.public.cpp.language
and news:borland.public.tasm.

If your news server does not carry these groups, you can access them at
http://www.inprise.com (Inprise is Borland's new name), or
http://www.dejanews.com.

</Jack>


Richard Kanarek

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
Howdy.

Regarding:


On Thu, 24 Dec 1998 19:18:41 +0100, Xavier VASSOR
<xva...@mail.dotcom.fr> wrote:
>I have Turbo C 2.0 and i can't do it for now.. I have DJGPP too, but i
>still didn't look a lot at it..

Turbo C 2.01 (best DOS compiler/enviornment ever?) can most certainly
be linked with Assembler produced .OBJ files. Or at least it could be
with TASM 1.? (best DOS assembler ever?) and 2.5? and their TLINK's
(linkage editors). As I recall, Turbo C 2.01 also supports inline
assembler statements though I think you need to have a copy of TASM
to use it but I *never* used inline assembler statements and know
little about them.

>And I can use TASM (5.0 I think).

I don't know. On the one hand, if you were naive, you might suppose
that any .OBJ file could be linked with any other .OBJ file. (I was
naive until I tried linking RASM86 (DRI Assembler) .OBJ files with
others. <g>) On the other hand, I really can't believe you'd have any
trouble linking Borland's (Imprise's) own .OBJ files with those of
another Borland (Imprise) product. At worst, I'd imagine you might be
restricted to using the circa TASM 5 TLINK rather than the older one.
And that's hardly much of a problem.

Lastly, Borland (Imprise) had newsgroups which are far more suitable
for compiler specific questions (and, occasionally, they actually
work! <g>). You might want to visit www.borland.com (not the proper
URL since Borland was purchased but there's a redirector) and sign up.

Happy programming and happy new year to all!

Cordially,
Richard Kanarek


0 new messages