DIE		macro
		scope
		jp	$	; Endless, no return.
		endmac


dump_buff	MACRO	BUFF,LENGTH

		PUMP	0,dmp_cr$
		ld	de,BUFF
		ld	b,LENGTH
$more_dmp	ld	a,(de)
		inc	de
		push	bc
		push	de
		cvt_ascii	dmp_string$
		PUMP	0,dmp_string$
		pop	de
		pop	bc
		LOOP	$more_dmp
		PUMP	0,dmp_cr$
		endmac	dump_buff



PUMP		MACRO	msgdev,msgbuf	; Pump a screen built in memory to x serial port.
		scope			; A tribute to Dave Shriner - Display Data Corp.

		LD	HL,msgbuf	; Pump from this starting point until ETX.asc  is found.

		if	msgdev=0
$0:		LD	A,(HL)		; Get byte to send.
		INC	HL		; pointer=pointer+1
;		CP	EOT.asc		; End Of Transmission (block)?
;		jr	Z,$0a		; Return if finished.
		CP	ETX.asc		; End Of Text?
		jr	Z,$0a		; Return if finished.
		CP	CR.asc		; Was it a CR?
		call	z,$1		; 1st add a LF to stream.
		LD	C,A 		; Output byte in C.
		XOR	A		; Set Z flag for put.
		CALL	U0DVR		; Out the UART we go.
		JR	$0
$1:		ld	a,LF.asc	; Get a LF.
		LD	C,A 		; Output byte in C.
		XOR	A		; Set Z flag for put
		CALL	U0DVR		; Out the UART we go.
		ld	a,CR.asc	; Now put a CR back in stream.
		ret			; Return and print CR.
$0a		endif		

		if	msgdev=1
$1:		LD	A,(HL)		; Get byte to send.
		INC	HL		; pointer=pointer+1
;		CP	EOT.asc		; End Of Transmission (block)?
;		jr	Z,$1a		; Return if finished.
		CP	ETX.asc		; End Of Text?
		jr	Z,$1a		; Return if finished.
		LD	C,A 		; Output byte to C.
		XOR	A		; Set Z flag for put.
		CALL	U1DVR		; Out the UART we go.
		JR	$1
$1a		equ	$
		endif		
		ENDMAC	PUMP