home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap14 / writechr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-07  |  534 b   |  19 lines

  1. /* writechr.c -- writes char and attribute repeatedly */
  2. /*               using DMA                            */
  3. /* write character ch with attribute attr num times   */
  4. /* starting at location pstart -- uses array notation */
  5.  
  6. typedef unsigned int (far * VIDMEM); 
  7.  
  8. void Write_chars(pstart, ch, attr, num)
  9. VIDMEM pstart;
  10. unsigned short ch, attr, num;
  11. {
  12.     register count;
  13.     unsigned short pair;
  14.  
  15.     pair = (attr << 8) | (ch & 0x00FF) ;
  16.     for (count = 0; count < num; count++)
  17.         pstart[count] = pair;
  18. }
  19.