home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGC.ZIP / PROGC003.C < prev    next >
Text File  |  1988-05-15  |  872b  |  21 lines

  1.  
  2. /************************************************************************/
  3. /* Get cursor position by reading CRTC registers E and F                */
  4. /************************************************************************/
  5.  
  6. read_cursor_address()
  7.         {
  8.         #define MONO    5
  9.         #define VMONO   7
  10.         int     hi, lo, port;
  11.         if (get_display_type() == MONO || get_display_type() == VMONO)
  12.                 port = 0x3B4;
  13.         else
  14.                 port = 0x3D4;
  15.         write_register(port, 0x0E);     /* Select register index        */
  16.         hi = read_register(port+1);     /* Get register value           */
  17.         write_register(port, 0x0F);     /* Select register              */
  18.         lo = read_register(port+1);     /* Get register value           */
  19.         printf("\nCursor is at %x hex", hi * 256 + lo);
  20.         }
  21.