delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/09/01:29:36

From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Message-Id: <199607090524.PAA24424@gbrmpa.gov.au>
Subject: Near pointers, are they bad?
To: djgpp AT delorie DOT com
Date: Tue, 9 Jul 1996 15:24:48 +1000 (EST)

I have written some graphics code which blits stuff around the screen in
a linear only SVGA graphics mode (variable... 640x480, 1024x768, etc)

The way I have coded it is to use near pointers, so I can simply access
the memory where the graphics screen is stored in memory via an array.

eg:	char *vid_mem;

	vid_mem[100] = 1000;  (I run a 16bit mode)

In order to access the memory this way though, I had to set the _crt0 flag
to nearptr enable.

What I want to know is: Is this programming practice bad? I assumed that
a near pointer in protected mode was the same as a far, ie: could access the
full 4GB segment. It also seems to allow fast memory access...

Leathal.

- Raw text -


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