	;MASM MODE
	.386
	.MODEL use32 small


include  prints.ase 
include  input.ase 
include  mtrap.ase 
include  breaks.ase 

	PUBLIC doin,doout

	.CODE
;
; Read from a port
;
doin	PROC	
	Call	WadeSpace	; Wade till address
	jz	inerr
	call	ReadNumber
	jc	inerr
	mov	edx,eax
	call	WadeSpace
	jnz	inerr
	in	al,dx
	push	eax
	call	crlf
	pop	eax		;
      	call	PrintByte	; Print data
	clc
	ret
inerr:
	stc
	ret
doin	ENDP
;
; Write to a port
;
doout	PROC
	Call	WadeSpace	; Wade till address
	jz	inerr
	call	ReadNumber
	jc	inerr
	mov	edx,eax
	call	WadeSpace
	jz	inerr
	call	ReadNumber
	jc	inerr
	mov	ebx,eax
	call	WadeSpace
	jnz	inerr
	mov	al,bl
	out	dx,al
	clc
	ret
doout	ENDP
end