delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/05/09:02:44

From: "Alex Oleynikov" <alex AT compuweigh DOT com>
To: <djgpp AT delorie DOT com>
Subject: RE: Mapping a data structure into DOS memory space
Date: Tue, 5 Dec 2000 08:55:29 -0500
Message-ID: <NEBBKABEDKFPFBKEMBFOCEEKCAAA.alex@compuweigh.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
In-Reply-To: <Pine.SUN.3.91.1001205120252.27857I-100000@is>
Importance: Normal
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi

>??? The ``Fat DS'' (a.k.a. ``nearptr'') method should allow you to use
>the normal C operators for accessing the struct members.  Why did you
>think it doesn't?
I think you're right - I didn't realize the fact, that I simply shouldn't
define a variable of my structure type in any module, but rather use the
pointer, prepared through "Fat DS" technique instead.
>You could write a C++ class which overrides the . and -> operators
>with functions that use _far* to access the data.
No I couldn't - my program is in pure C.

>Alternatively, you could copy the struct's data between the
>conventional memory and your program's data segment (e.g., with
>dosmemget and dosmemput), and then access the copy with normal C
>code.
Unfortunately, the whole point of having NVRAM is to keep important data
there all the time (even, while recomputing it), so should the power go off
nothing is lost.
Thank you, Eli, for putting me into the right direction - sometimes an
independent look at the problem helps a lot :)
Alex

- Raw text -


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