home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / VARIOUS / PORTS.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-06-10  |  1.7 KB  |  67 lines

  1. ;****************************************************************************
  2. ; Filename: PORTS.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.02.09
  6. ;  Updated: -
  7. ;****************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;****************************************************************************
  11. ; Function: int outp(unsigned portid, int value);
  12. ;    Input: Eax = port address
  13. ;            Edx = value
  14. ;   Output: value send to port.
  15. ;  Comment: Sends a byte value to I/O port.
  16. ;****************************************************************************
  17. ; Function: unsigned outpw(unsigned portid, unsigned value);
  18. ;    Input: Eax = port address
  19. ;            Edx = value
  20. ;   Output: value send to port.
  21. ;  Comment: Sends a word value to I/O port.
  22. ;****************************************************************************
  23. ; Function: int inp(unsigned portid);
  24. ;    Input: Eax = port address
  25. ;   Output: value returned from port.
  26. ;  Comment: reads a byte value from I/O port.
  27. ;****************************************************************************
  28. ; Function: unsigned inpw(unsigned portid);
  29. ;    Input: Eax = port address
  30. ;   Output: value returned from port.
  31. ;  Comment: reads a word value from I/O port.
  32. ;****************************************************************************
  33.  
  34.     Include    STDDEF.INC
  35.  
  36.     Codeseg
  37.  
  38.  
  39. Proc    outp ,2
  40.         xchg  Eax,Edx
  41.         out      Dx,Al
  42.         ret
  43. Endp
  44.  
  45. Proc    outpw ,2
  46.         xchg  Eax,Edx
  47.         out      Dx,Ax
  48.         ret
  49. Endp
  50.  
  51. Proc    inp ,1
  52.         Mov      Edx,Eax
  53.         Xor      Eax,Eax
  54.         in      Al,Dx
  55.         ret
  56. Endp
  57.  
  58. Proc    inpw ,1
  59.         Mov      Edx,Eax
  60.         Xor      Eax,Eax
  61.         in      Ax,Dx
  62.         ret
  63. Endp
  64.  
  65.  
  66.     End
  67.