www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/23/19:05:17

Message-ID: <326EBE49.729B@gbrmpa.gov.au>
Date: Thu, 24 Oct 1996 08:54:35 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: Emil0 AT aol DOT com
CC: djgpp AT delorie DOT com
Subject: Re: Another way to access VGA memory
References: <961023180905_339586309 AT emout17 DOT mail DOT aol DOT com>

> Leathal,
> I started this thread, but I only read the weekly digest, so I've only just
> seen your reply. Using near pointers in no quicker because you still have to
> load the %edi register with your pointer and then no doubt add some stuff to
> this to access the right pixel. With my method you load %es or whatever and
> then load stuff into %edi to point to the right pixel  - so it is not slower
> (apart from perhaps another register to save on the stack, although a push
> and a pop will hardly slow a program down even if done hundreds of times a
> second). With my method you retain full memory protection and it will work
> under all DPMI providers. It is a safe method which is guaranteed to work in
> the future and with DOS emulators on other machines. The near pointer method
> is really a hack, so for professional stuff I'd recommend my method which is
> far neater. For example, say you're testing a bit blitter, a gp fault is
> caused when you write outside video memory.  Another thing,
> __djgpp_conventional_base is not guaranteed to stay the same - currently it
> does, but in future this may change.
>      I think  that the protection offered by my method far out-weighs the
> hassle of having to save and restore a single register. My method is for
> people who want to write bullet-proof code which runs fast.

I think it comes down to preference, but your point is noted... :) Maybe
one day when (if? ;) I get this project I am working on finished, I will
change the routines to use the more secure selector method - I spose I
just have a major fear of segment registers... yuk... :)

Leathal.

- Raw text -


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