delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/29/21:19:26

From: "Damian Yerrick" <web DOT poison AT pineight DOT 8m DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem with far pointers
Date: Wed, 29 Sep 1999 17:30:39 -0500
Organization: Rose-Hulman Institute of Technology
Lines: 39
Message-ID: <7su41v$a4q$1@solomon.cs.rose-hulman.edu>
References: <7ssgdl$pg AT cs DOT vu DOT nl> <7sssfq$rds AT acp3bf DOT knirsch DOT de>
NNTP-Posting-Host: 137.112.205.146
X-Trace: solomon.cs.rose-hulman.edu 938644351 10394 137.112.205.146 (29 Sep 1999 22:32:31 GMT)
X-Complaints-To: news AT cs DOT rose-hulman DOT edu
NNTP-Posting-Date: 29 Sep 1999 22:32:31 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

FokkemaDBRA has a selector that points to video RAM.
S/he wants to access video RAM as if it were an array. In
Borland C++, this worked:

> > int far *pointer;

Hans-Bernhard Broeker <broeker AT acp3bf DOT knirsch DOT de> responded:

> There is no such thing as a 'far pointer' in DJGPP. But there are
specialised
> functions (inline assembly, so they should be fast enough for just about
> every application you can come up with), conveniently called the 'far
pointer
> functions'. Look up
>
> farpokeb()
> farpeekb()
> movedata()

Shouldn't movedata() be called farmemmove() or farmemcpy()?

> The one thing you won't get using these functions is use of
> the 'standard' syntax, like 'video_mem[position] = content;'.

Maybe someone could put true far pointer support
(a la Borland) into DJGPP.

> If you insist on that, you must effectively disable
> memory protection using the 'near pointer method'.

And risk overwriting other programs in memory (such as
Windows, DOS, etc.). Overwriting DOS is a Bad Thing.

> See the FAQ for more details about all of this.
> --
> Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
> Even if all the snow were burnt, ashes would remain.


- Raw text -


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