;	RCV.ZAS
;	
	ORG 103H
SIOBC	EQU 6
SIOBD	EQU 4
ABUFF	EQU 200H
EBUFF	EQU 90H
CTRLZ	EQU 1AH
;
RCV:	JP START
EXIT:	LD C,0
	JP 0005
COUNT:	DEFW 0H
REGS:	DEFB 11011000B
	DEFB 4
	DEFB 11000100B
	DEFB 5
	DEFB 11100000B
	DEFB 3
	DEFB 11000001B
	DEFB 1
	DEFB 0H
;
START:	
	LD HL,REGS
	LD B,9H
OUTLP:	LD A,(HL)
	OUT (SIOBC),A
	DEC B
	INC HL
	JP NZ,OUTLP
	LD B,0
	LD C,B
	LD HL,ABUFF
	LD D,EBUFF
	LD E,1
;
LOOP:	IN A,(SIOBC)
	AND E
	JP Z,LOOP
	IN A,(SIOBD)
	LD (HL),A
	JP SKIP
	PUSH AF
	PUSH BC
	PUSH DE
	PUSH HL
	LD E,A
	LD C,2
	CALL 0005
	POP HL
	POP DE
	POP BC
	POP AF
SKIP:	INC BC
	CP CTRLZ
	JP Z,READY
	INC HL
	LD A,D
	CP H
	JP NZ,LOOP
READY:	LD HL,COUNT
	LD (HL),C
	INC HL
	LD (HL),B
	JP EXIT
;
	END
