home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / R_LA4_01.ZIP / DFILL2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-23  |  657 b   |  23 lines

  1. /* DFILL2.C - From page 353 of "Microsoft C Programming for     */
  2. /* the IBM" by Robert Lafore. Uses direct memory access to      */
  3. /* fill the screen. To quit, enter X.                           */
  4. /****************************************************************/
  5.  
  6. #define ROMAX 25
  7. #define COMAX 80
  8.  
  9. main()
  10. {
  11. int far *farptr;
  12. int col, row;
  13. char ch;
  14.  
  15.    printf("\nType a character to start, another to change, X to exit.");
  16.    farptr = (int far *) 0xB0000000;
  17.    while((ch = getche()) != 'X')
  18.       for(row = 0; row < ROMAX; row++)
  19.          for(col = 0; col < COMAX; col++)
  20.             *(farptr + row*COMAX + col) = ch | 0x0700;
  21. }
  22.  
  23.