home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / lib / r_la4_01 / dfill3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-25  |  657 b   |  23 lines

  1. /* DFILL3.C - From page 357 of "Microsoft C Programming for     */
  2. /* the IBM" by Robert Lafore. Uses direct memory access to      */
  3. /* fill the screen with blinking attribute. 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 | 0x8700;
  21. }
  22.  
  23.