From: "Alex Oleynikov" To: Subject: RE: Mapping a data structure into DOS memory space Date: Tue, 5 Dec 2000 08:55:29 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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: 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 Precedence: bulk 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