home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / io386.doc < prev    next >
Text File  |  1992-11-23  |  2KB  |  43 lines

  1.  
  2. Finally a solution to the hardware port access problem. This package contains
  3. 3 files: io386.asm, io386.def, and io386.obj. These files allow your CSet/2
  4. program to access the 8 and 16 bit hardware ports.
  5.  
  6. To use these functions you need to link with io386.obj. You can recompile
  7. io386.asm if you need to make changes. It has been tested with TASM 3.1 and
  8. some version of MASM (I didn't test it myself). You MUST also include the
  9. segment definition and export section of the io386.def file in your programs
  10. .def file.
  11.  
  12. You must then declare the functions as follows:
  13.  
  14.     extern _Far16 _Pascal OUTP8(USHORT, UCHAR);
  15.     extern _Far16 _Pascal OUTP16(USHORT, USHORT);
  16.     extern UCHAR _Far16 _Pascal INP8(USHORT);
  17.     extern USHORT _Far16 _Pascal INP16(USHORT);
  18.  
  19. You can then call the functions as you would call any function:
  20.     
  21.     OUTP8(portnumber, (UCHAR)value);
  22.     OUTP16(portnumber, (USHORT)value);
  23.     (UCHAR)value=INP8(portnumber);
  24.     (USHORT)value=INP16(portnumber);
  25.  
  26. I have tested this quite a bit and it works just fine for me. If there are any
  27. problems then just let me know.
  28.  
  29. This was put together by me with EXTENSIVE help from Joel Armengaud (what CAN'T
  30. this guy do...) in the hopes that it will help some people out. Feel free to
  31. use this code as you will. Also feel free to give Joel and I credit for 
  32. finally getting this darn problem figured out.
  33.  
  34. Enjoy.
  35.  
  36. Keith Murray (murrayk@prism.cs.orst.edu)
  37. Joel Armengaud (joe2@vnet.ibm.com)
  38.  
  39.                               ____          _____  ____
  40. Keith Murray                 /     /___/ /\ \    \ \____    P.O. Box 1889
  41. murrayk@prism.cs.orst.edu   /___  /   / /__\ \____\ ____\   Corvallis OR 97339
  42.    the Dodger                  s  o  f  t  w\ a  r  e
  43.