	.SYSID <	.TITLE DOS >,< RESIDENT MONITOR>	/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ COPYRIGHT (C) 1975						/EAG:191

/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.			/EAG:191

/								/EAG:191

/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY	/EAG:191

/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH	/EAG:191

/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS		/EAG:191

/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-	/EAG:191

/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON		/EAG:191

/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO	/EAG:191

/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE		/EAG:191

/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.			/EAG:191

/								/EAG:191

/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE		/EAG:191

/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-		/EAG:191

/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.			/EAG:191

/								/EAG:191

/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY	/EAG:191

/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.	/EAG:191

/								/EAG:191
	.TITLE EDIT NUMBERS AND HISTORY
/  THE XVM/DOS RESIDENT MONITOR --
/  WRITTEN BY EDWARD A. GARDNER
/  AND R. KENT BLACKETT, ET. AL.

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ 191	3-JUN-75	EAG	INITIAL XVM/DOS RESIDENT	/EAG:191

/				MONITOR.  DOES NOT INCLUDE	/EAG:191

/				BATCH, BOSS, CTRL-X, CLOCK	/EAG:191

/				ROUTINES, OR STUFF TO HANDLE	/EAG:191

/				^P, ^C, ETC.  DOESN'T HAVE	/EAG:191

/				GET/PUT OR ^Q EITHER.  CODE	/EAG:191

/				FOR SOME OF THIS EXISTS BUT	/EAG:191

/				IS INOPERATIVE.  THIS VERSION	/EAG:191

/				ALSO REQUIRES API.		/EAG:191

/								/EAG:191

/ 192	15-JUL-75	EAG	FIX SEVERAL PROBLEMS IN 191.	/EAG:192

/				MAKE ^P, ^C, ETC. WORK (NOT ^Q)	/EAG:192

/				ALSO MAKE IOPS ERROR ROUTINES	/EAG:192

/				WORK.				/EAG:192

/								/EAG:192

/ 193	30-JUL-75	EAG	FIX SEVERAL PROBLEMS IN 192.	/EAG:193

/				ADD VT15 (CTRL-X) CODE BACK	/EAG:193

/				INTO MONITOR.  ADD MINI-ODT.	/EAG:193

/				DELETE UC15 CONDITIONALS AND	/EAG:193

/				MAKE UC15 ON/OFF DETERMINATION	/EAG:193

/				DYNAMIC.  ADD FEATURE WHEREBY	/EAG:193

/				PROGRAMS RUN WITH MEMORY LIMIT	/EAG:193

/				CHECKING, SO ALL REFERENCES	/EAG:193

/				OUTSIDE OF MEMSIZ WILL BE	/EAG:193

/				TRAPPED (%PRTCT).  SPLIT RESMON	/EAG:193

/				INTO TWO FILES -- RESMNA AND	/EAG:193

/				RESMNB.				/EAG:193

/								/EAG:193

/ 194	13-AUG-75	EAG	FIX SEVERAL PROBLEMS IN 193.	/EAG:194

/				ADD CLOCK ROUTINES AND		/EAG:194

/				UNICHANNEL POLLER.		/EAG:194

/								/EAG:194

/ 195	18-AUG-75	EAG	MAKE HALT AND QDUMP NON-RES.	/EAG:195

/				MONITOR COMMANDS WORK.  FIX	/EAG:195

/				BUGS IN HANDLING OF .DAT WITH	/EAG:195

/				KEEP ON.  THESE BUGS ARE	/EAG:195

/				ESPECIALLY NOTICEABLE WITH	/EAG:195

/				BATCH.  ADD NON-API (API OFF)	/EAG:195

/				CODE.  CAUSE A STOP ALL TASKS	/EAG:195

/				TCB TO BE ISSUED WHENEVER	/EAG:195

/				APPROPRIATE.			/EAG:195

/								/EAG:195

/ 196	5-SEP-75	EAG	INTEGRATE BATCH (NON-BOSS)	/EAG:196

/				WHICH WAS DONE INDEPENDENTLY	/EAG:196

/				BY KENT BLACKETT.		/EAG:196

/				ALSO DELETE MANY UNUSED LABELS.	/EAG:196

/								/EAG:196

/ 197	25-SEP-75	EAG	CHANGE TCB CONDITIONALS SO THAT	/EAG:197

/				THE DEFAULT (FOR MOST TCB'S) IS	/EAG:197

/				THAT THEY ARE NOT GENERATED,	/EAG:197

/				RATHER THAN THE DEFAULT BEING	/EAG:197

/				ALL TCB'S PRESENT.  ADD DL AND	/EAG:197

/				LV TCB'S.  ADD .GET/.PUT/^Q.	/EAG:197

/								/RKB-198

/ 198	01-OCT-75	RKB	INTEGRATE BOSS RESIDENT CODE 	/RKB-198

/				WHICH WAS DEVELOPED INDEPEN-	/RKB-198

/				DENTLY.  ALSO ELIMINATED THE 	/RKB-198

/				FAMOUS "BOSS JIGGLES" BUG.	/RKB-198

/				ALSO SHORTEN SOME INITIALIZA-	/RKB-198

/				TION ERROR MESSAGES.  A FEW	/RKB-198

/				OPERATIONAL CHANGES TO BATCH	/RKB-198

/				WERE MADE.			/RKB-198

/								/RKB-198

/ 199	04-OCT-75	EAG	SHORTEN RESMON BY MOVING THE	/EAG:199

/				REST OF THE SYSTEM LOADER INTO	/EAG:199

/				.SYSLD.  THE CODE WHICH SETS	/EAG:199

/				UP THE OVERLAY TABLE, FILE	/EAG:199

/				BUFFERS, I/O CONFIGURATION	/EAG:199

/				TABLE, ETC. IS NOW IN .SYSLD.	/EAG:199

/				THIS AND LATER VERSIONS OF	/EAG:199

/				RESMON REQUIRE VERSION 058 OR	/EAG:199

/				LATER OF .SYSLD.		/EAG:199

/								/EAG:199

/ 200	07-OCT-75	EAG	IMPLEMENT .DAT SLOT TRANSLATION	/EAG:200

/				(CM AND SY DEVICES) FOR BATCH	/EAG:200

/				AND BOSS.			/EAG:200

/								/EAG:200
/ 201	09-OCT-75	EAG	FIX SEVERAL BUGS WHICH HAVE	/EAG:201
/				BEEN AROUND FOR AWHILE.		/EAG:201
/								/EAG:201
/ 202	11-OCT-75	RKB	FIX A BOSS/ERROR PROCESSOR	/RKB-202
/				INTERACTION PROBLEM.		/RKB-202
/								/RKB-202
/ 203	13-OCT-75	RKB	ADD CHECK IN IN.HWA FOR THE	/RKB-203
/				"REENTRANCY ECO PKGE".  ALSO,	/RKB-203
/				MAKE IT SO THAT .XVMOFF CAL IS	/RKB-203
/				IS OK EVEN IF NO XM15. ALSO,	/RKB-203
/				IF ANY INITIALIZATION-TIME MSGS	/RKB-203
/				ARE TYPED ON TTY W/VT ON, DO A	/RKB-203
/				CR/LF ON TTY.			/RKB-203
/								/RKB-203
/ 204	15-OCT-75	RKB	FIX BATCH SO THAT A ^T WILL	/RKB-204
/				NOT CAUSE AN IOPS 11 IF ^T IS	/RKB-204
/				STRUCK WHILE THERE IS NO BATCH	/RKB-204
/				HANDLER IN CORE, I.E. WHILE	/RKB-204
/				.SYSLD IS RUNNING.		/RKB-204
/								/RKB-204
/ 205	10-NOV-75	RKB	INSERT NEW BATCH .SCOMS		/RKB-205
/				FIX BUG IN RES. BOSS RE: .WAIT	/RKB-205
/				TO TTY NOT EVER RUNNING AT	/RKB-205
/				MAINSTREAM API LEVEL.		/RKB-205
/								/RKB-205
/ 206	11-NOV-75	RKB	FIX FOUR LITTLE BUGS: TRANSLATE	/RKB-206
/				'SYS' TO 'PAG' OR 'BNK' IN	/RKB-206
/				.USER'S; MAKE THE BATCH '$JOB	/RKB-206
/				HOLDOFF' WORK FOR PR AND CD;	/RKB-206
/				TRIM FULL WORD PAIRS OF BLANKS	/RKB-206
/				FROM THE END OF BATCH COMMANDS;	/RKB-206
/				STOP THE BATCH JIGGLES.		/RKB-206
/								/RKB-206
/ 207	11-NOV-75	RKB	FIX PROBLEM IN 206 RE: .USER'S	/RKB-207
/				RECALL THAT MIC NEED NOT BE SYS	/RKB-207
/				ADD TOMORROWS DATE FOR MIDNIGHT	/RKB-207
/				CHANGING.  ALSO DO PROMPTING	/RKB-207
/				AFTER $PAUSE IN BATCH, SIMILAR	/RKB-207
/				TO LOGW FUNCTION.		/RKB-207
/								/RKB-207
/ 208	11-NOV-75	RKB	FIX A POLLER BUG, CAUSE 'PRX 4'	/RKB-208
/				MESSAGE TO BE OUTPUT LESS OFTEN	/RKB-208
/				ADD IOPS 35 ERROR DETECTION.	/RKB-208
/				MAKE PHYSICAL MEM SIZE SAME AS	/RKB-208
/				BOOTSTRAP ADDRESS FOR NON-XVM	/RKB-208
/				SYSTEMS.  ALL CODE FOR THESE	/RKB-208
/				BUGS WAS WRITTEN BY ED GARDNER	/RKB-208
/								/RKB-208
/ 208	13-NOV-75	RCHM	INSERT IOPS67 TESTS INTO TTA.	/RCHM-209
/								/RCHM-209
/ 210	17-NOV-75	RKB	MULTIPLE BUG FIXES: TO CAL HAN-	/RKB-210
/				DLER IN NON-API CASE DON'T	/RKB-210
/				INTERRUPTS INHIBITED.		/RKB-210
/				TO IO.WAT:  LET IN.DT2 SET .DAT	/RKB-210
/				-3 .WAIT CASE, RATHER THAN	/RKB-210
/				USING SPACE IN THE 'NUCLEUS'	/RKB-210
/				FOR THE TEST.			/RKB-210
/				REMOVED EDIT MARKERS FROM A	/RKB-210
/				COUPLE OF .TITLES.		/RKB-210
/				CHANGE TO BA.PAU TO REMOVE BIT	/RKB-210
/				0 FROM THE BUFFER ADDR. OF A 	/RKB-210
/				.WRITE.				/RKB-210
/				CHANGE BATCH EXEC TO DECODE A	/RKB-210
/				.INIT TO 'CM' AND RETURN BUF	/RKB-210
/				SIZE OF 42(8) AS TTY WOULD	/RKB-210
/				ALSO SETUP ^P,^T, OR ^C ADDRESS	/RKB-210
/				AS PER USERS .INIT.		/RKB-210
/				MOVE THE TEST FOR INITIALIZA-	/RKB-210
/				TION-TIME MESSAGES FROM IN.VT	/RKB-210
/				TO IN.GO TO ALWAYS DO CR/LF	/RKB-210
/				PRIOR TO STARTUP IF MESSAGES	/RKB-210
/				HAVE BEEN TYPED VIA IN.CHR, 	/RKB-210
/				AND FRIENDS.			/RKB-210
/								/RKB-210
/ 211	21-NOV-75	EAG	FIX BUG IN BOSS INTRODUCED BY	/EAG:211
/				EDIT 210.			/EAG:211
/								/EAG:211
/ 212	26-NOV-75	RKB	FIX RES BOSS TO RETURN MAX.	/RKB-212
/				BUFFER SIZE ON .INIT		/RKB-212
/								/RKB-212
/ 213	26-NOV-75	EAG	FIX A BUG IN .PUT.  HAD OVER-	/EAG:213
/				LOOKED THE FACT THAT .PUT	/EAG:213
/				ISSUES NESTED CAL'S, AND	/EAG:213
/				THUS CL.RET GETS CLOBBERED.	/EAG:213
/								/EAG:213
	.TITLE CONDITIONAL ASSEMBLY PARAMETERS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:197

/ THE FOLLOWING SYMBOL IS NOT A CONDITIONAL PARAMETER.		/EAG:197

/ RATHER, IT IS DESIGNED TO INDICATE THE NUMBER OF THE		/EAG:197

/ CURRENT ASSEMBLY PASS (1 FOR PASS ONE OR 2 FOR PASS TWO).	/EAG:197

/ SOME OF THE CONDITIONALIZATIONS BELOW REQUIRE KNOWLEDGE	/EAG:197

/ OF WHICH PASS IT IS.						/EAG:197

/								/EAG:197

								/EAG:197

	.IFUND .PASS.						/EAG:197

.PASS.=0							/EAG:197

	.ENDC							/EAG:197

								/EAG:197

.PASS.=.PASS.+1							/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:193

/ DEFINE %HALTS=0 TO INCLUDE CODE TO PERFORM VARIOUS INTERNAL	/EAG:193

/ CONSISTENCY CHECKS AND HALT IF SOMETHING WRONG IS DETECTED.	/EAG:193

/ %DEBUG=0 IMPLIES %HALTS=0.					/EAG:193

/								/EAG:193

/ DEFINE %ODT=0 TO INCLUDE A MINI-ODT WHICH WILL BE INVOKED	/EAG:193

/ ON IOPS ERRORS AND BY ^T (UNTIL ^T IS WIRED (BY .INIT TO	/EAG:193

/ TTA.) TO SOME OTHER LOCATION, SUCH AS DDT).  %DEBUG=0		/EAG:193

/ IMPLIES %ODT=0.						/EAG:193

/								/EAG:193

/ DEFINE %PRTCT=0 TO HAVE ALL PROGRAMS (EXCEPT I/O HANDLERS,	/EAG:193

/ CAL ROUTINES, AND INTERRUPT ROUTINES) RUN WITH MEMORY LIMIT	/EAG:193

/ CHECKING SO AS TO TRAP ALL REFERENCES OUTSIDE OF MEMSIZ.	/EAG:193

/ %DEBUG=0 IMPLIES %PRTCT=0.					/EAG:193

/								/EAG:193

/ DEFINE %DEBUG=0 TO INCLUDE ALL OF THE ABOVE.			/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

	.IFDEF %DEBUG						/EAG:193

%HALTS=0							/EAG:193

%ODT=0								/EAG:193

%PRTCT=0							/EAG:193

	.ENDC							/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ PARAMETERS CONTROLLING UNICHANNEL TCB AREA:			/EAG:193

/								/EAG:193

/ THE FOLLOWING PARAMETERS CONTROL THE ALLOCATION OF SPACE	/EAG:193

/ FOR THE UNICHANNEL TCB AREA.  THE UNICHANNEL TCB AREA IS	/EAG:193

/ ALLOCATED BY THE ROUTINE IN.UC15 WHENEVER UC15 IS ON.  EACH	/EAG:193

/ PARAMETER SPECIFIES THE LENGTH OF ONE OF THE TCB'S TO BE	/EAG:193

/ INCLUDED IN THE AREA.  THE TCB AREA CONSISTS OF A TABLE OF	/EAG:193

/ TRANSFER VECTORS TO THE TCB'S PLUS THE TCB'S THEMSELVES.	/EAG:197

/ IF A PARTICULAR TCB HAS NOT BEEN ALLOCATED THAT TCB'S		/EAG:197

/ TRANSFER VECTOR WILL CONTAIN ZERO.  THE TCB AREA WILL		/EAG:197

/ ALWAYS BE WITHIN THE FIRST 4K OF MEMORY.  .SCOM LOCATION	/EAG:197

/ SC.TCB POINTS TO THE TRANSFER VECTOR TABLE, OR ELSE		/EAG:197

/ CONTAINS ZERO IF THE TCB AREA HAS NOT BEEN ALLOCATED.		/EAG:197

/								/EAG:197

/ EACH TCB HAS A DEFAULT LENGTH.  DEFINING THE APPROPRIATE	/EAG:197

/ PARAMETER EQUAL TO ZERO CAUSES THE DEFAULT LENGTH TO		/EAG:197

/ APPLY.  DEFINING THE PARAMETER EQUAL TO A NON-ZERO VALUE	/EAG:197

/ CAUSES THAT VALUE TO BE USED AS THE LENGTH OF THE TCB.	/EAG:197

/ LEAVING THE PARAMETER UNDEFINED WILL, IN MOST CASES,		/EAG:197

/ SUPPRESS GENERATION OF THAT TCB.  THE RK AND LP TCB'S		/EAG:197

/ WILL, HOWEVER, ALWAYS BE GENERATED AS THEIR PRESENCE IS	/EAG:197

/ REQUIRED BY VARIOUS PIECES OF SYSTEM SOFTWARE.		/EAG:197

/								/EAG:197

/ IF A NON-STANDARD (NON-DEFAULT) TCB LENGTH IS USED CARE	/EAG:197

/ MUST BE TAKEN THAT PROGRAMS USING THAT TCB ARE AWARE OF	/EAG:197

/ ITS NON-STANDARD LENGTH.  THE PARAMETERS HERE ONLY AFFECT	/EAG:197

/ THE SPACE ALLOCATED FOR THE TCB'S, AND ARE NOT COMMUNICATED	/EAG:197

/ TO ANY OTHER PROGRAMS.					/EAG:197

/								/EAG:197

/ A TABLE OF TCB PARAMETERS, THE DEVICES TO WHICH THEY		/EAG:197

/ APPLY, AND THEIR DEFAULT LENGTHS IS GIVEN BELOW.  THOSE	/EAG:197

/ TCB'S FLAGGED WITH AN ASTERISK ("*") WILL ALWAYS BE		/EAG:197

/ GENERATED, WHEREAS THE OTHER TCB'S WILL NOT BE GENERATED	/EAG:197

/ IF THEIR PARAMETER IS LEFT UNDEFINED.  THE DEFAULT LENGTHS	/EAG:197

/ ARE GIVEN AS AN OCTAL NUMBER OF WORDS.			/EAG:197

/								/EAG:197

/   PARAMETER  LENGTH	    DEVICE				/EAG:197

/								/EAG:197

/   *	RKTCB	 21	CARTRIDGE DISK	(ALWAYS GENERATED)	/EAG:197

/   *	LPTCB	117	LINE PRINTER	(ALWAYS GENERATED)	/EAG:197

/	CDTCB	 65	CARD READER				/EAG:197

/	PLTCB	117	XY (INCREMENTAL) PLOTTER		/EAG:197

/	TCB1	 24	SPARE TCB #1				/EAG:197

/	TCB2	120	SPARE TCB #2				/EAG:197

/	TCB3	170	SPARE TCB #3				/EAG:197

/	LVTCB	120	PRINTER/PLOTTER (ELECTROSTATIC)		/EAG:197

/	DLTCB	 54	COMMUNICATIONS (DL11)			/EAG:197

/								/EAG:197

/ IN ADDITION TO THE PARAMETERS LISTED ABOVE, THE PARAMETER	/EAG:197

/ "ALLTCB" IS PROVIDED AS A CONVENIENCE.  IF ALLTCB IS DEFINED	/EAG:197

/ THEN ALL THE TCB'S WILL BE GENERATED AND HAVE THEIR DEFAULT	/EAG:197

/ LENGTHS.  DEFINING ALLTCB IS EQUIVALENT TO SETTING EACH OF	/EAG:197

/ THE PARAMETERS LISTED ABOVE TO ZERO.				/EAG:197

/								/EAG:197

/ IMMEDIATELY BELOW ARE THE CONDITIONALS WHICH DECIPHER		/EAG:197

/ ALL THIS.  NOTE THAT THEY ARE ONLY INVOKED DURING PASS	/EAG:197

/ ONE.  AFTER THEY HAVE BEEN INVOKED, EACH OF THE PARAMETERS	/EAG:197

/ LISTED ABOVE WILL HAVE BEEN SET EQUAL TO THE LENGTH OF	/EAG:197

/ ITS TCB.  IF THE TCB IS NOT TO BE GENERATED THE PARAMETER	/EAG:197

/ WILL HAVE BEEN SET TO ZERO.					/EAG:197

/								/EAG:197

								/EAG:197

	.IFZER .PASS.-1		/ PASS 1 ONLY			/EAG:197

								/EAG:197

	.IFDEF ALLTCB		/ CHECK IF ALL TCB'S WANTED	/EAG:197

RKTCB=0				/ SET EACH PARAMETER TO ZERO	/EAG:197

LPTCB=0				/ WHICH WILL CAUSE THAT TCB	/EAG:197

CDTCB=0				/ TO BE GENERATED.		/EAG:197

PLTCB=0								/EAG:197

TCB1=0								/EAG:197

TCB2=0								/EAG:197

TCB3=0								/EAG:197

LVTCB=0								/EAG:197

DLTCB=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFUND RKTCB		/ CARTRIDGE DISK		/EAG:197

RKTCB=0								/EAG:197

	.ENDC							/EAG:197

	.IFZER RKTCB						/EAG:197

RKTCB=21							/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFUND LPTCB		/ LINE PRINTER			/EAG:197

LPTCB=0								/EAG:197

	.ENDC							/EAG:197

	.IFZER LPTCB						/EAG:197

LPTCB=117							/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF CDTCB		/ CARD READER			/EAG:197

	.IFZER CDTCB						/EAG:197

CDTCB=65							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND CDTCB						/EAG:197

CDTCB=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF PLTCB		/ XY PLOTTER			/EAG:197

	.IFZER PLTCB						/EAG:197

PLTCB=117							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND PLTCB						/EAG:197

PLTCB=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF TCB1		/ SPARE TCB #1			/EAG:197

	.IFZER TCB1						/EAG:197

TCB1=24								/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND TCB1						/EAG:197

TCB1=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF TCB2		/ SPARE TCB #2			/EAG:197

	.IFZER TCB2						/EAG:197

TCB2=120							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND TCB2						/EAG:197

TCB2=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF TCB3		/ SPARE TCB #3			/EAG:197

	.IFZER TCB3						/EAG:197

TCB3=170							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND TCB3						/EAG:197

TCB3=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:297

	.IFDEF LVTCB						/EAG:197

	.IFZER LVTCB						/EAG:197

LVTCB=120							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND LVTCB						/EAG:197

LVTCB=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFDEF DLTCB		/ COMMUNICATIONS TCB		/EAG:197

	.IFZER DLTCB						/EAG:197

DLTCB=54							/EAG:197

	.ENDC							/EAG:197

	.ENDC							/EAG:197

	.IFUND DLTCB						/EAG:197

DLTCB=0								/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.ENDC							/EAG:197

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ NOW WE WILL GENERATE SOME FANCY .TITLE STATEMENTS		/EAG:191

/ WHICH WE WON'T BOTHER LISTING					/EAG:191

/								/EAG:191

								/EAG:191

	.NOLST							/EAG:191

								/EAG:193

	.IFDEF %HALTS

	.TITLE     INCLUDES CODE TO PERFORM VARIOUS CONSISTENCY

	.TITLE         CHECKS AND HALT IF A PROBLEM IS

	.TITLE         ENCOUNTERED.

	.ENDC							/EAG:193

								/EAG:193

	.IFDEF %ODT						/EAG:193

	.TITLE     INCLUDES MINI-ODT

	.ENDC							/EAG:193

								/EAG:193

	.IFDEF %PRTCT						/EAG:193

	.TITLE     INCLUDES MEMSIZ VIOLATION CHECKING FEATURE.

	.TITLE         MEMORY LIMIT CHECKING HARDWARE WILL BE

	.TITLE         USED TO TRAP PROGRAMS WHICH ACCESS

	.TITLE         LOCATIONS ABOVE MEMSIZ.

	.ENDC							/EAG:193

								/EAG:191

								/EAG:191

								/EAG:191

	.DEFIN INSNUM NUM,LINBEG,LINEND				/EAG:193

								/EAG:193

	    .DEFIN REDEFN BEGIN,END				/EAG:193

								/EAG:193

	        .DEFIN ADDDIG					/EAG:193

								/EAG:193

	            .IFNZR .X					/EAG:193

								/EAG:193

	                .IFZER .X&7-0				/EAG:193

	                    REDEFN <BEGIN@0>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-1				/EAG:193

	                    REDEFN <BEGIN@1>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-2				/EAG:193

	                    REDEFN <BEGIN@2>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-3				/EAG:193

	                    REDEFN <BEGIN@3>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-4				/EAG:193

	                    REDEFN <BEGIN@4>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-5				/EAG:193

	                    REDEFN <BEGIN@5>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-6				/EAG:193

	                    REDEFN <BEGIN@6>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	                .IFZER .X&7-7				/EAG:193

	                    REDEFN <BEGIN@7>,<END>		/EAG:193

	                .ENDC					/EAG:193

								/EAG:193

	            .ENDC					/EAG:193

								/EAG:193

	        .ENDM						/EAG:193

								/EAG:193

	    .ENDM						/EAG:193

								/EAG:193

	    REDEFN <LINBEG>,<LINEND>				/EAG:193

								/EAG:193

.X=NUM/100000							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

.X=NUM/10000							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

.X=NUM/1000							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

.X=NUM/100							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

.X=NUM/10							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

	    .DEFIN REDEFN BEGIN,END				/EAG:193

BEGIN@END							/EAG:193

	    .ENDM						/EAG:193

								/EAG:193

.X=NUM/1!100							/EAG:193

	    ADDDIG						/EAG:193

								/EAG:193

	.ENDM							/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

	.IFZER RKTCB						/EAG:193

	.TITLE     DOES NOT INCLUDE AN RK DISK TCB.

	.ENDC							/EAG:193

	.IFNZR RKTCB						/EAG:193

	INSNUM RKTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD RK DISK TCB.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER LPTCB						/EAG:193

	.TITLE     DOES NOT INCLUDE A LINE PRINTER TCB.

	.ENDC							/EAG:193

	.IFNZR LPTCB						/EAG:193

	INSNUM LPTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD LINE PRINTER TCB.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER CDTCB						/EAG:193

	.TITLE     DOES NOT INCLUDE A CARD READER TCB.

	.ENDC							/EAG:193

	.IFNZR CDTCB						/EAG:193

	INSNUM CDTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD CARD READER TCB.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER PLTCB						/EAG:193

	.TITLE     DOES NOT INCLUDE AN XY PLOTTER TCB.

	.ENDC							/EAG:193

	.IFNZR PLTCB						/EAG:193

	INSNUM PLTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD XY PLOTTER TCB.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER TCB1						/EAG:193

	.TITLE     DOES NOT INCLUDE SPARE TCB #1

	.ENDC							/EAG:193

	.IFNZR TCB1						/EAG:193

	INSNUM TCB1,<	.TITLE     INCLUDES >,< (OCTAL) WORD SPARE TCB #1.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER TCB2						/EAG:193

	.TITLE     DOES NOT INCLUDE SPARE TCB #2.

	.ENDC							/EAG:193

	.IFNZR TCB2						/EAG:193

	INSNUM TCB2,<	.TITLE     INCLUDES >,< (OCTAL) WORD SPARE TCB # 2.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER TCB3						/EAG:193

	.TITLE     DOES NOT INCLUDE SPARE TCB #3.

	.ENDC							/EAG:193

	.IFNZR TCB3						/EAG:193

	INSNUM TCB3,<	.TITLE     INCLUDES >,< (OCTAL) WORD SPARE TCB #3.>	/EAG:193

	.ENDC							/EAG:193

								/EAG:193

	.IFZER LVTCB						/EAG:197

	.TITLE     DOES NOT INCLUDE A PRINTER/PLOTTER TCB

	.ENDC							/EAG:197

	.IFNZR LVTCB						/EAG:197

	INSNUM LVTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD PRINTER/PLOTTER TCB.>	/EAG:197

	.ENDC							/EAG:197

								/EAG:197

	.IFZER DLTCB						/EAG:197

	.TITLE     DOES NOT INCLUDE A COMMUNICATIONS TCB

	.ENDC							/EAG:197

	.IFNZR DLTCB						/EAG:197

	INSNUM DLTCB,<	.TITLE     INCLUDES >,< (OCTAL) WORD COMMUNICATIONS TCB.>	/EAG:197

	.ENDC							/EAG:197

								/EAG:197

								/EAG:193

								/EAG:193

	.LST							/EAG:193

	.TITLE HARDWARE IOT AND CONSTANT DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ CPU OR INTERNAL IOTS						/EAG:191

								/EAG:191

.INH=705522	/ DISABLE BREAKS				/EAG:191

.ENB=705521	/ ENABLE BREAKS					/EAG:191

DBR=703344	/ DEBREAK AND RESTORE				/EAG:191

RES=707742	/ RESTORE					/EAG:191

DBK=703304	/ DEBREAK					/EAG:191

IOF=700002	/ TURN INTERRUPT OFF				/EAG:191

ION=700042	/ TURN INTERRUPT ON				/EAG:191

CAF=703302	/ CLEAR FLAGS					/EAG:191

SBA=707761	/ SKIP IF BANK ADDRESSING MODE			/EAG:193

								/EAG:191

								/EAG:191

/ KA15 AUTOMATIC PRIORITY INTERRUPT (API) IOTS			/EAG:191

								/EAG:191

ISA=705504	/ INITIATE SELECTED ACTIVITY			/EAG:191

RPL=705512	/ LOAD PRIORITY LEVELS INTO AC			/EAG:191

								/EAG:191

/ DEFINE BIT FLAGS WITHIN API STATUS WORD.  ALL FLAGS HAVE THE	/EAG:191

/ "ON" BIT SET, BECAUSE ISA REQUIRES IT BE SO OR ELSE API WILL	/EAG:191

/ BE TURNED OFF.						/EAG:191

								/EAG:191

API.ON=400000	/ API ENABLE BIT				/EAG:191

API.R4=404000	/ REQUEST SOFTWARE LEVEL 4			/EAG:191

API.R5=402000	/ REQUEST SOFTWARE LEVEL 5			/EAG:191

API.R6=401000	/ REQUEST SOFTWARE LEVEL 6			/EAG:191

API.R7=400400	/ REQUEST SOFTWARE LEVEL 7			/EAG:191

API.L0=400200	/ PRIORITY LEVEL 0 ACTIVE			/EAG:191

API.L1=400100	/ PRIORITY LEVEL 1 ACTIVE			/EAG:191

API.L2=400040	/ PRIORITY LEVEL 2 ACTIVE			/EAG:191

API.L3=400020	/ PRIORITY LEVEL 3 ACTIVE			/EAG:191

API.L4=400010	/ PRIORITY LEVEL 4 ACTIVE			/EAG:191

API.L5=400004	/ PRIORITY LEVEL 5 ACTIVE			/EAG:191

API.L6=400002	/ PRIORITY LEVEL 6 ACTIVE			/EAG:191

API.L7=400001	/ PRIORITY LEVEL 7 ACTIVE			/EAG:191

								/EAG:191

								/EAG:191

/ KW15 REAL-TIME CLOCK						/EAG:191

								/EAG:191

CLSF=700001	/ SKIP ON CLOCK FLAG				/EAG:191

CLOF=700004	/ CLEAR FLAG AND DISABLE CLOCK			/EAG:191

CLON=700044	/ CLEAR FLAG AND ENABLE CLOCK			/EAG:191

KW.API=51	/ CLOCK API VECTOR ADDRESS			/EAG:191

								/EAG:191

								/EAG:191

/ CONSOLE TELETYPE KEYBOARD					/EAG:191

								/EAG:191

KSF=700301	/ SKIP ON KEYBOARD FLAG				/EAG:191

KRB=700312	/ CLEAR FLAG AND READ KEYBOARD TO AC		/EAG:191

KRS=700332	/ CLEAR FLAG, READ KEYBOARD TO AC, AND SUPPRESS	/EAG:191

		/ ECHO						/EAG:191

								/EAG:191

								/EAG:191

/ CONSOLE TELETYPE TELEPRINTER					/EAG:191

								/EAG:191

TSF=700401	/ SKIP ON TELEPRINTER FLAG			/EAG:191

TCF=700402	/ CLEAR TELEPRINTER FLAG			/EAG:191

TLS=700406	/ CLEAR TELEPRINTER FLAG AND PRINT AC		/EAG:191

								/EAG:191

								/EAG:191

/ XM15 XVM HARDWARE OPTION, INCLUDING MEMORY PROTECT, RELOCATE,	/EAG:191

/ AND EXTEND							/EAG:191

								/EAG:191

LDMM=700024	/ LOAD MM REGISTER				/EAG:191

RDMM=700032	/ READ MM REGISTER				/EAG:191

MPSNE=701741	/ SKIP IF NON-EXISTENT MEMORY REFERENCED	/EAG:191

MPCNE=701744	/ CLEAR NON=EXISTENT MEMORY REFERENCE FLAG	/EAG:191

MPEU=701742	/ ENTER USER MODE				/EAG:192

MPSK=701701	/ SKIP IF MEMORY PROTECT VIOLATION		/EAG:192

MPLD=701704	/ LOAD BOUNDARY REGISTER			/EAG:193

MPLR=701724	/ LOAD RELOCATION REGISTER			/EAG:193

								/EAG:191

								/EAG:191

/ VT15 DISPLAY PROCESSOR					/EAG:191

								/EAG:191

SIC=703024	/ SET INITIAL CONDITIONS			/EAG:191

RS1=703002	/ OR STATUS REGISTER 1 TO ACCUMULATOR		/EAG:193

STPD=703044	/ EXTERNAL STOP DISPLAY				/EAG:191

RS2=703022	/ OR STATUS REGISTER 2 TO ACCUMULATOR		/EAG:193

LSD=703004	/ LOAD DISPLAY ADDRESS AND START DISPLAY	/EAG:193

								/EAG:191

								/EAG:191

/ VP15A STORAGE TUBE DISPLAY					/EAG:191

								/EAG:191

SDDF=700521	/ SKIP ON DISPLAY DONE FLAG			/EAG:191

CDDF=700722	/ CLEAR DISPLAY DONE FLAG			/EAG:191

VP.API=54	/ VP15 API VECTOR ADDRESS			/EAG:191

								/EAG:191

								/EAG:191

/ UC15 PROCESSOR LINK						/EAG:191

								/EAG:191

LDRS=706122	/ LOAD STATUS					/EAG:191

RDRS=706112	/ READ STATUS					/EAG:191

SIOA=706001	/ SKIP IF I/O ACCEPTED				/EAG:194

LIOR=706006	/ CLEAR I/O DONE AND LOAD I/O REGISTER		/EAG:194

								/EAG:191

								/EAG:191

/ LT15 AND LT19D TELETYPE CONTROL				/EAG:191

								/EAG:191

KSF1=704101	/ SKIP ON RECEIVER FLAG				/EAG:191

KRB1=704112	/ READ RECEIVER BUFFER AND CLEAR RECEIVER FLAG	/EAG:191

								/EAG:192

								/EAG:192

/ KF15 POWER FAILURE DETECTION					/EAG:192

								/EAG:192

PFSF=703201	/ SKIP ON POWER-LOW FLAG			/EAG:192

KF.API=52	/ KF15 API VECTOR ADDRESS			/EAG:192

								/EAG:192

								/EAG:192

/ MP15 MEMORY PARITY						/EAG:192

								/EAG:192

SPE=702701	/ SKIP ON PARITY ERROR				/EAG:192

MP.API=53	/ MP15 API VECTOR ADDRESS			/EAG:192

	.TITLE .SCOM DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

	.ABSP							/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE OFFSETS INTO .SCOM PLUS SC.BAS AND SC.LEN		/EAG:191

/								/EAG:191

								/EAG:191

SC.BAS=100							/EAG:191

								/EAG:191

	.LOC SC.BAS						/EAG:191

								/EAG:191

SC.COD	0							/EAG:191

SC.RMS	RM.SIZ							/EAG:191

SC.FRL	0							/EAG:191

	0							/EAG:191

SC.MOD	0							/EAG:191

SC.SST	IN							/EAG:191

SC.UST	0							/EAG:191

SC.FNM	0							/EAG:191

	0							/EAG:191

	0							/EAG:191

SC.LV4	0							/EAG:191

SC.LV5	0							/EAG:191

SC.LV6	0							/EAG:191

SC.LV7	0							/EAG:191

SC.TTP	0							/EAG:191

SC.TTA	0							/EAG:191

SC.MSZ	0							/EAG:191

SC.MTS	0							/EAG:191

SC.AMS	0							/EAG:191

SC.DAT	0							/EAG:191

SC.SLT	0							/EAG:191

SC.UFD	0							/EAG:191

SC.BNM	0							/EAG:191

SC.BLN	0							/EAG:191

SC.BTB	0							/EAG:191

SC.OTB	0							/EAG:191

SC.BBN	0							/EAG:191

SC.VTF	0							/EAG:191

SC.ETS	0							/EAG:191

SC.CTT	0							/EAG:191

SC.ACT	0							/EAG:191

SC.EEP	0							/EAG:191

	0							/EAG:191

SC.UIC	0							/EAG:191

SC.NMF	0							/EAG:191

SC.SPN	0							/EAG:191

	0							/EAG:191

SC.NMN	0							/EAG:191

	0							/EAG:191

SC.DAY	0							/EAG:191

SC.TIM	0							/EAG:191

SC.ETT	0							/EAG:191

SC.BOS	0							/EAG:191

SC.VTR	0							/EAG:191

SC.PRC	0							/EAG:191

SC.TRN	0							/EAG:191

SC.TLM	0							/EAG:191

SC.SDV	0							/EAG:191

SC.TMT	0							/EAG:191

SC.TMA	0							/EAG:191

SC.BTA	0							/EAG:191

SC.BTL	0							/EAG:191

	0			/ RESERVED			/EAG:191

SC.CQF	0							/EAG:197
SC.CQB	0							/EAG:197
	0							/EAG:197
	0							/EAG:197
SC.TDT	0			/ TOMORROW'S DATE		/RKB-207
	0			/ RESERVED			/EAG:191
SC.TMR	0							/EAG:191

SC.LFR	0							/EAG:191

SC.RTF	0							/EAG:191

SC.FRH	0							/EAG:191

	0							/EAG:191

SC.TCB	0							/EAG:191

SC.U01	0							/EAG:191

SC.U02	0							/EAG:191

SC.U03	0							/EAG:191

SC.U04	0							/EAG:191

SC.U05	0							/EAG:191

SC.BFNM	0							/EAG:195

	0							/EAG:195
SC.BFXT	0						/RKB-205
SC.BUIC	0							/EAG:195
SC.BDEV	0							/EAG:195
SC.BUNT	0							/RKB-205

								/EAG:191

SC.LEN=.-SC.BAS							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BITS IN SC.MOD						/EAG:191

/								/EAG:191

								/EAG:191

SC.XVM=1							/EAG:191

SC.UC15=2							/EAG:191

SC.PLR=4							/EAG:191

SC.LPSZ=60							/EAG:191

SC.BNK=100							/EAG:191

SC.FIL=200							/EAG:191

SC.9CH=4000							/EAG:191

SC.UB1=10000							/EAG:201

SC.UB2=20000							/EAG:201

SC.NRM=40000							/EAG:191

SC.TAB=100000							/EAG:191

SC.API=400000							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BITS IN SC.UST						/EAG:191

/ NOTE THAT ACTUAL USER STARTING ADDRESS IS KNOWN TO BE A	/EAG:191

/ 15-BIT QUANTITY, IN LOW 15 BITS.				/EAG:191

/								/EAG:191

								/EAG:191

SC.DDT=400000							/EAG:191

SC.GLD=200000							/EAG:191

SC.DNS=100000							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BITS IN SC.VTF						/EAG:191

/								/EAG:191

								/EAG:191

SC.HFN=400000							/EAG:191

SC.VTN=100000							/EAG:191

SC.DMN=1							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BITS IN SC.NMF						/EAG:191

/								/EAG:191

								/EAG:191

SC.MIC=400000							/EAG:191

SC.NRE=200000							/EAG:191

SC.NRO=100000							/EAG:191

SC.LPON=40000							/EAG:191

SC.DMP=20000							/EAG:191

SC.HLT=10000							/EAG:191

SC.TMM=4000							/EAG:191

SC.PVT=1000							/EAG:197

SC.PCLK=400							/EAG:197

SC.PAPI=200							/EAG:191

SC.PUC15=100							/EAG:191

SC.PXVM=40							/EAG:191

SC.DT6=10							/EAG:191

SC.DT7=4							/EAG:191

SC.KPN=2							/EAG:191

SC.BCH=1							/EAG:191

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ DEFINE BITS IN SC.BOS						/EAG:193

/								/EAG:193

								/EAG:193

SC.BMD=400000							/EAG:193

SC.BCR=200000							/EAG:197

SC.BEOF=100000							/EAG:197

SC.BTM=40000							/EAG:197

SC.BTT=20000							/EAG:197

SC.BIO=10000							/EAG:197

SC.BDMP=4000							/EAG:197

SC.BOA=2000							/EAG:197

SC.BJA=1000							/EAG:197

SC.BXT=400							/EAG:197

SC.BPT=200							/EAG:197

SC.BGT=100							/EAG:197

SC.BERR=16							/EAG:197

SC.BAB=1							/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ DEFINE BITS IN SC.CQF:					/EAG:197

/								/EAG:197

								/EAG:197

SC.QFLG=400000							/EAG:197

SC.QNF=2000							/EAG:197

SC.QNRM=1000							/EAG:197

SC.QPUT=400							/EAG:197

SC.QRTN=7							/EAG:197

	.TITLE BOOTSTRAP DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ALL DEFINITIONS ARE OFFSETS RELATIVE TO THE BEGINNING OF A	/EAG:191

/ BANK								/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

BT.BAS=17637	/ BASE ADDRESS OF BOOTSTRAP			/EAG:191

								/EAG:191

								/EAG:191

/ ENTRY POINTS:							/EAG:191

								/EAG:191

BT.BOO=17646	/ ENTER HERE TO RE-BOOTSTRAP SYSTEM		/EAG:191

BT.RED=17663	/ ENTER HERE TO READ DISK			/EAG:191

BT.WRT=17665	/ ENTER HERE TO WRITE DISK			/EAG:191

								/EAG:191

								/EAG:191

/ MAGIC LOCATIONS IN BOOTSTRAP:					/EAG:191

								/EAG:191

BT.BLK=17637	/ DISK BLOCK AT WHICH TO START TRANSFER		/EAG:191

BT.CA=17640	/ CORE ADDRESS -1 AT WHICH TO START TRANSFER	/EAG:191

BT.WC=17641	/ TWO'S COMPLEMENT NUMBER OF WORDS TO TRANSFER	/EAG:191

BT.ERR=17704	/ ADDRESS OF ERROR HALT IN BOOTSTRAP		/EAG:191

BT.FLG=17777	/ ADDRESS OF FLAGS WORD (USED BY BATCH)		/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ VERIFY THAT THE DEFINITION OF SC.SST IS WHAT THE BOOTSTRAP	/EAG:191

/ EXPECTS IT TO BE						/EAG:191

/								/EAG:191

								/EAG:191

	.IFNZR SC.SST-105					/EAG:191

ERROR	BOOTSTRAP REQUIRES THAT SC.SST=105			/EAG:191

ERROR	.LOC .-1						/EAG:191

	.ENDC							/EAG:191

	.TITLE SGNBLK DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE LOCATION AND FORMAT OF SGNBLK.  SGNBLK IS LOCATED	/EAG:191

/ IN BLOCK 36 OF THE SYSTEM DEVICE.  IT IS BROUGHT INTO		/EAG:191

/ CORE AS PART OF THE SAME TRANSFER WHICH BRINGS IN THE		/EAG:191

/ RESIDENT MONITOR.  THIS LOCATES IT IN MEMORY BEGINNING	/EAG:191

/ AT LOCATION 17100.						/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

SG.BAS=17100		/ BASE ADDRESS OF SGNBLK.		/EAG:191

								/EAG:191

SG.FRE=SG.BAS+0		/ POINTER TO FIRST FREE WORD IN SGNBLK.	/EAG:191

			/ POINTER IS RELATIVE TO SGNBLK BASE.	/EAG:191

								/EAG:191

SG.NMP=SG.BAS+1		/ NUMBER OF PARAMETERS INCLUDED IN	/EAG:191

			/ SGNBLK.				/EAG:191

								/EAG:191

SG.NMD=SG.BAS+2		/ NUMBER OF .DAT SLOTS*2.  THUS THIS	/EAG:191

			/ IS THE TOTAL SIZE (IN WORDS) OF THE	/EAG:191

			/ COMBINED .DAT AND .UFDT TABLES.	/EAG:191

								/EAG:191

SG.NMS=SG.BAS+3		/ NUMBER OF SKIPS IN SKIP CHAIN.	/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THE PARAMETERS IN SGNBLK ARE IN FIXED LOCATIONS.  THEY ARE	/EAG:191

/ AS FOLLOWS:							/EAG:191

/								/EAG:191

								/EAG:191

SG.SYS=SG.BAS+4		/ SYSTEM DEVICE CODE IN .SIXBT		/EAG:191

								/EAG:191

SG.MOD=SG.BAS+5		/ ORIGINAL (DEFAULT) CONTENTS OF SC.MOD	/EAG:191

								/EAG:191

SG.MSZ=SG.BAS+6		/ ORIGINAL (DEFAULT) CONTENTS OF SC.MSA	/EAG:191

			/ I.E. THE SYSTEM MEMORY SIZE		/EAG:191

								/EAG:191

SG.BLN=SG.BAS+7		/ ORIGINAL (DEFAULT) CONTENTS OF SC.BLK	/EAG:191

			/ I.E. THE SYSTEM BUFFER LENGTH		/EAG:191

								/EAG:191

SG.BNM=SG.BAS+10	/ ORIGINAL (DEFAULT) CONTENTS OF SC.BNM	/EAG:191

			/ I.E. THE NUMBER OF SYSTEM BUFFERS	/EAG:191

								/EAG:191

SG.MIC=SG.BAS+11	/ MONITOR IDENTIFICATION CODE (FOR	/EAG:191

			/ MICLOG)				/EAG:191

								/EAG:191

SG.VTF=SG.BAS+12	/ ORIGINAL (DEFAULT) CONTENTS OF SC.VTF	/EAG:191

			/ I.E. VT ON/OFF STATUS REGISTER	/EAG:191

								/EAG:191

SG.PRC=SG.BAS+13	/ ORIGINAL (DEFAULT) CONTENTS OF SC.PRC	/EAG:191

			/ I.E. FILE PROTECTION CODE		/EAG:191

								/EAG:191

SG.PSZ=SG.BAS+14	/ RESIDENT PATCH AREA SIZE		/EAG:191

								/EAG:191

SG.LFR=SG.BAS+15	/ POWER LINE FREQUENCY.  CONTENTS OF	/EAG:191

			/ SC.LFR.				/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THE DEFAULT IMAGE OF .DAT AND .UFDT FOLLOWS THE PARAMETERS.	/EAG:191

/ THE STARTING ADDRESS OF THIS IMAGE MAY BE CALCULATED AS	/EAG:191

/ FOLLOWS:							/EAG:191

/								/EAG:191

/	SG.BAS+1+(SG.NMP)					/EAG:191

/								/EAG:191

/ THE IMAGE IS (SG.NMD) WORDS LONG AND IS AN EXACT IMAGE	/EAG:191

/ OF HOW .DAT AND .UFDT SHOULD APPEAR IN CORE.			/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THE SKIP CHAIN FOLLOWS THE .DAT AND .UFDT TABLES.  THE	/EAG:191

/ STARTING ADDRESS OF THE SKIP CHAIN MAY BE CALCULATED AS	/EAG:191

/ FOLLOWS:							/EAG:191

/								/EAG:191

/	SG.BAS+1+(SG.NMP)+(SG.NMD)				/EAG:191

/								/EAG:191

/ THE SKIP CHAIN IS (SG.NMS) WORDS (SKIPS) LONG.  THE SKIP	/EAG:191

/ IS STORED NORMALLY IF IT IS A NORMAL OR "POSITIVE" SKIP,	/EAG:191

/ WHICH SKIPS IF THE FLAG IS SET.  THE SKIP IS STORED		/EAG:191

/ COMPLEMENTED (ONE'S) IF IT IS A "NEGATIVE" SKIP, OR ONE	/EAG:191

/ WHICH SKIPS IF THE FLAG IS CLEAR.				/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THE DEVICE HANDLER TABLE FOLLOWS THE SKIP CHAIN.  THE		/EAG:191

/ STARTING ADDRESS OF THE DEVICE HANDLER TABLE MAY BE		/EAG:191

/ CALCULATED AS FOLLOWS:					/EAG:191

/								/EAG:191

/	SG.BAS+1+(SG.NMP)+(SG.NMD)+(SG.NMS)			/EAG:191

/								/EAG:191

/ THE FIRST FREE WORD IN SGNBLK IMMEDIATELY FOLLOWS THE LAST	/EAG:191

/ WORD OF THE DEVICE HANDLER TABLE.  THE ADDRESS OF THE FIRST	/EAG:191

/ FREE WORD MAY BE CALCULATED AS FOLLOWS:			/EAG:191

/								/EAG:191

/	SG.BAS+(SG.FRE)						/EAG:191

/								/EAG:191

/ THERE IS AN ENTRY IN THE DEVICE HANDLER TABLE FOR EACH	/EAG:191

/ DEVICE.  AN ENTRY STARTS WITH A LIST OF THE NAMES (IN .SIXBT)	/EAG:191

/ OF THE DEVICE'S HANDLERS.  FOLLOWING THIS IS A WORD		/EAG:191

/ CONTAINING A COUNT OF THE NUMBER OF SKIPS USED BY THE		/EAG:191

/ DEVICE, FOLLOWED IN TURN BY A LIST OF THE SKIPS THEMSELVES.	/EAG:191

/ EACH SKIP FORMS A THREE WORD ENTRY.  THE FIRST TWO WORDS	/EAG:191

/ ARE THE SKIP MNEMONIC IN .SIXBT.  THE LAST WORD IS THE	/EAG:191

/ SKIP IOT.							/EAG:191

/								/EAG:191

	.TITLE SYSBLK AND COMBLK DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BASE ADDRESS OF SYSBLK AND COMBLK			/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

SB.BAS=16100							/EAG:191

CB.TOP=SB.BAS+777						/EAG:191

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ DEFINE FORMAT OF SYSBLK:					/EAG:197

/								/EAG:197

								/EAG:197

SB.FRE=SB.BAS			/ POINTER TO FIRST FREE LOC.	/EAG:197

								/EAG:197

SB.BEG=SB.BAS+1			/ START OF ENTRIES		/EAG:197

								/EAG:197

SB.LEN=7			/ LENGTH OF ENTRIES		/EAG:197

								/EAG:197

/								/EAG:197

/ SYSBLK CONTAINS AN ENTRY FOR EACH SYSTEM PROGRAM OR OVERLAY	/EAG:197

/ WHICH IS STORED ON THE DISK IN IMAGE FORM.  THE FIRST ENTRY	/EAG:197

/ BEGINS AT SG.BEG.  EACH ENTRY IS SB.LEN WORDS LONG.  LOCATION	/EAG:197

/ SG.FRE CONTAINS AN OFFSET (RELATIVE TO SB.BAS) OF THE FIRST	/EAG:197

/ FREE LOCATIN IN SYSBLK -- I.E. THE LOCATION IMMEDIATELY ABOVE	/EAG:197

/ THE LAST WORD OF THE LAST OVERLAY.				/EAG:197

/								/EAG:197

/ THE FOLLOWING LOCATIONS EXIST WITHIN EACH ENTRY:		/EAG:197

/								/EAG:197

								/EAG:197

SB.NM1=0			/ FIRST THREE CHARACTERS OF	/EAG:197

				/ NAME (.SIXBT)			/EAG:197

								/EAG:197

SB.NM2=1			/ SECOND THREE CHARACTERS OF	/EAG:197

				/ NAME (.SIXBT)			/EAG:197

								/EAG:197

SB.FB=2				/ FIRST DISK BLOCK ALLOCATED	/EAG:197

				/ TO IMAGE			/EAG:197

								/EAG:197

SB.NB=3				/ NUMBER OF DISK BLOCKS		/EAG:197

				/ ALLOCATED TO IMAGE		/EAG:197

								/EAG:197

SB.FA=4				/ BASE ADDRESS (IN CORE) OF	/EAG:197

				/ IMAGE				/EAG:197

								/EAG:197

SB.PS=5				/ POSITIVE LENGTH OF IMAGE	/EAG:197

								/EAG:197

SB.SA=6				/ PROGRAM START ADDRESS OF	/EAG:197

				/ IMAGE				/EAG:197

	.TITLE MISCELLANEOUS MONITOR CONSTANT DEFINITIONS

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE THE LENGTH AND BASE ADDRESS OF THE RESIDENT		/EAG:191

/ MONITOR FOR PURPOSES OF DISK TRANSFERS, ETC.			/EAG:191

/								/EAG:191

								/EAG:191

RM.TLN=17400							/EAG:191

RM.TBS=100							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE THE LENGTH OF ENTRIES IN THE OVERLAY TABLE.  THE	/EAG:191

/ FORMAT OF AN ENTRY IS DESCRIBED IN MORE DETAIL IN THE		/EAG:191

/ COMMENTS PRECEEDING THE .OVRLA CAL FUNCTION ROUTINE.		/EAG:191

/								/EAG:191

								/EAG:191

OTB.LN=6	/ LENGTH OF EACH ENTRY = 6 WORDS		/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE LOCATION OF CAL TRAP VECTOR				/EAG:191

/								/EAG:191

								/EAG:191

CL.VCT=20							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE ENTRY TO MONITOR ERROR DIAGNOSTIC ROUTINE		/EAG:191

/								/EAG:191

								/EAG:191

.MED=3								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE LENGTH OF AN ENTRY IN THE MASS STORAGE BUSY TABLE	/EAG:191

/								/EAG:191

								/EAG:191

RM.BTL=5							/EAG:191

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ DEFINE PARAMETERS CONTROLLING OPERATION OF UNICHANNEL POLLER.	/EAG:194

/								/EAG:194

								/EAG:194

PLR.NT=15		/ NUMBER OF TASKS ABOUT WHICH ERROR	/EAG:194

			/ STATUS INFORMATION IS RETURNED BY	/EAG:194

			/ PIREX IN RESPONSE TO ERROR STATUS	/EAG:194

			/ REPORT SOFTWARE DIRECTIVE.		/EAG:194

								/EAG:194
PLR.WT=1		/ MINIMUM NUMBER OF SECONDS TO ALLOW	/EAG:194

			/ PIREX TO RESPOND TO ERROR STATUS	/EAG:194

			/ REPORT SOFTWARE DIRECTIVE BEFORE	/EAG:194

			/ TIMING OUT AND GIVING PIREX NOT	/EAG:194
			/ READY ("IOPSUC PRX 4") MESSAGE.	/EAG:194
								/RKB-208
PLR.FR=454		/ FREQUENCY (IN SECONDS) AT WHICH THE	/RKB-208
			/ "IOPSUC PRX 4" MESSAGE WILL REPEAT	/RKB-208
			/ WHEN THE UNICHANNEL IS CONTINUOUSLY	/RKB-208
			/ HALTED.  454 IS 300 DECIMAL (5 MIN)	/RKB-208

	.TITLE CAL HANDLER AND DISPATCH TABLE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ WHAT FOLLOWS IS THE RESIDENT MONITOR CAL HANDLER.  WHEN A	/EAG:191

/ CAL OCCURS IT INTERCEPTS CONTROL, DECIDES WHETHER THE CAL	/EAG:191

/ IS AN I/O CAL OR A MONITOR CAL, AND DISPATCHES TO THE		/EAG:191

/ APPROPRIATE I/O HANDLER OR MONITOR CAL FUNCTION ROUTINE.	/EAG:191

/ IN THE PROCESS VARIOUS ERROR CHECKS ARE PERFORMED.		/EAG:191

/								/EAG:191

/ THE INITIALIZATION ROUTINE IN.CAL SETS UP LOW MEMORY		/EAG:191

/ IN ACCORDANCE WITH THE FOLLOWING:				/EAG:191

/								/EAG:191

/		.LOC 20						/EAG:191

/	CL.VCT	CL.IND		/ CAL* GOES TO CL.IND		/EAG:191

/		JMS CL.ENT	/ JMP TO CAL HANDLER		/EAG:191

/								/EAG:196

/ WE USE A JMS TO TRANSFER TO CL.ENT, RATHER THAN A JMP, SO	/EAG:196

/ THAT WE WILL GET A FREE INSTRUCTION AND NOT GET INTERRUPTED.	/EAG:196

/ THE REASON WHY THIS IS NECESSARY IS DESCRIBED SOMEWHERE	/EAG:196

/ BELOW.							/EAG:196

/								/EAG:191

/ WE DISPATCH TO A CAL FUNCTION ROUTINE (FOR A NON-I/O CAL)	/EAG:191

/ VIA THE CAL DISPATCH TABLE CL.TAB.  EACH ENTRY IN THIS	/EAG:191

/ TABLE CONTAINS THE ADDRESS OF A FUNCTION ROUTINE ENTRY	/EAG:191

/ POINT PLUS FLAGS INDICATING THE LENGTH OF THE CAL.  A		/EAG:191

/ CAL MAY BE 2, 3, OR 4 WORDS LONG.  THIS LENGTH INFORMATION	/EAG:191

/ IS USED SOLELY TO SET UP CL.RET, THE CAL RETURN ADDRESS.	/EAG:191

/ IN ALL CASES, THE FOLLOWING LOCATIONS WILL BE SET UP		/EAG:191

/ BEFORE DISPATCHING TO THE CAL FUNCTION ROUTINE:		/EAG:191

/								/EAG:191

/	CL.AC	CONTAINS THE USER AC AT TIME OF CAL		/EAG:191

/								/EAG:191

/	CL.RET	CONTAINS (IN ITS SIGN BIT) THE USER LINK	/EAG:191

/		AT TIME OF CAL					/EAG:191

/								/EAG:191

/	CL.WD1	CONTAINS THE CAL INSTRUCTION ITSELF		/EAG:191

/								/EAG:191

/	CL.WD3	CONTAINS A COPY OF THE SECOND WORD		/EAG:191

/		FOLLOWING THE CAL INSTRUCTION			/EAG:191

/								/EAG:191

/	CL.WD4	CONTAINS A COPY OF THE THIRD WORD		/EAG:191

/		FOLLOWING THE CAL INSTRUCTION			/EAG:191

/								/EAG:191

/ IT SHOULD BE NOTED THAT THE FIRST WORD FOLLOWING THE CAL	/EAG:191

/ INSTRUCTION CONTAINS THE CAL FUNCTION CODE, AND IS USED	/EAG:191

/ SOLELY TO DISPATCH TO THE PROPER CAL FUNCTION ROUTINE.	/EAG:191

/ WHEN WE GET TO THE CAL FUNCTION ROUTINE THE AC AND LINK HAVE	/EAG:191

/ BEEN SAVED AND MAY BE USED FREELY.  ANY OTHER REGISTERS (THE	/EAG:191

/ XR, LR, EAE, AND FPP REGISTERS) MUST BE SAVED			/EAG:191

/ BY THE CAL FUNCTION ROUTINE.  THE CAL FUNCTION ROUTINE	/EAG:191

/ PROPER IS AN ORDINARY SUBROUTINE, CALLED VIA A JMS.  IF	/EAG:191

/ IT RETURNS, IT SHOULD RETURN IN THE ORDINARY MANNER.		/EAG:191

/								/EAG:191

/ CAL FUNCTION ROUTINES ARE NOT REQUIRED TO RETURN.  MOST	/EAG:191

/ NORMAL CAL'S RETURN TO THE USER AT THE INSTRUCTION FOLLOWING	/EAG:191

/ THE CAL.  THIS IS THE EXIT FROM CAL PROCESSING TAKEN IF	/EAG:191

/ THE CAL FUNCTION ROUTINE RETURNS NORMALLY TO THE CAL		/EAG:191

/ DISPATCHER.  IN THIS CASE ALL USER REGISTERS ARE PRESERVED,	/EAG:191

/ UNLESS THE CAL FUNCTION ROUTINE HAS EXPLICITLY MODIFIED	/EAG:191

/ THEM (IN CL.AC, ETC.).  SOME CAL'S, SUCH AS .EXIT,		/EAG:191

/ DO NOT HAVE A MEANINGFUL RETURN TO THE USER.  SUCH CAL'S	/EAG:191

/ DO NOT RETURN TO THE CAL DISPATCHER -- THEY JUST GO DO	/EAG:191

/ THEIR THING.							/EAG:191

/								/EAG:191

/ THERE IS A LAST CATEGORY OF CAL'S WHICH "RETURN" TO		/EAG:191

/ THE USER IN A FUNNY MANNER.  THIS IS ILLUSTRATED BY .OVRLA	/EAG:191

/ IN THE CASE WHERE AN OVERLAY TABLE ENTRY EXISTS FOR THE	/EAG:191

/ DESIRED OVERLAY.  IN THIS CASE .OVRLA WILL BRING IN THE	/EAG:191

/ REQUESTED OVERLAY (VIA MONITOR TRAN) AND JUMP DIRECTLY	/EAG:191

/ TO THE OVERLAY'S STARTING ADDRESS.  THERE ARE OTHER CAL'S	/EAG:191

/ WHICH ALSO "RETURN" TO THE USER BY JUMPING TO AN ARBITRARY	/EAG:191

/ POINT IN HIS PROGRAM.  SUCH RETURNS ARE CHARACTERIZED BY	/EAG:191

/ THE FACT THAT NO USER REGISTERS WHATSOEVER ARE PRESERVED,	/EAG:191

/ EXCEPT FOR USER OPERATING MODES (BANK VS. PAGE, XVM VS.	/EAG:191

/ NON-XVM).  THESE CAL FUNCTION ROUTINES "RETURN" BY COPYING	/EAG:191

/ CL.RET INTO A TEMPORARY, EXECUTING A DBR IOT, AND THEN	/EAG:191

/ PERFORMING AN INDIRECT JUMP THROUGH THE TEMPORARY.  GENERALLY	/EAG:191

/ SUCH CAL FUNCTION ROUTINES PERFORM NESTED CAL'S, WHICH	/EAG:191

/ CLOBBER THE CAL RETURN INFORMATION (CL.RET, CL.AC,		/EAG:191

/ CL.WD1, CL.WD3, ETC.).					/EAG:191

/								/EAG:191

/ WITHIN CERTAIN LIMITS CAL'S MAY BE NESTED (I.E., CAL FUNCTION	/EAG:191

/ ROUTINES MAY ISSUE CAL'S) ALMOST ARBITRARILY.  THE LIMITS	/EAG:191

/ OR RULES ARE AS FOLLOWS.  I/O HANDLERS (I.E. I/O CAL FUNCTION	/EAG:191

/ ROUTINES) MAY ISSUE AT WILL THOSE NON-I/O CAL'S WHICH		/EAG:191

/ RETURN NORMALLY (I.E., EXCLUDING .EXIT, .OVRLA, .MTRAN,	/EAG:191

/ ETC.).  THEY SHOULD AVOID					/EAG:191

/ ISSUEING I/O CAL'S AS MOST I/O HANDLERS ARE NON REENTRANT.	/EAG:191

/ NON-I/O CAL FUNCTION ROUTINES MAY ISSUE CAL'S OF EITHER TYPE	/EAG:191

/ ON THE UNDERSTANDING THAT THE AC AND LINK WILL NOT		/EAG:191

/ BE PRESERVED ACROSS THE CAL AND THAT THE CAL RETURN		/EAG:191

/ INFORMATION WILL BE CLOBBERED.  THUS A NON-I/O CAL FUNCTION	/EAG:191

/ ROUTINE WHICH ISSUES NESTED CAL'S MAY NOT RETURN TO THE CAL	/EAG:191

/ DISPATCHER IN THE NORMAL MANNER AND MAY NOT REFERENCE		/EAG:191

/ THE LOCATIONS CL.RET, CL.AC, CL.WD1, ETC. AFTER		/EAG:191

/ ISSUEING THE CAL.  OTHER THAN THAT IT SHOULD BE CAUTIOUS	/EAG:191

/ THAT THE CAL IT ISSUES WILL NOT INITIATE SOME LOOP WHICH	/EAG:191

/ WILL RESULT IN THE ISSUEING CAL FUNCTION ROUTINE BEING	/EAG:191

/ REENTERED.							/EAG:191

/								/EAG:191

/ THUS THE GENERAL FORM OF A NON-I/O CAL IS AS FOLLOWS:		/EAG:191

/								/EAG:191

/	CAL+ARGUMENTS		/ COPIED INTO CL.WD1		/EAG:191

/	CAL FUNCTION CODE					/EAG:191

/	ARGUMENTS OR RETURN	/ COPIED INTO CL.WD3		/EAG:191

/	ARGUMENTS OR RETURN	/ COPIED INTO CL.WD4		/EAG:191

/	RETURN							/EAG:191

/								/EAG:191

/ I/O CALS ARE DIFFERENT FROM THIS.  ALL THE STUFF SAID ABOVE	/EAG:191

/ ABOUT DISPATCHING TO CAL FUNCTION ROUTINES IS COMPLETELY	/EAG:191

/ CHANGED FOR I/O CALS.  THE GENERAL FORM OF AN I/O CAL		/EAG:191

/ IS AS FOLLOWS:						/EAG:191

/								/EAG:191

/	WORD 1	BITS 00-04	ZERO (I.E., OPCODE = CAL)	/EAG:191

/		BITS 05-08	USE VARIES FOR DIFFERENT I/O	/EAG:191

/				FUNCTIONS AND HANDLERS		/EAG:191

/		BITS 09-17	DAT SLOT NUMBER MASKED TO	/EAG:191

/				NINE BITS			/EAG:191

/								/EAG:191

/	WORD 2	BITS 00-02	DEVICE UNIT NUMBER.  INSERTED	/EAG:191

/				HERE BY DISPATCH ROUTINE	/EAG:191

/		BITS 03-17	I/O CAL FUNCTION CODE		/EAG:191

/								/EAG:191

/	WORDS 3-N		ARGUMENTS			/EAG:191

/								/EAG:191

/ THE DISPATCH DOES THE FOLLOWING WHEN IT RECOGNIZES AN I/O	/EAG:191

/ CAL.  FIRST IT EXTRACTS THE DAT SLOT NUMBER, CHECKS THAT IT	/EAG:191

/ IT LEGAL, AND THEN VERIFIES THAT THE DAT SLOT HAS BEEN SET	/EAG:191

/ UP.  THEN IT COPIES THE DEVICE UNIT NUMBER FROM THE HIGH 3	/EAG:191

/ BITS.  OF .DAT TO THE HIGH THREE BITS OF CAL WORD 2.  THEN IT	/EAG:191

/ LOADS THE AC WITH THE ADDRESS OF THE CAL (LOW 15 BITS) AND	/EAG:191

/ THE LINK, ADDRESS MODE, AND USER MODE FLAGS (HIGH 3 BITS).	/EAG:191

/ (THIS QUANTITY IS DETERMINED BY SUBTRACTING 1 FROM THE VALUE	/EAG:191

/ STORED IN CL.VCT = LOCATION 20).  FINALLY IT JUMPS TO THE I/O	/EAG:191

/ HANDLER ENTRY POINT, DETERMINED FROM THE LOW 15 BITS OF .DAT.	/EAG:191

/ THE CONTENTS OF THE USER AC ARE LOST.				/EAG:191

/								/EAG:191

/ THE DISPATCH ROUTINE DISTINGUISHES BETWEEN I/O CALS AND	/EAG:191

/ NON-I/O CALS BY THE CAL FUNCTION CODE.  CODES 1 THROUGH	/EAG:191

/ CL.IOF ARE I/O CALS.  CODES CL.IOF+1 THROUGH CL.IOF+CL.NMF	/EAG:191

/ ARE NON-I/O CALS.						/EAG:191

/								/EAG:191

/ THERE EXISTS A POTENTIAL TIMING PROBLEM WHEN CERTAIN		/EAG:191

/ INTERRUPTS OCCUR IN THE MIDDLE OF CAL PROCESSING.  THE	/EAG:191

/ INTERRUPTS WHICH MAY CAUSE THIS ARE THOSE WHICH REDIRECT	/EAG:191

/ THE FLOW OF USER CONTROL.  THESE INTERRUPTS ARE CLOCK		/EAG:191

/ INTERRUPTS WHICH TRIGGER A USER .TIMER ROUTINE AND CONSOLE	/EAG:191

/ KEYBOARD INTERRUPTS WHICH ARE DUE TO THE RECEIPT OF A ^P,	/EAG:191

/ ^C, ^T, ^S, OR ^Q.  THE PROBLEM IS THAT THE INTERRUPT MAY	/EAG:191

/ OCCUR IN THE MIDDLE OF THE MONITOR (WHICH TERM INCLUDES I/O	/EAG:191

/ HANDLERS), AND THAT AS A RESULT OF INTERRUPTING THE MONITOR	/EAG:191

/ IN THE MIDDLE OF ITS PROCESSING INTERNAL TABLES MAY BE LEFT	/EAG:191

/ IN AN INCONSISTENT STATE.  THIS PROBLEM CAN BE SOLVED FOR	/EAG:191

/ VARIOUS SPECIAL CASES, BUT NOT FOR THE GENERAL CASE UNLESS	/EAG:191

/ INORDINATE AMOUNTS OF EFFORT ARE EXPENDED.			/EAG:191

/								/EAG:191

/ THE SOLUTION TO THIS PROBLEM WOULD BE TO HAVE ALL CAL'S	/EAG:191

/ ENTER VIA A COMMON CAL ENTRANCE ROUTINE (WHICH THEY DO)	/EAG:191

/ AND ALSO TO HAVE ALL CAL'S EXIT VIA ANOTHER COMMON ROUTINE	/EAG:191

/ (WHICH THEY DON'T).  THE ENTRY AND EXIT ROUTINES WOULD	/EAG:191

/ INCREMENT AND DECREMENT A COUNTER, FROM WHICH ONE COULD	/EAG:191

/ ALWAYS TELL IF CAL (I.E., MONITOR) PROCESSING WAS IN		/EAG:191

/ PROGRESS.  IF ONE OF THE PROBLEM INTERRUPTS WAS RECEIVED	/EAG:191

/ WHILE CAL PROCESSING WAS IN PROGRESS A FLAG WOULD BE SET	/EAG:191

/ AND NOTHING ELSE DONE IMMEDIATELY.  EVENTUALLY CAL PROCESSING	/EAG:191

/ WOULD TERMINATE AND THE COMMON EXIT ROUTINE WOULD CHECK THE	/EAG:191

/ FLAG.  IF IT WERE SET ACTIONS WOULD BE TAKEN TO FIELD THE	/EAG:191

/ INTERRUPT TO THE USER.					/EAG:191

/								/EAG:191

/ THIS IS A VERY GOOD SOLUTION, AND WOULD WORK WONDERFULLY,	/EAG:191

/ EXCEPT FOR ONE SLIGHT PROBLEM.  CAL'S DO NOT TAKE A COMMON	/EAG:191

/ EXIT BACK TO THE USER.  THIS COULD BE DONE FOR NON-I/O	/EAG:195

/ CAL'S WITHOUT TOO MUCH DIFFICULTY.  HOWEVER			/EAG:195

/ EACH AND EVERY I/O HANDLER IS AN INDEPENDENT ENTITY,		/EAG:191

/ ACCUSTOMED TO RETURNING TO THE USER DIRECTLY.  THE AMOUNT	/EAG:191

/ OF WORK NEEDED TO ALTER EVERY I/O HANDLER TO RETURN VIA A	/EAG:191

/ COMMON ROUTINE IN THE MONITOR IS MONSTROUS.  IF YOU DON'T	/EAG:191

/ AGREE JUST RECALL THAT THIS NEW EXIT MUST ONLY BE USED	/EAG:191

/ BY THE PROGRAM OR CAL SIDE OF THE HANDLERS, AND THAT THE	/EAG:191

/ INTERRUPT SIDE MUST CONTINUE TO RETURN DIRECTLY AS BEFORE.	/EAG:191

/ THEN GO LOOK AT A LISTING OF A DISK HANDLER AND WEEP.		/EAG:191

/								/EAG:191

/ ALL IS NOT LOST, HOWEVER.  IF WE ARE RUNNING ON AN API SYSTEM	/EAG:191

/ WITH API ENABLED WE CAN USE A NEAT LITTLE HARDWARE KLUDGE	/EAG:191

/ TO ACHIEVE A SOLUTION.  WE MAKE USE OF THE FACT THAT CAL'S	/EAG:191

/ IMPLICITLY RAISE THE PRIORITY LEVEL TO 4, AND THAT THE	/EAG:191

/ RETURN FROM A CAL LOWERS THE PRIORITY LEVEL BACK TO ITS	/EAG:191

/ FORMER VALUE.  AS PART OF THE COMMON CAL ENTRY ROUTINE	/EAG:191

/ WE ISSUE AN API SOFTWARE LEVEL 4 REQUEST.  THE PRIORITY	/EAG:191

/ REMAINS AT LEVEL 4 DURING OUR CAL PROCESSING.  UPON CAL	/EAG:191

/ EXIT, HOWEVER, THE LEVEL DROPS LOWER AND OUR LEVEL 4 REQUEST	/EAG:191

/ IS IMMEDIATELY GRANTED.  EUREKA!  WE HAVE JUST ACHIEVED A	/EAG:191

/ COMMON EXIT ROUTINE -- NAMELY, THE SOFTWARE LEVEL 4 INTERRUPT	/EAG:191

/ ROUTINE.  OF COURSE, IT ISN'T QUITE THIS SIMPLE, AS IS TRUE	/EAG:191

/ OF EVERY THEORY APPLIED TO THE REAL WORLD.  A FEW TRICKS	/EAG:191

/ ARE NECESSARY DUE TO THE FACT THAT WE SHARE USE OF SOFTWARE	/EAG:191

/ LEVEL 4 WITH THE DISK HANDLERS AND (POSSIBLY) THE USER,	/EAG:191

/ PLUS THE FACT THAT A LIMITED DEGREE OF NESTING OF CAL'S	/EAG:191

/ IS PERMITTED.  HOWEVER, THESE TRICKS ARE QUITE STRAIGHT-	/EAG:191

/ FORWARD AND ARE EASILY UNDERSTOOD BY EXAMINING THE CODE	/EAG:191

/ OR ELSE THE FLOW CHARTS IN THE SYSTEM MANUAL.			/EAG:191

/								/EAG:191

/ SO FOR API SYSTEMS, AT LEAST, EVERYTHING IS JUST FINE		/EAG:191

/ AND DANDY.  FOR NON-API SYSTEMS, HOWEVER, THINGS DON'T WORK	/EAG:191

/ OUT SO NICE.  UNLESS ITS A .TIMER INTERRUPT AND		/EAG:191

/ THE USER OPTS TO RETURN TO THE INTERRUPTED CODE, ALL WE	/EAG:191

/ CAN DO IS PRAY.						/EAG:191

/								/EAG:191

/ IN THE SOLE CASE OF A .TIMER INTERRUPT FOR WHICH THE USER	/EAG:191

/ OPTS TO RETURN TO THE INTERRUPTED CODE THERE IS SOMETHING	/EAG:191

/ WE CAN DO.  IF THE USER RETURNS TO THE INTERRUPTED CODE	/EAG:191

/ THERE IS THE POTENTIAL THAT, IF THE INTERRUPT OCCURED IN	/EAG:191

/ THE MIDDLE OF AN I/O HANDLER, THE I/O HANDLER CAN FINISH	/EAG:191

/ ITS PROCESSING AND EVERYONE WILL BE HAPPY.  THIS OF COURSE	/EAG:191

/ DEPENDS UPON THE USER NOT DISTURBING THE I/O HANDLER IN	/EAG:191

/ ANY WAY -- I.E. NOT ISSUEING ANY CAL'S.  AGAIN, SOME CARE	/EAG:191

/ MUST BE TAKEN IN APPLYING THIS THEORY TO THE REAL WORLD.	/EAG:191

/ RECALL THAT THE I/O HANDLER MUST RUN IN EXEC MODE AND		/EAG:191

/ THE USER MAY VERY WELL BE RUNNING IN USER MODE.  THE		/EAG:191

/ SPECIFICATION OF .TIMER STATES THAT THE USER'S INTERRUPT	/EAG:191

/ ROUTINE SHALL RUN IN THE SAME MODE AS THE USER AND THAT	/EAG:191

/ THE .TIMER INTERRUPT ROUTINE SHALL NOT USE A DBR TO RETURN	/EAG:191

/ TO THE INTERRUPTED CODE.  THUS A POTENTIAL PROBLEM EXISTS	/EAG:191

/ IN GETTING EVERYONE TO RUN IN HIS DESIRED MODE.  THE		/EAG:191

/ SOLUTION IS TO HAVE THE ROUTINE WHICH ISSUES THE .TIMER	/EAG:191

/ INTERRUPT TO THE USER DO THE FOLLOWING:			/EAG:191

/								/EAG:191

/	1.  ENTER THE USER'S OPERATING MODE.			/EAG:191

/								/EAG:191

/	2.  CALL THE USER'S .TIMER INTERRUPT ROUTINE WITH	/EAG:191

/	    AN ACTUAL JMS, RATHER THAN SIMULATING A JMS.	/EAG:191

/								/EAG:191

/	3.  REGAIN CONTROL UPON THE USER'S ROUTINE RETURNING.	/EAG:191

/								/EAG:191

/	4.  ENTER EXEC MODE AND RETURN TO THE INTERRUPTED	/EAG:191

/	    CODE, RESTORING ALL OPERATING MODES TO THEIR	/EAG:191

/	    FORMER VALUES.					/EAG:191

/								/EAG:191

/ IF THIS SEEMS LIKE A BIT OF A KLUDGE, IT IS.  NOTE THAT	/EAG:191

/ IF A HANDLER IS DOING ANY TIMING SENSITIVE OPERATIONS, THEY	/EAG:191

/ MIGHT FAIL DUE TO THIS (OF COURSE, THEY COULD FAIL DUE TO	/EAG:191

/ SOME OTHER DEVICE INTERRUPT ALSO).  ALSO NOTE THAT		/EAG:191

/ THE RETURN ADDRESS IN THE USER'S INTERRUPT ROUTINE WILL	/EAG:191

/ BE CONSTANT.  THUS .TIMER IS NO LONGER USEFUL TO OBTAIN	/EAG:191

/ PROFILES OF WHERE PROGRAMS ARE SPENDING THEIR TIME EXECUTING.	/EAG:191

/								/EAG:191

/ IT SHOULD BE NOTED THAT ALL OF THE ABOVE DISCUSSION ACTS	/EAG:191

/ ON THE IMPLICIT ASSUMPTION THAT ONLY THE PROGRAM OR CAL SIDE	/EAG:191

/ OF I/O DRIVERS CAN BE INTERRUPTED, AND THAT INTERRUPT		/EAG:191

/ SIDE PROCESSING WILL NEVER ITSELF BE INTERRUPTED.  IN THE	/EAG:191

/ CASE OF A PI SYSTEM THIS IS CLEARLY TRUE IF THE DEVICE	/EAG:191

/ HANDLER NEVER ENABLES INTERRUPTS.  IF THE HANDLER DOES	/EAG:191

/ ENABLE INTERRUPTS, THERE IS NOTHING WE CAN DO (EXCEPT		/EAG:191

/ PRAY SOME MORE).  FOR API SYSTEMS IT TURNS OUT TO NOT BE	/EAG:191

/ A PROBLEM.  WHAT WE ARE EFFECTIVELY DOING IS CAUSING		/EAG:191

/ USER LEVEL INTERRUPTS TO HAPPEN AT SOFTWARE LEVEL 4.		/EAG:191

/ SINCE THIS IS STRICTLY A SOFTWARE LEVEL, ALL I/O HANDLER	/EAG:191

/ INTERRUPT PROCESSING HAPPENS AT A HIGHER PRIORITY AND		/EAG:191

/ THUS WILL NOT BE INTERRUPTED.  THE ONLY HAZY SITUATION	/EAG:196

/ IS IN THE CASE OF I/O HANDLERS SUCH AS THE DISK HANDLERS,	/EAG:196

/ WHICH DROP THEMSELVES TO API LEVEL 4.				/EAG:196

/								/EAG:196

/ A DEFINITE POTENTIAL TIMING PROBLEM EXISTS HERE.  SUPPOSE	/EAG:196

/ WE ISSUE A .EXIT CAL AND IMMEDIATELY AFTERWARDS (BEFORE	/EAG:196

/ THE CAL HANDLER PLAYS WITH LEVEL 4) A DISK INTERRUPT OCCURS,	/EAG:196

/ AND THE DISK HANDLER QUEUES A LEVEL 4 REQUEST.  THE DISK	/EAG:196

/ HANDLER'S LEVEL 4 REQUEST CAN'T HAPPEN UNTIL THE CAL (.EXIT)	/EAG:196

/ RETURNS, WHICH IT NEVER DOES.  THE .EXIT CAL CANNOT COMPLETE,	/EAG:196

/ HOWEVER, UNTIL THE DISK HANDLER TERMINATES OPERATION.  THUS	/EAG:196

/ THE SYSTEM WILL HANG.  WE SOLVE THIS AND ALL OTHER POTENTIAL	/EAG:196

/ PROBLEMS OF THE SAME SORT BY NOT ALLOWING AN INTERRUPT TO	/EAG:196

/ OCCUR BEFORE WE HAVE FINISHED PLAYING WITH LEVEL 4.  WHEN	/EAG:196

/ THE CAL IS ISSUED WE GET ONE FREE INSTRUCTION.  WE USE THIS	/EAG:196

/ INSTRUCTION TO EXECUTE A JMS TO CL.ENT, GIVING US ANOTHER	/EAG:196

/ FREE INSTRUCTION.  THIS TIME WE EXECUTE A .INH, LOCKING OUT	/EAG:196

/ INTERRUPTS.  WE THEN PROCEED TO PLAY WITH LEVEL 4 AND EXECUTE	/EAG:196

/ A .ENB WHEN WE'RE DONE.  NOW IF WE GET A DISK HANDLER		/EAG:196

/ INTERRUPT IT IS QUEUED AHEAD OF THE CAL HANDLER'S OWN LEVEL	/EAG:196

/ 4 REQUEST (TO CL.LV4).  AS THE .EXIT (OR ANY OTHER) CAL	/EAG:196

/ ROUTINE SITS THERE LOOPING ON A .WAIT THE DISK HANDLER'S	/EAG:196

/ LEVEL 4 REQUEST GETS HONORED FIRST, BEFORE CL.LV4 IS INVOKED	/EAG:196

/ TO REALIZE THAT THE NESTED CAL WANTS US TO STAY AT LEVEL 4.	/EAG:196

/								/EAG:196

	.TITLE     CAL HANDLER PROPER

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ DEFINE BASE OF RESIDENT MONITOR, SINCE THIS IS THE FIRST	/EAG:191

/ CODE FOR IT.							/EAG:191

/								/EAG:191

								/EAG:191

RM.BAS=.							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ CAL HANDLER ENTRY POINT.  COME HERE (VIA JMS) ON ALL CAL'S	/EAG:191

/ EXCEPT CAL*'S.						/EAG:191

/								/EAG:195

/ NOTE THAT IF API IS NOT IN USE LOCATIONS CLEN.0 AND CLEN.1	/EAG:196
/ THROUGH CLEN.2-1 INCLUSIVE HAVE BEEN NOP'ED BY IN.CAL.	/EAG:196

/								/EAG:191

								/EAG:191

								/EAG:191

CL.ENT	0							/EAG:196

CLEN.0	.INH			/// LOCK OUT INTERRUPTS UNTIL	/EAG:196

				/// WE'RE DONE PLAYING WITH	/EAG:196

				/// CL.CTR AND LEVEL 4 STUFF	/EAG:196

	DAC CL.AC		/// SAVE AC			/EAG:191

	LAC CL.VCT		/// SAVE RETURN ADDRESS		/EAG:191

	DAC CL.RET						/EAG:191

	AAC -1			/// GET ADDRESS OF CAL INSTR.,	/EAG:191

	DAC .MED		/// GIVE TO ERROR ROUTINE	/EAG:192

	AND (77777)		/// MASK OUT POINTER		/EAG:191

	DAC CL.WD4		/// USE CL.WD4 AS PTR INTO CAL	/EAG:191

CLEN.1	ISZ CL.CTR		/// INCREMENT CAL LEVEL COUNTER	/EAG:191

				/// AND CHECK IF THIS IS A	/EAG:191

				/// NESTED CAL -- I.E. A CAL	/EAG:191

				/// FROM WITHIN A CAL ROUTINE.	/EAG:191

	JMP CLEN.2		/// NESTED CAL -- API LEVEL 4	/EAG:191

				/// REQUEST ALREADY SET UP	/EAG:191

	.IFDEF %HALTS						/EAG:191

	DAC CL.CHK		/// SAVE ADDRESS OF USER CAL	/EAG:191

				/// FOR LATER CHECK BY CL.LV4	/EAG:191

	.ENDC							/EAG:191

	RPL			/// SAVE OLD LEVEL 4 REQUEST	/EAG:191

	AND (API.R4)		/// (IF ANY).  WILL BE RESTORED	/EAG:191

	DAC CL.API		/// BY CL.LV4.			/EAG:191

	LAC (API.R4)		/// SET LEVEL 4 REQUEST BIT SO	/EAG:191

	ISA			/// CL.LV4 WILL BE CALLED ON	/EAG:191

				/// CAL EXIT			/EAG:191

	LAC SC.LV4		/// ALSO SAVE OLD LEVEL 4	/EAG:191

	DAC CL.SV4		/// TRANSFER VECTOR		/EAG:191

	LAC (CL.LV4)		/// AND POINT TRANSFER VECTOR	/EAG:191

	DAC SC.LV4		/// TO OUR LEVEL 4 INTERRUPT	/EAG:191

				/// ROUTINE.			/EAG:191

CLEN.2	.ENB			/// ALLOW INTERRUPTS ONCE AGAIN	/EAG:193

	ION			/// ION REQUIRED HERE BY CTRLQ	/EAG:197

	LAC (CL.IND)		/// RESTORE CL.VCT FOR CAL*'S	/EAG:191

	DAC CL.VCT						/EAG:191

	LAC* CL.WD4		/ SET UP CL.WD1			/EAG:191

	DAC CL.WD1						/EAG:191

	ISZ CL.WD4		/ BUMP POINTER TO WORD 2	/EAG:191

	LAC* CL.WD4		/ NOW GET CAL FUNCTION CODE	/EAG:191

	AND (77777)		/ AND DECIDE WHETHER ITS AN	/EAG:191

	SNA			/ I/O FUNCTION, A NON-I/O	/EAG:191

	JMP CL.ERR		/ FUNCTION, OR AN ILLEGAL	/EAG:191

	AAC -CL.IOF-1		/ FUNCTION.  ZERO IS ILLEGAL.	/EAG:191

	SPA			/ CODES 1 THROUGH CL.IOF ARE	/EAG:191

	JMP CL.IO		/ I/O FUNCTIONS			/EAG:191

	AAC -CL.NMF		/ CL.IOF+1 THROUGH		/EAG:191

	SMA			/ CL.IOF+CL.NMF ARE NON-I/O	/EAG:191

	JMP CL.ERR		/ ALL OTHERS ILLEGAL		/EAG:191

	TAD (CL.TAB+CL.NMF)	/ GET ADDR. OF DISP. TABLE	/EAG:191

	DAC CL.WD3		/ ENTRY.  USE CL.WD3 AS TEMP.	/EAG:191

	LAC* CL.WD3		/ GET ADDRESS OF CAL FUNCTION	/EAG:191

	AND (77777)		/ ROUTINE, AND PUT IN CL.DSP	/EAG:191

	DAC CL.DSP		/ FOR DISPATCH			/EAG:191

	XOR* CL.WD3		/ GET FLAG BITS FROM DISP. TAB.	/EAG:191

	CLL!RTL			/ THEY ARE LENGTH OF CAL.	/EAG:191

	RTL			/ ROTATE INTO POSITION, AND	/EAG:191

	TAD CL.RET		/ CALCULATE CAL RETURN ADDRESS	/EAG:191

	DAC CL.RET						/EAG:191

	ISZ CL.WD4		/ BUMP POINTER TO WORD 3	/EAG:191

	LAC* CL.WD4		/ NOW SET UP CL.WD3		/EAG:191

	DAC CL.WD3						/EAG:191

	ISZ CL.WD4		/ BUMP POINTER TO WORD 4	/EAG:191

	LAC* CL.WD4		/ AND SET UP CL.WD4		/EAG:191

	DAC CL.WD4						/EAG:191

	JMS* CL.DSP		/ AND CALL CAL FUNCTION ROUTINE	/EAG:191

				/ (WHICH NEED NOT RETURN)	/EAG:191

	LAC CL.AC						/EAG:191

	DBR			/ AND RETURN TO USER		/EAG:191

	JMP* CL.RET		/				/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE ON ILLEGAL CAL TO GIVE IOPS 0 ERROR			/EAG:191

								/EAG:191

CL.ERR	LAW 0							/EAG:191

	JMP .MED+1						/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE ON CAL*'S TO GIVE IOPS 1 ERROR			/EAG:191

								/EAG:191

CL.IND	0			/ ENTRY POINT			/EAG:191

	LAW -1			/ GET ADDRESS OF CAL*		/EAG:191

	TAD CL.IND						/EAG:191

	DAC .MED		/ GIVE TO ERROR ROUTINE		/EAG:191

	LAW 1							/EAG:191

	JMP .MED+1		/ AND GO TO ERROR ROUTINE	/EAG:191

	.TITLE     NON-I/O CAL DISPATCH TABLE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191
CL.IOF=13			/ CAL FUNCTION CODE OF LAST	/EAG:191

				/ I/O CAL.  ALSO NUMBER OF	/EAG:191

				/ I/O CAL FUNCTIONS		/EAG:191

								/EAG:191

								/EAG:191

CL.2WD=100000			/ FLAG BITS FOR 2 WORD CAL	/EAG:191

CL.3WD=200000			/ FLAG BITS FOR 3 WORD CAL	/EAG:191

CL.4WD=300000			/ FLAG BITS FOR 4 WORD CAL	/EAG:191

								/EAG:191

/ THE CAL DISPATCH TABLE:					/EAG:191

								/EAG:191

CL.TAB	TIMER+CL.4WD		/ CODE 14 => .TIMER		/EAG:191

	EXIT+CL.2WD		/ CODE 15 => .EXIT		/EAG:191

	SETUP+CL.4WD		/ CODE 16 => .SETUP		/EAG:191

	MTRAN+CL.2WD		/ CODE 17 => .MTRAN		/EAG:191

	XVMOFF+CL.2WD		/ CODE 20 => .XVMOFF/.XVMON	/EAG:191

	GTBUF+CL.3WD		/ CODE 21 => .GTBUF		/EAG:191

	GVBUF+CL.3WD		/ CODE 22 => .GVBUF		/EAG:191

	USER+CL.3WD		/ CODE 23 => .USER		/EAG:191

	OVRLA+CL.3WD		/ CODE 24 => .OVRLA		/EAG:191

	GET+CL.3WD		/ CODE 25 => .GET		/EAG:191

	PUT+CL.3WD		/ CODE 26 => .PUT		/EAG:191

								/EAG:191

CL.NMF=.-CL.TAB			/ NUMBER OF CAL FUNCTIONS	/EAG:191

	.TITLE     CL.IO -- I/O CAL DISPATCHER

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ COME HERE IF CAL FUNCTION CODE IS I/O FUNCTION.  HERE WE	/EAG:191

/ DETERMINE THE I/O HANDLER (FOR THE .DAT SLOT) AND DISPATCH	/EAG:191

/ TO IT.  WHEN WE GET HERE LOCATION CL.WD1 CONTAINS A COPY	/EAG:191

/ OF THE CAL INSTRUCTION AND CL.WD4 POINTS TO THE CAL		/EAG:191

/ INSTRUCTION ITSELF.						/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

CL.IO	JMS CL.DAT		/ GET DAT SLOT NUMBER		/EAG:191

	TAD SC.DAT		/ THEN DAT SLOT ADDRESS		/EAG:191

	DAC CL.DSP		/ STICK IT WHERE WE CAN USE IT	/EAG:191

	LAC* CL.DSP		/ GET DAT SLOT CONTENTS		/EAG:191

	XOR* CL.WD4		/ AND PUT DEVICE UNIT NUMBER	/EAG:191

	AND (700000) 		/ INTO WORD 2 OF CAL		/EAG:191

	XOR* CL.WD4		/				/EAG:191

	DAC* CL.WD4		/				/EAG:191

	LAC* CL.DSP		/ GET I/O HANDLER ADDRESS	/EAG:191

	AND (77777)		/				/EAG:191

	DAC CL.DSP		/ AND SAVE FOR DISPATCH		/EAG:191

	AAC -377		/ VERIFY THAT DAT SLOT IS	/EAG:191

	SPA!SNA!CLA!CMA		/ SET UP, SKIP IF IT IS		/EAG:191

	JMP CL.DSE		/ HANDLER NOT LOADED -- ERROR	/EAG:191

	TAD CL.RET		/ FORM ADDRESS OF CAL		/EAG:191

				/ IN SAME ADDRESS MODE AS USER	/EAG:191

				/ PROGRAMS)			/EAG:191

	JMP* CL.DSP		/ AND GO TO I/O HANDLER		/EAG:191

	.TITLE     CL.DAT -- DAT SLOT CALCULATOR

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ SUBROUTINE TO CALCULATE DAT SLOT NUMBERS FROM CL.WD1		/EAG:191

/ ALSO VERIFY DAT SLOT NUMBER FOR LEGALITY.			/EAG:191

/ USES CL.WD1 AS INPUT, RETURN DAT SLOT NUMBER IN AC.		/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

CL.DAT	0							/EAG:191

	LAC CL.WD1		/ GET 9 BIT DAT SLOT NUMBER	/EAG:191

	AND (777)						/EAG:191

	SNA!SWHA		/ GET SIGN BIT WHERE WE CAN	/EAG:191

	JMP CL.DSE		/ TEST IT.  ZERO => ERROR	/EAG:191

	SPA!SWHA		/ SKIP IF POS. DAT SLOT		/EAG:191

	XOR (777000)		/ NEG. DAT SLOT => SIGN EXTEND	/EAG:191

	AAC 15			/ CHECK THAT IT ISN'T TOO	/EAG:191

	SPA!TCA			/ NEGATIVE			/EAG:191

	JMP CL.DSE						/EAG:191

	AAC 15			/ RESTORE FROM AAC 15		/EAG:191

	TAD SC.SLT		/ CHECK THAT IT ISN'T		/EAG:191

	SPA!TCA			/ TOO POSITIVE			/EAG:191

	JMP CL.DSE						/EAG:191

	TAD SC.SLT		/ RESTORE FROM TAD SC.SLT	/EAG:191

	JMP* CL.DAT		/ AND RETURN			/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE IF ILLEGAL DAT SLOT TO GIVE IOPS 2 ERROR		/EAG:191

								/EAG:191

CL.DSE	LAW 2							/EAG:191

	JMP .MED+1						/EAG:191

	.TITLE     CL.LV4 -- CAL COMMON EXIT ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE IS CALLED EVERY TIME A CAL ROUTINE EXITS.  IT	/EAG:191

/ IS NOT CALLED DIRECTLY, BUT RATHER BY MEANS OF AN API		/EAG:191

/ SOFTWARE LEVEL 4 TRAP.  CAL ROUTINES ALWAYS EXECUTE AT	/EAG:191

/ PRIORITY LEVEL 4 WITH A SOFTWARE LEVEL 4 TRAP REQUESTED.	/EAG:191

/ AS SOON AS THE CAL ROUTINE EXITS (USING A DBR) THE CPU	/EAG:191

/ DROPS BELOW LEVEL 4 AND THEN IMMEDIATELY RISES BACK TO	/EAG:191

/ LEVEL 4 AS THIS ROUTINE IS INVOKED.  THIS ROUTINE THEN	/EAG:191

/ DECREMENTS THE CAL NESTING DEPTH COUNTER (CL.CTR) AND		/EAG:191

/ TAKES ACTION DEPENDING UPON WHETHER WE ARE AT THE OUTER-	/EAG:191

/ MOST CAL YET.  IF WE ARE RETURNING FROM THE OUTERMOST		/EAG:191

/ CAL THIS ROUTINE WILL RESTORE THE STATE OF THE LEVEL 4	/EAG:191

/ INTERRUPT TO WHAT IT WAS PRIOR TO THE ISSUANCE OF THE		/EAG:191

/ CAL.  IF WE ARE NOT RETURNING FROM THE OUTERMOST CAL		/EAG:191

/ (I.E., WE ARE RETURNING FROM A NESTED CAL ISSUED BY A		/EAG:191

/ CAL ROUTINE) THEN THIS ROUTINE MERELY RE-REQUESTS A LEVEL	/EAG:191

/ 4 INTERRUPT AND RETURNS TO THE INTERRUPTED CODE, WHICH WE	/EAG:191

/ KNOW TO BE A CAL ROUTINE IMMEDIATELY FOLLOWING A CAL WHICH	/EAG:191

/ IT HAS ISSUED.						/EAG:191

/								/EAG:191

/ THE NET EFFECT OF ALL THIS IS THAT (INSOFAR AS THIS		/EAG:191

/ ROUTINE IS CONCERNED) CAL'S MAY BE NESTED ARBITRARILY,	/EAG:191

/ AND THAT ALL CAL ROUTINES (NO MATTER WHAT THE NESTING		/EAG:191

/ DEPTH) WILL BE RUN AT LEVEL 4.  IT IS ALSO TRUE THAT THEY	/EAG:191

/ WILL ALWAYS RUN WITH A SOFTWARE LEVEL 4 REQUEST PENDING,	/EAG:191

/ BUT THAT IS ONLY TO INVOKE THIS ROUTINE UPON THEIR RETURN.	/EAG:191

/ AFTER ALL CAL PROCESSING IS COMPLETED (ALL NESTED CAL'S HAVE	/EAG:191

/ RETURNED) THE SOFTWARE LEVEL 4 REQUEST STATUS WILL BE		/EAG:191

/ RESTORED TO WHAT IT WAS PRIOR TO THE FIRST (ORIGINAL OR	/EAG:191

/ OUTERMOST) CAL.						/EAG:191

/								/EAG:191

/ OTHER ROUTINES CAN AND DO MAKE USE OF LEVEL 4 DURING CAL	/EAG:191

/ PROCESSING.  SO LONG AS THEY SAVE AND RESTORE LEVEL 4		/EAG:191

/ REQUESTS PROPERLY THEY WILL POSE NO PROBLEM, AS WE WILL	/EAG:191

/ GAIN CONTROL AT THE RIGHT TIME.  THE ONLY INTERACTION OF	/EAG:191

/ INTEREST IS THAT WITH THE ROUTINE RQ.LV4.  THIS ROUTINE	/EAG:191

/ IS USED TO REQUEST A SOFTWARE LEVEL 4 REQUEST WHICH IS	/EAG:191

/ GUARANTEED TO OCCUR AFTER ALL CAL PROCESSING HAS FINISHED.	/EAG:191

/ THUS A LEVEL 4 INTERRUPT REQUEST ESTABLISHED BY RQ.LV4 IS	/EAG:191

/ GUARANTEED TO INTERRUPT FROM THE USER PROGRAM (I.E. THE	/EAG:191

/ RETURN ADDRESS POINTS TO AN INSTRUCTION WITHIN THE USER	/EAG:191

/ PROGRAM).  RQ.LV4 DOES THIS BY CHECKING CL.CTR AND		/EAG:191

/ SOMETIMES PLAYING TRICKS WITH OUR SAVED LEVEL 4 STATUS	/EAG:191

/ INFORMATION IN CL.API AND CL.SV4.				/EAG:191

/								/EAG:195

/ IT SHOULD BE NOTED THAT THIS ROUTINE WILL NOT BE USED NOR	/EAG:195

/ WILL IT EVER BE INVOKED IF API IS NOT IN USE.			/EAG:195

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

CL.LV4	0			/// ENTER FROM SOFTWARE LEVEL	/EAG:191

				/// 4 TRAP			/EAG:191

	.INH			/// DISABLE INTERRUPTS SINCE	/EAG:191

				/// WE'RE PLAYING WITH LEVEL	/EAG:191

				/// 4 STATUS			/EAG:191

	DAC CLL4.A		/// SAVE AC FOR LATER RESTOR.	/EAG:191

	LAW -1			/// DECREMENT CAL LEVEL COUNTER	/EAG:191

	TAD CL.CTR		/// AND CHECK TO SEE IF IT	/EAG:191

	DAC CL.CTR		/// REACHED LOGICAL ZERO YET.	/EAG:191

	SMA!IAC			/// LOGICAL ZERO IS REPRESENTED	/EAG:191

				/// BY -1			/EAG:191

	JMP CLL4.4		/// HAVEN'T REACHED IT YET --	/EAG:191

				/// GO RETURN FROM NESTED CAL	/EAG:191

	.IFDEF %HALTS		///				/EAG:191

	SZA			/// VERIFY IT REALLY WAS -1	/EAG:191

	JMP CLL4.2		/// WASN'T -- GO TO ERROR HALT	/EAG:191

	LAC CL.LV4		/// GET INTERRUPT ADDRESS (I.E.	/EAG:191

	AND (77777)		/// ADDRESS IN USER PROGRAM TO	/EAG:191

	TCA			/// WHICH THE CAL RETURNED	/EAG:191

	TAD CL.CHK		/// CONTROL) AND CHECK IT FOR	/EAG:191

	SZA!SMA			/// VALIDITY.  CL.ENT HAS SAVED	/EAG:191

	JMP CLL4.0		/// THE ADDRESS OF THE CAL	/EAG:191

	AAC 6			/// IN CL.CHK FOR US.  THE	/EAG:191

	SMA			/// INTERRUPT ADDRESS MUST BE	/EAG:191

	JMP CLL4.3		/// THE CAL ADDRESS OR WITHIN	/EAG:191

				/// A FEW (I.E., 6) WORDS AFTER	/EAG:191

				/// IF INTERRUPT ADDRESS OK, GO	/EAG:191

				/// TO CLL4.3 TO RETURN TO USER	/EAG:191

CLL4.0	LAC* CL.CHK		/// OTHERWISE COME HERE TO	/EAG:191

	ISZ CL.CHK		/// CHECK THAT WAS APPROPRIATE	/EAG:191

	AND (777000)		/// CAL.  .WAITR OK SO LONG	/EAG:191

	SAD (1000)		/// AS IT ENDS UP AT WAIT	/EAG:191

	SKP			/// RETURN ADDRESS (IN WORD	/EAG:191

	JMP CLL4.2		/// 3 OF CAL).			/EAG:191

	LAC* CL.CHK		///				/EAG:191

	SAD (12)		///				/EAG:191

	SKP			///				/EAG:191

	JMP CLL4.2		///				/EAG:191

	ISZ CL.CHK		/// IF ANY CONDITIONS ARE NOT	/EAG:191

	LAC CL.LV4		/// MET, LOSSAGE EXISTS SO	/EAG:191

	AND (77777)		/// FALL THROUGH TO ERROR HALT	/EAG:191

	SAD* CL.CHK		///				/EAG:191

	JMP CLL4.3		///				/EAG:191

CLL4.2	HLT			/// ERROR HALT			/EAG:191

	.ENDC			///				/EAG:191

CLL4.3	LAC CL.API		/// COME HERE TO RETURN FROM	/EAG:191

	ISA			/// OUTERMOST CAL.  RESTORE	/EAG:191

	LAC CL.SV4		/// OLD LEVEL 4 STATUS, ...	/EAG:191

	DAC SC.LV4		///				/EAG:191

	LAC CLL4.A		/// ..., RESTORE AC, ...	/EAG:191

	.ENB			/// ..., ALLOW INTERRUPTS, ...	/EAG:191

	DBR			///				/EAG:191

	JMP* CL.LV4		/// ..., AND RETURN.		/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE TO RETURN FROM NESTED CAL.  RE-REQUEST A LEVEL	/EAG:191

/ 4 SOFTWARE INTERRUPT, THEN RETURN WITHOUT A DEBREAK SO WILL	/EAG:191

/ STAY AT LEVEL 4.						/EAG:191

								/EAG:191

CLL4.4	LAC (API.R4)		/// REQUEST LEVEL 4 INTERRUPT	/EAG:191

	ISA			///				/EAG:191

	LAC CLL4.A		/// RESTORE AC			/EAG:191

	.ENB			/// ENABLE INTERRUPTS		/EAG:191

	RES			/// RESTORE LINK AND MODES	/EAG:191

				/// WITHOUT DEBREAK		/EAG:191

	JMP* CL.LV4		/// AND RETURN FROM NESTED CAL	/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

CLL4.A	0			/ TEMPORARY IN WHICH TO SAVE AC	/EAG:191

	.TITLE     CAL HANDLER VARIABLES

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

CL.RET	-1			/ USED TO SAVE CAL RETURN	/EAG:191

				/ ADDRESS (I.E. USER PC)	/EAG:191

				/ WITH LINK, ADDRESSING		/EAG:191

				/ MODE, AND USER MODE FLAGS	/EAG:191

				/ IN HIGH THREE BITS.		/EAG:191

								/EAG:191

CL.AC	0			/ USED TO SAVE USER AC		/EAG:191

								/EAG:191

								/EAG:191

CL.WD1	0			/ CONTAINS WORD 1 OF THE CAL	/EAG:191

				/ (THE CAL INSTRUCTION ITSELF)	/EAG:191

								/EAG:191

CL.WD3	0			/ CONTAINS WORD 3 OF THE CAL	/EAG:191

				/ ALSO USED AS TEMPORARY BY	/EAG:191

				/ CAL DISPATCHER		/EAG:191

								/EAG:191

CL.WD4	0			/ CONTAINS WORD 4 OF THE CAL	/EAG:191

				/ ALSO USED AS TEMPORARY BY	/EAG:191

				/ CAL DISPATCHER		/EAG:191

								/EAG:191

								/EAG:191

CL.DSP	-1			/ TEMPORARY USED FOR ADDRESS	/EAG:191

				/ OF ROUTINE BEING DISPATCHED	/EAG:191

				/ TO				/EAG:191

								/EAG:191

								/EAG:191

CL.CTR	-1			/ CAL LEVEL COUNTER.  -1 IS	/EAG:191

				/ LOGICAL LEVEL ZERO -- I.E.	/EAG:191

				/ NO CAL PROCESSING IN PROGRESS	/EAG:191

								/EAG:191

								/EAG:191

CL.API	0			/ LOCATION IN WHICH TO SAVE	/EAG:191

				/ API LEVEL 4 REQUEST STATUS	/EAG:191

				/ INFORMATION DURING CAL	/EAG:191

				/ PROCESSING.			/EAG:191

								/EAG:191

CL.SV4	0			/ LOCATION IN WHICH TO SAVE THE	/EAG:191

				/ API LEVEL 4 TRAP ADDRESS	/EAG:191

				/ DURING CAL PROCESSING.	/EAG:191

								/EAG:191

								/EAG:191

	.IFDEF %HALTS						/EAG:191

CL.CHK	-1			/ USED TO SAVE POINTER TO USER	/EAG:191

				/ CAL FOR DEBUG ERROR CHECKING	/EAG:191

				/ BY CL.LV4.  CL.ENT SAVES THE	/EAG:191

				/ THE POINTER.			/EAG:191

	.ENDC							/EAG:191

								/EAG:195

								/EAG:195

	.IFUND %PRTCT						/EAG:195

CL.USR	NOP			/ THE USER/EXEC MODE SWITCH.	/EAG:195

				/ THIS LOCATION IS SET TO A	/EAG:195

				/ NOP BY .XVMOFF AND TO AN	/EAG:195

				/ MPEU BY .XVMON.  THIS ALLOWS	/EAG:195

				/ THE ERROR ROUTINES TO ENTER	/EAG:195

				/ THE PROPER MODE ON ^C, ^P,	/EAG:195

				/ ETC. AND FOR .TIMER TO CALL	/EAG:195

				/ THE USER'S ROUTINE CORRECTLY	/EAG:195

				/ WHEN API IS DISABLED.		/EAG:195

	.ENDC							/EAG:195

	.TITLE .TIMER CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ COME HERE TO HANDLER .TIMER REQUESTS				/EAG:191

/ WE START OUT BY ZEROING SC.TMT SO THAT WE WON'T GET TIMING	/EAG:195

/ PROBLEMS FROM CLOCK INTERRUPTS HAPPENING WHILE WE'RE PLAYING	/EAG:195

/ AROUND HERE.							/EAG:195

/								/EAG:191

								/EAG:191

								/EAG:191

TIMER	0							/EAG:191

	DZM SC.TMT		/ MAKE SURE .TIMER INTERRUPT	/EAG:195

				/ WON'T HAPPEN			/EAG:195

	LAC CL.WD3		/ SAVE .TIMER INTERRUPT ROUTINE	/EAG:195

	DAC SC.TMA		/ ADDRESS			/EAG:195

	LAC CL.WD4		/ AND TIME INTERVAL		/EAG:195

	DAC SC.TMT		/ WHICH REALLOWS .TIMER		/EAG:195

	JMP* TIMER		/ INTERRUPTS			/EAG:195

	.TITLE .EXIT CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ COME HERE TO PROCESS .EXIT CAL, WHICH EXITS TO NON-RESIDENT	/EAG:191

/ MONITOR.  PORTION OF THIS ROUTINE ALSO USED BY .OVRLA CAL,	/EAG:191

/ FOR SITUATION WHERE REQUESTED OVERLAY IS NOT IN OVERLAY	/EAG:191

/ TABLE, AND THUS WE MUST FETCH SYSTEM LOADER TO BRING IT IN.	/EAG:191

/								/EAG:191

/ FIRST WE ESTABLISH THE NON-RESIDENT MONITOR AS THE PROGRAM	/EAG:191

/ TO BRING IN.  THE CONTROL FLOW FROM .OVRLA JOINS US NEXT.	/EAG:191

/ THEN WE PERFORM A .INIT TO ALL .DAT SLOTS IN THE MASS STORAGE	/EAG:191

/ BUSY TABLE, SO THAT ANY FILES WHICH HAVEN'T BEEN CLOSED	/EAG:191

/ WILL BE.  THEN WE USE THE MONITOR TRAN ROUTINE (DSKTRN) TO	/EAG:191

/ READ THE RESIDENT MONITOR (PLUS SYSTEM LOADER) INTO THE	/EAG:191

/ HIGHEST BANK OF MEMORY.  FINALLY WE TRANSFER TO THE		/EAG:191

/ INITIALIZATION ROUTINE.					/EAG:191

/								/EAG:191

/ NOTE:  THE ROUTINES IO.CLR AND DSKTRN ISSUE NESTED CAL'S.	/EAG:191

/	 THUS .EXIT AND THIS BRANCH OF .OVRLA CANNOT RETURN	/EAG:191

/	 TO THEIR CALLER, AS THE NESTED CAL'S CLOBBER THE	/EAG:191

/	 CAL RETURN INFORMATION.  THUS IT IS A GOOD THING	/EAG:191

/	 THAT THESE CAL'S INVOKE THE SYSTEM LOADER RATHER	/EAG:191

/	 THAN RETURNING TO THEIR CALLER.			/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

EXIT	0			/ JMS RETURN ADDRESS NEVER USED	/EAG:191

	LAC SC.NMN		/ COPY NAME OF NON-RESIDENT	/EAG:191

	DAC SC.SPN		/ MONITOR INTO SC.SPN, SO	/EAG:191

	LAC SC.NMN+1		/ THAT MONITOR WILL BE PROGRAM	/EAG:191

	DAC SC.SPN+1		/ WE LOAD.			/EAG:191

/ NEXT LOCATION IS ENTRY POINT FROM .OVRLA ROUTINE		/EAG:191

EXIT.0	JMS IO.CLR		/ CLEAR OUT I/O -- DO .INIT	/EAG:191

				/ TO ALL ACTIVE .DAT SLOTS	/EAG:191

EXIT.1	NOP			/ THIS IS A BOSS-MODE SWITCH	/RKB-198

				/ IT IS A 'JMP BS.XT0' WHEN	/RKB-198

				/ IN BOSS MODE			/RKB-198

	LAC (EXIT.A)		/ POINT AC TO PARAMETER BLOCK	/EAG:191

	CLL			/ LINK=0 => DISK READ		/EAG:191

	JMS DSKTRN		/ AND READ IT IN		/EAG:191

	JMS RM.CAF		/// CLEAR OUT EVERYTHING.	/EAG:194

				/// RM.CAF TURNS OFF INTERRUPT	/EAG:194

				/// SYSTEM AND STOPS UNICHANNEL	/EAG:194

				/// POLLER (IF IT IS ENABLED).	/EAG:194

UCSTP1	NOP			/// ISSUE A "STOP ALL TASKS"	/EAG:195

				/// DIRECTIVE TO THE UNICHANNEL	/EAG:195

				/// IF UC15 IS ON.  THIS	/EAG:195

				/// LOCATION IS MODIFIED BY	/EAG:195

				/// IN.UC15.			/EAG:195

	JMP* EXIT.C		/// GO TO INITIALIZATION CODE	/EAG:191

								/EAG:191

								/EAG:191

/ PARAMETER BLOCK FOR MONITOR TRAN ROUTINE			/EAG:191

								/EAG:191

EXIT.A	0			/ STARTING DISK BLOCK NUMBER	/EAG:191

EXIT.B	RM.TBS-1		/ STARTING CORE ADDRESS -1	/EAG:191

				/ INITIALIZATION CODE (IN.XIT)	/EAG:191

				/ ADDS BANK BITS.		/EAG:191

	-RM.TLN			/ WORD COUNT			/EAG:191

								/EAG:191

								/EAG:191

EXIT.C	INIT			/ TRANSFER VECTOR TO INIT.	/EAG:191

				/ CODE.  INITIALIZATION CODE	/EAG:191

				/ (IN.XIT) ADDS BANK BITS.	/EAG:191

	.TITLE .SETUP CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE "CONNECTS" AN INTERRUPT ROUTINE (USUALLY IN	/EAG:191

/ AN I/O HANDLER) TO THE SKIP CHAIN AND/OR API VECTOR.  THE	/EAG:191

/ FORMAT OF THE CAL IS AS FOLLOWS:				/EAG:191

/								/EAG:191

/	CAL+API VECTOR ADDRESS	/ ZERO IF NO API VECTOR		/EAG:191

/	CAL FUNCTION CODE (16)					/EAG:191

/	IOTSKP			/ THE SKIP CHAIN SKIP IOT	/EAG:191

/	ADDR			/ ENTRY ADDRESS OF THE		/EAG:191

/				/ INTERRUPT ROUTINE		/EAG:191

/								/EAG:191

/ FOR DETAILED INFORMATION ABOUT THE FORMAT OF THE SKIP CHAIN	/EAG:191

/ SEE THE ROUTINE IN.SKP IN THE RESIDENT MONITOR INITIALIZATION	/EAG:191

/ CODE.  THAT ROUTINE (IN.SKP) ALSO SETS UP LOCATIONS STUP.2,	/EAG:191

/ STUP.X, AND STUP.Y FOR THIS ROUTINE.				/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

SETUP	0							/EAG:191

	LAC STUP.X		/ PICK UP TWO'S COMPLEMENT OF	/EAG:191

	DAC STUP.A		/ # OF SKIP CHAN ENTRIES AND	/EAG:191

				/ PUT INTO TEMPORARY		/EAG:191

	LAC STUP.Y		/ PICK UP POINTER TO FIRST SKIP	/EAG:191

				/ CHAIN ENTRY			/EAG:191

STUP.0	DAC STUP.B		/ PUT POINTER TO NEXT SKIP	/EAG:191

				/ ENTRY INTO TEMP.		/EAG:191

	LAC* STUP.B		/ PICK UP SKIP IOT		/EAG:191

	SAD CL.WD3		/ MATCH ONE WE'RE LOOKING FOR?	/EAG:191

	JMP STUP.1		/ YES -- GO SET UP ENTRY	/EAG:191

	LAC STUP.B		/ CALCULATE ADDRESS OF NEXT	/EAG:191

	AAC 4			/ ENTRY				/EAG:191

	ISZ STUP.A		/ REACHED END OF CHAIN YET?	/EAG:191

	JMP STUP.0		/ NO -- KEEP LOOKING		/EAG:191

	LAW 5			/ SKIP NOT IN SKIP CHAIN --	/EAG:191

	JMP .MED+1		/ IOPS 5 ERROR			/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE WHEN WE HAVE FOUND THE DESIRED SKIP CHAIN ENTRY.	/EAG:191

/ STUP.B POINTS TO THE SKIP IOT WITHIN THE ENTRY.		/EAG:191

								/EAG:191

STUP.1	LAC STUP.B		/ CALCULATE ADDRESS OF TRANSFER	/EAG:191

	AAC 3			/ VECTOR AND PUT IT IN STUP.A	/EAG:191

	DAC STUP.A						/EAG:191

	ISZ STUP.B		/ BUMP PTR TO WORD 2 OF ENTRY	/EAG:191

	LAC CL.WD1		/ CHECK IF API .SETUP REQUEST	/EAG:191

STUP.2	SZA			/ SKIP IF NOT API .SETUP.  THIS	/EAG:191

				/ INSTRUCTION IS SET UP BY	/EAG:191

				/ IN.SKP.  IT IS A SZA IF API	/EAG:191

				/ IS ENABLED, A SKP IF API IS	/EAG:191

				/ DISABLED.			/EAG:191

	JMP STUP.4		/ API .SETUP -- GO DO IT	/EAG:191

	LAC STUP.A		/ CALCULATE JMP* THROUGH LAST	/EAG:191

	TAD (JMP+20000)		/ WORD OF SKIP CHAIN		/EAG:191

	ISZ* STUP.A		/ IS THIS A NEGATIVE SKIP?	/EAG:191

	JMP STUP.3		/ IF SO, ITS BEEN SET UP BEFORE	/EAG:191

	DAC* STUP.B		/ NEG. SKIP -- PUT JMP* INTO	/EAG:191

	JMP STUP.5		/ WORD 2, AND GO DO XFER VECTOR	/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE FOR NON-API SETUP IN TWO CASES:  1) POSITIVE SKIPS	/EAG:191

/ 2) NEGATIVE SKIPS WHICH HAVE BEEN SET UP BEFORE.  WHEN WE	/EAG:191

/ GET HERE STUP.B IS POINTING TO WORD 2 OF THE SKIP CHAIN ENTRY	/EAG:191

								/EAG:191

STUP.3	SAD* STUP.B		/ IS IT NEG. SKIP SET UP BEFORE	/EAG:191

	JMP STUP.5		/ YES -- GO DO XFER VECTOR	/EAG:191

	ISZ STUP.B		/ BUMP PTR TO WORD 3, AND PUT	/EAG:191

	DAC* STUP.B		/ JMP* INTO WORD 3		/EAG:191

	JMP STUP.5		/ THEN GO DO XFER VECTOR	/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE FOR API SETUP.  WE DON'T CARE WHETHER THE SKIP IS	/EAG:191

/ POSITIVE OR NEGATIVE.  JUST SET UP API VECTOR AND XFER VECTOR	/EAG:191

								/EAG:191

STUP.4	LAC STUP.A		/ CALCULATE JMS* THROUGH LAST	/EAG:191

	TAD (JMS+20000)		/ WORD OF ENTRY (XFER VECTOR)	/EAG:191

	DAC* CL.WD1		/ STICK INTO API VECTOR		/EAG:191

	TAD (JMP+1-JMS-20000)	/ CALCULATE JMP TO NEXT ENTRY	/EAG:191

	ISZ STUP.B		/ BUMP POINTER TO WORD 3 OF	/EAG:191

	DAC* STUP.B		/ ENTRY AND PUT JMP INTO IT	/EAG:191

STUP.5	LAC CL.WD4		/ PICK UP INTERRUPT ENTRY ADDR.	/EAG:191

	DAC* STUP.A		/ AND PUT IT INTO XFER VECTOR	/EAG:191

	JMP* SETUP						/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

STUP.A	-1			/ TEMPORARY			/EAG:191

								/EAG:191

STUP.B	-1			/ TEMPORARY			/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THE FOLLOWING TWO LOCATIONS ARE INITIALIZED BY THE ROUTINE	/EAG:191

/ IN.SKP.							/EAG:191

/								/EAG:191

								/EAG:191

STUP.X	0			/ WILL CONTAIN THE TWO'S COM-	/EAG:191

				/ PLEMENT OF THE NUMBER OF	/EAG:191

				/ ENTRIES (SKIPS) IN THE SKIP	/EAG:191

				/ CHAIN.			/EAG:191

								/EAG:191

STUP.Y	0			/ WILL CONTAIN THE ADDRESS OF	/EAG:191

				/ FIRST ENTRY (SKIP) IN THE	/EAG:191

				/ SKIP CHAIN			/EAG:191

	.TITLE .MTRAN CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE ALLOWS THE USER TO USE THE RESIDENT MONITOR	/EAG:191

/ TRAN ROUTINE (DSKTRN).  BEFORE ISSUEING THIS CAL THE USER	/EAG:191

/ SHOULD POINT THE AC TO A PARAMETER BLOCK AND INDICATE THE	/EAG:191

/ TRANSFER DIRECTION WITH THE LINK.  THE FORMAT OF THE		/EAG:191

/ PARAMETER BLOCK IS AS FOLLOWS:				/EAG:191

/								/EAG:191

/	AC --->	BLKNUM		/ STARTING DISK BLOCK NUMBER	/EAG:191

/		CORADR		/ STARTING CORE ADDRESS -1	/EAG:191

/		WRDCNT		/ WORD COUNT (2'S COM.)		/EAG:191

/		RETADR		/ RETURN ADDRESS FOLLOWING	/EAG:191

/				/ TRANSFER			/EAG:191

/								/EAG:191

/ THE TRANSFER DIRECTION FLAG IN THE LINK SHOULD BE AS FOLLOWS:	/EAG:191

/								/EAG:191

/	LINK=0 => DISK READ					/EAG:191

/								/EAG:191

/	LINK=1 => DISK WRITE					/EAG:191

/								/EAG:191

/ IT SHOULD BE NOTED THAT THIS CAL DOES NOT RETURN IN THE	/EAG:191

/ NORMAL MANNER, SINCE IT CALLS DSKTRN WHICH ISSUES NESTED	/EAG:191

/ CAL'S.  THE USER'S OPERATING MODE BITS ARE APPENDED TO	/EAG:191

/ THE RETURN ADDRESS WHICH HE SUPPLIES AND THIS RESULTING	/EAG:191

/ RETURN QUANTITY IS SAVED IN A TEMPORARY.  THIS QUANTITY	/EAG:191

/ IS THEN USED TO RETURN TO THE USER FOLLOWING USE OF DSKTRN.	/EAG:191

/ ONLY THE USER'S OPERATING MODES ARE PRESERVED -- ALL OF	/EAG:191

/ HIS ACTIVE REGISTERS ARE CLOBBERED.				/EAG:191

/								/EAG:191

/ FOR COMPATABILITY WITH PRIOR MONITORS THE LABEL RM.TRN	/EAG:191

/ AND THE CODE FOLLOWING IT IS PROVIDED.  THIS IS FOR		/EAG:191

/ PROGRAMS WHICH EXPECT TO INVOKE THE MONITOR TRAN ROUTINE	/EAG:191

/ BY JUMPING TO .SCOM LOCATION SC.TRN.  THE INITIALIZATION	/EAG:191

/ ROUTINE IN.TRN SETS UP .SCOM LOCATION SC.TRN TO CONTAIN	/EAG:191

/ A JUMP TO RM.TRN. THE CODE FOLLOWING LABEL RM.TRN RUNS	/EAG:191

/ IN USER MODE!							/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

MTRAN	0							/EAG:191

	LAC CL.AC		/ CALCULATE POINTER TO RETURN	/EAG:191

	AAC 3			/ ADDRESS AND PUT IT INTO	/EAG:191

	DAC RMTR.A		/ A TEMPORARY			/EAG:191

	.IFDEF %HALTS						/EAG:191

	LAC CL.CTR		/ CHECK IF AT BASE LEVEL CAL	/EAG:191

	SZA			/ SKIP IF YES			/EAG:191

	JMP RMTR.0		/ IF NOT, DON'T DO ANYTHING	/EAG:191

	LAC* RMTR.A		/ THIS IS BASE LEVEL CAL --	/EAG:191

	AND (77777)		/ STICK RETURN ADDRESS INTO	/EAG:191

	DAC CL.CHK		/ CL.CHK FOR CL.LV4 ERROR CHK.	/EAG:191

	.ENDC							/EAG:191

RMTR.0	LAC* RMTR.A		/ PICK UP RESTART ADDRESS	/EAG:191

	XOR CL.RET		/ AND APPEND MODE BITS		/EAG:191

	AND (77777)						/EAG:191

	XOR CL.RET						/EAG:191

	DAC RMTR.A		/ AND SAVE FOR LATER		/EAG:191

	RAL			/ PUT USER LINK BACK INTO LINK	/EAG:191

	LAC CL.AC		/ PICK UP ADDRESS OF PARM. BLK	/EAG:191

	JMS DSKTRN		/ AND DO TRANSFER		/EAG:191

	DBR			/ AND RETURN TO USER AT HIS	/EAG:191

	JMP* RMTR.A		/ RESTART ADDRESS		/EAG:191

								/EAG:191

								/EAG:191

RMTR.A	0			/ TEMPORARY TO SAVE USER	/EAG:191

				/ RESTART ADDRESS		/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/ CODE PROVIDED FOR COMPATABILITY WITH PREVIOUS MONITORS.	/EAG:191

								/EAG:191

RM.TRN	.MTRAN							/EAG:191

	.IFDEF %HALTS						/EAG:191

	HLT			/ JUST IN CASE			/EAG:191

	.ENDC							/EAG:191

	.TITLE .XVMOFF/.XVMON CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO TURN XVM MODE (I.E. USER MODE) ON AND OFF.		/EAG:191

/ THE USER COULD DO THIS HIMSELF WITH APPROPRIATE IOT'S		/EAG:191

/ AND INDIRECT REFERENCES, BUT IT IS FELT THAT PROVIDING	/EAG:191

/ THIS CAL FUNCTION ROUTINE PRODUCES A CLEANER INTERFACE.	/EAG:191

/ ALSO IT IS NECESSARY TO MAINTAIN A SWITCH (CL.USR) FOR THE	/EAG:192

/ ERROR ROUTINES INDICATING WHETHER WE ARE CURRENTLY IN USER	/EAG:192

/ MODE OR EXEC MODE.						/EAG:192

/								/EAG:191

/ THE FIRST WORD OF THE CAL IS USED AS A SUB-FUNCTION		/EAG:191

/ WORD.  IF IT IS ZERO THE CAL IS A .XVMOFF.  IF IT IS		/EAG:191

/ ONE THE CAL IS .XVMON.  ALL OTHER SUBFUNCTIONS ARE RESERVED	/EAG:191

/ FOR LATER USE.  THE NET EFFECT OF THE CURRENT DEFINITION	/EAG:191

/ IS THAT BIT 17 IS COPIED INTO THE EXEC/USER MODE BIT OF	/EAG:191

/ THE USER RETURN ADDRESS WORD IN CL.RET.			/EAG:191

/								/EAG:193

/ NOTE THAT IF XVM MODE IS DISABLED (I.E. BIT SC.XVM OF SC.MOD	/EAG:193

/ IS CLEAR) THEN ROUTINE IN.XVM WILL PUT A JMP CL.ERR IN	/EAG:193

/ LOCATION XVMOFF+1.  THUS THE .XVMON AND .XVMOFF CAL'S ARE	/EAG:193

/ ILLEGAL IF XVM MODE IS DSABLED, AND RESULT IN AN IOPS 0.	/EAG:193

/								/EAG:193

/ IF %PRTCT IS DEFINED THE USER IS ALWAYS IN USER MODE, AND	/EAG:193

/ WE SWITCH XVM MODE ON AND OFF BY CHANGING THE G-MODE BITS IN	/EAG:193

/ THE MM REGISTER.						/EAG:193

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

	.IFUND %PRTCT						/EAG:193
XVMOFF	0							/EAG:191
	LAC CL.WD1		/ PICK UP SUBFUNCTION CODE	/EAG:191
	RAR			/ AND SHIFT BIT 17 INTO LINK.	/EAG:192
	LAC CL.CTR		/ ONLY CHANGE CL.USR IF TOP	/EAG:192
	SZA			/ LEVEL CAL (I.E., ISSUED BY	/EAG:192
	JMP XMOF.1		/ USER LEVEL PROGRAM)		/RKB-203
	LAC (NOP)		/ SET CL.USR TO A NOP IF THIS	/EAG:192
	SZL			/ IS AN .XVMOFF (LINK=0) OR	/EAG:192
XMOF.0	LAC (MPEU)		/ ELSE SET IT TO AN MPEU IF	/EAG:192
	DAC CL.USR		/ THIS IS AN .XVMON (LINK=1).	/EAG:192
XMOF.1	RAR			/ NOW SHIFT BIT 17 INTO		/EAG:191
	RTR			/ USER/EXEC MODE BIT POS.	/EAG:191

	XOR CL.RET		/ AND FORCE INTO CL.RET		/EAG:191

	AND (100000)						/EAG:191

	XOR CL.RET						/EAG:191

	DAC CL.RET						/EAG:191

	JMP* XVMOFF		/ AND RETURN			/EAG:191

	.ENDC							/EAG:193

								/EAG:193

								/EAG:193

	.IFDEF %PRTCT						/EAG:193

XVMOFF	0							/EAG:193

	LAC CL.WD1		/ PICK UP SUBFUNCTION CODE	/EAG:193

	RAR			/ AND SHIFT BIT 17 INTO LINK.	/EAG:193

	RDMM			/ PICK UP MM REGISTER.		/EAG:193

	AND (477777)		/ MASK OUT G-MODE BITS		/EAG:193

	SZL			/ SKIP IF XVMOFF		/EAG:193
XMOF.0	XOR (300000)		/ XVMON -- SET G-MODE		/EAG:193

	LDMM			/ AND PUT INTO MM REGISTER	/EAG:193

	JMP* XVMOFF						/EAG:193

	.ENDC							/EAG:193

	.TITLE .GTBUF/.GVBUF CAL FUNCTION ROUTINES

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO ALLOCATE A SYSTEM BUFFER.  SYSTEM BUFFERS ARE	/EAG:191

/ INITIALLY CREATED BY ONE OF THE LOADERS.  THE TOTAL NUMBER	/EAG:191

/ OF SYSTEM BUFFERS IS STORED IN SC.BNM.  THE BASE ADDRESS OF	/EAG:191

/ THE BUFFER TABLE IS STORED IN SC.BTB.  THE BUFFER TABLE	/EAG:191

/ IS MADE UP OF ONE WORD ENTRIES, ONE FOR EACH BUFFER.  EACH	/EAG:191

/ ENTRY CONTAINS EITHER THE BASE ADDRESS OF THE BUFFER, IF THE	/EAG:191

/ BUFFER IS FREE, OR THE ONES COMPLEMENT OF THE ADDRESS, IF	/EAG:191

/ BUFFER IS IN USE.						/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

GTBUF	0							/EAG:191

	JMS GVBF.0		/ CALL COMMON SEARCH ROUTINE	/EAG:191

	  SPA			/ SKIP IS ARG TO GVBF.0		/EAG:191

	  DAC* GVBF.B		/ FOUND RETURN -- MARK BUFFER	/EAG:191

				/ IN USE			/EAG:191

	CMA			/ NOT FOUND RETURN		/EAG:191

				/ CMA GETS ADDR OF BUFFER OR -1	/EAG:191

				/ INTO AC			/EAG:191

	DAC CL.AC		/ PASS INFO TO USER		/EAG:191

	JMP* GTBUF						/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO DE-ALLOCATE A SYSTEM BUFFER.  SEE COMMENTS		/EAG:191

/ FOR .GTBUF FOR DESCRIPTION OF SYSTEM				/EAG:191

/ BUFFERS AND THE SYSTEM BUFFER TABLE.  THIS CAL CONTAINS	/EAG:191

/ THE BASE ADDRESS OF THE BUFFER TO BE FREED IN WORD 3		/EAG:191

/ OF THE CAL.  IF THE ADDRESS DOES NOT CORRESPOND TO ANY	/EAG:191

/ EXISTENT SYSTEM BUFFER THE CAL IS IGNORED, RATHER THAN	/EAG:191

/ AN ERROR BEING CAUSED.					/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

GVBUF	0							/EAG:191

	JMS GVBF.0		/ CALL COMMON SEARCH ROUTINE	/EAG:191

	  SAD CL.WD3		/ SKIP IS ARG TO GVBF.0		/EAG:191

	  DAC* GVBF.B		/ FOUND RETURN -- FLAG BUFFER	/EAG:191

				/ NOT IN USE			/EAG:191

	JMP* GVBUF		/ NOT FOUND RETURN -- DONE	/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ COMMON ROUTINE TO SEARCH SYSTEM BUFFER TABLE.  CALLING	/EAG:191

/ SEQUENCE:							/EAG:191

/								/EAG:191

/	JMS GVBF.0						/EAG:191

/	  SKIP INSTR.						/EAG:191

/	  FOUND RETURN						/EAG:191

/	  NOT FOUND RETURN					/EAG:191

/								/EAG:191

/ THE SKIP INSTRUCTION IS EXECUTED WITH THE ONE'S COMPLEMENT	/EAG:191

/ OF THE BUFFER TABLE ENTRY IN THE AC.  IT SHOULD SKIP IFF.	/EAG:191

/ THE BUFFER (ENTRY) IS NOT DESIRED.  THIS ROUTINE RETURNS	/EAG:191

/ AS SOON AS IT FINDS AN ENTRY FOR WHICH THE SKIP INSTRUCTION	/EAG:191

/ THE RETURN IS MADE TO THE SKIP INSTRUCTION WITH GVBF.B	/EAG:191

/ POINTING TO THE BUFFER TABLE ENTRY AND WITH THE AC		/EAG:191

/ CONTAINING THE ONE'S COMPLEMENT OF THE ENTRY CONTENTS.	/EAG:191

/ THE SKIP INSTRUCTION WILL NOT SKIP AND THUS THE FOUND		/EAG:191

/ RETURN WILL BE EXECUTED.					/EAG:191

/								/EAG:191

/ IF NO ENTRY CAUSES THE SKIP INSTRUCTION TO NOT SKIP A		/EAG:191

/ NOT FOUND RETURN IS TAKEN.  THE AC IS CLEARED AND AGAIN WE	/EAG:191

/ RETURN TO THE SKIP INSTRUCTION.  THE SKIP INSTRUCTION MUST	/EAG:191

/ SKIP IF ZERO IS IN THE AC, THUS CAUSING US TO TAKE THE	/EAG:191

/ NOT FOUND RETURN.						/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

GVBF.0	0							/EAG:191

	LAC SC.BNM		/ PICK UP # OF BUFFERS		/EAG:191

	SNA!TCA			/ CHECK FOR ZERO AND MAKE LOOP	/EAG:191

				/ COUNTER			/EAG:191

	JMP* GVBF.0		/ NO BUFFERS, THUS NOT FOUND.	/EAG:191

				/ RETURN WITH ZERO IN AC.	/EAG:191

	DAC GVBF.A		/ PUT LOOP COUNTER INTO TEMP	/EAG:191

	LAC SC.BTB		/ PICK UP POINTER TO BUFFER	/EAG:191

	DAC GVBF.B		/ TABLE AND PUT INTO TEMP.	/EAG:191

GVBF.1	LAC* GVBF.B		/ GET ONE'S COMPLEMENT OF NEXT	/EAG:191

	CMA			/ BUFFER TABLE ENTRY INTO AC	/EAG:191

	XCT* GVBF.0		/ XCT SKIP INSTR. TO SEE IF	/EAG:191

				/ WE'VE FOUND ONE WE'RE LOOKING	/EAG:191

				/ FOR				/EAG:191

	JMP* GVBF.0		/ SKIP INSTR. DIDN'T SKIP, THUS	/EAG:191

				/ HAVE FOUND IT.  RETURN WITH	/EAG:191

				/ ONE'S COMPLE. OF ENTRY IN AC	/EAG:191

	ISZ GVBF.B		/ THIS ENTRY NOT OK.  BUMP PTR	/EAG:191

				/ TO NEXT ENTRY			/EAG:191

	ISZ GVBF.A		/ REACHED END OF TABLE YET?	/EAG:191

	JMP GVBF.1		/ NO, KEEP LOOKING		/EAG:191

	CLA			/ YES, RETURN ZERO IN AC	/EAG:191

	JMP* GVBF.0						/EAG:191

								/EAG:191

								/EAG:191

GVBF.A	0			/ TEMPORARY USED FOR LOOP CTR	/EAG:191

								/EAG:191

GVBF.B	0			/ TEMPORARY USED FOR POINTER	/EAG:191

				/ INTO BUFFER TABLE.  CONTENTS	/EAG:191

				/ USED BY CALLER AFTER RETURN	/EAG:191

	.TITLE .USER CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO UPDATE UFD NAME (FOR A PARTICULAR .DAT SLOT)	/EAG:191

/ STORED IN .UFD TABLE.  THE NEW UFD IS IN WORD 3 OF THE	/EAG:191

/ CAL.								/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191
USER	0							/EAG:191

	JMS CL.DAT		/ GET .DAT SLOT NUMBER		/EAG:191

	TAD SC.UFD		/ POINT TEMP. AT PROPER		/EAG:191
	DAC USER.A		/ .UFD ENTRY			/EAG:191
	LAC	SC.NMF		/ CHECK FOR MIC TRANSLATION	/RKB-207
	AND	(SC.MIC)	/ ARE WE MICLOGGED?		/RKB-207
	SNA			/ SKIP IF YES			/(RKB-207)
	JMP	USER.1		/ NO, ALWAYS TRANSLATE 'SYS'	/RKB-207
	LAC	SC.UIC		/ THIS IS THE MIC CODE		/RKB-207
	SAD	CL.WD3		/ ARE WE TALKING ABOUT THE MIC?	/RKB-207
	JMP	USER.2		/ YES, TRANSLATE IT TO BNK, PAG	/RKB-207
USER.1	LAC CL.WD3		/ PICK UP NEW UFD CODE		/EAG:191
	SAD	(233123)	/ IS IT 'SYS'?			/RKB-206
	SKP			/ YES, THEN IT NEED TRANSLATING	/RKB-206
	JMP	USER.3		/ NOT 'SYS', CONTINUE		/RKB-206
USER.2	LAC	SC.MOD		/ FIND OUT WHICH MODE WE'RE IN	/RKB-206
	AND	(SC.BNK)	/ BANK OR PAGE?			/RKB-206
	SNA!CLA			//				/RKB-206
	LAC	(156274)	/ PAGE (THIS IS 'PAG-BNK')	/RKB-206
	TAD	(021613)	/ BANK (THIS IS 'BNK')		/RKB-206
USER.3	DAC* USER.A		/ AND PUT IN .UFD		/RKB-206

	JMP* USER		/ RETURN			/EAG:191

								/EAG:191

								/EAG:191

USER.A	0			/ TEMPORARY USED FOR POINTER	/EAG:191

				/ TO .UFD ENTRY			/EAG:191

	.TITLE .OVRLA CAL FUNCTION ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO BRING IN OVERLAYS FOR CORE IMAGE SYSTEM PROGRAMS.	/EAG:191

/ WORD 3 OF THE CAL POINTS TO TWO WORDS WHICH CONTAIN THE	/EAG:191

/ NAME, IN .SIXBT, OF THE OVERLAY TO BE BROUGHT IN.  IN SYSBLK	/EAG:191

/ AND COMBLK, EACH SYSTEM PROGRAM IS DEFINED WITH A LIST OF	/EAG:191

/ OVERLAYS.  THE SYSTEM LOADER BUILDS AN OVERLAY TABLE FROM	/EAG:191

/ THIS INFORMATION AND POINTS SC.OTB TO IT.  WHEN A SYSTEM	/EAG:191

/ PROGRAM REQUESTS THAT WE BRING IN AN OVERLAY, WE FIRST SEARCH	/EAG:191

/ THE OVERLAY TABLE.  IF THE REQUESTED OVERLAY IS FOUND WE	/EAG:191

/ BRING IT IN (USING THE MONITOR TRAN ROUTINE) AND TRANSFER	/EAG:191

/ CONTROL TO IT, RETAINING CURRENT I/O HANDLERS AND OTHER	/EAG:191

/ PARTS OF THE CURRENT CORE LOAD.  IF THE REQUESTED OVERLAY	/EAG:191

/ IS NOT FOUND IN THE OVERLAY TABLE, WE INVOKE THE SYSTEM	/EAG:191

/ LOADER TO BRING IT IN FOR US.  THIS OF COURSE WIPES OUT THE	/EAG:191

/ CURRENT CORE LOAD, INCLUDING ALL I/O HANDLERS.		/EAG:191

/								/EAG:191

/ EACH ENTRY IN THE OVERLAY TABLE IS OTB.LN WORDS LONG.  THE	/EAG:191

/ CONTENTS OF THE WORDS WITHIN EACH ENTRY ARE AS FOLLOWS:	/EAG:191

/								/EAG:191

/	WORD 1	FIRST 3 CHAR.'S OF NAME (.SIXBT)		/EAG:191

/	WORD 2	SECOND 3 CHAR.'S OF NAME (.SIXBT)		/EAG:191

/	WORD 3	FIRST DISK BLOCK OF OVERLAY			/EAG:191

/	WORD 4	STARTING CORE ADDRESS -1 (FOR DISK TRANSFER)	/EAG:191

/	WORD 5	WORD COUNT (LENGTH OF OVERLAY) (TWO'S COMPLE.)	/EAG:191

/	WORD 6	OVERLAY PROGRAM START ADDRESS			/EAG:191

/								/EAG:191

/ FOLLOWING THE LAST ENTRY IN THE OVERLAY TABLE IS A WORD	/EAG:191

/ CONTAINING ZERO.						/EAG:191

/								/EAG:191

/ THE .OVRLA CAL NORMALLY DOES NOT RETURN.  THE ONLY POSSIBLE	/EAG:191

/ RETURN IS AN ERROR RETURN, TAKEN IF THE REQUESTED OVERLAY	/EAG:191

/ WILL NOT FIT IN MEMORY.  THIS IS GOOD BECAUSE, IN ORDER	/EAG:191

/ TO BRING IN THE OVERLAY, THIS ROUTINE INVOKES ROUTINES	/EAG:191

/ (NOTABLY DSKTRN) WHICH PERFORM NESTED CAL'S.  THIS CLOBBERS	/EAG:191

/ THE CAL RETURN INFORMATION, SO WE COULDN'T RETURN NORMALLY	/EAG:191

/ IF WE WANTED TO.						/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

OVRLA	0							/EAG:191

	LAC* CL.WD3		/ COPY OVERLAY NAME TO SC.SPN	/EAG:191

	DAC SC.SPN		/ THIS BOTH PUTS IT IN A	/EAG:191

	ISZ CL.WD3		/ CONVENIENT PLACE FOR US TO	/EAG:191

	LAC* CL.WD3		/ USE IT AND ALSO PUTS IT	/EAG:191

	DAC SC.SPN+1		/ WHERE THE SYSTEM LOADER WILL	/EAG:191

				/ WANT IT, IN CASE WE MUST	/EAG:191

				/ INVOKE THE SYSTEM LOADER.	/EAG:191

	LAC SC.OTB		/ IS THERE AN OVERLAY TABLE?	/EAG:191

	SNA			/ ZERO IF NONE			/EAG:191

	JMP EXIT.0		/ IF NONE, GO INVOKE SYS. LDR.	/EAG:191

OVRL.0	DAC OVRL.A		/ POINT OVRL.A TO TABLE ENTRY	/EAG:191

	LAC* OVRL.A		/ REACHED END OF TABLE YET?	/EAG:191

	ISZ OVRL.A		/ (BUMP POINTER TO WORD 2)	/EAG:191

	SNA			/ SKIP IF NO			/EAG:191

	JMP EXIT.0		/ DIDN'T FIND OVERLAY IN TABLE	/EAG:191

				/ GO USE SYSTEM LOADER		/EAG:191

	SAD SC.SPN		/ NAMES MATCH?			/EAG:191

	SKP			/ YES, CHECK NEXT 3 CHARACTERS	/EAG:191

	JMP OVRL.1		/ NO, ADVANCE TO NXT ENTRY	/EAG:191

	LAC* OVRL.A		/ CHECK SECOND 3 CHARACTERS	/EAG:191

	SAD SC.SPN+1						/EAG:191

	JMP OVRL.2		/ MATCH -- GO BRING IT IN	/EAG:191

OVRL.1	LAC OVRL.A		/ ADVANCE TO NEXT ENTRY		/EAG:191

	AAC OTB.LN-1						/EAG:191

	JMP OVRL.0		/ AND CHECK IT OUT		/EAG:191

								/EAG:191

								/EAG:191

/ COME HERE WHEN WE HAVE FOUND THE ENTRY FOR THE REQUESTED	/EAG:191

/ OVERLAY.  OVRL.A IS POINTING TO WORD 2 OF THE ENTRY.		/EAG:191

								/EAG:191

OVRL.2	ISZ OVRL.A		/ BUMP POINTER TO WORD 4 OF THE	/EAG:191

	ISZ OVRL.A		/ ENTRY (STARTING CORE ADDR.)	/EAG:191

	LAC* OVRL.A		/ CHECK THAT OVERLAY WILL	/EAG:191

	CMA!STL			/ FIT IN CORE			/EAG:191

	TAD SC.FRL						/EAG:191

	SNL!CLA!CMA		/ SKIP IF IT FITS		/EAG:191

	JMP OVRL.4		/ GO TAKE FAILURE EXIT		/EAG:191

	LAC* OVRL.A		/ UPDATE FREE CORE POINTER	/EAG:191

	DAC SC.FRL+1						/EAG:191

	ISZ OVRL.A		/ BUMP POINTER TO WORD 6 OF	/EAG:191

	ISZ OVRL.A		/ ENTRY (PROGRAM START ADDR.)	/EAG:191

	.IFDEF %HALTS						/EAG:191

	LAC CL.CTR		/ CHECK IF AT BASE LEVEL CAL	/EAG:191

	SZA			/ SKIP IF YES			/EAG:191

	JMP OVRL.3		/ NOT BASE LEVEL CAL, DON'T DO	/EAG:191

				/ DO ANYTHING			/EAG:191

	LAC* OVRL.A		/ PUT RETURN ADDRESS INTO	/EAG:191

	AND (77777)		/ CL.CHK SO CL.LV4 CAN DO	/EAG:191

	DAC CL.CHK		/ ERROR CHECKING OF RETURN ADDR	/EAG:191

	.ENDC							/EAG:191

OVRL.3	LAC* OVRL.A		/ FUDGE CAL RETURN ADDRESS	/EAG:191

	XOR CL.RET		/ SO WE WILL START OVERLAY	/EAG:191

	AND (77777)		/ AT ITS STARTING ADDRESS	/EAG:191

	XOR CL.RET						/EAG:191

	DAC OVRL.B		/ AND SAVE IT			/EAG:191

	LAC OVRL.A		/ POINT AC TO PARAMETER BLOCK	/EAG:191

	AAC -3			/ FOR MONITOR TRAN ROUTINE	/EAG:191

	CLL							/EAG:191

	JMS DSKTRN		/ AND READ IN OVERLAY		/EAG:191

	DBR			/ RESTORE USER OPERATING MODES	/EAG:191

	JMP* OVRL.B		/ AND TRANSFER TO OVERLAY	/EAG:191

								/EAG:191

								/EAG:191

/ FAILURE RETURN -- OVERLAY DOESN'T FIT IN CORE			/EAG:191

/ AC CONTAINS -1 WHEN WE GET HERE.				/EAG:191

								/EAG:191

OVRL.4	DAC CL.AC		/ RETURN -1 IN AC		/EAG:191

	JMP* OVRLA		/ AND RETURN			/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

OVRL.A	-1			/ TEMPORARY USED AS POINTER	/EAG:191

				/ INTO OVERLAY TABLE		/EAG:191

								/EAG:191

OVRL.B	-1			/ TEMPORARY IN WHICH TO SAVE	/EAG:191

				/ START ADDRESS OF OVERLAY	/EAG:191

	.TITLE .PUT/.GET CAL FUNCTION ROUTINES

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ FOLLOWING ARE THE ROUTINES TO IMPLEMENT .PUT AND .GET.	/EAG:197

/ VARIATIONS ON THESE CAL'S IMPLEMENT ^Q DUMPS AND THE		/EAG:197

/ NON-RESIDENT MONITOR GET AND PUT COMMANDS.			/EAG:197

/								/EAG:197

/ NOTE THAT THE .GET CAL NEVER RETURNS TO THE USER.  THE	/EAG:197

/ .PUT CAL DOES, BUT ONLY AFTER THE CORE IMAGE HAS BEEN		/EAG:197

/ SAVED AND THEN RESTORED.  THUS THE CODING AROUND THE		/EAG:197

/ ENTRY POINTS -- A .GET DESTROYS SOME CODE, BUT IT WILL	/EAG:197

/ NEVER BE USED.						/EAG:197

/								/EAG:197

/ WHEN WE ENTER THIS WE SET THE BIT SC.QFLG IN SC.CQF.		/EAG:197

/ THIS BIT IS CLEARED BY QFILE BEFORE IT RESTORES THE		/EAG:197

/ CORE IMAGE.  THIS WAY THE FIRST TIME THE CODE FOLLOWING	/EAG:197

/ THE JMS DSKTRN (TO SAVE THE CORE IMAGE ON A .PUT) IS		/EAG:197

/ EXECUTED WE DO A .OVRLA TO QFILE, WHEREAS THE SECOND		/EAG:197

/ TIME (FOLLOWING THE RESTORATION BY QFILE) WE TAKE THE		/EAG:197

/ APPROPRIATE EXIT TO THE USER.  WHICH EXIT TO TAKE IS		/EAG:197

/ INDICATED BY THE FLAGS IN SC.CQF, WHICH MAY BE EITHER		/EAG:197

/ PRESERVED OR REPLACED BY QFILE, DEPENDING UPON THE		/EAG:197

/ OPTION SPECIFIED IN THE .GET.					/EAG:197

/								/EAG:197

								/EAG:197
PUT	0			/ ENTER VIA JMS			/EAG:197

	LAC (SC.QPUT)		/ COMPLEMENT SC.QPUT BIT	/EAG:197

				/ IN CODE WORD			/EAG:197

GET	STL!SKP			/ SET FLAG INDICATING .PUT.	/EAG:197

				/ IF .GET, JMS CLOBBERS THIS	/EAG:197

				/ LOCATION			/EAG:197

	CLA!CLL			/ CLEAR FLAG INDICATING .GET.	/EAG:197

				/ PRESERVE CODE WORD.		/EAG:197

PTGT.BS	NOP			/ THIS IS A BOSS MODE SWITCH	/RKB-198

				/ IT IS A 'JMP BS.GPR'		/RKB-198

	XOR CL.WD1		/ PICK UP CODE WORD, AND	/EAG:197

				/ COMPLEMENT SC.QPUT IF .PUT	/EAG:197

.X=SC.QNF!SC.QPUT!SC.QNRM	/ MASK OUT BITS WHICH THE	/EAG:197

	AND (.X!SC.QRTN)	/ USER MAY SPECIFY		/EAG:197

	XOR (SC.QFLG)		/ SET FLAG BIT SO WILL EXIT	/EAG:197

				/ TO QFILE INSTEAD OF USER	/EAG:197

	DAC SC.CQF		/ AND SAVE FLAGS WORD.		/EAG:197

	AND (SC.QNRM)		/ WILL AN IMAGE BE RESTORED?	/EAG:197

PTGT.0	SKP			/ IF IT WILL AND THE QAREA	/EAG:197

	JMP PTGT.5		/ IS TOO SMALL THEN GIVE ERROR.	/EAG:197

				/ PTGT.0 CONTAINS A NOP IF	/EAG:197

				/ THERE IS NOT QAREA AND A SNA	/EAG:197

				/ IF THE QAREA DOESN'T EXTEND	/EAG:197

				/ TO THE BOOTSTRAP.  NORMALLY	/EAG:197

				/ IT CONTAINS A SKP AND THE	/EAG:197

				/ QAREA EXTENDS TO THE BOOTSTRP	/EAG:197

	.IFDEF %HALTS						/EAG:197

	LAC CL.CTR		/ VERIFY THAT .PUT/.GET IS TOP	/EAG:197

	SZA			/ LEVEL (UNNESTED) CAL, AS THIS	/EAG:197

	HLT			/ IS REQUIRED.			/EAG:197

	.ENDC							/EAG:197

	SNL			/ SKIP IF DOING .PUT		/EAG:197
	JMP PTGT.2		/ .GET -- DON'T SAVE CORE	/EAG:197
	LAC CL.RET		/ SAVE CAL RETURN ADDRESS	/EAG:213
	DAC PTGT.A		/ FOR A LATER RETURN.		/EAG:213

PTGT.1	JMS IO.CLR		/ CLOSE ANY OPEN FILES		/EAG:197
				/ THIS LOCATION NOP'D BY CTRLQ	/EAG:197

	LAC (JMS IO.CLR)	/ RESTORE JMS IO.CLR IN CASE	/EAG:100

	DAC PTGT.1		/ THIS A ^Q DUMP AND ITS BEEN	/EAG:197

				/ NOP'D BY CTRLQ.		/EAG:197

	LAC (SC.CQB)		/ ADDRESS OF PARAMETER BLOCK	/EAG:197

	STL			/ DO DISK WRITE			/EAG:197

	JMS DSKTRN		/ AND DO IT			/EAG:197

	LAC SC.CQF		/ CHECK FLAG TO SEE WHETHER	/EAG:197

	AND (SC.QFLG)		/ WE JUST SAVED CORE OR QFILE	/EAG:197

	SNA			/ RESTORED IT.			/EAG:197

	JMP PTGT.6		/ QFILE RESTORED IT -- GO	/EAG:197

				/ RETURN TO USER		/EAG:197

PTGT.2	LAC SC.CQF		/ CHECK IF A FILE NAME EXISTS	/EAG:197

	AND (SC.QNF)						/EAG:197

	SZA			/ SKIP IF A FILE EXISTS		/EAG:197

	JMP PTGT.3		/ ELSE DON'T COPY FILE NAME.	/EAG:197

	LAC* CL.WD3		/ COPY FILE NAME INTO SC.FNM	/EAG:197

	DAC SC.FNM		/ SO THAT QFILE WILL BE ABLE	/EAG:197

	ISZ CL.WD3		/ TO GET AT IT			/EAG:197

	LAC* CL.WD3						/EAG:197

	DAC SC.FNM+1						/EAG:197

	ISZ CL.WD3						/EAG:197

	LAC* CL.WD3						/EAG:197

	DAC SC.FNM+2						/EAG:197

PTGT.3	DZM SC.OTB		/ CLEAR OVERLAY TABLE, SO THAT	/EAG:197

				/ SYSTEM LOADER WILL BE USED.	/EAG:197

	.OVRLA PTGT.4		/ AND BRING IN QFILE.		/EAG:197

								/EAG:197

								/EAG:197

PTGT.4	.SIXBT "QFILE"						/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ COME HERE FOR EITHER OF TWO CASES:				/EAG:197

/								/EAG:197

/   1.  NO QAREA EXISTS AND ANY VARIETY OF .GET/.PUT		/EAG:197

/	IS ATTEMPTED.						/EAG:197

/								/EAG:197

/   2.  THE QAREA ISN'T LONG ENOUGH TO HOLD ALL CORE		/EAG:197

/	BELOW THE BOOTSTRAP, AND A .PUT/.GET IS			/EAG:197

/	ATTEMPTED WHICH WANTS TO EXIT BY RESTORING		/EAG:197

/	THE CORE IMAGE RATHER THAN EXITING TO THE		/EAG:197

/	NON-RESIDENT MONITOR.					/EAG:197

/								/EAG:197

								/EAG:197

PTGT.5	LAW 77			/ GIVE APROPRIATE FATAL		/EAG:197

	JMP .MED+1		/ IOPS ERROR.			/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ COME HERE IF SC.QFLG IS CLEAR, INDICATING THAT THE		/EAG:197

/ CORE IMAGE (IN WHICH WE ARE RUNNING) WAS JUST			/EAG:197

/ RESTORED BY QFILE.  WE CHECK THE SC.QRTN FIELD OF		/EAG:197

/ SC.CQF TO FIND OUT HOW WE SHOULD RETURN TO THE USER,		/EAG:197

/ AND THEN RETURN TO THE USER IN THAT WAY.			/EAG:197

/								/EAG:197

/ POSSIBLE RETURN CODES:					/EAG:197

/								/EAG:197

/   0	RETURN FOLLOWING .PUT CAL (NORMAL RETURN)		/EAG:197

/								/EAG:197

/   1	RETURN TO ^P ROUTINE ADDRESS				/EAG:197

/								/EAG:197

/   2	RETURN TO ^T ROUTINE ADDRESS				/EAG:197

/								/EAG:197

/   3	RETURN TO ^S ADDRESS (ADDRESS SPECIFIED IN SC.UST)	/EAG:197

/								/EAG:197

								/EAG:197

PTGT.6	LAC SC.CQF		/ FETCH RETURN CODE		/EAG:197

	AND (SC.QRTN)						/EAG:197

	SNA							/EAG:197

	JMP PTGT.7		/ ZERO, SO JUST RETURN		/EAG:197

	SAD (2)			/ TRANSLATE CODE NUMBER		/EAG:197

	LAC TTTABL+2		/ TO ROUTINE ADDRESS		/EAG:197

	SAD (1)							/EAG:197

	LAC TTTABL						/EAG:197

	SAD (3)							/EAG:197

	LAC SC.UST						/EAG:197

	AND (77777)		/ MASK TO 15 BITS		/EAG:197

	AAC -10			/ VERIFY IS REALLY ADDRESS,	/EAG:197

	SPA			/ AND NOT FUNNY CODE.		/EAG:197

	LAC (PTGT.8-10)		/ IF FUNNY CODE, USE JMP .	/EAG:197

	AAC 10							/EAG:197

	.IFDEF %HALTS						/EAG:197

	DAC CL.CHK						/EAG:197

	.ENDC							/EAG:197
	XOR PTGT.A		/ MERGE INTO CAL RETURN		/EAG:213

	AND (77777)		/ ADDRESS, PRESERVING		/EAG:197
	XOR PTGT.A		/ OPERATING MODE BITS.		/EAG:213
	DAC PTGT.A						/EAG:213
PTGT.7	DBR			/ RESTORE OPERATING MODES ...	/EAG:213
	JMP* PTGT.A		/ ... AND RETURN.		/EAG:213

								/EAG:197

PTGT.8	JMP .			/ COME HERE IF DESIRED		/EAG:197

				/ RETURN IS UNDEFINED.		/EAG:197
								/EAG:213
								/EAG:213
								/EAG:213
PTGT.A	0			/ LOCATION IN WHICH TO SAVE	/EAG:213
				/ .PUT CAL RETURN ADDRESS.	/EAG:@13
	.TITLE CTRLQ -- ^Q DUMP ROUTINE

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ THIS IS THE ^Q CONTROL CHARACTER INTERRUPT ROUTINE.  TTA.	/EAG:197

/ AND THE ERROR PROCESSOR EVENTUALLY TRANSFER HERE WHEN		/EAG:197

/ A ^Q IS TYPED.  HERE WE DO THE APPROPRIATE MAGIC TO		/EAG:197

/ EFFECT A ^Q DUMP.						/EAG:197

/								/EAG:197

								/EAG:197

CTRLQ	.INH			/// DISALLOW INTERRUPTS SO	/EAG:197

	IOF			/// THAT OUR CLOBBERING PTGT.1	/EAG:197

				/// CAN'T BOTHER ANYONE ELSE.	/EAG:197

				/// THE CAL PROCESSOR ENTRY	/EAG:197

				/// ROUTINE WILL REENABLE	/EAG:197

				/// INTERRUPTS.			/EAG:197

	LAC (NOP)		/// NOP PTGT.1, SO THAT ALL	/EAG:197

	DAC PTGT.1		/// .DAT SLOTS WILL BE LEFT	/EAG:197

				/// ALONE.			/EAG:197

	.PUT SC.QNF!SC.QNRM,0	/// AND DO THE ^Q DUMP		/EAG:197

	JMP .			/ IF WE EVER RETURN, WAIT	/EAG:197

				/ FOR A CONTROL CHAR. TO BE	/EAG:197

				/ TYPED.			/EAG:197

	.TITLE DSKTRN -- RESIDENT MONITOR TRAN ROUTINE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ ROUTINE TO PERFORM A TRAN TO THE SYSTEM DISK.  CALLED VIA	/EAG:191

/ JMS WITH THE AC POINTING TO A PARAMETER BLOCK AND THE LINK	/EAG:191

/ INDICATING WHETHER A READ OR WRITE IS DESIRED.  THE FORMAT	/EAG:191

/ OF THE PARAMETER BLOCK IS AS FOLLOWS:				/EAG:191

/								/EAG:191

/	AC --->	BLKNUM		/ STARTING DISK BLOCK #		/EAG:191

/		CORADR		/ STARTING CORE ADDRESS -1	/EAG:191

/		WRDCNT		/ WORD COUNT (2'S COMPLE.)	/EAG:191

/								/EAG:191

/ THE LINK SHOULD CONTAIN A READ/WRITE INDICATOR AS FOLLOWS:	/EAG:191

/								/EAG:191

/	LINK=0 => READ SYSTEM DISK				/EAG:191

/	LINK=1 => WRITE SYSTEM DISK				/EAG:191

/								/EAG:191

/ THIS ROUTINE PRESERVES NO REGISTERS WHATSOEVER.  THE		/EAG:191

/ ONLY THING PRESERVED IS THE STATE OF THE INTERRUPT		/EAG:191

/ SYSTEM -- I.E. THE API STATUS REGISTER			/EAG:191

/ (CONTAINING ACTIVE PRIORITY LEVELS AND REQUEST FLAGS) IS	/EAG:191

/ RESTORED BEFORE EXIT.  INTERRUPTS ARE ASSUMED TO BE		/EAG:191

/ TURNED ON AND ARE ENABLED ON EXIT.  THIS ROUTINE ALSO		/EAG:191

/ PRESERVES OPERATING MODES (BANK VS. PAGE MODE, THE		/EAG:191

/ CONTENTS OF THE MM REGISTER).  THIS ROUTINE MAY ONLY BE	/EAG:191

/ CALLED IN EXEC MODE -- OTHERWISE IT WILL NOT BE ABLE TO	/EAG:191

/ PRESERVE BANK VS. PAGE MODE PROPERLY.				/EAG:191

/								/EAG:191

/ NOTE:  THIS ROUTINE MAY ONLY BE CALLED BY A CAL FUNCTION	/EAG:191

/	 ROUTINE.  THIS IS BECAUSE THIS ROUTINE IS NOT		/EAG:191

/	 REENTRANT.						/EAG:191

/								/EAG:191

/ THIS ROUTINE OPERATES BY INVOKING THE BOOTSTRAP TO PERFORM	/EAG:191

/ THE TRANSFER.  LOCATIONS DKTR.W THROUGH DKTR.Z ALL POINT	/EAG:191

/ TO LOCATIONS IN THE BOOTSTRAP, AND THUS NEED APPROPRIATE	/EAG:191

/ BANK BITS ADDED TO THEM.  THEY ARE SET UP BY THE ROUTINE	/EAG:191

/ IN.TRN.							/EAG:191

/								/EAG:191

/ NOTE:  THIS ROUTINE ISSUES NESTED CALS!  THUS ANY CAL 	/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS ROUTINE MUST		/EAG:191

/	 PRESERVE THE CAL RETURN INFORMATION IF IT PLANS	/EAG:191

/	 TO RETURN TO THE USER.  SPECIFICALLY, A CAL		/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS ROUTINE		/EAG:191

/	 MUST SAVE LOCATIONS CL.AC, CL.RET, ETC.		/EAG:191

/	 CL.WD* MUST ALSO BE SAVED IF THE CAL FUNCTION ROUTINE	/EAG:191

/	 WILL NEED TO REFER TO THEM SUBSEQUENTLY.  THESE 	/EAG:191

/	 LOCATIONS NEED NOT BE SAVED IN THE CASE OF CAL'S	/EAG:191

/	 SUCH AS .EXIT WHICH DO NOT RETURN TO THEIR CALLER.	/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

DSKTRN	0							/EAG:191

	DAC DKTR.A		/ SAVE POINTER TO PARM. BLK	/EAG:191

	LAC DKTR.W		/ POINT DKTR.B TO PROPER	/EAG:191

	SZL			/ BOOTSTRAP ENTRY POINT --	/EAG:191

	AAC BT.WRT-BT.RED	/ EITHER BT.WRI OR BT.RED.	/EAG:191

	DAC DKTR.B						/EAG:191

	LAC* DKTR.A		/ COPY TRANSFER PARAMETERS	/EAG:191

	DAC* DKTR.X		/ INTO APPROPRIATE LOCATIONS	/EAG:191

	ISZ DKTR.A						/EAG:191

	LAC* DKTR.A		/ WITHIN BOOTSTRAP.  FIRST	/EAG:191

	DAC* DKTR.Y		/ BLOCK NUMBER, THEN CORE	/EAG:191

	ISZ DKTR.A						/EAG:191

	LAC* DKTR.A		/ STARTING ADDRESS, AND		/EAG:191

	DAC* DKTR.Z		/ FINALLY WORD COUNT.		/EAG:191

DKTR.0	JMS IO.WAT		/ WAIT FOR ALL DISK I/O		/EAG:191

				/ TRANSFERS TO FINISH		/EAG:191

	.INH			/// FREEZE STATE OF INTERRUPTS	/EAG:191

	RPL			/// REMEMBER ACTIVE PRIORITY	/EAG:191

	DAC DKTR.A		/// LEVELS FOR LATER		/EAG:191

				/// RESTORATION.		/EAG:191

	RDMM			/// ALSO REMEMBER CONTENTS	/EAG:192

	DAC DKTR.C		/// OF MM REGISTER.		/EAG:192

	JMS RM.CAF		/// PERFORM CAF, ETC.		/EAG:191

	LAC DKTR.B		/// GIVE RESTART ADDRESS TO	/EAG:191

	DAC .MED		/// ERROR ROUTINES		/EAG:191

	LAC (DKTR.1)		/// AND RETURN ADDRESS TO	/EAG:191

	DAC SC.SST		/// BOOTSTRAP			/EAG:191

	EBA			/// BOOTSTRAP RUNS IN BANK MODE	/EAG:191

	JMP* DKTR.B		/// AND GO TO BOOTSTRAP		/EAG:191

								/EAG:191

								/EAG:192

/ BOOTSTRAP RETURNS TO US AT THIS POINT.  BOOTSTRAP TRANSFERS	/EAG:192

/ TO US WITH A JMS.  IF THE JMS INSTRUCTION IS AT BT.ERR (I.E.,	/EAG:192

/ RETURN ADDRESS IS BT.ERR+1) THEN A DISK ERROR WAS ENCOUNTERED	/EAG:192

/ AND WE SHOULD GIVE AN IOPS4 ERROR.  IF THE JMS IS AT ANY	/EAG:192

/ OTHER LOCATION THE TRANSFER SUCCEEDED.  THE JMS INSTRUCTION	/EAG:192

/ AT LOCATION BT.ERR IS PUT THERE BY THE ROUTINE IN.TRN.	/EAG:192

								/EAG:192

DKTR.1	NOP			/// BOOTSTRAP COMES BACK TO	/EAG:191

	RES			/// HERE VIA JMS.  RESTORE	/EAG:191

	LAC* DSKTRN		/// PREVIOUS ADDRESSING MODE	/EAG:191

				/// (BANK/PAGE).  MUST DO THIS	/EAG:191

				/// BEFORE ALLOWING INTERRUPTS.	/EAG:191

	CAF			/// JUST IN CASE		/EAG:194

	.IFDEF %PRTCT		///				/EAG:193

	LAC SC.MSZ		/// RESTORE BOUNDARY AND	/EAG:193

	AAC -377		/// RELOCATE REGISTERS.		/EAG:193

	MPLD			///				/EAG:193

	CLA			///				/EAG:193

	MPLR			///				/EAG:193

	.ENDC			///				/EAG:193

	LAC DKTR.C		/// RESTORE MM REGISTER		/EAG:192

	LDMM			///				/EAG:192

	LAC DKTR.U		/// RESTORE LOCATIONS 1 AND	/EAG:197

	DAC 1			/// .MED+1, IN CASE THIS IS A	/EAG:197

	LAC (JMS ER.MED)	/// RETURN FROM A .GET.  JMP	/EAG:197

	DAC .MED+1		/// TO SKIP CHAIN IN 1, JMP TO	/EAG:197

				/// .MED ROUTINE IN .MED+1.	/EAG:197

PLR.S1	NOP			/// RESTART UNICHANNEL POLLER.	/EAG:194

				/// THIS INSTRUCTION MODIFIED	/EAG:194

				/// BY IN.PLR.			/EAG:194

	LAC DKTR.A		/// RESTORE INTERRUPT SYSTEM	/EAG:191

	ISA			/// BOTH API...			/EAG:191

	ION			/// ...AND PI			/EAG:191

	.ENB			/// JUST IN CASE		/EAG:191

	JMS TTCBSW		/ CLEAR TTY BUSY SWITCH		/EAG:191

	JMS CK.STRT		/ AND RESTART CLOCK		/EAG:194

	LAC SC.VTR		/ CHECK IF VT15 (^X) HAS BEEN	/EAG:193

	SZA			/ SET UP,			/EAG:193

	LSD			/ AND START DISPLAY IF IT HAS	/EAG:193

	LAC DKTR.1		/ DETERMINE LOCATION OF JMS	/EAG:192

	AND (77777)		/ INSTRUCTION WHICH BOOTSTRAP	/EAG:192

	SAD DKTR.V		/ USED TO RETURN TO US.  IF	/EAG:192

				/ JMS WAS AT BT.ERR (RETURN	/EAG:192

				/ ADDRESS = BT.ERR+1) THEN	/EAG:192

				/ GIVE IOPS 4 ERROR.		/EAG:192

	JMP DKTR.2		/ GO GIVE IOPS 4		/EAG:192

	JMP* DSKTRN		/ RETURN TO CALLER		/EAG:191

								/EAG:192

								/EAG:192

/ COME HERE IF BOOTSTRAP ENCOUNTERS ERROR.  WHEN WE GET HERE	/EAG:192

/ THE INTERRUPT SYSTEM AND THE REST OF THE SYSTEM STATE HAS	/EAG:192

/ BEEN RESTORED.  GIVE IOPS 4 ERROR, WAIT FOR ^R, AND THEN	/EAG:192

/ TRY AGAIN.							/EAG:192

								/EAG:192

DKTR.2	LAW 4			/ ERROR IS IOPS 4		/EAG:192

	JMS .MED		/ GO TYPE ERROR MESSAGE		/EAG:192

	JMP DKTR.0		/ GO TRY AGAIN			/EAG:192

								/EAG:191

								/EAG:191

DKTR.A	0			/ TEMPORARY USED AS POINTER	/EAG:191

				/ AS POINTER TO PARAMETER BLOCK	/EAG:191

				/ ALSO USED TO SAVE STATE OF	/EAG:191

				/ API SYSTEM.			/EAG:191

								/EAG:192

DKTR.B	0			/ TEMPORARY USED TO POINT TO	/EAG:191

				/ BOOTSTRAP ENTRY ADDRESS	/EAG:191

								/EAG:192

DKTR.C	0			/ TEMPORARY USED TO SAVE MM	/EAG:192

				/ REGISTER			/EAG:192

								/EAG:197

								/EAG:197

								/EAG:197

								/EAG:197

/								/EAG:197

/ FOLLOWING LOCATIN IS SET UP BY THE INITIALIZATION ROUTINE	/EAG:197

/ IN.SKP.  IT IS SET UP TO CONTAIN A COPY OF THE CONTENTS	/EAG:197

/ OF LOCATION 1 -- A JMP TO THE SKIP CHAIN.  THIS IS SO		/EAG:197

/ THAT LOCATION 1 CAN BE RESTORED UPON A RETURN FROM A		/EAG:197

/ .GET, WHICH DOES NOT PRESERVE LOCATIONS 0 THROUGH 4.		/EAG:197

/								/EAG:197

								/EAG:197

DKTR.U	XX			/ SET TO JMP TO SKIP CHAIN	/EAG:197

				/ BY IN.SKP			/EAG:197

								/EAG:192

								/EAG:191

								/EAG:191

/								/EAG:191

/ FOLLOWING LOCATIONS ARE SET UP BY THE INITIALIZATION		/EAG:191

/ ROUTINE IN.TRN.  THAT ROUTINE ADDS IN APPROPRIATE		/EAG:191

/ BANK BITS TO MAKE THESE LOCATIONS POINT TO THE		/EAG:191

/ BOOTSTRAP							/EAG:191

/								/EAG:191

								/EAG:191

DKTR.V	BT.ERR+1		/ LOCATION FOLLOWING JMS BACK	/EAG:192

				/ TO DSKTRN IF DISK ERROR	/EAG:192

				/ ENCOUNTERED			/EAG:192

								/EAG:192

DKTR.W	BT.RED			/ ENTRY ADDRESS TO DO DISK	/EAG:191

				/ READ				/EAG:191

								/EAG:191

DKTR.X	BT.BLK			/ DISK BLOCK NUMBER		/EAG:191

								/EAG:191

DKTR.Y	BT.CA			/ STARTING CORE ADDRESS -1	/EAG:191

								/EAG:191

DKTR.Z	BT.WC			/ WORD COUNT (2'S COMPLE.)	/EAG:191

	.TITLE RM.CAF -- ROUTINE TO ISSUE CAF

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE IS USED BY THE RESIDENT MONITOR TO ISSUE		/EAG:191

/ A CLEAR ALL FLAGS (CAF) IOT.  THIS ROUTINE SHOULD BE		/EAG:191

/ THE ONLY PLACE IN THE MONITOR WHICH ISSUES A CAF.		/EAG:191

/ BEFORE ISSUEING THE CAF THIS ROUTINE FIRST STOPS THE		/EAG:191

/ VT15 DISPLAY PROCESSOR (IF PRESENT) WITH A STPD IOT.		/EAG:191

/ THIS IS BECAUSE CAF'S HAVE BEEN KNOWN TO CAUSE VT15'S		/EAG:191

/ TO WANDER OFF INTO NON-EXISTENT MEMORY.  THIS ROUTINE		/EAG:191

/ ALSO DISABLES (KILLS) THE INTERRUPT SYSTEM AND ENSURES	/EAG:191

/ THAT THE CLOCK CONTINUES TO RUN.  THE CLOCK WON'T		/EAG:191

/ INTERRUPT BECAUSE THE INTERRUPT SYSTEM IS KILLED FIRST.	/EAG:191

/ THIS ROUTINE IN REENTRANT BECAUSE IT IS NON-INTERRUPTABLE.	/EAG:191

/								/EAG:194

/ WE MUST ALSO STOP THE UNICHANNEL POLLER IF IT IS ENABLED,	/EAG:194

/ AS ISSUEING A CAF WHILE A TCB POINTER IS WAITING TO BE	/EAG:194

/ ACCEPTED BY THE UNICHANNEL DISTURBS THE HARDWARE'S		/EAG:194

/ MEDITATION.  THE CALLER OF THIS ROUTINE (RM.CAF) MUST BE	/EAG:194

/ CERTAIN TO RESTART THE POLLER BEFORE REENABLING INTERRUPTS.	/EAG:194

/								/EAG:192

/ THIS ROUTINE CLOBBERS THE MM REGISTER!			/EAG:192

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

RM.CAF	0			/// ENTER ROUTINE WITH ONE	/EAG:191

				/// ONE FREE INSTRUCTION	/EAG:191

				/// FROM JMS			/EAG:191

	IOF+10			/// AND TURN OFF INTERRUPTS	/EAG:191

	ISA+10			/// BEFORE ONE CAN OCCUR.	/EAG:191

				/// "+10" CLEARS AC FOR ISA	/EAG:191

PLR.F1	NOP			/// TERMINATE THE UNICHANNEL	/EAG:194

				/// POLLER.  THIS INSTRUCTION	/EAG:194

				/// IS MODIFED BY IN.PLR.	/EAG:194

	STPD			/// STOP VT15 IF PRESENT	/EAG:191

	LAW -40			/// DELAY TO ENSURE STPD	/EAG:191

RMCF.0	IAC!SZA			/// HAS TAKEN EFFECT		/EAG:191

	JMP RMCF.0		///				/EAG:191

	CAF			/// WHAT WE CAME HERE TO DO	/EAG:191

	CLON			/// ENSURE THAT CLOCK IS	/EAG:191

				/// STILL RUNNING (I DON'T	/EAG:191

				/// THINK THIS IS NECESSARY,	/EAG:191

				/// BUT IT CAN'T HURT US).	/EAG:191

	JMP* RM.CAF		/// AND RETURN			/EAG:191

	.TITLE IO.WAT -- ROUTINE TO WAIT FOR I/O TO COMPLETE

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE ENSURES THAT ALL I/O IS COMPLETED BY ISSUEING A	/EAG:191

/ .WAIT CAL TO EVERY ACTIVE .DAT SLOT.  THIS ROUTINE DETERMINES	/EAG:191

/ WHICH .DAT SLOTS ARE ACTIVE BY EXAMINING THE MASS STORAGE	/EAG:191

/ BUSY TABLE.  NO ATTEMPT IS MADE TO PROPERLY TREAT ACTIVE	/EAG:191

/ I/O HANDLERS WHICH DON'T USE THE MASS STORAGE BUSY TABLE --	/EAG:191

/ THE PROBLEM IS JUST IGNORED.					/EAG:191

/								/EAG:191

/ THIS ROUTINE CLOBBERS THE AC, XR, LR, AND LINK.  THIS IS	/EAG:191

/ BECAUSE THIS ROUTINE ISSUES NESTED CAL'S, WHICH CANNOT BE	/EAG:191

/ ASSUMED TO PRESERVE THESE REGISTERS.				/EAG:191

/								/EAG:191

/ NOTE:  THIS ROUTINE ISSUES NESTED CALS!  THUS ANY CAL 	/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS ROUTINE MUST		/EAG:191

/	 PRESERVE THE CAL RETURN INFORMATION IF IT PLANS	/EAG:191

/	 TO RETURN TO THE USER.  SPECIFICALLY, A CAL		/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS ROUTINE		/EAG:191

/	 MUST SAVE LOCATIONS CL.AC, CL.XR, CL.LR, AND CL.RET.	/EAG:191

/	 CL.WD* MUST ALSO BE SAVED IF THE CAL FUNCTION ROUTINE	/EAG:191

/	 WILL NEED TO REFER TO THEM SUBSEQUENTLY.  THESE 	/EAG:191

/	 LOCATIONS NEED NOT BE SAVED IN THE CASE OF CAL'S	/EAG:191

/	 SUCH AS .EXIT WHICH DO NOT RETURN TO THEIR CALLER.	/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191
IO.WAT	0							/EAG:191
IOWT.S	.WAIT	-3		/  WAIT ON CONSOLE		/RKB-206
	.LOC	.-2		/ BACK UP THE ASSEMBLER TO THE	/RKB-210
	SKP			/ 'CAL' AND OVERLAY IT WITH	/RKB-210
	.LOC	.+1		/ A 'SKP' FOR THE FIRST TIME	/RKB-210
				/ THRU.  THE 'SKP' IS CHANGED	/RKB-210
				/ TO A 'CAL -3&777' BY IN.DT2.	/RKB-210
				/ THIS SOLVES 'BATCH JIGGLES'	/RKB-206

	LAC SC.ACT		/ GET COUNT OF ENTRIES IN MASS	/EAG:191

	SNA!TCA			/ STORAGE BUSY TABLE		/EAG:191

	JMP* IO.WAT		/ IF ZERO, EXIT			/EAG:191

	DAC IOWT.A		/ OTHERWISE SAVE AS LOOP CNTR.	/EAG:191

	LAC SC.BTA		/ GET POINTER TO BUSY TABLE	/EAG:191

IOWT.0	DAC IOWT.B		/ STORE POINTER TO NEXT ENTRY	/EAG:191

	LAC* IOWT.B		/ GET .DAT SLOT FOR THIS ENTRY	/EAG:191

	AND (777)		/ MASK OFF CRUFT		/EAG:191

	SNA			/ ZERO => ENTRY EMPTY		/EAG:191

	JMP IOWT.2		/ GO TRY NEXT ONE		/EAG:191

	DAC IOWT.1		/ PUT .DAT SLOT INTO CAL	/EAG:191

IOWT.1	.WAIT 0			/ ISSUE .WAIT TO .DAT SLOT	/EAG:191

IOWT.2	LAC IOWT.B		/ PICK UP POINTER		/EAG:191

	TAD SC.BTL		/ ADVANCE TO NEXT ENTRY		/EAG:191

	ISZ IOWT.A		/ HAVE WE TRIED ALL YET?	/EAG:191

	JMP IOWT.0		/ NO -- LOOP			/EAG:191

	JMP* IO.WAT		/ YES -- RETURN			/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

IOWT.A	0			/ TEMPORARY USED FOR LOOP CNTR.	/EAG:191

								/EAG:191

IOWT.B	-1			/ TEMPORARY USED TO POINT TO	/EAG:191

				/ BUSY TABLE ENTRY		/EAG:191

	.TITLE IO.CLR -- ROUTINE TO DELETE UN-CLOSED FILES

								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

/								/EAG:191

/ THIS ROUTINE DELETES UN-CLOSED FILES BY ISSUEING A		/EAG:191

/ .INIT CAL TO EVERY ACTIVE .DAT SLOT.  THIS ROUTINE DETERMINES	/EAG:191

/ WHICH .DAT SLOTS ARE ACTIVE BY EXAMINING THE MASS STORAGE	/EAG:191

/ BUSY TABLE.  NO ATTEMPT IS MADE TO PROPERLY TREAT ACTIVE	/EAG:191

/ I/O HANDLERS WHICH DON'T USE THE MASS STORAGE BUSY TABLE --	/EAG:191

/ THE PROBLEM IS JUST IGNORED.					/EAG:191

/								/EAG:191

/ THIS ROUTINE CLOBBERS THE AC, XR, LR, AND LINK.  THIS IS	/EAG:191

/ BECAUSE THIS ROUTINE ISSUES NESTED CAL'S, WHICH CANNOT BE	/EAG:191

/ ASSUMED TO PRESERVE THESE REGISTERS.				/EAG:191

/								/EAG:191

/ NOTE:  THIS ROUTINE ISSUES NESTED CALS!  THUS ANY CAL		/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS ROUTINE MUST		/EAG:191

/	 PRESERVE THE CAL RETURN INFORMATION IF IT PLANS	/EAG:191

/	 TO RETURN TO THE USER.  SPECIFICALLY, A CAL		/EAG:191

/	 FUNCTION ROUTINE WHICH CALLS THIS MUST SAVE		/EAG:191

/	 LOCATIONS CL.AC, CL.XR, CL.LR, AND CL.RET.		/EAG:191

/	 CL.WD* MUST ALSO BE SAVED IF THE CAL FUNCTION ROUTINE	/EAG:191

/	 WILL NEED TO REFER TO THEM SUBSEQUENTLY.  THESE 	/EAG:191

/	 LOCATIONS NEED NOT BE SAVED IN THE CASE OF CAL'S	/EAG:191

/	 SUCH AS .EXIT WHICH DO NOT RETURN TO THEIR CALLER.	/EAG:191

/								/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

IO.CLR	0							/EAG:191

	LAC SC.ACT		/ GET COUNT OF ENTRIES IN MASS	/EAG:191

	SNA!TCA			/ STORAGE BUSY TABLE		/EAG:191

	JMP* IO.CLR		/ IF ZERO, EXIT			/EAG:191

	DAC IOCL.A		/ OTHERWISE SAVE AS LOOP CNTR.	/EAG:191

	LAC SC.BTA		/ GET POINTER TO BUSY TABLE	/EAG:191

IOCL.0	DAC IOCL.B		/ STORE POINTER TO NEXT ENTRY	/EAG:191

	LAC* IOCL.B		/ GET .DAT SLOT FOR THIS ENTRY	/EAG:191

	AND (777)		/ MASK OFF CRUFT		/EAG:191

	SNA			/ ZERO => ENTRY EMPTY		/EAG:191

	JMP IOCL.2		/ GO TRY NEXT ONE		/EAG:191

	.INH			/// AVOID POTENTIAL TIMING	/EAG:201

	IOF			/// PROBLEMS.  INTERRUPTS	/EAG:201

				/// REALLOWED BY CAL HANDLER	/EAG:201

	DZM* IOCL.B		/// CLEAR MSBT ENTRY, SO THAT	/EAG:201

				/// IF .INIT GETS IOPS ERROR	/EAG:201

				/// WE WON'T REPEAT IT NEXT ^C	/EAG:201

	DAC IOCL.1		/// PUT .DAT SLOT INTO CAL	/EAG:191

IOCL.1	.INIT 0,0,0		/// ISSUE .INIT TO .DAT SLOT	/EAG:191

IOCL.2	LAC IOCL.B		/ PICK UP POINTER		/EAG:191

	TAD SC.BTL		/ ADVANCE TO NEXT ENTRY		/EAG:191

	ISZ IOCL.A		/ HAVE WE TRIED ALL YET?	/EAG:191

	JMP IOCL.0		/ NO -- LOOP			/EAG:191

	JMP* IO.CLR		/ YES -- RETURN			/EAG:191

								/EAG:191

								/EAG:191

								/EAG:191

IOCL.A	0			/ TEMPORARY USED FOR LOOP CNTR.	/EAG:191

								/EAG:191

IOCL.B	-1			/ TEMPORARY USED TO POINT TO	/EAG:191

				/ BUSY TABLE ENTRY		/EAG:191

	.TITLE RQ.LV4 -- REQUEST A LEVEL 4 INTERRUPT

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:195

/ THIS SUBROUTINE IS USED BY VARIOUS INTERRUPT ROUTINES TO	/EAG:195

/ SCHEDULE THE EXECUTION OF SOME AUXILIARY ROUTINE AT A LATER	/EAG:195

/ TIME.  THIS ALLOWS THE INTERRUPT ROUTINE TO COMPLETE ITS	/EAG:195

/ PROCESSING AND REACH AN INTERNALLY CONSISTENT STATE BEFORE	/EAG:195

/ THE AUXILIARY ROUTINE IS EXECUTED.  IF API IS AVAILABLE WE	/EAG:195

/ FURTHERMORE ENSURE THAT ALL OTHER INTERRUPT PROCESSING	/EAG:195

/ PLUS ALL CAL PROCESSING IS ALSO COMPLETE BEFORE INVOKING	/EAG:195

/ THE AUXILIARY ROUTINE.  THIS IS DONE BY REQUESTING A LEVEL	/EAG:195

/ 4 SOFTWARE INTERRUPT AND INVOKING THE AUXILIARY ROUTINE	/EAG:195

/ WHEN THE INTERRUPT IS GRANTED.  THE REQUESTING OF THE LEVEL	/EAG:195

/ 4 INTERRUPT INTERACTS WITH THE CAL HANDLER'S USE OF API	/EAG:195

/ LEVEL 4 IN SUCH A MANNER SO AS TO GUARANTEE THAT THE		/EAG:195

/ AUXILIARY ROUTINE WILL NOT BE EXECUTED UNTIL ALL CAL		/EAG:195

/ PROCESSING IS COMPLETED.					/EAG:195

/								/EAG:195

/ WHILE WE WOULD LIKE TO PROVIDE SIMILAR GUARANTEES IN THE	/EAG:195

/ CASE WITHOUT API, WE CAN'T.  THE BEST WE CAN DO IS TO		/EAG:195

/ HAVE THE AUXILIARY ROUTINE EXECUTED WHEN THE INTERRUPT	/EAG:195

/ ROUTINE COMPLETES.  THIS WAY, IF THE AUXILIARY ROUTINE	/EAG:195

/ NEVER RETURNS (WHICH IT NEED NOT), AT LEAST THE INTERRUPT	/EAG:195

/ ROUTINE SCHEDULING IT WILL TERMINATE CONSISTENTLY.  THE	/EAG:195

/ SAME CANNOT BE SAID FOR CAL ROUTINES OR I/O HANDLERS SUCH	/EAG:195

/ AS THE DISK HANDLERS WHICH ALLOW INTERRUPTS DURING THEIR	/EAG:195

/ PROCESSING.							/EAG:195

/								/EAG:195

/ THIS ROUTINE SHOULD ONLY BE CALLED FROM INTERRUPT ROUTINES.	/EAG:195

/ IF API IS AVAILABLE THIS ROUTINE IS COMPLETELY REENTRANT.	/EAG:195

/ THIS IS BECAUSE IT LOCKS OUT INTERRUPTS.  IF API IS NOT	/EAG:195

/ AVAILABLE THIS ROUTINE IS ALSO REENTRANT, BUT REQUIRES SOME	/EAG:195

/ ASSISTANCE FROM ITS CALLER.  INTERRUPTS SHOULD BE TURNED	/EAG:195

/ OFF (VIA IOF) PRIOR TO CALLING THIS ROUTINE AND TURNED	/EAG:195

/ BACK ON (VIA ION) AFTER ITS RETURN.  CONSIDERING THAT THIS	/EAG:195

/ ROUTINE SHOULD ONLY BE CALLED FROM INTERRUPT ROUTINES		/EAG:195

/ THIS REQUIREMENT WILL PROBABLY BE MET AUTOMATICALLY.		/EAG:195

/								/EAG:195

/ THIS ROUTINE WANTS TWO ARGUMENTS.  CLEARLY, IT NEEDS THE	/EAG:195

/ ADDRESS OF THE AUXILIARY ROUTINE WHICH IS TO BE SCHEDULED.	/EAG:195

/ BESIDES THE NORMAL ENTRY POINT WORD THE AUXILIARY ROUTINE	/EAG:195

/ MUST BE PRECEEDED BY A 2 WORD HEADER.  THESE TWO WORDS	/EAG:195

/ ARE USED TO SAVE SOME STATUS INFORMATION.  THE SECOND ARGU-	/EAG:195

/ MENT IS THE ADDRESS OF THE INTERRUPT VECTOR.  BY INTERRUPT	/EAG:195

/ VECTOR WE MEAN THAT LOCATION WHICH CONTAINS THE INTERRUPT	/EAG:195

/ RETURN ADDRESS.  THIS INFORMATION IS ONLY USED FOR THE	/EAG:195

/ NON-API CASE, SO IF DIFFERENT INTERRUPT VECTORS ARE USED	/EAG:195

/ FOR API AND NON-API ONLY THE NON-API NEED BE PROVIDED.	/EAG:195

/								/EAG:195

/ EXAMPLE:							/EAG:195

/								/EAG:195

/ INTERRUPT ROUTINE:						/EAG:195

/								/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		JMS RQ.LV4	/ SCHEDULE AUXILIARY ROUTINE	/EAG:195

/		  AUXRTN	/ POINTER TO AUXILIARY ROUTINE	/EAG:195

/		  INTVCT	/ POINTER TO INTERRUPT VECTOR	/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		DBR						/EAG:195

/		JMP* INTVCT					/EAG:195

/								/EAG:195

/ AUXILIARY ROUTINE:						/EAG:195

/								/EAG:195

/	AUXRTN	0		/ THESE TWO WORDS USED BY	/EAG:195

/		0		/ RQ.LV4			/EAG:195

/	AUXENT	0		/ ACTUAL ENTRY POINT		/EAG:195

/		DAC SAVEAC	/ SAVE AC			/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		 .						/EAG:195

/		LAC SAVEAC	/ RESTORE AC			/EAG:195

/		DBR		/ AND RESTORE			/EAG:195

/		JMP* AUXENT					/EAG:195

/								/EAG:195

/ WHEN API IS IN USE THE AUXILIARY ROUTINE WILL BE INVOKED	/EAG:195

/ AT API LEVEL 4.  THE MANNER IN WHICH IT IS CALLED IS		/EAG:195

/ IDENTICAL TO A DIRECT LEVEL 4 INTERRUPT.  THE AUXILIARY	/EAG:195

/ ROUTINE IS RESPONSIBLE FOR SAVING AND RESTORING THE AC	/EAG:195

/ AND FOR RETURNING WITH A DBR INSTRUCTION.  THE AUXILIARY	/EAG:195

/ ROUTINE WILL BE CALLED IN EXEC. MODE.  THE RETURN ADDRESS	/EAG:195

/ (SAVED IN AUXENT IN THE EXAMPLE ABOVE) WILL POINT TO A	/EAG:195

/ LOCATION IN THE MAINSTREAM PROGRAM.				/EAG:195

/								/EAG:195

/ IF API IS NOT IN USE THE AUXILIARY ROUTINE WILL BE CALLED	/EAG:195

/ WITH INTERRUPTS ENABLED.  IT WILL ALWAYS BE CALLED IN EXEC.	/EAG:195

/ MODE.  THE MANNER IN WHICH THE AUXILIARY ROUTINE IS INVOKED	/EAG:195

/ IS IDENTICAL IN BOTH CASES.  A DBR SHOUDL BE USED FOR THE	/EAG:195

/ RETURN; ACTUALLY A RES WOULD BE SUFFICIENT BUT THE DBR IS	/EAG:195

/ MORE GENERAL.							/EAG:195

/								/EAG:195

/ THIS ROUTINE (RQ.LV4) SHOULD ONLY BE CALLED IN EXEC. MODE	/EAG:195

/ FROM AN INTERRUPT ROUTINE.  THE AC AND LINK ARE CLOBBERED,	/EAG:195

/ ALL OTHER REGISTERS ARE PRESERVED.  THE THREE WORDS		/EAG:195

/ PRECEEDING THE AUXILIARY ROUTINE (THE TWO TEMPORARIES PLUS	/EAG:195

/ THE AUXILIARY ROUTINE'S ENTRY POINT) ARE CLOBBERED WHEN	/EAG:195

/ RQ.LV4 IS CALLED.  THEY SHOULD NOT BE MODIFIED UNTIL AFTER	/EAG:195

/ THE AUXILIARY ROUTINE HAS BEEN INVOKED.  CARE SHOULD BE	/EAG:195

/ TAKEN THAT AN AUXILIARY ROUTINE IS NOT SCHEDULED TWICE	/EAG:195

/ WITHOUT IT HAVING BEEN EXECUTED IN BETWEEN.			/EAG:195

/								/EAG:195

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:195

/ THE VERSION OF THIS ROUTINE PRESENTED BELOW IS FOR API USE	/EAG:195

/ ONLY.  IF API IS NOT IN USE THE ENTIRE ROUTINE IS REPLACED	/EAG:195

/ BY IN.CAL.							/EAG:195

/								/EAG:192

/ THE THREE WORDS ARE USED TO CONSTRUCT A LINKED LIST OF	/EAG:192

/ ALL OUTSTANDING LEVEL 4 INTERRUPT REQUESTS.  THE HEAD		/EAG:192

/ OF THIS LINKED LIST IS IN RQL4.B.  EACH ENTRY CONTAINS	/EAG:192

/ THE PRIOR STATE OF THE LEVEL 4 REQUEST BIT IN THE FIRST	/EAG:192

/ WORD, THE PRIOR CONTENTS OF THE LEVEL 4 INTERRUPT TRANSFER	/EAG:192

/ VECTOR (SC.LV4) IN THE SECOND WORD, AND A LINK TO THE		/EAG:192

/ NEXT REQUEST IN THE THIRD WORD.				/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

RQ.LV4	0							/EAG:192

	.INH			/// LOCK OUT INTERRUPTS		/EAG:192

	LAC* RQ.LV4		/// PUT POINTER TO TEMPORARY	/EAG:192

	DAC RQL4.A		/// STORAGE WHERE WE CAN USE IT	/EAG:192

	LAC CL.CTR		/// IS CAL ROUTINE IN PROGRESS?	/EAG:192

	SMA			/// SKIP IF NOT			/EAG:192

	JMP RQL4.0		/// GO FUDGE CAL STUFF		/EAG:192

	RPL			/// SAVE CURRENT STATE OF	/EAG:192

	AND (API.R4)		/// LEVEL 4 REQUEST IN THE	/EAG:192

	DAC* RQL4.A		/// FIRST WORD OF TEMP. STORAGE	/EAG:192

	ISZ RQL4.A		/// BUMP TEMP. STORE POINTER	/EAG:192

	LAC SC.LV4		/// SAVE CURRENT LEVEL 4 XFER	/EAG:192

	DAC* RQL4.A		/// VECTOR IN SECOND WORD	/EAG:192

	LAC (API.R4)		/// ISSUE API LEVEL 4		/EAG:192

	ISA			/// REQUEST			/EAG:192

	LAC (RQL4.2)		/// AND MAKE IT COME BACK	/EAG:192

	DAC SC.LV4		/// TO US			/EAG:192

	JMP RQL4.1		/// GO JOIN COMMON CODE		/EAG:192

								/EAG:192

								/EAG:192

/ COME HERE IF A CAL ROUTINE IS IN PROGRESS.  FUDGE		/EAG:192

/ STUFF WITH THE SAVED CAL API INFORMATION SO THAT		/EAG:192

/ WE WILL BE INVOKED AFTER THE CAL ROUTINE COMPLETES.		/EAG:192

								/EAG:192

RQL4.0	LAC CL.API		/// REMEMBER SAVED STATE	/EAG:192

	DAC* RQL4.A		/// OF LEVEL 4 REQUEST		/EAG:192

	ISZ RQL4.A		/// BUMP TEMP. STORE POINTER	/EAG:192

	LAC CL.SV4		/// REMEMBER SAVED LEVEL 4 XFER	/EAG:192

	DAC* RQL4.A		/// VECTOR			/EAG:192

	LAC (API.R4)		/// CAUSE CAL HANDLER TO	/EAG:192

	DAC CL.API		/// ISSUE A LEVEL 4 REQUEST	/EAG:192

	LAC (RQL4.2)		/// (DIRECTED AT US) WHEN	/EAG:192

	DAC CL.SV4		/// CAL PROCESSING IS COMPLETE	/EAG:192

/ WHEN WE GET HERE WE HAVE SAVED THE OLD LEVEL 4 REQUEST STATE	/EAG:192

/ AND TRANSFER VECTOR ADDRESS IN THE FIRST TWO WORDS OF		/EAG:192

/ TEMPORARY STORAGE AND HAVE REQUESTED A NEW LEVEL 4 INTERRUPT	/EAG:192

/ DIRECTED AT US (ENTRY AT RQL4.2).				/EAG:192

RQL4.1	ISZ RQL4.A		/// BUMP TEMP STORE POINTER	/EAG:192

	LAC RQL4.B		/// PICK UP HEAD OF LINKED LIST	/EAG:192

	DAC* RQL4.A		/// STICK IT AWAY		/EAG:192

	LAC* RQ.LV4		/// POINT LINKED LIST HEAD TO	/EAG:192

	DAC RQL4.B		/// ENTRY JUST BUILT		/EAG:192

	ISZ RQ.LV4		/// BUMP RETURN ADDRESS		/EAG:192

	ISZ RQ.LV4		/// BUMP PAST INT. VECTOR	/EAG:195

	.ENB			/// ENABLE INTERRUPTS AFTER	/EAG:192

	JMP* RQ.LV4		/// RETURN, AND RETURN		/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/ LEVEL 4 INTERRUPT ENTRY.  COME HERE, DO SOME BOOKKEEPING,	/EAG:192

/ AND THEN TRANSFER TO REQUESTED LEVEL 4 AUXILIARY ROUTINE.	/EAG:192

								/EAG:192

RQL4.2	0							/EAG:192

	.INH			/// LOCK OUT INTERRUPTS SO	/EAG:192

				/// CAN PLAY WITH LEVEL 4	/EAG:192

	DAC RQL4.A		/// SAVE AC			/EAG:192

	LAC* RQL4.B		/// RESTORE PREVIOUS LEVEL 4	/EAG:192

	ISA			/// REQUEST STATUS		/EAG:192

	ISZ RQL4.B		/// BUMP POINTER		/EAG:192

	LAC* RQL4.B		/// AND RESTORE LEVEL 4		/EAG:192

	DAC SC.LV4		/// TRANSFER VECTOR		/EAG:192

	ISZ RQL4.B		/// BUMP POINTER		/EAG:192

	LAC RQL4.B		/// SAVE POINTER FOR		/EAG:192

	DAC RQL4.C		/// DISPATCH TO AUX. ROUTINE	/EAG:192

	LAC* RQL4.B		/// REMOVE ENTRY FROM		/EAG:192

	DAC RQL4.B		/// LINKED LIST			/EAG:192

	LAC RQL4.2		/// PASS INTERRUPT RETURN	/EAG:192

	DAC* RQL4.C		/// ADDRESS TO AUX. ROUTINE	/EAG:192

	ISZ RQL4.C		/// BUMP TO FIRST INSTR.	/EAG:192

	LAC RQL4.A		/// RESTORE AC			/EAG:192

	.ENB			///				/EAG:192

	JMP* RQL4.C		/// AND GO TO ROUTINE		/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

RQL4.A	0			/ TEMP. USED ABOVE		/EAG:192

								/EAG:192

RQL4.B	-1			/ HEAD OF LINKED LIST OF	/EAG:192

				/ LEVEL 4 REQUESTS		/EAG:192

								/EAG:192

RQL4.C	0			/ TEMP. USED ABOVE		/EAG:192

								/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

/								/EAG:195

/ BELOW WE PRESENT AN IMAGE OF THE NON-API VERSION OF RQ.LV4.	/EAG:195

/ READERS ARE CAUTIONED AGAINST ASSUMING THIS IS ABSOLUTELY	/EAG:195

/ CORRECT WITHOUT FIRST CHECKING IT AGAINST THE TEMPLATE IN	/EAG:195

/ IN.CAL.  NOTE THAT WHILE THE ENTIRE ROUTINE IS REPLACED,	/EAG:195

/ THERE IS NO REASON TO COPY THE ENTRY POINT WORD, SO IT ISN'T.	/EAG:195

/								/EAG:195

/	RQ.LV4	0						/EAG:195

/		LAC* RQ.LV4	/ PICK UP AUX. ROUTINE ADDR.	/EAG:195

/		AAC 2		/ BUMP TO ENTRY POINT		/EAG:195

/		DAC RQL4.A	/ SAVE IT AWAY			/EAG:195

/		ISZ RQ.LV4	/ PICK UP INTERRUPT VECTOR	/EAG:195

/		LAC* RQ.LV4	/ ADDRESS AND SAVE IT AWAY	/EAG:195

/		DAC RQL4.B					/EAG:195

/		ISZ RQ.LV4	/ BUMP TO RETURN		/EAG:195

/		LAC* RQL4.B	/ PICK UP INTERRUPT RETURN	/EAG:195

/		DAC* RQL4.A	/ ADDRESS (FROM VECTOR) AND	/EAG:195

/				/ GIVE TO AUX. ROUTINE.		/EAG:195

/		AND (600000)	/ MASK OFF MODE BITS AND FORCE	/EAG:195

/		XOR RQL4.A	/ TO EXEC. MODE, COMBINE WITH	/EAG:195

/		IAC		/ AUX. ROUTINE ADDRESS, AND	/EAG:195

/		DAC* RQL4.B	/ REPLACE INT. RETURN ADDR.	/EAG:195

/				/ WITH THIS.			/EAG:195

/		JMP* RQ.LV4	/ DONE, SO RETURN		/EAG:195

/								/EAG:195

/	RQL4.A	0		/ POINTER TO AUX. ROUTINE	/EAG:195

/								/EAG:195

/	RQL4.B	0		/ POINTER TO INT. VECTOR	/EAG:195

/								/EAG:195

								/EAG:195

RQL4.D=(600000)			/ REMEMBER ADDRESS OF CONSTANT	/EAG:195

				/ SO WE CAN REFERENCE IT IN	/EAG:195

				/ TEMPLATE.			/EAG:195

	.TITLE ILLEGAL INTERRUPT ERROR ROUTINES

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

NEMERR	LAC	0		/NON-EXISTENT MEMORY REFERENCE

	DAC	.MED		/INTERRUPT PC IS ARGUMENT

	LAW	31		/IOPS 31

	JMP	.MED+1

								/EAG:192

								/EAG:192

MPVERR	LAC	0		/MEMORY PROTECT VIOLATION

	DAC	.MED		/INTERRUPT PC IS ARGUMENT

	LAW	32		/IOPS 32

	JMP	.MED+1

								/EAG:192

								/EAG:192

MPEERR	SKP			/PI INTERRUPT-MEMORY PARITY ERROR

	JMP	.+3		/API INTERRUPT-MEMORY PARITY ERROR

	LAC	0		/INTERRUPT PC IS ARGUMENT

	SKP

	LAC	MPEERR

	DAC	.MED

	LAC (SKP)		/ RESTORE SKIP			/EAG:192

	DAC	MPEERR

	LAW	33		/IOPS 33

	JMP	.MED+1

								/EAG:192

								/EAG:192

PFERR	SKP			/POWER FAIL PI INTERRUPT

	JMP	.+3		/POWER FAIL API INTERRUPT

	LAC	0		/INTERRUPT PC IS ARGUMENT

	SKP

	LAC	PFERR

	DAC	.MED

	LAC (SKP)		/ RESTORE SKIP			/EAG:192

	DAC	PFERR

	LAW	34		/IOPS 34

	JMP	.MED+1

								/EAG:192

								/EAG:192

/SOFTWARE API ERROR---CHANNEL REGS. T.V.'S (112-115) NOT SETUP BY USER.

								/EAG:192

SERR	0

	RPL			/API STATUS IS ARGUMENT

	DAC .MED

	LAW	30		/IOPS 30

	JMP	.MED+1

	.TITLE ERROR DIAGNOSTIC ROUTINES

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ THE MONITOR ERROR DIAGNOSTIC ROUTINES HAVE TWO ENTRY POINTS.	/EAG:192

/ ONE IS TO THE STANDARD ERROR PROCESSOR, VIA .MED.  THE OTHER	/EAG:192

/ IS TO THE EXPANDED ERROR PROCESSOR, VIA SC.EEP.  THESE ENTRY	/EAG:192

/ POINTS ARE SET UP WITH TRANSFERS TO THE APPROPRIATE POINTS	/EAG:192

/ HERE IN THE DIAGNOSTIC ROUTINES PROPER.  THE TRANSFERS ARE TO	/EAG:192

/ LOCATION ER.MED OR ER.EEP RESPECTIVELY.  THE TRANSFERS ARE	/EAG:192

/ DONE WITH JMS INSTRUCTION INSTEAD OF JMP INSTRUCTIONS SO	/EAG:192

/ AS TO OBTAIN A FREE (UNINTERRUPTIBLE) INSTRUCTION.  THE	/EAG:192

/ FIRST INSTRUCTION OF EACH ERROR ROUTINE IS A JMS TO ER.ENTR.	/EAG:192

/ THE FIRST INSTRUCTION OF ER.ENTR IS A .INH.  THUS THE FIRST	/EAG:192

/ THING DONE ON ENTERING EITHER ERROR ROUTINE IS TO DISABLE	/EAG:192

/ INTERRUPTS.  THE ERROR ROUTINES DO A LOT OF PLAYING WITH	/EAG:192

/ THE CONSOLE TELETYPE AND OTHER SUCH SHENANIGANS WHICH DO	/EAG:192

/ NOT WANT TO BE INTERRUPTED.  ALSO, THE ERROR ROUTINES ARE	/EAG:192

/ NOT REENTRANT, SO THAT WE DON'T WANT TO ALLOW INTERRUPTS	/EAG:192

/ FROM WITHIN THE ERROR ROUTINES, BECAUSE SAID INTERRUPTS	/EAG:192

/ MAY RESULT IN A CALL TO THE ERROR ROUTINES.			/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ .MED MONITOR ERROR DIAGNOSTIC ROUTINE.  LOCATIONS .MED AND	/EAG:192

/ .MED+1 ARE SET UP (BY ROUTINE IN.ERR) TO CONTAIN:		/EAG:192

/								/EAG:192

/	.MED/	0		/ ACTUAL ENTRY POINT		/EAG:192

/		JMS ER.MED	/ TRANSFER TO ERROR ROUTINE	/EAG:192

/				/ WITHOUT INTERRUPT		/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.MED	0							/EAG:192

	JMS ER.ENTR		/// ENTER ERROR PROCESSOR AND	/EAG:192

				/// SAVE STATE INFORMATION	/EAG:192

	JMS ER.IOPS		/// OUTPUT IOPS ERROR MESSAGE	/EAG:192

	LAC .MED		/// ASSUME ERROR IS IOPS 4 AND	/EAG:195

	DAC ER.RADR		/// SET UP RETRY ADDRESS.	/EAG:195

	LAC (4)			/// IS ERROR IOPS 4?		/EAG:195

	SAD ER.ERR		///				/EAG:195

	JMP ER.RTRY		/// YES -- GO WAIT FOR ^R	/EAG:195

	DAC ER.RADR		/// NO -- POINT RETRY ADDRESS	/EAG:195

				/// TO LOC. 4 SO WE WILL COME	/EAG:195

				/// BACK HERE ON ^R.		/EAG:195
ER.FTL	NOP			/// DO RIGHT THING FOR UNRECOV-	/EAG:195

	JMP ER.RTRY		/// ERABLE (FATAL) IOPS ERROR.	/EAG:195

				/// NORMALLY WE GO TO ER.RTRY	/EAG:195

				/// TO WAIT FOR CONTROL CHAR.	/EAG:195

/				///				/EAG:195

/ THE ABOVE TWO LOCATIONS (ER.FTL AND ER.FTL+1) ARE MODIFIED	/EAG:195

/ BY IN.ERR IN ACCORDANCE WITH WHICH OF SEVERAL ERROR HANDLING	/EAG:195

/ OPTIONS HAS BEEN REQUESTED FROM THE NON-RESIDENT MONITOR.	/EAG:195

/ IF THE HALT COMMAND HAS BEEN ISSUED (BIT SC.HLT SET IN	/EAG:195

/ SC.NMF) THEN THE LOCATIONS WILL CONTAIN THE SEQUENCE:		/EAG:195

/								/EAG:195

/	ER.FTL	HLT		/// HALT ON FATAL IOPS ERROR	/EAG:195

/		JMP ER.RTRY	/// AND GO WAIT FOR CONTROL	/EAG:195

/				/// CHARACTER IF CONTINUED	/EAG:195

/								/EAG:195

/ IF THE QDUMP COMMAND IS ISSUED (BIT SC.DMP SET IN SC.NMF)	/EAG:195

/ BOTH LOCATIONS ARE REPLACED BY THE SEQUENCE:			/EAG:195

/								/EAG:195

/	ER.FTL	LAW 21		/// FAKE AN ^Q SO A DUMP	/EAG:195
/		JMP ER.FAK	/// WILL OCCUR.			/EAG:195
/								/EAG:195
/								/EAG:195
/ IF BOSS IS RUNNING, IT LOOKS LIKE THIS:			/RKB-202
/								/RKB-202
/	ER.FTL	JMP	BS.ERR /// CALL THE BOSS ERROR PROCESS	/RKB-202
/		  (DON'T CARE)					/RKB-202
/								/RKB-202
/ NOTE THAT THIS SCHEME DEPENDS ON IN.BOSS RUNNING AFTER IN.ERR	/RKB-202
/								/RKB-202
/								/RKB-202

								/EAG:192

	.IFNZR .MED-3		/ ABOVE CODE "KNOWS" THAT	/EAG:192

				/ .MED=3.  CHECK FOR IT		/EAG:192

ERROR	ABOVE CODE REQUIRES THAT .MED=3				/EAG:192

ERROR	RECODE IT APPROPRIATELY					/EAG:192

	.LOC .-2						/EAG:192

	.ENDC							/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ EXPANDED ERROR PROCESSOR.  ROUTINE IN.ERR SETS UP LOCATIONS	/EAG:192

/ SC.EEP AND SC.EEP+1 AS FOLLOWS:				/EAG:192

/								/EAG:192

/	SC.EEP	0		/ ACTUAL ENTRY POINT		/EAG:192

/		JMS ER.EEP	/ TRANSFER TO ERROR ROUTINE	/EAG:192

/				/ WITHOUT INTERRUPT		/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.EEP	0							/EAG:192

	JMS ER.ENTR		/// ENTER ERROR ROUTINES AND	/EAG:192

				/// SAVE STATE INFO.		/EAG:192

	LAC ER.ERR		/// IF ERROR CODE (PASSED IN AC	/EAG:192

	SPA			/// AND SAVED IN ERR) IS	/EAG:192

	JMS ER.IOPS		/// NEGATIVE OUTPUT IOPS	/EAG:192

				/// ERROR MESSAGE		/EAG:192

	LAC SC.EEP		/// PUT RETRY ADDRESS INTO	/EAG:192

	DAC ER.RADR		/// ER.RADR FOR ER.RTRY		/EAG:192

	ISZ SC.EEP		/// BUMP TO MESSAGE WORD COUNT	/EAG:192

	LAC* SC.EEP		/// PICK UP COUNT OF # OF WORDS	/EAG:192

	SMA			/// IN MESSAGE, IF POSITIVE NO	/EAG:192

	JMP EREE.1		/// MESSAGE TO OUTPUT.		/EAG:192

	DAC EREE.A		/// PUT COUNT INTO TEMP.	/EAG:192

EREE.0	ISZ SC.EEP		/// AND OUTPUT MESSAGE.		/EAG:192

	LAC* SC.EEP		/// PICK UP NEXT WORD OF MSG	/EAG:192

	JMS ER.SIX		/// AND TYPE IT OUT		/EAG:192

	ISZ EREE.A		/// REACHED END YET?		/EAG:192

	JMP EREE.0		/// NO -- CONTINUE		/EAG:192

EREE.1	LAC (4)			/// FINISHED OUTPUTTING MESSAGE	/EAG:195

	SAD ER.ERR		/// IS ERROR IOPS 4?		/EAG:195

	JMP ER.RTRY		/// YES -- GO WAIT FOR ^R	/EAG:195
ER.NT4	JMP ER.FTL		/// NOT IOPS 4.  NORMALLY, GO	/RKB-202
				/// WAIT FOR A CONTROL CHAR.	/EAG:195
/				///				/EAG:195
								/EAG:192

								/EAG:192

EREE.A	0			/ TEMPORARY			/EAG:192

	.TITLE     ER.RTRY -- RETURN FROM ERROR PROCESSOR

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ COME TO ER.RTRY TO WAIT FOR A CONTROL CHARACTER TO BE		/EAG:195

/ TYPED AND DO APPROPRIATE THING.  ER.RTRY ALSO HACKS MINI-ODT.	/EAG:195

/ COME TO ER.FAK WITH CONTROL CHARACTER CODE IN AC TO FAKE	/EAG:195

/ THE TYPING OF A CONTROL CHARACTER.  ERRT.0 IS THE PLACE TO	/EAG:195

/ COME TO (USED BY MINI-ODT) TO WAIT FOR A CHARACTER TO BE	/EAG:195

/ TYPED IN WITHOUT RE-INITIALIZING MINI-ODT.			/EAG:195

/								/EAG:192

								/EAG:192

								/EAG:192

ER.RTRY=.							/EAG:193

	.IFDEF %ODT		///				/EAG:193

	JMS ODT.IN		/// INITIALIZE MINI-ODT		/EAG:193

	.ENDC			///				/EAG:193

ERRT.0	LAC (CKTL.0)		/// ASSUME TIME LIMIT EXPIRED	/EAG:201

	DAC ERRT.B		/// AND SET UP EXIT ADDRESS.	/EAG:201

	LAC 7			/// COMPUTE NUMBER OF CLOCK	/EAG:201

	IAC			/// TICKS ELAPSED AND COMPARE	/EAG:201

	CLL!TCA			/// AGAINST # OF TICKS LEFT TO	/EAG:201

	TAD ER.TLM		/// TIME LIMIT EXPIRATION.	/EAG:201

	SNL			/// IF ENOUGH TICKS ELAPSED	/EAG:201

	JMP ERRT.1		/// GO TO TIME LIMIT UP ROUTINE	/EAG:201

	KSF			/// WAIT FOR CHARACTER TO BE	/EAG:192

	JMP ERRT.0		/// TYPED			/EAG:192

	KRB			/// GET THE CHARACTER		/EAG:192

ER.FAK	AND (177)		/// MASK OFF ANY CRUFT		/EAG:192

	DAC ERRT.A		/// SAVE IN CASE WE ECHO IT	/EAG:192

	SAD (03)		/// CHECK IF ITS ONE WE CAN USE	/EAG:192

	JMP ER.CTC		/// ^C				/EAG:192

	SAD (20)		/// ^P				/EAG:192

	JMP ER.CTP		///				/EAG:192

	SAD (21)		/// ^Q				/EAG:192

	JMP ER.CTQ		///				/EAG:192

	SAD (22)		/// ^R				/EAG:192

	JMP ER.CTR		///				/EAG:192

	SAD (23)		/// ^S				/EAG:192

	JMP ER.CTS		///				/EAG:192

	SAD (24)		/// ^T				/EAG:192

	JMP ER.CTT		///				/EAG:192

	.IFUND %ODT		///				/EAG:193

	JMP ER.RTRY		/// CHAR. WASN'T SUITABLE CTRL	/EAG:192

				/// CHAR. -- GO GET ANOTHER	/EAG:192

	.ENDC			///				/EAG:193

	.IFDEF %ODT		///				/EAG:193

	JMP ODT.CH		/// CHAR. WASN'T SUITABLE CTRL	/EAG:193

				/// CHAR. -- GO GIVE IT TO	/EAG:193

				/// MINI-ODT.			/EAG:193

	.ENDC			///				/EAG:193

								/EAG:192

								/EAG:192

/ COME HERE ON CTRL-R'S.  RESTORE STATE OF THINGS AND		/EAG:192

/ RETURN TO RETRY ADDRESS IN ER.RADR.				/EAG:192

								/EAG:192

ER.CTR	JMS ERRT.2		/// TYPE ^R			/EAG:192

	XCT ER.TCF		/// RESTORE TELEPRINTER FLAG	/EAG:192

	.IFDEF %ODT		///				/EAG:193

	LAC ER.XR		/// RESTORE INDEX REGISTER	/EAG:193

	PAX			///				/EAG:193

	XCT ER.EBA		/// AND BANK MODE IF NEEDED	/EAG:193

	.ENDC			///				/EAG:193

	LAC ER.ERR		/// RESTORE ERROR CODE TO AC	/EAG:192

				/// (IN CASE THE ERROR IS	/EAG:192

				/// NON-RETRYABLE,IN WHICH CASE	/EAG:192

				/// WE'RE ABOUT TO TRANSFER TO	/EAG:192

				/// .MED+1 AND FROM THERE BACK	/EAG:192

				/// TO ER.MED)			/EAG:192

	.ENB			/// ALLOW INTERRUPTS AGAIN	/EAG:192

	ION			///				/EAG:195

	JMP* ER.RADR		/// AND RETRY IT		/EAG:192

								/EAG:192

								/EAG:192

/ COME TO APPROPRIATE ADDRESS BELOW ON ^C, ^P, ETC.  CHECK	/EAG:192

/ THAT TRANSFER ADDRESS IS NON-ZERO, CLEAN THINGS UP, AND GO	/EAG:192

/ TO CONTROL CHAR. TRANSFER ADDRESS.				/EAG:192

								/EAG:192

ER.CTQ	LAC (CTRLQ)		/// ^Q.  IF ^Q AREA DOESN'T	/EAG:197

	SKP			/// EXIST, IN.CTQ PUTS A CLA	/EAG:197

				/// IN ER.CTQ.			/EAG:197

ER.CTC	LAC TTTABL+1		/// ^C				/EAG:192

	SKP			///				/EAG:192

ER.CTP	LAC TTTABL		/// ^P				/EAG:192

	SKP			///				/EAG:192

ER.CTS	LAC SC.UST		/// ^S				/EAG:192

	SKP			///				/EAG:192
ER.CTT	LAC TTTABL+2		/// ^T				/EAG:192

	AND (77777)		/// MASK OUT UNWANTED MODE BITS	/EAG:192

	SNA			/// CHCK THAT ADDR IS FOR REAL	/EAG:192

	JMP ER.RTRY		/// NOPE -- IGNORE THIS CHAR.	/EAG:192
	DAC ERRT.B		/// SAVE ADDRESS FOR LATER	/EAG:192
	DAC	ERRT.D		// AND FOR IOPS35 ERROR.	/RKB-208

	.IFDEF %ODT		///				/EAG:193

	SAD (2)			/// CHECK IF CONTROL CHAR. IS	/EAG:193

	JMP ER.RTRY		/// MINI-ODT, AND IGNORE IT IF	/EAG:193

				/// IS (AFTER ALL, WE'RE	/EAG:193

				/// ALREADY IN MINI-ODT).	/EAG:193

	.ENDC			///				/EAG:193

	JMS ERRT.2		/// ECHO CONTROL CHAR.		/EAG:192

ERRT.1	RPL			/// REMEMBER IF API IS ENABLED	/EAG:192

	AND (API.ON)		///				/EAG:192

	DAC ERRT.A		///				/EAG:192

	RDMM			/// AND CONTENTS OF MM REGISTER	/EAG:192

	DAC ERRT.C		///				/EAG:192

	JMS RM.CAF		/// CLEAR OUT EVERYTHING	/EAG:192

	.IFDEF %PRTCT		///				/EAG:193

	LAC SC.MSZ		/// RESTORE BOUNDARY AND	/EAG:193

	AAC -377		/// RELOCATE REGISTERS.		/EAG:193

	MPLD			///				/EAG:193

	CLA			///				/EAG:193

	MPLR			///				/EAG:193

	.ENDC			///				/EAG:193

	LAC ERRT.C		/// RESTORE MM REGISTER		/EAG:192

	LDMM			///				/EAG:192

	LAC ERRT.A		/// RESTORE API IF ENABLED	/EAG:192

	ISA			///				/EAG:192

	.INH			/// AND LOCK OUT INTERRUPTS	/EAG:192

				/// JUST IN CASE		/EAG:192

	LAW -1			/// INITIALIZE:			/EAG:192

	DAC CL.CTR		/// CAL LEVEL COUNTER		/EAG:192

	DAC TTCTFL		/// TTA CTRL CHAR FLAG		/EAG:192

	LAC (SERR)		/// API SOFTWARE LEVEL 4 TRAP	/EAG:193
	DAC SC.LV4		/// VECTOR			/EAG:193
	LAC	(ERRT.3)	/// POINT CONTROL CHARACTER	/RKB-208
	DAC	SC.TTP		/// RETURN ADDRESS TO IOPS35.	/RKB-208

	LAC SC.VTR		/// CHECK IF VT WAS RUNNING,	/EAG:193

	SZA			///				/EAG:193

	LSD			/// AND RESTART IT IF IT WAS.	/EAG:193

	.IFDEF %ODT		///				/EAG:193

	LAC ER.XR		/// RESTORE INDEX REGISTER	/EAG:193

	PAX			///				/EAG:193

	XCT ER.EBA		/// RESTORE BANK MODE IF NEEDED	/EAG:193

	.ENDC			///				/EAG:193

PLR.S2	NOP			/// RESTART UNICHANNEL POLLER	/EAG:194

				/// (IT WAS STOPPED BY RM.CAF).	/EAG:194

				/// THIS INSTRUCTION MODIFIED	/EAG:194

				/// BY IN.PLR.			/EAG:194

	.ENB			/// ALLOW INTERRUPTS		/EAG:193

	ION			///				/EAG:195

	JMS TTCBSW		/ CLEAR OUT TTA BUSY SWITCHES	/EAG:192

	JMS CK.STRT		/ AND RESTART CLOCK.		/EAG:192

				/ (MAKE SURE IT GETS STARTED)	/EAG:192

	.IFUND %PRTCT						/EAG:193

	XCT CL.USR		/ ENTER USER MODE IF NEEDED	/EAG:192

	.ENDC							/EAG:193

	.IFDEF %PRTCT						/EAG:193

	LAC SC.MOD		/ ENTER USER MODE IF NEEDED	/EAG:193

	AND (SC.XVM)						/EAG:193

	SZA			/ SKIP IF NOT ON XVM		/EAG:193

	MPEU							/EAG:193

	.ENDC							/EAG:193

	JMP* ERRT.B		/ AND GO TO CTRL CHAR ROUTINE	/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/ SUBROUTINE TO ECHO CONTROL CHARACTER ON TELEPRINTER.  IT	/EAG:192

/ IS FOLLOWED BY A CARRAIGE RETURN, LINE FEED.			/EAG:192

								/EAG:192
ERRT.2	0							/EAG:192

	LAW 36			/// UPARROW IN .SIXBT		/EAG:192

	JMS ER.TYP		/// TYPE IT			/EAG:192

	LAC ERRT.A		/// CONTROL CHAR. CODE IS ALSO	/EAG:192

				/// ALPHA. CHAR CODE IN .SIXBT	/EAG:192

	JMS ER.TYP		/// TYPE IT			/EAG:192

	JMS ER.CR		/// AND CR/LF			/EAG:192
	JMP* ERRT.2		/// RETURN			/EAG:192
								/RKB-208
								/RKB-208
								/RKB-208
/ COME HERE WHEN A CONTROL CHARACTER ROUTINE RETURNS TO		/RKB-208
/ US VIA A JMP* SC.TTP.						/RKB-208
/								/RKB-208
ERRT.3	LAC	ERRT.D		/ GIVE IOPS35 ERROR USING	/RKB-208
	DAC	.MED		/ SAVED CONTROL CHARACTER	/RKB-208
	LAW	35		/ ROUTINE ADDRESS FOR		/RKB-208
	JMP	.MED+1		/ ADDITIONAL INFORMATION.	/RKB-208
								/EAG:192
								/EAG:192
								/EAG:192
								/EAG:192
/ TEMPORARIES USED ABOVE:					/EAG:192
								/EAG:192
ERRT.A	0			/ USED TO SAVE CONTROL CHAR	/EAG:192
				/ AND ALSO FOR STATE OF API	/EAG:192
				/ ENABLE			/EAG:192
								/EAG:192
ERRT.B	0			/ USED TO SAVE CONTROL CHAR.	/EAG:192
				/ ROUTINE ADDRESS		/EAG:192
								/EAG:192
ERRT.C	0			/ USED TO SAVE MM REGISTER	/EAG:192
								/RKB-208
ERRT.D	0			/ USED TO SAVE CONTROL CHAR	/RKB-208
				/ ROUTINE ADDRESS FOR IOPS35	/RKB-208

								/EAG:193

	.IFDEF %ODT						/EAG:193

	.TITLE     MINI-ODT

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ ROUTINE TO INITIALIZE MINI-ODT:				/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

ODT.IN	0			///				/EAG:193

	DZM ODT.NM		/// CLEAR NUMBER INPUT		/EAG:193

	DZM ODT.NF		/// AND NUMBER INPUT FLAG	/EAG:193

	LAW -1			/// AND SET CURRENT ADDRESS	/EAG:193

	DAC ODT.AF		/// TO NONE.			/EAG:193

	JMS ER.CR		/// TYPE CRLF AFTER ERROR MSG	/EAG:193

	LAC (170424)		/// AND PROMPT FOR TYPE IN	/EAG:193

	JMS ER.SIX		///				/EAG:193

	LAC (407640)		///				/EAG:193

	JMS ER.SIX		///				/EAG:193

	JMP* ODT.IN		///				/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ ROUTINE TO ACCEPT ANOTHER CHARACTER.  ER.RTRY COMES HERE	/EAG:193

/ IF THE CHARACTER TYPED IN ISN'T ONE OF THE EXPECTED CONTROL	/EAG:193

/ CHARACTERS.  IT COMES HERE VIA A JMP.  THIS ROUTINE		/EAG:193

/ RETURNS TO ER.RTRY BY JUMPING TO EITHER ER.RTRY OR ERRT.0.	/EAG:193

/ IT GOES TO ER.RTRY FOLLOWING SYNTAX ERRORS AND ALT MODES	/EAG:193

/ SO AS TO RE-INITIALIZE MINI-ODT AND START EVERYTHING OVER.	/EAG:193

/ IT GOES TO ERRT.0 IN ALL OTHER CASE SO AS TO ACCEPT ANOTHER	/EAG:193

/ CHARACTER.							/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

ODT.CH	SAD (15)		/// CARRAIGE RETURN		/EAG:193

	JMP ODTC.3		///				/EAG:193

	SAD (175)		/// ALT MODE			/EAG:193

	JMP ODTC.6		///				/EAG:193

	SAD (33)		/// ALT MODE			/EAG:193

	JMP ODTC.6		///				/EAG:193

	SAD (176)		/// ALT MODE			/EAG:193

	JMP ODTC.6		///				/EAG:193

	SAD (57)		/// SLASH			/EAG:193

	JMP ODTC.2		///				/EAG:193

	AAC -60			/// CHECK IF ITS AND OCTAL	/EAG:193

	SPA			/// DIGIT.			/EAG:193

	JMP ODTC.0		/// IT ISN'T.			/EAG:193

	AAC -10			///				/EAG:193

	SPA			///				/EAG:193

	JMP ODTC.1		/// IT IS.			/EAG:193

ODTC.0	LAC (407777)		/// ILLEGAL CHAR. -- TYPE	/EAG:193

	JMS ER.SIX		/// " ??" AND START OVER.	/EAG:193

	JMP ER.RTRY		///				/EAG:193

								/EAG:193

								/EAG:193

/ COME HERE WHEN AN OCTAL DIGIT IS TYPED TO ACCUMULATE NUMBER.	/EAG:193

								/EAG:193

ODTC.1	LAC ODT.NM		/// PREVIOUS DIGITS		/EAG:193

	CLL!RAL			/// MULTIPLY BY 8.		/EAG:193

	RTL			///				/EAG:193

	TAD ERRT.A		/// ADD IN NEW DIGIT.		/EAG:193

	AAC -60			/// AND COMPENSATE FOR ASCII.	/EAG:193

	DAC ODT.NM		/// SAVE NEW NUMBER.		/EAG:193

	LAW -1			/// AND SET NUMBER TYPED IN	/EAG:193

	DAC ODT.NF		/// FLAG.			/EAG:193

	JMP ERRT.0		/// GO GET ANOTHER CHARACTER.	/EAG:193

								/EAG:193

								/EAG:193

/ COME HERE WHEN A SLASH IS TYPED.				/EAG:193

								/EAG:193

ODTC.2	ISZ ODT.NF		/// HAS A NUMBER BEEN TYPED IN?	/EAG:193

	JMP ODTC.0		/// NO -- SYNTAX ERROR.		/EAG:193

	LAC ODT.NM		/// YES -- PUT THE NUMBER INTO	/EAG:193

	PAX			/// CURRENT ADDRESS, AND 	/EAG:193

	DZM ODT.AF		/// INDICATE IT EXISTS.		/EAG:193

	JMP ODTC.5		/// AND GO TYPE ITS CONTENTS	/EAG:193

								/EAG:193

								/EAG:193

/ COME HERE WHEN A CARRIAGE RETURN IS TYPED.			/EAG:193

								/EAG:193

ODTC.3	JMS ER.CR		/// ECHO A LF			/EAG:193

	ISZ ODT.AF		/// VERIFY CURRENT ADDRESS	/EAG:193

	SKP			/// EXISTS, AND GIVE ERROR IF	/EAG:193

	JMP ODTC.0		/// IT DOESN'T.  ERROR ROUTINE	/EAG:193

				/// (ODTC.0) RE-INIT.'S MINI-	/EAG:193

				/// ODT, WHICH RESETS ODT.AF	/EAG:193

	ISZ ODT.NF		/// CHECK IF NUMBER WAS TYPED	/EAG:193

	JMP ODTC.4		/// IN.  JMP IF WASN'T.		/EAG:193

	LAC ODT.NM		/// FETCH NUMBER TYPED IN.	/EAG:193

	DAC 0,X			/// AND UPDATE APPRO. LOC.	/EAG:193

ODTC.4	AXR 1			/// BUMP CURRENT ADDRESS.	/EAG:193

	LAC (170424)		/// REPEAT PROMPT		/EAG:193

	JMS ER.SIX		///				/EAG:193

	LAC (407640)		///				/EAG:193

	JMS ER.SIX		///				/EAG:193

	PXA			/// TYPE CURRENT ADDRESS	/EAG:193

	JMS ER.NUM		///				/EAG:193

	LAW 57			/// FOLLOW WITH SLASH		/EAG:193

	JMS ER.TYP		///				/EAG:193

ODTC.5	LAW 40			/// TYPE A SPACE		/EAG:193

	JMS ER.TYP		///				/EAG:193

	LAC 0,X			/// AND CONTENTS OF CURRENT	/EAG:193

	JMS ER.NUM		/// ADDRESS.			/EAG:193

	DZM ODT.NM		/// CLEAR NUMBER TYPED IN,	/EAG:193

	DZM ODT.NF		/// AND ITS FLAG.		/EAG:193

	JMP ERRT.0		/// AND GO GET ANOTHER CHAR.	/EAG:193

								/EAG:193

								/EAG:193

/ COME HERE ON ALT MODES					/EAG:193

								/EAG:193

ODTC.6	ISZ ODT.NF		/// WAS NUMBER TYPED IN?	/EAG:193

	JMP ER.RTRY		/// NO -- GO RE-INIT		/EAG:193

	ISZ ODT.AF		/// YES -- BETTER EXIST CURRENT	/EAG:193

	SKP			/// ADDRESS OR ELSE ERROR.	/EAG:193

	JMP ODTC.0		/// GO GIVE ERROR AND RE-INIT.	/EAG:193

	LAC ODT.NM		/// PICK UP NUMBER,		/EAG:193

	DAC 0,X			/// AND STORE INTO CURRENT ADR.	/EAG:193

	JMP ER.RTRY		/// AND GO RE-INIT.		/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ LOCATIONS USED BY MINI-ODT LISTED BELOW.  IT ALSO USES	/EAG:193

/ THE XR TO STORE THE CURRENT ADDRESS BEING EXAMINED.		/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

ODT.NM	0			/ USED TO ACCUMULATE NUMBER	/EAG:193

				/ BEING TYPED IN		/EAG:193

								/EAG:193

ODT.NF	0			/ INDICATES WHETHER OR NOT	/EAG:193

				/ A NUMBER HAS BEEN TYPED IN.	/EAG:193

				/ -1 INDICATES A NUMBER HAS	/EAG:193

				/ BEEN TYPED IN, 0 INDICATES	/EAG:193

				/ ONE HASN'T.			/EAG:193

								/EAG:193

ODT.AF	0			/ INDICATES WHETHER OR NOT THE	/EAG:193

				/ CURRENT ADDRESS (KEPT IN THE	/EAG:193

				/ XR) IS VALID.  -1 INDICATES	/EAG:193

				/ IT IS INVALID, 0 INDICATES	/EAG:193

				/ IT IS VALID.			/EAG:193

								/EAG:193

	.ENDC							/EAG:193

	.TITLE     ER.ENTR -- ENTER ERROR PROCESSOR

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ THIS SUBROUTINE IS CALLED TO ENTER THE ERROR DIAGNOSTIC	/EAG:192

/ ROUTINES AND SAVE THE NECESSARY STATE INFORMATION.  THE	/EAG:192

/ CALL (JMS) TO THIS ROUTINE MUST BE THE FIRST INSTRUCTION	/EAG:192

/ IN THE ERROR ROUTINE.  THE FIRST INSTRUCTION OF THIS		/EAG:192

/ ROUTINE IS A .INH.  THUS, FROM THE TIME WE ENTER THE		/EAG:192

/ ERROR PROCESSOR, WE HAVE AN UNBROKEN STRING OF JMS'S		/EAG:192

/ FOLLOWED BY A .INH -- THEREFORE NO INTERRUPTS CAN HAPPEN.	/EAG:192

/								/EAG:192

/ THIS ROUTINE DISABLES INTERRUPTS, SAVES THE ERROR CODE	/EAG:192

/ (FROM THE AC) INTO ER.ERR, MODIFIES ROUTINE ER.TYP SO		/EAG:192

/ THAT NULLS WILL BE IGNORED OR PRINTED AS SPACES 		/EAG:192

/ (DEPENDING UPON THE LINK), WAITS FOR THE TTY TO BECOME	/EAG:192

/ IDLE, SAVES THE STATE OF THE TELETYPE FLAG (SO TTA.		/EAG:192

/ WON'T LOSE), AND TYPES A CARRIAGE RETURN/LINE FEED.		/EAG:192

/								/EAG:193

/ IF MINI-ODT IS BEING INCLUDED THIS ROUTINE ALSO SAVES THE	/EAG:193

/ INDEX REGISTER, THE CURRENT ADDRESSING MODE (BANK VS. PAGE),	/EAG:193

/ AND ENTERS PAGE MODE.  MINI-ODT MUST RUN IN PAGE MODE AS IT	/EAG:193

/ USES THE XR TO ADDRESS THE LOCATIONS IT EXAMINES.		/EAG:193

/								/EAG:192

								/EAG:192

								/EAG:192

ER.ENTR	0							/EAG:192

	.INH			/// DISABLE INTERRUPTS		/EAG:192

	IOF			///				/EAG:195

	DAC ER.ERR		/// SAVE ERROR CODE		/EAG:192

	.IFDEF %ODT		///				/EAG:193

	PXA			/// SAVE XR			/EAG:193

	DAC ER.XR		///				/EAG:193

	LAC (EBA)		/// GET EBA IF IN BANK MODE,	/EAG:193

	SBA			/// ELSE NOP AND PUT IN ER.EBA	/EAG:193

	LAC (NOP)		/// TO SAVE CURRENT ADDRESSING	/EAG:193

	DAC ER.EBA		/// MODE (BANK VS. PAGE).	/EAG:193

	DBA			/// AND ENTER PAGE MODE FOR	/EAG:193

				/// MINI-ODT.			/EAG:193

	.ENDC			///				/EAG:193

	LAW 40			/// SET UP ER.TYP TO IGNORE	/EAG:192

	SNL			/// NULLS IF LINK IS CLEAR,	/EAG:192

	LAC (JMP*  ER.TYP)	/// OUTPUT SPACES FOR NULLS	/EAG:192

	DAC ERTP.0		/// IF LINK IS SET		/EAG:192

	LAC SC.LFR		/// CALCULATE NUMBER OF TICKS	/EAG:201

	DAC ER.TLM		/// LEFT UNTIL TIME LIMIT	/EAG:201

	CLA!STL			/// EXPIRES.  MULTIPLY SC.TLM	/EAG:201

EREN.0	TAD SC.TLM		/// BY SC.LFR BY LOOPING SC.LFR	/EAG:201

	SZA!SNL!CLL		/// TIMES.  SET ER.TLM TO #	/EAG:201

	CLA!IAC!CLL		/// TICKS -1.  IF # TICKS	/EAG:201

	ISZ ER.TLM		/// OVERFLOWS USE 2**18-1 (THE	/EAG:201

	JMP EREN.0		/// MAXIMUM) INSTEAD ( > 1 HR.)	/EAG:201

	CMA			/// IF NO TIME LIMIT (SC.TLM=0)	/EAG:201

	DAC ER.TLM		/// PUT 777777 IN ER.TLM WHICH	/EAG:201

				/// DISABLES TIME LIMIT CHECK	/EAG:201

	LAC (600000)		/// WAIT ABOUT 131 MS. TO	/EAG:192

EREN.1	SZA!IAC			/// ALLOW ANY TTY OUTPUT IN	/EAG:192

	JMP EREN.1		/// PROGRESS TO FINISH		/EAG:192

	LAC (NOP)		/// SET UP ER.TCF TO CONTAIN	/EAG:192

	TSF			/// A NOP IF PRINTER FLAG IS	/EAG:192

	LAC (TCF)		/// SET, TCF IF IT IS CLEAR	/EAG:192

	DAC ER.TCF		///				/EAG:192

	JMS ER.CR		/// OUTPUT CR, LF		/EAG:192

	JMP* ER.ENTR		/// AND RETURN			/EAG:192

	.TITLE     ER.CR -- TYPE CARRAIGE RETURN, LINE FEED

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ OUTPUT CARRAIGE RETURN, LINE FEED.  WE DO THIS OURSELVES	/EAG:192

/ RATHER THAN USING ER.TYP BECAUSE ER.TYP ONLY OUTPUTS		/EAG:192

/ .SIXBT CHARACTERS.						/EAG:192

/								/EAG:192

/ LEAVE THE TELEPRINTER FLAG SET ON EXIT.			/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.CR	0							/EAG:192

	LAW 15			/// CARRAIGE RETURN FIRST	/EAG:192

ERCR.0	TCF			/// CLEAR FLAG			/EAG:192

	TLS			/// PRINT CHARACTER		/EAG:192

ERCR.1	TSF			/// DONE PRINTING YET?		/EAG:192

	JMP ERCR.1		/// NO -- WAIT			/EAG:192

	SAD ERCR.2		/// OUTPUT LF YET?		/EAG:192

	JMP* ER.CR		/// YES -- RETURN		/EAG:192

ERCR.2	LAW 12			/// OUTPUT LF NEXT		/EAG:192

	JMP ERCR.0		///				/EAG:192

	.TITLE     ER.IOPS -- OUTPUT IOPS MESSAGE

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ PRINT IOPS MESSAGE.  THE IOPS MESSAGE IS AS FOLLOWS:		/EAG:192

/								/EAG:192

/	IOPSNN (.MED) (SC.BBN)					/EAG:192

/								/EAG:192

/ "NN" IS THE APPROPRIATE IOPS ERROR CODE (STORED IN ER.ERR	/EAG:192

/ BY ER.ENTR) TYPED WITH LEADING ZEROS SUPPRESSED.  IF THE	/EAG:192

/ ERROR CODE IS 4 THIS IS ALL THAT IS TYPED.  FOR ALL OTHER	/EAG:192

/ ERROR CODES THE CONTENTS OF .MED FOLLOWS, SEPERATED BY	/EAG:192

/ A SPACE.  FOR ERROR CODES 20 AND 21 THE CONTENTS OF SC.BBN	/EAG:192

/ FOLLOWS THIS, ALSO SEPERATED BY A SPACE.  IN ALL CASES	/EAG:192

/ A SPACE IS TYPED FOLLOWING THE ENTIRE MESSAGE, IN CASE	/EAG:192

/ ANYTHING ELSE FOLLOWS.					/EAG:192

/								/EAG:192

/ THIS ROUTINE EXPECTS THE ERROR CODE IN ER.ERR AND TRUNCATES	/EAG:192

/ IT TO 9 BITS.  THUS AFTER CALLING THIS ROUTINE ER.ERR WILL	/EAG:192

/ CONTAIN THE "PURE" ERROR CODE, WITHOUT ANY OPCODE BITS LEFT	/EAG:192

/ FROM A LAW INSTRUCTION.					/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.IOPS	0							/EAG:192

	LAC (111720)		/// "IOP" IN .SIXBT		/EAG:192

	JMS ER.SIX		/// TYPE IT OUT			/EAG:192

	LAW 23			/// "S" IN .SIXBT		/EAG:192

	JMS ER.TYP		/// TYPE IT OUT			/EAG:192

	LAC (60)		/// SET UP ER.NUM TO SUPPRESS	/EAG:192

	DAC ERNM.A		/// LEADING ZEROS FOR ERR. #	/EAG:192

	LAC ER.ERR		/// FETCH ERROR CODE		/EAG:192

	AND (777)		/// MASK OUT CRUFT		/EAG:192

	DAC ER.ERR		/// SAVE FOR OTHER PEOPLE	/EAG:192

	SAD (4)			/// IF IOPS4,			/EAG:192

	JMP ERIO.0		/// SKIP SOME STUFF		/EAG:192

	JMS ER.NUM		/// TYPE ERROR NUMBER,		/EAG:192

				/// FOLLOWED BY A SPACE		/EAG:192

	LAC .MED		/// TYPE .MED NEXT		/EAG:192

ERIO.0	JMS ER.NUM		/// TYPE NUMBER FOLLOWED	/EAG:192

				/// BY A SPACE			/EAG:192

	LAW 777776		/// CHECK ERROR CODE # --	/EAG:192

	AND ER.ERR		/// IF NOT 20 OR 21 WE'RE	/EAG:192

	SAD (20)		/// DONE.			/EAG:192

	SKP							/EAG:192

	JMP* ER.IOPS		/// SO RETURN			/EAG:192

	LAC SC.BBN		/// IS 20 OR 21 -- SO TYPE	/EAG:192

	JMS ER.NUM		/// SC.BBN FOLLOWED BY SPACE	/EAG:192

	JMP* ER.IOPS		/// AND RETURN			/EAG:192

	.TITLE     ER.NUM -- TYPE AN OCTAL NUMBER

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ ROUTINE TO TYPE THE CONTENTS OF THE AC IN OCTAL.		/EAG:192

/ NORMALLY LEADING ZEROS WILL BE TYPED.  TO SUPPRESS		/EAG:192

/ OUTPUT OF LEADING ZEROS PUT 60 (OCTAL) INTO LOCATION		/EAG:192

/ ERNM.A BEFORE CALLING THIS ROUTINE.  UPON EXIT THIS		/EAG:192

/ WILL BE RESTORED SO THAT NEXT TIME LEADING ZEROS		/EAG:192

/ WILL NOT BE SUPPRESSED.					/EAG:192

/								/EAG:192

/ THIS ROUTINE WILL TYPE THE NUMBER IN OCTAL AND THEN		/EAG:192

/ FOLLOW IT WITH A SPACE					/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.NUM	0							/EAG:192

	DAC ERNM.B		/// SAVE NUMBER TO TYPE		/EAG:192

	LAW -6			/// PUT DIGIT COUNTER IN ERNM.C	/EAG:192

	DAC ERNM.C		/// COUNT IS # OF DIGITS	/EAG:192

ERNM.0	LAC ERNM.B		/// EXTRACT NEXT DIGIT		/EAG:192

	RTL			///				/EAG:192

	RAL			///				/EAG:192

	DAC ERNM.B		/// SAVE FOR NEXT TIME		/EAG:192

	RAL			/// AND POSITION DIGIT		/EAG:192

	AND (7)			/// MAKE INTO .SIXBT CHAR.	/EAG:192

	AAC 60			/// CODE			/EAG:192

	ISZ ERNM.C		/// REACHED END OF ZERO		/EAG:192

				/// SUPPRESSABLE DIGITS?	/EAG:192

	JMP ERNM.1		/// NO -- GO CHECK FOR IT	/EAG:192

	JMS ER.TYP		/// YES -- OUTPUT LAST DIGIT	/EAG:192

	LAW 40			/// AND FOLLOW WITH A SPACE	/EAG:192

	JMS ER.TYP		///				/EAG:192

	DZM ERNM.A		/// DON'T SUPPRESS ZEROS	/EAG:192

				/// NEXT TIME			/EAG:192

	JMP* ER.NUM		/// AND RETURN			/EAG:192

								/EAG:192

								/EAG:192

/ COME HERE TO CHECK IF DIGIT IS LEADING ZERO WHICH WANTS	/EAG:192

/ TO BE SUPPRESSED.  WE COME HERE FOR EACH DIGIT EXCEPT 	/EAG:192

/ THE LAST							/EAG:192

								/EAG:192

ERNM.1	SAD ERNM.A		/// IF MATCH, CHAR. IS LEADING	/EAG:192

				/// ZERO WHICH WANTS TO BE	/EAG:192

				/// SUPPRESSED			/EAG:192

	JMP ERNM.0		/// SO GO GET NEXT ONE		/EAG:192

	JMS ER.TYP		/// PRINT THIS DIGIT,		/EAG:192

	DZM ERNM.A		/// AND FLAG SO WILL PRINT	/EAG:192

				/// FUTURE DIGITS		/EAG:192

	JMP ERNM.0		/// AND GO GET THEM		/EAG:192

								/EAG:192

								/EAG:192

ERNM.A	0			/ ZERO SUPPRESS SWITCH		/EAG:192

				/ CONTAINS 60 IF ZEROS		/EAG:192

				/ SHOULD BE SUPPRESSED.		/EAG:192

				/ WILL BE CLEARED ON ANY	/EAG:192

				/ NON-ZERO CHARACTER.		/EAG:192

				/ CONTAINS ZERO IF ZEROS	/EAG:192

				/ SHOULD BE PRINTED		/EAG:192

								/EAG:192

ERNM.B	0			/ TEMPORARY TO HOLD NUMBER	/EAG:192

				/ BEING TYPED			/EAG:192

								/EAG:192

ERNM.C	0			/ TEMPORARY FOR DIGIT COUNTER	/EAG:192

	.TITLE     ER.SIX -- TYPE 3 .SIXBT CHARACTERS

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ TYPES 3 .SIXBT CHARACTERS FROM THE WORD IN THE AC.		/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.SIX	0							/EAG:192

	DAC ERSX.A		/// SAVE WORD			/EAG:192

	SWHA			/// GET FIRST CHARACTER		/EAG:192

	RTR			/// INTO POSITION		/EAG:192

	RAR			///				/EAG:192

	JMS ER.TYP		/// AND TYPE IT			/EAG:192

	LAC ERSX.A		/// GET SECOND CHARACTER	/EAG:192

	RTR			/// INTO POSITION		/EAG:192

	RTR			///				/EAG:192

	RTR			///				/EAG:192

	JMS ER.TYP		/// AND TYPE IT			/EAG:192

	LAC ERSX.A		/// THIRD CHAR. ALREADY IN	/EAG:192

	JMS ER.TYP		/// POSITION -- JUST TYPE IT	/EAG:192

	JMP* ER.SIX		/// DONE -- RETURN		/EAG:192

								/EAG:192

								/EAG:192

ERSX.A	0			/ TEMPORARY			/EAG:192

	.TITLE     ER.TYP -- TYPE A SINGLE .SIXBT CHARACTER

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ TYPE A SINGLE .SIXBT CHARACTER FROM THE AC.  IGNORE THE	/EAG:192

/ HIGH 12 BITS OF THE AC.  IGNORE NULLS OR OUTPUT THEM		/EAG:192

/ AS SPACES AS APPROPRIATE.  ROUTINE ER.ENTR SETS UP		/EAG:192

/ LOCATION ERTP.0 TO ACCOMPLISH THIS.				/EAG:192

/								/EAG:192

/ THE TELEPRINTER FLAG MUST BE SET WHEN THIS ROUTINE IS		/EAG:192

/ CALLED.  NO SPECIAL CARE IS NEEDED AS ER.CR LEAVES THE	/EAG:192

/ FLAG SET.  THIS ROUTINE ALWAYS LEAVES THE FLAG SET		/EAG:192

/ WHEN IT EXITS.						/EAG:192

/								/EAG:192

								/EAG:192

								/EAG:192

ER.TYP	0							/EAG:192

	AND (77)		/// MASK OUT CHARACTER		/EAG:192

	SNA			/// CHECK IF CHAR. IS NULL	/EAG:192

ERTP.0	XX			/// THIS LOCATION SET UP BY	/EAG:192

				/// ER.ENTR.  IF NULLS ARE	/EAG:192

				/// TO BE IGNORED IT WILL BE:	/EAG:192

				///				/EAG:192

				///	JMP* ER.TYP		/EAG:192

				///				/EAG:192

				/// IF NULLS ARE TO BE OUTPUT	/EAG:192

				/// AS SPACES IT WILL BE:	/EAG:192

				///				/EAG:192

				///	LAW 40			/EAG:192

				///				/EAG:192

	XOR (40)		/// CONVERT .SIXBT CHARACTER	/EAG:192

	AAC 40			/// TO ASCII			/EAG:192

	TCF			/// CLEAR TELEPRINTER FLAG	/EAG:192

	TLS			/// PRINT CHARACTER		/EAG:192

ERTP.1	TSF			/// WAIT FOR CHARACTER		/EAG:192

	JMP ERTP.1		/// TO BE PRINTED		/EAG:192

	JMP* ER.TYP		/// AND RETURN			/EAG:192

	.TITLE     GLOBAL VARIABLES USED BY ERROR ROUTINES

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

ER.ERR	0			/ THE ERROR CODE NUMBER.	/EAG:192

				/ STORED HERE BY ER.ENTR,	/EAG:192

				/ LATER MASKED TO 9 BITS BY	/EAG:192

				/ ER.IOPS.			/EAG:192

								/EAG:192

ER.TCF	XX			/ SWITCH WHICH IS USED TO	/EAG:192

				/ PRESERVE THE STATE OF THE	/EAG:192

				/ TELEPRINTER FLAG.  ROUTINE	/EAG:192

				/ ER.ENTR WAITS FOR THE		/EAG:192

				/ TELEPRINTER TO BECOME IDLE	/EAG:192

				/ AND THEN SETS THIS LOCATION	/EAG:192

				/ TO A NOP IF THE TELEPRINTER	/EAG:192

				/ FLAG IS SET OR A TCF IF THE	/EAG:192

				/ TELEPRINTER FLAG IS CLEAR.	/EAG:192

				/ ALL THE OUTPUT ROUTINES USED	/EAG:192

				/ IN THE ERROR PROCESSORS LEAVE	/EAG:192

				/ THE TELEPRINTER FLAG SET.	/EAG:192

				/ THUS EXECUTING THE		/EAG:192

				/ INSTRUCTION STORED HERE JUST	/EAG:192

				/ BEFORE RETURNING FROM A ^R	/EAG:192

				/ WILL CAUSE THE STATE OF THE	/EAG:192

				/ TELEPRINTER FLAG TO BE	/EAG:192

				/ PRESERVED.			/EAG:192

								/EAG:192

ER.RADR	-1			/ RETRY ADDRESS.  THE ADDRESS	/EAG:192

				/ TO TRANSFER TO TO EFFECT A	/EAG:192

				/ RETRY IS STORED HERE BY	/EAG:192

				/ ER.MED OR ER.EEP BEFORE	/EAG:192

				/ THEY TRANSFER TO ER.RTRY.	/EAG:192

				/ IN THE CASE OF A		/EAG:192

				/ NON-RETRYABLE ERROR (I.E.,	/EAG:192

				/ A NON-IOPS4 GIVEN TO		/EAG:192

				/ .MED) THIS LOCATION WILL BE	/EAG:192

				/ SET TO .MED+1, CAUSING THE	/EAG:192

				/ ERROR MESSAGE TO BE REPEATED	/EAG:192

				/ ON A ^R.			/EAG:192

								/EAG:193

	.IFDEF %ODT						/EAG:193

ER.XR	0			/ LOCATION IN WHICH TO SAVE	/EAG:193

				/ XR.  MINI-ODT USES THE XR.	/EAG:193

								/EAG:193

ER.EBA	XX			/ BANK/PAGE MODE SWITCH.  THIS	/EAG:193

				/ LOCATION SET UP BY ER.ENTR	/EAG:193

				/ TO REMEMBER ADDRESSING MODE	/EAG:193

				/ OF ROUTINE WHICH CALLED	/EAG:193

				/ ERROR PROCESSOR.  IT IS EBA	/EAG:193

				/ IF ROUTINE WAS IN BANK MODE,	/EAG:193

				/ NOP IF IT WAS IN PAGE MODE.	/EAG:193

	.ENDC							/EAG:193

								/EAG:201

ER.TLM	777777			/ LOCATION WHICH CONTAINS THE	/EAG:201

				/ # OF TICKS LEFT BEFORE TIME	/EAG:201

				/ LIMIT EXPIRES.  ACTUALLY WILL	/EAG:201

				/ BE # TICKS -1.  777777 TURNS	/EAG:201

				/ OFF CHECKING FOR TIME LIMIT.	/EAG:201

				/ IT CORRESPONDS TO 2**18 TICKS	/EAG:201

				/ WHICH CAN NEVER BE REACHED	/EAG:201

				/ SINCE LOCATION 7 WRAPS AROUND	/EAG:201

	.TITLE CLOCK INTERRUPT ROUTINES

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ SERVICE CLOCK INTERRUPTS.  ALL THE WORK IS DONE BY THE	/EAG:195

/ LOOP WHICH STARTS AT CKIN.0.  THIS LOOP IS EXECUTED ONCE	/EAG:195

/ FOR EACH CLOCK TICK (1/60 OR 1/50 SECOND).  EACH TIME IT	/EAG:195

/ DECREMENTS LOCATION 7, AND WHEN LOCATION 7 GOES TO -1 IT	/EAG:195

/ EXITS.							/EAG:195

/								/EAG:195

/ THIS ROUTINE IS USED BOTH WITH AND WITHOUT API, BUT ONLY ONE	/EAG:195

/ OF THESE PER CORE LOAD.  IN EITHER CASE THE INTERRUPT ENTRY	/EAG:195

/ POINT IS CK.INT.  THE LAST INSTRUCTION (AT LABEL CK.RET)	/EAG:195

/ IS THE RETURN INSTRUCTION AND IS MODIFIED FOR THESE TWO	/EAG:195

/ CASES.  IT IS A JMP* CK.INT IF API IS IN USE AND A JMP* 0	/EAG:195

/ OTHERWISE.  IT IS SET UP BY THE ROUTINE IN.CLK.		/EAG:195

/								/EAG:194

								/EAG:194

CK.INT	NOP			/ INTERRUPT ENTRY POINT		/EAG:195

	DAC CK.AC		/ SAVE AC			/EAG:195

CKIN.0	LAW -1			/ MAIN LOOP.  DECREMENT		/EAG:194

	.INH			/// LOCATION 7.  LOCKOUT	/EAG:194

	TAD 7			/// INTERRUPTS TO MINIMIZE	/EAG:194

	.ENB			/// CHANCE OF INTERRUPT BETWEEN	/EAG:194

	DAC 7			/// TAD AND DAC CAUSING US TO	/EAG:194

				/// LOSE A TICK.		/EAG:194

	CLON			/ CLEAR CLOCK FLAG		/EAG:194

	ISZ SC.ETT		/ INCREMENT ELAPSED TIME IN	/EAG:194

	NOP			/ TICKS, CHECK FOR OVERFLOW.	/EAG:194

	LAC SC.TMT		/ .TIMER TIME LIMIT IN EFFECT?	/EAG:194

	SZA			/ SKIP IF NOT			/EAG:194

	ISZ SC.TMT		/ TIME LIMIT EXPIRED?		/EAG:194

	JMP CKIN.1		/ NO -- SKIP THIS		/EAG:194

	LAC SC.TMA		/ TIME LIMIT EXPIRED.  REMEMBER	/EAG:194

	AND (77777)		/ .TIMER ADDRESS (TO AVOID	/EAG:194

	DAC CKTR.A		/ TIMING BUGS) AND REQUEST	/EAG:194

	JMS RQ.LV4		/ EXECUTION OF .TIMER ROUTINE.	/EAG:194

	  CK.TMR						/EAG:194

	  0			/ NON-API INT. RETURN ADDR.	/EAG:195

CKIN.1	ISZ SC.TMR		/ IS SECOND UP YET?		/EAG:194

	JMP CKIN.3		/ NO -- GO FINISH UP.		/EAG:194

	LAC SC.LFR		/ YES -- RESTORE SECOND COUNTER	/EAG:194

	DAC SC.TMR						/EAG:194

PLR.J1	NOP			/ INVOKE POLLER.  THIS INSTR.	/EAG:194

				/ MODIFIED BY IN.PLR.		/EAG:194

	ISZ SC.ETS		/ INCREMENT ELAPSED TIME IN	/EAG:194

	NOP			/ SECONDS			/EAG:194

	LAC SC.TLM		/ TIME LIMIT REQUESTED?		/EAG:194

	SZA			/ SKIP IF NOT			/EAG:194

	ISZ SC.TLM		/ TIME LIMIT EXPIRED?		/EAG:194

	JMP CKIN.2		/ NO -- SKIP THIS		/EAG:194

	DZM SC.TMT		/ WE'RE GOING TO DO A .EXIT, SO	/EAG:195

				/ DON'T LET A .TIMER INTERRUPT	/EAG:195

				/ MAKE US FORGET IT.		/EAG:195

	JMS RQ.LV4		/ TIME LIMIT EXPIRED -- REQUEST	/EAG:194

	  CK.TLM		/ EXECUTION OF TIME LIMIT RTN.	/EAG:194

	  0			/ NON-API INT. RETURN ADDR.	/EAG:195
CKIN.2	ISZ SC.TIM		/ INCREMENT TIME OF DAY		/EAG:194

	LAC SC.TIM		/ AND CHECK OF SECONDS		/EAG:194

	AND (77)		/ HAVE OVERFLOWED		/EAG:194

	SAD (74)						/EAG:194

	SKP							/EAG:194

	JMP CKIN.3		/ SECONDS NOT EQUAL TO 60	/EAG:194

	LAC SC.TIM		/ 60 SECONDS REACHED -- ZERO	/EAG:194
	AAC 100-74		/ SECONDS AND INCREMENT MINUTES	/EAG:194

	DAC SC.TIM						/EAG:194

	AND (7700)		/ AND CHECK IF MINUTES HAVE	/EAG:194

	SAD (7400)		/ OVERFLOWED			/EAG:194

	SKP							/EAG:194

	JMP CKIN.3		/ THEY HAVEN'T			/EAG:194

	XOR SC.TIM		/ FETCH HOURS			/EAG:194

	SAD (270000)		/ CHECK IF = 23.		/EAG:194

	CLA!SKP			/ YES -- TIME IS 00:00:00	/EAG:194

	TAD (10000)		/ NO -- INCREMENT HOURS		/EAG:194
	DAC SC.TIM		/ REMEMBER NEW TIME		/EAG:194
	SZA			/ DID WE PASS MIDNIGHT?		/RKB-207
	JMP	CKIN.3		/ NO				/RKB-207
	LAC	SC.TDT		/ GET TOMORROWS DATE		/RKB-207
	DAC	SC.DAY		/ IT IS NOW TODAYS DATE		/RKB-207
	DZM	SC.TDT		/ ONLY GOOD FOR ONE MIDNIGHT	/RKB-207
				/ BETWEEN CALLS TO NON-RES MON	/RKB-207
				/ AFTER TWO MIDNIGHTS, IT WILL	/RKB-207
				/ REQUEST DATE AS BEFORE	/RKB-207

CKIN.3	LAW -1			/ FINISHED WITH PREVIOUS CLOCK	/EAG:194

	SAD 7			/ TICK.  ANY MORE TO DO?	/EAG:194

	SKP			/ NO -- SO EXIT			/EAG:195

	JMP CKIN.0		/ YES -- DO LOOP AGAIN		/EAG:194

	LAC CK.AC		/ RESTORE AC			/EAG:195

	ION			/ REENABLE PI IF IT IS OFF	/EAG:195

	DBR			/ AND RETURN			/EAG:195

CK.RET	JMP* CK.INT		/ THIS INSTRUCTION IS A JMP* 0	/EAG:195

				/ IF API NOT IN USE		/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

CK.AC	0			/ LOC. TO SAVE AC		/EAG:195

	.TITLE     CK.STRT -- ROUTINE TO RESTART CLOCK

								/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

/								/EAG:195

/ THIS ROUTINE IS CALLED FOLLOWING CLEAR ALL FLAGS AND OTHER	/EAG:195

/ SUCH THINGS WHICH MAY CAUSE US TO LOSE A CLOCK INTERRUPT.	/EAG:195

/ IT ISSUES A CLON (TO MAKE SURE THE CLOCK IS STILL TICKING)	/EAG:195

/ AND THEN CHECKS LOCATION 7 TO SEE IF WE'VE MISSED A CLOCK	/EAG:195

/ INTERRUPT.  IF LOCATION 7 CONTAINS ANYTHING OTHER THAN -1	/EAG:195

/ WE'VE MISSED AN INTERRUPT.  IF WE HAVE MISSED AN		/EAG:195

/ INTERRUPT WE SIMULATE AN INTERRUPT AND INVOKE THE CLOCK	/EAG:195

/ INTERRUPT ROUTINE.						/EAG:195

/								/EAG:195

/ NOTE THAT THE INTERRUPT SYSTEM SHOULD BE TURNED ON AND	/EAG:195

/ ENABLED PRIOR TO CALLING THIS ROUTINE.  ALSO THIS ROUTINE	/EAG:195

/ MAY ONLY BE CALLED IN EXEC. MODE. (ACTUALLY, ALL THAT IS	/EAG:195

/ REALLY NEEDED IS THAT G-MODE BE DISABLED AND IOT'S BE		/EAG:195

/ ALLOWED).							/EAG:195

/								/EAG:195

/ THE ROUTINE AS PRESENTED BELOW IS FOR API OPERATION ONLY.	/EAG:195

/ IF API IS NOT IN USE THE ROUTINE IN.CLK WILL MODIFY VARIOUS	/EAG:195

/ INSTRUCTIONS BELOW TO CAUSE THE INTERRUPT SYNCHRONIZATION	/EAG:195

/ TO WORK FOR PI OPERATION RATHER THAN API.			/EAG:195

/								/EAG:195

								/EAG:195

CK.STRT	0							/EAG:195

	CLON			/ KEEP THE CLOCK TICKING	/EAG:195

	LAC (API.L3)		/ RAISE TO CLOCK INTERRUPT	/EAG:195

CKST.0	ISA			/ LEVEL SO INTERRUPTS WON'T	/EAG:195

				/ BOTHER US.  IF NON-API IN.CLK	/EAG:195

				/ CHANGES THE ISA TO AN IOF.	/EAG:195

	LAW -1			/ DID WE MISS AN INTERRUPT?	/EAG:195

	SAD 7			/ SKIP IF WE DID		/EAG:195

	JMP CKST.3		/ NO -- GO RETURN		/EAG:195

	LAC CK.STRT		/ YES -- SIMULATE INTERRUPT.	/EAG:195

CKST.1	DAC CK.INT		/ USE RETURN ADDRESS FOR INT.	/EAG:195

				/ RETURN ADDRESS.  IF NON-API	/EAG:195

				/ IN.CLK CHANGES DAC CK.INT TO	/EAG:195

				/ DAC 0.			/EAG:195

CKST.2	JMP CK.INT+1		/ AND ENTER INTERRUPT ROUTINE.	/EAG:195

				/ IF NON-API IN.CLK CHANGES	/EAG:195

				/ JMP CK.INT+1 TO JMP CK.INT.	/EAG:195

								/EAG:195

								/EAG:195

/ COME HERE TO DROP BACK TO MAINSTREAM AND RETURN.		/EAG:195

								/EAG:195

CKST.3	DBK			/ DROP BACK TO MAINSTREAM LEVEL	/EAG:195

				/ IF NON-API IN.CLK CHANGES	/EAG:195

				/ DBK TO ION.			/EAG:195

	JMP* CK.STRT		/ RETURN TO CALLER.		/EAG:195

	.TITLE     CK.TMR -- .TIMER INTERRUPT ROUTINE

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS ROUTINE IS SCHEDULED VIA RQ.LV4 WHEN			/EAG:194

/ .TIMER INTERRUPT GOES OFF.  THE USER'S INTERRUPT ROUTINE	/EAG:194

/ ADDRESS (KEPT IN SC.TMA) HAS BEEN SAVED IN CKTR.A.		/EAG:194

/ IT HAS ALREADY BEEN MASKED TO 15 BITS.			/EAG:194

/								/EAG:195

/ THE ROUTINE PRESENTED BELOW IS FOR NON-API OPERATION.  IF	/EAG:195

/ WE ARE USING API ALMOST THE ENTIRE ROUTINE (LOCATIONS CKTR.1	/EAG:195

/ THROUGH CKTR.4 INCLUSIVE) IS REPLACED BY A DIFFERENT ROUTINE.	/EAG:195

/ THIS IS DONE BY IN.CLK.					/EAG:195

/								/EAG:194

								/EAG:194

CK.TMR	0			/ TWO LOCATIONS FOR RQ.LV4	/EAG:194

	0							/EAG:194

CKTR.0	0			/ THE ACTUAL ENTRY POINT	/EAG:194

	DAC CKTR.B		/ SAVE AC			/EAG:195

	LAC CKTR.0		/ PICK UP RETURN ADDRESS FROM	/EAG:195

	AND (77777)		/ WHICH .TIMER INT. OCCURRED.	/EAG:195

CKTR.1	SAD (CKTR.3)		/ CHECK IF HAPPENED FROM INSIDE	/EAG:195

	JMP CKTR.2		/ US -- I.E. IF REENTRANCY	/EAG:195

				/ PROBLEM OCCURED.  IF IT DID	/EAG:195

				/ REUSE OLD RETURN ADDRESS.	/EAG:195

	LAC CKTR.0		/ IT DIDN'T, SO SAVE RETURN	/EAG:195

	DAC CKTR.C		/ ADDRESS.			/EAG:195

	.IFDEF %PRTCT						/EAG:195

CKTR.2	LAC SC.MOD		/ ENTER USER MODE IF		/EAG:195

	AND (SC.XVM)		/ APPROPRIATE			/EAG:195

	SZA							/EAG:195

	MPEU							/EAG:195

	.ENDC							/EAG:195

	.IFUND %PRTCT						/EAG:195

CKTR.2	XCT CL.USR		/ ENTER USER MODE IF NEEDED	/EAG:195

	.ENDC							/EAG:195

	LAC CKTR.B		/ RESTORE AC FOR USER'S .TIMER	/EAG:195

				/ INTERRUPT ROUTINE.		/EAG:195

	JMS* CKTR.A		/ AND CALL HIS ROUTINE		/EAG:195

CKTR.3	RES			/ RESTORE PREVIOUS OPERATING	/EAG:195

				/ MODES.  MIGHT GET INTERRUPT	/EAG:195

				/ AT THIS POINT WHICH REQUIRES	/EAG:195

				/ REENTRANCY CHECK ABOVE.	/EAG:195

CKTR.4	JMP* CKTR.C		/ RETURN TO INTERRUPTED ROUTINE	/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

CKTR.A	0			/ LOC. TO SAVE ROUTINE ADDRESS	/EAG:195

								/EAG:195

CKTR.B	0			/ LOC. TO SAVE AC		/EAG:195

								/EAG:195

CKTR.C	0			/ LOC. TO SAVE RETURN ADDRESS	/EAG:195

				/ TO INTERRUPTED ROUTINE.	/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

								/EAG:195

/								/EAG:195

/ BELOW WE PRESENT THE ROUTINE WHICH REPLACES THE ABOVE		/EAG:195

/ ROUTINE WHEN API IS IN USE.  THIS REPLACEMENT IS DONE		/EAG:195

/ BY IN.CLK.  THE ACTUAL CODE FOR THE API ROUTINE IS		/EAG:195

/ CONTAINED IN IN.CLK.  THE READER IS CAUTIONED AGAINST		/EAG:195

/ ASSUMING THAT WHAT WE PRESENT BELOW IS CORRECT WITHOUT	/EAG:195

/ CHECKING IT AGAINST THE TEMPLATE WITHIN IN.CLK.		/EAG:195

/								/EAG:195

/	CK.TMR	0		/ TWO LOCATIONS FOR RQ.LV4	/EAG:195

/		0						/EAG:195

/	CKTR.0	0		/ THE ACTUAL ENTRY POINT	/EAG:195

/		DAC CKTR.B	/ SAVE AC			/EAG:195

/		LAC CKTR.0	/ PICK UP RETURN ADDRESS FROM	/EAG:195

/		AND (77777)	/ WHICH .TIMER INT. OCCURRED.	/EAG:195

/	CKTR.1	DAC* CKTR.A	/ GIVE TO USER'S ROUTINE.	/EAG:195

/		XOR CKTR.0	/ PICK UP MODE BITS		/EAG:195

/		XOR CKTR.A	/ APPEND TO ROUTINE ADDRESS.	/EAG:195

/		IAC		/ BUMP TO FIRST INSTRUCTION.	/EAG:195

/		DAC CKTR.A	/ PUT WHERE WE CAN USE IT	/EAG:195

/		LAC CKTR.B	/ RESTORE AC			/EAG:195

/		DBR		/ AND GO TO USER'S ROUTINE	/EAG:195

/		JMP* CKTR.A					/EAG:195

/								/EAG:195

/	CKTR.A	0		/ LOC. TO SAVE ROUTINE ADDRESS	/EAG:195

/								/EAG:195

/	CKTR.B	0		/ LOC. TO SAVE AC		/EAG:195

/								/EAG:195

/ NOTE THAT BOTH ROUTINES ARE IDENTICAL UP TO BUT NOT INCLUDING	/EAG:195

/ THE LOCATION LABELED CKTR.1.  ONLY LOCATIONS CKTR.1 ONWARDS	/EAG:195

/ ARE REPLACED.							/EAG:195

/								/EAG:195

	.TITLE     CK.TLM -- TIME LIMIT EXPIRED INTERRUPT

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS ROUTINE IS SCHEDULED VIA RQ.LV4 WHEN THE TIME LIMIT	/EAG:195

/ (SC.TLM) HAS EXPIRED.  IF API IS IN USE, NOTE THAT BY		/EAG:195

/ ISSUEING THE .EXIT DIRECTLY, WHILE STILL AT LEVEL 4,		/EAG:195

/ WE AVOID THE PROBLEMS OF A .TIMER OR ^C BYPASSING THE TIME	/EAG:195

/ LIMIT.  IF API IS NOT IN USE THERE IS NOTHING WE CAN DO	/EAG:195

/ SO WE DON'T DO ANYTHING.					/EAG:195

/								/EAG:194

								/EAG:194

CK.TLM	0			/ TWO LOCATIONS FOR USE BY	/EAG:194

	0			/ RQ.LV4			/EAG:194

	0			/ THE ACTUAL ENTRY POINT	/EAG:194

CKTL.0	NOP			/ THIS IS A BOSS-MODE SWITCH	/RKB-198

				/ IT IS A 'JMP BS.TLE' WHEN	/RKB-198

				/ BOSS IS RUNNING.  CONTROL	/RKB-198

				/ NEVER RETURNS HERE.		/RKB-198

	.EXIT			/ JUST DO .EXIT			/EAG:194

/

/	CLEAR OUT TELETYPE I/O

/

TTCBSW	0

	DZM	TTIOSW		/CLEAR OUT BUSY SWITCH

PLR.X1	NOP			/ INVOKE POLLER IF IT WANTS US	/EAG:194

				/ TO.  THIS INSTRUCTION		/EAG:194

				/ MODIFIED BY IN.PLR.		/EAG:194

	LAW 760000		/ SET ACCEPT INPUT FLAG		/EAG:191

	DAC TTINSW						/EAG:191

	JMP* TTCBSW						/EAG:191

	.TITLE TTA.

/TELETYPE HANDLER  7-17-68

/PETE WILSON / J.J. MURPHY, JR / D. LENEY

EDCXAD	0		/ADDRESS OF VTLBUF FOR EDITVT

TTIOSW	0	/TTY I/O UNDERWAY - NON 0 IF UNDERWAY

TTA.	DAC TTYCAL	/SAVE CAL ADDRESS

	DAC TTCALT

	ISZ TTCALT		/POINTS TO FUNCTION

	LAC TTIOSW		/PICK UP IO UNDERWAY INDICATOR.

	SZA!CLL		/CONTINUE IF IO IS FINISHED.

	JMP TTLOPT		/OTHERWISE RETURN TO CAL.

	LAC TTYCAL

	DAC TTYPTR	/ADDRESS OF CURRENT ARGUMENT.

	ISZ TTYPTR	/BUMP POINTER TO FUNCTION WANTED.

	LAC* TTYPTR	/GET ACTION-REQUESTED DESIGNATOR.

	ISZ TTYPTR		/BUMP POINTER TO NEXT ARGUMENT (IF ANY).

	ADD TTDTPR	/ADD TABLE BASE ADDRESS.

	DAC TTRTPT	/GIVE TO DISPATCHER.

TTRTPT	XX        	/DISPATCH ON FUNCTION CODE.

/TABLE OF FUNCTIONS.

TTDTPR	JMP TTDTBL-1

TTDTBL	JMP TTINIT	/.INIT ---1

	LAW 777377	/.DLETE,.RENAM,.FSTAT---2(LAW)

.DATAD	LAW	-1	/.SEEK----3 (LAW)

	ISZ TTYPTR	/.ENTER ---4

	JMP TTWAIT	/.CLEAR ---5

	JMP TTCLOS	/.CLOSE ---6

	JMP TTWAIT	/.MTAPE ---7

	JMP TTREAD	/.READ ---10

	JMP TTWRIT	/.WRITE ---11

	JMP TTWAIX	/.WAIT ----12

	.EJECT

/ERROR RETURNS.

TTERR6	LAW 6		/ILLEGAL FUNCTION. .TRAN --13

	JMS	SC.EEP						/EAG:191

	JMP	TTERR6

	-1

	.SIXBT	'TTA'
TTERR7	LAW 7		/ILLEGAL DATA MODE.

	JMS	SC.EEP						/EAG:191

	JMP	TTERR7

	-1
	.SIXBT	'TTA'
TTER67	LAW 67		/FETCH ERROR CODE			/RCHM-209
	JMS SC.EEP	/ENTER EXTENDED ERROR PROCESSOR	/RCHM-209
	JMP TTER67	/REISSUE ERROR ON ^R RETRY.		/RCHM-209
	-1		/WORD COUNT				/RCHM-209
	.SIXBT 'TTA'	/MESSAGE				/RCHM-209
	.EJECT

/

TTWATR	LAW 1000

	AND* TTYCAL

	SNA

	JMP TTLOOP	/NOT .WAITR

	LAC TTYCAL

	AND (700000)	/SAVE L,EM,MP				/EAG:191

	DAC TTYCAL

	ISZ TTCALT	/POINTS TO BUSY RETURN

	LAC* TTCALT

	AND (77777)	/15 BITS ONLY				/EAG:191

	XOR TTYCAL	/FOR DBR

	DAC TTYCAL

	JMP TTLOOP

TTWAIX	LAW 1000

	AND* TTYCAL

	SZA

	ISZ TTYPTR

	JMP TTWAIT

/INITIALIZE TELETYPE.

TTINIT	LAC* TTYPTR	/GET CALLER'S CONTROL ENTRY.

	RAL		/FIND 2-BIT PREFIX.

	RTL

	AND (3) 	/TAKE ONLY BITS 0, 1.			/EAG:191

	TAD (TTTABL)		/ CALCULATE POINTER TO TABLE	/EAG:192

	DAC TTRTPT		/ ENTRY,			/EAG:192

	LAC* TTYPTR		/ PICK UP ADDRESS OF NEW CTRL	/EAG:192

	DAC* TTRTPT		/ CHAR. ROUTINE AND PUT INTO	/EAG:192

				/ TABLE ENTRY			/EAG:192

	ISZ TTYPTR	/BUMP TO BUFFER SIZE.

	LAC (42)	/GET STANDARD LENGTH.---34 (DECIMAL)

	DAC* TTYPTR	/GIVE TO CALLER.

	ISZ TTYPTR		/BUMP TO RETURN.

	LAC	SC.BOS		/ CHECK FOR BOSS MODE		/RKB-198

	AND	(SC.BMD)	/ AND DON'T DO CR/LF FOR BOSS	/RKB-198

	SZA!CMA			/ THIS IS THE JIGGLER		/RKB-198

				/ AC MUST BE NON-ZERO AS IT	/RKB-198

				/ WILL BE USED TO SET TTY BUSY	/RKB-198

				/ SWITCH RIGHT SHORTLY HERE	/RKB-198

	JMP	TTLNFN		/ DON'T JIGGLE OR WASTE PAPER	/RKB-198

	JMP TTINS1	/GO OUTPUT C.R./L.F.

TTCLOS	LAC TTCFLG	/SWITCH FLAG.

	CMA

	DAC TTCFLG

	SMA		/IS THIS 2ND ENTRANCE.

	JMP TTWAIT	/YES. ---EXIT AFTER .CLOSE

	LAC TTYCAL	/SIT ON .CLOSE.

	DAC TTYPTR

	.EJECT

TTINS1	DZM	TTOSW1

	DAC TTIOSW	/I/O UNDERWAY

TTOCRT	LAW 15		/PRINT THIS CARRIAGE RETURN.

TTYCR1	JMS TTOSVC		/..

TTLFO	LAW 212		/LF

	JMS TTOSVC

TTLNFN	DZM TTIOSW

PLR.X2	NOP			/ INVOKE POLLER IF IT WANTS	/EAG:194

				/ US TO.  THIS INSTRUCTION	/EAG:194

				/ MODIFIED BY IN.PLR.		/EAG:194

	JMP	TTYVT4

TTLOPT	LAC* TTCALT

	AND (77777)						/EAG:191

	SAD (12)	/IS IT A WAIT				/EAG:191

	JMP TTWATR	/YES TEST FOR .WAITR

TTLOOP	DBR		/EXIT IF I/O UNDERWAY.

	XCT .+1

	JMP* TTYCAL

TTCFLG	0

/

	.EJECT

/TTWRIT, TTREAD.

TTWRIT=.

	LAW 17777		/SET UP INITIAL 5-CHARACTER COUNTER.

	JMS TTYSET		/GO SET UP MODE AND LINE BUF ADDRESS.

	LAC (JMP TTDSMS)	/IGNORE INITIAL LINE FEED	/EAG:191

	DAC TTLFSW		/IN IOPS ASCII LINE.

	ISZ TTYPTR	/BUMP TO RETURN.

TTYVT1	NOP

	LAC* TTLBH	/EXTRACT WORD PAIR COUNT FROM LBH.

	AND (377000)						/EAG:191

	TAD (777000)		/ SUBTRACT 1 FOR HEADER		/EAG:191

	SNA!SPA		/SKIP IF NON 0 AND +

	JMP TTOCRT		/ELSE WORD COUNT ERROR.  OUTPUT C.R./L.F.

	DAC TTWDCT		/WD. PAIR COUNT-HEADER.

	JMP TTOGTC	/GO GET FIRST CHARACTER.

/

/

TTREAD=.

	LAW 17773		/SET INITIAL 5-CHARACTER COUNTER.

	JMS TTYSET		/GO SET UP MODE AND INPUT ADDRESS.

	LAC (2)		/ADJUST WORD COUNT IN CAL SEQUENCE	/EAG:191

	TAD* TTYPTR	/FOR HEADER PAIR.

	ISZ TTYPTR

	SMA

	JMP TTLNFN		/ILLEGAL WORD COUNT---IGNORE REQUEST.

	DAC TTWDCT	/PUT SOMETHING IN WORD COUNT REGISTER.

	JMS	TTLFRT

	IOF			/INSURE EXIT PRIOR TO ACCEPTANCE

	DZM	TTINSW		/OF INPUT; ACCEPT INPUT

	JMP TTDSM2	/RETURN TO CALLER.

	.EJECT

/SOME SUBROUTINES.

/SUBROUTINE TO INITIALIZE POINTERS, INDICATORS AND

/COUNTERS, FOR .READ'S AND .WRITE'S.
TTYSET	0

	DAC TG5CHR

	LAW 2000		/CHECK ALPHA

	AND* TTYCAL		/BIT IN CAL INST.

	SNA

	JMP TTERR7	/ILLEGAL DATA MODE.

	LAC* TTYCAL

	AND (1000)						/EAG:191

	SWHA							/EAG:191

	TAD (1002)	/WD. PAIR OF 1 FOR HDR			/EAG:191

	DAC TTIVAL	/L.B. HDR. ACCUMULATOR.
	LAC* TTYPTR	/FETCH BUFFER ADDRESS			/RCHM-209
	AND (700000)	/IS THE BUFFER ABOVE 32K?		/RCHM-209
	SZA		/0 => BELOW 32K				/RCHM-209
	JMP TTER67	/ABOVE 32K, ISSUE ERROR			/RCHM-209
	LAC* TTYPTR	/FETCH BUFFER ADDRESS			/RCHM-209
	DAC TTLBH 	/ADDRESS OF LINE BUFFER HEADER.

	ADD (2)							/EAG:191

	DAC TTADR 	/ADDRESS OF FIRST DATA WORD.

	DAC	TTIOSW		/SET TELETYPE BUSY SWITCH

	ISZ TTYPTR	/BUMP POINTER FOR READ OR WRITE.

	DZM CTLUFG	/CLEAR OUT CONTROL U ISSUED FLAG

	JMP* TTYSET	/RETURN TO CALLER.

/

/SUBROUTINE TABOUT, PRINT SPACES ON IN-OUT TAB ENCOUNTERED.

TABOUT	0

	LAW 40		/GET A SPACE.

	JMS TTOSVC		/GO PRINT IT

	LAW -10		/ENTRY FROM PRINTING, GET COUNT WANTED.

	SAD TTOBLK	/HAVE WE REACHED IT.Q

	JMP* TABOUT	/YES, RETURN TO CALLER.

	JMP TABOUT+1	/NO, GO FOR MORE.

/

	.EJECT

/SUBROUTINE TTICLS, GENERATE HEADER PAIR FOR INPUT LINE.

TTICLS	0

	LAC TTIVAL		/IN CASE ODD # OF WORDS

	TAD (400)		/ROUND UPWARD.			/EAG:191

	AND (777377)		/INSERT IN WD. 0 OF		/EAG:191

	DAC* TTLBH		/USER'S LINE BUFFER.

	JMP* TTICLS

/

/SUBROUTINE TTROT7, ROTATE IOPS WORD PAIR 7 LEFT OR RIGHT.

TTROT7	0

	LAW 17771		/SET UP 7-BIT COUNTER.

	DAC TP7BTS	/..

TT7RO	LAC TTRWD3	/ENTER ROTATE.

	XCT* TTROT7

	DAC TTRWD3

	LAC TTRWD2

	XCT* TTROT7

	DAC TTRWD2

	LAC TTRWD1

	XCT* TTROT7

	DAC TTRWD1

	ISZ TP7BTS	/FINISHED WITH 7 TIMES THROUGH.Q

	JMP TT7RO		/NO, GO GET SOME MORE.

	ISZ TTROT7	/YES, BUMP TO RETURN.

	JMP* TTROT7	/RETURN TO CALLER.

/

TTOTAB=.

TT35N2	XX		/TAB OUTPUT PROCESSING

			/JMS TABOUT IF 33

			/JMS TTOSVC IF 35/37

TT35N3	XX		/ JMP NONULL IF 33			/EAG:191

			/ LAW -2 IF 35/37			/EAG:191

JMPDLY	DAC DELAY

	CLA

	JMS TTOSVC		/TYPE NULLS AS DELAY

	ISZ DELAY		/ANY MORE

	JMP .-3		/YES

NONULL	LAC (TTNORM)		/NO - RESET INTERRUPT PROCESSOR	/EAG:191

	DAC TTOSVC

	JMP TTYCR3+1		/GET NEXT CHAR

FORM	JMS TTOSVC

	LAW -12		/DELAY FOR VT OR FF

	JMP JMPDLY

	.EJECT

/SUBROUTINE TPUTCH, INSERT TYPED CHARACTER (IN TTCHR) IN LINE BUFFER.

TPUTCH	0

	LAC TTIVAL		/BIT 17: 1 IF IMAGE, 0 IF IOPS ASCII.

	RAR

	LAC TTCHR

	SNL

	JMP TPASCI	/DEPOSIT IOPS ASCII CHAR

	JMS TTDPOS		/DEPOSIT IMAGE ALPHA CHAR

	JMP TTIRTN		/MORE TO DO.

TPASCI	RTR		/ADD IOPS ASCII CHAR.

	RTR		/TO CURRENT WORD

	RTR		/PAIR.

	RTR

	DAC TTRWD3

	JMS TTROT7

	RAL

	ISZ TG5CHR

	JMP* TPUTCH

	LAC TTRWD2	/WORD PAIR IS FULL.

	RAL!CLL	/SHIFT PAIR LEFT 1 BIT

	DAC TTRWD2	/THEN ENTER IT IN

	LAC TTRWD1	/USER'S LINE BUFFER.

	RAL

	JMS TTDPOS

	LAC TTRWD2

	JMS TTDPOS

	LAW 17773		/RESET 5/7 COUNTER FOR NEXT PAIR.

	DAC TG5CHR

	JMP* TPUTCH

	.EJECT

TTDPOS	0		/DEPOSIT ONE WORD INTO USER'S LINE BUFFER

	DAC* TTADR

	ISZ TTADR

	LAC TTIVAL		/UPDATE WORD 0 ACCUMULATOR BY 1/2 PAIR.

	TAD (400)						/EAG:191

	DAC TTIVAL

	ISZ TTWDCT

	JMP* TTDPOS

	LAC TTCHR		/WD. CNT. EXHAUSTED

	SAD (15)						/EAG:191

	JMP TTICRT		/C.R. ECHO L.F.

	LAC TTIVAL

	RAR

	SZL!RAL

	JMP	TTIMGE		/IMAGE .ASCII END

	XOR (60)		/BUFFER OVERFLOW. INDICATION	/EAG:191

	DAC TTIVAL		/ IF IOPS ASCII.

	LAW	15		/RETURN CARRIAGE TO INDICATE BUFFER OVFLO

	JMS	TTOSVC	/AND GIVE A LINE FEED AND STOP .READ

	JMP	TTICRT

	JMS TTFILL		/PAD IOPS ASCII WORD PAIR.

TTIALT	JMS TTICLS		/GENERATE HEADER PAIR.

	JMP TTLNFN

TTIMGE	JMS	TTICLS		/GENERATE HEADER PAIR

	JMS	TTCBSW		/CLEAR OUT TELETYPE BUSY FLAGS

	JMP	TTEXT1		/RETURN TO USER

/

	.EJECT

/TELETYPE INPUT SERVICE - INTERRUPT SECTION

TIINT	DAC TINTAC		/ SAVE AC TEMPORARILY		/EAG:201

	KRB		/GET THE CHARACTER TYPED

	AND (177)		/TAKE ONLY 7 BITS		/EAG:191

	DAC TTCHR1		/SAVE IT TEMPORARILY

	SAD (3)			/CONTROL C			/EAG:191

	JMP TTCTLC		/ GO HANDLE ^C			/EAG:192

	SAD (20)		/CONTROL P			/EAG:191

	JMP TTCTLP		/ GO HANDLE ^P			/EAG:192

	SAD (24)		/CONTROL T			/EAG:191

	JMP TTCTLT		/ GO HANDLE ^T			/EAG:192

	SAD (23)		/CONTROL S			/EAG:191

	JMP TTCTLS		/ GO HANDLE ^S			/EAG:192

	SAD (21)		/CONTROL Q			/EAG:191

	JMP TTCTLQ		/ GO HANDLE ^Q			/EAG:192

	CLA			/IGNORE CHARACTER IF I/O NOT IN PROGRESS

	SAD	TTIOSW		/INDICATED BY BUSY SWITCH NON-ZERO

	JMP	TTIGNR		/IGNORE CHARACTER

	LAC TTINSW	/DETERMINE WHETHER OR NOT INPUT WAS

	SZA!CMA		/EXPECTED FROM THE KEYBOARD.

	JMP TTCTRL		/INPUT WAS NOT EXPECTED IF NON-ZERO.

				/DON'T ACCEPT ANOTHER INTERRUPT

	DAC TTINSW		/UNTIL FINISHED WITH THIS CHARACTER.

	LAC TINTAC		/ PICK UP AC FROM INTERRUPT	/EAG:201

	DAC TIAC	  	/PUT IT IN THE USUAL PLACE.

	LAC 0			/ PICK UP PC FROM INTERRUPT	/EAG:201

	DAC TTYPTR		/SAVE THAT TOO.

	ION

	LAC TTCHR1 	/GET CHARACTER.

/MAP STRANGE ALT MODE CHARACTERS TO MODEL 33 ALT MODE (175).

	SAD (176)						/EAG:191

	LAC (175)	/ALTMODE				/EAG:191

	SAD (33)						/EAG:191

	LAC (175)						/EAG:191

	DAC TTCHR 	/SAVE FOR LATER.

	SAD (4)			/^D  ENDFILE			/EAG:191

	JMP TTDCLS

/PUT CHARACTER IN LINE BUFFER AND CHECK FOR COMPLETION.

TTYVT2	NOP		/TESTS FOR SPECIAL CHAR. IF VT ON

	JMS TPUTCH

/

	.EJECT

/CHECK FOR SPECIAL CHARACTER. (IOPS ASCII MODE) RETURN IF NON-SPECIAL.

	LAC TTCHR

	SAD (015)	/INPUT CHARACTER IS CARRIAGE RETURN.	/EAG:191

	JMP TTICRT-1	/LINE TERMINATOR, VARIETY 1.

	SAD (175)	/ALT MODE.				/EAG:191

	JMP TTIALT-1	/LINE TERMINATOR, VARIETY 2.

	SAD (177)	/RUBOUT.				/EAG:191

	JMP TTIDEL	/GO DELETE PREVIOUS CHARACTER.

	SAD (25)		/CONTROL U.			/EAG:191

	JMP TTIKIL		/GO DELETE CURRENT LINE.

TT35N1	XX		/TAB INPUT PROCESSING

			/SAD (11) IF 33				/EAG:191

			/SKP IF 35/37

TTY011=(11)		/ REMEMBER ADDRESS OF CONSTANT FOR	/EAG:191

			/ INITIALIZATION ROUTINE IN.TTA		/EAG:191

	JMS TABOUT	/GO PRINT SOME SPACES.

	JMP	TTIRTN

	.TITLE     CODE TO HANDLE ^C, ^P, ^T, ^S

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/ TABLE OF ADDRESSES USED FOR ^P, ^C, ^T.  THIS TABLE IS	/EAG:192

/ UPDATED BY THE .INIT FUNCTION.  THE FOURTH WORD IS		/EAG:192

/ PROVIDED IN CASE THE USER SPECIFIES AN ILLEGAL CODE		/EAG:192

/ IN THE HIGH TWO BITS OF THE APPROPRIATE WORD.			/EAG:192

/ A ZERO IN THE ENTRY CAUSES THE APPROPRIATE CONTROL CHAR.	/EAG:192

/ TO BE IGNORED.  A TWO CAUSES MINI-ODT TO BE INVOKED.		/EAG:192

/ IT SHOULD BE NOTED THAT THIS TABLE MAY BE MODIFIED BY		/EAG:196

/ THE BATCH AND BOSS INITIALIZATION ROUTINES (IN.BAT AND	/EAG:196

/ IN.BOS).							/EAG:196

								/EAG:192

TTTABL	0			/ ^P ADDRESS			/EAG:192

	TTEXIT			/ ^C ADDRESS			/EAG:192

	.IFUND %ODT						/EAG:193

	0			/ ^T ADDRESS			/EAG:192

	.ENDC							/EAG:193

	.IFDEF %ODT						/EAG:193

	2			/ ^T ADDRESS			/EAG:193

	.ENDC							/EAG:193

	0			/ UNUSED			/EAG:192

								/EAG:192

								/EAG:192

/ DEFAULT CODE FOR ^C:						/EAG:192

								/EAG:192

TTEXIT	.EXIT							/EAG:192

								/EAG:192

								/EAG:192

/ LOCATIONS USED BY CONTROL CHAR CODE:				/EAG:192

								/EAG:192

TTCTFL	-1			/ CONTROL FLAG.  CONTAINS -1	/EAG:192

				/ IF A CONTROL CHARACTER IS NOT	/EAG:192

				/ BEING PROCESSED, ANYTHING	/EAG:192

				/ ELSE IF A CONTROL CHAR. IS	/EAG:192

				/ BEING PROCESSED.  WHILE A	/EAG:192

				/ CHAR. IS BEING PROCESSED ALL	/EAG:192

				/ ADDITIONAL CONTROL CHAR.'S	/EAG:192

				/ WILL BE IGNORED.		/EAG:192

								/EAG:192

TTCTAD	0			/ LOC. TO REMEMBER ADDRESS OF	/EAG:192

				/ CONTROL CHAR. ROUTINE (I.E.,	/EAG:192

				/ CONTENTS OF SC.UST OR APPRO.	/EAG:192

				/ ENTRY IN TTTABL)		/EAG:192

								/EAG:192

TTCTCH	0			/ LOC. TO REMEMBER CHARACTER	/EAG:192

				/ CODE OF CONTROL CHARACTER	/EAG:192

				/ (FOR ECHOING PURPOSES)	/EAG:192

								/EAG:192

TTJMP.	JMP .			/ WAIT LOOP WHILE WE'RE WAITING	/EAG:192

				/ FOR CONTROL CHAR.'S TO BE	/EAG:192

				/ ECHOED.			/EAG:192

								/EAG:192

								/EAG:192

/ THE ACTUAL CODE ITSELF:					/EAG:192

								/EAG:192

TTCTLQ	LAC (CTRLQ)		/ ^Q.  IF ^Q AREA DOESN'T EXIST	/EAG:197

	SKP			/ IN.CTQ PUTS A CLA IN TTCTLQ.	/EAG:197

TTCTLS	LAC SC.UST		/ PICK UP ^S ADDRESS		/EAG:192

	SKP							/EAG:192

TTCTLC	LAC TTTABL+1		/ PICK UP ^C ADDRESS		/EAG:192

	SKP							/EAG:192

TTCTLP	LAC TTTABL		/ PICK UP ^P ADDRESS		/EAG:192

	SKP							/EAG:192

TTCTLT	LAC TTTABL+2		/ PICK UP ^T ADDRESS		/EAG:192

	AND (77777)		/ MASK OUT UNWANTED MODE BITS	/EAG:192

	SNA			/ CHECK IF NULL (ZERO) ENTRY	/EAG:192

	JMP TTIGNR		/ IT IS -- IGNORE CONTROL CHAR.	/EAG:192

	ISZ TTCTFL		/ IS CONTROL CHAR. ALREADY	/EAG:192

				/ BEING PROCESSED?		/EAG:192

	JMP TTIGNR		/ YES -- IGNORE THIS ONE	/EAG:192

	DAC TTCTAD		/ REMEMBER ROUTINE ADDRESS	/EAG:192

	LAC TTCHR1		/ PICK UP CONTROL CHAR. CODE	/EAG:192

	AAC 100			/ MAKE INTO ALPHA. CHAR.	/EAG:192

	DAC TTCTCH		/ AND REMEMBER IT		/EAG:192

	JMS RQ.LV4		/ REQUEST LEVEL 4 INTERRUPT	/EAG:192

	  TTLV4							/EAG:192

	  0			/ INTERRUPT RETURN ADDRESS	/EAG:195

	JMP TTIGNR		/ AND RETURN FROM TTY INTERRUPT	/EAG:192

								/EAG:192

								/EAG:192

/ LEVEL 4 INTERRUPT CODE.  THIS CODE ACTUALLY PROCESSES THE	/EAG:192

/ CONTROL CHAR. REQUEST						/EAG:192

/ THE CODE GIVEN BELOW IS MOSTLY FOR NON-API OPERATION.		/EAG:201

/ FOR API OPERATION ALL THE CODE FLAGGED WITH "/*/" IS		/EAG:201

/ EFFECTIVELY NOPPED, ALTHOUGH ONLY LOCATIONS TTL4.3 AND	/EAG:201

/ TTL4.4 ARE ACTUALLY OVERLAYED WITH NOPS.  LOCATION TTL4.5	/EAG:201

/ BELOW BECOMES A "LAC TTLV4R" FOR API OPERATION.		/EAG:201

								/EAG:192

TTLV4	0			/ TWO WORDS OF TEMP. STORAGE	/EAG:192

	0			/ FOR RQ.LV4			/EAG:192

TTLV4R	0			/ ACTUAL ENTRY POINT		/EAG:192

	.INH			/// LOCK OUT INTERRUPTS SO TTY	/EAG:193

	IOF			/// INTERRUPT CAN'T BOTHER US.	/EAG:195

	DAC TIAC		/// SAVE AC			/EAG:192

	.IFDEF %ODT		///				/EAG:193

	CLA!CMA			/// SET INPUT-IN-PROGRESS FLAG	/EAG:193

	DAC TTODTB		/// FOR MINI-ODT.  ASSUMES	/EAG:193

				/// SUBSEQUENT CHECK INDICATES	/EAG:193

				/// INPUT IS IN PROGRESS.	/EAG:193

	.ENDC			///				/EAG:193

	LAC TTIOSW		/// CHECK IF TTY IS BUSY.	/EAG:193

	SNA			/// SKIP IF IT IS		/EAG:193

	JMP TTL4.1		/// IT ISN'T -- NEEDN'T WAIT	/EAG:193

	LAC TTINSW		/// CHECK IF IT'S DOING INPUT	/EAG:193

	SNA			/// SKIP IF IT ISN'T		/EAG:193

	JMP TTL4.2		/// IT IS -- NEEDN'T WAIT	/EAG:193

	LAC (700000)		/// TTA. IS BUSY WITH OUTPUT --	/EAG:193

TTL4.0	SNA!IAC			/// WAIT UNTIL CHAR. BEING	/EAG:193

	JMP TTL4.1		/// OUTPUT FINISHES (I.E. TSF	/EAG:193

	TSF			/// SKIPS) OR ABOUT 139 MSEC.	/EAG:193

	JMP TTL4.0		/// PASSES, WHICHEVER IS FIRST.	/EAG:193

TTL4.1=.			///				/EAG:193

	.IFDEF %0DT		///				/EAG:193

	DZM TTODTB		/// CLEAR INPUT-IN-PROGRESS FLG	/EAG:193

	.ENDC			///				/EAG:193

TTL4.2	TCF			/// CLEAR TELEPRINTER FLAG	/EAG:193

	LAC TTLV4R		/// PICK UP MODE BITS		/EAG:192

	AND (700000)		///				/EAG:192

	DAC TTLV4		/// SAVE THEM AWAY		/EAG:193

	XOR (TTJMP.)		/// AND SET UP JMP . TO RUN	/EAG:192

	DAC TTYPTR		/// WHILE WE'RE ECHOING CONTROL	/EAG:192

				/// CHAR.'S			/EAG:192

	LAW 136			/// TYPE UPARROW ("^")		/EAG:192

	DAC TTIOSW		/// AFTER SETTING BUSY SWITCH	/EAG:192

	.ENB			/// AND ALLOWING INTERRUPTS	/EAG:193

	ION			///				/EAG:195

	DAC TTINSW		/// AFTER DISALLOWING INPUT.	/EAG:193

	JMS TTLFRT		/ OUTPUT LF IF NEEDED		/EAG:192

	JMS TTOSVC						/EAG:192

	LAC TTCTCH		/ AND TYPE CONTROL CHAR		/EAG:192

	JMS TTOSVC						/EAG:192

	.IFUND %PRTCT	      /*/				/EAG:201

	LAC CL.USR	      /*/ SET LINK TO REFLECT USER/EXEC	/EAG:201

	SAD (NOP)	      /*/ MODE STATUS.  L=1 => USER,	/EAG:201

	CLL!SKP		      /*/ L=0 => EXEC MODE.		/EAG:201

	STL		      /*/				/EAG:201

	.ENDC		      /*/				/EAG:201

	.IFDEF %PRTCT	      /*/				/EAG:201

	LAC SC.MOD	      /*/ SET LINK TO REFLECT USER/EXEC	/EAG:201

	AND (SC.XVM)	      /*/ MODE STATUS.  L=1 => USER,	/EAG:201

	SZA!CLL		      /*/ L=0 => EXEC MODE.		/EAG:201

	STL		      /*/				/EAG:201

	.ENDC		      /*/				/EAG:201

	LAC TTCTAD		/ PICK UP CONTROL CHAR. ROUTINE	/EAG:193

	.IFDEF %ODT						/EAG:193

	SAD (2)			/ AND CHECK IF FOR MINI-ODT.	/EAG:193

	JMP TTODT		/ JMP IF IT IS, ELSE TAKE	/EAG:193

	.ENDC							/EAG:193

	XOR TTLV4		/ ADDRESS, ADD IN MODE BITS,	/EAG:193

TTL4.3	AND (677777)	      /*/ CLEAR USER/EXEC MODE BIT AND	/EAG:201

	SZL		      /*/ RESET IT PROPERLY		/EAG:201

TTL4.4	XOR (100000)	      /*/				/EAG:201

	DAC TTYPTR		/ AND USE FOR RETURN ADDRESS.	/EAG:193

	LAC TIAC		/ SET UP SC.TTA AND SC.TTP TO	/EAG:201

	DAC SC.TTA		/ REFLECT WHERE ^P, ETC. IS	/EAG:201

TTL4.5	LAC (TTL4.6)		/ INTERRUPTING THE PROGRAM.  IF	/EAG:201

	AND (77777)		/ USING API TTL4.5 BECOMES:	/EAG:201

	DAC SC.TTP		/	TTL4.5	LAC TTLV4R	/EAG:201

	LAW -1			/ RESTORE CONTROL CHAR. IN	/EAG:192

	DAC TTCTFL		/ PROGRESS FLAG, SO CAN GET	/EAG:192

				/ NEXT CONTROL CHAR. OK		/EAG:192

	JMP TTLNFN		/ AND RETURN			/EAG:192

								/EAG:193

TTL4.6	RES		      /*/ RESTORE PROPER OPERATING	/EAG:201

	JMP* TTLV4R	      /*/ MODES AND RETURN FROM CTRL	/EAG:201

			      /*/ CHAR. INTERRUPT.		/EAG:201

								/EAG:201

	.IFDEF %ODT						/EAG:193

	.TITLE     INTERFACE TO MINI-ODT

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ COME HERE WHEN CONTROL CHARACTER IS ^T WHICH IS CONNECTED	/EAG:193

/ TO MINI-ODT.							/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

TTODT	LAC TTLV4R		/ USE REAL RETURN ADDRESS	/EAG:193

	DAC TTYPTR		/ AS RETURN ADDRESS.		/EAG:193

	SWHA			/ AND PUT HIGH THREE OCTAL	/EAG:193

	JMS TTODT5		/ DIGITS AT TTODT0.		/EAG:193

	DAC TTODT0						/EAG:193

	LAC TTLV4R		/ THEN PUT LOW THREE DIGITS	/EAG:193

	JMS TTODT5		/ IN TTODT1.			/EAG:193

	DAC TTODT1						/EAG:193

	LAC TIAC		/ SIMILARLY PUT SIX OCTAL	/EAG:193

	SWHA			/ DIGITS OF SAVED AC AT		/EAG:193

	JMS TTODT5		/ TTODT2 AND TTODT3.		/EAG:193

	DAC TTODT2						/EAG:193

	LAC TIAC						/EAG:193

	JMS TTODT5						/EAG:193

	DAC TTODT3						/EAG:193

	CLA			/ TELL ERROR PROCESSOR NOT TO	/EAG:193

	JMS SC.EEP		/ TYPE IOPS MESSAGE, AND CALL	/EAG:193

	JMP TTODT4		/ ERROR PROCESSOR.  ON ^R	/EAG:193

	LAW .-TTODT4+1		/ RETURN TO INTERRUPTED PGM.	/EAG:193

	.SIXBT "ODT > PC="	/ MESSAGE TO BE OUTPUT BY ERROR	/EAG:193

TTODT0	0			/ PROCESSOR PRIOR TO INVOKING	/EAG:193

TTODT1	0			/ MINI-ODT.  CONSISTS OF	/EAG:193

	.SIXBT "   AC="		/ IMITATION OF MINI-ODT PROMPT	/EAG:193

TTODT2	0			/ PLUS CONTENTS OF PC AND AC	/EAG:193

TTODT3	0			/ AT TIME OF INTERRUPT.		/EAG:193

								/EAG:193

TTODT4	LAW -1			/ ^R RETURN.  RESTORE CONTROL	/EAG:193

	DAC TTCTFL		/ CHAR. FLAG.			/EAG:193

	ISZ TTODTB		/ WAS INPUT IN PROGRESS?	/EAG:193

	JMP TTLNFN		/ NO -- RETURN TO INTERRUPTED	/EAG:193

				/ PROGRAM.			/EAG:193

	DZM TTINSW		/ YES -- CLEAR FLAG SO INPUT	/EAG:193

				/ WILL BE ACCEPTED,		/EAG:193

	JMP TTYVT4		/ AND RETURN WITHOUT CLEARING	/EAG:193

				/ TTIOSW.			/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ FOLLOWING SUBROUTINE ACCEPTS 3 OCTAL DIGITS IN LOW HALF OF	/EAG:193

/ AC AND CONVERTS THEM TO THREE .SIXBT CHARACTERS (RETURNED	/EAG:193

/ IN AC).  THE HIGH HALF OF THE AC (ON INPUT) IS IGNORED.	/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

TTODT5	0							/EAG:193

	DAC TTODTA		/ SAVE INPUT			/EAG:193

	RTL			/ ROTATE HIGH DIGIT UP 3 BITS	/EAG:193

	RAL							/EAG:193

	XOR TTODTA		/ BRING IN MIDDLE DIGIT		/EAG:193

	AND (777707)						/EAG:193

	XOR TTODTA						/EAG:193

	RTL			/ ROTATE HIGH AND MIDDLE DIGITS	/EAG:193

	RAL			/ INTO PROPER POSITION		/EAG:193

	XOR TTODTA		/ AND BRING IN BOTTOM DIGIT	/EAG:193

	AND (777770)						/EAG:193

	XOR TTODTA						/EAG:193

	AND (070707)		/ MASK OUT THE DIGITS		/EAG:193

	XOR (606060)		/ AND CONVERT TO .SIXBT		/EAG:193

	JMP* TTODT5		/ RETURN			/EAG:193

								/EAG:193

								/EAG:193

TTODTA	0			/ TEMPORARY TO SAVE NUMBER	/EAG:193

				/ INPUT TO TTODT5		/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

								/EAG:193

TTODTB	0			/ INPUT-IN-PROGRESS FLAG.  SET	/EAG:193

				/ BY TTLV4 AT TIME ^T INVOKES	/EAG:193

				/ MINI-ODT.  THIS ALLOWS THIS	/EAG:193

				/ ROUTINE TO RESTORE TTIOSW	/EAG:193

				/ AND TTINSW SO THAT IF A READ	/EAG:193

				/ WAS IN PROGRESS WHEN THE ^T	/EAG:193

				/ WAS TYPED IT CAN CONTINUE	/EAG:193

				/ AFTER MINI-ODT RETURNS.	/EAG:193

				/ CONTAINS -1 IF INPUT WAS IN	/EAG:193

				/ PROGRESS, 0 IF IT WASN'T.	/EAG:193

								/EAG:193

	.ENDC							/EAG:193

	.TITLE     CODE TO HANDLE ^D

								/EAG:192

								/EAG:192

								/EAG:192

								/EAG:192

/								/EAG:192

/ COME HERE WHEN ^D (END-OF-FILE) IS TYPED.  FIRST THREE	/EAG:192

/ INSTRUCTIONS ARE COPIED FROM RESMON.190.  REST IS NEW.	/EAG:192

/								/EAG:192

								/EAG:192

TTDCLS	LAC (1005)		/ SET UP EOF CODE IN LINE	/EAG:192

	DAC* TTLBH		/ BUFFER HEADER			/EAG:192

	JMS TTLFRT		/ OUTPUT LF IF NEEDED		/EAG:192

	LAW 136			/ OUTPUT UPARROW ("^")		/EAG:192

	JMS TTOSVC						/EAG:192

	LAW 104			/ OUTPUT "D"			/EAG:192

	JMS TTOSVC						/EAG:192

	JMP TTLNFN		/ CLEAR BUSY SWITCH AND EXIT	/EAG:194

	.TITLE     MORE TTA.

								/EAG:192

								/EAG:192

TTCTRL	LAC TTCHR1

	SAD (25)						/EAG:191

	SKP!CLC			/^U TO TERMINATE OUTPUT

	JMP TTIGNR

	DAC	CTLUFG		/SET ^U FLAG

TTIGNR	LAC TINTAC		/ SPURIOUS INTERRUPT -- RESTORE	/EAG:201

	ION			/ AC AND RETURN			/EAG:201

	DBR

	JMP* 0							/EAG:201

								/EAG:201

	JMS TTFILL		/PAD IOPS ASCII LAST WORD PAIR.

TTICRT	JMS TTICLS		/GENERATE HEADER PAIR.

	LAW	-10		/RESET TAB COUNTER

	DAC	TTOBLK

	JMP TTLFO

TTFILL	0		/PAD LAST WORD

	DZM TTCHR		/PAIR OF IOPS ASCII

	LAW 17773		/LINE WITH NULL CHARS.

	SAD TG5CHR

	JMP* TTFILL

	JMS TPUTCH

	JMP .-5

/SECTION TO SERVICE AN ERASE (RUBOUT) CHARACTER. ECHO A

/BACK SLASH FOR RO

TTIDEL	LAW 17776		/RO HAS BEEN PUT AWAY, SO SET UP

	DAC TTD2CT	/TO EXTRACT TWO CHARACTERS

TTIBSL	LAW 134

	DAC TTCHR

TTDCK5	LAC TG5CHR	/GET CURRENT 5-CHARACTER COUNTER

	SAD (-5)	/IS IT -5				/EAG:191

	JMP TDRNEW	/WORD PAIR JUST COMPLETED IF SO; GET PREVIOUS PAIR

	TAD (-1)	/CHAR WANTED IS IN CURRENT PAIR. SET TG5CHR

	DAC TG5CHR	/TO REFLECT NEW COUNT.

	LAC TTRWD1	/INVERT CURRENT WORD PAIR

	DAC TTRWD3	/TO ALLOW OFFENDING ENDING CHARACTER

	JMS TTROT7	/TO BE ROTATED OUT

	RAR		/BACKWARDS.

	LAC TTRWD3	/RESTORE WORD PAIR TO ORIGINAL

	DAC TTRWD1	/SEQUENCE.

	ISZ TTD2CT	/HAVE WE DELETED TWO CHARACTERS.?

	JMP TTDCK5	/NO, GET ONE MORE.

			/YES, GET CONFIRMATION CHARACTER (BACK SLASH)

			/SET INTERRUPT SERVICE TO IGNORE

			/TELEPRINTER FLAG

TTCFRM	LAC TTCHR		/GET APPLICABLE CONFIRMATION CHAR (BACKSLASH OR AT SIGN

	JMS TTOSVC		/GO PRINT IT

	DZM	TTCHR		/DON'T COUNT CHARACTER IN TAB COUNT

TTIRTN	IOF			/BE SURE TO EXIT BEFORE BEING INTERUPTED

	DZM	TTINSW		/ACCEPT INPUT FROM KEYBOARD

TTEXT1	LAC	TTCHR		/EXIT AND COUNT CHARACTER IN TAB COUNT

	JMP	TTNPT		/IF IT IS PRINTING CHARACTER

	.EJECT

/COME HERE ON CURRENT WORD PAIR EXHAUSTED GOING BACKWARDS.

TDRNEW	LAW 17776		/ADJUST OUTPUT ADDRESS FOR NEW

	TAD TTADR		/CURRENT PAIR.

	SAD TTLBH		/ARE WE AT BEGINNING OR LINK.?

	JMP TTCFRM	/IF SO, IGNORE.

	DAC TTADR		/IF NOT, GIVE NEW OUTPUT ADDRESS.

	DAC TTROT7	/BUT USE A TEMPORARY REGISTER TO GET NEW PAIR.

	LAC TTIVAL		/DECREMENT ACCUMULATED WORD PAIR

	TAD (-1000)		/COUNT BY 1.			/EAG:191

	DAC TTIVAL

	LAW 17776		/DECREMENT (2'S COMD) WORD COUNT BY 2

	TAD TTWDCT

	DAC TTWDCT

	LAC* TTROT7	/GET WORD 1.

	RAR!CLL		/MAKE IT OFF BY ONE BIT.

	DAC TTRWD1	/SAVE AS CURRENT WORD 1.

	ISZ TTROT7	/BUMP TEMP POINTER TO WORD 2.

	LAC* TTROT7	/GET WORD 2

	RAR		/AND ADJUST IT ALSO.

	DAC TTRWD2

	DZM TG5CHR	/NEW WORD PAIR.

	JMP TTDCK5

/SECTION TO SERVICE A KILL (CONTROL U) CHARACTER ECHO A

/COMMERCIAL AT SIGN FOR CTL U UNLESS LINE IS EMPTY

TTIKIL	LAW	100

	DZM	TTD2CT

	JMP TTDCK5-1

	.EJECT

/TELETYPE OUT SERVICE-INTERRUPT SECTION.

TOINT	DAC TIAC 	/SAVE USER'S AC.

	LAC 0     	/ALONG WITH SOME OTHER DATA.

TOINT2	DAC TTYPTR

	TCF

	LAC TTIOSW

	SNA

	JMP TTYVT4	/I/O NO LONGER UNDERWAY.

	ION

TTGETM	LAC TTIVAL

	RAR		/LINK=1 IF IMAGE ALPHA.

	ISZ	CTLUFG		/SKIP ON ^U ABORT OF WRITE

	JMP* TTOSVC	/GO SERVICE INTERRUPT

	LAC	TTINSW		/DO NOT ABORT INPUT .READ

	SNA			/ON A ^U

	JMP	TTGETM		/IGNORE ^U ON THIS .READ FROM KEYBOARD

	JMP	TTOCRT		/ABORT WRITE AND TYPE CRLF

/NOTE:	THE FOLLOWING FEATURE IS USED BY .KM9 AND ALL SYSTEM

/	PROGRAMS -- NEVER CHANGE NEXT INSTRUCTION WHICH BYPASSES

/	WORD PAIR COUNT ON IOPS ASCII

TTNORM	SZL!CLA		/IOPS ASCII

	LAW -400		/-400

	TAD TTWDCT		/DECREMENT WD.PAIR COUNT BY 1/2. IF IMAGE ALPHA.

	DAC TTWDCT

	SNA

			/WILL GO TO ZERO IF IMAGE MODE OR IOPS OFLO.

	JMP TTRSLN

	.EJECT

/

/

/SECTION TO EXTRACT NEXT IMAGE OR IOPS ASCII

/7-BIT CHARACTER FROM LINE BUFFER.

TTOGTC	LAC  TTIVAL

	RAR

	SNL

	JMP TGASCI	/L=0 IF ASCII

	JMS	TTLFRT

	LAC* TTADR

	AND (177)						/EAG:191

	ISZ TTADR

	SAD	(175)		/ALT MODE?			/EAG:191

	JMP	TTYCR3+1	/YES. IGNORE. INCREMENT WORD COUNT

	SAD	(15)		/CR?				/EAG:191

	SKP

	JMP	TTOCDL

TTYCR3	JMS	TTOSVC		/TREAT CR AS SPECIAL FOR LA30

	LAC	TTIVAL		/RESTORE LINK STATE

	RAR

	JMP	TTNORM

TGASCI	ISZ TG5CHR

	JMP TTRSET

	LAC* TTADR

	DAC TTRWD2

	ISZ TTADR

	LAC* TTADR

	DAC TTRWD3

	ISZ TTADR

	LAW 17773

	DAC TG5CHR

TTRSET	JMS TTROT7

	RAL

	AND (177)						/EAG:191

/

	.EJECT

/CHECK FOR SPECIAL CHARACTER AND TAKE APPROPRIATE ACTION

/IF FOUND. IF NOT, PRINT CHARACTER AND RETURN.

	SAD	(20)		/IS THIS OVERPRINT LINE		/EAG:191

	DZM	TTOSW1

	JMS	TTLFRT

	SAD (15)	/OUTPUT CARRIAGE RETURN.		/EAG:191

	JMP	TTCRIA

	SAD (12)	/OUTPUT LINE FEED.			/EAG:191

TTLFSW	XX		/IGNORE IF FIRST CHAR IN IOPS LINE(JMP TTOGTC)

	SAD	(21)		/ CHANGE DOUBLE SPACE FLAG	/EAG:191

	LAC	(12)		/TO LINE FEED FOR FORTRAN I/O	/EAG:191

	SAD (175)	/OUTPUT ALT MODE.			/EAG:191

	JMP TTLNFN	/TERMINATION CHAR, NO ECHO.

	SNA       	/OUTPUT NULL CHARACTER.

	JMP TTOGTC	/IGNORE NULL CHARACTERS.

TTOCDL	SAD (11)	/OUTPUT TAB				/EAG:191

	JMP TTOTAB

	SAD (177)						/EAG:191

	JMP TTGETM		/RUBOUT ---  IGNORE BUT COUNT.

	SAD (13)						/EAG:191

	JMP FORM

	SAD (14)						/EAG:191

	JMP FORM

	SKP

TTOSVC	0		/DISPATCH ADDRESS ON TELEPRINTER FLAG

TTYVT3	NOP	/CHAR. TO DISPLAY LINE BUFFER IF ^X ON

	TLS

	IOF

TTNPT	AND	(177)		/CLEAN				/EAG:191

	SAD	(15)		/IF CHARACTER IS C.R. RESET	/EAG:191

	JMP	TTRTAB		/ TAB COUNT

	AND	(140)		/SEE IF NON-PRINTING CHARACTER	/EAG:191

	SZA		/DONT COUNT IF SO

	ISZ TTOBLK

	JMP TTYVT4

TTRTAB	LAW -10		/RESET TAB COUNTER.

	DAC TTOBLK

TTYVT4	NOP		/SETS UP CORRECT RETURN WHEN ^X ON

TTDSM2	LAC TIAC  	/RESTORE AC

	ION

TTWAIT	DBR

	JMP* TTYPTR	/RETURN TO CALLER.

/

TTDSMS	LAW 12			/RESET TTLFSW TO PRINT LATER LF'S.

	DAC TTLFSW

	JMP TTOGTC

	.EJECT

TTRSLN	SZL

	JMP TTOCRT		/IOPS ASCII (LINK COMPLEMENTED BY TAD)

	JMP TTLNFN

TTCRIA	CLC

	DAC	TTOSW1

	LAW	15

TTYCR2	JMS	TTOSVC

	JMP	TTLNFN

/

/SUBROUTINE TO OUTPUT LF IF NEEDED

/

TTLFRT	0

	DAC	TTOSAV		/SAVE AC

	ISZ	TTOSW1		/IS A LF NECESSARY

	JMP	TTLF1		/NO

	LAW	212		/LF

	JMS	TTOSVC

TTLF1	LAC	(TTNORM)	/FINISHED NOW RESTORE POINTER	/EAG:191

	DAC	TTOSVC

	LAC	TTOSAV

	DZM	TTOSW1

	JMP*	TTLFRT

TTOSW1	-1			/-1 INDICATES LF NEEDED

TTOSAV	0			/SAVED AC

/

/ SUBROUTINE TO HANDLE 30 CPS LA30 CR

/

LA30CR	0

	LAC	TTOSVC

	DAC	RETSAV		/SAVE DISPATCH ADDR

	LAW	-10		/SET FILLER COUNT

	DAC	TTYFCT

	LAW	15

CRFLOP	JMS	TTOSVC

	CLA

	ISZ	TTYFCT

	JMP	CRFLOP

	LAC	RETSAV

	DAC	TTOSVC

	CLA

	JMP*	LA30CR

/

RETSAV	0

TTYFCT	0

/

	.EJECT

TTWDCT	0			/ INPUT 2'S COMP. EXCLUSIVE OF	/EAG:191

				/ HEADER.  OUTPUT-WD. PAIR EXC.	/EAG:191

				/ OF HDR.			/EAG:191

								/EAG:191

TTOBLK	-10			/ 2'S COMP BLOCK COUNT FOR TABS	/EAG:191

								/EAG:191

TTCHR	0			/ CHAR. ON KEYBOARD INTERRUPTS	/EAG:191

								/EAG:191

TTCHR1	0			/ TEMP. FOR KEYBRD INT. CHAR	/EAG:191

								/EAG:191

TIAC	0			/ AC ON INTERRUPTS		/EAG:191

								/EAG:191

TTADR	0			/ ADDR. OF DATA WRD IN DATA BUF	/EAG:191

								/EAG:191

TTLBH	0			/ ADDR OF LINE BUF HDR		/EAG:191

								/EAG:191

TTYCAL	0			/ ADDR OF CAL INSTRUCTION	/EAG:191

								/EAG:191

TTCALT	0			/ TEMP AT LEVEL 4		/EAG:191

								/EAG:191

TTYPTR	0			/ ADDRESS OF CURRENT LOC IN ARG	/EAG:191

				/ STRING AND PC ON OUTPUT INT.	/EAG:191

								/EAG:191

TTINSW	-1			/ INPUT EXPECTED SWITCH		/EAG:191

				/ -1 IF NOT EXPECTED		/EAG:191

								/EAG:191

DELAY	0							/EAG:191

								/EAG:191

TTIVAL	0			/ WRD 0 OF L.B. HDR ACCUMULATOR	/EAG:191

								/EAG:191

TTRWD1	0			/ STORAGE FOR CURRENT WORD PAIR	/EAG:191

TTRWD2	0							/EAG:191

TTRWD3	0							/EAG:191

								/EAG:191

TTD2CT	0							/EAG:191

								/EAG:191

TG5CHR	0			/ 5/7 CHARACTER COUNTER		/EAG:191

								/EAG:191

TP7BTS	0			/ ROTATE COUNTER		/EAG:191

								/EAG:191

CTLUFG	0			/ ^U ABORT IF -1		/EAG:191

								/EAG:201

TINTAC	0			/ PLACE TO SAVE INTERRUPT AC	/EAG:201

				/ (USED WITH INTERRUPT DISABLE)	/EAG:201

	.TITLE CONSTANTS AND PATCH AREA FOR RESMON

/

/

	.LTORG							/EAG:191

								/EAG:191

RM.SIZ	.BLOCK 1000		/ ALLOCATE SPACE FOR RESIDENT	/EAG:191

				/ PATCH AREA.			/EAG:191

								/EAG:191

RM.LMT=.			/ LIMIT OF RESIDENT MONITOR	/EAG:191

				/ PROPER (I.E., CODE PRECEEDING	/EAG:191

				/ AND RESIDENT PATCH AREA)	/EAG:191

								/EAG:191

	.IFNEG 10000-RM.LMT	/ MUST BE < 4K			/EAG:191

ERROR	RESIDENT MONITOR PROPER MUST BE < 4K			/EAG:191

ERROR	.LOC .-1						/EAG:191

	.ENDC							/EAG:191

	.TITLE POLLER FOR UNICHANNEL ERRORS

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS SET OF ROUTINES PERIODICALLY POLLS THE UNICHANNEL	/EAG:194

/ PROCESSOR FOR ERROR CONDITIONS.  ANY ERRORS DETECTED		/EAG:194

/ RESULT IN AN APPROPRIATE IOPSUC ERROR MESSAGE.		/EAG:194

/								/EAG:194

/ THE ROUTINES PLR.MS AND PLR.ST ARE THE ROUTINES WHICH		/EAG:195

/ ACTUALLY POLL THE UNICHANNEL AND PRINT THE MESSAGES.		/EAG:195

/ WE WANT TO CALL THEM ABOUT ONCE EVERY SECOND, EXCEPT THAT	/EAG:194

/ WE ONLY WANT TO CALL THEM WHEN THE CONSOLE TERMINAL		/EAG:194

/ IS IDLE OR WHEN IT IS DOING A READ AND NO CHARACTERS		/EAG:194

/ HAVE BEEN INPUT YET.						/EAG:194

/								/EAG:194

/ WE EFFECT THE PERIODIC INVOKATION OF THESE ROUTINES AS	/EAG:194

/ FOLLOWS.  THE ROUTINE PLR.CK IS CALLED EVERY SECOND FROM	/EAG:195

/ THE CLOCK ROUTINE.  IT PUTS A JMS TO PLR.PL IN PLR.SW AND	/EAG:194

/ CALLS PLR.TT TO CHECK IF THE CONSOLE TERMINAL IS IDLE.	/EAG:194

/ PLR.TT CHECKS IF THE CONSOLE IS IDLE AND CALLS PLR.MS AND	/EAG:195

/ PLR.ST IF IT IS; OTHERWISE IT JUST RETURNS.  IF THE		/EAG:195

/ ROUTINES ARE NOT CALLED PLR.SW IS LEFT CONTAINING A JMS TO	/EAG:195

/ PLR.PL.  AT STRATEGIC LOCATIONS WITHIN TTA. (WHEREVER IT	/EAG:195

/ IS ABOUT TO GO IDLE) ARE LOCATED XCT PLR.SW INSTRUCTIONS.	/EAG:195

/ THUS IF PLR.TT FINDS THAT TTA. IS BUSY WE HAVE ARRANGED	/EAG:195

/ FOR PLR.PL TO BE CALLED AS SOON AS TTA. BECOMES IDLE.		/EAG:195

/ PLR.PL, WHEN IT IS CALLED, MERELY CALLS PLR.MS AND PLR.ST.	/EAG:195

/ PLR.MS PLACES A NOP IN PLR.SW WHENEVER IT IS CALLED SO	/EAG:195

/ THAT THE PLR.MS/PLR.ST PAIR WON'T BE CALLED AGAIN UNTIL	/EAG:195

/ THE NEXT SECOND ELAPSES.					/EAG:195

/								/EAG:194

/ PLR.MS AND PLR.ST TOGETHER FORM THE GUTS OF THE POLLER.	/EAG:195

/ PLR.MS IS STRICTLY AN INTERNAL SUBROUTINE TO THE POLLER.	/EAG:195

/ IT SHOULD NOT BE CALLED FROM OUTSIDE THE POLLER.  THIS	/EAG:194

/ IS THE SUBROUTINE WHICH ACTUALLY CHECKS IF THE TCB HAS	/EAG:194

/ COMPLETED AND PRINTS THE ERROR MESSAGES IF APPROPRIATE.	/EAG:194

/ PLR.ST ISSUES THE ERROR STATUS REPORT TCB TO THE		/EAG:195

/ UNICHANNEL.  AS SUCH IT IS CALLED EVERY TIME THE POLLER	/EAG:195

/ IS INVOKED (I.E. ABOUT ONCE PER SECOND).  PLR.ST IS ALSO	/EAG:195

/ USED TO START THE POLLER RUNNING.				/EAG:195

/								/EAG:194

/ A THIRD ROUTINE, PLR.FN, IS THE FINAL ELEMENT OF THE		/EAG:195

/ POLLER.  IT AND PLR.ST FORM A COMPLEMENTARY PAIR.  PLR.ST	/EAG:195

/ IS CALLED TO START THE POLLER RUNNING AND PLR.FN IS USED	/EAG:195

/ TO TERMINATE POLLER OPERATION.  IT IS ESSENTIAL		/EAG:194

/ THAT THE POLLER BE SHUT DOWN WHEN A CAF IS			/EAG:194

/ ISSUED, WHEN THE MONITOR RE-BOOTSTRAPS ITSELF,		/EAG:194

/ AND WHEN ^Q STYLE DUMPS ARE PERFORMED.  THE REASON		/EAG:194

/ FOR THIS IS AS FOLLOWS.  AT ANY GIVEN TIME THE POLLER HAS	/EAG:194

/ AN ERROR STATUS TCB OUTSTANDING WITH THE UNICHANNEL.		/EAG:194

/ WHENEVER PLR.MS IS CALLED IT CHECKS TO SEE IF THIS TCB HAS	/EAG:194

/ COMPLETED YET.  IF IT HAS ERRORS ARE CHECKED FOR AND		/EAG:194

/ PRINTED OUT IF THEY OCCURED.  FOLLOWING THIS THE TCB IS	/EAG:194

/ AGAIN REQUESTED FOR THE NEXT TIME PLR.MS IS CALLED.  IF,	/EAG:194

/ ON THE OTHER HAND, THE TCB HAS NOT COMPLETED WHEN PLR.MS	/EAG:194

/ IS CALLED, IT JUST RETURNS AND CHECKS IT AGAIN THE NEXT	/EAG:194

/ TIME.  PLR.ST STARTS THE POLLER BY ISSUEING THE FIRST TCB	/EAG:194

/ REQUEST.  PLR.FN TERMINATES THE POLLER BY WAITING FOR		/EAG:194

/ THE TCB TO COMPLETE AND PRINTING APPROPRIATE ERROR		/EAG:194

/ MESSAGES, WITHOUT RE-REQUESTING THE TCB.  ISSUEING		/EAG:194

/ A CAF WHILE A TCB POINTER IS WAITING TO BE ACCEPTED		/EAG:194

/ BY THE UNICHANNEL (I.E. WHILE AN SIOA WOULDN'T SKIP)		/EAG:194

/ DOES BAD THINGS TO THE HARDWARE.  IF A REQUEST		/EAG:194

/ WERE LEFT OUTSTANDING WHILE THE MONITOR RE-BOOTSTRAPPED	/EAG:194

/ ITSELF WE WOULD HAVE AN INTERESTING TIMING DEPENDENT BUG	/EAG:194

/ RESULTING FROM THE UNICHANNEL OVERWRITING THE MONITOR		/EAG:194

/ AS IT ATTEMPTS TO INITIALIZE ITSELF.				/EAG:194

/								/EAG:194

/ THE ABOVE PICTURE OF THE POLLER IS NOT ENTIRELY CORRECT.	/EAG:194

/ AS STATED PLR.PL CHECKS IF THE TCB				/EAG:194

/ HAS COMPLETED AND RETURNS IF IT HASN'T, SO AS TO TRY		/EAG:194

/ AGAIN NEXT TIME.  BUT THERE IS A LIMIT TO HOW MANY TIMES	/EAG:194

/ IT WILL TRY AGAIN.  A COUNTER (PLR.WC) IS INITIALIZED		/EAG:194

/ BY PLR.ST TO SOME APPROPRIATE NEGATIVE NUMBER.  EVERY		/EAG:194

/ TIME PLR.MS IS CALLED AND THE TCB HASN'T COMPLETED YET	/EAG:194

/ THIS COUNTER IS INCREMENTED.  IF THIS COUNTER SHOULD		/EAG:194

/ OVERFLOW IT INDICATES THAT THE UNICHANNEL IS TAKING		/EAG:194

/ AN INORDINATELY LONG TIME TO RESPOND TO OUR REQUEST		/EAG:194

/ (PERHAPS BECAUSE IT HAS CRASHED) AND THE FOLLOWING		/EAG:194

/ MESSAGE IS OUTPUT:						/EAG:194

/								/EAG:194

/	IOPSUC   PRX   4					/EAG:194

/								/EAG:194

/ THIS MESSAGE IS SUPPOSED TO INDICATE THAT PIREX IS NOT	/EAG:194

/ READY.  FOLLOWING THIS MESSAGE THE TCB IS RE-REQUESTED,	/EAG:194

/ THE COUNTER RESET, AND THE WHOLE PROCESS BEGUN AGAIN.		/EAG:194

/ THERE IS ONE OTHER SITUATION WHICH CAN CAUSE THIS MESSAGE	/EAG:194

/ TO APPEAR.  IF, WHEN THE TCB REQUEST IS BEING ISSUED TO	/EAG:194

/ THE UNICHANNEL, THE SIOA INSTRUCTION SHOULD FAIL TO SKIP	/EAG:194

/ IT ALSO INDICATES THAT THE UNICHANNEL'S RESPONSE IS		/EAG:194

/ INORDINATELY SLOW.  IN THIS CASE WE MERELY NEGLECT TO		/EAG:194

/ ISSUE THE TCB REQUEST TO THE UNICHANNEL.  SOME TIME LATER	/EAG:194

/ THE TIMEOUT DESCRIBED ABOVE WILL EXPIRE (THE TCB CANNOT	/EAG:194

/ COMPLETE SINCE IT WAS NEVER REQUESTED) AND THE ABOVE		/EAG:194

/ MESSAGE WILL AGAIN RESULT.					/EAG:194

/								/EAG:194

/ ALL OF THESE ROUTINES HAVE VERY POWERFUL RESTRICTIONS		/EAG:194

/ ON HOW AND BY WHOM THEY MAY BE CALLED.  FOR DETAILS OF	/EAG:194

/ THESE CHECK THE COMMENTS PRECEEDING EACH ROUTINE.  ALSO	/EAG:194

/ NOTE THAT ALL CALLS TO THESE ROUTINES MUST BE RELOCATED	/EAG:194

/ AND INSERTED BY THE ROUTINE IN.PLR.				/EAG:194

/								/EAG:194

/ TWO PARAMETERS ARE USED BY THE POLLER.  THE FIRST OF THESE,	/EAG:194

/ PLR.NT, IS THE NUMBER OF TASKS ABOUT WHICH PIREX WILL		/EAG:194

/ RETURN ERROR STATUS INFORMATION.  THE SECOND OF THESE,	/EAG:194

/ PLR.WT, IS THE MINIMUM NUMBER OF SECONDS FOR WHICH THE	/EAG:194

/ POLLER WILL WAIT FOR THE UNICHANNEL TO RESPOND BEFORE		/EAG:194

/ PRINTING THE "IOPSUC PRX 4" MESSAGE.  IT SHOULD BE NOTED	/EAG:194

/ THAT THE TIMING OF THIS IS HIGHLY DEPENDENT ON PLR.CK		/EAG:194

/ BEING CALLED ONCE PER SECOND.  ALSO THIS PARAMETER DOES	/EAG:194

/ NOT AFFECT HOW LONG IT WILL WAIT FOR A RESPONSE WHEN		/EAG:194

/ PLR.FN IS CALLED.						/EAG:194

/								/EAG:194

								/EAG:194

								/EAG:194

PLRREL=.			/ DEFINE START OF POLLER	/EAG:194

				/ RELOCATABLE CODE		/EAG:194

	.TITLE     PLR.CK -- POLLER INTERFACE TO CLOCK

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ FOLLOWING ROUTINE IS LOGICALLY PART OF THE REAL-TIME		/EAG:194

/ CLOCK INTERRUPT SERVICE ROUTINE.  IT IS CALLED ONCE PER	/EAG:194

/ SECOND BY A JMS PLR.CK INSERTED AT LOCATION PLR.J1.  THE JMS	/EAG:194

/ IS INSERTED THERE BY THE ROUTINE IN.PLR.  THIS ROUTINE	/EAG:194

/ SHOULD NOT BE CALLED FROM ANYWHERE ELSE.			/EAG:194

/								/EAG:194

/ THIS ROUTINE IS CALLED BY A JMS INSERTED (BY IN.PLR) INTO	/EAG:194

/ LOCATION PLR.J1.						/EAG:194

/								/EAG:194

								/EAG:194

PLR.CK	0							/EAG:194

	LAC PLR.JMS		/ PUT JMS PLR.PL INTO		/EAG:194

	DAC PLR.SW		/ PLR.SW, AND THEN CHECK IF	/EAG:194

	JMS PLR.TT		/ CONSOLE IS IDLE AND CALL	/EAG:194

	JMP* PLR.CK		/ PLR.PL IF IT IS		/EAG:194

								/EAG:195

PLR.JMS	JMS PLR.PL						/EAG:195

	.TITLE     PLR.TT -- POLLER INTERFACE TO TTA.

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THE FOLLOWING ROUTINE IS THE POLLER'S INTERFACE TO TTA.	/EAG:194

/ IT IS LOGICALLY A PART OF TTA.  WHEN CALLED IT CHECKS IF	/EAG:194

/ THE CONSOLE TERMINAL IS IN A STATE SUITABLE FOR THE		/EAG:194

/ POLLER TO PRINT A MESSAGE.  IF THIS CONDITION HOLDS THIS	/EAG:194

/ ROUTINE THEN CALLS PLR.MS AND PLR.ST.  OTHERWISE IT		/EAG:195

/ DOES NOTHING.							/EAG:194

/								/EAG:194

/ THE CONDITIONS UNDER WHICH PLR.MS AND PLR.ST WILL BE		/EAG:195

/ CALLED ARE AS FOLLOWS.  IF NO I/O IS IN PROGRESS PLR.MS	/EAG:195

/ AND PLR.ST WILL BE CALLED. IF A READ IS IN PROGRESS AND	/EAG:195

/ NO CHARACTERS HAVE BEEN INPUT YET THEY WILL BE CALLED.	/EAG:195

/ IN ALL OTHER CASES NOTHING WILL BE DONE.			/EAG:194

/								/EAG:194

/ THIS ROUTINE SHOULD NOT BE CALLED FROM ANYWHERE OTHER THAN	/EAG:194

/ PLR.CK.							/EAG:194

/								/EAG:194

								/EAG:194
PLR.TT	0							/EAG:194

	LAC TTIOSW		/ CHECK IF TTY IS BUSY		/EAG:194

	SNA			/ SKIP IF IT IS			/EAG:194

	JMP PLTT.0		/ TTY IDLE -- GO CALL ROUTINES	/EAG:194

	LAC TTINSW		/ IS ACTIVITY A READ?		/EAG:194

	SZA			/ SKIP IF YES			/EAG:194

	JMP* PLR.TT		/ OUTPUT IN PROGRESS -- DO	/EAG:194

				/ NOTHING			/EAG:194

	LAW 777400		/ PICK UP WORD PAIR COUNT	/EAG:194

	AND TTIVAL		/ FOR INPUT IN PROGRESS.	/EAG:194

	SAD (1000)		/ IF EQUAL TO ONE (HDR. WRD.	/EAG:194

	SKP			/ PR.) KEEP CHECKING, ELSE	/EAG:194

	JMP* PLR.TT		/ DO NOTHING.			/EAG:194

	LAW -5			/ PICK UP CHARACTER COUNT	/EAG:194
	SAD TG5CHR		/ WITHIN WORD PAIR.  IF EQUAL	/EAG:194
	SKP			/ TO FIVE (CHARACTERS LEFT TO	/RKB-208
	JMP*	PLR.TT		/ INSERT), THEN			/RKB-208

PLTT.0	.INH			/// INVOKE POLLER ROUTINES.	/EAG:195

	JMS PLR.MS		/// DISABLE INTERRUPTS TO	/EAG:195

	  JMS PLR.ST		/// PRESERVE REENTRANCY AND	/EAG:195

	.ENB			/// PROHIBIT CLOCK INTERRUPTS	/EAG:195

				/// BETWEEN PLR.MS AND PLR.ST.	/EAG:195

	JMP* PLR.TT		/ AND RETURN			/EAG:194

	.TITLE     PLR.PL -- POLL THE UNICHANNEL

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS ROUTINE IS CALLED BY TTA. TO POLL THE UNICHANNEL.	/EAG:195

/ IT IS CALLED VIA AN XCT PLR.SW WHEN PLR.SW CONTAINS A JMS	/EAG:195

/ PLR.PL.  FOR MORE INFORMATION ON HOW AND WHEN THIS IS		/EAG:195

/ CALLED SEE THE COMMENTS PRECEEDING THE POLLER.		/EAG:195

/								/EAG:195

/ THE XCT PLR.SW INSTRUCTIONS ARE INSERTED BY IN.PLR INTO	/EAG:195

/ LOCATIONS PLR.X1 AND PLR.X2.					/EAG:195

/								/EAG:195

								/EAG:195

PLR.PL	0							/EAG:195

	.INH			/// LOCK OUT INTERRUPTS TO	/EAG:195

	IOF			/// PRESERVE REENTRANCY AND	/EAG:195

	JMS PLR.MS		/// NOT ALLOW CLOCK INTERRUPTS	/EAG:195

	  JMS PLR.ST		/// BETWEEN PLR.MS AND PLR.ST.	/EAG:195

	.ENB			///				/EAG:195

	IOF			///				/EAG:195

	JMP* PLR.PL		///				/EAG:195

	.TITLE     PLR.ST -- START UP THE POLLER

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS ROUTINE SERVES A DUAL PURPOSE.  IT IS CALLED		/EAG:194

/ INDEPENDENTLY TO START UP THE POLLER.  IT IS ALSO CALLED	/EAG:194

/ FROM WITHIN THE POLLER TO RE-REQUEST THE POLLER TCB.  THAT	/EAG:194

/ IS ESSENTIALLY ALL IT DOES.  IT SHOULD BE NOTED THAT CLOCK	/EAG:194

/ INTERRUPTS MUST NOT BE ALLOWED BEFORE THIS ROUTINE IS		/EAG:194

/ CALLED.							/EAG:194

/								/EAG:194

								/EAG:194

PLR.ST	0							/EAG:194

	DZM PLR.EV		/ CLEAR EVENT VARIABLE		/EAG:194

	DZM PLR.WC		/ CONVERT NUMBER OF CLOCK	/EAG:194

	LAC 7			/ TICKS WAITING TO BE		/EAG:194

	IAC!STL			/ PROCESSED INTO AN		/EAG:194

PLST.0	SNL!CLL			/ EQUIVALENT NUMBER OF		/EAG:194

	JMP PLST.1		/ SECONDS, ROUNDED UP TO	/EAG:194

	ISZ PLR.WC		/ NEXT SECOND, IF EVEN		/EAG:194

	TAD SC.LFR		/ NUMBER OF SECONDS ADD		/EAG:194

	JMP PLST.0		/ ONE MORE.			/EAG:194

								/EAG:194

PLST.1	LAC PLR.WC		/ USE THIS NUMBER, ADD IN	/EAG:194

	AAC PLR.WT		/ NUMBER OF SECONDS WE ALLOW	/EAG:194

	TCA			/ FOR UNICHANNEL RESPONSE,	/EAG:194

	DAC PLR.WC		/ AND USE FOR WAIT COUNT.	/EAG:194

	LAC PLST.A		/ PICK UP ADDRESS OF TCB	/EAG:194

	SIOA			/ CAN UC15 ACCEPT IT?		/EAG:194

	SKP			/ NO -- SOMETHING WRONG WITH	/EAG:194

				/ UNICHANNEL.  AFTER TIMEOUT	/EAG:194

				/ EXPIRES IOPSUC PRX 4 MESSAGE	/EAG:194

				/ WILL RESULT AND WE'LL TRY AGN	/EAG:194

	LIOR			/ YES -- GIVE IT TCB POINTER	/EAG:194

	JMP* PLR.ST		/ DONE -- RETURN		/EAG:194

	.TITLE     PLR.FN -- TERMINATE THE POLLER

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THIS ROUTINE IS USED TO CLEANLY TERMINATE THE POLLER'S	/EAG:194

/ OPERATION.  IT MUST BE CALLED BEFORE RE-BOOTSTRAPPING THE	/EAG:194

/ MONITOR AND OTHER SUCH MAJOR DISTORTIONS OF ITS OPERATION.	/EAG:194

/ INTERRUPTS SHOULD BE DISABLED BEFORE CALLING THIS		/EAG:194

/ ROUTINE.  FOR THIS PARTICULAR ROUTINE THIS WILL USUALLY	/EAG:194

/ BE ACCOMPLISHED BY RM.CAF, RATHER THAN A .INH.  AFTER		/EAG:194

/ CALLING THIS ROUTINE CLOCK INTERRUPTS MUST NOT BE		/EAG:194

/ ALLOWED UNTIL PLR.ST IS INVOKED.				/EAG:194

/								/EAG:194

/ THIS ROUTINE IMPOSES, OF COURSE, A TIMEOUT ON HOW LONG	/EAG:194

/ IT WILL WAIT FOR THE UNICHANNEL TO RESPOND TO THE TCB.	/EAG:194

/ THIS IS ACCOMPLISHED BY ZEROING PLR.WC.  THIS ALLOWS		/EAG:194

/ PLR.MS TO BE INVOKED 2**18 TIMES BEFORE IT WILL GIVE UP	/EAG:194

/ AND ASSUME PIREX ISN'T READY.  WHEN FIRST WRITTEN THE		/EAG:194

/ LOOP THUS CONSTRUCTED WAS 19 CYCLES LONG, WHICH ON A .8	/EAG:194

/ USEC. CYCLE TIME MACHINE AMOUNTS TO 3.9 TO 4.0 SECONDS.	/EAG:194

/ THIS SEEMS SUFFICIENTLY LONG, ESPECIALLY SINCE PIREX OUGHT	/EAG:194

/ TO BE IDLE SINCE THE SYSTEM IS SHUTTING DOWN.			/EAG:194

/								/EAG:194

								/EAG:194

PLR.FN	0							/EAG:194

	DZM PLR.WC		/// AND CAUSE PLR.MS TO		/EAG:194

				/// WAIT A LONG TIME.		/EAG:194

PLFN.0	JMS PLR.MS		/// KICK PLR.MS			/EAG:194

	  JMP* PLR.FN		/// TCB COMPLETED -- EXIT	/EAG:194

	JMP PLFN.0		/// TCB NOT COMPLETED YET --	/EAG:194

				/// GO TRY AGAIN.		/EAG:194

	.TITLE     PLR.MS -- CHECK FOR POLLER MESSAGE(S)

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ THE FOLLOWING ROUTINE IS LOGICALLY A PART OF THE IOPS		/EAG:194

/ ERROR PROCESSOR.  THE READER IS REFERRED THERE FOR 		/EAG:194

/ DESCRIPTIONS OF THE SUBROUTINES CALLED AND A BETTER		/EAG:194

/ UNDERSTANDING OF THE CODING CONVENTIONS USED.			/EAG:194

/								/EAG:194

/ INTERRUPTS MUST BE DISABLED BEFORE THIS ROUTINE IS CALLED.	/EAG:194

/ THIS IS BOTH A CONVENTION OF THE ERROR PROCESSOR AND		/EAG:194

/ A NECESSITY TO ACHIEVE REENTRANCY.				/EAG:194

/								/EAG:194

/ CALLING SEQUENCE:						/EAG:194

/								/EAG:194

/	JMS PLR.MS						/EAG:194

/	  <TCB COMPLETED RETURN>				/EAG:194

/	<TCB NOT COMPLETED RETURN>				/EAG:194

/								/EAG:194

/ THIS ROUTINE FIRST CHECKS THE EVENT VARIABLE (PLR.EV) TO SEE	/EAG:194

/ IF THE ERROR STATUS REPORT (PREVIOUSLY ISSUED BY PLR.ST) TCB	/EAG:194

/ HAS COMPLETED YET.  IF IT HAS, ANY ERRORS ARE REPORTED AND	/EAG:194

/ THE NON-SKIP RETURN IS TAKEN.  IF THE TCB HAS NOT YET		/EAG:194

/ COMPLETED THE WAIT COUNTER (PLR.WC) IS INCREMENTED.  ASSUMING	/EAG:194

/ THE COUNTER DOES NOT OVERFLOW (THE NORMAL CASE) THE SKIP	/EAG:194

/ RETURN IS TAKEN.  IF THE COUNTER DOES OVERFLOW THE MESSAGE	/EAG:194

/ "IOPSUC PRX 4" OUTPUT AND THE NON-SKIP RETURN IS TAKEN.	/EAG:194

/ EFFECTIVELY WE PRETEND THE TCB COMPLETED WITH A PIREX NOT	/EAG:194

/ READY ERROR INDICATION.  THE MESSAGE IS GENERATED BY MEANS	/EAG:194

/ OF A DUMMY MESSAGE BUFFER.					/EAG:194

/								/EAG:194

								/EAG:194
PLR.MS	0							/EAG:194

	LAC (NOP)		/// CLEAR SWITCH AS POLLER	/EAG:194

	DAC PLR.SW		/// HAS BEEN CALLED.		/EAG:194

	LAC PLR.EV		/// HAS 11 RESPONDED TO OUR	/EAG:194

	SZA			/// POLL YET?			/EAG:194

	JMP PLMS.0		/// YES -- GO CHECK FOR ERRORS	/EAG:194

	ISZ PLR.WC		/// HAS 11 HAD ENOUGH TIME TO	/EAG:194

				/// ANSWER?			/EAG:194
	JMP PLMS.3		/// NO -- TAKE APPRO. RETURN	/EAG:194
	ISZ	PLMS.G		// DO WE GIVE PRX 4 MSG THIS	/RKB-208
	JMP*	PLR.MS		/// TIME?  NO -- JUST RETURN	/RKB-208
.X=PLR.WT+1			/// YES, RESET PRX 4		/RKB-208
.X=PLR.FR-PLR.WT/.X	///				/RKB-208
	LAW	-.X		/// FREQUENCEY COUNTER SO THAT	/RKB-208
	DAC	PLMS.G		/// PRX 4 WON'T REPEAT QUICKLY	/RKB-208
	LAW -1			/// GIVE IOPSUC PRX 4		/EAG:194

	DAC PLMS.A		/// ERROR, INDICATING NO	/EAG:194

	LAC PLMS.E		/// RESPONSE FROM 11.		/EAG:194
	JMP PLMS.1		///				/EAG:194
								/EAG:194
PLMS.0	LAW	-1		/// RESET PRX4 FREQUENCY CTR	/RKB-208
	DAC	PLMS.G		/// SO PRX 4 WILL BE IMMEDIATE	/RKB-208
	LAW -PLR.NT		/// PUT COUNT OF # TASKS INTO	/EAG:194

	DAC PLMS.A		/// COUNTER, AND PICK UP ADDR.	/EAG:194

	LAC PLMS.F		/// OF POLLER MESSAGE BUFFER	/EAG:194

				/// (PLR.MB)			/EAG:194

PLMS.1	DAC PLMS.B		/// SAVE POINTER TO 3-WORD	/EAG:194

	AAC 2			/// TASK ERROR BLOCK.  PLMS.B	/EAG:194

	DAC PLMS.C		/// POINTS TO TASK NAME AND	/EAG:194

				/// PLMS.C TO ERROR NUMBER.	/EAG:194

	LAC* PLMS.C		/// ERROR FOR THIS TASK?	/EAG:194

	SNA!CLL			/// SKIP IF YES.		/EAG:194

	JMP PLMS.2		/// NO -- GO TRY NEXT TASK	/EAG:194

	JMS ER.ENTR		/// INIT. ERROR PROCESSOR.	/EAG:194

				/// CLEAR LINK CAUSES NULL	/EAG:194

				/// CHARACTERS TO BE IGNORED.	/EAG:194

				/// ER.ENTR PRINTS CR/LF.	/EAG:194

	LAC (111720)		/// .SIXBT "IOP"		/EAG:194

	JMS ER.SIX		///				/EAG:194

	LAC (232503)		/// .SIXBT "SUC"		/EAG:194

	JMS ER.SIX		///				/EAG:194

	LAC (404040)		/// .SIXBT "   "		/EAG:194

	JMS ER.SIX		///				/EAG:194

	LAC* PLMS.B		/// TASK MNEMONIC		/EAG:194

	JMS ER.SIX		///				/EAG:194

	LAC (404040)		/// .SIXBT "   "		/EAG:194

	JMS ER.SIX		///				/EAG:194

	LAC (60)		/// CONDITION ER.NUM TO		/EAG:194

	DAC ERNM.A		/// SUPPRESS LEADING ZEROS.	/EAG:194

	LAC* PLMS.C		/// IOPSUC ERROR CODE NUMBER	/EAG:194

	JMS ER.NUM		///				/EAG:194

	LAC (404000)		/// .SIXBT "  "			/EAG:194

	JMS ER.SIX		///				/EAG:194

	ISZ PLMS.B		/// PICK UP SUPPLEMENTARY	/EAG:194

	LAC* PLMS.B		/// INFORMATION WORD,		/EAG:194

	SZA			/// ONLY PRINT IF NON-ZERO	/EAG:194

	JMS ER.NUM		/// PRINT IT.			/EAG:194

	JMS ER.CR		/// TERMINATE WITH CR/LF.	/EAG:194

	XCT ER.TCF		/// RESTORE TTY FLAG		/EAG:194

	.IFDEF %ODT		///				/EAG:194

	LAC ER.XR		/// RESTORE XR AND		/EAG:194

	PAX			///				/EAG:194

	XCT ER.EBA		/// ADDRESSING MODE.		/EAG:194

	.ENDC			///				/EAG:194

PLMS.2	LAC PLMS.C		/// GET ADDRESS NEXT TASK	/EAG:194

	IAC			/// ERROR BLOCK.		/EAG:194

	ISZ PLMS.A		/// CHECK ALL TASKS YET?	/EAG:194

	JMP PLMS.1		/// NOT YET.			/EAG:194

	JMP* PLR.MS		/// YES, SO RETURN		/EAG:194

								/EAG:194

								/EAG:194

PLMS.3	ISZ PLR.MS		/// TCB HASN'T COMPLETED YET,	/EAG:194

	JMP* PLR.MS		/// SO TAKE SKIP RETURN.	/EAG:194

	.TITLE     POLLER VARIABLES AND CONSTANTS

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ HERE ARE GATHERED ALL THE VARIABLES AND CONSTANTS USED BY	/EAG:194

/ THE POLLER.  THEY CONSTITUTE THE POLLER'S ABSOLUTE SECTION.	/EAG:194

/								/EAG:194

								/EAG:194

PLRABS=.			/ DEFINE START OF POLLER	/EAG:194

				/ ABSOLUTE SECTION		/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ POLLER GLOBAL VARIABLES:					/EAG:194

/								/EAG:194

								/EAG:194

PLR.SW	NOP			/ SWITCH TO INDICATE WHETHER	/EAG:194

				/ PLR.PL IS WAITING TO BE	/EAG:194

				/ CALLED.  CONTAINS NOP		/EAG:194

				/ NORMALLY, JMS PLR.PL IF	/EAG:194

				/ PLR.PL WANTS TO BE CALLED.	/EAG:194

								/EAG:194

PLR.WC	0			/ POLLER WAIT COUNT.  COUNTS	/EAG:194

				/ HOW LONG THE POLLER HAS BEEN	/EAG:194

				/ WAITING FOR A RESPONSE FROM	/EAG:194

				/ THE UNICHANNEL.  WHEN IT	/EAG:194

				/ OVERFLOWS THE PIREX NOT-	/EAG:194

				/ READY MESSAGE RESULTS.	/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ LOCATIONS USED BY PLR.ST:					/EAG:194

/								/EAG:194

								/EAG:194

PLST.A	PLR.TCB-PLRREL		/ TRANSFER VECTOR TO POLLER	/EAG:194

				/ TCB.  THIS LOCATION IS	/EAG:194

				/ RELOCATED BY IN.PLR.		/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ LOCATIONS USED BY PLR.MS:					/EAG:194

/								/EAG:194

								/EAG:194

PLMS.A	0			/ TASK COUNTER.  USED TO COUNT	/EAG:194

				/ NUMBER OF TASKS IN MESSAGE	/EAG:194

				/ BUFFER.			/EAG:194

								/EAG:194

PLMS.B	0			/ POINTER INTO MESSAGE BUFFER.	/EAG:194

								/EAG:194

PLMS.C	0			/ POINTER INTO MESSAGE BUFFER	/EAG:194

								/EAG:194

PLMS.D	.SIXBT "PRX"		/ DUMMY MESSAGE BUFFER USED TO	/EAG:194

	0			/ GENERATE PIREX NOT-READY	/EAG:194

	4			/ MESSAGE ("IOPSUC   PRX   4").	/EAG:194

								/EAG:194

PLMS.E	PLMS.D-PLRREL		/ TRANSFER VECTOR TO DUMMY	/EAG:194

				/ MESSAGE BUFFER.  RELOCATED	/EAG:194

				/ BY IN.PLR.			/EAG:194

								/EAG:194
PLMS.F	PLR.MB-PLRREL		/ TRANSFER VECTOR TO REAL	/EAG:194

				/ MESSAGE BUFFER.  RELOCATED	/EAG:194
				/ BY IN.PLR.			/EAG:194
								/RKB-208
PLMS.G	-1			/ PRX 4 COUNTER.  USED TO	/RKB-208
				/ CONTROL REPITITION FREQUENCY	/RKB-208
				/ OF IOPSUC PRX 4 MESSAGE	/RKB-208

								/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ WHAT FOLLOWS IS THE TCB WITH WHICH THE POLLER QUERIES		/EAG:194

/ THE UNICHANNEL.  THIS TCB INCLUDES THE MESSAGE BUFFER		/EAG:194

/ IN WHICH THE UNICHANNEL RETURNS ERROR STATUS INFORMATION	/EAG:194

/ ON ITS VARIOUS TASKS.						/EAG:194

/								/EAG:194

								/EAG:194

PLR.TCB	0			/ THIS TCN REQUESTS AN "ERROR	/EAG:194

	601			/ STATUS REPORT" SOFTWARE	/EAG:194

PLR.EV	0			/ DIRECTIVE.  UPON COMPLETION	/EAG:194

	1400			/ THE EVENT VARIABLE (PLR.EV)	/EAG:194

PLR.MB	.BLOCK PLR.NT*3		/ WILL BE SET WITHOUT CAUSING	/EAG:194

				/ AND INTERRUPT.  THE MESSAGE	/EAG:194

				/ BUFFER (PLR.MB) WILL CONTAIN	/EAG:194

				/ A 3-WORD ERROR STATUS BLOCK	/EAG:194

				/ FOR EACH TASK.  PLR.NT IS	/EAG:194

				/ THE NUMBER OF TASKS.		/EAG:194

								/EAG:194

								/EAG:194

								/EAG:194

/								/EAG:194

/ CONSTANTS:							/EAG:194

/								/EAG:194

								/EAG:194

	.LTORG							/EAG:194

								/EAG:194

								/EAG:194

PLREND=.			/ DEFINE END OF POLLER		/EAG:194

	.TITLE MONITOR BATCH MODE EXECUTIVE

/								/RKB-196

/								/RKB-196

/								/RKB-196

/ THIS CODE IS ACTUALLY A SPECIAL PURPOSE DOS HANDLER.  IT IS CALLED	/RKB-196

/ BY THE CAL DISPATCHER WITH THE USER'S CAL ADDRESS IN THE AC.	/RKB-196

/ THE CAL EXPANSION IS THEN EXAMINED TO DETERMINE THE I/O	/RKB-196

/ FUNCTION BEING REQUESTED.  IF IT IS NOT A READ, IT IS IGNORED	/RKB-196

/ AND CONTROL IS RETURNED TO THE USER.  IF IT IS A READ, THEN THE	/RKB-196

/ USER'S LINE BUFFER ADDRESS AND MAXIMUM WORD COUNT ARE COPIED FROM	/RKB-196

/ HIS CAL EXPANSION TO THAT OF MY OWN .READ FROM .DAT MINUS 7.	/RKB-196

/ THUS, READING IS EFFECTED BY SIMPLY REQUESTING I/O FROM .DAT -7.	/RKB-196

/ AFTER THE READ IS COMPLETE, WE				/RKB-196

/ DECIDE WHETHER THE DEVICE IS FILE ORIENTED OR NOT.  IF IT IS,	/RKB-196

/ WE MUST 'READ THRU' THE BATCH FILE TO THE 'NEXT' IMAGE WE WISH TO	/RKB-196

/ PROCESS.  THIE MECHANISM FOR ACCOMPLISHING THIS IS USING	/RKB-196

/ SC.RTF JUST AS BOSS DOES.  HOWEVER, IF WE FIND THAT THE BATCH	/RKB-196

/ DEVICE IS NON-FILE ORIENTED, (SUCH AS PR AND CD) WE DON'T DO THIS	/RKB-196

/ 'READ THRU' MESS, BECAUSE THE NEXT SEQUENCIAL RECORD IS THE ONE 	/RKB-196

/ WE WANT.  							/RKB-196

/								/RKB-196

/ NOW THAT WE HAVE READ THE RECORD OF INTEREST, WE EXAMINE THE FIRST	/RKB-196

/ THREE CHARACTERS FOR CERTAIN SPECIAL CONTROL CARDS.  INCIDENTALLY,	/RKB-196

/ END OF FILE OR END OF MEDIUM IS DETECTED AT THIS POINT AND IS	/RKB-196

/ TREATED JUST AS A $EXIT CARD IS (SEE BELOW):			/RKB-196

/	$JOB	THIS CARD IS PRINTED, AND THEN WE RELOAD NON-RESMON	/RKB-196

/		TO SIGNAL THE START OF A NEW 'JOB'.  THIS CAUSES	/RKB-196

/		THE CARD FOLLOWING THE $JOB CARD TO BE READ	/RKB-196

/		AS A DOS COMMAND BY THE NON-RESMON.  NOTE THAT NO	/RKB-196

/		OTHER PROCESSING THAN THIS OCCURS, SO THAT A $JOB	/RKB-196

/		CARD IS NO LONGER REQUIRED TO START A 'JOB'.  ALSO,	/RKB-196

/		A $JOB CARD IS NO LONGER REQUIRED BETWEEN THE EXECUTION	/RKB-196

/		OF ALL PROGRAMS, AS WAS PREVIOUSLY REQUIRED.	/RKB-196

/	$EXIT	THIS CARD IS PRINTED (UNLESS EOF OR EOM WAS ENCOUNTERED)	/RKB-196

/		AND THE MONITOR LEAVES BATCH MODE.  THIS	/EAG:196

/		IS ACCOMPLISHED BY CLEARING BIT SC.BCH OF	/EAG:196

/		SC.NMF AND DOING A .EXIT.			/EAG:196

/		BY TURNING OFF ALL BATCH INFORMATION BITS (NOTABLY	/RKB-196

/		BIT ZERO OF THE LAST WORD OF THE BANK IN WHICH THE	/RKB-196

/		BOOTSTRAP RESIDES, AND BITS 15 AND 17 OF SC.NMF, THEN	/RKB-196

/		WORDS SC.RTF, SC.BFN, SC.BFN+1, SC.BUIC, AND	/RKB-196

/		SC.BDEV ARE ZEROED.  FINALLY, A .EXIT IS PERFORMED, WHICH	/RKB-196

/		WILL CAUSE RESMON TO BE RE-LOADED AND RE-CONFIGURED, WITH	/RKB-196

/		OUT THIS CODE.					/RKB-196

/	$END	THIS CARD IS USED TO SIGNAL THE END OF A JOB.  WHEN	/RKB-196

/		IS IS ENCOUNTERED, AN END OF FILE INDICATION, RATHER	/RKB-196

/		THAN THE $END IMAGE ITSELF, IS RETURNED TO THE CALLER.	/RKB-196

/		THIS WILL ENABLE PROGRAMS GETTING DATA OR COMMANDS	/RKB-196

/		BE BE ABLE TO DYNAMICALLY DETERMINE THE END OF ITS	/RKB-196

/		INPUT DATA.  IS IS ASSUMED THAT THE RECORD FOLLOWING	/RKB-196

/		A $END IS A $JOB.				/RKB-196

/	$PAUSE	THIS CARD CAUSES ITSELF TO BE TYPED ON THE OPERATORS	/RKB-196

/		CONSOLE AND 'HANG' THE BATCH UNTIL THE OPERATOR TYPES	/RKB-196

/		'^R'.  THIS WAIT UNTILL ^R IS ACCOMPLISHED BY CALLING	/RKB-196

/		THE EXTENDED ERROR PROCESSOR WITH A MESSAGE WORD COUNT	/RKB-196

/		OF ZERO.  UPON RECOVERY (^R), THE NEXT COMMAND IS READ.	/RKB-196

/	$DATA	THIS CARD IS ESSENTIALLY A NOP.  IT IS NOT PRINTED	/RKB-196

/		AND CAUSES THE NEXT CARD TO BE READ IMMEDIATELY.	/RKB-196

/								/RKB-196

/								/RKB-196

/ NOTE THAT THE DIFFERENCES BETWEEN THIS MONITOR BATCH FACILITY AND	/RKB-196

/ THE CORRESPONDING ONE IN THE DOS-15 SERIES MONITORS ARE:	/RKB-196

/	ANY DEVICE (PR, CD, RK, DP, DK, MT, DT) CAN BE THE	/RKB-196

/	BATCH DEVICE.						/RKB-196

/	THE $JOB IS NOT REQUIRED TO MARK THE START OF A JOB.	/RKB-196

/	THE $JOB IS NOT REQUIED AFTER EVERY PROGRAM.		/RKB-196

/	THE $END PROCESSING SENDS BACK AN EOF INDICATION.	/RKB-196

/	STANDARD <IOS> DEVICE HANDLERS ARE USED FOR BATCH DEVICES.	/RKB-196

/								/RKB-196

/								/RKB-196

/								/RKB-196

	.EJECT							/RKB-196

/								/RKB-196

/								/RKB-196

/ METHOD OF OPERATION:						/RKB-196

/								/RKB-196

/ MONITOR BATCHING IS ACCOMPLISHED BY USING THREE MAJOR COMPONENTS OF THE	/RKB-196

/ XMV/DOS OPERATING SYSTEM:  1) NON-RESIDENT MONITOR, 2) RESIDENT	/RKB-196

/ MONITOR, AND 3) THE SYSTEM LOADER.  CORRESPONDINGLY, THERE ARE THREE	/RKB-196

/ MAJOR STATES INVOLVED IN THE SETING UP OF THE SYSTEM FOR MONITOR BATCHING.	/RKB-196

/ THESE ARE:							/RKB-196

/	1.  THE NON-RESIDENT MONITOR MUST RECEIVE, VALIDATE AND	/RKB-196

/	    INTERPRET THE MONITOR COMMAND 'BATCH'.  WHEN A LEGAL BATCH	/RKB-196

/	    COMMAND IS RECEIVED BY NON-RES MONITOR, THE INFORMATION IN	/RKB-196

/	    THE COMMAND IS EXTRACTED AND STORED IN SEVERAL .SCOM WORDS:	/RKB-196

/								/RKB-196

/		BIT SC.BCH OF SC.NMF IS SET, INDICATING TO	/EAG:196

/		IN.BAT AND THE SYSTEM LOADER THAT WE ARE	/EAG:196

/		IN MONITOR BATCH MODE.    NOTE THAT THE		/EAG:196

/		DOS-15 MONITOR BATCH FACILITY DID NOT USE	/EAG:196

/		THIS BIT.  PLEASE NOTE TOO THAT BOSS XVM ALSO	/EAG:196

/		USES THIS BIT WITH VERY SIMILAR MEANING.	/EAG:196

/		THE SYSTEM LOADER (AND ANYONE ELSE WHO NEEDS	/EAG:196

/		TO KNOW) CAN TELL THE DIFERENCE BETWEEN		/EAG:196

/		MONITOR BATCH AND BOSS BY CHECKING BIT		/EAG:196

/		SC.BMD OF SC.BOS.				/EAG:196

/								/RKB-196

/		SC.RTF (.SCOM+75) IS ZEROED BY THE NON-RES MONITOR COMMAND.	/RKB-196

/		THIS WORD IS USED TO INDICATE TO THE RESIDENT MONITOR	/RKB-196

/		BATCH SETUP ROUTINE (IN.BAT) THAT  IT SHOULD CONDITION	/RKB-196

/		THE BATCH EXECUTIVE ROUTINE (BA.HND) TO SKIP, OR 'READ	/RKB-196

/		THRU' ZERO LINES FROM THE BATCH COMMAND FILE, SHOULD IT	/RKB-196

/		RESIDE ON  A FILE-ORIENTED DEVICE.  A COMPLETE EXPLANATION	/RKB-196

/		OF THIS NEED IS COVERED BELOW.			/RKB-196

/								/RKB-196

/		SC.BFN AND SC.BFN+1 (.SCOM+106, 107) ARE SET DEPENDING ON	/RKB-196

/		TWO CASES, 1) THE BATCH DEVICE IS FILE ORIENTED, AND	/RKB-196

/		2) THE BATCH DEVICE IS NON-FILE ORIENTED.  FOR CASE 1),	/RKB-196

/		THESE TWO WORDS ARE SET TO THE .SIXBT REPRESENTATION OF	/RKB-196

/		THE NAME OF THE BATCH COMMAND FILE.  INCIDENTALLY, THE	/RKB-196

/		FIXED, ASSUMED EXTENSION FOR THE BATCH FILE IS 'BAT'.	/RKB-196

/		IN CASE 2), THE FIRST WORD OF THE FILE NAME PAIR IS SET TO	/RKB-196

/		ZERO (THE SECOND WORD IS NOT MODIFIED) TO INDICATE	/RKB-196

/		TO THE RESIDENT MONITOR BATCH INITIALIZATION ROUTINE	/RKB-196

/		(IN.BAT) THAT WHEN IT IS SETTING UP BATCH EXECUTIVE, IT	/RKB-196

/		SHOULD SET THE 'READ THRU' COUNT TO -1, SO THAT	/RKB-196

/		NO LINES WILL BE SKIPED FROM THE DEVICES WHICH ARE NOT	/RKB-196

/		FILE ORIENTED, AND THEREFORE, NEED NOT BE RE-POSITIONED	/RKB-196

/		AT THE START OF EACH CORE LOAD, BUT MORE ON THIS LATER.	/RKB-196

/								/RKB-196

/		SC.BUIC (.SCOM+110) IS SET TO THE USER SPECIFIED UIC OR	/RKB-196

/		TO THE CURRENT UIC (SC.UIC, .SCOM+41) IF HE DIDN'T GIVE	/RKB-196

/		ONE ON THE BATCH COMMAND.  THE UIC IS STORED IN .SIXBT	/RKB-196

/		FORMAT IN EITHER CASE AND IS USED BY THE SYSTEM LOADER	/RKB-196

/		PRIOR TO THE OPENING OF THE COMMAND FILE TO ASSURE	/RKB-196

/		THAT THE PROPER UIC IS BEING USED.  IT IS SOMETIMES DIFICULT	/RKB-196

/		TO GIVE AN ADEQUATE DISCRIPTION OF THE OBVIOUS.	/RKB-196

/								/RKB-196

/		SC.BDEV (.SCOM+111) IS SET TO THE SYSBLK (OR IOC INDEX)	/RKB-196

/		HANDLER CODE CORRESPONDING TO THE BATCH DEVICE TYPE	/RKB-196

/		SPECIFIED ON THE BATCH COMMAND.  THIS CODE IS A MAXIMUM	/RKB-196

/		OF SIX BITS LONG (1-77) AND IS STORED IN BITS 12-17.  BITS	/RKB-196

/		0-2 OF THE WORD CONTAIN THE UNIT NUMBER, IF SPECIFIED ON	/RKB-196

/		THE BATCH COMMAND.  NOTE THAT THIS WORD HAS THE FORMAT OF	/RKB-196

/		A NORMAL .DAT SLOT ENTRY.  THE SYSTEM LOADER USES THIS	/RKB-196

/		WORD TO MAKE A DYNAMIC ASSIGNMENT TO .DAT -7 AND INVOKE	/RKB-196

/		THE PROPER HANDLER.				/RKB-196

/								/RKB-196

/	2.  THE RESIDENT MONITOR INITIALIZATION ROUTINE		/EAG:196

/	    IN.BAT DETECTS THAT SC.BCH OF SC.NMF IS SET AND	/EAG:196

/	    SC.BMD OF SC.BOS IS CLEAR, AND THUS BATCH MODE	/EAG:196

/	    IS REQUESTED.  IT APPENDS THE FOLLOWING CODE (THE	/EAG:196

/	    BATCH HANDLER/COMMAND DECODER) TO THE RESIDENT	/EAG:196

/	    MONITOR AND ARRANGES FOR IT TO BE USED FOR THE	/EAG:196

/	    COMMAND INPUT DEVICE.  BIT SC.DT7 OF SC.NMF IS	/EAG:196

/	    SET SO THAT THE SYSTEM LOADER WILL LOAD AND		/EAG:196

/	    SET UP .DAT -7 (THE BATCH DEVICE).  BIT ZERO OF	/EAG:196

/	    THE BOOTSTRAP FLAGS WORD (BT.FLG) IS SET SO WHICH	/EAG:196

/	    CHECKED FOR THE BATCH MODE OPERATION UNDER DOS-15	/EAG:196

/	    WILL STILL WORK CORRECTLY.				/EAG:196

/								/EAG:196

/	3.  THE SYSTEM LOADER DETECTS THAT BATCH MODE IS IN	/EAG:196

/	    EFFECT AND SETS UP .DAT -7.  IT LOADS THE HANDLER,	/EAG:196

/	    DOES A .INIT, AND THEN DOES A .SEEK.		/EAG:196

/								/EAG:196

								/EAG:196

	.EJECT							/RKB-196
BA.REL=.			/BEGINNING OF RELOC. SECTION	/RKB-196
	JMP	BA.XIT+1	/ SPECIAL ENTRY TO BATCH --	/RKB-196
				/ TO EXIT FROM BATCH MODE	/RKB-196

								/EAG:196

								/EAG:196
BA.HND	DAC	BA.UCA		/ NORMAL ENTRY FROM CAL DISP.	/RKB-196
				/ SAVE CAL ADDRESS UNMODIFIED.	/RKB-196
	DZM	BA.RAC		/ ZERO THE RETURNED AC		/RKB-210
	IAC			/ POINT TO CAL FUNC. CODE (CFC)	/RKB-196

	DAC	BA.CPT		/ SAVE AS CAL POINTER		/RKB-196

	LAC*	BA.CPT		/ GET THE CAL FUNCTION CODE	/RKB-196

	SAD	(11)		/ IS IT A .WRITE?		/RKB-198

	JMP	BA.TYPE		/ YES, GO OFF AND TYPE IT	/RKB-198

	SAD	(10)		/ IS IT A .READ?		/RKB-196
				/ THERE IS NO CONCERN OVER THE	/RKB-196
				/ UNIT #, ITS ALWAYS ZERO	/RKB-196
	SKP			/ SKIP IF IT IS A .READ		/RKB-196
	JMP	BA.DCR		/ NOT .READ OR .WRITE, FIND OUT	/RKB-196
				/ WHAT IT IS, AND WHERE TO	/RKB-196
				/ TETURN TO USER AT		/RKB-196
	ISZ	BA.CPT		/ OK, POINT TO USER'S BUFF ADDR	/RKB-196
	LAC*	BA.CPT		/ GET THE USER'S BUFFER ADDRESS	/RKB-196
	DAC	BA.RD+2		/ AND STUFF IT INTO MY .READ 	/RKB-196
	DAC	BA.WR+2		/ ALSO INTO THE .WRITE -3, IF	/RKB-196
				/ ITS A CONTROL CARD, WHICH I	/RKB-196
				/ MUST TYPE OUT			/RKB-196

	AAC 2			/ ALSO SET UP POINTER TO DATA	/EAG:196

	DAC BA.BUF		/ BUFFER SO WE CAN CHECK FOR	/EAG:196

				/ CONTROL CARDS.		/EAG:196
	ISZ	BA.CPT		/ POINT TO USER'S MAX BUFF LEN	/RKB-196

	LAC*	BA.CPT		/ GET IT			/RKB-196

	DAC	BA.RD+3		/ AND STUFF IT IN MY .READ	/RKB-196

BA.RD	.READ	-7,2,XX,XX	/READ FROM BATCH DEVICE		/RKB-196

	.WAIT -7						/EAG:196

	LAC*	BA.RD+2		/CHECK TO SEE IF EOF.		/RKB-196

	AND	(17)		//				/RKB-196

	SAD	(5)		//				/RKB-196

	JMP	BA.XIT+1	/YES, TREAT AS $EXIT.		/RKB-196

	SAD	(6)		/IS IT EOM?			/RKB-196

	JMP	BA.XIT+1	/YES, EOM IS LIKE EOF TO ME.	/RKB-196

	ISZ	BA.CNT		/SPACE INTO FILE		/RKB-196
	JMP	BA.RD		//				/RKB-204

	LAW	-1		/RESET COUNT			/RKB-196

	DAC	BA.CNT		//				/RKB-196
	ISZ	SC.RTF		/ KICK THE NUMBER FOR NEXT TIME	/RKB-204
	LAC	SC.BOSS		/ GET THE JOB ABORT IN PROG.	/RKB-204
	RAR			/ BIT INTO THE LINK		/RKB-204
	LAC*	BA.BUF		/NOW TAKE A LOOK AT THE CARD.	/RKB-196
	SAD	BA.JBC		/IS IT '$JOB'?			/RKB-196
	JMP	BA.JOB		//				/RKB-196
	SZL			/ IS A JOB ABORT (^T) IN PROG.?	/RKB-204
	JMP	BA.RD		/ YES, THEN NOTHING ELSE IS OK	/RKB-204
	SAD	BA.EXC		/IS IT '$EXIT'?			/RKB-204
	JMP	BA.XIT		/YES.				/RKB-196

	SAD	BA.ENC		/IS IT '$END'?			/RKB-196

	JMP	BA.ND		/YES.				/RKB-196

	SAD	BA.DAC		/IS IT '$DATA'?			/RKB-196

	JMP	BA.DAT		/YES.				/RKB-196

	SAD	BA.PAC		/IS IT '$PAUSE'?		/RKB-196

	JMP	BA.PAU		/YES.				/RKB-196
	JMS	BA.PRT		/NO, BEFORE WE EXIT, TYPE IT	/RKB-196

	JMP	BA.RT1		/NONE OF THESE, RETURN TO USER.	/RKB-196

								/EAG:196
BA.JOB	LAW	777777\SC.BAB	/ RESET ABORT BIT		/RKB-204
	AND	SC.BOSS		/ TO RETURN TO NORMAL		/RKB-204
	DAC	SC.BOSS		/ NORMAL IS ACCEPTING ANYTHING	/RKB-204
	LAC	SC.MOD		/ IS THE NON-RES MONITOR IN?	/RKB-204
	AND	(SC.NRM)	/ /				/RKB-204
	SZA			//				/RKB-204
	JMP	BA.JB1		/ YES				/RKB-204
	LAC	SC.BFN		/ NO, CHECK DEVICE		/RKB-206
	SNA			/ IS IT PR OR CD?		/RKB-206
	JMP	BA.JB2		/ YES, HAVE TO PRINT $JOB NOW	/RKB-206
	LAW	-1		/ NO, THEN WE HAVE TO CALL IT	/RKB-204
	TAD	SC.RTF		/ ACT LIKE WE'VE NOT READ THIS	/RKB-204
	DAC	SC.RTF		/     $JOB CARD SO NON-RES CAN	/RKB-204
				/     PRINT IT AFTER HELLO MESG	/RKB-204
BA.EXIT	.EXIT			/AND CALL NON-RESMON.		/RKB-196
BA.JB1	JMS	BA.DLR		/ NON-RES IS IN CORE, DON'T	/RKB-204
	JMP	BA.RT1		/ WASTE TIME RELOADING IT	/RKB-204
								/RKB-206
BA.JB2	JMS	BA.DLR		/ PRINT THE $JOB WHERE WE STAND	/RKB-206
	JMP	BA.EXIT		/ AND CALL IN MONITOR		/RKB-206
				/ PASS BACK THE $JOB SO THAT	/RKB-204
				/ DOSNRM CAN RE-PROMPT ME	/RKB-204
								/EAG:196

BA.XIT	JMS	BA.DLR		/PRINT $EXIT.			/RKB-196

	LAW	777777\SC.BCH	/ RESET BATCH FLAG		/RKB-198

	AND	SC.NMF		//				/RKB-198

	DAC	SC.NMF		//				/RKB-198
	JMP	BA.EXIT		/AND RETURN TO NON-RESMON.	/RKB-196

								/EAG:196

BA.ND	JMS	BA.DLR		/PRINT $END.			/RKB-196

	LAC	(2005)		/GET EOF INDICATOR.		/RKB-196

	DAC*	BA.RD+2		/SEND AN EOF INDICATOR TO USER.	/RKB-196

	JMP	BA.RT1		/AND RETURN TO USER.		/RKB-196

								/EAG:196

BA.DAT	DZM	BA.PFLG		/ RESET THE PRINT FLAG TO NOT	/RKB-198

	JMP	BA.RD		/ NOT PRINT STUFF, AND READ NXT	/RKB-198

								/EAG:196
BA.PAU	JMS	BA.DLR		/PRINT $PAUSE.			/RKB-196
	.WRITE	-3,2,BA.PRMT,10	/ PRINT THE PROMPT		/RKB-210
BA.PTV=.-2			/ FOR IN.BAT TO SET UP		/RKB-210
	.WAIT	-3		/ WHICH IS '^R <BELL> <BELL>'	/RKB-207

	CLA			/ DON'T OUTPUT IOPS MESSAGE	/EAG:196

	JMS	SC.EEP		/CALL EER TO WAIT ON CTRL R.	/RKB-196

	JMP	BA.RD		/RETURN, JUST READ NEXT CARD.	/RKB-196

	.DSA	0		/ PRINT 0 WORDS			/RKB-196

								/EAG:196

/								/RKB-198
/ NEW CTRL T ENTRY POINT.					/RKB-210

/								/RKB-198
BA.CTT	LAW	777777\SC.BAB	/ SHOW THAT WE WISH TO ABORT 	/RKB-204
	AND	SC.BOSS		/ THIS JOB, BY SCANNING CMD IN-	/RKB-204
	IAC			/ PUT UNTIL WE FIND A $JOB CARD	/RKB-204
	DAC	SC.BOSS		/ OR WE FIND THE END OF FILE	/RKB-204
	JMP	BA.EXIT		/ WE MUST EXIT HERE IN ORDER TO	/RKB-204
				/ BE SURE THAT A BATCH DEVICE 	/RKB-204
				/ HANDLER IS LOADED BEFORE WE	/RKB-204
				/ ATTEMPT TO READ FROM IT	/RKB-204
/								/RKB-198
/ COME HERE TO SERVICE A .WRITE -2,...				/RKB-198
/								/RKB-198

BA.TYPE	LAC	BA.UCA		/ RESTORE THE ORIGINAL CAL ADDR	/RKB-198

	JMP	TTA.		/ LET TTA. DO ALL THE WORK	/RKB-198

/								/RKB-198

/ SUBROUTINE TO PRINT $ CARDS, AND RESET PRINT FLAG		/RKB-198

/								/RKB-198

BA.DLR	XX							/RKB-198

	DAC	BA.PFLG		/ SET FLAG NON-ZERO		/RKB-198

	JMS	BA.PRT		/ NOW CALL THE PRINT ROUTINE	/RKB-198

	JMP*	BA.DLR		/ THATS IT			/RKB-198
BA.DCR	SAD	(12)		/DECODE OTHER CALS AND RETURN.	/RKB-196

	JMP	BA.WAIT		/.WAIT OR .WAITR.		/RKB-196

	SAD	(1)		/				/RKB-196
	JMP	BA.INIT		/.INIT.				/RKB-210

	SAD	(2)		/				/RKB-196
	JMP	BA.OPR		/ .DLETE, .FSTAT, .RENAM (ALL	/RKB-210
				/ OK); .RAND, .RTRAN (BOTH IL-	/RKB-210
				/ LEGAL)			/RKB-210

	AAC	-5		/				/RKB-196

	SPA			/				/RKB-196
	JMP	BA.SKEN		/.SEEK, .ENTER.			/RKB-210

	AAC	-2		/				/RKB-196

	SPA!SNA			/				/RKB-196
	JMP	BA.RT1		/.CLEAR, .CLOSE, .MTAPE.	/RKB-196
	JMP	BA.IO6		/ .TRAN, IOPS 6			/RKB-210
BA.RT2	ISZ	BA.CPT		/				/RKB-196
BA.RT1	ISZ	BA.CPT		/				/RKB-196
BA.RT0	LAC	BA.RAC		/ RETURNED AC			/RKB-210
	DBR			/				/RKB-196

	JMP*	BA.CPT		/ LEAVE LEVEL 4 AND RETURN	/RKB-196

								/EAG:196

BA.WAIT	LAW	1000		/DISTINGUISH .WAIT, .WAITR.	/RKB-196

	AND*	BA.UCA		//				/RKB-196

	SZA			//				/RKB-196

	JMP	BA.RT2		/.WAITR				/RKB-196

	JMP	BA.RT1		/.WAIT				/RKB-196

								/EAG:196
BA.SKEN	CMA			/ AC IS -1 FOR .ENTER, -2 FOR	/RKB-210
	SZA			/ .SEEK, WE WANT TO RETURN 0	/RKB-210
BA.DRF	CLC			/ FOR .ENTER (FILE NOT HERE)	/RKB-210
	DAC	BA.RAC		/ AND -1 FOR .SEEK (FILE IS	/RKB-210
	JMP	BA.RT2		/ ALWAYS HERE)			/RKB-210
				/ ALSO USE -1 FOR .DELETE,	/RKB-210
				/ .RENAME, AND .FSTAT		/RKB-210
								/RKB-210
BA.OPR	LAC*	BA.UCA		/ DECIDE IF SUBFUNCTION IS > 3	/RKB-210
	AND	(4000)		/ INDICATING .RAND OR .RTRAN	/RKB-210
	SAD	(4000)		/ < 4 IS .DLETE, .RENAM, .FSTAT	/RKB-210
	SKP			/ WHICH WE WILL IGNORE, KIND OF	/RKB-210
	JMP	BA.DRF		/ DELETE, RENAME, FSTAT		/RKB-210
				/ .RAND AND .RTRAN ARE ILLEGAL	/RKB-210
				/ SO WE ISSUE AN IOPS6		/RKB-210
								/RKB-210
								/RKB-210
/ COME HERE TO PRINT AN IOPS6 OF THE FORM:			/RKB-210
/								/RKB-210
/  IOPS6 XXXXXX CMD FF						/RKB-210
/								/RKB-210
/ WHERE CMD IS PRINTED AS THE HANDLER NAME,			/RKB-210
/  AND XXXXXX IS THE USER'S CAL ADDRESS,			/RKB-210
/  AND FF IS THE SUPPLIED FUNCTION CODE.			/RKB-210
/								/RKB-210
BA.IO6	LAC*	BA.CPT		/ ADDITIONAL ARG		/RKB-210
	DAC	BA.ERC		/ 				/RKB-210
	STL			/ OUTPUT NULLS AS SPACES	/RKB-210
	LAW	6		/ ERROR 6, ILLEGAL FUNCTION	/RKB-210
	JMS	SC.EEP		/ CALL ERROR PROCESSOR		/RKB-210
	JMP	BA.IO6		/ LOOP ON ERROR			/RKB-210
	LAW	-2		/ OUPUT TWO ADDITIONAL WRDS	/RKB-210
	.SIXBT	'CMD'		/ DEVICE CODE			/RKB-210
BA.ERC	0			/ CAL FUNCTION CODE		/RKB-210
								/RKB-210
								/RKB-210
BA.INIT	ISZ	BA.CPT		/ PROCESS .INIT'S		/RKB-210
	LAC*	BA.CPT		/ GET SPECIAL CNTRL CHAR ADDR	/RKB-210
	RTL; RTL		/ POSITION CODE			/RKB-210
	AND	(7)		/ CLEAN IT UP			/RKB-210
	TAD	(TTTABL)	/ CALCULATE ENTRY INTO TABLE	/RKB-210
	DAC	BA.PRT		/ TEMP. HOLDER			/RKB-210
	LAC*	BA.CPT		/ GET ROUTINE ADDRESS		/RKB-210
	DAC*	BA.PRT		/ STUFF IT IN TABLE		/RKB-210
	ISZ	BA.CPT		/ POINT TO RETURNED BUFFER SIZE	/RKB-210
	LAC	(42)		/ RETURN SAME AS TTA.		/RKB-210
	DAC*	BA.CPT		/ PUT IT THERE			/RKB-210
	JMP	BA.RT1
								/EAG:196
BA.PRT	XX			/				/RKB-196
/								/RKB-198
/ THE FOLLOWING CODE DELETES TRAILING BLANKS (MULTIPLES OF 5	/RKB-198
/ONLY) FROM ALL BATCH COMMANDS OUTSIDE '$DATA' CARDS.		/RKB-206
/								/RKB-198
/ WE DO THE STRIPPING HERE TO AVOID MANHANDLING USER DATA,	/RKB-198
/ WHICH IS PRESUMABLY PROTECTED WITH $DATA CARDS.		/RKB-198

/								/RKB-198

	LAC	BA.PFLG		/ ARE SUPPOSED TO BE PRINTING?	/RKB-198

	SNA			/ SKIP IF YES TO CONTINUE	/RKB-198

	JMP*	BA.PRT		/ NO, SO EXIT NOW		/RKB-198
	LAW	-2		/ AND THE USERS BUFF LEN DOWN	/RKB-206
				/ TO NEXT LOWER EVEN WORD PAIR	/RKB-206
				/ (OF CONCERN ONLY IF ODD)	/RKB-206
	AND	BA.RD+3		/ NEG OF MAX BUF LENGTH		/RKB-206
	TCA			/ MAKE IT POSITIVE		/RKB-206
	DAC	BA.TM2		/ SAVE IT AWAY			/RKB-206
	LAC*	BA.WR+2		/ SEE IF WE NEED HWP CNT	/RKB-206
	AND	(60)		/ IS THE BUFFER FULL?		/RKB-206
	SAD	(60)		//				/RKB-206
	JMP	BA.WR0		/ YES, THE WE USE MAX IN BA.TM2	/RKB-206
	LAC*	BA.WR+2		/ NO, THEN WE USE THE ACTUAL	/RKB-206
	LRSS	10		/ AMOUNT PUT I BUFFER		/RKB-206
	SKP			//				/RKB-206
BA.WR0	LAC	BA.TM2		/ RECALL BUFFER LENGTH		/RKB-206
	TAD	BA.WR+2		/ NOW POINTING TO FIRST WORD	/RKB-206
				/ BEYOND BUFFER			/RKB-206
	DAC	BA.TM1		/ SAVE IN POINTER		/RKB-198

/								/RKB-198
BA.WR1	LAW	-2		/ BACK THE POINTER DOWN A PAIR	/RKB-198

	TAD	BA.TM1		//				/RKB-198

	DAC	BA.TM1		//				/RKB-198

	IAC			/ NOW POINT TO SECOND WORD	/RKB-198
	DAC	BA.TM2		//				/RKB-198
	LAW	774000		/ CHECK FOR STUFFED CR		/RKB-206
	AND*	BA.TM1		/ WHICH IS SOMETIMES SUPPLIED	/RKB-206
	SAD	(064000)	/ BY F4 OTS AND HANDLERS	/RKB-206
	JMP	BA.WRA		/ IF ITS HERE, IGNORE IT	/RKB-206
	LAC*	BA.TM1		/ EXAMINE FIRST WORD FOR BLANKS	/RKB-198

	SAD	(201004)	//				/RKB-198

	SKP			/ COULD BE, CHECK SECOND WORD	/RKB-198
	JMP	BA.WR2		/ ITS ALL SCRUNCHED READY TO GO	/RKB-206

	LAC*	BA.TM2		/ CLOSE, TRY SECOND HALF	/RKB-198

	SAD	(020100)	//				/RKB-198

	SKP			/ YES, ITS ANOTHER BLANK PAIR	/RKB-198
	JMP	BA.WR2		/ NOPE, PRINT IT		/RKB-206

	LAC	(064000)	/ BLANK SO SET IT TO CR		/RKB-198

	DAC*	BA.TM1		/ IF THIS IS LAST OF BLANKS	/RKB-198
BA.WRA	LAW	-1000		/ SUBRTRACT ONE FROM HEADER	/RKB-198

	TAD*	BA.WR+2		//				/RKB-198

	DAC*	BA.WR+2		//				/RKB-198

	JMP	BA.WR1		/ LOOP TILL DONE		/RKB-198
/								/RKB-198
BA.WR2	LAC*	BA.WR+2		/ WAS USERS BUFFER TOO SHORT	/RKB-206
				/ TO HOLD UN-SCRUNCHED DATA?	/RKB-206
	AND	(60)		/ NOTE THAT THE HEADER WORD	/RKB-206
	SAD	(60)		/ PAIR COUNT HAS BEEN SUITABLY	/RKB-206
				/ DECREMENTED AS SCRUNCHING	/RKB-206
				/ OCCURRED.			/RKB-206
	SKP!CLL			/ YES, BUFFER OVERFLOW		/RKB-206
	JMP	BA.WR		/ NO IT FIT BEFORE, IT FITS NOW	/RKB-206
	LAW	777000		/ MUST SEE IF LINE IS NOW	/RKB-206
	AND*	BA.WR+2		/ SHORT ENOUGH TO FIT		/RKB-206
	LRS	10		/ CONVERT WORD PAIR COUNT TO 	/RKB-206
				/   WORD COUNT			/RKB-206
	TAD	BA.RD+3		/ COMPARE TO MAX BUF LENGTH	/RKB-206
				/ FROM USER'S CAL EXPANSION	/RKB-206
	SMA!SZA			/ IF IT EITHER JUST FITS OR IS	/RKB-206
				/ SMALLER, WE'RE GOLDEN		/RKB-206
	JMP	BA.WR		/ IF IT'S STILL TOO BIG, LEAVE	/RKB-206
				/ ERROR INDICATION FOR USER	/RKB-206
	LAW	777717		/ FITS NOW, SO CLEAR ERROR BITS	/RKB-206
	AND*	BA.WR+2		/ FROM HEADER WORD		/RKB-206
	DAC*	BA.WR+2		/ HOWS THAT FOR SERVICE?	/RKB-206
/								/RKB-206
BA.WR	.WRITE	-3,2,XX,100	/ PRINT BATCH CARD ON TTY	/RKB-196

	.WAIT	-3		/ WAIT				/RKB-196

	JMP*	BA.PRT		/DONE				/RKB-196

								/EAG:196

BA.ABS=.			/END OF RELOCATABLE, BEGIN OF ABSOLUTE.	/RKB-196

								/EAG:196

BA.TM1=.

BA.UCA	0			/CAL ADDR			/RKB-196

BA.TM2	0							/RKB-198

BA.CPT	0			/CAL POINTER.			/RKB-196

								/EAG:196

BA.JBC	.ASCII	'$JO'		/		/		/RKB-196

	.LOC	.-1		/		/		/RKB-196

BA.EXC	.ASCII	'$EX'		/		/		/RKB-196

	.LOC	.-1		/		/		/RKB-196

BA.ENC	.ASCII	'$EN'		/		/		/RKB-196

	.LOC	.-1		/		/		/RKB-196

BA.DAC	.ASCII	'$DA'		/		/		/RKB-196

	.LOC	.-1		/		/		/RKB-196
BA.PAC	.ASCII	'$PA'		/		/		/RKB-196
	.LOC	.-1		/		/		/RKB-196
BA.PRMT	002002			/ $PAUSE PROMPT LINE		/RKB-207
	0							/RKB-207
	.ASCII	'^R'<7><7><175>					/RKB-207

								/EAG:196

BA.CNT	.DSA	-1		/COUNT OF FILE LINE TO SKIP	/RKB-196

BA.PFLG	-1			/ PRINT FLAG. =0 NO PRINT	/RKB-198

								/EAG:196
BA.BUF	-1			/ POINTER TO DATA BUFFER	/EAG:196
BA.RAC	0			/ THE RETURNED AC		/RKB-210
								/EAG:196
	.LTORG			/DO THE LITERALS.		/RKB-196

								/EAG:196

BA.END=.		/END OF THE BATCH PROCESSOR.		/RKB-196
	.TITLE	BOSS RESIDENT EXECUTIVE

/NOV. 12,  1971	E. MARISON					/RKB-198

/								/RKB-198

/ RESIDENT BOSS MODIFIED FOR USE WITH ED GARDNER'S NEW		/RKB-198

/	XVM/DOS RESIDENT MONITOR BY KENT BLACKETT		/RKB-198

/		     SEPTEMBER 12, 1975				/RKB-198

/								/RKB-198

/								/RKB-198

/ BOSS IS ENTERED UNDER SEVEN DIFFERENT CONDITIONS.		/RKB-198

/ EACH CONDITION HAS ITS OWN ENTRY POINT AND PROCESSING		/RKB-198

/ MODULES.							/RKB-198

/								/RKB-198

/ THIS CODE IS MOVED INTO PLACE BY THE ROUTINE "IN.BOS"		/RKB-198

/ ALSO, THE RESIDENT MONITOR IS PATCHED BY "IN.BOS" SO THAT	/RKB-198

/ RESIDENT BOSS IS ENTERED UNDER THE FOLLOWING CONDITIONS	/RKB-198

/								/RKB-198

/	1. I/O SYSTEM MACRO ADDRESSED TO DAT SLOT -2		/RKB-198

/	2. I/O SYSTEM MACRO ADDRESSED TO DAT SLOT -3		/RKB-198

/	3. CONTROL "T" (^T) TYPED ON CONSOLE TTY		/RKB-198

/	4. NON-RECOVERABLE IOPS ERROR --- UNDER BOSS		/RKB-198

/	   ONLY AN IOPS4 IS CONSIDERED RECOVERABLE BY BOSS.	/RKB-198

/	5. IF THE USER HAS BEEN TIMED OUT			/RKB-198

/	   (TIME ESTIMATE EXCEEDED)				/RKB-198

/	6. .PUT OR .GET BY USER					/RKB-198

/	7. WHEN A .EXIT HAS BEEN ISSUED.			/RKB-198

/	   AT THIS TIME IF A CONTROL CARD			/RKB-198

/	   IMAGE IS TO BE GIVEN TO NRBOSS IT WILL		/RKB-198

/	   BE TRANSFERED VIA THE MONITOR TRAN			/RKB-198

/								/RKB-198

/ IN ADDITION THE CARD READER HANDLER WILL PLACE THE 		/RKB-198

/ ADDRESS OF THE CONTROL CARD BUFFER IN "BS.CIA"		/RKB-198

/ C(DAT-2)+2 IF IN USER MODE					/RKB-198

/ WHERE USER MODE --> SC.BMD OF SC.BOS & SC.BCH OF SC.NMF = 1	/RKB-198

/								/RKB-198

/ THE RELATIVE POSITION OF SOME ENTRY POINTS MUST NOT BE	/RKB-198

/ CHANGED, AND IF THEY ARE, THEN THE				/RKB-198

/ SETUP SUBROUTINE "IN.BOS" MUST BE MODIFIED TO REFLECT		/RKB-198

/ THIS FACT.  THIS IS ALSO TRUE OF SOME LOCATIONS		/RKB-198

/ IN THE ABSOLUTE SECTION OF THIS CODE				/RKB-198

/ ALL LOCATIONS CONTAINING ADDRESSES ONLY ARE SETUP BY "IN.BOS"	/RKB-198

/								/RKB-198

/								/RKB-198

BS.REL=.				/ BEGINNING OF RELOC.	/RKB-198

/								/RKB-198

/								/RKB-198

/								/RKB-198

/								/RKB-198

/								/RKB-198

/ AN IOPS ERROR HAS OCCURED.  THE ERROR MESSAGE HAS ALREADY	/RKB-198

/ BEEN PRINTED ON THE OPERATOR'S CONSOLE.  WE CHECK TO SEE IF	/RKB-198

/ A ^Q DUMP SHOULD BE TAKEN, AND DO IT IF SO.  THEN THE ERROR	/RKB-198

/ INFORMATION IS MOVED INTO THE NON-RESIDENT BOSS DISK IMMAGE	/RKB-198

/ AND THE APPROPRIATE EXIT BITS SET IN SC.BOS.  THIS WILL CAUSE	/RKB-198

/ THE 'TERMINAL ERROR' MESSAGE, PLUS A COPY OF THE IOPS		/RKB-198

/ MESSAGE TO OUTPUT ON THE LINE PRINTER, AND THE JOB TERMINATED	/RKB-198

/								/RKB-198

/								/RKB-198

BS.ERR	LAC*	BS.ERC		/ GET THE ERROR CODE		/RKB-198

	DAC	BS.ERC		//				/RKB-198

	LAC*	BS.MED		/ GET THE ERROR DATA		/RKB-198

	DAC	BS.MED		//				/RKB-198

	LAC*	BS.ERP		/ GET ENTRY ADDR TO EXPND. ERR	/RKB-198

	DAC	BS.ERP		//				/RKB-198

	LAC	(SC.BIO)	/ SET THE IOPS ERROR BIT	/RKB-198

	JMS	BS.BITS		//				/RKB-198

	LAC	SC.BOSS		/ INFO IS SAFE, IS DUMP NEEDED?	/RKB-198

	AND	(SC.BDMP)	//				/RKB-198

	SNA			/ SKIP IF YES			/RKB-198

	JMP	BS.ER1		/ NO, CONTINUE WITH ERROR	/RKB-198

BS.DMP	LAC	(NOP)		/ NEED TO DUMP CORE, TURN OFF	/RKB-198

	DAC	PTGT.B		/ THE TRAP IN PUT PROCESSOR	/RKB-198

	LAW	21		/ NOW FAKE A ^Q			/RKB-198

	JMP	ER.FAKE		//				/RKB-198

				/ CONTROL WILL BE RETURNED	/RKB-198

				/ VIA A .EXIT, SO WE CONTINUE	/RKB-198

				/ AT BS.XT0 UPON COMPLETION OF	/RKB-198

				/ THE DUMP.			/RKB-198

/								/RKB-198

/ IF NEEDED A ^Q HAS BEEN DONE. NOW TRAN IN THE FIRIST BLOCK OF	/RKB-198

/ NON-RES BOSS AND PUT ERROR DATA IN IT				/RKB-198

/ STARTING AT WORD 44 OF THE BLOCK				/RKB-198

/								/RKB-198
BS.ER1	LAW	-1		/ RETURNED FROM DUMP		/RKB-198

	TAD	SC.FRL		/ GET ADDR TO TRAN TO		/RKB-198
	DAC	BS.TRN-2		/ PUT CA .MTRAN CPB	/RKB-198
	CLL			/ INPUT OR READ .MTRAN		/RKB-198
	JMS	BS.TRN		/ GO DO IT			/RKB-198
	LAC BS.TRN-2		/ SET UP ADDRESS FOR BS.DAPT	/EAG:211
	AAC 45			/ TO STORE DATA INTO.		/EAG:211
	DAC BS.TM1						/EAG:211

	LAC	BS.ERC		/ BACK, GET ERROR CODE		/RKB-198

	JMS	BS.DAPT		/ CALL DATA PUT ROUTINE		/RKB-198

	LAC	BS.MED		/ GET CONTENTS OF .MED		/RKB-198

	JMS	BS.DAPT		/ PUT IT IN IMAGE		/RKB-198

	LAC	BS.ERP		/ GET EXPANDED ERR FLAG		/RKB-198

	JMS	BS.DAPT		/ FOR NON-RES BOSS		/RKB-198

	ISZ	BS.ERP		/ BUMP ERROR MESSAGE POINTER	/RKB-198

	LAC*	BS.ERP		/ MOVE EXPANDED ERROR		/RKB-198

	JMS	BS.DAPT		/ MESSAGE INFORMATION		/RKB-198

	JMP	.-3		/ TO NON-RES BOSS INFO AREA	/RKB-198

/								/RKB-198

/								/RKB-198

BS.DAPT	XX			/ RTNE. TO MOVE DATA TO NRBOSS	/RKB-198

	DAC*	BS.TM1		/ STORE NEXT DATA WORD		/RKB-198

	ISZ	BS.TM1		/ BUMP POINTER			/RKB-198
	ISZ	(-40)		/ STORE 40(8) WORDS OF INFO MAX	/RKB-198

	JMP*	BS.DAPT		/ EXIT				/RKB-198

	STL			/ TRAN BLOCK BACK OUT		/RKB-198

	JMS	BS.TRN		/ DO IT				/RKB-198

	JMP	BS.EXIT		/ EXIT TO MONITOR		/RKB-198

/								/RKB-198

/ AT THE PRESENT TIME A CONTROL "T" ONLY SETS			/RKB-198

/ BIT 7 IN SC.BOS AND THEN EXITS TO THE MONITOR			/RKB-198

/								/RKB-198

BS.CTT	LAC	(SC.BOA)	/ SET BIT 7 IN SC.BOS		/RKB-198

	JMS	BS.BITS		//				/RKB-198

	JMP	BS.EXIT		/ ABORT				/RKB-198

/								/RKB-198

/ OPERATOR TYPED ^C, EXIT FROM BOSS MODE.			/RKB-198

/ SO WE SET BIT SC.BXT AND CALL NRBOSS TO			/RKB-198

/ BOMB THE CURRENT JOB, DO ACCOUNTING AND			/ RKB-198

/ RELEASE THE SYSTEM FROM BOSS.					/RKB-198

/								/RKB-198
BS.CTC	LAC	(SC.BXT!SC.BOA) / REQUEST EXIT FROM BOSS MODE	/RKB-202

	JMS	BS.BITS		//				/RKB-198

	JMP	BS.EXIT		/ ABORT THIS JOB		/RKB-198

/								/RKB-198

/ THIS IS A JOB ABORT THEREFORE SET BIT 17			/RKB-198

/ IN SC.BOS FOR THE NON-RESIDENT MONITOR			/RKB-198

/								/RKB-198

BS.EXIT	CLA!IAC			/ SET BIT 17			/RKB-198

	JMS	BS.BITS		//				/RKB-198

	LAC	SC.NMN		/ BRING IN THE RESIDENT MONITOR	/RKB-198

	DAC	SC.SPN		//				/RKB-198

	LAC	SC.NMN+1	//				/RKB-198

	DAC	SC.SPN+1	//				/RKB-198

	JMP	BS.XT1		/ PICK UP EXIT PROCESSING	/RKB-198

/								/RKB-198

/ .EXIT MACROS AND .OVERLA MACROS JOIN US HERE:			/RKB-198

/								/RKB-198
BS.XT0	LAC	SC.BOS		/ FIND OUT IF WE ARE BACK FROM	/RKB-198
	AND	(SC.BIO!SC.BDMP) / DUMPING CORE AFTER IOPS ERR	/RKB-198
	SAD	(SC.BIO!SC.BDMP) //				/RKB-202
	JMP	BS.ER1		/ YES, SO WIND UP ERROR PROCESS	/RKB-198

	LAC	SC.BOS		/ ARE WE BACK FROM DUMPING	/RKB-198

	AND	(SC.BPT)	/ MEMORY IN RESPONSE TO A .PUT	/RKB-198

	SZA			/ 				/RKB-198

	JMP	BS.EXIT		/ YES, THE PICK UP ABORT PROC.	/RKB-198

/								/RKB-198

BS.XT1	LAC	(777777\SC.BTT)	/ CLEAR TTY TO TTY BIT		/RKB-198

	AND	SC.BOS		/ SO OUTPUT WILL GO TO PRINTER	/RKB-198

	DAC	SC.BOS		//				/RKB-198

	LAC	BS.CCB		/ CHECK IF A CONTROL CARD IS 	/RKB-198

	SNA			/ PENDING			/RKB-198

	JMP	BS.XT2		/ NO, JUST EXIT QUIETLY		/RKB-198

/ YES, TRNASFER THE CARD IMAGE TO NON-RES BOSS			/RKB-198

/								/RKB-198

	LAW	-1		/ TRAN IN THE 1ST BLOCK OF BOSS	/RKB-198

	TAD	SC.FRL		/ CALCULATE WHERE TO READ IT TO	/RKB-198

	DAC	BS.TRN-2	/ STARTING AT C(SC.FRL)		/RKB-198

	CLL			/ LINK = 0 MEANS READ		/RKB-198

	JMS	BS.TRN		/ DO IT				/RKB-198

/								/RKB-198

	LAC	BS.CCB		/ BACK FROM TRAN, GET CARD ADDR	/RKB-198

	DAC	BS.TM4		/ 'FROM' POINTER		/RKB-198

	LAC	SC.FRL		/ ADRR OF WHERE TO PUT		/RKB-198

	DAC	BS.TM2		/ SAVED IMAGE

	LAW	-44

	JMS	BS.MOVE		/ MOVE IMAGE BACK

/ 

	STL			/ TRAN BLOCK BACK

	JMS	BS.TRN		/ OUT TO NRBOSS

/ 

BS.XT2	JMS	IO.CLR		/ DO .INITS TO BUSY TABLE	/RKB-198

	DZM	SC.ACT		/ ZERO NO. OF MSBT ENTRIES	/RKB-198

	JMP	EXIT.1+1	/ FINISH .EXIT OR NRM OVERLAY

/ 

/ SUBROUTINE BS.MOVE

/ 

/ CALL:

/ 	LAC	ADDR FROM

/ 	DAC	BS.TM4

/ 	LAC	ADDR TOO

/ 	DAC	BS.TM2

/ 	LAW	-#OF WORD TO MOVE

/ 	JMS	BS.MOVE

/ 

BS.MOVE	XX

	DAC	BS.TM3

BS.MV1	LAC*	BS.TM4		/ GET DATA

	DAC*	BS.TM2		/ MOVE IT

	ISZ	BS.TM2		/ BUMP POINTERS

	ISZ	BS.TM4

	ISZ	BS.TM3		/ DONE ??

	JMP	BS.MV1		/ NO LOOP

	JMP*	BS.MOVE		/ DONE

/ 

/ 

/ THE USER HAS EXCEEDED HIS (OR DEFAULT) TIME ESTIMATE

/ THEREFORE SET BIT 3 OF SC.BOS AND DO JOB ABORT .EXIT

/ 

BS.TLE	LAC	(SC.BTM)	/ SET TIME LIMIT EXCEEDED BIT	/RKB-198

	JMS	BS.BITS		//				/RKB-198

	JMP	BS.EXIT

/ 

/ THE USER HAS TRIED TO DO A .PUT OR .GET

/ SET BIT 10 IN SC.BOS IF .PUT

/ SET BIT 11 IN SC.BOS IF .GET

/ IF ITS A .PUT GIVE A ^Q AND THEN EXIT

/ 

BS.GPR	SZL

	JMP	BS.PUT

	LAC	(SC.BGT)	/ SET THE USER ATTEMPTED .GET 	/RKB-198

	JMS	BS.BITS

BS.GT1	JMP	BS.EXIT

BS.PUT	LAC	(SC.BPT)	/

	JMS	BS.BITS

	JMP	BS.DMP		/ NOW RUN OFF AND DUMP CORE	/RKB-198

/ 

/ SUBOUTINE TO SET BITS IN SC.BOS

/ 

/ CALL:

/ 	LAC	CONSTANT

/ 	JMS	BS.BITS

/ 	RETURN

/ 

BS.BITS	XX

	LMQ			/ LOAD FOR INCL. 'OR'

	LAC	SC.BOS			/ GET THE WORD

	OMQ			/ SET THE BIT

	DAC	SC.BOS		/ PUT IT BACK

	JMP*	BS.BITS		/ EXIT

/ 

/ 

/ PROCESSING FOR DAT SLOT -3

/ IF BIT A OF SC.BOS IS SET CLEAR IT AND

/ GO TO THE TTY HANDLER.  IF IT IS NOT SET

/ IGNORE ALL CALLS EXCEPT .WRITE AND SHUNT

/ THE OUTPUT TO THE LINE PRINTER (DATSLOT 6)

/ 
BS.DT3	DAC	BS.TM1		/ SAVE CAL ADDRESS

	LAC	SC.BOS		/ IS OUTPUT TO GO TO TTY
	AND	(SC.BTT) 	/ BIT4=1 IF SO

	SNA			/ 
	JMP	BS.LPOT		/ NO -- OUTPUT TO LP
	LAC	TTIOSW		/ GOING TO TTY, LET'S WAIT	/RKB-205
	SZA			/ IF ITS ACTIVE FIRST		/RKB-205
	JMP	BS.RT0		/ GET OFF API 4			/RKB-205
	LAC*	BS.TM1		/ IF CALLED FROM A + .DAT SLOT, ASSUME USER
	SWHA			/ GO TO TT NOT LP (BR-76)	/(RKB-205)
	SPA!CLA			/ IF MINUS, RESET BIT 4.	/RKB-205
	LAC	(SC.BTT)	/ CLEAR BIT IF -, NOT IF +	/RKB-205
	XOR	SC.BOS		/ CLEAR SC.BTT			/RKB-198
	DAC	SC.BOS		/				/RKB-198
	LAC	BS.TM1		/ GET CAL ADDRESS

	JMP	TTA.		/ GO TO TTY HANDLER		/RKB-198

/ 
BS.LPOT	LAC*	BS.TM1		/ GET DATA MODE IN CAL

	AND	(7000)

	AAC	+6		/ MAKE UP CAL TO .DAT SLOT 6

	DAC	BS.LPCL		/ STUFF CAL

	ISZ	BS.TM1		/ BUMP TO FUNCTION CODE

	LAC*	BS.TM1		/ GET IT
	SAD	(11)		/ IS IT A .WRITE
	JMP	BS.LPWT		/ 
	SAD	(1)		/ IS IT A .INIT?		/RKB-212
	JMP	BS.TINT		/ YES				/RKB-212

	JMP	BS.CAL		/ GO AN IGNORE CAL

BS.LPWT	ISZ	BS.TM1		/ GET BUFF ADDR. +2

	LAC*	BS.TM1		/ 

	AAC	+2		/ POINT TO DATA

	DAC	BS.TM4		/ SAVE IT

	LAC	BS.LPBF		/ GET BOSS BUFFER ADDR

	DAC	BS.TM2		/ SAVE IT

	LAW	-42

	JMS	BS.MOVE		/ MOVE USERS BUFFER

BS.LPCL	.WRITE	6,2,XX,54

	.WAIT	6		/ WAIT FOR IT TO FINISH

	JMP	BS.RT2		/ RETURN TO USER

/ 

/ 

/ PROCESSING FOR DAT SLOT -2

/ IGNORE ALL CALS EXCEPT A .READ

/ UPON A .READ TRANSFER THE NEXT LINE

/ IN THE PROCEDURE FILE (DAT -7) TO

/ THE USER BUFFER AND INCREMENT SC.RTF

/ SO THAT NON-RES BOSS WILL KNOW HOW

/ MANY LINES THE LAST USER READ

/ 

BS.DT2	DAC	BS.TM1		/ SAVE CAL ADDRESS

	SKP		/ OVER ADDR WORD FOR CARD READER

BS.CCB	0			/ CARD READER WILL PUT

			/ ADDR OF CARD IMAGE HERE

			/ IF USER READ A CONTROL CARD

	ISZ	BS.TM1		/ BUMP TO FUNCTION CODE

	LAC*	BS.TM1		/ GET IT

	SAD	(10)		/ IS IT A .READ

	JMP	BS.RDP		/ YES GO READ PROCEDURE FILE

	JMP	BS.CAL		/ NO-- GO AND IGNORE CAL

BS.RDP	ISZ	BS.TM1		/ BUMP TO USER BUFF ADDR

	LAC*	BS.TM1		/ GET IT AND PUT IT

	DAC	BS.RDCL+2	/ IN READ CAL

	ISZ	BS.TM1		/ GET WORD COUNT

	LAC*	BS.TM1		/ 

	DAC	BS.RDCL+3	/ 

BS.RDCL	.READ	-7,2,XX,XX

	.WAIT -7		/ WAIT FOR READ

	ISZ	BS.LCNT		/ SKIP OVER LINES ALREADY

	JMP	BS.RDCL		/ READ IN THE PROCEEDURE FILE

	LAW	-1		/ RESET COUNT SO THAT WE PROCESS

	DAC	BS.LCNT		/ EVERY LINE FROM NOW ON

	LAC*	BS.RDCL+2	/ CHECK FOR EOF

	AND	(17)		/ EOF IS ILLEGAL AT THIS POINT

	SAD	(5)		/ 

	JMP	BS.EOF		/ END OF PRC FILE ABORT

	ISZ	SC.RTF		/ COUNT LINE

	JMP	BS.RT1		/ RETURN TO USER

/ 

/ END OF PROCEDURE FILE HAS BEEN READ

/ BY RESIDENT BOSS.  THIS IS AN ABORT CONDITION.

/ SET BIT 2 OF SC.BOS AND DO A JOB ABORT .EXIT

/ 

BS.EOF	LAC	(SC.BEOF)

	JMS	BS.BITS

	JMP	BS.EXIT

/ 

/ 

/ COMMON EXIT ROUTINE FOR IGNORED CALS

/ TO DAT SLOTS -2 AND -3

/ 

BS.CAL	SAD	(12)		/ IS CAL A WAIT

	JMP	BS.WTCL		/ YES

	SAD	(1)		/ IS IT A .INIT

	JMP	BS.RT3		/ YES

	SAD	(2)		/ IS CAL AN OPERATE

	JMP	BS.OPRC		/ YES

	AAC	-5		/ IS FUNC CODE 3-4

	SPA			/ 

	JMP	BS.RT2		/ YES

	AAC	-2		/ IS FUNC CODE 5-7

	SPA!SNA 		/ 

	JMP	BS.RT1		/ YES

	AAC	-2		/ IS FUNC CODE 13

	SMA!SZA 		/ 

BS.RT4	ISZ	BS.TM1		/ YES

BS.RT3	ISZ	BS.TM1		/ 

BS.RT2	ISZ	BS.TM1		/ 

BS.RT1	ISZ	BS.TM1		/ 
BS.RT0	DBR			/ LEAVE LEVEL 4

	JMP*	BS.TM1		/ RETURN TO USER AFTER CAL

/ 

/ IGNORE CAL IS A WAIT OR A WAITR

/ 

BS.WTCL	LAW	-1		/ GO BACK TO CAL

	TAD	BS.TM1		/ 

	DAC	BS.TM1		/ 

	LAC*	BS.TM1		/ GET CAL

	AND	(1000)		/ IS IT A WAITR

	SZA			/ 

	JMP	BS.RT3		/ YES

	JMP	BS.RT2		/ NO

/ 

/ IGNORE CAL IS AN OPERATE FUNCTION

/ 
BS.OPRC	ISZ	BS.TM1		/ BUMP RETURN

	LAW	-2		/ GET USERS CAL

	TAD	BS.TM1

	DAC	BS.TM4

	LAC*	BS.TM4

	AND	(7000)		/ AND OFF SUB-FUNC

	SAD	(4000)		/ IS IT (4)  .RTRAN

	JMP	BS.RT4		/ YES

	SAD	(5000)		/ IS IT (5) .RAND

	JMP	BS.RT2		/ YES
	JMP	BS.RT1		/ NO
/ 
/ 
BS.TINT	ISZ	BS.TM1		/ POINT TO "^P" ADDR		/RKB-212
	ISZ	BS.TM1		/ POINT TO BUF SIZE		/RKB-212
	LAC	SC.MOD		/ FIND OUT HOW BIG THE PRINTER	/RKB-212
	AND	(SC.LPSZ)	/ IS				/RKB-212
	SAD	(SC.LPSZ)	/ IS IT 132 COL.?		/RKB-212
	CLA!SKP			/ YES, RETURN BUF SIZE OF 70	/RKB-212
	LAW	-24		/ NO, RETURN BUF SIZE OF 44	/RKB-212
	AAC	+70		/ MAKES THE NUMBER RIGHT	/RKB-212
	DAC*	BS.TM1		/ RETURN 44 OR 70 TO USER	/RKB-212
	JMP	BS.RT1		/ ALL DONE			/RKB-212

/ 

/ SUBROUTINE BS.TRN -- TRAN VIA THE BOOTSTRAP THE

/ FIRST BLOCK OF NON-RES BOSS15	THE BLOCK

/ NUMBER IN THE DATA BLOCK IS SETUP BY THE SETUP

/ SUBROUTINE "BOSS15" THE ADDRESS TO TRAN

/ FROM OR TO IS STORED IN TRAN.2 AND THE LINK DETERMINS

/ THE DIRECTION OF THE TRAN. THE WORD COUNT

/ IS ALWAYS 400 OCTAL

/ 

/ CALL	LAC	ADDR-1		/ TRAN ADDRESS

/ 	DAC	TRAN.2

/ 	STL OR CLL		/ OUT/ IN TRAN DIRECTION

/ 	JMS	TRNBLK

/ 	RETURN

/ 

/ 

/ 

/  NOTE THAT THE NEXT FIVE (5) LOCATIONS (**INCLUDING SUBROUTINE ENTRY**)

/  ARE THE PARAMETER BLOCK FOR A MONITOR TRAN CALL.

/

	.DSA	 .+1	/ POINTER TO CPB (NOT REALLY PART OF CPB)

	XX		/ 1'ST BLOCK OF NRBOSS

	XX		/ FA-1

	-400		/ -WC

BS.TRN	0

	LAC	BS.TRN-4	/ GO TO BOOTSTRAP ROUTINE

	JMP	SC.TRN						/RKB-198

/ 

/ 

/ ABSOLUTE SECTION OF RESIDENT BOSS15

BS.ABS=.

/ 

/ LINE PRINTER BUFFER

BS.LBUF	022002			/ **LP HANDLER WILL USE DATA MODE IN CAL

BS.TM2	0			/ **TEMPORARY LOCATION**

	.BLOCK	42		/ 

	064000			/ CARRIAGE RETURN FOR LP IOPS ASCII

	15			/ CARRIAGE RETURN FOR LP IMAGE ASCII

BS.LPBF	.DSA	BS.LBUF+2	/ SET TO CORRECT ADDR BY "IN.BOS"

BS.LCNT	.DSA	-1		/ SET TO CORRECT VALUE BY "IN.BOS"

/  NOTE:  ABOVE TWO WORDS MUST BE IN THAT ORDER AND CONTIGUOUS.

/

BS.ERC	.DSA	ER.ERR		/ ERROR NUMBER

BS.MED	.DSA	.MED		/ MONITOR ERROR MESSG. INFO

BS.ERP	.DSA	ER.RADR		/ EXTENDED ERROR PROCESSOR ADDR

BS.TM1	0			/ TEMPORARY

BS.TM3	0			//

BS.TM4	0			//

/

/ 

	.LTORG			/ RESIDENT BOSS LITERALS

/ 

BS.END=.			/ END OF RESIDENT BOSS		/RKB-198

	.TITLE CONTROL X FEATURE

/

/

/TELETYPE INTERFACE TO THE VT15 DISPLAY SYSTEM

/ALSO KNOWN AS THE CONTROL X FEATURE

/- CHARLES F DAVIS     NOV. 1970

/

/

VTREL=.

/

/

/

/

/

/

/ SC.VTF -- CONTROL X STATUS WORD				/EAG:193

/	BIT SC.HFN -- HALF BUFFER ON-OFF			/EAG:193

/	BIT SC.VTS -- SETUP ON-OFF				/EAG:193

/	BIT SC.VTN -- VT ON-OFF					/EAG:193

/	BIT SC.DMN -- ^X ON-OFF					/EAG:193

/ SC.VTR -- DISPLAY RESTART ADDRESS				/EAG:193

/

/

/

/

/CORE REQUIREMENTS:

/

/FULL BUFFER--1440 DEC. LOCATIONS

/HALF BUFFER-- 760 DEC. LOCATIONS

/CONTROL X HANDLER--520 DEC. LOCATIONS

/

/

VT.FUL=1250+1250+120		/ SIZE OF FULL BUFFER		/EAG:193

VT.HAF=1250+120			/ SIZE OF HALF BUFFER		/EAG:193

								/EAG:193

	.EJECT

/

/THE FOLLOWING ARE SUBROUTINES CALLED FROM THE TELETYPE HANDLER,

/THESE ARE THE PRIMARY LINKS TO THE CONTROL X HANDLER.

/

/

VTDISP	JMP	VTTTIN		/TTY INPUT HANDLER

	JMP	VTSAVE

	JMP	VTRET1

/

/

/

VTSAVE	LAC TTYPTR		/SAVE RETURN ADDRESS OF .WRITE

	DAC	VTSTOR

	JMP TTYVT1+1		/RETURN TO TTY HANDLER AT TTYVT1+1

/

/

/

VTTTIN	SAD (30)

	JMP	VTFPFP

VTOTJP	JMP TTYVT2+1		/OVERLAYED WITH SAD (015) WHEN ^X ON, TEST FOR CARRIAGE RETURN

	JMP	VTCROT

	SAD (25)		/TEST FOR ^U

	JMP	VTCUOT

	SAD (177)		/TEST FOR RUB OUT

	JMP	VTBKUP

	SAD (11)		/ IF TAB MAY WANT TO IGNORE IT	/EAG:193

				/ SINCE IS CONVERTED TO SPACES	/EAG:193

				/ BY TTA.			/EAG:193

VTTAB	XX			/ THIS LOCATION SET UP BY IN.VT	/EAG:193

				/ TO EITHER NOP (IF SC.TAB	/EAG:193

				/ SET) OR JMP VTIGNR (IF SC.TAB	/EAG:193

				/ CLEAR)			/EAG:193

VTCHOT	JMS	VTLBUF		/DEPOSITS INCOMING CHAR. INTO LINE BUFFER

VTEMP0	NOP

VTIGNR	LAW			/SUBROUTINE VTLINE RETURNS HERE

	DAC	VTAB12		/SET SWITCH TO NONE ZERO

	LAC	VTEMP0		/RESTORE THE INCOMING CHAR. TO THE AC

VTOFJP	JMP TTYVT2+1

/

	.EJECT

/

/VTRET1 DETERMINES THE CORRECT RETURN TO MAINSTREAM.

/IF OUTPUT TO THE DISPLAY IS NOT COMPLETED IT RETURNS TO THE TTY

/HANDLER OUTPUT INTERRUPT SECTION, THUS IT AVOIDS A WAIT FOR TTY FLAG

/

VTRET1	LAC TTIOSW		/TTIOSW

	SZA			/TEST IF I/O IS UNDERWAY

	JMP	VTINON

	LAC	VTSTOR		/I/O NOT UNDERWAY

	SNA			/TEST FLAG TO DETERMINE IF THIS WAS A .WRITE

	JMP TTYVT4+1

	DZM	VTSTOR		/YES IT WAS .WRITE, CLEAR FLAG

	DAC TTYPTR

	JMP TTYVT4+1		/RETURN TO TTY HANDLER, THEN TO .WRITE RETURN

VTINON	LAC	VTAB12		/I/O UNDERWAY

	SZA!CMA			/TEST IF A CHAR. WAS DISPLAYED

	JMP TTYVT4+1				/NO, NORMAL RETURN

	DAC	VTAB12		/YES, SET FLAG

	JMP TOINT2+1		/RETURN TO OUTPUT INTERRUPT SECTION OF TTY HANDLER

/

/ROUTINE TO SIMULATE A FORM FEED

/GEGERATES LINE FEEDS UNTIL COUNT =56

/

VTFFOT	LAC	VTLBUF		/GET FINAL RETURN ADDRESS

	DAC	VTDMRT		/SAVE IT

	LAC VTM26

	CMA

	TAD	VTCNT1		/DETERMINE NUMBER OF LINE FEEDS TO GENERATE

	DAC	VTFFSW

	LAW	012

VTCRNX	ISZ	VTFFSW

	JMS	VTLBUF

	SKP

	JMP	VTCRNX		/VTLBUF RETURNS HERE, GET ANOTHER LINE FEED

	LAC (014)

	JMP*	VTDMRT

VTDMRT	0

/

	.EJECT

/

/VTLBUF IS A SUBROUTINE WHICH IS CALLED FROM TTYVT3 IN THE TELETYPE HANDLER

/IT STORES THE INCOMING CHAR, ALSO PUT THE CHAR IN THE DISPLAY LINE BUFFER

/IT TEST FOR THE END OF A LINE  AND IF FOUND GOES TO A PACKING ROUTINE.

/WHEN RETURNING TO THE TELETYPE HANDLER IT RESTORES THE INCOMING CHAR TO THE AC

/

VTLBUF	0

	SAD (LAW 30)		/TEST FOR CTRL X FROM EDITVT

	JMP	VTEDCX		/GO SERVICE IT

	AND (177)		/MASK = 177

	DAC	VTEMP0		/STORE THE INCOMING CHAR, LATER RESTORE

	ISZ	VTLBUF

	DZM	VTAB12		/CLEAR FLAG FOR PROPER VTRET1 SUBROUTINE RETURN

	SAD (34)		/TEST FOR A TOP FROM THE EDITOR

	JMP VTTOP		/=LAW 34

	SAD (012)		/TEST FOR LINE FEED

	JMP	VTPCK1		/END OF LINE, PACK IT

VTAB77	SAD (015)

	JMP	VTCROK

	SAD (014)		/TEST FOR FORM FEED

	JMP	VTFFOT

	SAD (175)

	JMP*	VTLBUF

	SNA

	JMP*	VTLBUF

	SAD (36)		/TEST FOR LINE DELETE FROM EDITVT

	JMP VTDELT

VTRBCT	NOP

VTOVFL	SKP			/OVERLAYED WITH A LAC VTEMP0 IF MORE THAN 72 CHAR PER LINE 

	JMP*	VTLBUF

VTPUT	DAC*	VTPT0		/PUT CHAR. IN LINE BUFFER

	ISZ	VTPT0

	ISZ	VTPT1

	LAC*	VTPT0		/MOVE (DJMPI TO LINE BUFFER TOP) DOWN ONE LOCATION

	DAC*	VTPT1

VTLOUT	LAC	VTEMP0		/RESTORE CHAR. TO THE AC

	ISZ	VTCNT0		/INCREMENT CHAR. COUNT

	JMP*	VTLBUF		/RETURN TO TTY HANDLER AT TLS INSTRUCTION+1

	LAC	VTLOUT

	DAC	VTOVFL		/OVERLAY SKP WITH LAC VTEMP0 

	LAC	VTISZ

	DAC	VTRBCT

	JMP	VTOVFL

VTCROK	LAC VTCNT0

	SMA!SZA

	JMP VTRBCT

	LAC VTEMP0

	JMP VTPUT

VTISZ	ISZ	VTCNT2		/COUNTS CHARACTERS PAST 72

	.EJECT

/

/VTCROT IS A ROUTINE TO ECHO A LINE FEED ON THE TELETYPE WHEN A

/CARRIAGE RETURN IS ENCOUNTERED ON TELETYPE INPUT; AND A CARRIAGE

/RETURN GOES TO THE DISPLAY.

/

VTCROT	LAC TTYVT4		/GET CONTENTS OF TTYVT4 = JMS VTRET1, AND SAVE IT

	DAC	VTROTA

	LAC	VTNOP3		/GET A NOP

	DAC TTYVT3		/DEPOSIT IN TTYVT3

	DAC TTYVT4		/DEPOSIT IN TTYVT4

	LAW	012		/SETUP TO ECHO LINE FEED ON TTY

	JMS TTOSVC		/GO TO TTOSVC, TELETYPE OUTPUT ROUTINE

	LAC	VTCHOT		/GET A JMS VTLINE

	DAC TTYVT3		/RESTORE TTY HANDLER LOCATION TTYVT3

	LAC	VTROTA		/GET A JMS VTRET1

	DAC TTYVT4		/RESTORE TTY HANDLER LOCATION TTYVT4

	LAW	015		/GET CODE FOR CARRIAGE RETURN

	JMP	VTCHOT

/

/GO SERVICE A CONTROL X REQUEST FROM EDITVT

/

VTEDCX	JMS	VTFFSW		/REVERSE CTRL X STATE

	JMP*	VTLBUF		/RETURN TO EDITVT

VTTOP	DZM SC.VTR		/ GO INIT DISPLAY		/EAG:193

	JMS VTINIT

	LAC VTEMP0	/RESTORE INCOMMING CHAR. IE 34(8)

	JMP* VTLBUF		/RETURN TO EDITOR

/

/

	.EJECT

/

/VTFPFP IS A ROUTINE TO INTERPRET ^X AND SETUP OR CLEAR NECESSARY REGISTERS

/THE ^X SWITCH IS FIRST REVERSED AND THEN TESTED IF ON OR OFF

/IF ON THREE JMP XXXXX ARE INSERTED IN THE TTY HANDLER AND A SAD (015)

/OVERLAYES JMP* VTTTIN AT VTOTJP, ALSO BACK SLASHES ARE NO LONGER ECHOED ON RUB OUTS

/IF ^X IS OFF NOP'S REPLACE THE JMS'S IN THE TTY HANDLER, A JMP* VTTTIN

/IS DEPOSITED IN VTOTJP AND BACK SLASHES ARE NOW ECHOED ON RUB OUTS

/

VTFPFP	JMS VTFFSW

	LAW 136

	JMP TTIKIL+1

VTFFSW	0

	LAC SC.VTF

	XOR (SC.DMN)						/EAG:193

	DAC SC.VTF

	JMS VTTEST

	CLA!CLL

	JMP* VTFFSW

VTTEST	0			/SETUP TTY HANDLER FOR PRESENT ^X STATE

	LAC SC.VTF

	AND (SC.DMN)						/EAG:193

	SNA							/EAG:193

	JMP	VTCXOF

	JMS	VTINIT		/INITIALIZE DISPLAY BUFFERS IF NECESSARY

	LAC TTYVT2

	IAC

	DAC TTYVT1

	IAC

	DAC TTYVT4

	LAC	VTCHOT

	DAC TTYVT3

	LAC	VTAB77		/SAD (015)

	DAC	VTOTJP

	LAW

	DAC TTIBSL

	JMP* VTTEST						/EAG:193

								/EAG:193

VTCXOF	LAC	VTNOP3		/ROUTINE TO TURN ^X OFF AND REINIT TTY HANDLER

	DAC TTYVT4		/REMOVES NECESSARY JMS'S FROM TTY HANDLER

	DAC TTYVT1

	DAC TTYVT3

	LAC	VTOFJP		/JMP*	VTTTIN

	DAC	VTOTJP

	LAW	134		/CODE FOR BACK SLASH

	DAC TTIBSL

	JMP* VTTEST						/EAG:193

								/EAG:193

	.EJECT

/VT DISPLAY , PACKING ROUTINE 5/7

/INSERTS ALT MODE AFTER PACK FOR ESCAPE

/

VTPCK1	DAC*	VTPT0		/PUT IT IN LINE BUFFER

	ISZ	VTCNT0		/INCREMENT CHAR. COUNTER

	NOP			/ IN CASE VTCNT0 OVERFLOWS	/EAG:193

VTPCK2	RS2+10			/READ THE PUSHBUTTONS

	AND (10000)

	SAD	VTMASK		/PREVIOUS PUSHBUTTON STATUS

	JMP	VTPCK3		/NO PUSHBUTTON HIT

VTSTPD	DZM SC.VTR						/EAG:193

	STPD			/EXTERNAL STOP DISPLAY

	JMS	VTINIT		/RESET THE DISPLAY BUFFER, SCREEN CLEARED

	LAC	VTEMP0

	JMP*	VTLBUF

								/EAG:193								/EAG:193

VTPCK3	LAC	VTCNT1		/(0-55)GET LINE COUNTER

	SAD	VTM26		/TEST FOR 55 LINES

	SKP!CLA

	JMP	VTLNCT

	RS2+10			/READ THE PUSHBUTTONS

	AND (20000)

	SNA			/ TEST IF PUSHBUTTON #5 IS SET	/EAG:193

	JMP VTPCK5		/ NO -- GO ROTATE TEXT		/EAG:193

	LAC TTCTFL		/ YES -- PAGE MODE OPERATION	/EAG:193

	SMA			/ IF CONTROL CHAR. (^C) IN	/EAG:193

	JMP VTSTPD		/ PROGRESS GO CLEAR SCREEN	/EAG:193

	JMP VTPCK2		/ ELSE WAIT FOR PUSHBUTTON #6	/EAG:193

								/EAG:193

								/EAG:193

VTPCK5	JMS	VTROTA		/RESET POINTERS, ROTATE TEXT LINE

VTLNCT	ISZ	VTCNT1		/INCREMENT LINE COUNTER

	LAC	VTMN3		/GET ADDRESS OF LINE BUFFER TOP, AND VTROTA RETURN HERE

	DAC	VTPT0		/SET POINTER 1 LOCATION BEFORE CHAR TO BE PACKED

	LAC (110-1)

	TAD	VTCNT0		/COUNTER 0 -72,  -72 + NUMBER OF CHAR. IN LINE BUFFER

	CMA

	DAC	VTCNT0		/NEG NUMBER OF CHAR. TO BE PACKED

	LAC	VTPT3		/TEST IF BOTTOM OF PACKED BUFFER WILL BE REACHED

	CMA			/GET PRESENT POINTER POSITION AND MAKE NEGATIVE VALUE

	TAD	VTPT4	

	AAC -40

	SMA			/ SKIP IF INSUFFICIENT ROOM	/EAG:193

	JMP VTPCK4

	ISZ* VTPT2		/ SET BIT 17 IN ALT MODE.	/EAG:193

				/ FLAGS LAST LINE OF BUFFER.	/EAG:193

	LAC	VTMN2		/GET POINTER TO BUFFER TOP

	IAC

	DAC	VTPT2		/SET POINTER TO LOC 2 OF BUFFER

	DAC	VTPT3

VTPCK4	LAC	VTPT3		/TEST AVAILABLE BUFFER LOCATIONS

	CMA

	TAD	VTMN1

	SPA

	JMP	VTPCK6

	AAC -40			/ IS THERE ROOM FOR 75 CHARACTERS

	SMA			/SKIP IF NO THERE IS NOT ROOM

	JMP	VTPCK6

	JMS	VTROTA		/DELETE OLDEST LINE IF INSUFFICIENT ROOM

VTNOP3	NOP

	JMP	VTPCK4		/1 LINE DELETED, TEST AVAILABLE ROOM AGAIN

	.EJECT

/

/CONTINUATION OF PACKING ROUTINE, THIS SECTION EMPTIES THE

/DISPLAY LINE BUFFER AND ROTATES THE CHARACTERS, THEN PACKS THEM.

/

VTPCK6	DZM	VTBOT1		/CLEAR 0-5 PACKING COUNTER

	ISZ	VTPT3

	ISZ	VTPT0

	LAC*	VTPT0		/GET FIRST CHAR.

	CLL!RTL

	SWHA

	JMS	VTDOIT		/PACK CHAR 1

	CLL!RTL

	RTL

	TAD*	VTPT3

	JMS	VTDOIT		/PACK CHAR 2

	AND (170)

	CLL!RTR

	RAR

	TAD*	VTPT3

	DAC*	VTPT3		/PACK 4 BITS OF CHAR 3

	LAC*	VTPT0

	AND (7)

	CLL!RTR

	RTR

	ISZ	VTPT3

	JMS	VTDOIT		/PACK 3 BITS OF CHAR 3

	CLL!SWHA

	RAR

	TAD*	VTPT3

	JMS	VTDOIT		/PACK CHAR 4

	CLL!RAL

	TAD*	VTPT3

	DAC*	VTPT3		/PACK CHAR 5

	ISZ	VTBOT1

	ISZ	VTCNT0

	JMP	VTPCK6		/PACK NEXT 5/7 PAIR

	JMP	VTPOUT		/LAST CHAR PACKED, EXIT

								/EAG:193

	.EJECT

VTDOIT	0

	DAC*	VTPT3		/PUT SHIFTED CHAR. IN PACKED BUFFER

	ISZ	VTBOT1		/INCREMENT 0-5 COUNTER

	ISZ	VTCNT0		/SKIP WHEN NO CHAR. LEFT IN LINE BUFFER

VTSKP3	SKP			/DO NOT ALTER THIS LOCATION, CALLED FROM OTHER PARTS OF VT HANDLER

	JMP	VTPOUT

	ISZ	VTPT0		/MOVE POINTER TO NEXT CHAR. IN LINE BUFFER

	LAC*	VTPT0		/GET THE NEXT CHARACTER

	JMP*	VTDOIT		/RETURN AND HANDLE NEXT CHAR.

	.EJECT

/

/EXIT ROUTINES USED BY PACKER, RESETTING OF BOTH LINE BUFFER AND

/PACKED BUFFER TAKES PLACE HERE, AND COUNTERS AND REGISTERS RESET.

/

/

/

VTPOUT	LAC	VTBOT1		/DETERMINES WHERE ALT MODE IS TO BE PUT FOR ESCAPE FUNCTION

	AAC -3

	SMA

	JMP	VTNX2

VTNX1	ISZ	VTPT3

	LAC (372)		/GET THE ALT MODE

	DAC*	VTPT3

	JMP	VTLSET

VTNX2	ISZ	VTPT3

	DZM*	VTPT3		/CLEAR FIRST WORD OF WORD PAIR

	JMP	VTNX1

VTLSET	JMS	VTPTST		/GO TO SUBROUTINE TO RESET LINE BUFFER POINTERS

	CLA!IAC			/ SET AC=1			/EAG:193

	DAC*	VTPT2		/CLEAR THE ALT MODE AND SET BIT 17

	LAC VTPT6

	DAC VTPT7

	LAC VTPT2

	DAC VTPT6

	LAC	VTPT3

	DAC	VTPT2

	LAC	VTSKP3		/RESET SKP IN VTLINE ROUTINE

	DAC	VTOVFL

	LAC	VTNOP3

	DAC VTRBCT

	DZM	VTCNT2

	JMP	VTLOUT

VTDELT	LAC	VTCNT1		/DON'T DELETE A LINE

	SNA

	JMP	VTDEL1

	LAC (372)

	DAC* VTPT6

	LAC VTPT6

	DAC VTPT2

	DAC VTPT3

	LAC VTPT7

	DAC VTPT6

	LAW -1

	TAD VTCNT1

	DAC VTCNT1

VTDEL1	LAC VTEMP0

	JMP* VTLBUF

	.EJECT

/

/ROUTINES USED TO ROTATE TEXT, MOVE POINTERS FROM BUFFER BOTTOM

/AND SEARCH FOR LINE FEEDS FOR LINE DELETIONS

/

VTROTA	0			/SEARCH PACKED BUFFER TO GET TEXT ROTATION OFF SCREEN

	CLA!IAC

	TAD	VTMN1		/ADD POINTER TO TOP OF SCREEN, DISPLAY BUFFER

	DAC	VTPT5		/STOTE POINTER TO WORD 2 OF FIRST WORD PAIR BEING DISPLAYED

VTGETI	LAC*	VTPT5		/TEST IF BIT 17 IS SET, INDICATES END OF LINE

	CLL!RAR			/PUT BIT 17 INTO LINK

	SZL

	JMP	VTGOTI		/IF LINK SET, END OF LINE FOUND

	ISZ	VTPT5		/THIS PAIR WAS NOT END OF LINE

	ISZ	VTPT5		/LOOK AT NEXT WORD PAIR

	JMP	VTGETI

VTGOTI	SAD (372/2)		/ TEST IF LAST LINE BEFORE END	/EAG:193

	JMS	VTBOT1		/THIS IS LAST LINE, RESET BUFFER POINTERS

	ISZ	VTPT5		/MOVE POINTER TO LOCATION 1 PAST END OF LINE PAIR

	LAC	VTPT5

	DAC	VTMN1		/SET NEW MAIN FILE DISPATCH ADDRESS

	ISZ	VTROTA		/BUMP THE RETURN ADDRESS

	JMP*	VTROTA

/

VTBOT1	0			/THIS ROUTINE RESETS POINTERS WHEN BOTTOM LINE PASSED

	LAC	VTMN2		/GET ADDRESS OF BUFFER TOP

	DAC	VTPT5		/SET POINTER TO BUFFER TOP

	ISZ	VTPT5		/MOVE POINTER TO LOCATION 2 OF BUFFER

	LAC (372)

	DAC*	VTPT5		/PUT ALT MODE IN LOC 2 OF BUFFER

	JMP*	VTBOT1

/

	.EJECT

/

/VTINIT IS A SUBROUTINE WHICH FIRST TESTS IF A SETUP IS NECESSARY

/IF NECESSARY IT PICKS UP THE POINTER WHICH ALLOCATES CORE AREA FOR THE 

/DISPLAY BUFFERS. A LINE BUFFER AND A PACKING BUFFER ARE THEN SET UP WITH THE 

/THE NECESSARY PARAMETERS INSERTED IN THEM.

/

/

VTINIT	0			/THIS ROUTINE INITIALIZES ALL DISPLAY BUFFERS

	LAC SC.VTR		/ TEST IF SETUP IS NEEDED	/EAG:193

	SZA							/EAG:193

	JMP*	VTINIT

	LAC VTMN3		/ GET ADDRESS OF BUFFER		/EAG:193

	DAC	VTPT0		/POINTS TO TOP OF LINE BUFFER

	AAC 2

	DAC	VTPT1		/POINTS TO LOC 3 OF LINE BUFFER

	AAC 113			/ RESERVES 72+3 LOCATIONS FOR LINE BUFF

	DAC	VTPT2		/POINTS TO TOP OF 5/7 BUFFER

	DAC	VTMN2		/INSERT ADDRESS OF 5/7 BUFFER IN DISPATCH LOCATION

	AAC 2

	DAC	VTMN1		/POINTS TO SECONDARY ENTRY TO 5/7 BUFFER

	DAC	VTPT3

	ISZ	VTPT3

	LAC	VTPT0		/GET LINE BUFFER ADDRESS

	TAD (DJMPI)

	DAC*	VTPT1

	ISZ	VTPT0

	DAC*	VTPT0

	DZM*	VTPT2

	ISZ	VTPT2

	LAC (372)

	DAC*	VTPT2

	ISZ	VTPT2

	DZM*	VTPT2		/CLEAR LOCATION 3 OF PACKING BUFFER

	ISZ	VTPT2

	DAC*	VTPT2		/DEPOSIT ALT MODE IN LOCATION 4

	LAW	-110		/-72

	DAC	VTCNT0

	DZM	VTCNT1		/CLEAR LINE COUNTER

	LAC VTMFIL		/ GET DJMP VTMAIN		/EAG:193

	AND (17777)						/EAG:193

	DAC SC.VTR		/ PUT DISPLAY RESTART ADDR.	/EAG:193

				/ INTO SC.VTR			/EAG:193

	LSD			/ AND START THE DISPLAY		/EAG:193

	RS2+10

	AND (10000)

	DAC	VTMASK

	LAC SC.VTF

	AND (SC.HFN)						/EAG:193

	SNA!CLA							/EAG:193

	LAC (VT.FUL-VT.HAF)					/EAG:193

	TAD (VT.HAF-120)					/EAG:193

	TAD	VTPT2

	DAC	VTPT4		/SET POINTER TO BUFFER BOTTOM

	JMP*	VTINIT

								/EAG:193

	.EJECT

/

/SPECIAL ROUTINES TO HANDLE SPECIAL INCOMING CHARACTERS

/

VTCUOT	JMS	VTPTST		/SET UP LINE BUFFER POINTERS

	ISZ	VTCNT0

	LAC (25)

	JMP TTYVT2+1

/

/

VTBKUP	LAW	-1		/ROUTINE TO HANDLE A RUB OUT 

	TAD	VTCNT2		/FIRST TEST IF GREATER THAN 72 CHAR. HAVE BEEN TYPED

	SPA

	JMP	.+3

	DAC	VTCNT2

	JMP	VTBUOT

	LAC	VTSKP3

	DAC	VTOVFL

	LAC	VTNOP3

	DAC	VTRBCT

	LAW	-1		/TEST IF ANY CHAR ARE IN THIS LINE

	TAD	VTPT0

	SAD	VTMN3

	JMP	VTBUOT

	DAC	VTPT0

	DAC	VTPT1

	ISZ	VTPT1

	LAC*	VTPT1

	DAC*	VTPT0

	LAW	-1

	TAD	VTCNT0

	DAC	VTCNT0

VTBUOT	LAC (177)

	JMP TTYVT2+1

/

/

VTPTST	0			/SUBROUTINE TO RESET LINE BUFFER POINTERS

	LAC	VTMN3		/GET POINTER TO LINE BUFFER TOP

	DAC	VTPT0

	ISZ	VTPT0		/MOVE POINTER TO LOC 2 OF LINE BUFFER

	LAC*	VTPT1		/GET DJMP TO LINE BUFFER TOP

	DAC*	VTPT0

	LAC	VTPT0

	DAC	VTPT1

	ISZ	VTPT1		/MOVE POINTER TO LOC 3 OF LINE BUFFER

	LAC*	VTPT0

	DAC*	VTPT1

	LAW	-111

	DAC	VTCNT0		/SET CHAR COUNT TO -73

	JMP*	VTPTST

	.EJECT

/

/DISPLAY MAIN FILE TO DISPATCH CHARACTER DISPLAY

/

/SYMBOL DEFINITIONS

/

OSETF=210002

ROTOF=210040

BKOF=211000

LPOF=210010

EGOFF=210200

CHALT=214000

INCROF=200020

DINT7=203600

/

PX=144000

PY=140000

DJMP=600000

DJMPI=620000

DJMSI=660000

CHARSI=060000

SYNC=236000

								/EAG:193

	.EJECT							/EAG:193

/

/ABSOLUTE SECTION OF CONTROL X HANDLER

VTABS=.

VTAB12	-1		/FLAG USED BY LINKING SUBROUTINES

VTSTOR	0		/STORES THE USERS RETURN ADDRESS

VTPT5	0		/GENERAL PURPOSE POINTER FOR BUFFER MANIPULATION AND SEARCHES

								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ MAIN DISPLAY FILE.						/EAG:193

/								/EAG:193

/ INSTRUCTIONS VTMREL THROUGH VTMFIL (INCLUSIVE) ARE SEPERATELY	/EAG:193

/ RELOCATED BY IN.VT.  THEY CANNOT BE HANDLED ALONG WITH THE	/EAG:193

/ BULK OF THE RELOCATABLE CODE BECAUSE THEY ARE DISPLAY		/EAG:193

/ INSTRUCTIONS RATHER THAN CPU INSTRUCTIONS, AND THUS IN.MOV	/EAG:193

/ DOESN'T KNOW HOW TO HANDLE THEM.				/EAG:193

/								/EAG:193

								/EAG:193

VTMAIN	OSETF!ROTOF!BKOF!LPOF!CHALT!EGOFF			/EAG:193

	INCROF!DINT7						/EAG:193

	PX!0							/EAG:193

	PY!1762							/EAG:197

	SYNC							/EAG:193

VTMREL	CHARSI VTMN1-VTMAIN	/ IN.VT WILL ADD THE ADDRESS	/EAG:193

	CHARSI VTMN2-VTMAIN	/ OF VTMAIN TO EACH OF THESE.	/EAG:193

	DJMSI VTMN3-VTMAIN					/EAG:193

VTMFIL	DJMP VTMAIN-VTMAIN					/EAG:193

								/EAG:193

								/EAG:193

	.LTORG							/EAG:193

								/EAG:193

	.EJECT							/EAG:193

/								/EAG:193

/ ALL VARIABLES FOLLOWING THIS POINT ARE COPIED (BY IN.VT)	/EAG:193

/ FROM THE "OLD" CTRL-X CODE TO THE "NEW" CTRL-X CODE EVERY	/EAG:193

/ TIME THE MONITOR IS RELOADED (REINITIALIZED).  THIS INCLUDES	/EAG:193

/ THE CONTENTS OF THE DISPLAY BUFFER.  THE POSITIONING		/EAG:193

/ OF VARIABLES BEFORE OR AFTER THIS POINT SHOULD NOT BE		/EAG:193

/ CHANGED, UNLESS IN.VT IS ALSO CHANGED APPROPRIATELY.		/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

VTCOPY=.							/EAG:193

								/EAG:193

VTPT6	0

VTPT7	0

VTM26	0

VTMASK	0			/ STORES CURRENT STATE OF PB #6	/EAG:193

								/EAG:193

/								/EAG:193

/ LINE BUFFER FORMAT:  THE LINE BUFFER CONSISTS OF A TOTAL	/EAG:193

/ OF 77 WORDS.  THE FIRST WORD IS THE DJMS ENTRY POINT,		/EAG:193

/ AND THUS STORES THE RETURN ADDRESS.  FOLLOWING THIS ARE	/EAG:193

/ THE CHARACTERS IN THE LINE, ONE CHARACTER PER WORD.		/EAG:193

/ ZERO THROUGH SEVENTY-TWO (INCLUSIVE, DECIMAL) PRINTING	/EAG:193

/ CHARACTERS PLUS AN OPTIONAL CARRAIGE RETURN AND A LINE FEED	/EAG:193

/ ARE PERMITTED.  FOLLOWING THE LAST CHARACTER ARE TWO WORDS	/EAG:193

/ EACH CONTAINING A DJMPI THROUGH THE FIRST WORD OF THE		/EAG:193

/ LINE BUFFER -- I.E., A RETURN.  ANY WORDS LEFT OVER (TO	/EAG:193

/ THE TOTAL OF 77) ARE UNUSED.					/EAG:193

/								/EAG:193

/ POINTERS AND OTHER WORDS WHICH REFER TO THE LINE BUFFER	/EAG:193

/ ARE AS FOLLOWS:						/EAG:193

								/EAG:193

VTMN3	-1			/ POINTS TO THE FIRST WORD	/EAG:193

				/ OF THE LINE BUFFER -- I.E.,	/EAG:193

				/ THE DJMS ENTRY POINT		/EAG:193

								/EAG:193

VTPT0	-1			/ POINTS TO THE WORD FOLLOWING	/EAG:193

				/ THE LAST CHARACTER IN THE	/EAG:193

				/ LINE BUFFER.  I.E., POINTS	/EAG:193

				/ TO THE FIRST DJMPI MENTIONED	/EAG:193

				/ ABOVE.			/EAG:193

								/EAG:193

VTPT1	-1			/ POINTS ONE WORD AFTER VTPT0.	/EAG:193

				/ THUS, POINTS TO THE SECOND	/EAG:193

				/ DJMPI MENTIONED ABOVE.	/EAG:193

								/EAG:193

VTCNT0	0			/ CONTAINS A COUNT OF THE	/EAG:193

				/ NUMBER OF CHARACTERS IN	/EAG:193

				/ THE LINE BUFFER.  STARTS	/EAG:193

				/ AT -72.  WHEN THIS COUNTER	/EAG:193

				/ OVERFLOWS SUBSEQUENT CHAR.'S	/EAG:193

				/ ARE IGNORED.			/EAG:193

								/EAG:193

VTCNT2	0			/ CONTAINS A COUNT OF THE	/EAG:193

				/ NUMBER OF CHARACTERS IGNORED	/EAG:193

				/ DUE TO VTCNT0 HAVING		/EAG:193

				/ OVERFLOWED.			/EAG:193

								/EAG:193

/ END OF LINE BUFFER FORMAT DESCRIPTION				/EAG:193

/								/EAG:193

								/EAG:193

								/EAG:193

/								/EAG:193

/ 5/7 BUFFER FORMAT:  THE 5/7 BUFFER OCCUPIES ALL REMAINING	/EAG:193

/ BUFFER SPACE.  IT IS A CIRCULAR (RING) BUFFER OF ENTRIES,	/EAG:193

/ EACH ENTRY BEING SOME PRIOR CONTENTS OF THE LINE BUFFER	/EAG:193

/ PACKED INTO 5/7 ASCII FORM.  THERE IS A ONE-TO-ONE		/EAG:193

/ CORRESPONDENCE BETWEEN SUCH PACKED LINES AND LINE FEEDS.	/EAG:193

/ LINE FEEDS ARE THE TERMINATING CHARACTER.  THUS IT IS A LINE	/EAG:193

/ FEED WHICH CAUSES THE CONTENTS OF THE LINE BUFFER TO BE	/EAG:193

/ PACKED INTO THE 5/7 BUFFER, AND THE LINE FEED IS INCLUDED	/EAG:193

/ IN THE NEWLY PACKED LINE.  IN ADDITION TO EVERY LINE IN THE	/EAG:193

/ 5/7 BUFFER ENDING IN A LINE FEED, BIT 17 OF THE SECOND WORD	/EAG:193

/ OF A 5/7 ASCII DOUBLE WORD IS USED TO FLAG THE END OF A LINE.	/EAG:193

/ 								/EAG:193

/ THE NORMAL STATE OF AFFAIRS IS AS FOLLOWS.  THE FIRST TWO	/EAG:193

/ WORDS OF THE 5/7 BUFFER CONTAIN A ZERO AND A ONE,		/EAG:193

/ RESPECTIVELY.  THIS DOUBLE WORD REPRESENTS 5 NULLS AND	/EAG:193

/ A DUMMY LINE.  FOLLOWING THIS DUMMY LINE IS SOME ARBITRARY	/EAG:193

/ NUMBER OF LINES, EACH PADDED OUT TO AN INTEGRAL NUMBER OF	/EAG:193

/ DOUBLE WORDS AND WITH THE LAST WORD OF EACH LINE CONTAINING	/EAG:193

/ ONE (NOTE THAT THIS LAST WORD CONTAINS NO CHARACTERS, AND	/EAG:193

/ THAT ADDITIONAL PADDING MAY BE NEEDED TO ACCOMPLISH THIS).	/EAG:193

/ THE LAST WORD OF THE LAST LINE IS AN EXCEPTION TO THIS	/EAG:193

/ RULE.  THE PADDING IS THE SAME, BUT THE LAST WORD OF THE	/EAG:193

/ LAST LINE CONTAINS NOT ONE BUT INSTEAD AN ALT MODE IN THE	/EAG:193

/ LAST CHARACTER POSITION.  THE TWO POINTERS VTPT2 AND VTPT3	/EAG:193

/ POINT TO THIS WORD.  FOLLOWING THIS IS SOME AMOUNT OF UNUSED	/EAG:193

/ SPACE AND THEN ANOTHER SEQUENCE OF LINES.  REMEMBERING THAT	/EAG:193

/ THIS IS A CIRCULAR BUFFER, IT SHOULD BE POINTED OUT THAT	/EAG:193

/ THESE LINES ARE THE "FIRST" LINES IN THE BUFFER.  POINTER	/EAG:193

/ VTMN1 POINTS TO THE FIRST OF THESE LINES.  AS BEFORE, EACH	/EAG:193

/ LINE IS TERMINATED WITH A WORD CONTAINING EXACTLY ONE.  ALSO	/EAG:193

/ AS BEFORE, THE VERY LAST LINE IS AN EXCEPTION.  IT CONTAINS	/EAG:193

/ AN ALT MODE IN THE LAST CHARACTER POSITION AND IT ALSO HAS	/EAG:193

/ THE LOW ORDER BIT SET.  FOLLOWING THIS IS SOME NUMBER OF	/EAG:193

/ UNUSED WORDS TO THE END OF THE BUFFER.  VTPT4 POINTS JUST	/EAG:193

/ PAST THE END OF THE BUFFER.					/EAG:193

/								/EAG:193

/ THERE IS ANOTHER STATE THE BUFFER TAKES TEMPORARILY AS	/EAG:193

/ IT WRAPS AROUND ITS END.  THE SECOND WORD IN THE BUFFER	/EAG:193

/ CONTAINS AN ALT MODE (IN THE LAST CHARACTER POSITION)		/EAG:193

/ INSTEAD OF A ONE.  A SINGLE SEQUENCE OF LINES BEGINS IN	/EAG:193

/ THE THIRD WORD, WHICH VTMN1 POINTS TO.  THE LINES ARE		/EAG:193

/ STORED EXACTLY AS BEFORE.  THE LAST WORD OF THE LAST LINE	/EAG:193

/ CONTAINS AN ALTMODE IN THE LOW CHARACTER POSITION.  VTPT2	/EAG:193

/ AND VTPT3 POINT TO THIS WORD.  THE WORDS FOLLOWING THIS ONE	/EAG:193

/ UP TO THE END OF THE BUFFER ARE UNUSED.			/EAG:193

/								/EAG:193

/ THE POINTERS AND WORDS WHICH REFER TO THE 5/7 BUFFER		/EAG:193

/ ARE DESCRIBED BELOW:						/EAG:193

								/EAG:193

VTMN2	-1			/ POINTS TO FIRST WORD OF	/EAG:193

				/ 5/7 BUFFER			/EAG:193

								/EAG:193

VTMN1	-1			/ POINTS TO FIRST LINE IN	/EAG:193

				/ BUFFER WHEN VIEWED AS RING.	/EAG:193

				/ POINTS TO SECOND SEQUENCE	/EAG:193

				/ OF LINES AS LAID OUT		/EAG:193

				/ PHYSICALLY.			/EAG:193

								/EAG:193

VTPT2	-1			/ POINTS TO WORD PRECEEDING	/EAG:193

				/ PRECEEDING PLACE WHERE WE	/EAG:193

				/ SHOULD INSERT NEXT LINE.	/EAG:193

								/EAG:193

VTPT3	-1			/ A SECOND COPY OF VTPT2	/EAG:193

								/EAG:193

VTPT4	-1			/ POINTS JUST PAST END OF	/EAG:193

				/ BUFFER			/EAG:193

								/EAG:193

VTCNT1	0			/ COUNT OF NUMBER OF LINES	/EAG:193

				/ IN BUFFER			/EAG:193

								/EAG:193

/ END OF 5/7 BUFFER DESCRIPTION					/EAG:193

/								/EAG:193

								/EAG:193

VTBUF=.				/ DEFINE SPACE OCCUPIED BY	/EAG:193

				/ DISPLAY BUFFERS		/EAG:193

VTEND=VTBUF+VT.FUL						/EAG:193
