www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/16/14:45:05

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: Re: mixed mode programming...
To: huntercr AT cs DOT purdue DOT edu (Charles Hunter)
Date: Thu, 16 Feb 1995 12:18:57 -0600 (CST)
Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu

> I have a few old real mode C libraries , and some real mode asm and
> protected mode asm objs/src ... etc.
> 
> Does anyone have any tips on how I could go about linking any combination of
> these to djgpp compiled sources? I have not tried any of this yet, because
> I thought I'd get some opinions first.

You create a "program" which contains the subroutines you want to call 
with the 16 bit compiler/linker.  This program should either be a TSR
or a simple format (like .COM).  If it is a TSR you can decide how to
pass it's subroutine entries; if it is a .COM file you should have
an entry vector at the start of the image; these must be RETF type 
wrappers.

In the .COM file case you call the DPMI services to allocate  a block
of DOS memory, copy the contents of the .COM file into offset 0x100.
You then use the DPMI services to do calls to these routines.  If you
run under a real DPMI you can also pass parameters (GO32 does not
support this).

Another approach is to write the main program in the 16 bit compiler,
then call a DJGPP program with spawn()/system() with parameters pointing to the
data you want processed.

Have fun.

- Raw text -


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