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.

78 lines
1.3 KiB

  1. page ,132
  2. title outp - output from ports
  3. ;***
  4. ;outp.asm - _outp, _outpw and _outpd routines
  5. ;
  6. ; Copyright (c) 1993-2001, Microsoft Corporation. All rights reserved.
  7. ;
  8. ;Purpose:
  9. ; Defines the write-to-a-port functions: _outp(), _outpw() and outpd().
  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 _outp(port, databyte) - write byte from port
  22. ;unsigned short _outpw(port, dataword) - write word from port
  23. ;unsigned long _outpd(port, datadword) - write dword from port
  24. ;
  25. ;Purpose:
  26. ; Write single byte/word/dword to the specified port.
  27. ;
  28. ;Entry:
  29. ; unsigned short port - port to write to
  30. ;
  31. ;Exit:
  32. ; returns value written.
  33. ;
  34. ;Uses:
  35. ; EAX, EDX
  36. ;
  37. ;Exceptions:
  38. ;
  39. ;*******************************************************************************
  40. CODESEG
  41. public _outp, _outpw, _outpd
  42. _outp proc
  43. xor eax,eax
  44. mov dx,word ptr [esp + 4]
  45. mov al,byte ptr [esp + 8]
  46. out dx,al
  47. ret
  48. _outp endp
  49. _outpw proc
  50. mov dx,word ptr [esp + 4]
  51. mov ax,word ptr [esp + 8]
  52. out dx,ax
  53. ret
  54. _outpw endp
  55. _outpd proc
  56. mov dx,word ptr [esp + 4]
  57. mov eax,[esp + 8]
  58. out dx,eax
  59. ret
  60. _outpd endp
  61. end