;
;  PATCH:  Z2PATCH.ASM
;  AUTHOR:  Richard Conn
;  NOTE:  This is a Patch to the MicroDecision BIOS (Ver 1.3)
;	which implements the following extended features of
;	ZCPR2 on the MicroDecision --
;		External Paths for Command Search
;		Multiple Command Line Buffer
;		ZCPR2 External Stack
;

;
;  ZCPR2 Equates
;
zcpr2	equ	0dc00h	;Base Address of ZCPR2 Itself
gocpm	equ	0f2a0h	;GOCPM Entry Point in BIOS
z2stack	equ	0f9d0h	;Bottom of ZCPR2 External Stack
z2tos	equ	z2stack+48	;Top of ZCPR2 External Stack
mclbuf	equ	z2tos	;Beginning of Multiple Command Line Buffer
path	equ	40h	;Base Address of External Path
patch	equ	0fca8h	;Patch Begins Here

;
;  Patch --
;
	org	patch
;
	lxi	h,clbase	;init command line
	lxi	d,mclbuf	;copy into buffer
	mvi	b,40		;40 chars
	call	move
;
	lxi	h,pathbase	;init default path
	lxi	d,path
	mvi	b,10		;10 bytes
	call	move
;
	lxi	h,zcpr2		;set pointer
	jmp	gocpm
;
;  Move Routine
;
move:
	mov	a,m	;get
	stax	d	;put
	inx	h	;pt to next
	inx	d
	dcr	b	;count down
	jnz	move
	ret
;
;  Default Values
;
clbase:
	dw	mclbuf+4	;pt to first char
	db	200		;200 chars
	db	0
	db	'STARTUP'	;default command
	db	0
pathbase:
	db	'A'-'@',0	;goto A0
	db	0
;
;  End of Patch
;
	end
