	.TITLE	TSR.NN - TERMINAL SERVICE ROUTINE
/
/   5 OCT 76 (003; PDH) ONLY REQUEST SELF AFTER 'EDIT'
/  28 SEP 76 (PDH) DON'T REQUEST SELF AFTER REQUESTING 'QUE'
/  21 SEP 76 (PDH) UPDATE FROM PROVIDED VERSION
/
/NN=0
	.DEC
LUN=30+NN		/ TT0
	.OCT
/
/ 
/ 
/                   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
/	USER COMMAND DISPATCH FOR RSX PLUS III
/	EDIT #1  G. COLE  7/16/73
/	THIS TASK MUST BE ASSEMBLED WITH THE LUN NUMBER TO
/	BE USED FOR  I/O  FORMAT IS LUN=NN
/
/	TASK PRINTS 
/		RSX III
/		.
/
/	READS IN 4 CHAR IN IMAGE MODE
/	REQUEST TASK NAMED  CCC.XX AT PRIORITY OF 144(10)
/	IF ERROR, PRINT A MESSAGE
/	IF OK, RE-REQUEST SELF AT PRIORITY OF 194(10)
/	THE .XX IS GOTTEN FORM THE NAME ASSIGNED TO THIS TASK
/
/
	.EJECT
	.IFUND	LUN
	.END	LUN MUST BE DEFINED AS TTY LUN #
	.ENDC
START	CAL	WRSX
	CAL	WAIT		/PRINT RSX III AND WAIT
RSET	CAL	WRHASH
	CAL	WAIT		/PRINT HASH MARK (#) AND WAIT
	CAL	RCMD
	CAL	WAIT		/READ THREE CHAR COMMAND AND WAIT
	CLQ
	LAC	C1
	AND	(77)
	LLS	6
	DAC	WNAM
	LAC	C2
	AND	(77)
	TAD	WNAM
	LLS	6
	DAC	WNAM
	LAC	C3
	AND	(77)
	TAD	WNAM
	DAC	WNAM		/ WORD IS FORMED IN 'WNAME'
	SAD	EXI		/ IS IT THE 'EXIT' COMMAND?
	CAL	EXIT		/ YES.  GO AWAY
/
	CAL	RTSK		/ GET SECOND HALF OF TASK NAME
	CAL	WAIT
	LAC	RTSK+3
	DAC	WNAM+1
	CAL	WTSK	/CALL THE DESIRED TASK
	CAL	WAIT
	LAC	EV
	SMA
	JMP	TOK
	CAL	WERR
	CAL	WAIT
	JMP	RSET
	.EJECT
TOK	LAC	RTSK+2
	DAC	REQTK
	LAC	RTSK+3
	DAC	REQTK2
	CAL	RCRLF
	CAL	WAIT
	LAC	WNAM
	SAD	EDI		/ ONLY IF THE REQUESTED TASK IS
	SKP			/ 'EDI' DO WE POSSIBLY REQUEST OURSELVES
	CAL	EXIT
	LAC	C4
	SAD	(175)
	CAL	EXIT
	CAL	REQSLF
	CAL	EXIT
/
/
EDI	.SIXBT	'EDI'
EXI	.SIXBT	'EXI'
	.EJECT
	
WRSX	2700
	EV
	LUN
	2
	.+1
	003002
	0
	.ASCII	<21>'XVM/RSX'<15>
WAIT	20
	EV
EV	0
RCRLF	2700
	EV
	LUN
	3
	.+2
	4
	002003
	0
	12
	15
WRHASH	2700
	EV
	LUN
	3
	.+1
	002003
	0
	12
	43
RCMD	2600
	EV
	LUN
	3
	RMSG
	6
RMSG	000003
	0
C1	0
C2	0
C3	0
C4	0
RTSK	25
	EV
	0
	0
WTSK	1
	EV
WNAM	0
	0
	200
WERR	2700
	EV
	LUN
	2
	.+1
	007002
	0
	.ASCII / -- TASK NOT AVAILABLE/<015>
REQSLF	3
	EV
REQTK	0
REQTK2	0
	5
	1
	0
	0
	250
EXIT	10
	.END
