[comp.sys.ibm.pc] usenet submission

birdsall@manana.dec.com (01/05/89)

dre: "   Three questions: " from James W. Birdsall

Two answers:
 
 >  1) I need a sophisticated way to determine where the screen begins in
 >     RAM. 

You're in luck, Jim. The video on a PC is about as sophisticated as a 
brick. You smash a character into RAM and it appears on the screen.
Even I can do it ... and it's fun!

For most modes, video RAM begins at hex B8000. Other modes can begin 
at B0000 or A0000. For example, mode 10 under EGA is 640 x 350 and 
begins at A0000. In general, YOU set the mode, and then write to the 
appropriate address. 

A handy book to have if you're going to do much with video is the 
Technical Reference Manual for your particular adapter. Our Most 
Worthy Competitor, IBM, will be honored to provide one ... for a 
modest fee. You can usually order them through a local IBM PC dealer.

Another source of video programming information is "The WaiteGroup's 
Microsoft C Programming for the IBM" by Robert Lafore (Howard W. Sams 
ISBN 0-672-22515-8).

Also highly recommended is "The Waite Group's Microsoft C Bible" by 
Nabajyoti Barkakati (Howard W. Sams ISBN 0-672-22620-0) - particularly 
if you would like to use Microsoft's excellent graphics routines which 
are available in MSC V5.0.

Unfortunately, I don't have any Turbo C references.

The following C code will fill your screen with X's ... very quickly!

============================== cut here =============================
   /*
    *  Fills the screen with X
    */
   main()
   {
   int i;
   unsigned short far *p;
   /*
    *  0xB8000000 is the start of video ram
    */
   p = (unsigned short far *)0xB8000000;
   /*
    *  0x700 ... keep in mind that video ram is 16 bits.
    *  In this case, 0x700 is setting one of the attribute bits.
    */
   for (i=0; i<80*25; i++) *p++ = 0x700 + 'X';
   }

============================== cut here =============================

>   3) Finally, could somebody send me a list of the control codes which
>      a VT100/102 responds to? (i.e. the codes the host sends to it).

If you will post a mailing address, I will mail you a copy of the
VT100 programmer's reference manual (I work for the manufacturer.) I
will also try to contact you on CompuServe (if I can figure out how). 
 
I can't help you with CGA 'snow'. I can't even get it to snow in New 
Hampshire.  :-(

>  Thanks a lot...

You are most welcome!

Walter E. Birdsall
Digital Equipment Corporation