home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCWRITE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.3 KB  |  53 lines

  1. /**
  2. *
  3. * Name        scwrite -- Write copies of a character
  4. *
  5. * Synopsis    iret = scwrite(ch,cnt);
  6. *
  7. *        int  iret      Return value is always 0
  8. *        char ch       Character to write
  9. *        unsigned cnt      Number of copies of ch to write
  10. *
  11. * Description    SCWRITE displays cnt copies of the character ch on the
  12. *        current display screen without changing the
  13. *        currently-set attribute.  The characters are written on
  14. *        the current page starting at the current cursor
  15. *        position.
  16. *
  17. *        Unexpected results may occur if you write beyond the end
  18. *        of the screen, or if (in graphics mode) you write beyond
  19. *        the current text row.  This function will not scroll the
  20. *        screen.
  21. *
  22. *        SCATTRIB is preferable for graphics modes because it
  23. *        allows control of the characters' color.  SCWRITE uses
  24. *        color 1 in graphics modes.
  25. *
  26. * Version    6.00 (C)Copyright Blaise Computing Inc.  1983,1987,1989
  27. *
  28. **/
  29.  
  30. #include <dos.h>
  31.  
  32. #include <bscreens.h>
  33.  
  34. int scwrite(ch,cnt)
  35. char     ch;
  36. unsigned cnt;
  37. {
  38.     union REGS inregs,outregs;
  39.  
  40.     if (cnt)                  /* BIOS treats 0 as 64K.          */
  41.     {
  42.     inregs.h.ah = 10;
  43.     inregs.h.al = ch;
  44.     inregs.h.bh = (unsigned char) b_curpage;
  45.     inregs.h.bl = 1;          /* Use color 1 in case this is  */
  46.                       /* graphics mode              */
  47.     inregs.x.cx = cnt;
  48.     int86(16,&inregs,&outregs);
  49.     }
  50.  
  51.     return(0);
  52. }
  53.