Mail Archives: djgpp/1997/04/18/05:36:37
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 -