home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / sphinx / ports.h__ < prev    next >
Text File  |  1993-07-06  |  1KB  |  53 lines

  1. /*
  2.     SPHINX Programming (C) 1993.
  3.     NAME:  PORTS.H--
  4.     DESCRIPTION:  This file contains a collection of procedures for reading
  5.                   and writing to ports.
  6.     LAST MODIFIED:  7 July 1993
  7.     PROCEDURES DEFINED IN THIS FILE:
  8.         : byte  INPORTB( , , ,port)
  9.         : word  INPORTW( , , ,port)
  10.         : dword INPORTD( , , ,port)
  11.         : void  OUTPORTB(bytevalue, , ,port)
  12.         : void  OUTPORTW(wordvalue, , ,port)
  13.         : void  OUTPORTD(dword dwordvalue, , ,port)
  14. */
  15.  
  16.  
  17. : byte INPORTB ()  /* DX = port to read byte from */
  18. {
  19. $ IN AL,DX
  20. }
  21.  
  22.  
  23. : word INPORTW ()  /* DX = port to read word from */
  24. {
  25. $ IN AX,DX
  26. }
  27.  
  28.  
  29. : dword INPORTD ()  /* DX = port to read dword from */
  30. {
  31. $ IN EAX,DX
  32. }
  33.  
  34.  
  35. : void OUTPORTB ()  /* AL = byte value to write, DX = port to write to */
  36. {
  37. $ OUT DX,AL
  38. }
  39.  
  40.  
  41. : void OUTPORTW ()  /* AX = word value to write,  DX = port to write to */
  42. {
  43. $ OUT DX,AX
  44. }
  45.  
  46.  
  47. : void OUTPORTD ()  /* EAX = dword value to write,  DX = port to write to */
  48. {
  49. $ OUT DX,EAX
  50. }
  51.  
  52.  
  53. /* end of PORTS.H-- */