; newioml.dsm
; L. Stewart September 23, 1982  5:09 PM

$INCLUDE(Lark.d)

C←CODE	SEGMENT

EXTRN	←PortStr:NEAR

ASSUME CS:C←CODE

←I8274 DB	sioctla
	DB	2
	DB	018H	; channel reset
	DB	0F0H	; reset Tx underrun, error reset

	DB	sioctlb
	DB	2
	DB	018H	; channel reset
	DB	0F0H	; reset Tx underrun, error reset

	DB	sioctla
	DB	14
	DB	004H	; WR 4 next
	DB	04CH	; 16 x clock, 2 stop, no parity
	DB	001H	; WR 1 next
;	DB	004H	; no interrupts, variable vector
	DB	01EH	; rx int all chars, variable vector, txint, no ext int
	DB	002H	; WR 2 next
	DB	014H	; 8088 mode, non-vector int. rx high pri., both int.
	DB	003H	; WR 3 next
	DB	0C0H	; 8 bits/rxchar
	DB	005H	; WR 5 next
	DB	060H	; 8 bits/txchar
	DB	006H	; WR 6 next
	DB	000H	; junk
	DB	007H	; WR 7 next
	DB	000H	; junk

	DB	sioctlb
	DB	14
	DB	004H	; WR 4 next
	DB	04CH	; 16 x clock, 2 stop, no parity
	DB	001H	; WR 1 next
;	DB	004H	; no interrupts, variable vector
	DB	01EH	; rx int all chars, variable vector, txint, no ext int
	DB	002H	; WR 2 next
	DB	000H	; base vector
	DB	003H	; WR 3 next
	DB	0C0H	; 8 bits/rxchar
	DB	005H	; WR 5 next
	DB	060H	; 8 bits/txchar
	DB	006H	; WR 6 next
	DB	000H	; junk
	DB	007H	; WR 7 next
	DB	000H	; junk

; now enable 8274
	DB	sioctla
	DB	4
	DB	003H
	DB	0C1H	; 8 bits/rxchar, rx enable
	DB	005H
	DB	068H	; 8 bits/txchar, tx enable

	DB	sioctlb
	DB	4
	DB	003H
	DB	0C1H	; 8 bits/rxchar, rx enable
	DB	005H
	DB	068H	; 8 bits/txchar, tx enable

	DB	0FFH

←Set8274	PROC	NEAR
	PUSH	BP
	MOV	BP,SP
	MOV	BX,OFFSET ←I8274
	CALL	←PortStr
	MOV	SP,BP
	POP	BP
	RET
←Set8274	ENDP

PUBLIC	←Set8274

C←CODE ENDS
	END