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

  1. /*
  2.  *    writetty -- write to screen using TTY interface
  3.  */
  4.  
  5. #include <dos.h>
  6. #include <local\std.h>
  7. #include <local\bioslib.h>
  8.  
  9. int
  10. writetty(ch, attr, pg)
  11. unsigned char ch;    /* character */
  12. unsigned char attr;    /* video attribute */
  13. int pg;            /* screen page for writes */
  14. {
  15.     union REGS inregs, outregs;
  16.  
  17.     inregs.h.ah = WRITE_TTY;
  18.     inregs.h.al = ch;
  19.     inregs.h.bl = attr;
  20.     inregs.h.bh = pg;
  21.     int86(VIDEO_IO, &inregs, &outregs);
  22.  
  23.     return (outregs.x.cflag);
  24. }
  25.