	.TITLE	THE DOS-15 SYSTEM LOADER PROPER
/
/COPYRIGHT (C) 1975
/DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
	.EJECT
/
/EDIT #50 	9-10-71
/	051	SK	7-NOV-73	$INSTRUCT PROGRAM LOAD MOD
/	052	SK
/	053	SK
/EDIT #054  17-AUG-75	KENT BLACKETT  ADD CODE NECESSARY FOR XVM BATCHING
/EDIT #055	20-AUG-75	M. HEBENSTREIT	DISCLAIMER
/EDIT #056  27-AUG-75	KENT BLACKETT  REMOVE X4K AND PDP-9 CODE
/					IN GENERAL, TIGHTEN UP THE CODE
/					IN PREPERATION FOR ADDING
/					MULTIPLE FLAVORS OF HANDLER CHECK.
/EDIT #057  27-SEP-75	GARTH REID	ADDED CHECK FOR MULTIPLE FLAVORS OF 
/					HANDLERS.  ALSO, FIXED PROBLEM WHICH
/					PREVENTED TYPE-OUT OF .SYSLD ERROR
/					MESSAGES.
/								/EAG:058
/ 058	2-OCT-75	EAG	INCORPORATE THE "SYSTEM LOADER	/EAG:058
/				INTERFACE" FROM RESMON INTO	/EAG:058
/				THIS ASSEMBLY.  ALL CODE UP TO	/EAG:058
/				LABEL .SYSLD IS FROM RESMON.	/EAG:058
/								/EAG:059
/ 059	8-OCT-75	EAG	ALTER BDEVT SO THAT DEVICE	/EAG:059
/				TABLE BUILT FOR PIP WILL	/EAG:059
/				CONTAIN ZERO (NON) FOR ALL	/EAG:059
/				DEVICES ALREADY SET UP.  THIS	/EAG:059
/				ONLY AFFECTS THE CMD AND TTA	/EAG:059
/				DEVICES, AS THEY ARE SET UP BY	/EAG:059
/				RESMON.  ALL OTHER DEVICES ARE	/EAG:059
/				SET UP HERE IN THE SYSTEM LDR.	/EAG:059
/								/EAG:060
/ 060	9-OCT-75	EAG	CORRECT THE DEFINITIONS OF	/EAG:060
/				 SOME ERRONEOUSLY DEFINED	/EAG:060
/				.SCOM LOCATIONS.		/EAG:060
/
/EDIT #061  04-NOV-75	KENT BLACKETT	MAKE THE .SYSLD 9 ERROR
/					NON-FATAL, AND CHANGE THE
/					MESSAGE OUTPUT TO INCLUDE
/					THE OFFENDING DEVICE CODE.
/								
/EDIT #062  06-NOV-75	KENT BLACKETT	CHANGE ARRANGEMENT OF BATCH-
/					RELATED .SCOM LOCATIONS.
/					AND THE CONTENTS OF SC.BDEV
/					IS NOW THE MNEMONIC, NOT
/					THE NUMBER.
/								
/EDIT #063  10-NOV-75	KENT BLACKETT	PERFORM TRANSLATION OF
/					SY* BATCH DEVICE TO PROPER
/					MNEMONIC.
/
/
/ COPYRIGHT 1971 DIGITAL EQUIPMENT CORP.,MAYNARD, MASS.
/
/
/
	.ABS
	.LOC	7500
.MED=3
.SCOM=100				/ABSOLUTE REFERENCES
SCOM20=.SCOM+20
SC.BFN=.SCOM+106
SC.BUIC=.SCOM+111
SC.BDEV=.SCOM+112
SC.BUNT=.SCOM+113
SC.BLN=.SCOM+27							/EAG:058
SC.BCH=1							/EAG:060
SC.BNM=.SCOM+26							/EAG:058
SC.BOS=.SCOM+52							/EAG:058
SC.BTB=.SCOM+30							/EAG:058
SC.COD=.SCOM+0							/EAG:058
SC.DAT=.SCOM+23							/EAG:058
SC.FNM=.SCOM+7							/EAG:058
SC.FRL=.SCOM+2							/EAG:058
SC.MOD=.SCOM+4							/EAG:058
SC.NMF=.SCOM+42							/EAG:058
SC.NMN=.SCOM+45							/EAG:060
SC.NRM=40000							/EAG:058
SC.OTB=.SCOM+31							/EAG:058
SC.RMS=.SCOM+1							/EAG:058
SC.SLT=.SCOM+24							/EAG:058
SC.SPN=.SCOM+43							/EAG:058
SC.SST=.SCOM+5							/EAG:058
SC.UST=.SCOM+6							/EAG:058
								/EAG:058
								/EAG:058
SG.BAS=17100							/EAG:058
SG.FRE=SG.BAS+0							/EAG:058
SG.NMP=SG.BAS+1							/EAG:058
SG.NMD=SG.BAS+2							/EAG:058
SG.NMS=SG.BAS+3							/EAG:058
SG.SYS=SG.BAS+4							/EAG:058
SG.BNM=SG.BAS+10						/EAG:058
								/EAG:058
SB.BAS=16100							/EAG:058
CB.TOP=SB.BAS+777						/EAG:058
								/EAG:058
DBA=707762
EBA=707764
IDX=ISZ
	.EJECT
/ SET UP APPROPRIATE VARIABLES SO THAT FOLLOWING CODE		/EAG:058
/ STOLEN FROM RESMON CAN FUNCTION.				/EAG:058
								/EAG:058
IN	LAC* (SC.DAT)		/ SET UP POINTERS TO .DAT SLOTS	/EAG:058
	IAC							/EAG:058
	DAC DAT1						/EAG:058
	AAC -5							/EAG:058
	DAC DATM4						/EAG:058
	LAC* (SC.COD)		/ SET UP BANK BITS		/EAG:058
	AND (60000)						/EAG:058
	DAC BANKBT						/EAG:058
	XOR (SB.BAS)		/ SET UP POINTERS TO SYSBLK	/EAG:058
	DAC SYSBK1		/ SYSBK1 -> BASE		/EAG:058
	TAD* SYSBK1						/EAG:058
	DAC ENDSYS		/ ENDSYS -> END			/EAG:058
	LAC (CB.TOP)		/ SET UP POINTERS TO COMBLK	/EAG:058
	XOR BANKBT						/EAG:058
	DAC ENDCOM		/ ENDCOM -> END			/EAG:058
	LAC* ENDCOM						/EAG:058
	TAD SYSBK1						/EAG:058
	DAC COMBK1		/ COMBK1 -> BASE		/EAG:058
	LAC SG.FRE		/ SET UP POINTERS TO SGNBLK	/EAG:058
	TAD (SG.BAS)						/EAG:058
	TAD BANKBT						/EAG:058
	DAC SGNBK1		/ SGNBK1 -> END OF HANDLER TBL	/EAG:058
	LAC (SG.BAS+1)						/EAG:058
	TAD SG.NMP						/EAG:058
	TAD SG.NMD						/EAG:058
	TAD SG.NMS						/EAG:058
	TAD BANKBT						/EAG:058
	DAC SGNTAB		/ SGNTAB -> BASE OF HANDLER TBL	/EAG:058
	JMP DISPAT						/EAG:058
	.TITLE	OUTPUT MESSAGE ON TTY
/
/CALLING SEQUENCE:
/	JMS TYPE
/	BUFFER ADDRESS
/	(RETURN)
TYPE	0
	JMS	OUTTY		/MAKE SURE OUTPUT GOES TO CONSOLE
				/TELETYPE
	LAC* TYPE		/GET BUFFER ADDRESS
	JMS	BBTMG
	TAD	(-2		/OFFSET FOR FAKE HEADER PAIR
	DAC .+3
	CAL+2775
	11
	XX
	-60
	JMS	OUTTY		/MAKE SURE .WAIT DONE TO TELETYPE
	CAL+775
	12
	ISZ TYPE		/TO RETURN
	JMP* TYPE
/
/	ROUTINE TO SET BIT 4 OF SC.BOS IF IN BATCH MODE
/	JMS	OUTTY
/				/RETURN
OUTTY	0			/ENTRY POINT
	LAC*	(SC.BOS		/BOSS-15 MODE
	AND	(757777
	SPA
	XOR	(20000		/YES; SET BIT
	DAC*	(SC.BOS
	JMP*	OUTTY		/EXIT
/
/	ERROR MESSAGES
/
ILLPG	JMS	TYPE
	ILLPGM
	LAC	(15
	JMP	OT		/.EXIT
ILLPG1=.
ILLPG2	JMS	TYPE
	ILPG1
	LAC	(15
	JMP	OT		/.EXIT
	.EJECT
SYSLD1	JMS	TYPE
	NORUM1
	LAC	(3		/SET .SYSLD ERROR
OT	XOR*	(SC.BOS		/NUMBER AND ABORT
	AND	(17
	XOR*	(SC.BOS
	DAC*	(SC.BOS		/BIT IN SC.BOS
	.EXIT			/LOAD THE NRM
	-1
	-1
NORUM1	.ASCII	'.SYSLD 1'<15>
ILLPGM	.ASCII	'PROGRAM NOT IN COMBLK'<15>
ILPG1	.ASCII	'FILE NOT IN SYSBLK'<15>
/ WARNING:  IF ANY CHANGES WHATSOEVER ARE MADE TO THE		/EAG:192
/	FOLLOWING MESSAGE, THE ROUTINE ILLDEV MAY ALSO HAVE	/EAG:192
/	TO BE CHANGED.						/EAG:192
ILDVMS	.ASCII "ILLEGAL DEVICE CODE IN .DAT+NN"<15>		/EAG:192
ILDV.A=.-3							/EAG:192
/
/
/ ROUTINE TO PRINT THE FOLLOWING MESSAGE:			/EAG:192
/								/EAG:192
/	ILLEGAL DEVICE CODE IN .DAT+NN				/EAG:192
/								/EAG:192
/ WHERE THE APPROPRIATE .DAT SLOT NUMBER WILL BE PRINTED.	/EAG:192
/ COME HERE WITH THE .DAT SLOT NUMBER IN THE AC.		/EAG:192
								/EAG:192
ILLDEV	CLL!RAL!SMA		/ POSITION BOTTOM DIGIT AND	/EAG:192
				/ CHECK FOR NEGATIVE SLOT #	/EAG:192
	JMP ILDV.0		/ POSITIVE SLOT # -- SKIP THIS	/EAG:192
	TCA			/ MAKE # POSITIVE		/EAG:192
	TAD (55-53*200*200)	/ ADD FUDGE FACTOR TO GET "-"	/EAG:192
ILDV.0	DAC ILDV.A		/ SAVE SLOT NUMBER		/EAG:192
	RTL			/ POSITION HIGH DIGIT		/EAG:192
	RTL							/EAG:192
	XOR ILDV.A		/ MERGE WITH LOW DIGIT AND	/EAG:192
	AND (3400)		/ POSSIBLE SIGN STUFF		/EAG:192
	XOR ILDV.A						/EAG:192
	TAD (53*200+60*200+60)	/ ADD FLAG BITS.  CONSTANT IS	/EAG:192
				/ SECOND WORD GENERATED BY:	/EAG:192
				/	.ASCII "..+00"		/EAG:192
	DAC ILDV.A		/ PUT INTO MESSAGE		/EAG:192
	JMS TYPE		/ TYPE THE MESSAGE		/EAG:192
	ILDVMS							/EAG:192
	LAC (11)		/ GET ERROR CODE		/EAG:192
	JMP OT			/ AND EXIT			/EAG:192
	.TITLE	RECOGNIZE TYPE OF CUSP AND DISPATCH
/
/
PNT5	0
TABLE	.SIXBT	'GLOAD'
	JMP	KLGLO
	.SIXBT	'LOAD'
	JMP	KLLOA
	.SIXBT	'DDT@'
	JMP	KLDDT
	.SIXBT	'DDTNS'
	JMP	KLDDTN
	.SIXBT	'EXECUT'
	JMP	KLEXEC
	.SIXBT	/INSALL/
	JMP	KLINS
	.SIXBT	/INSERR/
	JMP	KLINS
	0			/STOPPER
DISPAT	LAC	(TABLE		/SEARCH TABLE
	JMS	BBTMG
	DAC	PNT5
DISLO1	LAC*	PNT5
	ISZ	PNT5
	SAD*	(SC.SPN						/EAG:191
	STL!SKP			/FIRST HALF MATCHES
	CLL
	LAC*	PNT5		/GET SECOND HALF
	ISZ	PNT5		/BUMP TO NDISPATCH JMP
	SAD*	(SC.SPN+1					/EAG:191
	SNL
	SKP			/TRY AGAIN
	JMP*	PNT5		/DISPATCH
	ISZ	PNT5		/BUMP TO NEXT ENTRY
	LAC*	PNT5
	SZA			/HAVE WE REACHED THE END
	JMP	DISLO1		/NO
	JMP	LOADSY		/CORE IMAGE CUSP MAYBE
	.TITLE	LOADING THE LINKING LOADER
/
/
/ ROUTINES TO INITIALIZE FOR SYSTEM PROGRAMS AND CALL .SYSLD
/
KLLOA	LAC (100000		/NOT DDT,^S,NO SYMBOLS
LOADLD	DAC*	(SC.UST						/EAG:191
	JMS	BUFALC		/ALLOCATE BUFFERS NOW
	CLA		/0=LOAD,GLOAD,DDT,DDTNS
          JMP SYSLDR+1
KLGLO	LAC (300000		/NOT DDT,GO,NO SYMBOLS
	JMP LOADLD
KLDDT	LAC (400000		/DDT,GO,SYMBOLS
	JMP LOADLD
KLDDTN	LAC (500000		/DDT,GO,NO SYMBOLS
	JMP LOADLD
/
	.TITLE BUILD DEVICE TABLE FOR PIP
/
BDEVT	0
	LAC* (SC.RMS		/SC.RMS POINTS TO FIRST .DAT ENTRY	/EAG:191
          DAC KLDEVP
	LAC*	(SC.SLT		/FETCH # OF POSITIVE .DAT SLOTS	/EAG:191
	TCA
          DAC KLDATN
	LAC	DAT1		/FETCH ADDRESS OF .DAT 1
          DAC KLDATP
KLDEVL    LAC* KLDATP           /CONTENTS OF .DAT ENTRY
          AND (77777
          DAC KLDATD
	AND (77700
	SZA			/ IS DEVICE NONE OR SET UP?	/EAG:059
	JMP KLNODT		/ YES -- NO DEVICE MNEMONIC	/EAG:059
	LAC KLDATD
	JMS FIONM		/ FETCH NAME OF HANDLER		/EAG:192
	RTR		/GET FIRST TWO LETTERS RIGHT ADJUSTED IN WORD
	RTR
	RTR
	AND	(7777
          SKP
KLNODT    CLA
          DAC* KLDEVP           /ENTRY IN .DEV TABLE
          ISZ KLDEVP
          ISZ KLDATP
          ISZ KLDATN /NEXT .DAT
          JMP KLDEVL
	LAC SG.SYS		/ ADD SYSTEM DEVICE CODE TO	/EAG:196
	CLL!RTR			/ END OF DEVICE TABLE		/EAG:196
	RTR							/EAG:196
	RTR							/EAG:196
	DAC* KLDEVP						/EAG:196
	ISZ KLDEVP						/EAG:196
          LAC KLDEVP
	DAC*	(SC.FRL						/EAG:191
	JMS	ROMTST		/IS THERE ROOM?
	TAD	(20000
	JMP*	BDEVT
	.TITLE	LOADING EXECUTE/$INSTRUCT PROG
/
/
KLEXEC=.
/FOR NEW EXECUTE, COMPARE SYSDEV TO .DAT-4
/THROUGH .IOTAB. IF 1ST 2 CHARS. ARE =,
/SET SC.FNM+2 = XCS RATHER THAN XCT
	LAC*	DATM4
	AND	(77777
	JMS FIONM		/ GET HANDLER NAME		/EAG:192
	AND	(777700	/STRIP OF HANDLER LETTER LEAVING DEVICE CODE
	DAC	KLDATD
	LAC	SG.SYS
	XOR	KLDATD
	SNA!CLA		/XCT
	CLC		/SAME:/XCS
	TAD	XCTEXT
	DAC*	(SC.FNM+2					/EAG:191
	JMS	BUFALC		/ALLOCATED BUFFERS NOW
	LAC (13		/EXECUTE=13
	JMP SYSLDR
/
KLINS	JMS	BUFALC		/ALLOCATE BUFFERS
	LAC	(14		/$INSTRUCT=14
	JMP	SYSLDR
	.TITLE	ROUTINE TO LOAD SYS FILES
/
/
/ROUTINE TO LOAD SYS FILES
/
PIPTST	.SIXBT	'PIP'
LOADCT	0
LOADP	0
LOADSY	LAC	(SC.SPN						/EAG:191
	JMS	FCOMK		/FIND NAME IN COMBLK
	JMP	ILLPG		/MISSING
	LAC	(SC.SPN		/ FIND IN SYSBLK		/EAG:191
	JMS FSYSK						/EAG:197
	  JMP	ILLPG1		/MISSING
/
/	BUILD DEVICE TABLE FOR PIP IF NEEDED
/
	LAC	P2
	TAD	(1
	DAC	LOADP
LDP1	LAW	10000
	AND*	LOADP		/IS THIS A NAME
	SNA
	JMP	LDP2		/NO; THROUGH WITH ALL OVERLAYS
	LAC*	LOADP		/IS THIS PIP
	ISZ	LOADP
	SAD	PIPTST
	SKP!CLA			/IT MIGHT BE
	JMP	LDP3		/NO
	SAD*	LOADP		/SECOND PART 0
	JMP	LDP4		/YES; IT IS PIP
LDP3	ISZ	LOADP		/PROCESS NEXT OVERLAY
	JMP	LDP1
LDP4	JMS	BDEVT		/BUILD DEVICE TABLE
	.EJECT
LDP2	LAC*	(SC.FRL		/SET UP SC.OTB			/EAG:191
	DAC*	(SC.OTB						/EAG:191
	TAD	(-1
	DAC*	(17
	LAC	P2
	TAD	(-1
LOAD3	TAD	(2
	DAC	LOADP
	LAW	10000		/IS THIS ANOTHER OVERLAY NAME
	AND*	LOADP
	SNA
	JMP	LOAD4		/NO MORE OVERLAYS
	LAC	LOADP
	JMS FSYSK		/ FIND NAME IN SYSBLK		/EAG:197
	  JMP	ILLPG2		/NAME MISSING FROM SYSBLK
	LAC* FCOMTP		/ COPY OVERLAY NAME		/EAG:197
	DAC*	17
	LAC* FCOMT1						/EAG:197
	DAC*	17
	LAC* 11			/ AND FIRST DISK BLOCK		/EAG:197
	DAC*	17
	LAC* 11
	LAC* 11			/ AND FIRST CORE ADDRESS	/EAG:197
	AAC -1			/ MINUS ONE			/EAG:197
	XOR	BANKBT
	DAC*	17
	LAC* 11			/ AND PROGRAM LENGTH		/EAG:197
	TCA							/EAG:191
	DAC*	17
	LAC* 11			/ AND PROGRAM START ADDRESS	/EAG:197
	XOR	BANKBT
	DAC*	17
	LAC	LOADP
	JMP	LOAD3
LOAD4	DZM* 17			/ PUT END FLAG INTO OVRLA TABLE	/EAG:191
	LAC*	(17		/UPDATE SC.FRL			/EAG:191
	IAC							/EAG:191
	DAC* (SC.FRL)						/EAG:191
	JMS	ROMTST		/IS THERE ENOUGH ROOM
	TAD	(20000
	.EJECT
	LAC* LOADP		/ SET # BUFFS FROM VALUE IN	/EAG:191
	DAC* (SC.BNM)		/ SYSBLK			/EAG:191
	JMS	LNRM		/LOADING NRM?
	JMP	NONRM		/NO
	LAC*	(SC.MOD		/SET SC.NRM IN SC.MOD		/EAG:191
	XOR (SC.NRM)		/IF LOADING NRM			/EAG:191
	DAC*	(SC.MOD						/EAG:191
	LAC SG.BNM		/ ALSO RESTORE # BUFFS TO	/EAG:191
	DAC* (SC.BNM)		/ DEFAULT VALUE IN SGNBLK	/EAG:191
NONRM	LAC* (SC.NMF)		/ CHECK IF WE ARE IN BATCH OR	/EAG:197
	AND (SC.BCH)		/ BOSS MODES, AND ALLOCATE ONE	/EAG:197
	SZA			/ MORE BUFFER IF WE ARE.	/EAG:197
	ISZ* (SC.BNM)						/EAG:197
	ISZ	LOADP		/BUMP PAST BUFFS ENTRY
	LAC*	P2		/DOES PROGRAM HAVE ACTIVE .DAT SLOTS
	TAD	P2
	CMA			/COMPUTE NEGATIVE OF # ACTIVE .DAT SLOTS
	TAD	LOADP
	DAC	LOADCT		/LOOP COUNT
	TAD	(17636		/PUT .DAT SLOTS IN .SYSLD COMMAND AREA
	XOR	BANKBT		/GET INTO TOP BANK
	DAC*	(17
	DZM*	17		/0 DELIMITS ACTIVE .DAT SLOT LIST
	JMP	LOAD6
LOAD7	LAC*	LOADP		/TRANSFER LIST
	DAC*	17
	ISZ	LOADP
LOAD6	ISZ	LOADCT
	JMP	LOAD7		/ITERATE
	JMS	SETBUF		/SET UP FILES BUFFERS TRANSFER VECTOR TABLE
	LAC	(1		/LOAD SYS FILE
	JMP	SYSLDR
	.TITLE	SETBUF,TWOCMA,BBTMG,FAKSTP,ROMTST
/
/
/ROUTINE TO SET UP .GTBUF,.GVBUF ROUTINES
/	JMS	SETBUF
SETBUF	0
	LAC*	(SC.FRL		/ADD TRANSFER VECTOR TABLE TO	/EAG:191
					/TO RESIDENT MONITOR
	DAC*	(SC.BTB		/FIRST WORD IN SC.BTB		/EAG:191
	TAD*	(SC.BNM		/ADD # OF TRANSFER VECTORS	/EAG:191
	SAD*	(SC.FRL						/EAG:191
	DZM*	(SC.BTB		/CLEAR SC.BTB IF 0 BUFFERS	/EAG:191
	DAC*	(SC.FRL						/EAG:191
	JMS	ROMTST		/IS THERE ENOUGH ROOM?
	TAD (20000
	JMP*	SETBUF		/EXIT
/
/ROUTINE TO MERGE BANKBIT INTO AC
/
BBTMG	0
	XOR	BANKBT
	AND	(717777
	XOR	BANKBT
	JMP*	BBTMG
/
/	TEST IF ENOUGH ROOM EXISTS 
/
ROMTST	0
	TCA							/EAG:191
	XCT*	ROMTST
	SPA
	JMP	SYSLD1
	JMP*	ROMTST
	.TITLE	BUFALC,LNRM
/
/
/	JMS	BUFALC
/				/RETURN
/
CON1	0
BUFALC	0
	JMS	SETBUF		/ALLOCATE TV TABLE
	DZM*	(SC.OTB		/ZERO SC.OTB			/EAG:191
	LAC*	(SC.BNM		/GET # OF BUFFERS		/EAG:191
	TCA			/NEGATE				/EAG:191
	SMA
	JMP	ALLO2		/SKIP IF NONE
	DAC	CON1
	LAC*	(SC.BTB		/SET UP TO PUT VECTORS IN TABLE	/EAG:191
	DAC	TEM2
ALLO1	LAC*	(SC.FRL		/GET FIRST TV			/EAG:191
	DAC*	TEM2			/PUT INTO TABLE FIRST ENTRY
	TAD*	(SC.BLN		/BUMP TO FIRST FREE WORD	/EAG:191
	DAC*	(SC.FRL		/STORE INTO SC.FRL		/EAG:191
	ISZ	TEM2			/UPDATE POINTER TO NEXT ENTRY
	ISZ	CON1		/IS THIS THE LAST
	JMP	ALLO1		/NO
	SKP
ALLO2	LAC*	(SC.FRL		/DO NOTHING			/EAG:191
	DAC*	(SC.FRL						/EAG:191
	DAC*	(SC.RMS						/EAG:191
	TCA							/EAG:191	
	TAD*	(SC.FRL+1	/DID WE GO TO FAR		/EAG:191
	SMA
	JMP*	BUFALC		/NO
	JMP	SYSLD1		/YES .SYSLD 1
/
/	JMS	LNRM
/				/NOT LOADING NON-RESIDENT MONITOR
/				/LOADING NON-RESIDENT MONITOR
LNRM	0
	LAC*	(SC.SPN						/EAG:191
	CLL
	SAD*	(SC.NMN		/FIRST PARTS MATCH		/EAG:191
	STL			/YES
	LAC*	(SC.SPN+1		/SECOND HALVES		/EAG:191
	SAD*	(SC.NMN+1					/EAG:191
	SNL			/YES IF NONZERO LINK
	JMP*	LNRM
	ISZ	LNRM
	JMP*	LNRM		/YES
	.TITLE	ROUTINES TO SEARCH SYSBLK AND COMBLK
/
/
/FIND PROGRAM NAME IN COMBLK
/	AC CONTAINS ADDRESS OF NAME ON INPUT
/	JMS	FCOMK
/	FIRST RETURN	/NOT PRESENT IN COMBLK
/	SECOND	RETURN	/COMBLK ADDRESS IN AC
/	P2 ALSO CONTAINS COMBLK ADDRESS
/
P2	0
FCOMK	0
	DAC	FCOMTP
	DAC	FCOMT1
	ISZ	FCOMT1		/BUMP TO SECOND HALF OF NAME
	LAC	COMBK1
FCOM1	DAC	P2
	SAD	ENDCOM		/END OF COMBLK?
	JMP*	FCOMK		/YES; NOT PRESENT
	DAC*	(10
	LAC*	10
	SAD*	FCOMTP
	SKP
	JMP	FCOM2		/NOT THIS ENTRY
	LAC*	10
	SAD*	FCOMT1
	JMP	FCOM3
FCOM2	LAC	P2		/NO MATCH
	TAD*	P2
	JMP	FCOM1		/GO NEXT ENTRY
FCOM3	ISZ	FCOMK		/FOUND IT
	LAC	P2		/ADDRESS IN AC
	JMP*	FCOMK		/EXIT
FCOMTP	0
FCOMT1	0
	.EJECT
/
/FIND PROGRAM NAME IN SYSBLK
/	AC CONTAINS ADDRESS OF NAME
/	JMS	FSYSK
/	FIRST RETURN	/MISSING FROM SYSBLK
/	SECOND	RETURN	/AC ADDRESS OF ENTRY
/	P3 ALSO CONTAINS ADDRESS OF ENTRY
/	AUTO INDEX 11 READY TO PICK OUT FB
/
P3	0
FSYSK	0
	DAC	FCOMTP		/SET UP NAME POINTERS
	DAC	FCOMT1
	ISZ	FCOMT1
	LAC	SYSBK1
	TAD	(1
FSYS1	DAC	P3		/ARE WE FINISHED?
	SAD	ENDSYS
	JMP*	FSYSK		/YES; NOT THERE
	DAC*	(11
	LAC*	P3
	SAD*	FCOMTP
	SKP
	JMP	FSYS2		/NOT THIS ONE
	LAC*	11
	SAD*	FCOMT1
	JMP	FSYS3		/FOUND
FSYS2	LAC	P3	/GO TO NEXT ENTRY
	TAD	(7
	JMP	FSYS1		/SEVEN WORDS PER ENTRY
FSYS3	ISZ	FSYSK		/BUMP RETURN
	LAC	P3		/ADDRESS IN AC
	JMP*	FSYSK		/EXIT
/
/	POINTERS DIVIDING SYSBLK AND COMBLK
/
SYSBK1	XX		/FIRST ADDRESS OF SYBLK AREA
COMBK1	XX		/FIRST ADDRESS OF COMBLK IN CORE
ENDCOM	XX		/LAST ADDRESS +1 OF COMBLK AREA
ENDSYS	XX		/LAST ADDRESS +1 OF SYSBLK AREA
	.TITLE	ROUTINES TO SEARCH DEVICE TABLE IN SGNBLK
/
/
/GET HANDLER NAME FROM TABLE
/	AC	CONTAINS NUMBER OF HANDLER
/	JMS	FIONM
/	AC CONTAINS NAME OF HANDLER ON RETURN
/
FIONM	0
	DAC	HANNO
	CMA
	DAC	HANNAM		/COUNTER
	LAW	-1
	TAD	SGNTAB
	DAC	P1
FIO1	JMS	NHAN		/FETCH NEXT HANDLE NAME
	HLT		/RUN OUT OF HANDLERS
	ISZ	HANNAM		/COUNT #
	JMP	FIO1
	DAC	HANNAM		/STORE AWAY NAME FOUND
	JMP*	FIONM		/EXIT
/
	.EJECT
/
/GO TO NEXT HANDLER IN TABBE
/	P1 POINTS TO LAST HANDLER
/	JMS	NHAN
/	FIRST RETURN	/END OF TABLE REACHED
/	SECOND RETURN	/FOUND NEXT HANDLERR
/	AC CONTAINS HANDLER NAME
/
NHAN	0
NHAN1	ISZ	P1		/EXAMINE NEXT ENTRY FOR HANDLER NAME
	LAC	P1
	SAD	SGNBK1		/END REACHED
	JMP*	NHAN		/YES TAKE FIRST EXIT
	LAC*	P1		/IS THIS A HANDLER NAME
	AND	(777700	/TAKE ONLY TOP 12 BITS
	SNA			/YES
	JMP	NHAN2		/NO
	LAC*	P1		/GET INTO AC
	ISZ	NHAN		/BUMP EXIT
	JMP*	NHAN
NHAN2	LAC*	P1		/SKIP OVER SKIPS
	RCL			/QUICK MULTIPLY BY 3
	TAD*	P1
	TAD	P1
	DAC	P1
	JMP	NHAN1		/TRY AGAIN
HANNO	0			/HANDLER #
HANNAM	0			/HANDLER NAME
P1	0			/POINTS TO HANDLER IN TABLE
/
/	POINTERS DIVIDING SGNBLK
/
SGNTAB	XX		/BEGINNING OF DEVICE TABLE
SGNBK1	XX		/END OF DEVICE TABLE
	.TITLE	START UP THE SYSTEM LOADER
/
/
SYSLDR	DZM*	(SC.UST		/ENTRY FOR NON-ZERO PROGRAM CODES	/EAG:191
	DAC* (SC.SST)		/ ENTRY FOR ZERO PROGRAM CODES	/EAG:191
				/ PUT PROGRAM CODE INTO SC.SST	/EAG:191
/
/	BUILD CONFIGURATION TABLE FOR .SYSLD
/
	CLA			/CALCULATE THE NUMBER OF HANDLERS IN SYSTEM
	JMS FIONM		/ SKIP OVER NONE		/EAG:192
	DZM	LOADCT		/COUNTER			/EAG:191
CALMH	JMS NHAN		/ GET NEXT HANDLER		/EAG:192
	JMP	MAXFD		/FOUND MAXIMUM
	ISZ	LOADCT						/EAG:191
	JMP	CALMH
MAXFD	LAC	LOADCT						/EAG:191
	TCA			/SET UP COUNTER			/EAG:191
	TAD*	(SC.FRL+1					/EAG:191
          DAC KLDEVP /POINTS TO NEW TABLE
	CLA			/GO PAST NONE
	JMS FIONM		/ SKIP OVER NONE		/EAG:192
KLSQZE	JMS NHAN		/ GET NEXT HANDLER		/EAG:192
	  JMP	LSYLD		/FINISHED
	JMS IN.6TR		/ CONVERT HANDLER NAME TO	/EAG:192
	XOR (400000)		/ RADIX 50 AND SET SIGN BIT	/EAG:192
	DAC* KLDEVP		/ STORE IT AWAY			/EAG:192
	ISZ KLDEVP		/ BUMP POINTER			/EAG:192
	JMP KLSQZE		/ AND GO GET ANOTHER		/EAG:192
								/EAG:058
								/EAG:058
LSYLD	LAC LOADCT		/ PUT COUNT OF I/O HANDLERS	/EAG:058
	TCA			/ INTO IOC			/EAG:058
	DAC* KLDEVP						/EAG:058
	JMP .SYSLD						/EAG:058
	.TITLE     IN.6TR -- .SIXBT TO RADIX 50 CONVERSION
								/EAG:192
								/EAG:192
								/EAG:192
								/EAG:192
/								/EAG:192
/ THIS ROUTINE ACCEPTS A 3 CHARACTER NAME IN THE AC,		/EAG:192
/ CONVERTS IT TO RADIX 50, AND RETURNS IT IN THE AC.		/EAG:192
/								/EAG:192
								/EAG:192
								/EAG:192
IN.6TR	0							/EAG:192
	DAC IN6R.A		/ STORE IN TEMP.		/EAG:192
	LAW -3			/ INIT. CHAR. CTR.		/EAG:192
	DAC IN6R.B						/EAG:192
	DZM IN6R.C		/ INIT. RESULT			/EAG:192
	JMP IN6R.1		/ JMP INTO LOOP			/EAG:192
								/EAG:192
								/EAG:192
/ COME HERE WITH NEXT TEM. RESULT IN AC.  SAVE IT		/EAG:192
/ AND MUL. BY 50(8).						/EAG:192
								/EAG:192
IN6R.0	DAC IN6R.C		/ TEMP. SAVE RESULT		/EAG:192
	CLL!RTL			/ *4				/EAG:192
	TAD IN6R.C		/ *4 + *1 = *5			/EAG:192
	RAL							/EAG:192
	RTL			/ *5*10 = *50			/EAG:192
	DAC IN6R.C						/EAG:192
IN6R.1	LAC IN6R.A		/ GET NEXT .SIXBT CHAR.		/EAG:192
	RTL							/EAG:192
	RTL							/EAG:192
	RTL							/EAG:192
	DAC IN6R.A		/ SAVE FOR NEXT TIME		/EAG:192
	RAL							/EAG:192
	AND (77)						/EAG:192
	SAD (43)		/ CONVERT CHAR. CODES		/EAG:192
	AAC 47-43+23		/ 43 (#) => 47			/EAG:192
	SAD (56)		/ 56 (.) => 34			/EAG:192
	AAC 34-56+23						/EAG:192
	SAD (45)		/ 45 (%) => 33			/EAG:192
	AAC 33-45+23						/EAG:192
	SAD (40)		/ 40 (SPACE) => 0		/EAG:192
	AAC 0-40+23						/EAG:192
	AAC -33			/ CHECK IF ALPHABETIC		/EAG:192
	SMA			/ SKIP IF YES			/EAG:192
	AAC -23			/ MUST BE NUMERIC OR SPECIAL	/EAG:192
				/ TRANSLATE NUMERIC AND SPECIAL	/EAG:192
				/ (ALREADY MODIFIED ABOVE)	/EAG:192
	AAC 33			/ RESTORE EVERYTHING		/EAG:192
	TAD IN6R.C		/ ADD CHAR. INTO RESULT		/EAG:192
	ISZ IN6R.B		/ PROCESSED 3 CHAR.'S?		/EAG:192
	JMP IN6R.0		/ NO -- GO DO ANOTHER		/EAG:192
	JMP* IN.6TR		/ YES -- RETURN			/EAG:192
								/EAG:192
								/EAG:192
IN6R.A	0			/ TEMP. TO HOLD .SIXBT NAME	/EAG:192
								/EAG:192
IN6R.B	0			/ CHARACTER COUNTER		/EAG:192
								/EAG:192
IN6R.C	0			/ TEMP. TO HOLD RESULT		/EAG:192
	.TITLE	STORAGE CONSTANTS AND COUNTERS
/
/
KLDEVP	0
KLDATN	0			/.DAT NUMBER
KLDATP	0			/.DAT POINTER
KLDATD	0			/DAT DIGITS
BANKBT	0			/ BANK BITS
/
/	POINTERS TO CERTAIN .DAT SLOTS
/
DATM4	XX		/.DAT-4
DAT1	XX		/.DAT+1
/
/	TEMPORARIES
/
TEM2	XX
XCTEXT	.SIXBT	/XCT/
	.TITLE BEGINNING OF SYSTEM LOADER PROPER
/
/BUFFERS AND TEMPORARY STORAGE.
/
LNBUFF=.				/LINE BUFFER HEADER.
LNBUF2=.+2			/LINE BUFFER BODY
L2BUFF=.+62			/LINE BUFFER #2
NAMTBL=.+144			/(GAR-057) TABLE OF HANDLER NAMES ...
				/(GAR-057) BUILT DURING THE LOADING OF HANDLERS ...
				/(GAR-057) AND USED TO AVOID LOADING DIFFERENT ...
				/(GAR-057) VERSIONS OF ANY ONE HANDLER.
/
/
/ PROGRAM ENTRY
/
.SYSLD	LAW	-7
	TAD*	(.SCOM+23
	DAC	.DATM7
	AAC	2
	DAC	.DATM5
	IAC
	DAC	.DATM4
	IAC
	DAC	.DATM3
	AAC	2
	DAC	.DATM1
	IAC
	DAC	.DAT0
	LAW	-7
	TAD*	(.SCOM+25		/ADD .UFD
	DAC	UFDM7			/.UFD-7
	AAC	3
	DAC	UFDM4			/.UFD-4
	LAC*	UFDM7			/PICK UP CONTENTS OF .UFD-7
	DAC	UFDM7
	DAC	UFDM7A
	LAC*	UFDM4
	DAC	UFDM4
	LAC*	(.SCOM+4		/TEST IF BANK OR PAGE SYSTEM
	AND	LIT100		/(RKB-056) (100)
	SNA!CLL			/BANK MODE SYSTEM
	STL			/PAGE MODE SYSTEM
	LAC	SKPLIT		/COMPUTE FLAGS FOR TWO ALTERRNATIVES
	SNL
	LAC	NOPLIT
	DAC	SKPPAG		/SKIP IF PAGE MODE FLAG
	XOR	SKPLIT		/(RKB-056) CHANGE FROM NOP TO SKIP OR VICE VERSA
	XOR	NOPLIT		/(RKB-056) //
	DAC	SKPBNK		/SKIP IF BANK MODE FLAG
	LAC*	(.SCOM+5		/GET PGM CODE, IF ITS FOR
	SNA			/A SYS FILE WE DON'T HAVE
	SKP			/TO CHANGE "NOP" IN "BOSCK1"
	SAD	(13		/TO A "DBA". IF IT ISN'T , THEN
	SKP			/WE WILL IF WE ARE A PAGE SYSTEM.
	JMP	G.SCOM		/SYS FILE -- CONTINUE
	LAC	EPM		/GET "DBA" INSTRUCTION
	XCT	SKPBNK
	DAC	BOSRMD		/PAGE SYSTEM CHANGE "NOP TO DBA"
G.SCOM	LAC*	(.SCOM
	AND	(60000
	XOR	LIT135		/(RKB-056) (13500)
	DAC*	.DATM7		/SET UP SYSTEM LOADER HANDLER
/
/
	LAC*	(.SCOM+2		/LOWEST FREE ADDRESS.
	DAC	LPRES		/PRESENT LOAD ADDRESS.
	DAC* (10
	LAC*	(.SCOM+3		/HIGHEST FREE ADDRESS.
	DAC	IOCONF		/ADDRESS OF TOP OF IOC TABLE.
	LAW	-1
	TAD*	IOCONF
	DAC	MOVCNT		/2'S COMP. OF SIZE OF IOC TABLE.
	TAD	IOCONF
	DAC	MOVADD
	ISZ	MOVADD		/BOTTOM OF IOC TABLE.
	DZM*	10		/CLEAR CORE
	SAD*	(10		/FINISHED
	SKP			/YES
	JMP	.-3		/NO ITERATE
	TCA			/(RKB-056) PERFORM SUBTRACTION
	TAD*	(.SCOM+63		/SUBTRACT ENOUGH FOR ONE
	TCA			/(RKB-056) ENTRY IN THE BUSY TABLE
	DAC*	SCM62		/SET UP .SCOM+62 TO POINT TO TABLE
	ISZ*	SCM62		/WITH # OF ENTRIES = 1
	DZM*	(.SCOM+36
	ISZ*	(.SCOM+36
	DAC*	(.SCOM+3		/NEW .SCOM+3
	DAC	LSMST		/SYMBOL TABLE START
	DAC	LSMEND		/SYMBOL TABLE END
	.EJECT
/
/	BANK BIT INITIALIZATION ROUTINE
/
	AND	(060000)
	DAC	XBANK
	DAC	XXBANK
	XOR	BRATTV
	DAC	LTEMP1
/
/
/(RKB-056) THE FOLLOWING X4K-RELATED CODE REMOVED.
/
/	LAC*	(.SCOM+20		/EXTRA 4K?
/	SMA				/YES
/	JMP	BRL			/NO
/	LAC	XBANK			/CLEAR EXTRA 4K
/	XOR	(17777
/	DAC*	(10
/	TAD	(10000
/	DZM*	10
/	SAD*	(10
/	SKP
/	JMP	.-3
/
/(RKB-056) END OF REMOVED X4K CODE
/
/
BRL	LAC*	LTEMP1
	SPA
	JMP	FPRGCD
	XOR	XBANK
	DAC	LTEMP2
	LAC*	LTEMP2
	XOR	XBANK
	DAC*	LTEMP2
	ISZ	LTEMP1
	JMP	BRL
/
BRATBL	LNBUF		/BANK RELOCATION ADDRESS TABLE
	LN2BUF
	XKMD01
	XKMD02
	XKMD04
	XKMD05		/(RKB-056)
	XKMD06		/(RKB-061)
	LPRESS
	XCTTMP
	BBPFIL
	NAMTBV		/(GAR-057)
	-1		/END OF TABLE
	.EJECT
/
FPRGCD	LAC*	(.SCOM+5		/FETCH PROGRAM CODE
	DAC	TESL1		/SAVE FOR LATER
	SAD	(14		/$INSTRUCT?
	JMP	INST
	SAD	(13)	/EXECUTE?
	SKP
	JMP	SYSBCK	/NO
	LAC	EXEFIL	/CHANGE SEEK DATA
	DAC	LLDDIR	/FROM '.LOAD@BIN' TO
	LAC	EXEFIL+1	/'EXECUTBIN'.
	DAC	LLDDIR+1
	LAC*	SCOM11	/IF .SCOM+11 CONTAINS
	SAD	XCT6BT	/.SIXBT 'XCS', EXECUTE
	JMP	SYSBCK	/AND .SYSLD WILL USE
			/THE SAME I/O DEVICE.
/
/ .SCOM+11 CONTAINS 'XCS' -- TWO COPIES OF THE SYSTEM DEVICE
/ HANDLERS WILL BE LOADED.  ONE IN HIGH CORE FOR .SYSLD'S USE 
/  VIA .DAT-7, AND THE OTHER IN LOW CORE FOR EXECUTE'S USE VIA
/ .DAT-4.
/ NORMALLY, .DAT-7 IS RE-ASSIGNED TO EXECUTE'S DEVICE (FROM .DAT-4)
/ DURING THE READING OF THE 'XCT' FILE.  HOWERVER, IN THIS CASE, BOTH
/ .DAT-4 & .DAT-7 POINT TO DIFFERENT COPIES OF HANDLERS FOR THE SAME
/ DEVICE.  THEREFORE, THE "RE-ASSIGNMENT" OF .DAT-7 IS TO: .SYSLD'S
/ COPY OF THE HANDLER WITH EXECUTE'S UNIT NUMBER!
/
	IDX*	SCOM11	/CHANGE 'XCS' TO 'XCT'
	LAC*	.DATM7	/SETUP A .DAT SLOT CONTENT WITH THE
	AND	(077777)	/ENTRY POINT FOR .SYSLD'S COPY OF THE
	DAC	DM7XCT	/SYSTEM DEV HANDLER FROM .DAT-7, AND THE
	LAC*	.DATM4	/UNIT NUMBER FOR EXECUTE'S DEVICE FROM 
	AND	(700000)	/.DAT-4.
	XOR	DM7XCT
	DAC	DM7XCT
	LAC	NOPLIT	/IF PDP-15, NOP 'DBA' INSTRUCTIONS
	XCT	SKPBNK	/BECAUSE .SYSLD'S HANDLER, WHICH IS LOADED 
	DAC	EPM	/FOR BANK MODE EXECUTION, WILL BE USED
			/TO READ THE XCT FILE.
	JMP	SYSBCK
/
EXEFIL	.SIXBT	/EXECUT/
INSFIL	.SIXBT	/INSTRC/		/*LIT
JMPEXC	JMP	EXECUT	/*LIT
SCOM11	.SCOM+11		/*LIT
BRATTV	BRATBL		/*LIT
XCT6BT	.SIXBT	/XCT/
	.EJECT
/ LOADING INSTRC
INST	LAC	INSFIL
	DAC	LLDDIR
	LAC	INSFIL+1
	DAC	LLDDIR+1
/ROUTINE TO CLEAR MEMORY BANK POINTERS
/OF MEMORY BANKS THAT DO NOT EXIST.
SYSBCK	LAC	LPRESS
	DAC	LPRESP
	LAC*	(.SCOM+2	/COMPUTE THE FIRST FREE PAGE AND
	XCT	SKPPAG		/ZERO OUT LOWER PAGES(BANKS)
	AND	(60000		/BANKS AS THIS IS BANK MODE SYSTEM
	XCT	SKPBNK
	AND	(70000		/PAGES AS THIS IS PAGE MODE SYSTEM
	AAC	20		/(RKB-056) THIS IS NEED FOR MATCH TO WORK
.SBAC1	IDX	LPRESP		/BUMP TO NEXT PAGE
	SAD*	LPRESP		/IS THIS SAME PAGE
	JMP	.SBAC2		/YES; SAME PAGE OR BANK
	DZM*	LPRESP		/NO; DO NOT USE THIS PAGE
	JMP	.SBAC1		/ITERATE
.SBAC2	LAC*	(.SCOM+2	/SET FIRST FREE ADDRESS IN BANK OR PAGE
	DAC*	LPRESP
.SBAC3	LAC*	LPRESP		/CALCULATE FIRST PAGE ABOVE BOOTSTRAP
	XOR*	(.SCOM		/.SCOM POINTS TO FIRST FREE REGISTER
	AND	(70000		/UNDER THE BOOTSTRAP
	IDX	LPRESP		/THIS DOES NOT CHANGE AC
	SZA			/SKIP IF TTHIS IS PAGE WITH BOOTSTRAP
	JMP	.SBAC3		/LEAVE THIS PAGE OPEN FOR PROGRAMS
/
/
/(RKB-056) FOLLOWING X4K-RELATED CODE REMOVED.
/
/	LAC* (SCOM20)	/.SCOM+20 BIT-0 IS SET
/	RAL			/LINK=1 IF XTRA 4K PRESENT.
/
/(RKB-056) END OF REMOVED X4K CODE.
/
/
.SBACK	LAC*	LPRESP		/COMPUTE IF EXTRA 4K SHOULD BE USED AND ITS ENTRY
	SAD	LPRESS		/AND ZERO PAGES WHICH ARE NONEXISTENT
	JMP	.SCONT		/DONE
/
/
/(RKB-056) FOLLOWING X4K-RELATED CODE REMOVED.
/
/	SZL!CLL			/INCLUDING THE EXTRA 4K IF PRESENT
/	DAC	LPRESX		/USE EXTRA 4K
/
/(RKB-056) END OF REMOVED X4K CODE.
/
/
	DZM*	LPRESP		/AND CLEAR
	IDX	LPRESP
	JMP	.SBACK		/ALL OTHER POINTERS
.SCONT	LAC*	(.SCOM+5		/SYS. PROG. CODE
	SAD	(13
	JMP	MOD15		/EXECUTE
	SAD	(14		/$INSTRUCT?
	JMP	MOD15
	SZA			/LINKING LOADER
	JMP	.SDONE
 
/SET UP MASKS FOR 12-BIT RELOCATION.
MOD15	DZM	LPRESX		/DON'T USE XTRA 4K
	XCT	SKPPAG	/IF PDP-15, SETUP FOR PAGE ADDRESSING
	JMP	.SDONE
	LAC	(7777)	/SET UP DEFAULT RELOCATION (PAGE NOT BANK)
	DAC	MASK
	DAC	MASK1
	.EJECT
.SDONE	LAC*	(SC.NMF)		/ARE WE IN BOSS-15 MODE?
	AND	(4
	SNA
	JMP	.SDON2			/NO
	LAC*	(.SCOM+57		/PUT SYSTEM HANDLER DEVICE CODE IN
	DAC*	.DAT0			/.DAT+0
	LAC*	(SC.BOS)	/(RKB-062) CHECK FOR BOSS OR BATCH
	SPA			/(RKB-062) SKIP IF BATCH
	JMP	.SDON0		/(RKB-062) ITS BOSS, WE'RE ALL SET
	LAC*	(SC.BDEV)	/(RKB-063) SETUP TO TRANSLATE SY*
	DAC	SL.BDEV		/(RKB-063) TO RIGHT THING
	AND	(777700)	/(RKB-063) IS IT SY*?
	SAD	(233100)	/(RKB-063)
	SKP			/(RKB-063) YES
	JMP	.SDONC		/(RKB-063) NO, SKIP THIS
	XOR	SL.BDEV		/(RKB-063) STRIP SY, RECOVER FLAVOR
	SAD	(23)		/(RKB-063) IS FLAVOR 'S' AS IN 'SYS'?
	CLA!IAC			/(RKB-063) YES, MAKE IT 'A' AS IN 'SYA'
	XOR	SG.SYS		/(RKB-063) COMBINE WITH MNEMONIC
	DAC	SL.BDEV		/(RKB-063) THIS IS IT
.SDONC	DZM	HANNO		/(RKB-063) NEED TO LOOKUP BATCH DEVICE
	LAW	-1		/(RKB-062) TO FIND OUT WHAT ITS HANDLER
	TAD	SGNTAB		/(RKB-062) NUMBER IN SGNBLK IS.
	DAC	P1		/(RKB-062) WE'RE SETTING UP NHAN FOR THAT JOB
.SDONA	JMS	NHAN		/(RKB-062) FETCH NEXT HANDLER NAME FROM SGNBLK
	HLT			/(RKB-062) END OF TABLE REACH, NO BATCH DEV FOUND
	SAD	SL.BDEV		/(RKB-063) IS THIS THE RIGHT DEVICE?
	JMP	.SDONB		/(RKB-062) YES.
	ISZ	HANNO		/(RKB-062) NO, KICK THE HANDLER NUMBER BY 1
	JMP	.SDONA		/(RKB-062) STAY WITH IT
.SDONB	LAC*	(SC.BUNT)	/(RKB-062) GET THE BATCH DEV UNIT NUMBER
	AND	(700000)	/(RKB-062) IN CASE THE WORDS BEEN USED OTHERWISE
	XOR	HANNO		/(RKB-062) ADD IN HANDLER CODE #, NOW LOOK
				/(RKB-062) JUST LIKE A DAT SLOT ENTRY.
	DAC*	.DAT0		/(RKB-062) SO PUT IT THERE
.SDON0	CLA
	JMS	IOPROS			/.IODEV 0
.SDON2	LAC*	(.SCOM+42	/LOAD .DAT 6?
	AND	(10		/BIT 14
	SNA
	JMP	.SDON1		/NO
	AAC	-2		/(RKB-056) .IODEV 6
	JMS	IOPROS
.SDON1	LAC	TESL1			/WHAT KIND OF PROGRAM ARE WE LOADING?
	SAD	(13		/EXECUTE?
	JMP	.SEXCT		/YES
	SNA
	JMP	.SLLD		/LINKING LOADER
	SAD	(14		/$INSTRUCT?
SKPLIT	SKP			/(RKB-056) USED AS A LITERAL
	JMP	NOTLL
	LAW	-12
	JMS	IOPROS		/.IODEV .DAT -12
.SLLD	LAC*	.DATM1		/SAVE LINK. LDR'S. DEVICE
	AND	(77777		/MASK OFF UNIT NUMBER.
	DAC*	(.SCOM+7		/NUMBERS TO AVOID DUPLICATE
	LAC*	.DATM4		/LOADING IF USER REQUIRES
	AND	(77777
	DAC*	(.SCOM+10		/SAME DEVICES.
	LAC*	.DATM5
	AND	(77777
	DAC*	(.SCOM+11
	LAW	-1		/.IODEV .DAT SLOT -1
	JMS	IOPROS
	LAW	-5		/.IODEV .DAT SLOT -5
	JMS	IOPROS
.SEXCT	LAW	-4		/.IODEV .DAT SLOT -4
	JMS	IOPROS
	JMP	SEEKLB		/GO TO ^X BUFFER ALLOCATION ALGORITHM
	.EJECT
	.IFPOZ LNBUFF+257-.	/(GAR-057)
	.BLOCK LNBUFF+260-.	/(GAR-057)
	.ENDC
/ ^^^^^^  END OF INPUT BUFFERS  ^^^^^^
SL.BDEV	0		/(RKB-063) TRANSLATED MEMONIC OF BATCH DEV
NOLOAD	0		/SELECTIVE LOADING FLAG
RECDIN	0		/0=START OF NEW FILE
LNBUF	LNBUFF		/ADDRESS OF LINE BUFFER #1
LN2BUF	L2BUFF		/ADDRESS OF LINE BUFFER #2
LNBUFP	0		/LINE BUFFER POINTER
NAMTBV	NAMTBL		/(GAR-057) ADDRESS OF HANDLER NAME TABLE.
			/(GAR-057) THIS TABLE IS USED TO RECORD THE SIXBT
			/(GAR-057) REPRESENTATIONS OF THE HANDLERS LOADED.
			/(GAR-057) EACH TIME A HANDLER IS TO BE LOADED, THIS
			/(GAR-057) TABLE IS CHECKED TO MAKE SURE THAT DIFFERENT
			/(GAR-057) FLAVORS OF THE SAME HANDLER ARE NOT LOADED.
			/(GAR-057) IF THIS IS ATTEMPTED A .SYSLD 9 ERROR IS GIVEN.
/
WDCNT	0			/LINE BUFFER WORD COUNT.
CODEWD	0			/BINARY CODE WORD (3 CODES).
CWDTAL	0			/CODE WORD COUNT.
LRELOC	0			/CURRENT RELOCATION FACTOR
LPLA	0			/LOAD ADDRESS.
LSYM1	0			/1ST WORD OF SYMBOL.
LSYM2	0			/2ND WORD OF SYMBOL.
LSMDEF	0			/SYMBOL TYPE AND DEF.
LPRES	0			/LOWEST FREE ADDRESS.
LSMST	0			/SYMBOL TABLE START.
LSMEND	0			/SYMBOL TABLE END.
LSMW1	0			/PRESENT STORE ADDRESS OF SYMBOL TABLE.
LSMPT	0			/PRESENT WORD COUNTER IN SYMBOL ENTRY
SYSPNT	0			/POINTER TO SYS. PROG. TABLE ENTRY.
IODVCT	0			/.IODEV COUNTER.
LDATA1	0
LDATA2	0
LDATA3	0
XBANK	0			/MEMORY BANK BITS.
XXBANK	0
LSTRNG	0			/STRING CODE
LLDDIR	.SIXBT	/.LOAD@BIN/	/CHANGED TO /EXECUTBIN/
				/WHEN LOADING EXECUTE.
SCOM5	0			/START ADDRESS OF SYSTEM PROG.
SCOM5S	0			/SAVE JMP.T1 ADDR.
LTEMP1	100			/GENERAL TEMP. STORAGE 1
LIT100=.-1			/(RKB-056) CONSTANT FOR INITIALIZATION CODE
LTEMP2	13500			/GENERAL TEMP. STORAGE 2
LIT135=.-1			/(RKB-056) CONSTANT FOR INITIALIZATION CODE
LTEMP4	0			/GENERAL TEMP. STORAGE 4
	0
ERRFLG	0			/SELECTIVE LOADING
LLPRES	0			/BACKUP CELLS.
MOVCNT	0			/2'S COMP OF SIZE OF IOC TABLE.
MOVADD	0			/BOTTOM ADDRESS OF IOC TABLE.
NAMCNT	-1			/(GAR-057) NO. OF HANDLERS LOADED.
NAMCTT	0			/(GAR-057) TEMP. STORAGE.
NAMPTR	0			/(GAR-057) TEMP. POINTER.
NAM1	0			/(GAR-057) TEMP. STORAGE.
NAM2	0			/(GAR-057) TEMP. STORAGE.
/
	.EJECT
SWITCH=.	/THIS REGISTER IS USED AS A SWITCH -- ZEROED FOR
	/SECOND LIBR SEARCH WHEN LOADING EXECUTE'S HANDLERS.
NOTLL=.				/COME HERE FOR SYS FILE SYSTEM PROGRAMS
CHKMRE	LAC	17636		/PICK UP NEXT .DAT SLOT FROM HIGH CORE
	SNA			/0 .DAT SLOT MEANS END OF LIST
	JMP	SEEKLB		/GO TO ^X BUFFER ALLOCATION
	SPA			/NEGATIVE MEANS .IODEV ALL
	JMP	IODALL
	JMS	IOPROS		/.IODEV .DAT SLOT
CHKMR1	LAW	-1		/GET NEXT POSITION
	TAD	CHKMRE
	DAC	CHKMRE
	JMP	CHKMRE		/ITERATE
SEEKLB	.USER	-7,IOS		/(RKB-054) TAKE .USER, .INIT OUT OF LOOP
	.INIT	-7,0,0		/(RKB-054) BECAUSE IT MAKES US RUN FASTER
R50REP=.-1				/(RKB-054)
SEEKLP	JMS	SUGR		/ANY MORE HANDLERS NEEDED?
	JMP	IOR1		/NO
	LAW	-1		/BACK UP POINTER TO FIRST HALF OF SYMBOL
	TAD	LSMPT
	DAC	LSMPT
	LAC*	LSMPT		/PICK UP FIRST HALF OF SYMBOL
	AND	(177777		/CLEAN OFF BIT 0
/
/
/(RKB-056) THE FOLLOWING RADIX 50 TO .SIXBT CONVERT ROUTINE
/(RKB-056) HAS BEEN COMPLETELY REPLACED FROM OLDER VERSIONS
/
/
	IDIV			/(RKB-056) GET THE LAST CHAR IN AC
	50			/(RKB-056)
	DAC	HANAM		/(RKB-056) SAVE IN RIGHT PLACE IN .SIXBT
ECLA=641000			/(RKB-056) EAE CLEAR AC AT TIME 0
	ECLA!DIV			/(RKB-056) CLEAR AC AND DIVIDE AC-MQ
	50			/(RKB-056) TO PRODUCE SECOND CHAR IN AC, THIRD IN MQ
	LLSS	6		/(RKB-056) MOVE SECOND CHAR TO RIGHT PLACE
	XOR	HANAM		/(RKB-056) AND COMBINE WITH LAST
	PAL			/(RKB-056) SAVE THESE TWO IN THE LIMIT
	LLSS	6		/(RKB-056) MOVE FIRST TO RIGHT PLACE
	PLA			/(RKB-056) RECALL FIRST TWO
	OMQ			/(RKB-056) COMBINE WITH LAST OR FIRST, I DON'T KNOW
/
/
/(RKB-056) END OF NEW RAD50 CONVERT ROUTINE
/
	DAC	HANAM		/(GAR-057) STORE FOR FILE NAME
	LAC	NAMTBV		/(GAR-057) ADDRESS OF NAME TABLE.
	DAC	NAMPTR		/(GAR-057) SET UP POINTER.
	LAC	NAMCNT		/(GAR-057) PICK UP NO. OF NAMES IN TABLE.
	SNA!CLL			/(GAR-057) ARE THERE ANY NAMES IN THE TABLE?
				/(GAR-057) THE LINK IS USED TO DECIDE WHETHER
				/(GAR-057) A HANDLER NAME SOULD BE ENTERED
				/(GAR-057) INTO THE HANDLER NAME TABLE.
				/(GAR-057) THIS IS USED TO AVOID PUTTING ANY NAME
				/(GAR-057) IN MORE THAN ONCE. WHICH ONLY
				/(GAR-057) SERVES TO SPEED UP THE TABLE SCAN.
	JMP	CHK.1		/(GAR-057) NO, SIMPLY ENTER THE FIRST NAME.
	DAC	NAMCTT		/(GAR-057) YES, SET UP COUNTER.
	LAC	HANAM		/(GAR-057) GET HANDLER NAME IN SIXBT.
/(GAR-057)
/(GAR-057)	CHECK FOR MATCH ON HANDLER TYPE (FIRST TWO CHAR.)
/(GAR-057)
	AND	(777700)	/(GAR-057) LOOK AT FIRST TWO CHAR.
	DAC	NAM1		/(GAR-057) PUT IN TEMP. STOR.
CHKLP	LAC*	NAMPTR		/(GAR-057) PICK UP NAME FROM TABLE.
	AND	(777700)	/(GAR-057) 
	SAD	NAM1		/(GAR-057) DOES CURRENT NAME MATCH TABLE?
	JMP	CHKLSC		/(GAR-057) YES, GO CHECK RIGHT-MOST CHAR.
CHKLPA	ISZ	NAMPTR		/(GAR-057) NO, BUMP POINTER TO NEXT TABLE ENTRY.
	ISZ	NAMCTT		/(GAR-057) ARE THERE MORE ENTRIES?
	JMP	CHKLP		/(GAR-057) YES.
/(GAR-057)
/(GAR-057)	THE CURRENT HANDLER DOES NOT CONFLICT WITH ANY
/(GAR-057)	PREVIOUSLY LOADED HANDLERS.  ENTER ITS NAME INTO THE TABLE
/(GAR-057)	AND LOAD IT.
/(GAR-057)
CHK.1	LAC	HANAM		/(GAR-057) GET THE NAME.
	DAC*	NAMPTR		/(GAR-057) PUT IT INTO THE TABLE.
	LAC	NAMCNT		/(GAR-057) INCREMENT THE COUNT ...
	AAC	-1		/(GAR-057) AND ...
	SNL			/(GAR-057) IF THE LINK IS NON-ZERO, THE CURRENT
				/(GAR-057) HANDLER NAME IS ALREADY IN THE
				/(GAR-057) TABLE AND IT IS NOT NECESSARY TO
				/(GAR-057) TO PUT IT IN AGAIN.
	DAC	NAMCNT		/(GAR-257) PUT IT BACK.
	JMP	SKHAND		/(GAR-057) GO LOAD THE HANDLER.
/(GAR-057)
/(GAR-057)	CHECK THE RIGHT-MOST CHAR. FOR POSSIBLE HANDLER CONFLICT.
/(GAR-057)
CHKLSC	STL			/(GAR-057) IF THE NON-ERROR EXIT IS TAKEN
				/(GAR-057) FROM THIS SECTION, THE LINK WILL
				/(GAR-057) INDICATE THAT WE HAVE A CURRENT HANDLER
				/(GAR-057) NAME WHICH IS ALREADY IN THE
				/(GAR-057) HANDLER NAME TABLE AND THAT IT IS NOT
				/(GAR-057) NECESSARY TO PUT IT IN AGAIN.
	LAC	HANAM		/(GAR-057) PICK UP NAME.
	AND	(77)		/(GAR-057) JUST THE RIGHT-MOST CHAR.
	DAC	NAM2		/(GAR-057) PUT IN TEMP. STOR.
	LAC*	NAMPTR		/(GAR-057) GET ENTRY FROM TABLE.
	AND	(77)		/(GAR-057)
	SAD	NAM2		/(GAR-057) HANDLER CONFLICT?
	JMP	CHKLPA		/(GAR-057) NO, CONTINUE TABLE SCAN.
	JMS	ERROR9		/(RKB-061)(GAR-057) YES, GO GIVE .SYSLD 9 ERROR.
	JMP	CHKLPA		/(RKB-061) NOW IGNORE THE ERROR
SKHAND	.SEEK	-7,HANAM	/(RKB-056)(GAR-057) SEEK HANDLER.
XKMD01=.-1				/(RKB-056) FOR BANK BIT INITIALIZAION
	DZM	RECDIN	/NEW FILE
	JMS	LL000		/LOAD HANDLER
	.CLOSE	-7
	JMP	SEEKLP		/(RKB-054)ITERATE UNTIL FINISHED LOADING HANDLERS
HANAM	.SIXBT	'@@@.@@BIN'	/(RKB-056) HANDLER FILE NAME
	.EJECT
IOR1	LAC	TESL1			/WHAT PROGRAM ARE WE LOADING
	SNA
	JMP	FILELD			/LINKING LOADER
	SAD	(14		/$INSTRUCT?
	JMP	FILELD
	SAD	(13
	SKP
	JMP	GOTOEX			/SYS FILE
	LAC	SWITCH		/LOADING EXECUTE; SECOND LIBRARY SEARCH?
	SZA
	JMP	EXECUT		/NO; SET UP TO LOAD EXECUTE FILE HANDLERS
	JMS	NOACSL		/SET UP ACTIVE .DAT SLOT BUSY TABLE
	LAC	LPRES			/EXECUTE LOAD REQUIRES .SCOM+1 JUST
	DAC*	(.SCOM+1		/START OF EXECUTE
	LAC*	.DATM7
	DAC	DM7BU1
	LAC	DM7BUF
	DAC*	.DATM7
/
/ RELOCATE AND LOAD EXECUTE OR LINKING LOADER
/
FILELD	-7&777			/.USER -7,BNK OR PAG
	23
UFDM7A	XX			/INITIALIZED BEFORE USED
	-7&777			/.INIT -7
	1
	0
	0
	-7&777			/.SEEK .LOAD/EXECUTE/INSTRC FILE -7
	3			/ ON SYSTEM DEVICE
XKMD02	LLDDIR
	DZM	NOLOAD		/NON-SELECTIVE LOADING.
	DZM	RECDIN		/NEW FILE.
	JMS	LL000		/READ IN LINK. LOADER. OR EXECUTE
	DAC*	(.SCOM+5		/STARTING ADDRESS.
	DAC	SCOM5
	CAL	771		/.CLOSE .LOAD/EXECUTE FILE
	6
MOVBCK	LAC	TESL1			/ARE WE LOADING EXECUTE?
	SAD	(13		/NO.  LINKING LOADER?
	JMP	GOTOE1			/YES; FINISH UP
	JMS	NOACSL		/NO. SET UP ACTIVE .DAT SLOT BUSY TABLE
MOVBC1	LAC*	MOVADD		/ROUTINE TO MOVE
	DAC*	LPRES		/IOC TABLE FROM
	ISZ	MOVADD		/SYSTEM LOADER AREA
	ISZ	LPRES		/TO LINKING LOADER
	ISZ	MOVCNT		/AREA .
	JMP	MOVBC1
	JMP	GOTO2		/NO.
	.EJECT
/
/	ALLOCATE BUFFERS
/
GOTOEX	LAC*	SCM30		/PERFORM INDIRECTION ON BUFFER POINTER
	DAC	SCM30		/THIS POINTS TO THE FIRST WORD OF THE
				/BUFFER TRANSFER VECTOR TABLE FOR DYNAMIC
				/BUFFER ALLOCATION
	JMS	NOACSL		/SET UP ACTIVE .DAT SLOT BUSY TABLE
	LAC*	SCM26		/GET THE NUMBER OF BUFFERS TO BE ALLOCATED
	CMA			/GET THE NEGATIVE OF THIS NUMBER -1
	DAC	SCM26		/STORE BACK IN POINTER SINCE NOT NEEDED
GOTO1	ISZ	SCM26		/ARE THERE ANY MORE BUFFERS TO BE ALLOCATED
	SKP
	JMP	NONLLD		/NO
	LAC*	SCM27		/GET THE BUFFER SIZE
	JMS	ABUF		/ASSIGN THE BUFFER IF ROOM WITHOUT TESTING
	LAC	LRELOC		/FOR BEING WITHIN PAGE BOUNDS
	DAC*	SCM30		/STORE IN THE RESIDENT MONITOR TABLE
	ISZ	SCM30		/BUMP POINTER TO NEXT ENTRY
	JMP	GOTO1		/ITERATE
GOTOE1	LAC	DM7BU1		/RESTORE .DAT-7
	DAC*	.DATM7
GOTO2	LAC	LPRES		/EXIT FOR .LOAD AND EXECUT
	DAC*	(.SCOM+2		/LOWEST FREE ADDRESS.
	LAC*	(.SCOM
	DAC*	(.SCOM+3		/HIGHEST FREE ADDRESS
	JMS	BOSCK1		/SET UP RESIDENT BOSS IF NECESSARY
	XCT	SKPPAG	/IF PDP-15, ENTER PAGE ADDRESSING MODE
	JMP*	SCOM5
	LAC	(2000
	XOR*	(.SCOM+4
	DAC*	(.SCOM+4
	DBA		/BEFORE GOING TO LOADER OR EXECUTE.
	JMP* SCOM5&767777
TESL1	0			/CONTAINS PROGRAM CODE
/
/.SCOM REGISTERS ASSOCIATED WITH DYNAMIC FILES BUFFER ALLOCATION
/
SCM30	.SCOM+30		/FILE BUFFER TRANSFER VECTOR TABLE POINTER
SCM27	.SCOM+27		/SIZE OF FILE BUFFERS
SCM26	.SCOM+26		/NUMBER OF FILE BUFFERS
SCM62	.SCOM+62		/NUMBER OF ENTRIES PER BUFFER
	.EJECT
/
/ EXECUTE -- GET .IODEV INFORMATION FROM 'XCT' FILE
/
EXECUT	LAC*	.DATM7	/REASSIGN .DAT-7 TO READ
	DAC	DM7BUF	/THE 'XCT' FILE.  (SPECIAL
	LAC	DM7XCT	/REASSIGNMENT WHEN EXECUTE
	SNA		/AND .SYSLD USE THE SAME DEV.
	LAC*	.DATM4
	DAC*	.DATM7
	-7&777		/.USER TO CONTENTS OF .UFD-4
	23
UFDM4	XX
	XCT	SKPBNK	/IF PDP-15, ENTER PAGE MODE IF NECESSARY
	XCT	EPM
	CAL	771	/.INIT -7 FOR INPUT
	1
	0
	0
	CAL	771	/.SEEK -7
	3
	.SCOM+7		/FILENAME XCT
	EBA
XREAD=.
	XCT	SKPBNK	/IF PDP-15, ENTER PAGE MODE IF NECESSARY
	XCT	EPM
	CAL	771	/.READ -7 (IOPS BIN)
	10
XKMD04	L2BUFF
	-62
	CAL	771	/.WAIT -7
	12
	EBA
	LAC	L2BUFF	/GET HEADER
	AND	(077)
	SNA
	JMP	XCTROK	/NORMAL READ -- EXAMINE RECORD
			/ABNORMAL READ -- TEST FOR
			/EOF, EOM, OR ERR
	SAD	(005)
	JMP	XREAD	/EOF -- IGNORE, READ NEXT RECORD
	.CLOSE	-7
	JMP	ERROR2	/ERR -- TERMINATE
	.EJECT
/
XCTROK	LAC	L2BUFF+2	/GET SUBRECORD HEADER
	AND	(700000)
	SAD	(100000)	/TYPE-ONE RECORD?
	SKP
	JMP	XREAD	/NO -- READ NEXT RECORD
	LAC	L2BUFF+3	/YES -- .DAT INFO RECORD?
	SAD	(377777)	/        (LINK #377777)
	SKP		/YES -- LOAD I/O HANDLERS FOR THE 
			/       OVERLAY SYSTEM TO BE RUN
	JMP	XREAD	/NO -- READ NEXT RECORD
BITCNT=.	/THIS REGISTER IS ALSO USED AS BIT COUNTER FOR NEXT LOOP
	XCT	SKPBNK	/IF PDP-15, ENTER PAGE MODE IF NECESSARY
	XCT	EPM
	CAL	771	/.CLOSE -7
	6
	EBA
	LAC	DM7BUF	/RESTORE .DAT-7 ASSIGNMENT 
	DAC*	.DATM7
	-7&777		/.USER TO CONTENTS OF .UFD-7 BEFORE ABOVE .USER
	23
UFDM7	XX
	.EJECT
/
XCTLP1	IDX	XCTTMP	/SETUP TO EXAMINE A MAP-WORD REPRESENTING
	LAW	-22	/18 .DAT SLOTS.  (FIVE WORDS FOR SLOTS
	DAC	BITCNT	/.DAT-18 THRU .DAT+71)
/
XCTLP2	LAC*	XCTTMP	/MAKE A GLOBAL SYMBOL REFERENCE TO THE 
	RCL		/HANDLER ASSIGNED TO EACH .DAT SLOT WITH
	DAC*	XCTTMP	/ITS CORESPONDING MAP-WORD-BIT SET.
	SNL
	JMP	WICK1	/BIT NOT SET
	LAC	IODVNM	/.IODEV SLOT #
	SNA
	JMP	IODALL		/.DAT+0 MEANS ALL POSITIVE
	JMS	IOPROS	/PROCESS .IODEV
WICK1	ISZ	IODVNM
NOPLIT	NOP			/(RKB-056) USED AS LITERAL
	ISZ	BITCNT
	JMP	XCTLP2
	ISZ	WRDCNT
	JMP	XCTLP1
	DZM	SWITCH	/ALL HANDLERS "REFERENCED" -- CLEAR SWITCH
			/TO INDICATE SECOND LIBRARY SEARCH (IF ANY)
	JMP	SEEKLB		/GO TEST FOR SECOND LIBRARY SEARCH NEEDED
/
DM7BUF	0	/BUFFER FOR NORMAL .DAT-7 ASSIGNMENT WHILE READING 'XCT' FILE 
DM7BU1	0
DM7XCT	0	/SPECIAL .DAT-7 ASSIGNMENT FOR READING THE 'XCT' FILE
		/IF ZERO, THE .DAT-4 ASSIGNMENT IS MADE FOR .DAT-7 TO
		/READ THE 'XCT' FILE.
XCTTMP	L2BUFF+12	/RECORD BUFFER POINTER
WRDCNT	-5		/5 .IODEV WORDS
IODVNM	-22		/START WITH .DAT-22
	.EJECT
/
/
/
/(RKB-056) FOLLOWING X4K-RELATED CODE REMOVED.
/
/NONLLD	LAC*	(SCOM20		/SET .SCOM+20 TO LOWEST
/	XOR	LPRESX		/FREE ADDRESS IN
/	DAC*	(SCOM20		/XTRA 4K.		
/
/(RKB-056) END OF REMOVED X4K CODE.
/
/
NONLLD	LAC	LPRES
	DAC*	(.SCOM+2		/LOWEST FREE ADDRESS
	JMS	BOSCK1		/INITIALIZE BOSS-15 .DAT SLOTS
	0				/.OVRLA
	24
	.SCOM+43			/CUSP NAME
	JMP	ERROR4			/.SYSLD 1
/
	.EJECT
/PROCESS .IODEV ALL REQUEST.
/ALL POSITIVE .DAT SLOTS THAT DO NOT
/CONTAIN 0 ARE REQUESTED.
/
IODALL	CLA!IAC
	DAC	LTEMP4		/.DAT SLOT NO.
	TAD*	(.SCOM+23
	DAC	LTEMP2		/ADDRESS OF .DAT SLOT.
	LAC*	(.SCOM+24	/PUT # POSITIVE .DAT SLOTS IN AC
	CMA			/GET THE NEGATIVE -1
	TAD	LTEMP4
	SMA!CLA
	JMP	SEE1		/END OF .DAT TABLE
	LAC*	LTEMP2
	SNA
	JMP	NULDAT		/BYPASS 0 SLOT.
	LAC	LTEMP4
	JMS	IOPROS
NULDAT	LAC	LTEMP4
	IAC
	JMP	IODALL+1
SEE1	SAD	IODVNM
	JMP	WICK1
	JMP	CHKMR1
	.EJECT
/ SUGR -- SUBROUTINE TO SCAN (SYMBOL TABLE) FOR UNRESOLVED GLOBAL REFERENCES
/
/ RETURN AT JMS+1 -- NO UNRESOLVED GLOBALS FOUND
/ RETURN AT JMS+2 -- AN UNRESOLVED GLOBAL REFERENCE HAS BEEN FOUND
/
SUGR	0
	LAC	LSMST
SUGR1	DAC	LSMPT
	DAC	LSMW1
	SAD	LSMEND
	JMP*	SUGR	/RETURN AT JMS+1
	LAC*	LSMPT
	AND	(700000)
	SAD	(100000)
	JMP	.+3
	JMS	NXCNT
	JMP	SUGR1
	ISZ	SUGR	/RETURN AT JMS+2
	JMP*	SUGR
BOSCK	0			/ROUTINE TO SET .DAT -7 IN BOSS-15 MODE
	LAC*	.DAT0		/SET UP .DAT-7 IN CASE OF BOSS-15
	DAC*	.DATM7
	LAC*	(.SCOM+42	/ARE WE IN BOSS-15 MODE?
	AND	(4
	SNA
	DZM*	.DATM7		/CLEAR OUT SYSTEM LOADER .DAT SLOT
	LAC	.DAT0
	DAC*	.DAT0
	JMP*	BOSCK		/EXIT
BOSCK1	0		/ENTRY POINT FOR ROUTINE TO SET
				/BOSS-15 .DAT SLOTS FOR RESIDENT BOSS
	LAC*	(.SCOM+42		/ARE WE LOADING A CUSP UNDER BOSS15
	AND	(05
	SAD	(05
	SKP			/YES
	JMP*	BOSCK1		/NO; EXIT
	LAC*	(.SCOM+52)	/(RKB-054) IS IT BATCH OR BOSS?
	SPA			/(RKB-054) SKIP IF BATCH
	JMP	BOSK1		/(RKB-054) ITS BOSS
	LAC*	(SC.BUIC)	/(RKB-054) MOVE IN BATCH FILE UIC
	DAC	BOSK1+2		/(RKB-054) STUFF IT IN .USER
	LAC	(SC.BFN)	/(RKB-062) MOVE IN BATCH FILE NAME POINTER
	DAC	BBPFIL		/(RKB-062) TO THE .SEEK MACRO
BOSK1	.USER	-7,CTP		/(RKB-054) POINT TO RIGHT UIC
/   NOTE:
/ THE FOLLOWING NOP OR DBA INSTRUCTION IS NECESSARY BECAUSE
/ THE I/O DEVICE HANDLERS HAVE ALL BEEN LOADED AT THIS POINT
/ USING EITHER 12 OR 13 BIT RELOCATION, DEPENDING ON THE
/ MODE IN WHICH THE CORE LOAD IS TO RUN.  THEREFORE, WE MUST
/ ENTER PAGE MODE BEFORE INVOKING THE -7 HANDLER IF IT WAS
/ RELOCATED FOR PAGE MODE.  ALSO, SINCE THE SYSTEM LOADER
/ (US) WAS RELOCATED FOR BANK MODE ONLY, WE MUST RE-ENTER
/ BANK MODE UPON RETRUN FROM THE HANDLER.
/
BOSRMD	NOP			/THIS INSTRUCTION IS CHANGED
				/A "DBA" IF WE ARE LOADING THE
				/LINKING OR EXECUTE LOADERS
				/AND WE ARE A PAGE SYSTEM
	.INIT	-7,0,0		/(RKB-054) INIT THE BATCH OR BOSS DEVICE
	.SEEK	-7,PROCNM	/(RKB-054) OPEN THE BATCH FILE OR THE RTF
BBPFIL=.-1
	.WAIT	-7		/(RKB-054) TRY TO GIVE DECTAPE A CHANCE
	EBA			/MAKE SURE WE ARE IN BANK MODE
	JMP*	BOSCK1		/EXIT
PROCNM	.SIXBT	'PRCFILPRC'
	.EJECT
/SUBROUTINE TO LOAD A PROGRAM UNIT.
/RETURNS WITH STARTING ADDRESS IN AC.
/IT IS DOUBLE BUFFERED.
/
LL000	0
LL002	LAC	RECDIN			/IS .READ IN PROGRESS.
	SZA
	JMP	LL019			/YES
LL018	LAC	LNBUF			/NO. SET POINTER
	DAC	LNBUFP			/TO BUFFER A.
	DAC	LL010+2
	LAC	LN2BUF			/SET UP 2ND .READ TO
	DAC	LL016			/READ INTO L2BUFF.
/.READ	.-7,B,LNBUFF,50			/READ ONE LINE BUFFER.
LL010	CAL	771			/OF BINARY WORDS
	10				/INTO LNBUFF.
	LNBUFF
	-62
/.WAIT	,.-7				/WAIT FOR BINARY INPUT
LL014	CAL	771
	12
LL001	LAC*	LNBUFP			/CHECK BITS 12
	AND	(60			/AND 13 OF 1ST
	SZA				/WORD OF L.B. HEADER
	JMP	ERROR2			/FOR PARITY, CHECKSUM, BUF. OVERFLOW
	LAC*	LNBUFP			/PICK UP THE WORD
	AND	(377000			/PAIR COUNT AND
	CLL!RAL				/MULTIPLY BY 2
	TAD	(776000			/SUBTRACT 2 FOR HEADER
	DAC	WDCNT
	SNA!CLL!CML			/L=1,NO DATA WORDS.
	JMP*	LL000			/POSSIBLY EOF LINE.
/
/.READ	,.-7,B,BUFFX,50			/NO
LL015	CAL	771			/READ ONE LINE OF
	10				/BINARY WORDS INTO
LL016	XX			/L2BUFF OR LNBUFF.
	-62
	CLA!CMA				/INDICATES READ
	DAC	RECDIN			/IS IN PROGRESS.
/
	.EJECT
/DATA CODE WORD FETCH ROUTINE
/THIS ROUTINE SELECTS THE CODE WORD FROM THE LINE
/BUFFER AND DETERMINES WHICH DATA WORD PROCESSING
/ROUTINE TO ENTER
/
LL041	ISZ	LNBUFP		/SET LINE BUFFER POINTER TO
	ISZ	LNBUFP		/BEGINNING OF DATA
LL005	LAW	-4		/COUNT TO DETERMINE WHEN
	DAC	CWDTAL		/NEXT CODE WORD IS TO BE SELECTED
	JMS	WRDCHK		/PICK UP WORD MOVE BUFFER POINTER
	DAC	CODEWD		/STORE CODE WORD
CODE1	ISZ	CWDTAL		/DECREASE CODE TALLY WORD
	SKP
	JMP	LL005		/GO  GET NEXT CODE WORD.
	LAC	CODEWD		/SHIFT CURRENT CODE
	RTL			/TO BITS (12-17) OF AC
	RTL
	RTL
	DAC	CODEWD
	RAL
	AND	(77
	DAC	LTEMP1		/CODE IN BITS (12-17)
	LAC	NOLOAD
	SNA
	JMP	LL009		/NON-SELECTIVE LOADING
	LAC	LTEMP1		/SELECTIVE LOADING.
	SAD	(12		/INTERNAL GLOBAL DEF. (CODE 10)
	JMP	LL009
	SAD	(1		/PROGRAM SIZE (CODE 1)
	JMP	LL009
	SAD	(7		/1ST 3 CHARS. OF SYMBOL
	JMP	LL009		/ (CODE 7)
	SAD	(10		/2ND 3 CHARS  OF SYMBOL
	JMP	LL009		/ (CODE 8)
	XCT	SKPPAG		/OMIT PROCESSING .EBREL OR .DBREL IN
	JMP	CD1D		/BANK MODE SYSTEM
	SAD	(31		/.EBREL
	JMP	LL009
	SAD	(32
	JMP	LL009		/.DBREL
CD1D	SAD	(27		/END OF PROGRAM UNIT (CODE23)
	JMP	LL009
	JMS	WRDCHK		/BYPASS DATA WORD.
	JMP	CODE1		/FETCH NEXT CODE
	.EJECT
LL009	LAC	LTEMP1		/CODE (BITS 12-17)
	TAD	(-34
	SMA
	JMP	ERROR2		/>32
	LAC	LTEMP1
	TAD	(JMP ENTRY	/DISPATCH TO APPROPRIATE
	DAC	.+2		/DATA WORD PROCESSOR
	JMS	WRDCHK		/LOAD DATA WORD.
	XX
/
/TABLE OF DATA WORD PROCESSOR ADDRESSES
ENTRY	JMP	ERROR2	/CODE 00 - ILLEGAL
	JMP	LCD01	/CODE 01
	JMP	LCD02	/CODE 02
	JMP	LCD03	/CODE 03
	JMP	LCD04	/CODE 04
	JMP	LCD05	/CODE 05
	JMP	LCD06	/CODE 06
	JMP	LCD07	/CODE 07
	JMP	LCD08	/CODE 08
	JMP	LCD09	/CODE 09
	JMP	LCD10	/CODE 10
	JMP	CODE1	/CODE 11 IGNORED
	JMP	CODE1	/CODE 12 IGNORED
	JMP	CODE1	/CODE 13 IGNORED
	JMP	CODE1	/CODE 14 IGNORED
	JMP	LCD15	/CODE 15
	JMP	LCD16	/CODE 16
	JMP	LCD17	/CODE 17
	JMP	LCD18	/CODE 18
	JMP	CODE1	/CODE 19 IGNORED
	JMP	CODE1	/CODE 20 IGNORED
	JMP	CODE1	/CODE 21 IGNORED
	JMP	CODE1	/CODE 22 IGNORED
	JMP	LCD23	/CODE 23
	JMP	CODE1	/CODE 24 IGNORED - 18 BIT PAR. ASSIGNMENT
	JMP	LCD25		/.EBREL
	JMP	LCD26		/.DBREL
	JMP	CODE1	/CODE 27 IGNORED
/
	.EJECT
/CODE 01 DATA WORD PROCESSOR-PROGRAM UNIT SIZE.
/
LCD01	SPA
	JMP	LDABS		/ABSOLUTE PROGRAM
	DZM	ERRFLG		/CLEAR MEM. OVERFLOW FLAG.
	DAC	LTEMP1
	TCA			/(RKB-056)
SKPBNK	XX
	TAD	(10000
SKPPAG	XX
	TAD	(20000
	SPA
	JMP	ERROR5
	LAC	LTEMP1
	JMS	ALLOC		/FIND PLACE FOR UNIT WITHIN PAGE BOUNDS
	JMP	CODE1		/FETCH NEXT DATA WORD.
LDABS	DZM	LRELOC		/ABSOLUTE LOAD
	JMP	CODE1
/
/
/	CODE 25 - .EBREL
/
LCD25	LAC	(17777
	SKP
/
/	CODE 26 - .DBREL
/
LCD26	LAC	(7777
	XCT	SKPBNK
	DAC	MASK
	JMP	CODE1
	.EJECT
WRDCHK	0			/CHECK IF BUFFER EXHAUSTED,
	LAC	WDCNT		/IF NOT RETURN WITH
	SNA			/WORD IN AC.
	JMP	LL002		/GO READ NEXT LINE.
	TAD	(777000		/DECREMENT WORD COUNT
	DAC	WDCNT		/BY 1.
	LAC*	LNBUFP		/PICK UP WORD.
	ISZ	LNBUFP		/INDEX POINTER.
	JMP*	WRDCHK
LL019	LAC	LL016		/SET UP TO PROCESS
	DAC	LNBUFP		/BUFFER JUST FILLED
	SAD	LNBUF
	JMP	LL020		/SET UP TO READ
	LAC	LNBUF		/INTO OTHER.
LL021	DAC	LL016
	JMP	LL014		/GO TO .WAIT
LL020	LAC	LN2BUF
	JMP	LL021
/
	.EJECT
/CODE 02 DATA WORD PROCESSOR - PROGRAM LOAD ADDRESS
/
				/THE PROGRAM LOAD ADDRESS IS ABSOLUTE
LCD02	TAD	LRELOC		/IF BIT 0 IS A ONE---LRELOC=0
	DAC	LPLA
	JMP	CODE1
/CODE 03 DATA WORD PROCESSOR - RELOCATABLE INSTRUCTION
/
/CODE 04 DATA WORD PROCESSOR - ABSOLUTE INSTR/CONST/ADDRESS
/
LCD03	JMS	LMOD13		/GO ADD CURRENT RELOCATION FACTOR[MOD 13]
LCD04	DAC*	LPLA		/TO DATA WORD. STORE DATA WORD IN ADDRESS
	ISZ	LPLA		/SPECIFIED BY PRESENT LOAD ADDRESS. RETURN
	JMP	CODE1		/TO PROCESS NEXT DATA WORD.
/CODE 05 DATA WORD PROCESSOR - RELOCATABLE VECTOR
/
LCD05	TAD	LRELOC		/ADD CURRENT RELOCATION FACTOR (MOD 15)
	JMP	LCD04		/STORE DATA WORD.
/CODE 06 DATA WORD PROCESSOR - NON COMMON STORAGE ALLOCATION
/
LCD06	TAD	LPLA		/ADD CURRENT PROGRAM LOAD ADDRESS
	DAC	LPLA		/STORE ADJUSTED LOAD ADDRESS
	JMP	CODE1		/RETURN TO PROCESS NEXT DATA WORD
/CODE 07 DATA WORD PROCESSOR - SYMBOL-FIRST THREE CHARACTERS
/			 - RADIX 50 (OCTAL)
LCD07	DAC	LSYM1		/STORE FIRST WORD OF SYMBOL IN TEMP. STORE.
	JMP	CODE1		/RETURN TO PROCESS NEXT DATA WORD.
/
/
/CODE 08 DATA WORD PROCESSOR - SYMBOL-SECOND THREE CHARACTERS
/			 - RADIX 50 (OCTAL)
LCD08	DAC	LSYM2		/STORE SECOND WORD OF SYMBOL IN TEMMPORARY
	JMP	CODE1		/STORAGE RETURN TO PROCESS NEXT DATA WORD
/
	.EJECT
/CODE 09 DATA WORD PROCESSOR - VIRTUAL GLOBAL SYMBOL DEFINITION
/
LCD09	TAD	(100000		/ADD CODE FLAG FOR VIRTUAL SYMBOL DEF.
	TAD	LRELOC		/ADD RELOCATION FACTOR
	DAC	LSMDEF		/STORE IN TEMPORARY DEFINITION LOCATION.
	JMS	LSMSCN		/SCAN SYMBOL TABLE TO DETERMINE IF THIS
	SZA			/SYMBOL HAS BEEN PREVIOUSLY ENTERED. GO SEE
	JMP	CD092		/IF SYMBOL HAS BEEN DEFINED
	JMS	LSMSTR		/STORE DEFINITION AND SYMBOL IN
	JMP	CODE1		/SYMBOL TABLE AS THIS SYMBOL  HAS NOT BEEN
/				/PREVIOUSLY ENTERED.
CD092	DAC*	LSMDEF		/STORE DEFINITION IN TRANSFER VECTOR.
	LAC*	LSMW1
	SPA			/IF GLOBAL IS STILL A VIRTUAL, GIVE IT
	JMP	CODE1		/THE ADDRESS OF THIS TRANSFER VECTOR
	LAC	LSMDEF		/AS ITS NEW DEFINITION (EFFECTIVELY
	DAC*	LSMW1		/STRINGING VIRTUAL VECTORS).
	JMP	CODE1
ERROR1	ISZ	ERRFLG
	LAC	NOLOAD		/MAY NOT BE
	SZA			/ERROR IF
	JMP	CODE1		/SELECTIVE LOAD.
ERROR4	LAW	1		/MEMORY OVERFLOW - SYSLD 01
ERRXIT	JMS	ERROUT		/(RKB-061) SOME ERRORS ARE NOW RECOVERABLE
	.EXIT			/(RKB-061) BUT NOT THESE.
ERROR3	LAW	3		/ALL GLOBALS NOT RESOLVED - .SYSLD 03
	JMP	ERRXIT
ERROR2	LAW	2		/DATA ERROR - .SYSLD 02
	JMP	ERRXIT
ERROR5	LAW	5		/.SYSLD 5; PROGRAM GREATER THAN PAGE 
	JMP	ERRXIT		/OR BANK BOUNDRY
ERROR9	XX			/(RKB-061) THIS ERROR IS RECOVERABLE
	LAW	770000		/(RKB-061) PREPARE TO CONVERT HANDLER NAME
	AND	HANAM		/(RKB-061) FROM SIXBT TO 5/7
	STL			/(RKB-061) THAT DOES IT FOR 1ST CHARACTER
	RAR			/(RKB-061)  ALMOST
	LMQ			/(RKB-061) STASH IT AWAY IN THE MQ
	LAC	HANAM		/(RKB-061) NOW FOR SECOND CHARACTER
	AND	(007700)	/(RKB-061) 
	CLL!RTR			/(RKB-061) RIGHT POSITION FOR 5/7
	OMQ			/(RKB-061) COMBINE WITH FIRST CHARACTER
	XOR	(2001)		/(RKB-061) ADD IN HIGH BIT OF SECOND CHAR,
				/(RKB-061)  PLUS 1ST 4 BITS OF CR TERMINATOR
	DAC	ERRMES+4	/(RKB-061) STUFF IN MESSAGE
	LAC*	(SC.BOS)	/(RKB-061) ARE WE IN BOSS MODE?
	SPA			/(RKB-061) SKIP IF NOT
	JMP	ERR9BOS		/(RKB-061) YES, DO MESSAGE DIFFERENTLY
	LAW	11		/(RKB-061) ERROR CODE 9
	JMS	ERROUT		/(RKB-061) PRINT IT
	CLA!IAC			/(RKB-061) RESET TO SHORT MESSAGES
	DAC	ERRMES+4	/(RKB-061)
	JMP*	ERROR9		/(RKB-061) ALL DONE
ERR9BOS	LAC	ERRMES+4	/(RKB-061) FETCH BACK DEVICE MNEMONIC
	DAC	ERR9BMG+20	/(RKB-061) PUT IN BOSS MESSAGE
	.WRITE	-3,2,ERR9BMG-2,10 /(RKB-061) PUT IT ON PRINTER
XKMD06=.-2			/(RKB-061) FOR BBI ROUTINE
	JMP*	ERROR9		/(RKB-061) A WAIT IS NOT NECESSARY
/
ERR9BMG	.ASCII	'LOAD ERROR -- MULTIPLE TYPES OF DEVICE  XX'<15>
/ 
/(RKB-061) THE ABOVE MESSAGE IS IN THE BOSS FORMAT AND MUST
/(RKB-061) SADLY BE OUTPUT HERE SINCE IT IS NON-FATAL.
/(RKB-061) NOTE PLEASE, THAT IN THE BOSS CASE THE NORMAL
/(RKB-061) .SYSLD 9 XX MESSAGE WILL NOT APPEAR ON THE 
/(RKB-0619 OPERATOR'S CONSOLE.  ALSO, THE JOB WILL NOT BE
/(RKB-061) TERMINATED (SC.BOS WILL NOT BE SETUP).
/
/
	.EJECT
/CODE 10 DATA WORD PROCESSOR - INTERNAL GLOBAL SYMBOL DEFINITION
/
LCD10	TAD	LRELOC		/ADD RELOCATION FACTOR
	DAC	LTEMP1		/SET SYMBOL DEFINITION
	TAD	(500000		/ADD INTERNAL GLOBAL SYM. DEF. CODE TO
	DAC	LSMDEF		/TO ADDRESS. STORE IN TEMPORARY DEFINITION
	JMS	LSMSCN		/LOCATION TILL SYMBOL IS LOCATED. GO SEE IF
	SZA			/SYMBOL HAS BEEN ENTERED IN SYMBOL TABLE.
	JMP	CD102		/JUMP IF SYMBOL IS IN THE TABLE.
	LAC	NOLOAD		/UNREQUESTED INTERNAL GLOBALS ARE LOADED
	SNA			/WHEN THEY FOLLOW REQUESTED GLOBALS OR
				/DURING UNCONDITIONAL LOADING.
	JMS	LSMSTR		/STORE DEFINITION AND SYMBOL IN SYMBOL
	JMP	CODE1		/TABLE AS THIS SYMBOL HAS NOT BEEN PREV-
/				/IOUSLY ENTERED.
CD102	DAC	LTEMP2		/SAVE REFERENCE ADDRESS IF UNDEFINED
	LAC*	LSMW1
	SMA			/CHECK TO SEE IF GLOBAL IS DEFINED
	JMP	CD103		/IF DEFINED, IT HAS ALREADY BEEN LOADED
	LAC	NOLOAD
	SZA
	JMP	CODE1
	ISZ	NOLOAD		/BACK UP POINTERS
	LAC	AJUST1		/AS THIS ROUTINE IS
	DAC*	LPRESP		/NOT BEING LOADED
	LAC	AJUST2
	DAC	LPRES
				/SO THE NO LOAD IS PUT INTO EFFECT AND
	JMP	CODE1		/THIS PART IS IGNORED.
CD103	LAC	ERRFLG
	SZA
	JMP	ERROR4		/ROUTINE DID NOT FIT.
	LAC	NOLOAD
	SZA
	JMS	AJUST		/NOW MOVE POINTER
	DZM	NOLOAD		/CLEAR FOR LOADING
	LAC	LSMDEF
	DAC*	LSMW1		/DEFINE SYMBOL AS INTERNAL GLOBAL
CD104	LAC*	LTEMP2
	AND	(77777		/MASK OFF UNIT NO.
	DAC	LSMDEF		/FETCH AND SAVE NEXT REFERENCE ADDRESS
	LAC*	LTEMP2
	AND	(700000		/PRESERVE UNIT NO.
	XOR	LTEMP1
	DAC*	LTEMP2
				/PUT SYMBOL DEF. IN CONTENTS OF REF. ADR.
	LAC	LSMDEF
	SAD	LTEMP2		/CHAIN IS COMPLETE WHEN NEXT CHAIN ADDR.
	JMP	CODE1		/IS EQUAL TO SELF.
	DAC	LTEMP2
	JMP	CD104
	.EJECT
/CODE 15 DATA WORD PROCESSOR - DATA INITIALIZATION CONSTANT (1ST WORD)
/
LCD15	DAC	LDATA1		/STORE DATA WORD FOR FUTURE USE.
	JMP	CODE1		/RETURN TO PROCESS NEXT DATA WORD.
/
/CODE16 DATA WORD PROCESSOR - DATA INITIALIZATION CONSTANT (2ND WORD)
/
LCD16	DAC	LDATA2		/STORE DATA WORD FOR FUTURE USE.
	JMP	CODE1		/RETURN TO PROCESS NEXT DATA WORD.
/
/CODE 17 DATA WORD PROCESSOR - DATA INITIALIZATION CONSTANT (3RD WORD).
/
LCD17	DAC	LDATA3		/STORE DATA WORD FOR FUTURE USE.
	JMP	CODE1		/RETURN TO PROCESS NEXT DATA WORD.
/
/CODE 18 DATA WORD PROCESSOR - DATA INITIALIZATION CONSTANT DEFINITION
/
				/ADD PRESENT RELOCATION FACTOR TO DATA
LCD18	TAD	LRELOC		/WORD ADDRESS. STORE THE ADJUSTED ADDRESS
CD182	DAC	LTEMP1		/IN TEMPORARY STORAGE FOR FURTHER REFERENCE.
	LAC	LDATA1		/STORE FIRST DATA INITIALIZATION CONSTANT.
	DAC*	LTEMP1
	ISZ	LTEMP1		/INCREMENT STORAGE ADDRESS FOR NEXT CON-
	LAC	LTEMP1		/STANT, IF ANY TO BE STORED, EXTRACT OUT ALL
	AND	(300000		/BITS OF DEFINITION WORD EXCEPT BITS 1-2.
	SAD	(300000		/TEST IF BITS 1-2 OF DATA WORD EQUAL 11
	JMP	CODE1		/IF SO RETURN TO PROCESS NEXT DATA WORD.
	SNA
	JMP	CODE1
	LAC	LDATA2		/STORE SECOND DATA WORD IN SPECIFIED ADDR.
	DAC*	LTEMP1
	ISZ	LTEMP1		/INCREMENT STORE ADDRESS FOR NEXT DATA WD.
	LAC	LTEMP1		/TEST BIT 1-2 OF DEFINITION WORD. IF EQUAL
	AND	(300000		/TO 01 (REAL CONSTANT) RETURN TO PROCESS
	SAD	(100000		/NEXT CODE WORD. IF NOT EQUAL TO 01, SELECT
	JMP	CODE1		/AND STORE THIRD CONSTANT WORD AS CONSTANT
	LAC	LDATA3		/MUST BE A DOUBLE PRECISION NUMBER
	DAC*	LTEMP1
	JMP	CODE1
/
	.EJECT
/SUBROUTINE TO PROCESS .IODEV REQUESTS.
/
.DATM7	0
.DATM5	0
.DATM4	0
.DATM3	0
.DATM1	0
.DAT0	0
SLOT1	0
IOPROS	0
	AND	(000777)	/ACCEPT POSITIVE, 18-BIT 2'S COMPL 
	TAD	(777400)	/NEGATIVE, OR 9-BIT 2'S COMPL .DAT
	XOR	(777400)	/SLOT REPRESENTATIONS.
	DAC	SLOT1
	TAD*	(.SCOM+23
	DAC	LTEMP2		/ADDRESS OF .DAT SLOT.
	LAC*	(.SCOM+24	/GET # POSITIVE .DAT SLOTS
	CMA			/GET NEGATIVE -1
	TAD	SLOT1
	SMA
	JMP	IOERR2		/ILLEGAL .DAT SLOT.
	LAC	(15
	TAD	SLOT1
	SPA
	JMP	IOERR2		/ILLEGAL .DAT SLOT.
	LAC*	LTEMP2
	AND	(77777
	SNA
	JMP*	IOPROS		/IGNORE .DAT SLOT WHEN 0
	SAD	(1
	JMP	IOTTY		/TT1.
	TAD	MOVCNT		/2'S COMP OF SIZE OF IOC TABLE.
	SMA			/NEG.
	JMP*	IOPROS		/.DAT SLOT ALREADY SET UP.
	TAD	IOCONF		/PICK UP 1ST 3 CHARS. OF SYMBOL.
	AND	(17777
	XOR	(200000		/LAC
	DAC	.+1
	HLT			/MODIFIED.
	DAC	LSYM1		/1ST 3 CHARS. OF SYMBOL.
	LAC	PER50		/4TH CHAR OF SYMBOL (.).
	DAC	LSYM2		/IN RADIX 50 (OCTAL).
	LAC	LTEMP2		/ADDRESS OF .DAT SLOT.
	TAD	(100000		/ADD CODE FLAG FOR VIRTUAL SYM. DEF.
	DAC	LSMDEF		/STORE IN TEMP. DEF. LOCATION.
	JMS	LSMSCN		/SCAN SYMBOL TABLE TO
	SZA			/DETERMINE IF THIS SYMBOL
	JMP	IOALIN		/HAS BEEN PREVIOUSLY ENTERED.
	JMS	LSMSTR		/STORE IN SYMBOL TABLE.
	LAC*	LTEMP2		/MAKE 1ST T.V. OF
	AND	(700000		/STRING POINT TO
	XOR	LTEMP2		/ITSELF TO TERMINATE
	DAC*	LTEMP2		/RESOLUTION OF GLOBALS.
	JMP*	IOPROS		/EXIT.
/
IOALIN    DAC        LTEMP1                /ADDRESS OF LAST T.V. IN CHAIN.
			/LTEMP1 CONTAINS THE SYMBOL DEFINITION (HANDLER
			/ENTRY POINT) IF HANDLER HAS ALREADY BEEN LOADED.
			/THIS CONDITION WILL OCCUR WHEN AN OVERLAY SUSTEM
			/USES EXECUTE'S I/O DEVICE.
/
	LAC*	LSMW1	/IF DEFINED, SET DEFINITION IN BITS 3-17 OF .DAT
	SPA		/SLOT INSTEAD OF STRINGING REFERENCES.
	JMP	IOPREU
          LAC        LSMDEF
          DAC*       LSMW1
          JMP        IOPREU
IOERR2	LAW	4		/ILLEGAL .DAT SLOT - SYSLD
          JMP        ERRXIT
IOTTY     LAC*       .DATM3               /ADDRESS OF TTY HANDLER.
          DAC*       LTEMP2
          JMP*       IOPROS
/
IOPREU    LAC*       LTEMP2                /PRRESERVE UNIT NO.
          AND        (700000
          XOR        LTEMP1
          JMP        IOTTY+1
IOCONF	0			/TOP ADDRESS OF IOC TABLE.
PER50	127400			/(.) IN RADIX 50(OCTAL).
/
	.EJECT
/
/	SUBROUTINE TO SET UP BUSY TABLE
/	JMS	NOACSL
/
NOACSL	0
	JMS	BOSCK		/SET UP DISK HANDLER TO .DAT -7 IF NEC.
	LAW	-7		/COMPUTE .DAT -16 
	TAD	.DATM7
	DAC*	(10		/FIRST FETCH GETS .DAT -15
	DZM	NOLOAD		/INITIALIZE COUNTER TO 0
	LAC*	(.SCOM+24	/COMPUTE COUNTER FOR # OF .DAT SLOTS
	TCA			/(RKB-056) COMPLEMENT
	AAC	-16
	DAC	TMP2
NOAC1	LAC*	10		/GET NEXT SLOT
	AND	(77777		/CLEAN OFF UNIT #
	TAD	MOVCNT		/IS IT SET UP?
	SMA
	ISZ	TMP1		/YES
	ISZ	TMP2		/ARE WE THROUGH
	JMP	NOAC1		/NO
	LAW	-2		/IGNORE .DAT -2,-3 AND LEAVE EXTRA
				/ONE SET ASIDE BY .DAT 0 FOR USER
				/SET UP .DAT SLOT AND FORTRAN RANDOM
				/ACCESS CALL DEFINE ROUTINE
	TAD	TMP1		/COMPUTE # OF ACTIVE SLOTS
	DAC*	(.SCOM+36	/PUT # IN .SCOM+36
	CMA
	DAC	TMP1
	CLA
NOAC2	ISZ	TMP1		/MULTIPLY BY ENTRY SIZE
	SKP			/NOT DONE YET
	JMP	NOAC3		/FINISHED
	TAD*	(.SCOM+63
	JMP	NOAC2
NOAC3	SNA!CMA			/COMPUTE COUNTER FOR CLEAR ROUTINE
	JMP*	NOACSL		/NOTHING TO CLEAR
	DAC	TMP2		/STORE AWAY
	CMA			/GET BACK ORIGINAL
	JMS	ALLOC		/CANNOT OVERLAP .SYSLD AS IT IS CLEARED
	LAC	LRELOC		/FETCH FIRST ADDRESS
	DAC*	SCM62		/PUT INTO .SCOM+62
	AAC	-1
	DAC*	(10		/SET UP AUTO INDEX REGISTER
NOAC4	ISZ	TMP2		/CLEAR ENTRIES IN BUSY TABLE
	SKP
	JMP*	NOACSL		/FINISHED; EXIT
	DZM*	10
	JMP	NOAC4
TMP1	0
TMP2	0
	.EJECT
/ CODE 23 DATA WORD PROCESSOR - END OF PROGRAM UNIT
/
LCD23	TAD	LRELOC		/ RETURN WITH START ADDRESS OF PGM.
	DAC	LTEMP1
	LAC	MASK1		/SET RELOCATION BACK TO DEFAULT
	XCT	SKPBNK
	DAC	MASK
	LAC	LTEMP1
	CLL
	JMP*	LL000		/ UNIT
/SYMBOL TABLE SCAN ROUTINE - THIS SUBPROGRAM SCANS THE SYMBOL TABLE
/   FOR EQUAL SYMBOLS AND RETURNS WITH THE SYMBOL DEFINITION
/   ENTRY IN ACCUMULATOR OR ALL ZEROS IN ACCUM.  IF NO MATCH FOUND.
/CALLING SEQUENCE
/	JMS	LSMSCN
LSMSCN	CAL	0
	LAC	LSMST		/ STORE SYMBOL TABLE STARTING ADDRESS IN
LSCN03	DAC	LSMW1		/ TEMPORARY POINTERS.
	DAC	LSMPT
	SAD	LSMEND		/ THE SYMBOL IS NOT IN THE TABLE IF ALL
	JMP	LSCN01		/ HAS BEEN SCANNED.
	LAC*	LSMW1
	XOR	LSMDEF		/ THE SYMBOL TO BE EXAMINED MUST BE THE
	AND	(300000		/ SAME TYPE AS THE SEARCH SYMBOL.
	SZA!CLA!CMA			/IE. GLOBAL VS. GLOBAL
	JMP	LSCN02		/ COMMON BLOCK NAME VS. SAME
	TAD	LSMPT
	DAC	LSMPT
	LAC*	LSMPT		/ THE SYMBOL IS FOUND WHEN THE NAME
	SAD	LSYM1		/ WORD(S) MATCH.
	JMP	LSCN04
	JMP	LSCN02
LSCN04	SMA!CLA!CMA
	JMP	LSCN05
	TAD	LSMPT
	DAC	LSMPT
	LAC*	LSMPT
	SAD	LSYM2
	JMP	LSCN05		/ THEN A MATCH CANNOT BE MADE, THE SEARCH
LSCN02	JMS	NXCNT		/ ADDRESS IS UPDATED TO THE NEXT ENTRY IN
	JMP	LSCN03		/ THE TABLE.
LSCN05	LAC*	LSMW1
	AND	(77777		/ THE DEFINITION OF THE SYMBOL IS RETURNED
	JMP*	LSMSCN		/ AS A SIGNAL DAT THE NAME WAS FOUND.
LSCN01	CLA
	JMP*	LSMSCN		/ ZERO INDICATES THE SYMBOL WAS NOT FOUND.
/
	.EJECT
/SUBROUTINE TO INCREMENT SYMBOL TABLE COUNTER
/TO POINT TO NEXT ENTRY.
NXCNT	0
	LAC	LSMW1		/ALL ENTRIES IN THE SYMBOL
	TAD	(777777		/TABLE ARE EITHER 2 OR 3
	DAC	LSMPT		/WORD LONG, DEPENDING ON
	LAC*	LSMPT		/THE NO. OF CHARS. IN
	SPA!CLA			/THE SYMBOL.
	TAD	(777777
	TAD	(777777
	TAD	LSMPT		/RETURN WITH NEXT ENTRY
	DAC	LSMPT		/ADDRESS IN THE AC.
	JMP*	NXCNT
/
/SUBROUTINE TO DECREASE STORE ADDRESS FOR
/ENTERING A NEW SYMBOL IN SYMBOL TABLE AND
/CHECKING FOR SYMBOL TABLE OVERFLOW.
LPTCNT	0
	LAC	LSMEND
	TAD	(777777		/DECREASE SYMBOL TABLE
	DAC	LSMEND		/END POINTER.
	CMA			/1'S COMP. SUBROUTINE.
	TAD	LPRES		/COMPARE SYMBOL TABLE END
	SMA			/POINTER TO END OF FREE
	JMP	ERROR4		/STORAGE. --- OVERFLOW ERROR
	JMP*	LPTCNT
/
	.EJECT
/SUBROUTINE TO STORE A SYMBOL AND ITS DEFINITION IN THE SYMBOL TABLE
/
LSMSTR	CAL	0
	LAC	LSMDEF		/STORE SYMBOL DEFINITION IN SYMBOL TABLE
	DAC*	LSMEND
	JMS	LPTCNT
	LAC	LSYM1		/ STORE FIRST THREE CHARACTERS OF SYMBOL IN
	DAC*	LSMEND		/ SYMBOL TABLE.  TEST SYMBOL WORD TO SEE IF
	SMA			/ SYMBOL IS MORE THAN THREE CHARACTERS.
	JMP	SMSTR1
	JMS	LPTCNT
	LAC	LSYM2		/ STORE SECOND WORD OF SYMBOL IN TABLE.
	DAC*	LSMEND
SMSTR1	JMS	LPTCNT
	JMP*	LSMSTR		/ RETURN TO CALLING PROGRAM.
/
/ADD THIRTEEN BIT CURRENT RELOCATION FACTOR TO DATA WORD ADDRESS SUB-
/ROUTINE.
/CALLING SEQUENCE
/	JMS	LMOD13
/
LMOD13	CAL	0
	DAC	LTEMP1		/ STORE DATA WORD IN TEMP. STORAGE
	LAC	LRELOC		// LOAD 15 BIT ADDRESS
	AND	MASK		/ EXTRACT OUT BITS 14 AND 15
	TAD	LTEMP1		/ ADD DATA WORD TO 13 BIT ADDRESS
	JMP*	LMOD13		/ RETURN TO CALLING PROGRAM
/
	.EJECT
/
ERROUT	XX			/(RKB-061) NOW A SUBROUTINE
	STL			/SET .SYSLD # AND ABORT BIT IN
	AND	(17)		/(RKB-056) ALLOW UP TO 15 ERROR MESSAGES
	DAC	NXCNT		/STORE TEMPORARILY
	RAL			/.SCOM+52
	XOR*	(.SCOM+52
	DAC*	(.SCOM+52
	LAC	NXCNT		/FETCH CLEANED ERROR NUMBER
	CLL!RTR		/(RKB-056) ERRORS ARE NOW 4 BITS LONG
/(GAR-057)	DELETED 1 LINE -- 'RAR' -- SHIFTED ONCE TOO MANY.
	RTR
	XOR	ERRTMP+1	/(RKB-056) COMBINE WITH MESSAGE
	DAC	ERRMES+3
	SZL			/(RKB-056) WAS ERR NO <7
	ISZ	ERRMES+2	/(RKB-056) NO, CHANGE 06X TO 07X (FOR 8 AND 9)
	JMS	TTYOUT		/SET UP TO OUTPUT ONLY TO TELETYPE IN
				/BOSS-15 MODE
	.WRITE	-3,2,ERRMES-2,10
XKMD05=.-2			/(RKB-056) FOR BBI ROUTINE
	JMS	TTYOUT		/SET UP TO OUTPUT ONLY TO
	.WAIT	-3		/TELETYPE IN BOSS-15 MODE
	LAC	ERRTMP		/(RKB-061) RESTORE DESTROYED WORD
	DAC	ERRMES+2	/(RKB-061)
	JMP*	ERROUT		/(RKB-061) RETURN
TTYOUT	0			/ENTRY POINT TO SUBROUTINE
	LAC*	(.SCOM+52	/TO SET OUTPUT TO TELETYPE BIT
	AND	(757777		/ONLY IF IN BOSS-15 MODE
	XOR	(20000		/BIT 4; IN BOSS-15 MODE
	DAC*	(.SCOM+52
	JMP*	TTYOUT		/EXIT
/
/(RKB-061) THE ERROR MESSAGE TYPE OUTS HAVE ONE OF TWO FORMS:
/(RKB-061)	.SYSLD N	(FOR CODES 1-8)
/(RKB-061) 	   OR
/(RKB-061)	.SYSLD 9 DV	(FOR CODE 9)
/
/(RKB-061) THE FOLLOW RATHER COMPLICATED MESSAGE ALLOWS THIS
ERRMES	.ASCII	'.SYSLD 0 '<0><0><0><15>
/(RKB-061) FOR CODE 9, THE SECOND AND THIRD NULLS BECOME THE 
/(RKB-061) DEVICE CODE.  THE CODE 9 ROUTINE, ERROR9, RESETS
/(RKB-061) THEM TO NULLS.
/
/(RKB-061) THE FOLLOWING WORD PAIR IS USED TO BUILD OR
/(RKB-0619 RESTORE THE ACTUAL MESSAGE
/
ERRTMP	.ASCII	'D 0 '<0>
	.EJECT
/
/LOWEST FREE ADDRESS IN EACH OF THE
/EIGHT 4K MEMORY BANKS.
/
LPRESX	0			/EXTRA 4K BANK
	0			/DUMMY ENTRY.
LPRES0	20
	10020
LPRES1	20020
	30020
LPRES2	40020
	50020
LPRES3	60020
	70020
LPRESS	LPRESX-1
LPRESP	0
/
/	IF BANK MODE SYSTEM RELOCATION IS IN BANK MODE
/ONLY.  .EBREL AND .DBREL WILL BE IGNORED.  ALL PROGRAMS WILL BE
/LOADED WITHIN BANK BOUNDS AND MAY OVERLAP PAGE BOUNDS.
/	IF PAGE MODE SYSTEM, DEFAULT RELOCATION WILL BE IN BANK MODE
/WHICH WILL CHANGE TO PAGE MODE FOR LINKING LOADER,DDT, AND EXECUTE.
/ALL PROGRAMS WILL BE LOADED WITHIN PAGE BOUNDS EVEN IF RELOCATED
/IN BANK MODE.  .EBREL AND .DBREL WILL BE HONORED.
/
ADDR	60000			/70000 IF 4K MODE
MASK	17777			/7777 IF 4K MODE
MASK1	17777			/DEFAULT RELOCATION IS BANK MODE
	.EJECT
/
/	JMS ABUF OR JMS ALLOC ROUTINES ALLOCATE CORE FOR PROGRAMS
/LOADED BY THE SUSTEM LOADER.  ALL UNITS ARE ASSUMED TO BE 4K OR 
/LESS.  ENTRY ABUF IS USED FOR ALLOCATING BUFFERS WHICH MAY OVERLAP CORE 
/BOUNDS.  FIRST ADDRESS ON RETURN WILL BE STORED IN LRELOC.
/THIS ADDRESS WILL BE -2 IF BUFFER DOES NOT FIR (ENTRY ABUF).
/IF UNIT DOES NOT FIR ON ALLOC ENTRY, CHECKS ARE MADE AS USUAL FOR 
/.SYSLD 1.
/
ABUF	0
	DAC	LTEMP1		/BUFFER SIZE
	LAC	ABUF
	DAC	ALLOC		/SET UP COMMON RETURN
	LAC	SKPLIT		/FLAG FOR ABUF
	JMP	ABUF7		/JMP INTO ALLOC ROUTINE
ALLOC	0
	DAC	LTEMP1		/PROG. SIZE
	LAC	NOPLIT		/SET SWITCH FOR ALLOC
ABUF7	DAC	BUFSW		/THIS SWITCH SAYS WHETHER UNIT CAN OVERLAP
				/CORE BOUNDS
	LAC	(70000		/START OUT IN EXTRA 4K IF PRESENT
	DAC	ADDR
	LAC	LPRESS
	DAC	LPRESP
ABUF1	IDX	LPRESP		/MOVE TO THE NEXT CORE PAGE
	LAC*	LPRESP		/EXAMINE THE FIRST FREE ADDRESS
	SAD	LPRESS		/IS THIS CORE PAGE POSSIBLE
	JMP	NORUM		/GTREATER THAN 32K
	SZA			/BANKS WHICH ARE FULL HAVE 0 AS FIRST FREE
				/LOCATION
	JMP	ABUF3		/CHECK FOR FIT
ABUF2=.
	XCT	SKPBNK
	JMP	ABUF1
	LAC	(60000		/BANK MODE; SET FOR ALL REMAINING FULL BANKS
	DAC	ADDR
	IDX	LPRESP		/GO OVER PAGE WORDS THAT ARE UNNECESSARY
	JMP	ABUF1		/GO TO THE NEXT BANK
ABUF3	DAC	LRELOC		/STORE HERE IN CASE THIS IS A WINNER
	DAC	LPLA
	TAD	LTEMP1		/FIND IF IN SAME CORE PAGE/BANK
	DAC	LLPRES
	XOR	LPLA
	AND	ADDR		/THIS DETERMINES WHETHER TEST IS BANK OR PAGE
	SZA!CLC		/TEST AND PUT -1 IN AC
	JMP	OVRLPQ		/OVERLAPS BOUNDS
	TAD	LPRESP		/DOES NOT OVERLAP
	SAD	LPRESS		/ARE WE IN EXTRA 4K
	SKP!CLA		/YES; DO NOT USE AS NEW VALUE FOR .SCOM+3
	LAC	LLPRES		/DOES THIS ALLOCATION OVERLAY .SYSLD
	TCA
	TAD	LSMEND		/ADD FIRST FREE ADDRESS UNDER SYMBOL TABLE
	SMA
	JMP	ABUF4		/DOES NOT OVERLAY .SYSLD
BUFSW	NOP			/SKP IF ALLOCATING BUFFERS WHICH MAY OVERLAY
	JMP	ERROR1		/THE SYSTEM LOADER
ABUF4	XCT	BUFSW		/TEST FOR ABUF
	SKP
	JMP	ABUF5		/DO NOT TEST FOR LIBRARY MODE IF ALLOCATING
				/BUFFERS
	LAC	NOLOAD		/IF A LIBRARY SEARCH IS BEING MADE, DO NOT
	SNA			/TERMINATE THE LOADING PROCESS UNTIL THE
				/THE ROUTINE IS SHOWN TO BE NEEDED
ABUF5	JMS	AJUST		/UPDATE THE CORE POINTERS AND .SCOM+3 WORD
	JMP*	ALLOC		/RETURN
OVRLPQ	XCT	BUFSW		/MAY SPACE OVERLAY BOUNDS
	JMP	ABUF2		/NO
	TAD	LPRESP		/TEST FOR EXTRA 4K 
	SAD	LPRESS
	JMP	ABUF2		/THERE IS NO PLACE TO GO IN EXTRA 4K
	AAC	2		/COMPUTE THE ADDRESS OF THE NEXT CORE PAGE
	DAC	AJUST		/STORE TEMPORARILY
	XCT	SKPPAG
	IDX	AJUST		/BUMP TO NEXT BANK
	LAC*	AJUST		/IS THIS BANK POSSIBLE
	SAD	LPRESS
	JMP	NORUM		/NO
	XCT	SKPBNK
	LAC	(7777
	XCT	SKPPAG
	LAC	(17777
	AND*	AJUST		/IS THIS BANK FREE OF ANY OTHER INFO
	AAC	-20
	SZA			/YES
	JMP	ABUF2		/NO; CAN'T USE IT
	DZM*	LPRESP		/YES; PREVIOUS BANK ALL USED UP
	LAC	AJUST		/UPDATE CORE BANK POINTER TO THIS BANK/PAGE
	DAC	LPRESP
	JMP	ABUF5	/GO UPDATE THIS CORE POINTER AND .SCOM+3
NORUM	XCT	BUFSW		/IF ALLOCATING BUFFERS
	JMP	ERROR1		/DO NOT INDICATE AN ERROR BUT RETURN -2
	LAW	-2		/IN LRELOC
	DAC	LRELOC
	JMP*	ALLOC		/RETURN
	.EJECT
/
/SUBROUTINE TO STORE NEW LOWEST FREE ADDRESS
/IN PROPER ENTRY IN BANK POINTERS TABLE
/AND UPDATE LPRES IF NEED BE.
AJUST	0
	LAC*	LPRESP		/IN CASE ROUTINE
	DAC	AJUST1		/BY SAME NAME
	LAC	LPRES		/ALREADY LOADED
	DAC	AJUST2
	XCT	SKPPAG
	LAC	(17777
	XCT	SKPBNK
	LAC	(7777
	AND	LLPRES		/IF A CORE POINTER SHOULD EVER BE
	AAC	-21		/SUCH AS TO MAKE A BANK POINTER LESS
	SPA			/THAN 20, THEN THE POINTER MUST BE MADE
	CLA			/TO BE 21 IN THAT BANK
	AAC	21
	XOR	LLPRES		/MERGE INTO POINTER
	XCT	SKPPAG
	AND	(17777
	XCT	SKPBNK
	AND	(7777
	XOR	LLPRES
	DAC	LLPRES
	CLL!CLA!CMA!CML
	TAD	LPRESP		/0 TO LINK
	SAD	LPRESS
	CML			/XTRA 4K BANK.
	LAC	LLPRES		/UPDATE TABLE
	DAC*	LPRESP		/ENTRY.
	SZL!CMA
	JMP*	AJUST
	TAD	LPRES		/NOT XTRA 4K.
	LAC	LLPRES		/KEEP HIGHER
	SNL			/ADDRESS.
	DAC	LPRES
	JMP*	AJUST
AJUST1	0
AJUST2	0
/
EPM	DBA	/ENTER PAGE MODE INSTRUCTION
		/NOP WHEN XCT FILE IS READ USING 
		/.SYSLD'S I/O HANDLER
	.EJECT
	.LTORG		/(RKB-061)
	.IFPNZ	.-13500		/(RKB-061) MAKE SURE .SYSLD FITS
ERROR	.SYSLD OVERLAPS THE SYSTEM 'L' HANDLER
ERROR	.LOC .-1
	.ENDC
	.END IN
