Date: Thu, 11 Dec 1997 12:22:59 +0200 (IST) From: Eli Zaretskii To: Charles Krug cc: djgpp AT delorie DOT com Subject: Re: Storing text screens in protected mode? In-Reply-To: <348EA143.23BF0E2B@pentek.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.