/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/ EDIT #5
/
/ COPYRIGHT 1970, 1971 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION -- ENABLE	26 MAR 71	R. MCLEAN
/
/ TASK NAME  "...ENA"   TO ENABLE A TASK .
/
/ THE FIRST LINE OF THE COMMAND INPUT FOR ANY MCR
/ FUNCTION IS READ BY THE RESIDENT MCR TASK ("...MCR").
/ FOR THE "ENABLE" FUNCTION, THERE IS ONLY ONE LINE OF
/ COMMAND INPUT, AND IT'S SYNTAX IS AS FOLLOWS:
/
/	SYNTAX = 'ENA'$<NBC><BREAK CHARACTER><TASK NAME>
/		(<CR>/<AM>)
/	<BREAK CHAR> = " "/","
/	<TASK NAME> = 1-6 ALPHANUMERIC CHARACTERS
/	<CR> = CAR RTN
/	<AM> = ALTMODE
/	<NBC> = NON BREAK CHARACTER
/	$ -- " ANY NUMBER OF "INCLUDING ZERO "
/
/	THE RESIDENT MCR READS A LINE, FETCHES THE
/	FIRST THREE CHARACTERS TO FORM THE MCR FUNCTION TASK
/	NAME ("...ENA"), FLUSHES CHARACTERS THRU THE FIRST
/	BREAK CHARACTER, REQUESTS "...ENA", AND EXITS
/	THE TASK "...ENA " PROCESSES THE REMAINDER OF THE LINE
/	AND IF THE REQUEST IS VALID, ISSUES AN APPROPRIATE "ENABLE"
/	DIRECTIVE.
/
/	IF THE COMMAND INPUT LINE IS TERMINATED BY A CAR RTN,
/	THE RESIDENT MCR TASK IS REQUESTED, AND THE FUNCTION TASK
/	EXITS.
/
/	IF THE COMMAND INPUT LINE IS TERMINATED BY AN ALTMODE, THE
/	FUNCTION TASK EXITS WITHOUT REQUESTING "...MCR". A ^C TYPEIN
/	IS THEN NECESSARY TO RE-ESTABLISH MCR DIALOGUE.
 .TITLE *** MCR FUNCTION 'ENABLE'
/
MCRRI=171
FAC=174
X10=10
/
ENA	LAW	-7	/SET UP TO FETCH TASK NAME AND STORE
	DAC	CNT	/SIX CHARACTERS (ZERO RIGHT FILL) IN
	LAC	(ENACPB+1)	/ENABLE CAL PARAMETER BLOCK
	DAC*	(X10)
/
ENAN1	JMS*	(FAC)	/FETCH A CHARACTER
	SAD	(054)	/ IS IT A COMMA?
	JMP	ERR1	/YES -- ERROR IN SYNTAX
	SAD	(040)	/NO -- BLANK?
	JMP	ERR1	/YES -- ERROR IN SYNTAX
	SAD	(015)	/NO -- CAR RTN?
	JMP	ENDCRA	/YES-- END OF REQUEST
	SAD	(175)	/NO -- ALTMODE?
	JMP	ENDCRA	/YES-- END OF REQUEST
	DAC*	X10	/NO -- STORE CHARACTER
	ISZ	CNT	/LAST CHARACTER OF TASK NAME?
	JMP	ENAN1	/NO -- GET NEXT CHARACTER
/
ERR1	LAC	(MES2-2)	/GET SYNTAX ERROR MESSAGE ADDRESS
	DAC	TYPCPB+4	/PUT IT IN TYPE REQUEST
	JMP	ERRTY	/REQUEST MCR AND RETURN
/
ENDCRA	DAC	SVBKCH	/SAVE CAR RTN OR ALTMODE
ENAN2	DZM*	X10	/FILL REMAINING CHARACTERS WITH ZERO
	ISZ	CNT
	JMP	ENAN2
/
	LAC	ENACPB+4	/FORM FIRST HALF OF TASK NAME
	LRS	6
	LAC	ENACPB+3
	LRS	6
	LAC	ENACPB+2
	SNA		/IS THIS A NULL NAME?
	JMP	ERR1	/YES EXIT WITH ERROR
	LLS	14
	DAC	ENACPB+2	/STORE FIRST HALF OF WORD IN ENACPB
	LAC	ENACPB+7	/FORM SECOND HALF OF TASK NAME
	LRS	6
	LAC	ENACPB+6
	LRS	6
	LAC	ENACPB+5
	LLS	14
	DAC	ENACPB+3
	CAL	ENACPB	/ISSUE ENABLE DIRECTIVE
	CAL	WAITF	/WAIT FOR ENACEL TO COMPLETE
	LAC	EV	/GET EVENT VARIABLE
	SMA		/JUMP IF REJECTED
	JMP	EXT1A	/OK NO ERRORS
ERRTY	CAL	TYPCPB	/MAKE TYPE CPB REQUEST
WAITEV	CAL	WAITF
	JMP	EXT2	/FINISHED EXIT
EXT1A	LAC	SVBKCH	/GET TERMINATION CHARACTER
	SAD	(15)	/SKIP IF ALTMODE
EXT2	CAL	REQMCR	/REQUEST MCR TASK
	SAD	(175)	/IF ALTMODE DON'T CLEAR MCRRI
	DZM*	(MCRRI)	/CLEAR ^C SWITCH
	CAL	(10)	/RETURN
/
WAITF	20	/WAIT FOR REQUEST
	EV	/EVENT VARIABLE ADDRESS
/
REQMCR	1		/CALL MCR DIRECTIVE
	0
	.SIXBT	"..."
	.SIXBT	"MCR"
	0
/
ENACPB	22	/FUNCTION CODE
	EV	/EVENT VARIABLE ADR
	0	/TASK NAME (FIRST HALF)
	0	/TASK NAME (SECOND HALF)
	0
	0
	0
	0
	0
/
TYPCPB	2700	/WRITE
	EV	/EVENT VARIABLE
	3	/LUN NUMBER
	2	/IOPS ASCII
	MES3-2
EV	0
/
	000002	/HEADER WORD PAIR
	0
MES2	.ASCII	"ENA-SYNTAX ERR"<15>
	000002	/HEADER WORD PAIR
	0
MES3	.ASCII	"ENA-TASK NOT IN SYSTEM"<15>
/
/
/
SVBKCH	0
CNT	0
	.END	ENA
