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 / dfill.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-23  |  583 b   |  21 lines

  1. /* DFILL.C - From page 352 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 LENGTH 2000
  7.  
  8. main()
  9. {
  10. int far *farptr;
  11. int addr;
  12. char ch;
  13.  
  14.    printf("\nType character to start, another to change, X to exit.");
  15.    farptr = (int far *) 0xB0000000;
  16.    while((ch = getche()) != 'X')
  17.       for(addr = 0; addr < LENGTH; addr++)
  18.          *(farptr + addr) = ch | 0x0700;
  19. }
  20.  
  21.