/ 
/ 
/                   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 #11
/
/ COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION -- PARTITION 	22 SEPT 71	R. MCLEAN
/
/ TASK NAME "...PAR" TO REQUEST A LIST OF THE
/ PARTITION BLOCK DESCRIPTION LIST.
/
/ THE FIRST LINE OF COMMAND INPUT FOR ANY MCR
/ FUNCTION IS READ BY THE RESIDENT MCR TASK
/ ("...MCR"). FOR THE "PAR" FUNCTION, THE SYNTAX
/ OF THE FIRST LINE IS:
/
/	SYNTAX = "PAR"$<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 ("...PAR"), FLUSHES CHARACTERS THRU
/ THE FIRST BREAK CHARACTER, REQUESTS "...PAR" ,
/ AND EXITS. THE TASK "...PAR" THEN DECODES THE
/ PARTITION BLOCK DESCRIPTION LIST.  IF A ^C IS TYPED WHILE
/ "...PAR" IS RUNNING A MESSAGE IS PRINTED AND
/ "...PAR" EXITS.
/
/ IF THE COMMAND INPUT LINE IS TERMINATED BY A
/ CAR RTN, THE RESIDENT MCR TASK IS REQUESTED,
/ AND THE FUNCTION PAR 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 'PARTITION LIST'
/
MCRRI=171
FAC=174
PBDL=250
X10=10
X11=11
ECLA=641000
/
PAR	CAL	ATLU2	/ATTACH TO TTY ON LUN3
	CAL	WAITEV	/WAIT FOR ATTACH TO COMPLETE
	LAC*	(PBDL)	/PICK UP PARTITION BLOCK POINTER
PBDLP	DAC*	(X11)	/SAVE POINTER IN XR11
	DAC	PBDLFD	/SAVE POINTER TO FIND END OF LOOP
	LAC	(PBDLMS+2)	/SET UP MESSAGE POINTER
	DAC*	(X10)	/IN X10
	LAW	-2	/SET UP CNT TO DECODE TWO WORDS
	DAC	CNT	/OF PARTITION NAME
	ISZ*	(X11)	/INCREMENT XR11
DECOD2	LAC*	X11	/GET A WORD AND SAVE IT IN MQ
	LMQ		/GET FIRST WORD AND SAVE IT IN MQ
	LAW	-3
	DAC	CNT1
DECOD1	ECLA!LLS 6	/PICK UP FIRST SIX BITS
	SNA		/IS A NULL CHARACTER DETECTED?
	JMP	IGNR	/YES MAKE IT A BLANK
	AAC	-40
	SPA		/IF GREATER THAN IT IS NOT ALPHA
	AAC	100	/MAKE 7 BIT ASCII
IGNR	AAC	40	/REPLACE 40
	DAC*	X10	/STORE IT IN MESSAGE
	ISZ	CNT1	/FINISHED NAME?
	JMP	DECOD1	/NO GET ANOTHER CHARACTER
	ISZ	CNT	/ARE WE FINISHED?
	JMP	DECOD2	/NO DECODE SECOND WORD
	ISZ*	(X10)	/INSERT  A SPACE
	LAW	-2	/SET UP FOR TWO PASSES THRU GET3
	DAC	CNT
BASEL	LAC*	X11	/PICK UP BASE ADDRESS
	JMS	GET3	/DECODE AND STORE 5 BIT ADDRESS IN MESSAGE
	ISZ*	(X10)	/INSERT A SPACE
	ISZ	CNT	/HAS SIZE BEEN STORED?
	JMP	BASEL	/NO DECODE IT
	CAL	TTYMSG	/YES PRINT MESSAGE
	CAL	WAITEV	/WAIT FOR OUTPUT TO COMPLETE
	LAW	-1	/CHECK TO SEE IF A
	SAD*	(MCRRI)	/^C HAS BEEN TYPED
	JMP	ABTEXT	/YES, EXIT AFTER PRINTING MESSAGE
	LAC*	PBDLFD	/GET PBDL FORWARD POINTER
	SAD	(PBDL)	/IS IT THE END OF THE LIST
	SKP		/YES EXIT
	JMP	PBDLP	/NO GO DO ANOTHER ONE
	CAL	DETTTY	/DETACH TELETYPE BEFORE EXIT
NOTCR	JMS*	(FAC)	/FLUSH OUT INPUT LINE TO FIND CAR RTN OR ALTMODE
	SAD	(015)	/IS CHARACTER A CAR RTN?
	JMP	ABTXIT	/YES EXIT
	SAD	(175)	/IS CHARACTER AN ALTMODE?
	JMP	ALTEXT	/YES EXIT
	JMP	NOTCR	/NO FETCH ANOTHER CHARACTER
ABTXIT	CAL	REQMCR	/YES -- REQUEST MCR
	JMP	ALTEND	/IS BREAK CHARACTER AN ALTMODE
ALTEXT	DZM*	(MCRRI)	/YES, CLEAR ^C INHIBIT SWITCH
ALTEND	CAL	WAITEV	/WAIT FOR DETACH
	CAL	(10)	/EXIT
/
/	ABTEXT -- EXITS IF USER TYPES A ^C 
/
ABTEXT	CAL	XITMSG
	CAL	WAITEV	/WAIT FOR MESSAGE TO PRINT
	CAL	DETTTY	/DETATCH TELETYPE
	JMP	ABTXIT	/EXIT AND CALL MCR
/
/	GET3 -- STORES ADDRESSES IN MESSAGE.
/		AC CONTAINS  THE QUANTITY TO BE PRINTED
/
GET3	0
	LMQ		/SAVE VALUE IN MQ
	LAW	-6
	DAC	CNT1	/SET UP FOR 5 BIT ADDRESS
GET3L	ECLA!LLS 3	/CLEAR AC AND GET 3 BITS
	AAC	60	/ADD 60 TO MAKE IT ASCII
	DAC*	X10	/STORE IT IN MESSAGE
	ISZ	CNT1	/HAVE WE COPIED ENOUGH YET?
	JMP	GET3L	/NO  LOOP
	JMP*	GET3	/YES RETURN
/
/	WAITEV -- WAIT FOR TTY EVENT VARRIABLE
/
WAITEV	20	/WAIT FOR
	TTYEV	/EVENT VARIABLE ADDRESS
/
ATLU2	2400	/ATTATCH TO LUN 3
	TTYEV
	3
/
DETTTY	2500	/DETATCH FROM LUN3
	TTYEV
	3
/
TTYMSG	2700	/OUTPUT MESSAGE
	TTYEV
	3
	3
	PBDLMS
/
XITMSG	2700	/EXIT MESSAGE
	TTYEV
	3
	2
	TTYABT
/
REQMCR	1		/REQUEST "...MCR" CPB
	0
	.SIXBT	"..."
	.SIXBT	"MCR"
	0
/
TTYABT	2; 0; .ASCII	"^^^ PAR ^C EXIT"<15>
PBDLMS	015003	/HEADER
	0
	.REPT	26	/BLANKS
	40
	15		/CAR RTN
	12		/LF
/	
CNT	0
CNT1	0
TTYEV	0
PBDLFD	0
	.END	PAR
