;----------------------------------------------------------------------
;
;   LOCK - This file, in combination with LOCKR, is a demonstration
;	of a Resident System Extension (RSX) under CP/M 3. The RSX
; 	returns an empty string for calls to the "Read Line" BDOS
;	call until the correct password is entered. This effectively
;	disables command line input. When the correct password is
;	entered, the RSX sets theremove flag true so the CCP
;	disables/removes the RSX.
;
;	This file simply displays the fact that the RSX was started.
;
;   Mike Douglas, 06/11/19
;
;   Assemble with RMAC
;	A>RMAC LOCK
;	A>RMAC LOCKR
;
;   Link to a .COM file and to a page relocatable file ([OP] option)
;	A>LINK LOCK
;	A>LINK LOCKR [OP]
;
;   Rename LOCKR.PRL to LOCKR.RSX
;	A>REN LOCKR.RSX=LOCKR.PRL
;
;   Create the executable file by combining the startup .COM and
;   and the .RSX files
;	A>GENCOM LOCK LOCKR
;
;----------------------------------------------------------------------

BDOS	equ	5		;Jump vector to BDOS
WRTLINE	equ	9		;BDOS write a line to the console
CR	equ	13		;ASCII carriage return
LF	equ	10		;ASCII line feed

; Display "Console Disabled" on the console and exit.

	org	0100h		;CP/M expects programs at 0100h

	lxi	d,message	;DE = address of "disabled" message
	mvi	c,WRTLINE	;C = BDOS write line command
	jmp	BDOS		;display the message and exit

message	db	CR,LF
	db	'Console disabled. Enter password to re-enable.'
	db	CR,LF,'$'
	end
