delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/24/03:02:58

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: NEAR POINTERS
Date: Mon, 23 Jun 1997 19:59:12 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 28
Message-ID: <33AED590.2133@cs.com>
References: <01bc7f5e$2cc9b040$aa28bace AT client DOT kosone DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp205.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Oliver wrote:
> 
> Ok, quick question...I use __djgpp_nearpt_enable() so i  can write directly
> to video memory (it is so much faster than using memput or the poke
> functions). Anyway, i was wondering, what exactly this function does. Does
> it disable protected mode completely. If so, can i then write a keyboard
> handler in the same way i did in real mode? I am unsure as to what exactly
> this does. Could someone please tell me.

Not quite.  __djgpp_nearptr_enable() only disables memory protection;
thereby allowing you to write to any address in the computer's memory. 
It does this by resizing the program's data segment to 0xffffffff. 
Using near pointers does not affect the operation of the computer in any
other way; you are still in protected mode and must still obey all its
rules when installing interrupt handlers and the like.

BTW, be extremely careful when using near pointers.  A single rogue
pointer can wipe out your program, the operating system, the hard drive,
etc.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "If 'everybody knows' such-and-such, |
|       aka Fighteer I       | then it ain't so, by at least ten    |
|   mailto:fighteer AT cs DOT com   | thousand to one."                    |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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