.title	'Reinitialize port3 to no type ahead or interrupts'
	.ident	p3init
	.pabs
	.phex
	.loc	100h
;
version	==	1
revision==	0	;last modified 5/11/83  DRB
patch	==	' '
;
prtstrg ==	9	;CP/M 9, Print String
BDOS	==	05
cr	==	0Dh
lf	==	0Ah
p3ctrl	==	23h
;
	sspd	saveSP
	lxi	D,logmsg
	call	prtmsg
;
	mvi	a,11h
	out	p3ctrl	;end of typeahead
	mvi	A,4h
	out	p3ctrl	;end ints
	lspd	saveSP
	ret
;--------------
;  Regs in:   DE = address of string (ended by null)
;  Regs out:  none
;  Destroyed: DE
prtmsg:
	mvi	C,prtstrg
	call	BDOS	; print the string
	ret
saveSP:	.word	0
;
Logmsg:	.ascii	[cr][lf]'End the type ahead and interrupts '
	.ascii		'on port3, version '
	.byte	version+'0','.'
	.byte	revision/10+'0',revision@10+'0'
	.byte	patch
crlflf:	.ascii	[cr][lf][lf]'$'
;
	.end
