/ 
/ 
/                   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 #61
/
/ COPYRIGHT 1970,1971,1972,1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION -- TASK 	13 APR 73	R. MCLEAN
/					M. HEBENSTREIT
/
/ TASK NAME "...TAS" TO REQUEST A LIST OF THE
/ SYSTEM TASK LIST.
/
/ THE FIRST LINE OF COMMAND INPUT FOR ANY MCR
/ FUNCTION IS READ BY THE RESIDENT MCR TASK ("...MCR").
/ FOR THE "TASK" FUNCTION, THE SYNTAX OF THE FIRST LINE IS:
/
/	SYNTAX = "TAS"$<CHARACTER>(<CR>/<AM>)
/
/	<CR> = CAR RTN
/	<AM> = ALTMODE
/	$ -- ANY NUMBER OF "INCLUDING ZERO "
/
/
/ THE RESIDENT MCR READS A LINE, FETCHES THE
/ FIRST THREE CHARACTERS TO FORM THE MCR FUNCTION TASK
/ NAME ("...TAS"), FLUSHES CHARACTERS THRU THE FIRST
/ BREAK CHARACTER, REQUESTS "...TAS", AND EXITS.
/ THE TASK "...TAS" THEN DECODES THE SYSTEM TASK LIST.
/ IF A ^C IS TYPED WHILE "...TAS" IS RUNNING, A MESSAGE
/ IS PRINTED AND "...TAS" EXITS.
/
/ 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 'SYSTEM TASK LIST'
/
MCRRI=171
FAC=174
STKL=242
X10=10
X11=11
ECLA=641000
SYSDSK=301
/  
TAS	CAL	ATLU2	/ATTACH TO TTY ON LUN3
	CAL	WAITEV	/WAIT FOR COMPLETION
	LAC*	(STKL)	/GET ADDRESS OF FIRST TASK NODE
TASLP	DAC	STKLFD	/SAVE HEADER POINTER 
	IAC		/POINT TO THIRD WORD
	DAC*	(X11)	/SET UP TO PICK UP ADDRESS OF NAME
	LAC	(026000)	/RESTORE TASK MESSAGE HEADER
	AAC	+3	/SET HEADER
	DAC	TASMS
	LAC	(015)	/RESTORE CAR RTN
	DAC	TASCR
	LAC	(012)	/RESTORE LF
	DAC	TASLF
	LAC	(TASMS+2)/GET MESSAGE STARTING ADDRESS
	DAC*	(X10)	/PUT IN AUTOINDEX REGISTER
	JMS	DECODE	/DECODE AND STORE TASK NAME
	ISZ*	(X11)	/PARTITION BLOCK IS IN WORD 5
	LAC*	X11	/GET ADDRESS OF PARTITION BLOCK
	AAC	1	/SUBTRACT ONE FOR XR11
	DAC*	(X11)	/PUT IT IN XR11 FOR DECODE
	JMS	DECODE	/DECODE PARTITION BLOCK NAME
	LAC	STKLFD	/GET STL NODE ADDRESS
	AAC	3	/RESTORE XR11
	DAC*	(X11)
	LAC*	X11	/PICK UP PRIORITY FROM STL
	DAC	SAVFIX	/SAVE TO DETERMINE IF FIXED IN CORE
	AND	(1777)	/MASK OFF PRIORITY FROM FLAGS
	CLL		/CLEAR THE LINK FOR IDIV INSTRUCTION
	IDIV		/DIVIDE BY 10 TO CONVERT TO DECIMAL
	12
	AAC	60	/MAKE IT ASCII
	DAC	CNT	/SAVE IT
	LACQ	/GET DIVIDEND
	IDIV		/FIND TENS POSITION
	12
	AAC	60	/MAKE IT ASCII
	DAC	CNT1	/SAVE IT
	LACQ	/GET DIVIDEND
	IDIV		/FIND HUNDREDS POSITION
	12
	AAC	60	/MAKE IT ASCII
	DAC*	X10	/STORE IT IN MESSAGE
	LAC	CNT1	/PICK UP TENS POSITION
	DAC*	X10	/PUT IT IN MESSAGE
	LAC	CNT	/PICK UP UNITS
	DAC*	X10
	ISZ*	(X11)	/INCREMENT TO DISK ADDRESS
	ISZ*	(X10)	/SPACE SEPARATOR
	ISZ*	(X10)
	LAC*	X11	/GET DISK ADDRESS AND UNIT
	PAL		/SAVE THIS
        LAC*    (SYSDSK	/WHAT IS THE SYSTEM DEVICE?
        SAD     (2	/IS IT RF?
        JMP     RF	/YES
        PLA		/NO -- CALC. BLOCK NO. FOR RP AND RK
        AND     (777400
        LMQ
        PLA
        AND     (000377
        CLL
        LRSS    10
        JMP     GOTBLK	/BLOCK NO. IS IN MQ
RF      PLA		/CLAC. BLOCK NO. FOR RF DISK
        CLL
        AND     (000377
        ALS     12
        DAC     TEMP
        PLA
        AND     (777400
        LRS     10
        TAD     TEMP
        LMQ		/BLOCK NO. IS IN MQ
GOTBLK  DZM     CNT1
	LAW	-6	/TRANSFER 6 DIGITS OF DISK ADR
	DAC	CNT
	JMS	GET3	/STORE 5 DIGITS IN MQ
	ISZ*	(X10)	/SPACE SEPARATOR
        ISZ*    (X10
	LAC*	X11	/GET SIZE OF PROGRAM
	LRS	17	/SAVE PROGRAM SIZE FOR GET3
	LAW	-5	/5 CHARACTERS
	DAC	CNT
	DZM	CNT1	/CLEAR NUMBER OF ZERO'S SWITCH
	JMS	GET3	/STORE PROGRAM SIZE
	LAC	CNT1	/CHECK TO SEE IF SIZE IS ZERO FOR MONITOR TASKS
	SNA	
	JMP	ZEROSZ	/SIZE IS ZERO SKIP THIS NODE
	LAC	SAVFIX	/PICK UP FLAGS
	AND	(040000)	/MASK OFF FIXED IN CORE BIT
	SNA		/IS IT SET?
	JMP	OUTMSG	/NO GO PRINT MESSAGE
	LAC	(036000)	/YES-- SET UP TO PRINT FIXED IN CORE
	AAC	+3	/SET HEADER
	DAC	TASMS
	LAC	(040)	/BLANK OUT CAR RTN
	DAC	TASCR
	LAC	(050)	/BLANK OUT LF WITH (
	DAC	TASLF
OUTMSG	CAL	TTYMSG	/OUTPUT A LINE
	CAL	WAITEV	/WAIT FOR COMPLETION
ZEROSZ	LAW	-1
	SAD*	(MCRRI)	/CHECK ^C SWITCH
	JMP	ABTEXT	/EXIT IF ^C HAS BEEN REQUESTED
	LAC*	STKLFD	/GET FORWARD POINTER TO NEXT NODE
	SAD	(STKL)	/SKIP IF THERE ARE MORE NODES
	SKP		/END OF STKL EXIT
	JMP	TASLP	/GO DO ANOTHER NODE
	CAL	DETTTY	/DETACH TELETYPE
NOTCR	JMS*	(FAC)	/GET A CHARACTER
	SAD	(015)	/IS IT A CAR RTN
	JMP	ABTXIT	/EXIT CAR RTN FOUND
	SAD	(175)	/IS IT AN ALTMODE
	JMP	FNDEOF	/YES -- EXIT
	JMP	NOTCR	/NO GET ANOTHER CHARACTER
ABTXIT	CAL	REQMCR	/REQUEST MCR
	SAD	(175)	/DON'T CLEAR ^C SWITCH IF CAR RTN
FNDEOF	DZM*	(MCRRI)	/CLEAR ^C SWITCH
	CAL	WAITEV	/WAIT FOR COMPLETION
	CAL	(10)	/EXIT
ABTEXT	CAL	XITMSG	/PRINT TERMINATION MESSAGE
	CAL	WAITEV	/WAIT FOR MESSAGE TO PRINT
	CAL	DETTTY	/DETACH TELETYPE
	JMP	ABTXIT	/EXIT WITHOUT CALLING MCR
DECODE	0		/DECODE AND STORE
	LAW	-2	/DECODE TWO WORDS
	DAC	CNT
DECOD2	LAW	-3	/3 CHARACTERS PER WORD
	DAC	CNT1
	LAC*	X11	/PICK UP FIRST WORD
	LMQ
DECOD1	ECLA!LLS 6	/CLEAR AC AND GET SIX BITS
	SNA		/IS IT A NULL
	JMP	IGNR	/YES MAKE IT A SPACE
	AAC	-40	/IS IT LESS THAN 40
	SPA
	AAC	100	/NO MUST BE ALPHA
IGNR	AAC	40	/MAKE IOPS ASCII
	DAC*	X10	/STORE CHARACTER
	ISZ	CNT1	/SKIP IF THE WORD IS COMPLETE
	JMP	DECOD1	/NO GET ANOTHER CHARACTER
	ISZ	CNT	/HAVE 2 WORDS BEEN DECODED
	JMP	DECOD2	/NO DO THE NEXT ONE
	ISZ*	(X10)	/INSERT TWO SPACES
	ISZ*	(X10)
	JMP*	DECODE	/RETURN
/
/	GET3 -- ENTERED WITH NUMBER LEFT JUSTIFIED
/		IN MQ AND NUMBER OF CHARACTERS IN
/		CNT.  X10 POINTS TO INSERT LOCATION.
/
GET3	0
	ECLA!LLS 3	/PICK UP THREE BITS
	SZA		/IS IT A ZERO?
	ISZ	CNT1	/NO SET SIZE FLAG
	AAC	60	/MAKE IT IMAGE ASCII
	DAC*	X10	/STORE IT IN MESSAGE
	ISZ	CNT	/FINISHED ?
	JMP	GET3+1	/NO DO NEXT CHARACTER
	JMP*	GET3	/YES RETURN
/
WAITEV	20
	TTYEV
/
ATLU2	2400		/ATTACH TO LUN-3
	TTYEV
	3
/
DETTTY	2500		/DETACH FROM LUN-3
	TTYEV
	3
/
TTYMSG	2700		/TASK MESSAGE
	TTYEV
	3
	3
	TASMS
/
XITMSG	2700
	TTYEV		/ABORT MESSAGE
	3
	2
	TTYABT
/
REQMCR	1		/REQUEST "...MCR" CPB
	0
	.SIXBT	"...MCR"
	0
/
TTYABT	2; 0; .ASCII "^^^ TAS ^C EXIT"<15>
TASMS	025003		/HEADER
	000000
	.REPT	50
	40
TASCR	15		/CR
TASLF	12		/LF
	106	/F
	111	/I
	130	/X
	105	/E
	104	/D
	040	/SP
	111	/I
	116	/N
	040	/SP
	103	/C
	117	/O
	122	/R
	105	/E
	051	/)
	015	/CR
	012	/LF
/	STORAGE
CNT	0
CNT1	0
SAVFIX	0
STKLFD	0
TTYEV	0
TEMP    0
	.END	TAS
