BBS: Inland Empire Archive
Date: 03-10-92 (09:45)             Number: 183
From: MATT HART                    Refer#: 140
  To: TIM LAWING                    Recvd: NO  
Subj: Bsave                          Conf: (11) Quik_Bas

* In a message to All, Tim Lawing said: TL *> I have a screen that I want to save. I have tried to TL *> understand this from a couple different manuals, still not TL *> clear. The screen is Screen 0. Someone please explain to TL *> me the process of reading the screen and placing it into a TL *> file. Please explain Def Seg to thanks. DEF SEG is the statement to tell PEEK/POKE/BSAVE/BLOAD which DOS segment to operate in. A PC's memory is split into "segments" of 64K each. This has to do with the method in which memory is accessed, with a segment integer and an offset integer. Since an integer is max at 64K, each segment is 64K in size. The screen segment begins (for color) at memory location B800:000 which is B800 hex segment and 0000 offset. So if you were to: DEF SEG = &HB800 POKE 0,65 DEF SEG This would put an "A" (CHR$(65)) in the upper left side of the screen. Many useful things can be learned from accessing different memory areas, such as whether keys are pending in the keyboard buffer without actually accessing them, if ctrl or alt is pressed, if the num lock is on, what screen mode is current. To save a screen to a file, you can use BSAVE: DEF SEG = &HB800 : BSAVE "MYSCR.BIN",0,4000 : DEF SEG To reload it: DEF SEG = &HB800 : BLOAD "MYSCR.BIN",0 : DEF SEG The ending "DEF SEG" resets the segment to the default, which is important. --- * Origin: Midnight Micro! V.32/REL (918)451-3306 (1:170/600)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET