delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/01/04:58:29

Date: Thu, 1 Jun 1995 09:46:29 +0300 (IDT)
From: Eli Zaretskii <eliz AT is>
To: Bill Currie <BILLC AT teleng1 DOT tait DOT co DOT nz>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: dpmi DS:VRAM hack


On Thu, 1 Jun 1995, Bill Currie wrote:
> 
> If it hasn't already been suggested, what about a secialized class
>
> for C++ or macro set for C.  For the macros, uou could a macro that
> loads a specified segment register with the desired selector and
> then in your loop use another macro that takes as its arguments the
> segment register to use and the offset.  This does cause its own
> problems (such as restoring the previous value to the sr when done)
> but it would certainly be workable.

But that's exactly what the farptr functions do!  When compiled with
optimizations, they expand into two-instruction inline code exactly
as suggested above.  For tight loops, there is the ``no-selector''
variety of the functions which load the segment register only once, so 
that inside the loop you have one instruction per far memory access.  Why 
re-invent the wheel if DJ has already invented it pretty round?

- Raw text -


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