/ 
/ 
/                   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 #10
/
/ COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION -- FIX	25 MAR 71	R. MCLEAN
/
/ TASK NAME  "...FIX"   TO FIX A TASK  IN CORE.
/
/ THE FIRST LINE OF THE COMMAND INPUT FOR ANY MCR
/ FUNCTION IS READ BY THE RESIDENT MCR TASK ("...MCR").
/ FOR THE "FIX" FUNCTION, THERE IS ONLY ONE LINE OF
/ COMMAND INPUT, AND IT'S SYNTAX IS AS FOLLOWS:
/
/	SYNTAX = 'FIX'$<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 ("...FIX"), FLUSHES CHARACTERS THRU THE FIRST
/	BREAK CHARACTER, REQUESTS "...FIX", AND EXITS
/	THE TASK "...FIX " PROCESSES THE REMAINDER OF THE LINE
/	AND IF THE REQUEST IS VALID, ISSUES AN APPROPRIATE "FIX"
/	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 'FIX'
/
MCRRI=171
FAC=174
X10=10
/
FIX	LAW	-7	/SET UP TO FETCH TASK NAME AND STORE
	DAC	CNT	/SIX CHARACTERS (ZERO RIGHT FILL) 
	LAC	(FIXNAM-1)
	DAC*	(X10)
/
FIXN1	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	FIXN1	/NO -- GET NEXT CHARACTER
ERR1	LAC	(MES2)	/SYNTAX ERROR
	JMP	ERRTY	/REQUEST MCR AND RETURN
/
ENDCRA	DAC	SVBKCH	/SAVE CAR RTN OR ALTMODE
FIXN2	DZM*	X10	/FILL REMAINING CHARACTERS WITH ZERO
	ISZ	CNT
	JMP	FIXN2
/
	LAC	FIXNAM+2	/FORM FIRST HALF OF TASK NAME
	LRS	6
	LAC	FIXNAM+1
	LRS	6
	LAC	FIXNAM
	SNA		/IS THIS A NULL NAME?
	JMP	ERR1	/YES EXIT WITH ERROR
	LLS	14
	DAC	FIXNAM	/STORE FIRST HALF OF WORD IN FIXNAM
	LAC	FIXNAM+5	/FORM SECOND HALF OF TASK NAME
	LRS	6
	LAC	FIXNAM+4
	LRS	6
	LAC	FIXNAM+3
	LLS	14
	DAC	FIXNAM+1
	CAL	FIXCPB	/ FIX REQUEST
	LAC	EV	/PICK UP EVENT VARIABLE
	DZM	EV	/CLEAR EVENT VARIABLE
	SMA		/WAS THERE AN ERROR?
	JMP	EXT1A	/NO EXIT
	SAD	(-201)	/YES -- TASK IN SYSTEM
	JMP	ERTTYA	/NO -- ERROR
	SAD	(-202)	/IS TASK ACTIVE?
	JMP	TSKACT	/YES ERROR
	SAD	(-204)	/DISARMED
	JMP	DISRMD	/YES -- ERROR
	SAD	(-210)	/PARTITION ACTIVE?
	JMP	PARTAC
	SAD	(-777)	/EMPTY POOL
	JMP	EMPPOL	/YES ERROR
/
/	MUST BE FIXED ERROR
FIXED	LAC	(FIXEDI)	/PRINT FIXED IN CORE ERROR MESSAGE
	JMP	ERRTY
/
TSKACT	LAC	(ACTMSG)
	JMP	ERRTY
/
DISRMD	LAC	(DISARM)
	JMP	ERRTY
/
PARTAC	LAC	(PARACT)	/PRINT PARTITION ACTIVE MESSAGE
	JMP	ERRTY
/
/
EMPPOL	LAC	(EMMSG)	/PRINT EMPTY POOL MESSAGE
	JMP	ERRTY
/
ERTTYA	LAC	(MES3)	/PRINT TASK NOT IN SYSTEM ERROR
ERRTY	DAC	TYPCPB+4	/PUT ADDRESS OF ERROR MESSAGE IN TYPE CPB
	CAL	TYPCPB	/MAKE TYPE CPB REQUEST
WAITEV	CAL	WAITF	/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
FIXCPB	15		/FIX IN CORE REQUEST
	EV		/EVENT VARIABLE ADDRESS
FIXNAM	.BLOCK	7
/
WAITF	20	/WAIT FOR EVENT VARIABLE
	EV	/EVENT VARIABLE ADDRESS
/
/
TYPCPB	2700
	EV
	3
	2
	XX
/
EV	0
/
/
MES2	2; 0; .ASCII	"FIX-SYNTAX ERR"<15>
MES3	2; 0; .ASCII	"FIX-TASK NOT IN SYSTEM"<15>
FIXEDI	2; 0; .ASCII	"FIX-TASK ALREADY FIXED"<15>
ACTMSG	2; 0; .ASCII	"FIX-TASK IS ACTIVE"<15>
DISARM	2; 0; .ASCII	"FIX-TASK DISARMED"<15>
PARACT	2; 0; .ASCII	"FIX-PARTITION IS OCCUPIED"<15>
EMMSG	2; 0; .ASCII	"FIX-EMPTY POOL"<15>
/
SVBKCH	0
CNT	0
	.END	FIX
