home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / bios / readcur.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  535 b   |  26 lines

  1. /*
  2.  *    readcur    -- pass back the cursor position (row, col) 
  3.  */
  4.  
  5. #include <dos.h>
  6. #include <local\std.h>
  7. #include <local\bioslib.h>
  8.  
  9. unsigned int readcur(row, col, pg)
  10. unsigned int *row;    /* current row */
  11. unsigned int *col;    /* current column */
  12. unsigned int pg;    /* screen page */
  13. {
  14.     union REGS inregs, outregs;
  15.  
  16.     inregs.h.ah = GET_CUR;
  17.     inregs.h.bh = pg;
  18.  
  19.     int86(VIDEO_IO, &inregs, &outregs);
  20.  
  21.     *col = outregs.h.dl;        /* col */
  22.     *row = outregs.h.dh;        /* row */
  23.  
  24.     return (outregs.x.cflag);
  25. } /* end readcur() */
  26.