home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_08 / 2n08072b < prev    next >
Text File  |  1991-07-01  |  610b  |  25 lines

  1.  
  2.  
  3.  
  4.             Listing 2: Port I/O Function Macros
  5.  
  6.  
  7.      #if defined(__TURBOC__)
  8.          #include "dos.h"
  9.      
  10.          #define IN_PORT(port)       inportb(port)
  11.          #define IN_PORTW(port)      inport(port)
  12.          #define OUT_PORT(port,val)  outportb(port,val)
  13.          #define OUT_PORTW(port,val) outport(port,val)
  14.      #else
  15.          #include "conio.h"
  16.      
  17.          #define IN_PORT(port)       inp(port)
  18.          #define IN_PORTW(port)      inpw(port)
  19.          #define OUT_PORT(port,val)  outp(port,val)
  20.          #define OUT_PORTW(port,val) outpw(port,val)
  21.      #endif
  22.  
  23.  
  24.  
  25.