delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/18/05:36:37

Sender: mckee AT rtp DOT gtegsc DOT com
Message-ID: <33573EF5.5C89@rtp.gtegsc.com>
Date: Fri, 18 Apr 1997 05:29:25 -0400
From: David McKee <david DOT mckee AT rtp DOT gtegsc DOT com>
Organization: GTE (My views are my own)
MIME-Version: 1.0
To: "M. Solmaz" <M DOT Solmaz AT twi DOT tudelft DOT nl>
CC: djgpp AT delorie DOT com
Subject: Re: MK_FP with gcc...
References: <33562259 DOT 5003 AT twi DOT tudelft DOT nl>

M. Solmaz wrote:
> 
> Hi,
> 
> I have a little problem. I want to convert a C program, written in
> Borland C, to a C program, which has to be compiled by gcc. The problem
> is with the MK_FP (make a far pointer)... I don't know how to convert,
> such that I can compile it with gcc. Can anyone help me?
> 
> Already My Thanx....
> 
>                                 -- If a problem has no solution
>                                 -- Then there is no problem....


You might be interested in looking at the port of the the DFlat Text
User
Interface that is part of the DJGPP distribution (I don't recall where
in 
the distribution it is in) but as I understand it, the flat memory model
of DJGPP uses the offset as a 32 bit flat address and disregards the 
"segment".  In the Dflat example I have seen this basic idea:

   int seg = 0x40;
   int off = 0x6c;
#ifdef DJGPP
   fp = _farpeekw(_go32_conventional_mem_selector, seg*16+offset);
#else
   fp = *(unsigned far *)MK_FP(seg, offset);
#endif

This may not be exactly syntactically correct as I don't have my 
DJGPP docs here at work...

There is stuff in the Faq about this as well, and the _go32... and 
_farpeek... stuff is all in the libc docs.


-- David T. McKee: 
-- Think: Innovative Science Learning Systems
--                 Physics, Electrical Science, Computer
--                 Science, Natural Science, Theology
======================Signature Block====================
It is the glory of God to conceal a matter; To search out
a matter is the glory of kings.  Pr 25:2
---------------------------------------------------------
There is nothing so sacred as it cannot be looked into...
=========================================================

- Raw text -


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