C标准库源代码

源代码在线查看: inp.asm

软件大小: 1707 K
上传用户: yl810406
关键词: 标准库 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				        page    ,132
				        title   inp - input from ports
				;***
				;inp.asm - _inp, _inpw and _inpd routines
				;
				;       Copyright (c) 1993-1997, Microsoft Corporation. All rights reserved.
				;
				;Purpose:
				;       Defines the read-from-a-port functions: _inp(), _inpw() and inpd().
				;
				;*******************************************************************************
				
				        .xlist
				        include cruntime.inc
				        .list
				
				
				page
				;***
				;int            _inp(port)  - read byte from port
				;unsigned short _inpw(port) - read word from port
				;unsigned long  _inpd(port) - read dword from port
				;
				;Purpose:
				;       Read single byte/word/dword from the specified port.
				;
				;Entry:
				;       unsigned short port - port to read from
				;
				;Exit:
				;       returns value read.
				;
				;Uses:
				;       EAX, EDX
				;
				;Exceptions:
				;
				;*******************************************************************************
				
				        CODESEG
				
				        public _inp, _inpw, _inpd
				
				_inp    proc
				
				        xor     eax,eax
				        mov     dx,word ptr [esp + 4]
				        in      al,dx
				        ret
				
				_inp    endp
				
				
				_inpw   proc
				
				        mov     dx,word ptr [esp + 4]
				        in      ax,dx
				        ret
				
				_inpw   endp
				
				_inpd   proc
				
				        mov     dx,word ptr [esp + 4]
				        in      eax,dx
				        ret
				
				_inpd   endp
				
				        end
							

相关资源