home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / ARTLSRC.RAR / SYS / IODOS.ASM < prev    next >
Assembly Source File  |  2000-08-15  |  1KB  |  47 lines

  1.                 .386
  2.  
  3. FLAT        GROUP    CODE32
  4.  
  5. CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
  6.                 ASSUME  CS:FLAT,DS:FLAT
  7.  
  8. ; Performs Input/Output from/to hardware ports
  9.  
  10. ; EXPECTS:      ecx     = 0,4,8,12,16,20 => Type of IO operation
  11. ;               eax     = Value (Output only)
  12. ;               dx      = Port number
  13.  
  14. System@__IOPort PROC    Near
  15.                 PUBLIC  System@__IOPort
  16.                 jmp     @@JmpTable[ecx]
  17. ALIGN 4
  18. @@JmpTable      dd      InputByte
  19.                 dd      InputWord
  20.                 dd      InputDWord
  21.                 dd      OutputByte
  22.                 dd      OutputWord
  23.                 dd      OutputDWord
  24.  
  25. InputByte:      in      al,dx
  26.                 ret
  27. ALIGN 4
  28. InputWord:      in      ax,dx
  29.                 ret
  30. ALIGN 4
  31. InputDWord:     in      eax,dx
  32.                 ret
  33. ALIGN 4
  34. OutputByte:     out     dx,al
  35.                 ret
  36. ALIGN 4
  37. OutputWord:     out     dx,ax
  38.                 ret
  39. ALIGN 4
  40. OutputDWord:    out     dx,eax
  41.                 ret
  42. System@__IOPort ENDP
  43.  
  44. CODE32          ENDS
  45.  
  46.                 END
  47.