public sendfile




sendfile:
	mov	e,m		;address of pb
	inx	h
	mov	d,m
	xchg			;address of buffer
	lxi	d,129		;length of buffer
send1:
	mov	m,a		;get byte
	call 	send
	inx	h
	dcx	d
	mov	a,d
	ora	e
	jnz	send1		;jump if not at the end
	ret
send:
	PUSH	PSW
	MVI     A,0
	OUT 	2
OUTA1:
	IN	02		;GET STATUS
	ANI	3
	CPI	2
	JNZ	OUTA1		;JUMP IF BUFFER FULL
	POP	PSW
	CMA			;COMPLEMENT BYTE
	OUT	1		;SEND BYTE TO DMV
	RET
end
