Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!njin!njitgw.njit.edu!mars.njit.edu!cd5340 From: cd5340@mars.njit.edu (David Charlap) Newsgroups: comp.lang.pascal Subject: Re: Capturing a ega text screen. Message-ID: <1991Mar28.043613.28596@njitgw.njit.edu> Date: 28 Mar 91 04:36:13 GMT References: <25045@hydra.gatech.EDU> Sender: root@njitgw.njit.edu (System PRIVILEGED Account) Distribution: usa Organization: New Jersey Institute of Technology Lines: 31 Nntp-Posting-Host: mars.njit.edu In article <25045@hydra.gatech.EDU> gt0652b@prism.gatech.EDU writes: >I am writing a program that needs to be able to shell out to dos and then come >back again with the screen intact. There must be some way to store the >contents of the screen in ram and then redisplay the screen quickly >when the shell is done. Simple. Any 80 column screen is 4000 bytes long (80x25 characters + 80x25 attributes). A color mode screen (CGA, EGA, VGA text) begins at location $B800:0000, and a monochrome screen (MDA, EGA mono, VGA mono) begins at location $B000:0000. All you need to do is declare 4000 bytes like this: Var Buffer : Array[1..4000] of byte; and move the screen data into it like this: Move (Mem[$B800:0], Buffer, 4000); Restore the screen by moving it back. Like this: Move (Buffer, Mem[$B800:0], 4000); It's that simple. If you're in a monochrome mode (check if lastmode=7) then use address $B000:0 instead of $B800:0, and it'll still work OK. -- David Charlap "Invention is the mother of necessity" cd5340@mars.njit.edu "Necessity is a mother" Operators are standing by "mother!" - Daffy Duck