delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/25/05:00:25

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Using "far" pointers
Date: Thu, 25 Sep 1997 09:11:07 +0200
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 30
Message-ID: <342A0E8B.903E8F95@LSTM.Ruhr-UNI-Bochum.De>
References: <Pine DOT LNX DOT 3 DOT 95 DOT 970924214311 DOT 371B-100000 AT metroid DOT dyn DOT ml DOT org>
NNTP-Posting-Host: c64.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

firewind wrote:
[...] Lots of helpful stuff deleted

> At this point, it is valid to write the following:
> 
>         indos = _farpeekb(_dos_ds, es*16+bx);
> 
> 'es' (the real mode selector, AFAIK) must be multiplied by 16 to be valid
> (I don't know why, but the info page for _far* says so, so I do it :), and
> then the offset ('bx') is added to that, resulting in a valid address in
> the _dos_ds segment.
Just for the record:
 _farpeek() takes physical address locations, and those you get 
by multiplying the segment with 16 and add the offset. That's
why the info page says it. Theses are the segmented braindead
issues lurking through that protected mode usually overcomes.

Ciao
Tom

*************************************************************
* Thomas Demmer                                             *
* Lehrstuhl fuer Stroemungsmechanik                         *
* Ruhr-Uni-Bochum                                           *
* Universitaetsstr. 150                                     *
* D-44780  Bochum                                           *
* Tel: +49 234 700 6434                                     *
* Fax: +49 234 709 4162                                     *
* http://www.lstm.ruhr-uni-bochum.de/~demmer                *
*************************************************************

- Raw text -


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