Mail Archives: djgpp/1997/12/11/05:24:16
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 -