delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/24/18:47:02

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ASM linkage
Date: Wed, 24 Jun 1998 18:43:16 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 28
Message-ID: <35918104.F50D7194@cs.com>
References: <35913718 DOT C10085AA AT ameritech DOT net>
NNTP-Posting-Host: ppp241.cs.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

S Prasad wrote:
> 
> If I have a routine in ASM, compiled as .OBJ (or .O, I think they are
> the same), how do I use this function in my DJGPP C program?

They are not the same.  The format used to represent the object code, as
well as the characteristics of the code itself, heavily depends on the
compiler originally used to build it.  .OBJ usually indicates a Borland
or Microsoft-style object file, which is incompatible with DJGPP's
object format.  Even if you were to convert the format, the code itself
almost certainly uses a 16-bit real-mode model, which quite simply will
not work in a protected mode environment.

If you have access to the original assembly source code, you may be able
to work some magic on it to convert it to something that DJGPP can
digest.  The easier course by far is to just find a DJGPP equivalent or
write one from scratch.

See chapter 17 of the DJGPP Frequently Asked Questions list for more
information, including a possible exception to what I wrote above.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Autocracy is based on the assumption|
|       aka Fighteer I       | that one man is wiser than a million |
|   mailto:fighteer AT cs DOT com   | men.  Let's play that over again,    |
| http://www.cs.com/fighteer | too.  Who decides?"   - Lazarus Long |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019