www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/05:24:16

Date: Thu, 11 Dec 1997 12:22:59 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Charles Krug <charles AT pentek DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Storing text screens in protected mode?
In-Reply-To: <348EA143.23BF0E2B@pentek.com>
Message-ID: <Pine.SUN.3.91.971211122241.13672B-100000@is>
MIME-Version: 1.0

On Wed, 10 Dec 1997, Charles Krug wrote:

> One of my favorite real mode tricks is to have my text screens stored in
> an integer array.  Reletively simple to do in real mode--just set SI to
> point to the screen buffer, DI to my array, CX to the buffer size and
> "rep stosw" it over.  This was a very important trick on 8088
> systems--though it's less important now.
> 
> Question--is it possible to get the base address of the screen buffer in
> protected mode or is it necessary to go back to real mode to do this

There's no reason to reinvent the wheel: it has already been done for
you in the library.  Use the library functions `ScreenUpdate' and
`ScreenUpdateLine' to move text buffers directly to the screen video
memory; use `ScreenRetrieve' for the opposite movement.  These use
fast assembly instructions already.

And no, you don't have to switch to real mode to write to the video
RAM, you just need to observe some precautions when referencing
absolute addresses.  For details, see section 18.4 of the DJGPP FAQ
list and the library sources for the above functions.

- Raw text -


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