home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap08 / scrinv.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-05  |  562 b   |  26 lines

  1. /* scrinv.c  --  using a far pointer to access text   */
  2. /*               screen memory                        */
  3.  
  4. #define ROWS 25
  5. #define COLS 80
  6.  
  7. main()
  8. {
  9.     int far *screenp;
  10.     int temp, i;
  11.  
  12.     do
  13.         {
  14.         /* use 0xB800000 for EGA or VGA */
  15.         screenp = (int far *)0xB0000000;
  16.  
  17.         for (i = 0; i < ((ROWS*COLS)/2); ++i)
  18.             {
  19.             temp = screenp[i];
  20.             screenp[i] = screenp[(ROWS*COLS)-i-1];
  21.             screenp[(ROWS*COLS)-i-1] = temp;
  22.             }
  23.         } while (getch() != 'Q');
  24.  
  25. }
  26.