Google
 

Trailing-Edge - PDP-10 Archives - KS10_APT_INSTALL_TAPE - uetp/lib/cmlbcf.mac
There is 1 other file named cmlbcf.mac in the archive. Click here to see a list.
;<MITCHEL>CMLBCF.MAC.14, 24-Feb-78 10:48:41, EDIT BY EIBEN
;	ADDED TEST FOR 2060 IN SYSTES
	TITLE	CONMEM	RECONFIGURE MEMORY
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CONMEM

	;ROUTINE TO RECONFIGURE MEMORY. ENTER WITH DESIRED NUMBER
	;OF PAGES IN T2. IF ZERO - NO CHANGES MADE BUT JUST REPORTED.
	;RETURN NON-SKIP IF FAILED, OR SKIP IF OK.

CONMEM:	PUSH	P,T2		;SAVE REQUEST
	HRROI	T2,[ASCIZ /CURRENT /]
	call	STGOUT##	;START OFF
REPCOR:	call	SETPNT	;SET UP POINTERS
	SETZB	A,C		;NOTHING YET
CONMM1:	call	CHKPAG	;LOOK AT PAGE
	 TLNE	A,777777	;ILLEGAL-STILL IN MONITOR?
	TLOA	A,777777	;FOUND GOOD PAGES
	AOS	A		;COUNT MONITOR PAGES
	IDPB	T5,B		;SAVE VALUE
	SKIPN	T5		;AVAILABLE?
	AOS	C		;COUNT IT
	CAIN	T5,.MCPSO	;JUST OFFLINE?
	ADD	C,[1,,0]	;COUNT IT
	AOBJN	D,CONMM1	;DO ALL
	MOVEI	OUTP,.PRIOU	;REPORT IT
	HRROI	T2,[ASCIZ /CONFIGURATION HAS /]
	call	STGOUT##	;TELL HIM
	HRRZ	T2,C		;GET ON LINE PAGES
	MOVX	T3,<^D10>	;TELL HIM
	call	NUMOUT##	;FOR INTEREST
	HRROI	T2,[ASCIZ / ON-LINE PAGES AND /]
	call	STGOUT##	;TELL ALL
	HLRZ	T2,C		;AND
	MOVX	T3,<^D10>	;OFF-LINE
	call	NUMOUT##	;FOR INTEREST
	HRROI	T2,[ASCIZ / OFF-LINE PAGES.
MONITOR OCCUPIES /]
	call	STGOUT##	;TELL HIM ALL
	HRRZ	T2,A		;GET IT
	MOVX	T3,<^D10>	;DECIMAL
	call	NUMOUT##	;DO IT
	HRROI	T2,[ASCIZ / PAGES
/]
	call	STGOUT##	;TELL HIM
	POP	P,T2		;RESTORE REQUEST
	JUMPL	T2,CPOPJ1##	;DO NOTHING
	JUMPE	T2,ALLCOR	;DO ALL
	HRRZS	A		;GET SIZE OF MONITOR
	SUB	T2,A		;GET DESIRED NUMBER OF USER PAGES
	SKIPLE	T2		;IMPOSSIBLE
	CAIG	T2,^D64		;LEAVE AT LEAST THIS MUCH
CORERR:	ERROR	CPOPJ,<UNABLE TO SET CORE TO REQUIREMENTS>
	HRRZ	T3,C		;GET TOTAL IN USE
	HLRZ	T4,C		;AND OUT OF USE
	ADD	T3,T4		;GET TOTAL
	CAMLE	T2,T3		;TOO MUCH?
	JRST	CORERR		;BAD
	SKIPA	C,T2		;COPY COUNT
ALLCOR:	MOVX	C,MAXCOR	;SET UP ALL
	call	SETPNT	;RESET POINTERS
CONMM2:	ILDB	T1,B		;GET ENTRY
	JUMPE	T1,CONMM3	;OK
	CAIE	T1,.MCPSE	;CAN WE USE IT?
	JRST	CONMM4		;NO
	JUMPLE	C,CONMM4	;FOUND ENOUGH
	MOVX	T5,<.MCPSA>	;USE IT
	call	SETPAG	;TURN IT ON
	 JRST	CONMM4		;COULD NOT
CONMM5:	SOS	C		;COUNT DOWN
CONMM4:	AOBJN	D,CONMM2	;DO ALL
	PUSH	P,[-1]		;FUDGE 2
	HRROI	T2,[ASCIZ /NEW /]
	PJRST	REPCOR		;GO REPORT IT

CONMM3:	JUMPG	C,CONMM5	;KEEP IT
	MOVX	T5,<.MCPSE>	;OFF LINE IT
	call	SETPAG	;DO IT
	 JFCL
	JRST	CONMM4		;OK

	;HERE ON ILLEGAL PAGE

ILLPAG:	TLNN	A,777777	;MONITOR OR NXM?
	AOS	A		;MONITOR
	SETOM	T5		;MARK ILLEGAL
	ret			;OK

	;SET UP POINTERS

SETPNT:	MOVNI	D,MAXCOR	;MAKE POINTER
	HRLZS	D		;OF ALL KNOWN PAGES
	MOVE	B,[440300,,PAGTAB##] ;MAKE A BYTE POINTER TO TABLE
	ret			;OK

	;TEST PAGE. RETURN WITH STATUS IN T5

CHKPAG:	MOVX	T1,.MCRPS	;LOOK AT EXISTING PAGES
	MOVX	T2,.MCPST+1	;LENGTH OF ARG BLOCK
	MOVX	T3,T4		;START HERE
	HRRZ	T4,D		;GET PAGE NUMBER
	PMCTL			;GET IT
	ERJMP	CHKPG1		;BAD
	PJRST	CPOPJ1##	;OK
CHKPG1:	SETOM	T5		;MARK AS BAD
	ret			;OK

	;SET PAGE. ENTER WITH STATUS IN T5.

SETPAG:	MOVX	T1,.MCSPS	;SET IT
	MOVX	T2,.MCPST+1	;LENGTH
	MOVX	T3,T4		;WHERE IT IS
	HRRZ	T4,D		;GET PAGE
	PMCTL			;DO IT
	ERJMP	CPOPJ##		;BAD
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	CASHON	TURN ON THE CACHE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CASHON

	;ROUTINE TO TURN ON THE CACHE. MUST BE PRIVILEDGED!
	;RETURN SKIP IF OK. NON-SKIP OTHERWISE.

CASHON:	call	SYSTES##	;TEST SYSTEM
	CAIE	T1,4		;2040?
	ERROR	CPOPJ##,<SYSTEM IS NOT A 2040!!>
	MOVX	T1,.MCSCE	;SET STATUS OF CACHE
	MOVEI	T2,1		;LENGTH OF BLOCK
	MOVEI	T3,T4		;ADDRESS OF ARG BLOCK
	MOVX	T4,<MC%CEN>	;TURN ON CACHE
	PMCTL			;GO DO IT
	ERJMP	CSHFAL		;FAILED
	AOS	(P)		;GIVE SKIP RETURN
	PJRST	REPCNF##	;AND REPORT CHANGES

CSHFAL:	ERROR	CPOPJ##,<FAILED TO ENABLE CACHE>

	PRGEND
	TITLE	CASHOF	TURN OFF CACHE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CASHOF

	;ROUTINE TO TURN OFF CACHE MEMORY. MUST BE PRIVILEDGED.
	;RETURN SKIP IF OK, NON-SKIP FOR ERROR

CASHOF:	call	SYSTES##	;TEST SYSTEM
	CAIE	T1,5		;2050?
	ERROR	CPOPJ##,<SYSTEM IS NOT A 2050!!>
	MOVX	T1,<.MCSCE>	;SET CACHE
	MOVEI	T2,1		;LENGTH OF ARG BLOCK
	MOVEI	T3,T4		;ADDRESS OF ARG BLOCK
	SETZM	T4		;DISABLE CACHE
	PMCTL			;DO IT
	ERJMP	CSHFAL		;COULD NOT
	AOS	(P)		;GIVE SKIP RETURN
	PJRST	REPCNF##	;REPORT CONFIGURATION

CSHFAL:	ERROR	CPOPJ##,<COULD NOT TURN OFF CACHE>

	PRGEND
	TITLE	REPCNF	TELL THE WORLD ABOUT OUR CONFIGURATION.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	REPCNF

	;ROUTINE TO TELL ALL USERS ABOUT OUR CONFIGURATION. CALL
	;WITH PUSHJ. RETURN +1 ALWAYS HAVING TRIED TO TELL THE
	;WORLD ABOUT CACHE AND MEMORY.

REPCNF:	call	NUMJBS##	;GET NUMBER OF JOBS
	MOVEI	D,-1(T1)	;SAVE IT
	PUSH	P,OUTP		;SAVE OUTPUT JFN
REPCN1:	HRRZ	T1,D		;GET JOB NUMBER
	MOVE	T2,[-1,,T4]	;GET INFO IN T4
	MOVX	T3,.JITNO	;GET TERMINAL NUMBER
	GETJI			;GET IT
	 JRST	REPCN2		;CANNOT
	SKIPGE	OUTP,T4		;GET TTY NUMBER
	JRST	REPCN2		;DETACHED
	TXO	OUTP,400000	;MAKE DESIGNATOR
	call	REPCRC##	;TYPE CONFIGURATION
REPCN2:	SOJGE	D,REPCN1	;DO ALL
	POP	P,OUTP		;RESTORE JFN
	ret			;OK

	PRGEND
	TITLE	REPCRC	REPORT STATUS OF CORE AND CACHE.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	REPCRC

	;ROUTINE TO REPORT STATUS OF CORE AND CACHE. ENTER WITH
	;DESTINATION DESIGNATOR IN OUTP. RETURN +1 ALWAYS.

REPCRC:	MOVEI	T2,7		;SEND A BELL
	call	CHROUT##	;RING HIS CHIMES
	HRROI	T2,[ASCIZ /
[MESSAGE FROM SYSTEM: CURRENT CONFIGURATION IS A /]
	call	STGOUT##	;TELL HIM
	call	TSTMEM##	;GET SIZE
	ASH	T1,-1		;GET K
	MOVE	T2,T1		;POSITION IT
	MOVX	T3,<^D10>	;DECIMAL
	call	NUMOUT##	;TELL HIM
	HRROI	T2,[ASCIZ /K 20/]
	call	STGOUT##	;AND MORE
	call	SYSTES##	;TEST CACHE
	MOVEI	T2,60(T1)	;MAKE ASCIZ
	call	CHROUT##	;PRINT IT
	HRROI	T2,[ASCIZ /0]
/]
	PJRST	STGOUT##	;TELL HIM

	PRGEND
	TITLE	SYSTES	TEST FOR SYSTEM WE ARE ON
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	SYSTES


	LM2050==^D12		;TEST TIME FOR 2050
	LM2040==^D14		;TEST TIME FOR 2040
	LM2020==^D40		;TEST TIME FOR 2020

	;ROUTINE TO TEST SYSTEM TYPE. RETURN +1 ALWAYS WITH 
	;RESULT IN T1. 2=2020, 4=2040, 5=2050 , 6=2060.
	;result of cache-test in T2 ( byte-pointer )

;	2040/2050	test by sojg-loop
;	2020		test if serial above 4096 (decimal)
;	model A or B	test by special jrst

SYSTES:	call	TBAPID##	;GET SERIAL NUMBER
	CAIL	T1,^D4096	;2020?
	JRST	TS2020		;YES
SYSTS1:	MOVX	T1,.FHSLF	;TRY AN EXPERIMENT
	RUNTM			;GET OUR RUNTIME
	PUSH	P,T1		;SAVE IT
	MOVEI	T1,^D10000	;NOW LOOP UP
	SOJG	T1,.		;LOOP UP
	MOVX	T1,.FHSLF	;SO LET US SEE
	RUNTM			;GET RUNTIME
	POP	P,T2		;GET OLD TIME
	SUB	T1,T2		;GET INCREMENT
	CAIGE	T1,LM2050	;TEST IT WITH THRESHOLDS
	JRST	TS2050		;2050
	CAIGE	T1,LM2040	;AGAIN
	JRST	TS2040		;2040
	JRST	SYSTS1		;TRY AGAIN

sysmod:	jrst t5,[10000,,0
	sysmo1]
	erjmp .+1
	tdza t1,t1
sysmo1:	seto t1,
	skipe t1
	ret			;system  is model B
	cpopj##			;system is model A
	
TS2050:	hrroi	T2,[ASCIZ /    ON /]
	call sysmod		;find out if model a or b
	skipa t1, [ 0 ,, 6 ]	;model B
	movei t1,5		;model A
	ret


TS2040:	hrroi t2,[asciz /   none/]
	call sysmod		;find out if model A or model B
	jfcl			;what is name of "2060" w/o cache ???
	movei t1,4		;model A
	ret			;

TS2020:	hrroi t2,[asciz /   ON /]
	MOVEI	T1,2		;RETURN 2
	ret			;RETURN

	PRGEND
	TITLE	TSTMEM	TEST STATUS OF MEMORY
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TSTMEM

	;ROUTINE TO TEST MEMORY CONFIGURATION. RETURN WITH
	;PHYSICAL CORE IN PAGES IN T1 AND AVAILABLE USER CORE
	;IN PAGES IN T2.

TSTMEM:	call	TBNCPG##	;GET NUMBER OF USER PAGES
	MOVE	T2,T1		;MOVE IT
	ADDI	T1,^D40		;MONITOR IS AT LEAST THIS SIZE
	ADDI	T1,^D64		;IN MODULES OF 32K
	TRZ	T1,77		;ROUND DOWN
	ret	

	PRGEND
	TITLE	L1MOT	PRINT 1 MINUTE LOAD AVERAGE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	L1MOT

	;ROUTINE TO PRINT 1 MINUTE LOAD AVERAGE.

L1MOT:	HRLI	T1,14		;GET INDEX INTO TABLE
	PJRST	LODPNT##	;PRINT IT

	PRGEND
	TITLE	L5MOT	PRINT 5 MINUTE LOAD AVERAGE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	L5MOT

	;ROUTINE TO PRINT 5 MINUTE LOAD AVERAGE

L5MOT:	HRLI	T1,15		;GET INDEX INTO TABLE
	PJRST	LODPNT##	;PRINT IT

	PRGEND
	TITLE	L15MOT	PRINT 15 MINUTE LOAD AVERAGE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	L15MOT

	;ROUTINE TO PRINT 15 MINUTE LOAD AVERAGE

L15MOT:	HRLI	T1,16		;GET INDEX INTO TABLE
	PJRST	LODPNT##	;PRINT IT

	PRGEND
	TITLE	LODPNT	PRINT LOAD AVERAGES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	LODPNT

	;ROUTINE TO PRINT LOAD AVERAGES. ENTER WITH INDEX
	;INTO "SYSTAT"	TABLE IN LEFT HALF OF T1.

LODPNT:	PUSH	P,T1		;COPY IT
	call	TBSTAT##	;GET TABLE NUMBER
	POP	P,T1		;GET INDEX BACK
	HRR	T1,T2		;GET TABLE NUMBER
	call	JGETAB##	;GET IT
	MOVE	T2,T1		;COPY IT
	MOVX	T3,<FL%ONE+FL%PNT+FLD(3,FL%FST)+FLD(3,FL%SND)>
	PJRST	FNUMOT##	;PRINT IT

	PRGEND
	TITLE	MTASTS	PRINT AVAILABILITY OF MAGTAPES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	MTASTS

	;ROUTINE TO PRINT AVAILABILITY OF MAGTAPES. ENTER WITH
	;NUMBER OF MAGTAPE UNIT IN T1. ROUTINE PRINTS "FREE"
	;IF FREE, "NT/A" IF NOT AVAILABLE, OR THE JOB NUMBER
	;USING IT OTHERWISE.

MTASTS:	HRLI	T1,600002	;MAKE DEVICE NUMBER
	DVCHR			;GET CHARACTERISTICS
	 ERJMP	MTANA		;NOT AVAILABLE
	JUMPGE	T3,MTFREE	;FREE?
	SKIPA	T2,[-1,,[ASCIZ /FREE/]]
MTANA:	HRROI	T2,[ASCIZ .NT/A.]
	PJRST	STGOUT##	;PRINT IT

MTFREE:	HLRZ	T2,T3		;GET OWNING JOB NUMBER
	JUMPE	T2,MTANA	;NOT AVAILABLE
	PJRST	DIG3SP##	;PRINT IT

	PRGEND
	TITLE	UPTSTS	PRINT SYSTEM UPTIME
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	UPTSTS

	;ROUTINE TO PRINT SYSTEM UPTIME.

UPTSTS:	TIME			;GET UPTIME
	IDIV	T1,T2		;MAKE SECONDS
	IDIVI	T1,^D60		;MAKE MINUTES
	IDIVI	T1,^D60		;GET HOURS
	PUSH	P,T2		;SAVE REMAINDER
	MOVE	T2,T1		;COPY IT
	call	DIG3OT##	;PRINT IT
	call	COLOUT##	;PRINT COLON
	POP	P,T2		;GET REMAINDER
	PJRST	MINSOT##	;PRINT IT

	PRGEND
	TITLE	DSKSTS	PRINT TOTAL STORAGE AVAILABLE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DSKSTS

	;ROUTINE TO PRINT TOTAL DISK STORAGE AVAILABLE ON
	;A STRUCTURE ON THE SYSTEM. ENTER WITH T1 CONTAINING
	;THE STRUCTURE NUMBER.

DSKSTS:	PUSH	P,T1		;SAVE STRUCTURE NUMBER
	MOVE	T2,T1		;COPY IT
	HRROI	T1,SPACE##	;WRITE NAME TO CORE FIRST
	DEVST			;WRITE IT
	 HRROI	T1,SPACE##	;RESET BYTE POINTER
	MOVEI	T4,":"		;END ON COLON
	IDPB	T4,T1		;FOR NEATNESS
	MOVEI	T3,^D11		;MAX CHARS TO WRITE
	HRROI	T2,SPACE##	;POINT TO IT
	call	JSOUT##	;DO IT
	 MOVEI	T3,^D11		;ERROR
	POP	P,T1		;RESTORE STRUCTURE DESIGNATOR
	GDSKC			;GET SPACE LEFT
	HRLZS	T3		;POSITION FOR NUMBER OF COLUMNS
	IORX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	EXEMON	EXECUTE MONITOR ROUTINE IN MONITOR ADDRESS SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	EXEMON

	;ROUTINE TO LOCK ROUTINE IN MONITOR ADDRESS SPACE AND
	;EXECUTE IT. ENTER WITH T1 POINTING TO ADDRESS OF ROUTINE,
	;RELATIVE TO ADDRESS "EXEADR".
	;MONITOR IS PATCHED TO EXECUTE ROUTINE AT INTERRUPT LEVEL.

EXEMON:	PUSH	P,T1		;SAVE ARGS
	call	RELMEM	;RELEASE ANY LOCKED MEMORY
	POP	P,T1		;RESTORE ARGS
	HRLI	T1,P1		;MAKE INDEX
	MOVEM	T1,EXEADR+EXEDSP ;SAVE DISPATCH ADDRESS
	MOVEI	T3,EXECOM	;GET START ADDRESS OF COMMON ROUTINE
	LSH	T3,-^D9		;GET PAGE ADDRESS
	MOVEI	T2,EXEEND	;GET UPPER LIMIT FOR ROUTINES
	LSH	T2,-^D9		;FOR LOCKING ROUTINE
	SUBI	T2,-1(T3)	;GET NUMBER OF PAGES
	HRRZS	T2		;ONLY
	MOVEI	T1,.SNPLC	;SNOOP JSYS ARG
	SNOOP			;GO ON
	 ERROR	CPOPJ##,<CANNOT LOCK ROUTINE>
	MOVEM	T2,EXEMPG	;SAVE ADDRESSES
	SETZM	EXEADR+EXEFLG	;NOTHING HAPPENED YET
	MOVE	T2,PTCHLC	;SYMBOL TO MODIFY
	MOVE	T3,PTCHNM	;IN WHICH PART OF MONITOR
	MOVEI	T1,.SNPSY	;GET ITS VALUE
	SNOOP			;TRY
	 ERROR	RELMEM,<CANNOT TRANSLATE SYMBOL>
	MOVE	T3,T2		;COPY ADDRESS
	ADD	T3,PTCHOF	;ADD IN OFFSET,IF ANY!!
	MOVEI	T2,1		;BREAKPOINT 1
	MOVEI	T1,.SNPDB	;DEFINE BREAKPOINT
	MOVSI	T4,(PUSHJ P,)	;BUILD INTRUCTION
	HRRI	T4,EXECOM	;POINT TO COMMON ROUTINE
	HRRZ	T5,EXEMPG	;GET MONITOR PAGE NUMBER
	DPB	T5,[111100,,T4]	;REPLACE PAGE NUMBER
	SNOOP			;SET BREAKPOINT
	 ERROR	RELMEM,<CANNOT DEFINE BREAKPOINT>
	MOVEI	T1,.SNPIB	;INSERT BREAKPOINT
	SNOOP			;DO IT
	 ERROR	RELMEM,<CANNOT INSERT BREAKPOINT>
EXELP1:	MOVEI	T1,10		;SLEEP FOR A WHILE
	DISMS			;TO ALLOW IT TO HAPPEN
	SKIPN	EXEADR+EXEFLG	;FLAG SET YET?
	JRST	EXELP1		;NO
	HRROI	T1,[ASCIZ /
[ROUTINE EXECUTED]
/]
	PSOUT			;TELL HIM
	call	RELMEM	;UNSET EVERYTHING
	JRST	CPOPJ1##	;SKIP RETURN

PAGE
	;ROUTINES TO BE EXECUTED BY MONITOR AT INTERRUPT
	;LEVEL. ROUTINES ARE ALLOWED TO USE ACS 1,2,3,4.
	;THE ROUTINES WILL BE EXECUTED DURING THE INTERRUPT CYCLE
	;OF TOPS-20. THEY MUST BE WRITTEN TO BE RELOCATABLE
	;INDEXING VIA AC "P1".

	;THIS IS THE COMMON ROUTINE TO CALL THE MONITOR
	;ROUTINES. IT IS CALLED FROM MONITOR AND DISPATCHES
	;TO THE REQUESTED ROUTINE.

EXEMPG:	BLOCK	1		;SPACE TO SAVE ABSOLUTE ADDRESS
PTCHLC:	RADIX50	0,ENSKED	;SYMBOL TO PATCH
PTCHNM:	RADIX50	0,SCHED		;IN MONITOR ROUTINE
PTCHOF:	EXP 10			;OFFSET FROM SYMBOL!!!

EXECOM:	PUSH	P,P1		;SAVE AN AC
	MOVSI	P1,(POPJ P,)	;MAKE A POPJ
	PUSH	P,P1		;SAVE IT ON THE STACK
	call	(P)		;CALL DUMMY ROUTINE

	;"P1" WILL POINT TO EXEADR SO ALL CODE FROM NOW ON
	;IS RELOCATABLE.

EXEADR:
	PHASE	0

	MOVE	P1,1(P)		;NOW WE HAVE THE ADDRESS OF EXEADR
	POP	P,(P)		;TIDY UP THE STACK
	PUSH	P,T1		;SAVE T1
	PUSH	P,T2		;AND T2
	PUSH	P,T3		;AND T3
	PUSH	P,T4		;AND T4
	SKIPN	EXEFLG(P1)	;ALREADY BEEN HERE?
	call	@EXEDSP(P1)	;NO--EXECUTE ROUTINE
	SETOM	EXEFLG(P1)	;SET FLAG
	POP	P,T4		;RESTORE T4
	POP	P,T3		;RESTORE T3
	POP	P,T2		;RESTORE T2
	POP	P,T1		;RESTORE T1
	POP	P,P1		;RESTORE P1
	ret			;RETURN TO MONITOR

EXEFLG:	BLOCK	1		;-1 WHEN ROUTINE EXECUTED
EXEDSP:	BLOCK	1		;ADDRESS OF ROUTINE TO EXECUTE

PAGE
	;ANY ROUTINES TO BE EXECUTED MUST BE INSERTED BEFORE
	;THIS POINT.

EXEEND==EXEADR+.
	DEPHASE

	;ROUTINE TO RELEASE LOCKED PAGES WHICH MAY HAVE BEEN LOCKED
	;USING THE "SNOOP" JSYS.

RELMEM:	MOVEI	T1,.SNPUL	;RELEASE ALL
	SNOOP
	 JFCL			;FORGET IT
	ret			;OK

	PRGEND
	TITLE	SYSGET	ROUTINE TO EVALUATE INCREMENTS AND SUMMARY
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	SYSGET,SYSGT1

	;ROUTINE TO EVALUATE INCREMENTS AND A SUMMARY. ENTER WITH
	;"A" POINTING TO A BLOCK OF 3 WORDS AND WITH THE TABLE
	;NUMBER OF THE "SYSTAT" TABLE IN THE LEFT HALF OF T1.
	;THE ROUTINE GET THE NEW INFORMATION, SAVES ITS VALUE IN
	;OFFSET "SOFAR" OR THE 3-WORD BLOCK; SAVES THE INCREMENT SINCE
	;LAST TIME IN OFFSET "INCRMT" AND THE INCREMENT IS ALSO
	;ADDED TO OFFSET "SUMM" SO THAT A PERIODIC SUMMARY CAN BE
	;PRODUCED. ENTER AT SYSGT1 IF TABLE NUMBERS ALREADY
	;SET UP.

SYSGET:	PUSH	P,T1		;SAVE OFFSET
	call	TBSTAT##	;GET TABLE NUMBER
	POP	P,T1		;RESTORE OFFSET
	HRR	T1,T2		;MAKE TABLE NUMBER
SYSGT1:	call	JGETAB##	;GET ENTRY
	MOVE	B,T1		;COPY IT
	SUB	B,SOFAR(A)	;GET INCREMENT
	MOVEM	B,INCRMT(A)	;SAVE IT
	MOVEM	T1,SOFAR(A)	;UPDATE SOFAR COUNT
	ADDM	B,SUMM(A)	;AND SUMMARY
	ret			;OK


	PRGEND
	TITLE	NUMTTY	GET NUMBER OF SUPPORTED TTYS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMTTY

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF TTYS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF TTYS IN T1.

NUMTTY:	call	TBPPAR##	;GET ENTRY
	MOVEI	T1,-1(T1)	;NUMBER OF TTYS
	ret			;OK

	PRGEND
	TITLE	NUMPTY	GET NUMBER OF SUPPORTED PTYS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMPTY

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF PTYS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF PTYS IN T1.

NUMPTY:	call	TBPPAR##	;GET FIRST ENTRY
	HLRZS	T1		;NUMBER OF PTYS
	ret			;OK

	PRGEND
	TITLE	NUMDSK	GET NUMBER OF SUPPORTED DSKS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMDSK

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF DSKS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF DSKS IN T1.

NUMDSK:	MOVEI	T1,3		;CHEAT
	ret			;OK

	PRGEND
	TITLE	NUMDCH	GET NUMBER OF SUPPORTED DSK CHANS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMDCH

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF DSK CHANS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF DSK CHANS IN T1.

NUMDCH:	MOVEI	T1,2
	ret			;OK

	PRGEND
	TITLE	NUMMTA	GET NUMBER OF SUPPORTED MTAS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMMTA

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF MTAS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF MTAS IN T1.

NUMMTA:	MOVEI	T1,2		;CHEAT
	ret			;OK

	PRGEND
	TITLE	NUMMCH	GET NUMBER OF SUPPORTED MTA CHANS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMMCH

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF MTA CHANS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF MTA CHANS IN T1.

NUMMCH:	MOVEI	T1,1		;CHEAT
	ret			;OK

	PRGEND
	TITLE	NUMLPT	GET NUMBER OF SUPPORTED LPTS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMLPT

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF LPTS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF LPTS IN T1.

NUMLPT:	MOVEI	T1,1		;CHEAT
	ret			;OK

	PRGEND
	TITLE	NUMCDR	GET NUMBER OF SUPPORTED CDRS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMCDR

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF CDRS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF CDRS IN T1.

NUMCDR:	MOVEI	T1,1		;CHEAT
	ret			;OK

	PRGEND
	TITLE	NUMJBS	GET NUMBER OF SUPPORTED JOBS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	NUMJBS

	;ROUTINE TO USE MONITOR TABLES TO GET THE NUMBER OF JOBS
	;SUPPORTED ON THE SYSTEM. RETURN IS +1 ALWAYS WITH THE
	;NUMBER OF JOBS IN T1.

NUMJBS:	call	TBJBRT##	;GET FIRST ENTRY
	HLRE	T1,T2		;GET COUNT OF JOBS
	MOVMS	T1		;MAKE POSITIVE
	ret			;OK

	PRGEND
	TITLE	VERGET	GET MONITOR VERSION ETC.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	VERGET

	;ROUTINE TO GET MONITOR VERSION AND NAME, ETC.
	;ENTER WITH "D" POINTING TO PLACE TO STORE RESULTING STRING.
	;RETURNS +1 ALWAYS WITH MONITOR NAME AND VERSION.

VERGET:	call	TBSVER##	;GET COUNT OF WORDS
	HLL	D,T2		;GET COUNT OF WORDS
	MOVEM	T1,(D)		;SAVE FIRST WORD
	MOVEI	T3,1		;POINTER TO WORD
VERLP1:	AOBJP	D,VERLP2	;ALL DONE
	MOVE	T1,SVER%T##+1	;GET TABLE NUMBER
	HRL	T1,T3		;GET NEXT WORD
	call	JGETAB##	;GET IT
	MOVEM	T1,(D)		;SAVE IT
	AOS	T3		;POINT TO NEXT WORD
	JRST	VERLP1		;LOOP UP
VERLP2:	SETZM	(D)		;MAKE ASCIZ
	ret	

	PRGEND
	TITLE	TBJTTY	GET TABLE NUMBER FOR TABLE "JOBTTY"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBJTTY

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "JOBTTY". CHECKS
	;LOCATION "JTTY%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBJTTY:	SKIPE	T1,JTTY%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNJTTY		;YES
	MOVE	T1,[SIXBIT /JOBTTY/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,JTTY%T##	;SAVE FOUND VALUE
	MOVEM	T2,JTTY%T##+1	;BOTH OF THEM
	ret			;OK

KNJTTY:	MOVE	T2,JTTY%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBJBRT	GET TABLE NUMBER FOR TABLE "JOBRT"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBJBRT

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "JOBRT". CHECKS
	;LOCATION "JBRT%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBJBRT:	SKIPE	T1,JBRT%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNJBRT		;YES
	MOVE	T1,[SIXBIT /JOBRT/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,JBRT%T##	;SAVE FOUND VALUE
	MOVEM	T2,JBRT%T##+1	;BOTH OF THEM
	ret			;OK

KNJBRT:	MOVE	T2,JBRT%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBTJOB	GET TABLE NUMBER FOR TABLE "TTYJOB"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBTJOB

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "TTYJOB". CHECKS
	;LOCATION "TJOB%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBTJOB:	SKIPE	T1,TJOB%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNTJOB		;YES
	MOVE	T1,[SIXBIT /TTYJOB/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,TJOB%T##	;SAVE FOUND VALUE
	MOVEM	T2,TJOB%T##+1	;BOTH OF THEM
	ret			;OK

KNTJOB:	MOVE	T2,TJOB%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBTICK	GET TABLE NUMBER FOR TABLE "TICKPS"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBTICK

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "TICKPS". CHECKS
	;LOCATION "TICK%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBTICK:	SKIPE	T1,TICK%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNTICK		;YES
	MOVE	T1,[SIXBIT /TICKPS/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,TICK%T##	;SAVE FOUND VALUE
	MOVEM	T2,TICK%T##+1	;BOTH OF THEM
	ret			;OK

KNTICK:	MOVE	T2,TICK%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBNCPG	GET TABLE NUMBER FOR TABLE "NCPGS"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM
	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBNCPG
	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "NCPGS". CHECKS
	;LOCATION "NCPG%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBNCPG:	SKIPE	T1,NCPG%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNNCPG		;YES
	MOVE	T1,[SIXBIT /NCPGS/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,NCPG%T##	;SAVE FOUND VALUE
	MOVEM	T2,NCPG%T##+1	;BOTH OF THEM
	ret			;OK

KNNCPG:	MOVE	T2,NCPG%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDNAM	GET TABLE NUMBER FOR TABLE "DEVNAM"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDNAM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DEVNAM". CHECKS
	;LOCATION "DNAM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDNAM:	SKIPE	T1,DNAM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDNAM		;YES
	MOVE	T1,[SIXBIT /DEVNAM/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DNAM%T##	;SAVE FOUND VALUE
	MOVEM	T2,DNAM%T##+1	;BOTH OF THEM
	ret			;OK

KNDNAM:	MOVE	T2,DNAM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDCHR	GET TABLE NUMBER FOR TABLE "DEVCHR"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDCHR

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DEVCHR". CHECKS
	;LOCATION "DCHR%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDCHR:	SKIPE	T1,DCHR%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDCHR		;YES
	MOVE	T1,[SIXBIT /DEVCHR/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DCHR%T##	;SAVE FOUND VALUE
	MOVEM	T2,DCHR%T##+1	;BOTH OF THEM
	ret			;OK

KNDCHR:	MOVE	T2,DCHR%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDUNT	GET TABLE NUMBER FOR TABLE "DEVUNT"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDUNT

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DEVUNT". CHECKS
	;LOCATION "DUNT%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDUNT:	SKIPE	T1,DUNT%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDUNT		;YES
	MOVE	T1,[SIXBIT /DEVUNT/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DUNT%T##	;SAVE FOUND VALUE
	MOVEM	T2,DUNT%T##+1	;BOTH OF THEM
	ret			;OK

KNDUNT:	MOVE	T2,DUNT%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDSER	GET TABLE NUMBER FOR TABLE "DSKERR"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDSER

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DSKERR". CHECKS
	;LOCATION "DSER%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDSER:	SKIPE	T1,DSER%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDSER		;YES
	MOVE	T1,[SIXBIT /DSKERR/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DSER%T##	;SAVE FOUND VALUE
	MOVEM	T2,DSER%T##+1	;BOTH OF THEM
	ret			;OK

KNDSER:	MOVE	T2,DSER%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDMER	GET TABLE NUMBER FOR TABLE "DRMERR"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDMER

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DRMERR". CHECKS
	;LOCATION "DMER%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDMER:	SKIPE	T1,DMER%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDMER		;YES
	MOVE	T1,[SIXBIT /DRMERR/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DMER%T##	;SAVE FOUND VALUE
	MOVEM	T2,DMER%T##+1	;BOTH OF THEM
	ret			;OK

KNDMER:	MOVE	T2,DMER%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSVER	GET TABLE NUMBER FOR TABLE "SYSVER"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSVER

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SYSVER". CHECKS
	;LOCATION "SVER%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSVER:	SKIPE	T1,SVER%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSVER		;YES
	MOVE	T1,[SIXBIT /SYSVER/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SVER%T##	;SAVE FOUND VALUE
	MOVEM	T2,SVER%T##+1	;BOTH OF THEM
	ret			;OK

KNSVER:	MOVE	T2,SVER%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSTAT	GET TABLE NUMBER FOR TABLE "SYSTAT"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSTAT

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SYSTAT". CHECKS
	;LOCATION "STAT%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSTAT:	SKIPE	T1,STAT%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSTAT		;YES
	MOVE	T1,[SIXBIT /SYSTAT/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,STAT%T##	;SAVE FOUND VALUE
	MOVEM	T2,STAT%T##+1	;BOTH OF THEM
	ret			;OK

KNSTAT:	MOVE	T2,STAT%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBQTIM	GET TABLE NUMBER FOR TABLE "QTIMES"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBQTIM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "QTIMES". CHECKS
	;LOCATION "QTIM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBQTIM:	SKIPE	T1,QTIM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNQTIM		;YES
	MOVE	T1,[SIXBIT /QTIMES/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,QTIM%T##	;SAVE FOUND VALUE
	MOVEM	T2,QTIM%T##+1	;BOTH OF THEM
	ret			;OK

KNQTIM:	MOVE	T2,QTIM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBJNAM	GET TABLE NUMBER FOR TABLE "JOBNAM"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBJNAM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "JOBNAM". CHECKS
	;LOCATION "JNAM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBJNAM:	SKIPE	T1,JNAM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNJNAM		;YES
	MOVE	T1,[SIXBIT /JOBNAM/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,JNAM%T##	;SAVE FOUND VALUE
	MOVEM	T2,JNAM%T##+1	;BOTH OF THEM
	ret			;OK

KNJNAM:	MOVE	T2,JNAM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBJPNM	GET TABLE NUMBER FOR TABLE "JOBPNM"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBJPNM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "JOBPNM". CHECKS
	;LOCATION "JPNM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBJPNM:	SKIPE	T1,JPNM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNJPNM		;YES
	MOVE	T1,[SIXBIT /JOBPNM/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,JPNM%T##	;SAVE FOUND VALUE
	MOVEM	T2,JPNM%T##+1	;BOTH OF THEM
	ret			;OK

KNJPNM:	MOVE	T2,JPNM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSNAM	GET TABLE NUMBER FOR TABLE "SNAMES"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSNAM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SNAMES". CHECKS
	;LOCATION "SNAM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSNAM:	SKIPE	T1,SNAM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSNAM		;YES
	MOVE	T1,[SIXBIT /SNAMES/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SNAM%T##	;SAVE FOUND VALUE
	MOVEM	T2,SNAM%T##+1	;BOTH OF THEM
	ret			;OK

KNSNAM:	MOVE	T2,SNAM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSTIM	GET TABLE NUMBER FOR TABLE "STIMES"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSTIM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "STIMES". CHECKS
	;LOCATION "STIM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSTIM:	SKIPE	T1,STIM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSTIM		;YES
	MOVE	T1,[SIXBIT /STIMES/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,STIM%T##	;SAVE FOUND VALUE
	MOVEM	T2,STIM%T##+1	;BOTH OF THEM
	ret			;OK

KNSTIM:	MOVE	T2,STIM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSFLT	GET TABLE NUMBER FOR TABLE "SPFLTS"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSFLT

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SPFLTS". CHECKS
	;LOCATION "SFLT%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSFLT:	SKIPE	T1,SFLT%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSFLT		;YES
	MOVE	T1,[SIXBIT /SPFLTS/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SFLT%T##	;SAVE FOUND VALUE
	MOVEM	T2,SFLT%T##+1	;BOTH OF THEM
	ret			;OK

KNSFLT:	MOVE	T2,SFLT%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSSIZ	GET TABLE NUMBER FOR TABLE "SSIZE"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSSIZ

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SSIZE". CHECKS
	;LOCATION "SSIZ%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSSIZ:	SKIPE	T1,SSIZ%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSSIZ		;YES
	MOVE	T1,[SIXBIT /SSIZE/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SSIZ%T##	;SAVE FOUND VALUE
	MOVEM	T2,SSIZ%T##+1	;BOTH OF THEM
	ret			;OK

KNSSIZ:	MOVE	T2,SSIZ%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSBLK	GET TABLE NUMBER FOR TABLE "SNBLKS"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSBLK

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SNBLKS". CHECKS
	;LOCATION "SBLK%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSBLK:	SKIPE	T1,SBLK%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSBLK		;YES
	MOVE	T1,[SIXBIT /SNBLKS/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SBLK%T##	;SAVE FOUND VALUE
	MOVEM	T2,SBLK%T##+1	;BOTH OF THEM
	ret			;OK

KNSBLK:	MOVE	T2,SBLK%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDBGS	GET TABLE NUMBER FOR TABLE "DBUGSW"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDBGS

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DBUGSW". CHECKS
	;LOCATION "DBGS%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDBGS:	SKIPE	T1,DBGS%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDBGS		;YES
	MOVE	T1,[SIXBIT /DBUGSW/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DBGS%T##	;SAVE FOUND VALUE
	MOVEM	T2,DBGS%T##+1	;BOTH OF THEM
	ret			;OK

KNDBGS:	MOVE	T2,DBGS%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBLDES	GET TABLE NUMBER FOR TABLE "LOGDES"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBLDES

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "LOGDES". CHECKS
	;LOCATION "LDES%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBLDES:	SKIPE	T1,LDES%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNLDES		;YES
	MOVE	T1,[SIXBIT /LOGDES/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,LDES%T##	;SAVE FOUND VALUE
	MOVEM	T2,LDES%T##+1	;BOTH OF THEM
	ret			;OK

KNLDES:	MOVE	T2,LDES%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBPPAR	GET TABLE NUMBER FOR TABLE "PTYPAR"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBPPAR

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "PTYPAR". CHECKS
	;LOCATION "PPAR%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBPPAR:	SKIPE	T1,PPAR%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNPPAR		;YES
	MOVE	T1,[SIXBIT /PTYPAR/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,PPAR%T##	;SAVE FOUND VALUE
	MOVEM	T2,PPAR%T##+1	;BOTH OF THEM
	ret			;OK

KNPPAR:	MOVE	T2,PPAR%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBSMTB	GET TABLE NUMBER FOR TABLE "SYMTAB"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBSMTB

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "SYMTAB". CHECKS
	;LOCATION "SMTB%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBSMTB:	SKIPE	T1,SMTB%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNSMTB		;YES
	MOVE	T1,[SIXBIT /SYMTAB/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,SMTB%T##	;SAVE FOUND VALUE
	MOVEM	T2,SMTB%T##+1	;BOTH OF THEM
	ret			;OK

KNSMTB:	MOVE	T2,SMTB%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBDNTM	GET TABLE NUMBER FOR TABLE "DWNTIM"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBDNTM

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "DWNTIM". CHECKS
	;LOCATION "DNTM%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBDNTM:	SKIPE	T1,DNTM%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNDNTM		;YES
	MOVE	T1,[SIXBIT /DWNTIM/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,DNTM%T##	;SAVE FOUND VALUE
	MOVEM	T2,DNTM%T##+1	;BOTH OF THEM
	ret			;OK

KNDNTM:	MOVE	T2,DNTM%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBBDTD	GET TABLE NUMBER FOR TABLE "BLDTD"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBBDTD

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "BLDTD". CHECKS
	;LOCATION "BDTD%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBBDTD:	SKIPE	T1,BDTD%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNBDTD		;YES
	MOVE	T1,[SIXBIT /BLDTD/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,BDTD%T##	;SAVE FOUND VALUE
	MOVEM	T2,BDTD%T##+1	;BOTH OF THEM
	ret			;OK

KNBDTD:	MOVE	T2,BDTD%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBAPID	GET TABLE NUMBER FOR TABLE "APRID"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBAPID

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "APRID". CHECKS
	;LOCATION "APID%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBAPID:	SKIPE	T1,APID%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNAPID		;YES
	MOVE	T1,[SIXBIT /APRID/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,APID%T##	;SAVE FOUND VALUE
	MOVEM	T2,APID%T##+1	;BOTH OF THEM
	ret			;OK

KNAPID:	MOVE	T2,APID%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBHQLV	GET TABLE NUMBER FOR TABLE "HQLAV"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBHQLV

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "HQLAV". CHECKS
	;LOCATION "HQLV%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBHQLV:	SKIPE	T1,HQLV%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNHQLV		;YES
	MOVE	T1,[SIXBIT /HQLAV/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,HQLV%T##	;SAVE FOUND VALUE
	MOVEM	T2,HQLV%T##+1	;BOTH OF THEM
	ret			;OK

KNHQLV:	MOVE	T2,HQLV%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	TBLQLV	GET TABLE NUMBER FOR TABLE "LQLAV"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TBLQLV

	;ROUTINE TO GET TABLE NUMBER ETC. FOR TABLE "LQLAV". CHECKS
	;LOCATION "LQLV%T" FOR NON-ZERO. IF ZERO IT PERFORMS THE
	;"SYSGT" JSYS TO GET VALUES. OTHERWISE IT USES PREVIOUSLY
	;FOUND VALUES. RETURN +1 ALWAYS WITH WORD 0 IN T1
	;AND NEGATIVE LENGTH IN L.H. OF T2 AND TABLE NUMBER IN
	;R.H. OF T2.

TBLQLV:	SKIPE	T1,LQLV%T##	;DO WE KNOW ABOUT IT YET?
	JRST	KNLQLV		;YES
	MOVE	T1,[SIXBIT /LQLAV/] ;NO-SO FIND OUT
	SYSGT			;GET INFO
	MOVEM	T1,LQLV%T##	;SAVE FOUND VALUE
	MOVEM	T2,LQLV%T##+1	;BOTH OF THEM
	ret			;OK

KNLQLV:	MOVE	T2,LQLV%T##+1	;GET VALUE
	ret			;OK

	PRGEND
	TITLE	USENOT	PRINT USERNAME FOR JOB
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	USENOT

	;ROUTINE TO PRINT USERNAME ASSOCIATED WITH A JOB. ENTER WITH
	;THE JOB NUMBER IN T1. RETURN +1 ALWAYS. OUTPUT IS TO
	;FILE WITH JFN IN "OUTP"

USENOT:	MOVE	T2,[XWD -1,T4]	;WHAT WE WANT AND WHERE TO PUT IT
	MOVX	T3,.JIUNO	;WHERE HE IS LOGGED IN
	GETJI			;GET THE INFO
	 SETZM	T4		;ERROR
	MOVE	T2,T4		;COPY IT
	MOVE	T1,OUTP		;GET JFN FOR OUTPUT
	DIRST			;DO IT
	 ret			;ERROR
	MOVE	OUTP,T1		;RESAVE STRING POINTER
	ret			;RETURN

	PRGEND
	END