home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s300 / 1.ddi / CHAP2 / INOUT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-02  |  1.2 KB  |  48 lines

  1. /**********************************************************************
  2.  
  3. FILE
  4.     inout.h  -  maps compiler's 8-bit i/o function names 
  5.  
  6. REMARKS
  7.     Different compilers call their 8-bit port i/o routines by different
  8.     names.  This file contains macros to map these names to the generic
  9.     in() and out().  This makes programs much more portable across
  10.     different compilers
  11.  
  12.     Note: compiler #define's must be placed before this file.
  13.  
  14. ***********************************************************************/
  15.  
  16.  
  17. #if CIC86           /* Computer Innovations C86 */
  18.  
  19. #define in(port)            inportb((unsigned)(port))
  20. #define out(port, value)    outportb((unsigned)(port), value)
  21.  
  22. #endif
  23.  
  24. #if DESMET          /* Desmet C  */
  25.  
  26. #define in(port)            _inb(port)
  27. #define out(port, value)    _outb(port, value)
  28.  
  29. #endif
  30.  
  31. #if LATTICE         /* Lattice C (Version 2.15) */
  32.  
  33. #define in(port)            inp(port)
  34. #define out(port, value)    outp(port, value)
  35.  
  36. #endif
  37.  
  38. #if MICROSOFT       /* Microsoft C Version 4.00 and above */
  39.  
  40. extern int inp(unsigned);
  41. extern int outp(unsigned, int);
  42.  
  43. #define in(port)            inp(port)
  44. #define out(port, value)    outp((port), value)
  45.  
  46. #endif
  47.  
  48.