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

  1. /*
  2.  *    readca -- read character and attribute at current position
  3.  */
  4.  
  5. #include <dos.h>
  6. #include <local\std.h>
  7. #include <local\bioslib.h>
  8.  
  9. int readca(ch, attr, pg)
  10. unsigned char *ch;
  11. unsigned char *attr;
  12. unsigned int pg;    /* screen page for reads */
  13. {
  14.     union REGS inregs, outregs;
  15.  
  16.     inregs.h.ah = READ_CHAR_ATTR;
  17.     inregs.h.bh = pg;        /* display page */
  18.  
  19.     int86(VIDEO_IO, &inregs, &outregs);
  20.  
  21.     *ch = outregs.h.al;        /* character */
  22.     *attr = outregs.h.ah;        /* attribute */
  23.  
  24.     /* return the value in AX register */
  25.     return (outregs.x.cflag);
  26. } /* end readca() */
  27.