home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / comos2.zip / PORTINTF.C < prev    next >
C/C++ Source or Header  |  1992-11-30  |  2KB  |  68 lines

  1. /**************************************************************************
  2.  *
  3.  *  PORTINTF.C
  4.  *
  5.  *  This file contains the 16-bit function interface to the 16-bit IOPL
  6.  *  assembler code.  It is possible that this layer is unnecessary, but
  7.  *  it is included to simplify the coding.  These routines are not
  8.  *  needed from a 16-bit application.
  9.  *
  10.  *  This file was compiled with the MicroSoft C6.00AX compiler using the
  11.  *  following flags:
  12.  *
  13.  *    /MT /W3 /Alfu /Gt64 /G2s /FPi87 /c
  14.  *_________________________________________________________________________
  15.  *
  16.  *  Copyright (c) 1992 by ASH Software, Inc.
  17.  *
  18.  **************************************************************************/
  19.  
  20. //
  21. // Assembler prototypes
  22. //
  23.  
  24. extern int  far pascal ioplinp (unsigned int portaddress);
  25. extern int  far pascal ioplinpw(unsigned int portaddress);
  26. extern void far pascal ioplout (unsigned int portaddress,
  27.   unsigned char outputbyte);
  28. extern void far pascal ioploutw(unsigned int portaddress,
  29.   unsigned int outputword);
  30.  
  31. //
  32. // About a single byte to the port
  33. //
  34.  
  35. void far pascal PortOutByte(unsigned int uiPortAddress,unsigned char bParam)
  36. {
  37. ioplout(uiPortAddress,bParam);
  38. return;
  39. }
  40.  
  41. //
  42. // About a 2 bytes (a word) to the port
  43. //
  44.  
  45. void far pascal PortOutWord(unsigned int uiPortAddress,unsigned int wParam)
  46. {
  47. ioploutw(uiPortAddress,wParam);
  48. return;
  49. }
  50.  
  51. //
  52. // Return a single byte from the port
  53. //
  54.  
  55. unsigned int far pascal PortInpByte(unsigned int uiPortAddress)
  56. {
  57. return(ioplinp(uiPortAddress));
  58. }
  59.  
  60. //
  61. // Return two bytes (a word) from the port
  62. //
  63.  
  64. unsigned int far pascal PortInpWord(unsigned int uiPortAddress)
  65. {
  66. return(ioplinpw(uiPortAddress));
  67. }
  68.