;VECUSER	JUNE 13, 1978
;
;CONFIGUATION PACKAGE FOR CP/M ON MICROPOLIS
;CUSTOMIZED FOR VECTOR GRAPHICS PROM MONITOR
;
;COPYRIGHT (C) 1978, LIFEBOAT ASSOCIATES
;
;
;SYSTEM PARAMETERS
;*****************
MSIZE	EQU	22	;SET SYSTEM SIZE HERE
	;NOTE: SIZE IS "NOMINAL" CP/M SIZE WHICH
	;IS 2K LESS THAN AVAILABLE MEMORY FOR MICROPOLIS
;
BIAS	EQU	(MSIZE-16)*1024
;
CPMB	EQU	2900H+BIAS	;CPM ENTRY
BDOSE	EQU	3106H+BIAS	;ENTRY TO BDOS
BIOS	EQU	3E00H+BIAS
IOBYTE	EQU	3
;
;BEGIN USER AREA
USER	ORG	BIOS+600H
;
;JUMP VECTORS
;***********************
CINIT	JMP	CINITR	;COLD INIT
WINIT	JMP	WINITR	;WARM INIT
CONST	JMP	VECBRK	;STATUS RTN
CONIN	JMP	VECIN
CONOUT	JMP	VECOUT
LIST	JMP	VECOUT
PUNCH	JMP	VECOUT
READER	JMP	VECIN
;
CINITR:			;COLD INITIALIZATION ROUTINE
	MVI	A,1	;SET IOBYTE
	STA	IOBYTE
	RET
;
WINITR:			;WARM INITIALIZATION ROUTINE
	RET		;NONE NEEDED
;
;SPECIAL CONFIGURATION FOR VECTOR GRAPHIC PROM MONITOR
;
;VECTOR MONITOR ROUTINES
CNTLC	EQU	0C0DCH	;CONTROL X RTN
		;JMPS TO VECTOR MONITOR IF CONT X
RDCN	EQU	0C0BDH	;INPUT RTN WITH AUTO ECHO
PTLOP	EQU	0C098H	;OUTPUT CHAR FROM ACC
;
VECIN:
VECINLP	CALL	VECSTAT	;SEE IF CHAR READY
	JZ	VECINLP	;LOOP UNTIL CHAR
	MOV	A,M	;CHAR STORED BY VECSTAT
	MVI	M,0	;LET STAT RTN KNOW WE HAVE CHAR
	ANI	7FH	;STRIP PARITY
	RET		;EXIT
;
VECSTAT:
	LXI	H,CHAR	;POINT TO STORAGE LOCATION
	INR	M
	DCR	M	;TEST IF ZERO(NO CHAR THERE PREV)
	RNZ		;RET IF CHAR ALREADY THERE
	CALL	CNTLC	;GET CHAR
	MOV	M,A	;STORE CHAR
	ORA	A	;FLAG
	RET
	;
VECOUT:
	MOV	A,C	;PROM WANTS CHAR IN ACC
	CALL	PTLOP	;PROM OUTPUT RTN
	RET		;EXIT
	;
VECBRK:
	CALL	VECSTAT	;LOOK FOR CHAR
	RZ		;NO KEY, EXIT
	MVI	A,0FFH	;IF KEY
	RET		;EXIT
	;
CHAR	DB	0	;STORE CHAR FROM VECSTAT
	;
	;
