From: "Ben Peddell" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: FP_SEG and FP_OFF Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Wed, 26 Mar 2003 02:44:47 +1000 NNTP-Posting-Host: 144.139.175.74 X-Trace: newsfeeds.bigpond.com 1048609949 144.139.175.74 (Wed, 26 Mar 2003 03:32:29 EST) NNTP-Posting-Date: Wed, 26 Mar 2003 03:32:29 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com wrote in message news:as018v817up084rcigr5067a9n7gfho7n6 AT 4ax DOT com... > I have a 16-Bit Borland C program that works 100% when compiled, > it uses FP_SEG, and FP_OFF to get the address of a Structure, > > Even though I tried reading through the FAQ(s), I am still now > certain, nor do I feel confident enough yet, to port these functions > to DJGPP (ver 2.95.3). > > I would like to see a working DJGPP example of obtaining the address > of a global structure please, a value which can be stored in an > ordinary long. > DJGPP is a 32-bit compiler. All pointers in it are near pointers, and they can access up to 4GB of memory (i.e. _all_ of the memory). Also, DJGPP does not understand far pointers (since thay're not needed unless you want to access DOS memory, and even then near pointers could be used if __djgpp_nearptr_enable() is called). In other words all pointers can be stored in long integers. Also note that int's are 32-bit by default in DJGPP. You don't need far pointers, XMS, EMS or any of those other things. You do, however, need DPMI, which can be supplied with CWSDPMI, which comes with DJGPP. There are also some other things that I haven't mentioned. > Thanks for your help! > > I hope learning how this works isn't too complicated. Thanks. > > Email responces can be sent to: RadSurfer AT yahoo DOT com > > >