home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / vputc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  773 b   |  45 lines

  1. /*
  2. ** vputc.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include "pictor.h"
  9.  
  10. /*
  11. ** Prints character to the current video position using the
  12. ** current color attribute.
  13. */
  14. void vputc(char c)
  15. {
  16.     _asm    mov   di,_PL_offset
  17.     _asm    mov   ax,_PL_segment
  18.     _asm    mov    es,ax
  19.     _asm    mov   ax,_PL_color
  20.     _asm    mov    ah,al
  21.     _asm    mov    al,c
  22.     _asm    cmp   _PL_snowcheck,FALSE
  23.     _asm    je     direct
  24.     _asm    mov    bx,ax
  25.     _asm    mov    dx,CGA_STATUS_PORT
  26.     scan_lo:
  27.     _asm    in     al,dx
  28.     _asm    shr    al,1
  29.     _asm    jc     scan_lo
  30.     _asm    cli
  31.     scan_hi:
  32.     _asm    in     al,dx
  33.     _asm    shr    al,1
  34.     _asm    jnc    scan_hi
  35.     _asm    xchg    ax,bx
  36.     _asm    stosw
  37.     _asm    sti
  38.     _asm    jmp    end_vputc
  39.     direct:
  40.     _asm    stosw
  41.     end_vputc:
  42.     _asm    mov   _PL_offset,di
  43.  
  44. } /* vputc */
  45.