;----------------------------------------------------------------------------
; CP/M 2.2 patch to put the user number in the command prompt.
;----------------------------------------------------------------------------

CCPBASE	equ	0B100h		;modify for your system

USRNUM	equ	CCPBASE+0B41h	;user number in the BDOS
CCPDISP	equ	CCPBASE+008Ch	;CCP entry, display value in A

; CCP Patch

	org	CCPBASE+038Dh	;display prompt in the CCP
	call	prompt		;call patch below instead


; prompt is called when the CCP has loaded the drive letter for the prompt
;    into A. The drive letter is displayed followed by the user number.

	org	0FB80h		;place in a permanent hole in memory

prompt	call	CCPDISP		;display drive letter
	lda	USRNUM		;A=user number
	cpi	10		;0-9?
	jc	do1s		;yes, just do the 1's digit

	mvi	a,'1'		;print the 10's digit
	call	CCPDISP

	lda	usrNum		;A=user number
	sui	10		;get 1's digit alone

do1s	adi	'0'		;convert 1's digit to ASCII
	jmp	CCPDISP		;display it and exit

	end
