home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / s / sgtool11.arc / LIBC128.ARC / VDCIO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-25  |  754 b   |  29 lines

  1. /*
  2. SG C Tools 1.1
  3.  
  4. (C) 1993 Steve Goldsmith
  5. All Rights Reserved
  6.  
  7. Compiled with HI-TECH C 3.09 (CP/M-80).
  8. */
  9.  
  10. #include <sys.h>
  11. #include <hitech.h>
  12. #include <vdc.h>
  13.  
  14. /* low level vdc i/o */
  15.  
  16. uchar invdc(uchar RegNum)
  17. {
  18.   outp(vdcStatusReg,RegNum);                  /* internal vdc register to read */
  19.   while ((inp(vdcStatusReg) & 0x80) == 0x00); /* wait for status bit to be set */
  20.   return(inp(vdcDataReg));                    /* read register */
  21. }
  22.  
  23. void outvdc(uchar RegNum, uchar RegVal)
  24. {
  25.   outp(vdcStatusReg,RegNum);                  /* internal vdc register to write */
  26.   while ((inp(vdcStatusReg) & 0x80) == 0x00); /* wait for status bit to be set */
  27.   outp(vdcDataReg,RegVal);                    /* write register */
  28. }
  29.