;Test PRogram for Polytape
;runs under CP/M under NICE under MSDOS

;******************
; ASCII Characters
;******************
LF	equ	0AH	;Linefeed
CR	equ	0DH	;Carriage return
;---------------------------------------------------------
; BIOS Entry Points
;---------------------------------------------------------
BIOS	equ	0FE00h		;'NICE' BIOS base
CONST	equ	BIOS+06h	;Console Status
CONIN	equ	BIOS+09h	;Console Input
CONOUT	equ	BIOS+0Ch	;Console output

	org	1000h

	call	ILPRNT
	db	CR,LF,'Type any letter to return to CP/','M'+80h

LOOP:	call	CONST
	ora	a
	jz	LOOP

	jmp	0000		;reboot



;*****Subroutine***************************************
; Print In-line Message
;  The call to ILPRNT is followed by a message string.
;  The last chr of the string has its msb set
;  Note: this routine still works when ONBRD
; Trashes c
;******************************************************
ILPRNT:	xthl			;Save hl, get msg addr

IPLOOP:	mov	a,m
	ani	7Fh		;strip end-marker
	mov	c,a
	push	h
	call	CONOUT		;print byte
	pop	h
	mov	a,m
	rlc			;end of string?
	inx	h		;point past message
	jnc	IPLOOP		;Do all bytes of msg

	xthl			;Restore hl,
				;..get return address
	ret


