code	segment dword public use32 'code'
	assume cs:code

;*****************************
; I/O direct access routines
;*****************************

;int INPB(addr)

	public INPB
INPB	proc near
	xor  eax,eax
	mov  dx,[esp+4]
	in   al,dx
	ret
INPB	endp

;int INPW(addr)

	public INPW
INPW	proc near
	xor  eax,eax
	mov  dx,[esp+4]
	in   ax,dx
	ret
INPW	endp

;void OUTPB(addr,dat)

	public OUTPB
OUTPB	proc near
	mov  dx,[esp+4]
	mov  al,[esp+8]
	out  dx,al
	ret
OUTPB	endp

;void OUTPW(addr,dat)

	public OUTPW
OUTPW	proc near
	mov  dx,[esp+4]
	mov  ax,[esp+8]
	out  dx,ax
	ret
OUTPW   endp

;******************************
; I/O register access
;******************************

;void  OUTREGB(addr,num,dat)

	public OUTREGB
OUTREGB	proc near
	mov  dx,[esp+4]
	mov  al,[esp+8]
	out  dx,al
	add  dx,2
	mov  al,[esp+12]
	out  dx,al
	ret
OUTREGB	endp

;void OUTREGW(addr,num,dat)

	public OUTREGW
OUTREGW	proc near
	mov  dx,[esp+4]
	mov  al,[esp+8]
	out  dx,al
	add  dx,2
	mov  ax,[esp+12]
	out  dx,ax
	ret
OUTREGW	endp

code	ends
	end
