delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/29/08:54:17

Date: Wed, 29 Oct 1997 08:52:52 -0500 (EST)
Message-Id: <199710291352.IAA03164@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: peter DOT acs AT dial DOT pipex DOT com
CC: djgpp AT delorie DOT com
In-reply-to: <345718dd.193834@news.dial.pipex.com> (peter.acs@dial.pipex.com)
Subject: Re: Porting problem from Borland C++

>      unsigned long *ptr = (unsigned long *) 0x00400000;
>      uint SPA;
>      SPA = *(ptr+CmPt-1); /* get the address */

That won't work in DJGPP because it assumes 16-bit mode.  0x00400000
is a 32-bit *near* pointer in DJGPP.

Try this instead (you'll need <go32.h> and <sys/farptr.h>):

uint SPA = farpeekw(_dos_ds, 0x400+(CmPt-1)*2);

- Raw text -


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