Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.2 KiB

  1. page ,132
  2. title inp - input from ports
  3. ;***
  4. ;inp.asm - _inp, _inpw and _inpd routines
  5. ;
  6. ; Copyright (c) 1993-2001, Microsoft Corporation. All rights reserved.
  7. ;
  8. ;Purpose:
  9. ; Defines the read-from-a-port functions: _inp(), _inpw() and inpd().
  10. ;
  11. ;Revision History:
  12. ; 04-09-93 GJF Resurrected.
  13. ; 04-13-93 GJF Arg/ret types changed slightly.
  14. ;
  15. ;*******************************************************************************
  16. .xlist
  17. include cruntime.inc
  18. .list
  19. page
  20. ;***
  21. ;int _inp(port) - read byte from port
  22. ;unsigned short _inpw(port) - read word from port
  23. ;unsigned long _inpd(port) - read dword from port
  24. ;
  25. ;Purpose:
  26. ; Read single byte/word/dword from the specified port.
  27. ;
  28. ;Entry:
  29. ; unsigned short port - port to read from
  30. ;
  31. ;Exit:
  32. ; returns value read.
  33. ;
  34. ;Uses:
  35. ; EAX, EDX
  36. ;
  37. ;Exceptions:
  38. ;
  39. ;*******************************************************************************
  40. CODESEG
  41. public _inp, _inpw, _inpd
  42. _inp proc
  43. xor eax,eax
  44. mov dx,word ptr [esp + 4]
  45. in al,dx
  46. ret
  47. _inp endp
  48. _inpw proc
  49. mov dx,word ptr [esp + 4]
  50. in ax,dx
  51. ret
  52. _inpw endp
  53. _inpd proc
  54. mov dx,word ptr [esp + 4]
  55. in eax,dx
  56. ret
  57. _inpd endp
  58. end