/ 
/ 
/                   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 #7
/
/ COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION -- UNFIX	23 MAR 71	R. MCLEAN
/
/ TASK NAME  "...UNF"   TO UNFIX A TASK THAT HAS BEEN FIXED IN CORE.
/
/ THE FIRST LINE OF THE COMMAND INPUT FOR ANY MCR
/ FUNCTION IS READ BY THE RESIDENT MCR TASK ("...MCR").
/ FOR THE "UNFIX" FUNCTION, THERE IS ONLY ONE LINE OF
/ COMMAND INPUT, AND IT'S SYNTAX IS AS FOLLOWS:
/
/	SYNTAX = 'UNF'$<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 ("...UNF"), FLUSHES CHARACTERS THRU THE FIRST
/	BREAK CHARACTER, REQUESTS "...UNF", AND EXITS
/	THE TASK "...UNF " PROCESSES THE REMAINDER OF THE LINE
/	AND IF THE REQUEST IS VALID, ISSUES AN APPROPRIATE "UNFIX"
/	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 'UNFIX'
/
MCRRI=171
FAC=174
X10=10
/
UNF	LAW	-7	/SET UP TO FETCH TASK NAME AND STORE
	DAC	CNT	/SIX CHARACTERS (ZERO RIGHT FILL) 
	LAC	(UNFNAM-1)
	DAC*	(X10)
/
UNFN1	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	UNFN1	/NO -- GET NEXT CHARACTER
ERR1	LAC	(MES2)	/SYNTAX ERROR
	DAC	TYPCPB+4	/STORE MESSAGE POINTER IN TYPE CPB
	JMP	ERRTY	/PRINT ERROR MESSAGE
/
ENDCRA	DAC	SVBKCH	/SAVE CAR RTN OR ALTMODE
UNFN2	DZM*	X10	/FILL REMAINING CHARACTERS WITH ZERO
	ISZ	CNT
	JMP	UNFN2
/
	LAC	UNFNAM+2	/FORM FIRST HALF OF TASK NAME
	LRS	6
	LAC	UNFNAM+1
	LRS	6
	LAC	UNFNAM
	SNA		/IS THIS A NULL NAME?
	JMP	ERR1	/YES EXIT WITH ERROR
	LLS	14
	DAC	UNFNAM	/STORE FIRST HALF OF WORD IN UNFNAM
	LAC	UNFNAM+5	/FORM SECOND HALF OF TASK NAME
	LRS	6
	LAC	UNFNAM+4
	LRS	6
	LAC	UNFNAM+3
	LLS	14
	DAC	UNFNAM+1
	CAL	UNFCPB	/UNFIX REQUEST
	LAC	EV	/PICKUP EVENT VARIABLE
	DZM	EV	/CLEAR EVENT VARIABLE
	SMA		/IS REQUEST LEGAL?
	JMP	EXT1A	/YES EXIT
	SAD	(-201)	/IS TASK IN SYSTEM?
	SKP
	JMP	NOTFIX	/NOT FIXED IN CORE ERROR
	LAC	(MES3)	/TASK NOT IN SYSTEM
	DAC	TYPCPB+4
	JMP	ERRTY
NOTFIX	LAC	(MES1)	/TASK NOT FIXED IN CORE ERROR
	DAC	TYPCPB+4	/PUT ERROR MESSAGE IN TYPE CPB
ERRTY	CAL	TYPCPB	/MAKE TYPE CPB REQUEST
	CAL	WAITEV	/WAIT FOR TTY TO FINISH
	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
/
REQMCR	1		/CALL MCR DIRECTIVE
	0
	.SIXBT	"..."
	.SIXBT	"MCR"
	0
UNFCPB	16		/UNFIX CPB
	EV		/EVENT VARIABLE ADDRESS
UNFNAM	.BLOCK	7
/
TYPCPB	2700
	EV
	3
	2
	XX
/
WAITEV	20	/WAIT FOR
	EV	/EVENT VARIABLE ADDRESS
EV	0
/
MES1	2; 0; .ASCII	"UNF-TASK NOT FIXED"<15>
MES2	2; 0; .ASCII	"UNF-SYNTAX ERR"<15>
MES3	2; 0; .ASCII	"UNF-TASK NOT IN SYSTEM"<15>
/
/
/
SVBKCH	0
CNT	0
	.END	UNF
