		.PABS
		.PHEX
		.LOC 	00H
START:	LXI	H,4000H
WLOOP:	IN	03
	MOV	A,L
	XRA	H
	MOV	M,A
	INX	H
	MOV	A,H
	CPI	0
	JNZ	WLOOP
	LXI	H,4000H
READL1:	MOV	A,L
	XRA	H
	CMP	M
	JZ	CONT1
	XRA	M
	OUT	0
CONT1:	INX	H
	MOV	A,H
	CPI	80H
	JNZ	READL1
READL2:	MOV	A,L
	XRA	H
	CMP	M
	JZ	CONT2
	XRA	M
	OUT	1
CONT2:	INX	H
	MOV	A,H
	CPI	0C0H
	JNZ	READL2
READL3:	MOV	A,L
	XRA	H
	CMP	M
	JZ	CONT3
	XRA	M
	OUT	2
CONT3:	INX	H
	MOV	A,H
	CPI	0
	JNZ	READL3
	JMP	START
		.END
