	.SYSID <	.TITLE QFILE >				/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ COPYRIGHT (C) 1975						/EAG:100

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

/								/EAG:100

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

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

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

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

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

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

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

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

/								/EAG:100

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

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

/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.			/EAG:100

/								/EAG:100

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

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

/								/EAG:100

	.TITLE EDIT NUMBERS AND HISTORY

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ 100	14-SEP-75	EAG	INITIAL VERSION FOR XVM/DOS	/EAG:100

/				RESIDENT MONITOR.  ESSENTIALLY	/EAG:100

/				EQUIVALENT TO PRIOR VERSIONS,	/EAG:100

/				BUT WITH MORE GENERALITY AND	/EAG:100

/				ERROR CHECKING.			/EAG:100

/								/EAG:100

/ 101	10-OCT-75	EAG	REVISE ERROR MESSAGES SO THAT	/EAG:101

/				THEY WON'T RUN OFF THE END	/EAG:101

/				OF LINES.  EXPAND INPUT BUFFER	/EAG:101

/				TO COMPENSATE FOR BUG IN TTA.	/EAG:101

/				WHICH WON'T BE FIXED.		/EAG:101

/								/EAG:101

/ 102	14-OCT-75	EAG	FIX A COUPLE OF BUGS AND SPEED	/EAG:102

/				UP OPERATION OF ^Q'S.  THE NOP	/EAG:102

/				VARIATION OF QFILE (BOTH SC.QNF	/EAG:102

/				AND SC.QNRM SET IN SC.CQF) IS	/EAG:102

/				NOW CHECKED FOR AND NOTHING	/EAG:102

/				READ FROM THE ^QAREA.		/EAG:102

/								/EAG:102

	.TITLE DESCRIPTION OF OPERATION

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ QFILE IS USED BY XVM/DOS TO IMPLEMENT THE .GET AND .PUT	/EAG:100

/ CAL FUNCTIONS.  THE NON-RESIDENT MONITOR'S GET AND PUT	/EAG:100

/ COMMANDS PLUS THE RESIDENT MONITOR'S ^Q FEATURE ARE ALL	/EAG:100

/ TRANSLATED INTO A .GET OR .PUT, SO QFILE ALSO IMPLEMENTS	/EAG:100

/ THESE FEATURES.  THE READER IS REFERRED TO THE XVM/DOS	/EAG:100

/ SYSTEM MANUAL FOR INFORMATION NOT INCLUDED IN THE DISCUSSION	/EAG:100

/ BELOW.							/EAG:100

/								/EAG:100

/ QFILE IS CALLED VIA A .OVRLA FROM THE RESIDENT MONITOR.	/EAG:100

/ IT IS CALLED WITH AN OPTIONAL FILE NAME IN SC.FNM AND A	/EAG:100

/ FUNCTION CODE IN SC.CQF.  A FLAG IN SC.CQF INDICATES WHETHER	/EAG:100

/ OR NOT THE FILE NAME IS PRESENT.  QFILE PERFORMS THE		/EAG:100

/ OPERATION REQUESTED BY THE FUNCTION CODE AND THEN EXITS.	/EAG:100

/ IT TAKES ONE OF TWO EXITS, DEPENDING UPON THE FUNCION		/EAG:100

/ CODE.								/EAG:100

/								/EAG:100

/ THE OPERATION PERFORMED BY QFILE IS A FILE TRANSFER BETWEEN	/EAG:100

/ THE QAREA AND THE FILE WHOSE NAME IS IN SC.FNM.  THE FILE	/EAG:100

/ IS ACCESSED VIA .DAT SLOT -14, WHICH .DAT SLOT DETERMINES	/EAG:100

/ THE DEVICE AND UIC.  THE TRANSFER OPERATION PROCEEDS		/EAG:100

/ AS FOLLOWS:							/EAG:100

/								/EAG:100

/   1.	IF BIT SC.QNF OF SC.CQF IS SET, NO FILE TRANSFER	/EAG:100

/	WILL OCCUR AND THUS THE FILE NAME (IF PRESENT) IS	/EAG:100

/	IGNORED.  QFILE PROCEEDS TO THE EXIT PROCESSING		/EAG:100

/	DESCRIBED BELOW.					/EAG:100

/								/EAG:100

/   2.	IF BIT SC.QNF OF SC.CQF IS CLEAR AND BIT SC.QPUT	/EAG:100

/	IS SET, THE QAREA IS COPIED INTO THE NAMED FILE.	/EAG:100

/								/EAG:100

/   3.	IF BOTH BITS SC.QNF AND SC.QPUT ARE CLEAR, THE		/EAG:100

/	NAMED FILE IS COPIED INTO THE QAREA.			/EAG:100

/								/EAG:100

/ FOLLOWING THE FILE TRANSFER OPERATION QFILE EXITS.  WHICH	/EAG:100

/ EXIT IT TAKES IS DETERMINED AS FOLLOWS:			/EAG:100

/								/EAG:100

/   1.	IF BIT SC.QNRM OF SC.CQF IS SET, QFILE MERELY EXITS	/EAG:100

/	TO THE NON-RESIDENT MONITOR (I.E. IT DOES A .EXIT).	/EAG:100

/								/EAG:100

/   2.	IF BIT SC.QNRM IS CLEAR, QFILE EXITS TO THE CORE	/EAG:100

/	IMAGE IN THE QAREA.  FIRST IT UPDATES THE CONTENTS	/EAG:100

/	OF SC.CQF IN THE SAVED IMAGE SO THAT THE PROPER		/EAG:100

/	EXIT WILL BE TAKEN FROM THE .PUT CAL WHICH CREATED	/EAG:100

/	THE IMAGE.  IT ALSO UPDATES SEVERAL OTHER .SCOM		/EAG:100

/	REGISTERS AS NEEDED TO PRESERVE SYSTEM INTEGRITY.	/EAG:100

/	THEN IT OVERLAYS MEMORY WITH THE QAREA BY USING		/EAG:100

/	THE MONITOR TRAN ROUTINE -- I.E. THE SYSTEM		/EAG:100

/	BOOTSTRAP.  THIS IMPLICITLY UPDATES THE BOOTSTRAP	/EAG:100

/	RETURN ADDRESS SO THAT EXECUTION WILL PROCEED		/EAG:100

/	"NORMALLY" IN THE RESTORED CORE IMAGE.			/EAG:100

/								/EAG:100

/ QFILE PERFORMS NUMEROUS ERROR CHECKS TO ENSURE THAT PROPER	/EAG:100

/ OPERATION AND SYSTEM INTEGRITY ARE PRESERVED.  IF AN ERROR	/EAG:100

/ CHECK FAILS, QFILE EXITS TO THE NON-RESIDENT MONITOR (VIA	/EAG:100

/ A .EXIT).  SOME ERRORS ARE OPTIONALLY RECOVERABLE -- A	/EAG:100

/ WARNING MESSAGE IS PRINTED AND THE USER IS GIVEN THE OPTION	/EAG:100

/ OF CONTINUEING OR ABORTING.  THE BULK OF THE ERROR CHECKS	/EAG:100

/ ARE PERFORMED JUST PRIOR TO OVERLAYING CORE WITH THE		/EAG:100

/ CONTENTS OF THE QAREA.  THESE CHECKS EXAMINE THE IMAGE'S	/EAG:100

/ .SCOM AND MASS STORAGE BUSY TABLE.  FOR THIS PURPOSE THE	/EAG:100

/ FILE TRANSFER OPERATIONS GO TO SOME COMPLICATION TO		/EAG:100

/ PRESERVE THESE AREAS IN CORE SO THAT ADDITIONAL TRANSFERS	/EAG:100

/ WON'T BE NEEDED AT THE LATER TIME.				/EAG:100

/								/EAG:100

/ THE INITIAL VERSION OF QFILE (EDIT #100) HAS BEEN WRITTEN	/EAG:100

/ TO WORK WITH ANY AMOUNT OF FREE CORE (IT GIVES AN ERROR IF	/EAG:100

/ THE AMOUNT IS INSUFFICIENT).  THE CORE IMAGE MAY ALSO START	/EAG:100

/ AT ANY LOCATION (INDICATED BY SC.CQB+1) SO LONG AS THE IMAGE	/EAG:100

/ INCLUDES ALL OF .SCOM.  ALSO, THE VALUE MUST BE THE SAME IN	/EAG:100

/ BOTH THE IMAGE BEING RESTORED AND THE CURRENT IMAGE IN CORE.	/EAG:100

/								/EAG:100

	.TITLE DEFINE CONSTANTS AND .SCOM

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE AUTO-INCREMENT REGISTERS:				/EAG:100

/								/EAG:100

								/EAG:100

X10=10								/EAG:100

X11=11								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE .SCOM BASE AND LENGTH:					/EAG:100

/								/EAG:100

								/EAG:100

SC.BAS=100							/EAG:100

SC.LEN=112							/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE LOCATIONS WITHIN .SCOM:				/EAG:100

/								/EAG:100

								/EAG:100

SC.COD=SC.BAS+0							/EAG:100

SC.FRL=SC.BAS+2							/EAG:100

SC.MOD=SC.BAS+4							/EAG:100

SC.FNM=SC.BAS+7							/EAG:100

SC.MSZ=SC.BAS+20						/EAG:100

SC.AMS=SC.BAS+22						/EAG:100

SC.SLT=SC.BAS+24						/EAG:100

SC.BNM=SC.BAS+26						/EAG:100

SC.BTB=SC.BAS+30						/EAG:100

SC.VTF=SC.BAS+33						/EAG:100

SC.ACT=SC.BAS+36						/EAG:100

SC.NMF=SC.BAS+42						/EAG:100

SC.BOS=SC.BAS+52						/EAG:100

SC.SDV=SC.BAS+57						/EAG:100

SC.BTA=SC.BAS+62						/EAG:100

SC.BTL=SC.BAS+63						/EAG:100

SC.CQF=SC.BAS+65						/EAG:100

SC.CQB=SC.BAS+66						/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE BITS IN SC.MOD:					/EAG:100

/								/EAG:100

								/EAG:100

SC.API=400000							/EAG:100

SC.PLR=4							/EAG:100

SC.UC15=2							/EAG:100

SC.XVM=1							/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE BITS IN SC.VTF:					/EAG:100

/								/EAG:100

								/EAG:100

SC.VTN=100000							/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE BITS IN SC.NMF						/EAG:100

/								/EAG:100

								/EAG:100

SC.PVT=1000							/EAG:100

SC.PCLK=400							/EAG:100

SC.PAPI=200							/EAG:100

SC.PUC15=100							/EAG:100

SC.PXVM=40							/EAG:100

SC.BCH=1							/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE BITS IN SC.BOS						/EAG:100

/								/EAG:100

								/EAG:100

SC.BMD=400000							/EAG:100

SC.BAB=1							/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ DEFINE BITS IN SC.CQF						/EAG:100

/								/EAG:100

								/EAG:100

SC.QNF=2000							/EAG:100

SC.QNRM=1000							/EAG:100

SC.QPUT=400							/EAG:100

SC.QRTN=7							/EAG:100

	.TITLE DEFINE .TEXT MACRO

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ FOLLOWING MACRO ACCEPTS A MESSAGE AND CREATES AN IOPS		/EAG:100

/ ASCII LOGICAL RECORD CONTAINING THAT MESSAGE.  THE MESSAGE	/EAG:100

/ SHOULD BE IN A FORM ACCEPTABLE TO .ASCII.			/EAG:100

/								/EAG:100

								/EAG:100

	.DEFIN .TEXT MESSAG,?LABEL				/EAG:100

	    LABEL-.*400						/EAG:100

	    0							/EAG:100

	    .ASCII MESSAG					/EAG:100

LABEL=.								/EAG:100

	.ENDM							/EAG:100

	.TITLE INITIALIZATION AND BUFFER SETUP

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ ALLOCATE MAXIMUM POSSIBLE BUFFER FROM REGION DEFINED		/EAG:100

/ BY SC.FRL, AND VERIFY THAT IT IS SUFFICIENT.			/EAG:100

/								/EAG:100

								/EAG:100

IN	LAC* (SC.FRL)		/ INITIALIZE BUFFER BASE	/EAG:100

	DAC BUFBAS		/ ADDRESS			/EAG:100

	LAC* (SC.FRL+1)		/ CALCULATE LENGTH OF		/EAG:100

	CMA!STL			/ FREE AREA			/EAG:100

	TAD BUFBAS						/EAG:100

	SNL							/EAG:100

	JMP NOCORE		/ JMP IF (SC.FRL) > (SC.FRL+1)	/EAG:100

	AAC 377			/ TRUNCATE TO MULTIPLE OF 400	/EAG:100

	AND (777400)						/EAG:100

	DAC BUFLEN		/ AND REMEBER TWO'S COMPLE. OF	/EAG:100

	TCA!STL			/ LENGTH FOR WORD COUNT		/EAG:100

	TAD (-SC.BAS-SC.LEN)	/ VERIFY THERE IS ROOM FOR	/EAG:100

	SZL			/ .SCOM				/EAG:100

	JMP NOCORE		/ THERE ISN'T			/EAG:100

	LAC* (SC.CQB+2)		/ PICK UP LENGTH OF QAREA	/EAG:100

	SNA!TCA!STL		/ AND VERIFY ONE EXISTS		/EAG:100

	JMP NOQAREA						/EAG:100

	TAD (-SC.BAS-SC.LEN)	/ VERIFY IT IS LONG ENOUGH	/EAG:100

	SZL			/ TO INCLUDE .SCOM		/EAG:100

	JMP TOOSML						/EAG:100

	LAC* (SC.CQB)		/ COPY INITIAL BLOCK NUMBER,	/EAG:100

	DAC TRNBLK		/ CORE ADDRESS, AND IMAGE	/EAG:100

	LAC* (SC.CQB+1)		/ LENGTH FROM .SCOM		/EAG:100

	IAC							/EAG:100

	DAC CORADR						/EAG:100

	LAC* (SC.CQB+2)						/EAG:100

	DAC LENLFT						/EAG:100

	LAC* (SC.CQF)		/ WHAT DO WE WANT TO DO?	/EAG:100

	AND (SC.QNF)		/ CHECK FOR FILE REQUEST	/EAG:100

	SZA							/EAG:100

	JMP NOFILE		/ SKIP FILE TRANSFER OPERATION	/EAG:100

	JMP DOFILE		/ GO DO FILE TRANSFER		/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE IF THERE IS INSUFFICIENT CORE TO HOLD THE		/EAG:100

/ NECESSARY BUFFERS.						/EAG:100

								/EAG:100

NOCORE	JMS ERROR						/EAG:100

	  .TEXT <"INSUFFICIENT MEMORY."<015>>			/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF A QAREA DOESN'T EXIST.				/EAG:100

								/EAG:100

NOQAREA	JMS ERROR						/EAG:100

	  .TEXT <"NO ^QAREA."<015>>				/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF A QAREA EXISTS BUT ISN'T LONG ENOUGH TO HOLD	/EAG:100

/ .SCOM.							/EAG:100

								/EAG:100

TOOSML	JMS ERROR						/EAG:100

	  .TEXT <"^QAREA TOO SMALL."<015>>			/EAG:101

	.TITLE PERFORM FILE TRANSFER OPERATION

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE CODE BELOW TRANSFERS A CORE IMAGE BETWEEN THE QAREA	/EAG:100

/ AND THE FILE NAMED IN SC.FNM.  THE DIRECTION OF TRANSFER	/EAG:100

/ IS INDICATED BY BIT SC.QPUT OF SC.CQF.			/EAG:100

/								/EAG:100

								/EAG:100

DOFILE	JMS SETUP		/ SET UP WORD COUNTS, ETC.	/EAG:100

	LAC* (SC.CQF)		/ CHECK TRANSFER DIRECTION	/EAG:100

	AND (SC.QPUT)		/ AND THEN GO OPEN THE FILE	/EAG:100

	SNA			/ AND DO THE FIRST TRANSFER.	/EAG:100

	JMP GETFL1						/EAG:100

	.INIT -14,1,0		/ SET UP DEVICE FOR OUTPUT	/EAG:100

	.ENTER -14,SC.FNM,0	/ CREATE A NEW FILE		/EAG:100

	CLL			/ READ FIRST CHUNK OFF OF QAREA	/EAG:100

	JMS TRAN						/EAG:100

	JMS SCMCHK		/ VERIFY .SCOM IS REASONABLE	/EAG:100

				/ AND UPDATE LENLFT		/EAG:100

	JMS SETUP		/ UPDATE WORD COUNTS		/EAG:100

	.WRITE -14,4,-1,0	/ WRITE IT OUT			/EAG:100

PUTLN1=.-1							/EAG:100

PUTBF1=.-2							/EAG:100

	.WAIT -14						/EAG:100

	JMP COMFIL		/ JOIN COMMON CODE		/EAG:100

								/EAG:100

GETFL1	.INIT -14,0,0		/ SET UP DEVICE FOR INPUT	/EAG:100

	.SEEK -14,SC.FNM	/ OPEN EXISTING FILE		/EAG:100

	.READ -14,4,-1,0	/ READ IN FIRST CHUNK		/EAG:100

GETLN1=.-1							/EAG:100

GETBF1=.-2							/EAG:100

	.WAIT -14						/EAG:100

	JMS SCMCHK		/ VERIFY .SCOM IS REASONABLE	/EAG:100

				/ AND UPDATE LENLFT.		/EAG:100

	JMS SETUP		/ UPDATE WORD COUNTS		/EAG:100

	STL			/ WRITE IT OUT			/EAG:100

	JMS TRAN						/EAG:100

COMFIL	JMS SCMSAV		/ REMEMBER .SCOM FOR LATER	/EAG:100

				/ ERROR CHECKING		/EAG:100

FILLUP	JMS MSBTSV		/ CHECK FOR MASS STORAGE	/EAG:100

				/ BUSY TABLE AND REMEMBER	/EAG:100

				/ IT IF ITS IN CORE.		/EAG:100

	LAC TRNLEN		/ UPDATE EVERYTHING BY LENGTH	/EAG:100

	TCA			/ OF LAST TRANSFER		/EAG:100

	LMQ							/EAG:100

	TAD CORADR		/ INCLUDING CURRENT CORE ADDR.	/EAG:100

	DAC CORADR						/EAG:100

	LACQ							/EAG:100

	TAD LENLFT		/ AND REMAINING LENGTH TO XFER	/EAG:100

	SNA			/ CHECK IF TRANSFER COMPLETE	/EAG:100

	JMP CLSFIL		/ JMP IF IT IS			/EAG:100

	DAC LENLFT						/EAG:100

	CLA!CLL							/EAG:100

	LLS+12							/EAG:100

	TAD TRNBLK		/ UPDATE DISK BLOCK # WITHIN	/EAG:100

	DAC TRNBLK		/ QAREA				/EAG:100

	JMS SETUP		/ SET UP FOR NEXT TRANSFER	/EAG:100

	LAC* (SC.CQF)		/ CHECK DIRECTION		/EAG:100

	AND (SC.QPUT)		/ AND THEN GO TRANSFER THE	/EAG:100

	SNA			/ NEXT CHUNK			/EAG:100

	JMP GETFL2						/EAG:100

	CLL			/ READ IN FROM QAREA		/EAG:100

	JMS TRAN						/EAG:100

	.WRITE -14,4,-1,0	/ WRITE OUT TO FILE		/EAG:100

PUTLN2=.-1							/EAG:100

PUTBF2=.-2							/EAG:100

	.WAIT -14						/EAG:100

	JMP FILLUP		/ AND LOOP			/EAG:100

								/EAG:100

GETFL2	.READ -14,4,-1,0	/ READ IN FROM FILE		/EAG:100

GETLN2=.-1							/EAG:100

GETBF2=.-2							/EAG:100

	.WAIT -14						/EAG:100

	STL			/ WRITE OUT TO QAREA		/EAG:100

	JMS TRAN						/EAG:100

	JMP FILLUP		/ AND LOOP			/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE WHEN FILE TRANSFER IS COMPLETE TO CLOSE		/EAG:100

/ THE FILE.  THEN PROCEED TO EXIT PROCESSING.			/EAG:100

								/EAG:100

CLSFIL	.CLOSE -14		/ CLOSE THE FILE		/EAG:100

	JMP CKEXIT		/ JOIN EXIT PROCESSING		/EAG:100

	.TITLE READ IN .SCOM, MSBT FOR NON-FILE REQUEST

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ WE COME HERE FOLLOWING BUFFER SETUP AND INITIALIZATION	/EAG:100

/ ON ALL QFILE OPERATIONS WHICH DO NOT PERFORM A FILE		/EAG:100

/ TRANSFER OPERATION.  HERE WE SCAN THROUGH THE IMAGE		/EAG:100

/ IN THE QAREA UNTIL WE'VE READ IN .SCOM AND THE MSBT,		/EAG:100

/ SO THAT LATER ERROR CHECKS WHICH WANT THEM IN CORE		/EAG:100

/ WILL FIND THEM THERE.						/EAG:100

/								/EAG:100

								/EAG:100

NOFILE	LAC* (SC.CQF)		/ CHECK IF WE ARE JUST GOING TO	/EAG:102

	AND (SC.QNRM)		/ EXIT TO THE NON-RESIDENT	/EAG:102

	SZA			/ MONITOR.  IF SO, SKIP THIS,	/EAG:102

	JMP CKEXIT		/ AS WON'T NEED .SCOM, ETC.	/EAG:102

	JMS SETUP		/ SET UP TRANSFER		/EAG:100

	CLL			/ AND BRING IN FIRST CHUNK	/EAG:100

	JMS TRAN						/EAG:100

	JMS SCMCHK		/ CHECK .SCOM AND LENGTH	/EAG:100

	JMS SETUP						/EAG:100

	JMS SCMSAV		/ PRESERVE .SCOM		/EAG:100

NFLLUP	JMS MSBTSV		/ CHECK FOR AND PRESERVE MSBT	/EAG:100

	LAC MSBTAD		/ CHECK IF MSBT AND BUFFER	/EAG:100

	SNA			/ HAVE BEEN PRESERVED YET.	/EAG:100

	JMP NFLNXT		/ IF THEY HAVE, EXIT TO CKEXIT.	/EAG:100

	LAC BFTBAD		/ OTHERWISE CONTINUE AT NFLNXT.	/EAG:100

	SZA							/EAG:100

	JMP CKEXIT						/EAG:100

NFLNXT	LAC TRNLEN		/ UPDATE FOR NEXT TRANSFER	/EAG:100

	TCA							/EAG:100

	LMQ							/EAG:100

	TAD CORADR		/ IMAGE CORE ADDRESS OF BASE	/EAG:100

	DAC CORADR		/ OF CHUNK.			/EAG:100

	LACQ							/EAG:102

	TAD LENLFT		/ AND LENGTH REMAINING TO	/EAG:102

	SNA			/ TRANSFER.			/EAG:102

	JMP CKEXIT		/ IF WE REACH END, THEN QUIT	/EAG:102

	DAC LENLFT						/EAG:102

	CLA!CLL							/EAG:102

	LLS+12			/ AND DISK BLOCK NUMBER		/EAG:100

	TAD TRNBLK						/EAG:100

	DAC TRNBLK						/EAG:100

	JMS SETUP		/ READ IN NEXT CHUNK		/EAG:102

	CLL							/EAG:102

	JMS TRAN						/EAG:102

	JMP NFLLUP		/ AND PROCESS IT		/EAG:102

	.TITLE EXIT PROCESSING

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ COME HERE AFTER ANY FILE TRANSFER OPERATIONS HAVE BEEN	/EAG:100

/ COMPLETED.  CHECK FOR DESIRED TYPE OF EXIT AND DO IT.		/EAG:100

/								/EAG:100

								/EAG:100

CKEXIT	LAC* (SC.CQF)		/ CHECK IF EXIT TO NON-RES.	/EAG:100

	AND (SC.QNRM)		/ MONITOR HAS BEEN REQUESTED.	/EAG:100

	SNA			/ SKIP IF IT HAS.		/EAG:100

	JMP CHKIMG		/ GO CHECK AND BRING IN IMAGE.	/EAG:100

	.EXIT			/ EXIT TO N.R.M.		/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE TO VERIFY THAT AN IMAGE CAN BE BROUGHT INTO CORE.	/EAG:100

/ IF IT CAN, THEN BRING IT IN.					/EAG:100

								/EAG:100

CHKIMG	LAC SCMADR		/ VERIFY THAT .SCOM HAS BEEN	/EAG:100

	SNA			/ PRESERVED IN CORE.  ELSE	/EAG:100

	JMP BADIMG		/ SOMETHING FUNNY GOING ON.	/EAG:100

	AAC SC.COD		/ SET UP POINTERS TO .SCOM	/EAG:100

	DAC ISCCOD		/ LOCATIONS WITHIN PRESERVED	/EAG:100

	AAC SC.MOD-SC.COD	/ .SCOM IMAGE.			/EAG:100

	DAC ISCMOD						/EAG:100

	AAC SC.MSZ-SC.MOD					/EAG:100

	DAC ISCMSZ						/EAG:100

	AAC SC.AMS-SC.MSZ					/EAG:100

	DAC ISCAMS						/EAG:100

	AAC SC.SLT-SC.AMS					/EAG:100

	DAC ISCSLT						/EAG:100

	AAC SC.VTF-SC.SLT					/EAG:100

	DAC ISCVTF						/EAG:100

	AAC SC.NMF-SC.VTF					/EAG:100

	DAC ISCNMF						/EAG:100

	AAC SC.SDV-SC.NMF					/EAG:100

	DAC ISCSDV						/EAG:100

	AAC SC.CQF-SC.SDV					/EAG:100

	DAC ISCCQF						/EAG:100

	AAC SC.CQB-SC.CQF					/EAG:100

	DAC ISCCQB						/EAG:100

	AAC 1							/EAG:100

	DAC ISCCQB+1						/EAG:100

	AAC 1							/EAG:100

	DAC ISCCQB+2						/EAG:100

	LAC* ISCCQB+1		/ VERIFY THAT IMAGE INCLUDES	/EAG:100

	IAC			/ EVERYTHING BELOW BOOTSTRAP.	/EAG:100

	CLL!TCA							/EAG:100

	TAD* ISCCQB+2						/EAG:100

	TAD* ISCCOD						/EAG:100

	SNL							/EAG:100

	JMP NOBOOT						/EAG:100

	LAC* ISCCOD		/ VERIFY THAT BOOTSTRAP IS IN	/EAG:100

	SAD* (SC.COD)		/ SAME PLACE IN BOTH THE IMAGE	/EAG:100

	SKP			/ AND THE CURRENT CORE LOAD.	/EAG:100

	JMP DFBOOT						/EAG:100

	LAC* ISCMSZ		/ VERIFY THAT IMAGE'S MEMSIZ IS	/EAG:100

	CLL!TCA			/ NO BIGGER THAN THE CURRENT	/EAG:100

	TAD* (SC.MSZ)		/ CORE LOAD'S.			/EAG:100

	SNL							/EAG:100

	JMP MSZERR						/EAG:100

	LAC* ISCMOD		/ VERIFY THAT API IS PRESENT	/EAG:100

	AND (SC.API)		/ IF IT'S IN USE.		/EAG:100

	SNA							/EAG:100

	JMP CKIM.0						/EAG:100

	LAC* (SC.NMF)						/EAG:100

	AND (SC.PAPI)						/EAG:100

	SNA							/EAG:100

	JMP NOAPI						/EAG:100

CKIM.0	LAC* ISCMOD		/ VERIFY THAT XVM HARDWARE	/EAG:100

	AND (SC.XVM)		/ IS PRESENT IF IT'S IN USE.	/EAG:100

	SNA							/EAG:100

	JMP CKIM.1						/EAG:100

	LAC* (SC.NMF)						/EAG:100

	AND (SC.PXVM)						/EAG:100

	SNA							/EAG:100

	JMP NOXVM						/EAG:100

CKIM.1	LAC* ISCMOD		/ VERIFY THAT UC15 HARDWARE	/EAG:100

	AND (SC.UC15)		/ IS PRESENT IF IT'S IN USE.	/EAG:100

	SNA							/EAG:100

	JMP CKIM.2						/EAG:100

	LAC* (SC.NMF)						/EAG:100

	AND (SC.PUC15)						/EAG:100

	SNA							/EAG:100

	JMP NOUC15						/EAG:100

	LAC* ISCMOD		/ ALSO CHECK THAT A REAL	/EAG:100

	AND (SC.PLR)		/ TIME CLOCK IS PRESENT IF	/EAG:100

	SNA			/ THE POLLER IS RUNNING.	/EAG:100

	JMP CKIM.2						/EAG:100

	LAC* (SC.NMF)						/EAG:100

	AND (SC.PCLK)						/EAG:100

	SNA							/EAG:100

	JMP NOCLK						/EAG:100

CKIM.2	LAC* ISCVTF		/ VERIFY THAT A VT15 IS		/EAG:100

	AND (SC.VTN)		/ PRESENT IF VT ON.		/EAG:100

	SNA							/EAG:100

	JMP CKIM.3						/EAG:100

	LAC* (SC.NMF)						/EAG:100

	AND (SC.PVT)						/EAG:100

	SNA							/EAG:100

	JMP NOVT						/EAG:100

CKIM.3	LAC* ISCSDV		/ VERIFY THAT SYSTEM DEVICE	/EAG:100

	SAD* (SC.SDV)		/ CODES ARE THE SAME		/EAG:100

	SKP							/EAG:100

	JMP DFSDV						/EAG:100

	LAC* ISCSLT		/ AND THAT .DAT TABLES ARE	/EAG:100

	SAD* (SC.SLT)		/ THE SAME LENGTH		/EAG:100

	SKP							/EAG:100

	JMP DFDAT						/EAG:100

/ WHEN WE GET HERE .SCOM HAS SUCCESSFULLY PASSED ALL TESTS.	/EAG:100

/ NOW WE UPDATE THE IMAGE'S .SCOM TO WHAT IT WANTS TO		/EAG:100

/ BE WHEN BROUGHT INTO CORE.					/EAG:100

	LAC* (SC.NMF)		/ REPLACE THE IMAGE'S		/EAG:100

	XOR* ISCNMF		/ HARDWARE PRESENCE BITS	/EAG:100

.X=SC.PAPI!SC.PUC15!SC.PXVM	/ WITH OUR OWN.			/EAG:100

.X=.X!SC.PCLK!SC.PVT						/EAG:100

	AND (.X)						/EAG:100

	XOR* ISCNMF						/EAG:100

	SAD* ISCNMF		/ CHECK IF WE'RE MODIFYING	/EAG:100

	SKP			/ IMAGE'S .SCOM, AND CLEAR	/EAG:100

	DZM SCMSW		/ FLAG IF SO.			/EAG:100

	DAC* ISCNMF						/EAG:100

	LAC* (SC.AMS)		/ ALSO REPLACE ITS ACTUAL	/EAG:100

	SAD* ISCAMS		/ MEMORY SIZE.			/EAG:100

	SKP							/EAG:100

	DZM SCMSW						/EAG:100

	DAC* ISCAMS						/EAG:100

	LAC* (SC.CQF)		/ UPDATE ITS SC.CQF SO THAT	/EAG:100

	AND (SC.QRTN)		/ THE PROPER EXIT FROM THE	/EAG:100

	SAD (4)			/ .PUT CAL WILL BE TAKEN.	/EAG:100

	LAC* ISCCQF						/EAG:100

	AND (SC.QRTN)						/EAG:100

	SAD* ISCCQF						/EAG:100

	SKP							/EAG:100

	DZM SCMSW						/EAG:100

	DAC* ISCCQF						/EAG:100

	LAC* (SC.CQB)		/ UPDATE SC.CQB TO POINT	/EAG:100

	SAD* ISCCQB		/ TO WHERE QAREA IS NOW,	/EAG:100

	SKP			/ RATHER THAN WHERE IT WAS.	/EAG:100

	DZM SCMSW						/EAG:100

	DAC* ISCCQB						/EAG:100

	LAC* ISCCQB+1		/ UPDATE SC.CQB+2 IN CASE THIS	/EAG:100

	CMA			/ QAREA IS LONGER THAN THE	/EAG:100

	TAD* (SC.CQB+2)		/ PREVIOUS ONE, AND THE MEMSIZ	/EAG:100

	STL			/ IS BIG ENOUGH TO WANT TO	/EAG:100

	TAD* ISCMSZ		/ TAKE ADVANTAGE OF IT.		/EAG:100

	SZL!CMA							/EAG:102

	CLA							/EAG:102

	TAD* ISCMSZ						/EAG:100

	TCA							/EAG:100

	TAD* ISCCQB+1						/EAG:100

	SAD* ISCCQB+2						/EAG:100

	SKP							/EAG:100

	DZM SCMSW						/EAG:100

	DAC* ISCCQB+2						/EAG:100

	JMP CKMSBT		/ GO CHECK OUT MSBT		/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE IF THE IMAGE IS GARBAGE -- I.E. A SERIOUS		/EAG:100

/ INCONSISTENCY WHICH PREVENTS US FROM PROCESSING IT.		/EAG:100

								/EAG:100

BADIMG	JMS ERROR						/EAG:100

	  .TEXT <"INVALID CORE IMAGE."<015>>			/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF THE IMAGE LENGTH IS LESS THAN THE BOOTSTRAP	/EAG:100

/ ADDRESS (SC.COD).						/EAG:100

								/EAG:100

NOBOOT	JMS ERROR						/EAG:100

	  .TEXT <"IMAGE DOESN'T CONTAIN BOOTSTRAP."<015>>	/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF THE BOOTSTRAP IN THE SAVED IMAGE IS AT A		/EAG:100

/ LOCATION THAN THE BOOTSTRAP WE ARE CURRENTLY RUNNING WITH.	/EAG:100

								/EAG:100

DFBOOT	JMS ERROR						/EAG:100

	  .TEXT <"DIFFERENT BOOTSTRAP LOCATIONS."<015>>		/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF THE MEMSIZ (SC.MSZ) OF THE SAVED IMAGE IS	/EAG:100

/ GREATER THAN THE CURRENT MEMSIZ				/EAG:100

								/EAG:100

MSZERR	JMS ERROR						/EAG:100

	  .TEXT <"IMAGE'S MEMORY SIZE TOO LARGE."<015>>		/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF SAVED IMAGE USES API, BUT API ISN'T PRESENT.	/EAG:101

								/EAG:101

NOAPI	JMS ERROR						/EAG:101

	  .TEXT <"IMAGE REQUIRES API."<015>>			/EAG:101

								/EAG:101

								/EAG:101

/ COME HERE IF SAVED IMAGE USES XVM, BUT XVM ISN'T PRESENT.	/EAG:101

								/EAG:101

NOXVM	JMS ERROR						/EAG:101

	  .TEXT <"IMAGE REQUIRES XVM."<015>>			/EAG:101

								/EAG:101

								/EAG:101

/ COME HERE IF SAVED IMAGE USES UC15, BUT UC15 ISN'T PRESENT.	/EAG:101

								/EAG:101

NOUC15	JMS ERROR						/EAG:101

	  .TEXT <"IMAGE REQUIRES UC15."<015>>			/EAG:101

								/EAG:101

								/EAG:101

/ COME HERE IF SAVED IMAGE USES THE POLLER, BUT A CLOCK		/EAG:101

/ ISN'T PRESENT.						/EAG:101

								/EAG:101

NOCLK	JMS ERROR						/EAG:101

	  .TEXT <"IMAGE REQUIRES KW15 CLOCK."<015>>		/EAG:101

								/EAG:101

								/EAG:101

/ COME HERE IF SAVED IMAGE HAS VT ON ENABLED, BUT A VT15	/EAG:101

/ ISN'T PRESENT.						/EAG:101

								/EAG:101

NOVT	JMS ERROR						/EAG:101

	  .TEXT <"IMAGE REQUIRES VT15."<015>>			/EAG:101

								/EAG:100

								/EAG:100

/ COME HERE IF THE SYSTEM CONFIGURATION IF DIFFERENT FROM	/EAG:100

/ WHAT IT WAS WHEN THE SAVED IMAGE WAS CREATED.  THE SPECIFIC	/EAG:100

/ DIFFERENCES CHECKED FOR ARE:					/EAG:100

/								/EAG:100

/   1.  DIFFERENT SYSTEM DEVICE CODES.  THIS CAN BE DUE		/EAG:100

/	TO A DIFFERENT SYSTEM DEVICE OR A RECONFIGURATION	/EAG:100

/	OF I/O HANDLERS.  THIS IS CHECKED BY COMPARING	/EAG:100

/	SC.SDV IN THE CURRENT .SCOM AND THE IMAGE'S .SCOM	/EAG:100

/	FOR EQUALITY.  IF THEY ARE DIFFERENT WE COME TO		/EAG:100

/	DFSDV.							/EAG:100

/								/EAG:100

/   2.  DIFFERENT NUMBER OF .DAT SLOTS, DETECTED BY		/EAG:100

/	COMPARING LOCATION SC.SLT OF THE .SCOM'S FOR		/EAG:100

/	EQUALITY.  IF THEY ARE DIFFERENT WE COME TO DFDAT.	/EAG:100

/								/EAG:100

								/EAG:100

DFSDV=.								/EAG:100

DFDAT	JMS ERROR						/EAG:100

	  .TEXT <"DIFFERENT SYSTEM CONFIGURATIONS."<015>>	/EAG:101

	.TITLE CHECK MSBT FOR OPEN FILES

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ COME HERE AFTER WE'VE FINISHED CHECKING AND UPDATING		/EAG:100

/ THE IMAGE'S .SCOM.  HERE WE SCAN THE IMAGE'S MASS		/EAG:100

/ STORAGE BUSY TABLE (MSBT) TO CHECK FOR ANY OPEN FILES.	/EAG:100

/ IF WE FIND ANY WE GIVE AN APPROPRIATE WARNING.		/EAG:100

/								/EAG:100

								/EAG:100

CKMSBT	LAC MSBTAD		/ VERIFY THAT MSBT WAS		/EAG:100

	SNA			/ PRESERVED BY SCAN.		/EAG:100

	JMP BADIMG		/ ELSE SOMETHING IS WRONG	/EAG:100

	LAC MSBTNM		/ TAKE TWO'S COMPLEMENT		/EAG:100

	SNA!TCA			/ OF NUMBER OF ENTRIES FOR	/EAG:100

	JMP MSBTOK		/ LOOP COUNTER.  IF ZERO,	/EAG:100

	DAC MSBTNM		/ SKIP THIS.			/EAG:100

LPMSBT	LAC* MSBTAD		/ CHECK OUT NEXT MSBT ENTRY.	/EAG:100

	AND (777)		/ EXTRACT .DAT SLOT # AND	/EAG:100

	DAC LPMS.A		/ SAVE IT.			/EAG:100

	SNA!CLA			/ IF ZERO THEN THIS ENTRY IS	/EAG:100

	JMP NXMSBT		/ EMPTY, SO SKIP IT.		/EAG:100

	ISZ MSBTAD		/ BUMP POINTER TO BUFFER ENTRY.	/EAG:100

	LAC* MSBTAD		/ FETCH BUFFER TRANSFER VECTOR.	/EAG:100

	SNA!CLA!CMA		/ IF ZERO, ALL OK.  ELSE A	/EAG:100

	JMP NXMSBT		/ BUFFER IS ALLOCATED SO THE	/EAG:100

	LAW 777400		/ FILE IS OPEN.			/EAG:100

	AND LPMS.A		/ CHECK FOR NEGATIVE .DAT	/EAG:100

	SNA!CLL			/ SLOT NUMBERS, AND PERFORM	/EAG:100

	JMP LPMS.0		/ MAGIC TO CONVERT .DAT SLOT	/EAG:100

	LAC LPMS.A		/ NUMBER TO 5/7 ASCII TO BE	/EAG:100

	CLL!TCA			/ INSERTED INTO WARNING		/EAG:100

	AND (100777)		/ MESSAGE.			/EAG:100

	DAC LPMS.A						/EAG:100

LPMS.0	LAC LPMS.A						/EAG:100

	ALS+4							/EAG:100

	XOR LPMS.A						/EAG:100

	CLL!RAL							/EAG:100

	AND (703416)		/ MASK OUT CRUFT		/EAG:100

	TAD (330140)		/ AND SET HIGH BITS IN		/EAG:100

				/ DIGITS AND SIGN.		/EAG:100

	DAC LPMS.1		/ SAVE INTO MESSAGE.		/EAG:100

	JMS WARN		/ ISSUE WARNING			/EAG:100

	  LPMS.2-.*400		/	(LINE BUFFER HEADER)	/EAG:100

	  0							/EAG:100

	  .ASCII "OPEN FILE ON .DA"				/EAG:101

	  .ASCII "T +NN"					/EAG:100

LPMS.1=.-1							/EAG:100

	  .ASCII "."<015>					/EAG:101

LPMS.2	  .TEXT <<011>"CLOSE IT"<175>>				/EAG:101

	LAW -1			/ BACK UP POINTER TO		/EAG:100

	TAD MSBTAD		/ .DAT SLOT ENTRY.		/EAG:100

	DAC LPMS.A						/EAG:100

	DZM* LPMS.A		/ CLEAR IT.			/EAG:100

	LAC BFTBAD		/ SET UP TO SCAN BUFFER		/EAG:100

	DAC LPMS.A		/ TABLE FOR IN USE FILE		/EAG:100

	LAC BFTBNM		/ BUFFER.			/EAG:100

	SNA!TCA			/ IF NO ENTRIES GO TO NOT	/EAG:100

	JMP LPMS.4		/ FOUND EXIT.			/EAG:100

	DAC LPMS.B						/EAG:100

LPMS.3	LAC* LPMS.A		/ PICK UP BUFFER TABLE ENTRY,	/EAG:100

	CMA			/ ASSUME IT'S IN USE,		/EAG:100

	SAD* MSBTAD		/ AND SEE IT IT'S THE ONE	/EAG:100

	JMP LPMS.5		/ WE'RE LOOKING FOR.		/EAG:100

	ISZ LPMS.A		/ IT ISN'T -- ADVANCE TO NEXT	/EAG:100

	ISZ LPMS.B		/ ENTRY IN TABLE.		/EAG:100

	JMP LPMS.3						/EAG:100

LPMS.4	JMS WARN		/ ENTRY NOT FOUND IN TABLE.	/EAG:100

	  .TEXT <"BUFFER ILLEGAL OR NOT IN USE."<015>>		/EAG:101

	  .TEXT <<011>"IGNORE IT"<175>>				/EAG:101

	SKP							/EAG:100

LPMS.5	DAC* LPMS.A		/ FLAG BUFFER NOT IN USE	/EAG:100

	DZM* MSBTAD		/ CLEAR BUFFER ENTRY IN		/EAG:100

	DZM MSBTSW		/ MSBT, AND FLAG BOTH MSBT	/EAG:100

	DZM BFTBSW		/ AND BUFFER TABLE TO		/EAG:100

				/ BE WRITTEN OUT.		/EAG:100

	CLA!CMA			/ COMPENSATE FOR HOW WE'VE	/EAG:100

				/ BUMPED MSBT POINTER (MSBTAD)	/EAG:100

NXMSBT	TAD MSBTAD		/ ADVANCE MSBT POINTER TO	/EAG:100

	TAD MSBTEN		/ NEXT ENTRY			/EAG:100

	DAC MSBTAD						/EAG:100

	ISZ MSBTNM		/ DONE YET?			/EAG:100

	JMP LPMSBT						/EAG:100

MSBTOK	JMP BRNGIN		/ YES -- GO BRING IN IMAGE	/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

LPMS.A	0			/ TEMPORARY USED ABOVE		/EAG:100

								/EAG:100

LPMS.B	0			/ TEMPORARY USED ABOVE		/EAG:100

	.TITLE WRITE OUT .SCOM AND MSBT AND BRING IN IMAGE

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ COME HERE AFTER ALL ERROR CHECKS HAVE BEEN PASSED.		/EAG:100

/ FIRST WE WRITE OUT THE UPDATED .SCOM, MSBT, AND BUFFER	/EAG:100

/ TABLES (IF APPROPRIATE).  THEN WE BRING IN THE IMAGE		/EAG:100

/ FROM THE QAREA.  WHEN BRINGING IN THE IMAGE WE TAKE		/EAG:100

/ CARE NOT TO OVERWRITE THE BOOTSTRAP.				/EAG:100

/								/EAG:100

								/EAG:100

BRNGIN	LAC SCMBUF		/ WRITE OUT .SCOM		/EAG:100

	AAC -1							/EAG:100

	DAC TRNBUF						/EAG:100

	LAC SCMLEN						/EAG:100

	DAC TRNLEN						/EAG:100

	LAC SCMBLK						/EAG:100

	DAC TRNBLK						/EAG:100

	STL							/EAG:100

	ISZ SCMSW						/EAG:100

	JMS TRAN						/EAG:100

	LAC MSBTBF		/ WRITE OUT MSBT		/EAG:100

	AAC -1							/EAG:100

	DAC TRNBUF						/EAG:100

	LAC MSBTLN						/EAG:100

	DAC TRNLEN						/EAG:100

	LAC MSBTBK						/EAG:100

	DAC TRNBLK						/EAG:100

	STL							/EAG:100

	ISZ MSBTSW						/EAG:100

	JMS TRAN						/EAG:100

	LAC BFTBBF		/ WRITE OUT BUFFER TABLE	/EAG:100

	AAC -1							/EAG:100

	DAC TRNBUF						/EAG:100

	LAC BFTBLN						/EAG:100

	DAC TRNLEN						/EAG:100

	LAC BFTBBK						/EAG:100

	DAC TRNBLK						/EAG:100

	STL							/EAG:100

	ISZ BFTBSW						/EAG:100

	JMS TRAN						/EAG:100

	LAW 770000		/ CALCULATE ADDRESS ABOVE	/EAG:100

	AND* (SC.COD)		/ BOOTSTRAP			/EAG:100

	TAD (10000)						/EAG:100

	TCA			/ CONVERT TO RELATIVE OFFSET	/EAG:100

	TAD* (SC.CQB+1)		/ INTO IMAGE			/EAG:100

	CMA!STL							/EAG:100

	DAC BRIN.A		/ REMEMBER IT			/EAG:100

	TAD* (SC.CQB+2)		/ CHECK IF IMAGE EXTENDS ABOVE	/EAG:100

	SNL			/ BOOTSTRAP.  IF IT DOESN'T,	/EAG:100

	JMP BRIN.2		/ JMP PAST ALL THE FUNNY CODE.	/EAG:100

	LAC BUFBAS		/ SET UP TO READ INTO BUFFER.	/EAG:100

	AAC -1							/EAG:100

	DAC TRNBUF						/EAG:100

	LAW -400		/ A SINGLE BLOCK.		/EAG:100

	DAC TRNLEN						/EAG:100

	LAC BRIN.A		/ SPECIFICALLY, THE BLOCK	/EAG:100

	CLL			/ CONTAINING THE FIRST WORD	/EAG:100

	LRS+10			/ ABOVE THE BOOTSTRAP.		/EAG:100

	TAD* (SC.CQB)						/EAG:100

	DAC TRNBLK						/EAG:100

	LAC BRIN.A		/ POINT X11 TO JUST ABOVE	/EAG:100

	TAD* (SC.CQB+1)		/ BOOTSTRAP.			/EAG:100

	DAC* (X11)						/EAG:100

	LAC BRIN.A		/ CHECK IF BOOTSTRAP ENDS	/EAG:100

	AND (377)		/ ON A WORD BOUNDARY.		/EAG:100

	SNA			/ IF IT DOES, THEN JMP		/EAG:100

	JMP BRIN.1		/ PAST THE COPY LOOP.		/EAG:100

	TAD TRNBUF		/ ELSE POINT X10 TO WORD	/EAG:100

	DAC* (X10)		/ JUST ABOVE BOOTSTRAP		/EAG:100

				/ WITHIN THE IMAGE WHERE	/EAG:100

				/ IT WILL BE IN THE BUFFER.	/EAG:100

	LAC BRIN.A		/ CALCULATE ADDRESS OF LAST	/EAG:100

	AAC 377			/ WORD WITHIN THE BLOCK		/EAG:100

	AND (777400)		/ CONTAINING THE FIRST WORD	/EAG:100

	TAD* (SC.CQB+1)		/ ABOVE THE BOOTSTRAP.		/EAG:100

	CLL!TCA			/ COMPARE AGAINST MEMSIZ,	/EAG:100

	TAD* (SC.MSZ)		/ AND USE WHICHEVER IS SMALLER.	/EAG:100

	SNL!TCA							/EAG:100

	CLA							/EAG:100

	TAD* (SC.MSZ)						/EAG:100

	CLL!TCA			/ USE TO CALCULATE NUMBER OF	/EAG:100

	TAD* (X11)		/ WORDS TO COPY.		/EAG:100

	SNA!SZL			/ IF ZERO OR NEGATIVE WORDS TO	/EAG:100

	JMP BRIN.2		/ COPY, JMP PAST THIS.		/EAG:100

	DAC BRIN.A		/ SAVE FOR LOOP COUNTER.	/EAG:100

	CLL			/ READ IN BLOCK.		/EAG:100

	JMS TRAN						/EAG:100

BRIN.0	LAC* X10		/ COPY SEGMENT WHICH GOES ABOVE	/EAG:100

	DAC* X11		/ BOOTSTRAP FROM BUFFER TO	/EAG:100

	ISZ BRIN.A		/ ABOVE BOOTSTRAP.		/EAG:100

	JMP BRIN.0						/EAG:100

	ISZ TRNBLK		/ CONTINUE WITH NEXT BLOCK.	/EAG:100

BRIN.1	LAC* (X11)		/ X11 POINTS TO FIRST BLOCK	/EAG:100

	DAC TRNBUF		/ BOUNDARY ABOVE BOOTSTRAP --	/EAG:100

	LAC* (SC.CQB+1)		/ SET UP TO READ INTO THERE.	/EAG:100

	TCA			/ GET RELATIVE OFFSET WITHIN	/EAG:100

	TAD TRNBUF		/ IMAGE FOR THIS POINT		/EAG:100

	CLL			/ AND CALCULATE LENGTH OF	/EAG:100

	TAD* (SC.CQB+2)		/ REMAINING IMAGE.		/EAG:100

	SZL!SNA			/ IF THERE ISN'T ANY THEN JMP	/EAG:100

	JMP BRIN.2		/ PAST THE READ.		/EAG:100

	DAC TRNLEN						/EAG:100

	CLL			/ READ IN STUFF ABOVE BOOTSTRAP	/EAG:100

	JMS TRAN						/EAG:100

/ AT THIS POINT EVERYTHING ABOVE THE BOOTSTRAP HAS BEEN BROUGHT	/EAG:100

/ IN, AND ALL WE NEED DO IS READ IN THE STUFF BELOW.		/EAG:100

BRIN.2	LAC* (SC.COD)		/ CALCULATE LENGTH		/EAG:100

	TCA							/EAG:100

	TAD* (SC.CQB+1)						/EAG:100

	DAC* (SC.CQB+2)		/ USE PARAMETER BLOCK WITHIN	/EAG:100

	LAC (SC.CQB)		/ .SCOM, SINCE IT WILL BE	/EAG:100

	CLL			/ OVERLAYED.  THIS .MTRAN	/EAG:100

	.MTRAN			/ "RETURNS" TO THE NEW CORE	/EAG:100

				/ IMAGE.			/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

BRIN.A	0			/ TEMPORARY USED ABOVE		/EAG:100

	.TITLE SCMCHK -- CHECK .SCOM AND UPDATE LENLFT

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE SHOULD ONLY BE CALLED WHEN THE FIRST CHUNK	/EAG:100

/ OF THE IMAGE HAS BEEN BROUGHT INTO CORE -- I.E. WHEN		/EAG:100

/ THE IMAGE'S .SCOM IS IN CORE.  IT CHECKS THE IMAGES'S		/EAG:100

/ .SCOM AGAINST CERTAIN CRITERIA OF REASONABLENESS.		/EAG:100

/ THESE ARE ESSENTIALLY THE CHECKS WHICH MUST BE PASSED		/EAG:100

/ FOR A FILE TRANSFER OPERATION TO BE DOABLE, AND SHOULD	/EAG:100

/ BE PASSED BY ALL CORE IMAGES WHICH ARE REALLY CORE IMAGES,	/EAG:100

/ AND NOT JUST SOME GARBAGE FILE.  IF THE .SCOM CHECKS		/EAG:100

/ SUCCEED THE LENGTH OF THE IMAGE (IN THE IMAGE'S SC.CQB+2)	/EAG:100

/ IS CHECKED FOR VALIDITY AND LENLFT IS UPDATED TO REFLECT	/EAG:100

/ THIS LENGTH.  BEFORE CALLING THIS ROUTINE LENLFT SHOULD	/EAG:100

/ BE INITIALIZED FROM THE CURRENT SC.CQB+2.			/EAG:100

/								/EAG:100

/ NOTE THAT WE VERIFY THE IMAGE'S SC.CQB+2 BY VERIFYING THAT	/EAG:100

/ IT IS LESS THAN OR EQUAL IN MAGNITUDE (REMEMBERING THAT	/EAG:100

/ THEY ARE BOTH NEGATIVE NUMBERS) TO THE CURRENT SC.CQB+2.	/EAG:100

/ IF THERE WERE A CONVENIENT WAY OF OBTAINING THE CURRENT	/EAG:100

/ QAREA LENGTH (STORED IN SYSBLK) WE WOULD RATHER COMPARE	/EAG:100

/ AGAINST THIS.  THIS WOULD ALLOW US TO LOAD A FILE INTO	/EAG:100

/ THE QAREA IF IT WOULD FIT THERE, EVEN IF IT WOULD NOT		/EAG:100

/ FIT INTO CORE.  IF ANYONE EVER MAKES THIS CHANGE NOTE THAT	/EAG:100

/ THE LOGIC OF UPDATING LENLFT MUST BE CHANGED.			/EAG:100

/								/EAG:100

								/EAG:100

SCMCHK	0							/EAG:100

	LAC CORADR		/ COMPENSATE FOR IMAGE OFFSET	/EAG:100

	TCA							/EAG:100

	TAD TRNBUF		/ AND CALCULATE LOCATION OF	/EAG:100

	AAC 1+SC.CQB+1		/ THE IMAGE'S SC.CQB+1 WITHIN	/EAG:100

	DAC SCCK.A		/ THE CURRENT CHUNK (BUFFER).	/EAG:100

	LAC* SCCK.A		/ VERIFY THAT THE IMAGE'S	/EAG:100

	SAD* (SC.CQB+1)		/ OFFSET (SC.CQB+1) IS THE	/EAG:100

	SKP			/ SAME AS WHAT WE EXPECTED.	/EAG:100

	JMP BADIMG		/ ELSE THE IMAGE IS GARBAGE.	/EAG:100

	ISZ SCCK.A		/ BUMP TO IMAGE LENGTH.		/EAG:100

	LAC* SCCK.A		/ VERIFY THAT IMAGE INCLUDES	/EAG:100

	TCA!STL			/ .SCOM				/EAG:100

	TAD (-SC.BAS-SC.LEN)					/EAG:100

	SZL							/EAG:100

	JMP BADIMG						/EAG:100

	LAC* (SC.CQB+2)		/ VERIFY THAT IMAGE ISN'T TOO	/EAG:100

	TCA!STL			/ LARGE -- I.E. THAT ITS LENGTH	/EAG:100

	TAD* SCCK.A		/ IS NO BIGGER THAT SC.CQB+2.	/EAG:100

	SZL							/EAG:100

	JMP BIGIMG		/ IT'S TOO BIG.			/EAG:100

	TAD LENLFT		/ ADJUST LENLFT TO REFLECT	/EAG:100

	DAC LENLFT		/ ACTUAL SIZE OF IMAGE, RATHER	/EAG:100

				/ THAN SIZE IN SC.CQB+2.	/EAG:100

	JMP* SCMCHK		/ AND RETURN			/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE IF IMAGE IS TOO BIG.  GIVE WARNING AND, IF		/EAG:100

/ RECEIVE APPROPRIATE OVERRIDE, TRUNCATE IMAGE.			/EAG:100

								/EAG:100
BIGIMG	JMS WARN		/ ISSUE WARNING MESSAGE		/EAG:100

	  .TEXT <"IMAGE TOO LONG."<015>>			/EAG:101

	  .TEXT <<011>"TRUNCATE IT"<175>>			/EAG:101
	LAC* (SC.CQB+2)		/ TRUNCATE IMAGE -- SUBSTITUTE	/EAG:100
	DAC* SCCK.A		/ SC.CQB+2 FOR IMAGE LENGTH.	/EAG:100
	DZM SCMSW		/ FORCE UPDATE IN QAREA		/EAG:102

	JMP* SCMCHK		/ AND RETURN			/EAG:100

								/EAG:100

								/EAG:100

SCCK.A	-1			/ POINTER TO IMAGE'S SC.CQB+2	/EAG:100

	.TITLE SCMSAV -- PRESERVE IMAGE'S .SCOM FOR LATER

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE IS CALLED TO PRESERVE THE IMAGE'S .SCOM		/EAG:100

/ IN CORE SO THAT ERROR CHECKS AGAINST IT CAN BE DONE AT	/EAG:100

/ A LATER TIME.  THIS ROUTINE SHOULD ONLY BE CALLED WHEN	/EAG:100

/ THE FIRST CHUNK OF THE IMAGE (WHICH WILL ALWAYS CONTAIN	/EAG:100

/ .SCOM) IS IN CORE.  ALL FILE TRANSFER PROCESSING MUST BE	/EAG:100

/ COMPLETE BEFORE CALLING THIS ROUTINE.  THIS ROUTINE SETS	/EAG:100

/ UP THE VARIOUS WORDS DEFINING HOW WE'VE PRESERVED .SCOM	/EAG:100

/ AND SUBTRACTS SPACE FROM THE FILE TRANSFER BUFFER TO		/EAG:100

/ PROVIDE ROOM TO PRESERVE .SCOM.  SEE THE COMMENTS ABOUT	/EAG:100

/ THE .SCOM DEFINITION WORDS (SCMBUF, SCMLEN, SCMBLK,		/EAG:100

/ SCMADR, ETC.) FOR MORE INFORMATION.				/EAG:100

/								/EAG:100

								/EAG:100

SCMSAV	0							/EAG:100

	LAC BUFBAS		/ REMEMBER ADDRESS .SCOM BUFFER	/EAG:100

	DAC SCMBUF		/ USE FACT .SCOM IS ALWAYS AT	/EAG:100

				/ BEGINNING OF TRANSFER BUFFER.	/EAG:100

	LAC CORADR		/ DETERMINE LENGTH OF		/EAG:100

	AAC -SC.BAS-SC.LEN	/ .SCOM BUFFER.			/EAG:100

	AND (777400)		/ ROUNDED UP TO 400 MULTIPLE	/EAG:100

	DAC SCMLEN		/ REMEMBER TWO'S COMPLEMENT	/EAG:100

	TCA							/EAG:100

	TAD BUFBAS		/ ADJUST TRANSFER BUFFER FOR	/EAG:100

	DAC BUFBAS		/ SPACE WE JUST STOLE.		/EAG:100

	LAC SCMLEN						/EAG:100

	CLL!TCA							/EAG:100

	TAD BUFLEN		/ VERIFY THAT SOME SPACE IS	/EAG:100

	SZL			/ LEFT OVER.			/EAG:100

	JMP NOCORE		/ IF NOT, ERROR			/EAG:100

	DAC BUFLEN						/EAG:100

	LAC TRNBLK		/ REMEMBER BLOCK WHERE .SCOM	/EAG:100

	DAC SCMBLK		/ LIVES				/EAG:100

	LAC CORADR		/ AND CALCULATE REL. ADDR.	/EAG:100

	TCA			/ OF ZERO FOR CONVENIENT	/EAG:100

	TAD SCMBUF		/ ACCESS TO IMAGE'S .SCOM.	/EAG:100

	DAC SCMADR						/EAG:100

	JMP* SCMSAV		/ DONE -- RETURN		/EAG:100

	.TITLE MSTBSV -- PRESERVE IMAGE'S MASS STORAGE BSY TBL

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE PRESERVES THE IMAGE'S MASS STORAGE BUSY TABLE	/EAG:100

/ AND FILE BUFFER TRANSFER VECTOR TABLE IN CORE.  THIS IS	/EAG:100

/ SO THAT WE CAN VERIFY THAT THE IMAGE HAS NO OPEN FILES.	/EAG:100

/ THIS ROUTINE SHOULD BE CALLED FOR EACH CHUNK OF THE IMAGE	/EAG:100

/ WHEN THAT CHUNK IS STILL IN THE TRANSFER BUFFER, BUT AFTER	/EAG:100

/ THE CHUNK IS NO LONGER NEEDED FOR ANYTHING ELSE (I.E., AFTER	/EAG:100

/ THE CHUNK HAS BEEN TRANSFERRED).  THIS ROUTINE CHECKS IF	/EAG:100

/ ANY PIECE OF THE TABLES IS IN THE CHUNK AND REMEMBERS THEM	/EAG:100

/ IF SO.  IN THE PROCESS THIS ROUTINE SETS UP MSBTAD, MSBTNM,	/EAG:100

/ MSBTBF, BFTBAD, ETC.						/EAG:100

/								/EAG:100

/ IT SHOULD BE NOTED THAT ALL THE REAL WORK IS DONE BY THE	/EAG:100

/ HAIRY ROUTINE MSSV.A.						/EAG:100

/								/EAG:100

								/EAG:100

MSBTSV	0							/EAG:100

	LAC MSBTAD		/ CHECK IF MSBT IS ALREADY	/EAG:100

	SNA			/ PRESERVED -- SKIP IF IT IS.	/EAG:100

	JMP MSSV.0						/EAG:100

	LAC BFTBAD		/ AND DO THE SAME FOR BUFFER	/EAG:100

	SZA			/ TABLE.			/EAG:100

	JMP* MSBTSV		/ BOTH ALREADY PRESERVED --	/EAG:100

				/ SO RETURN			/EAG:100

MSSV.0	LAC SCMADR		/ SOMETHING REMAINS TO BE	/EAG:100

	SNA			/ PRESERVED.  VERIFY .SCOM IN	/EAG:100

	JMP* MSBTSV		/ CORE, RETURN IF IT ISN'T.	/EAG:100

	AAC SC.ACT		/ CALCULATE ADDRESS OF ALL THE	/EAG:100

	DAC MSBTNM		/ .SCOM REGISTERS WE CARE	/EAG:100

	AAC SC.BTA-SC.ACT	/ ABOUT.			/EAG:100

	DAC MSSV.8						/EAG:100

	AAC SC.BTL-SC.BTA					/EAG:100

	DAC MSBTEN						/EAG:100

	AAC SC.BNM-SC.BTL					/EAG:100

	DAC BFTBNM						/EAG:100

	AAC SC.BTB-SC.BNM					/EAG:100

	DAC MSSV.9						/EAG:100

	LAC* MSBTNM		/ FETCH ACTUAL .SCOM REGISTER	/EAG:100

	DAC MSBTNM		/ CONTENTS FOR .SCOM REGISTERS	/EAG:100

	LAC* MSSV.8		/ WHICH WE CARE ABOUT.		/EAG:100

	DAC MSSV.8						/EAG:100

	LAC* MSBTEN						/EAG:100

	DAC MSBTEN						/EAG:100

	LAC* BFTBNM						/EAG:100

	DAC BFTBNM						/EAG:100

	LAC* MSSV.9						/EAG:100

	DAC MSSV.9						/EAG:100

	LAC MSSV.8		/ DETERMINE WHICH COMES FIRST	/EAG:100

	CLL!TCA			/ THE MSBT OR THE BUFFER TBL.	/EAG:100

	TAD MSSV.9						/EAG:100

	SNL			/ SKIP IF MSBT FIRST.		/EAG:100

	JMP MSSV.4		/ BUFFER TABLE FIRST		/EAG:100

MSSV.1	LAC MSBTNM		/ PROCESS MSBT.  FIRST CHECK	/EAG:100

	SZA			/ TO SEE IF IT DOESN'T EXIST --	/EAG:100

	JMP MSSV.2		/ JMP IF IT DOES EXIST.		/EAG:100

	LAW -1			/ NUMBER OF ENTRIES IS ZERO.	/EAG:100

	DAC MSBTAD		/ PUT -1 IN MSBTAD TO INDICATE	/EAG:100

	JMP MSSV.4		/ MSBT DOESN'T EXIST, AND GO	/EAG:100

				/ CHECK BUFFER TABLE.		/EAG:100

								/EAG:100

MSSV.2	DAC MSSV.3		/ PUT NUMBER OF ENTRIES INTO	/EAG:100

				/ MULTIPLY INSTRUCTION.		/EAG:100

	LAC MSBTEN		/ GET LENGTH OF ENTRY		/EAG:100

	SNA!CLL			/ AND VERIFY ITS LEGIT.		/EAG:100

	JMP BADIMG						/EAG:100

	MUL			/ DETERMINE TOTAL LENGTH	/EAG:100

MSSV.3	-1			/ OF MSBT.			/EAG:100

	SZA			/ MAKE SURE IT'S REASONABLE	/EAG:100

	JMP BADIMG						/EAG:100

	LACQ							/EAG:100

	DAC MSBTSZ		/ AND STORE IT AWAY		/EAG:100

	LAC MSBTAD		/ CHECK IF WE'VE ALREADY	/EAG:100

	SZA			/ PRESERVED MSBT.		/EAG:100

	JMP MSSV.4		/ YES -- GO CHECK BUFFER TBL.	/EAG:100

	JMS MSSV.A		/ NO -- CALL ROUTINE TO DO	/EAG:100

	  TAD MSSV.8		/ THE RIGHT THING.  IF ANY OF	/EAG:100

	  TAD MSSV.9		/ MSBT IS IN CURRENT CHUNK,	/EAG:100

	  TAD BFTBAD		/ THIS WILL PRESERVE IT.	/EAG:100

	  TAD BFTBBF		/ THIS ROUTINE DOESN'T ALWAYS	/EAG:100

	  TAD BFTBLN		/ RETURN!			/EAG:100

	  TAD MSBTSZ						/EAG:100

	  DAC MSBTAD						/EAG:100

	  DAC MSBTBF						/EAG:100

	  DAC MSBTLN						/EAG:100

	  DAC MSBTBK						/EAG:100

MSSV.4	LAC BFTBNM		/ PROCESS BUFFER TABLE.		/EAG:100

	SNA!CLA!CMA		/ FIRST CHECK IF ZERO LENGTH.	/EAG:100

	DAC BFTBAD		/ ZERO LENGTH -- FLAG BFTBAD	/EAG:100

				/ WITH -1 TO INDICATE BUFFER	/EAG:100

				/ TABLE DOESN'T EXIST.		/EAG:100

	LAC BFTBAD		/ CHECK IF BUFFER TABLE ALREADY	/EAG:100

	SZA			/ PRESERVED.  SKIP IF IT ISN'T.	/EAG:100

	JMP MSSV.5		/ IT HAS BEEN -- DON'T REPEAT.	/EAG:100

	JMS MSSV.A		/ CALL MAGIC HAIRY ROUTINE TO	/EAG:100

	  TAD MSSV.9		/ PRESERVE IT.			/EAG:100

	  TAD MSSV.8		/ THIS ROUTINE DOESN'T ALWAYS	/EAG:100

	  TAD MSBTAD		/ RETURN!			/EAG:100

	  TAD MSBTBF						/EAG:100

	  TAD MSBTLN						/EAG:100

	  TAD BFTBNM						/EAG:100

	  DAC BFTBAD						/EAG:100

	  DAC BFTBBF						/EAG:100

	  DAC BFTBLN						/EAG:100

	  DAC BFTBBK						/EAG:100

MSSV.5	LAC MSBTAD		/ CHECK IF MSBT PRESERVED	/EAG:100

	SNA			/ YET.  IF IT ISN'T, LOOP	/EAG:100

	JMP MSSV.1		/ BACK TO CHECK FOR IT.		/EAG:100

	JMP* MSBTSV		/ ELSE RETURN			/EAG:100

								/EAG:100

								/EAG:100

MSSV.8	-1			/ TEMP TO SAVE ADDRESS (WITHIN	/EAG:100

				/ IMAGE) OF MSBT.		/EAG:100

								/EAG:100

MSSV.9	-1			/ TEMP TO SAVE ADDRESS (WITHIN	/EAG:100

				/ IMAGE) OF BUFFER TABLE.	/EAG:100

								/EAG:100

	.EJECT							/EAG:100

/								/EAG:100

/ THIS SUBROUTINE DOES MOST OF THE REAL WORK OF MSBTSV.		/EAG:100

/ THIS IS A VERY HAIRY SUBROUTINE.  BASICALLY IT CHECKS		/EAG:100

/ TO SEE IF ANY PART OF THE TABLE WHICH WANTS TO BE		/EAG:100

/ PRESERVED (EITHER THE MSBT OR THE BUFFER TABLE) IS IN THE	/EAG:100

/ CURRENT CHUNK.  IF SO IT PRESERVES IT.  WHAT MAKES IT HAIRY	/EAG:100

/ IS THE FACT THAT THERE ARE LOTS OF BOUNDARIES WHICH MIGHT	/EAG:100

/ BE CROSSED.  THIS ROUTINE HANDLES ALL OF THEM CORRECTLY.	/EAG:100

/								/EAG:100

/ THIS ROUTINE DOES NOT ALWAYS RETURN IN THE NORMAL SENSE.	/EAG:100

/ IF IT DETECTS THAT A CHUNK IS ALL USED UP -- I.E. THE		/EAG:100

/ THING IT'S LOOKING TO PRESERVE EITHER COMES AFTER THIS	/EAG:100

/ CHUNK OR RUNS OFF THE END OF THIS CHUNK -- THEN IT		/EAG:100

/ RETURNS FROM MSBTSV WITHOUT RETURNING TO MSBTSV.		/EAG:100

/								/EAG:100

/ THIS ROUTINE MAKES MANY ASSUMPTIONS.  IT ASSUMES THAT		/EAG:100

/ IT IS CALLED TO PRESERVE THE TABLE WITH THE LOWER ADDRESS	/EAG:100

/ FIRST.  THUS IT ASSUMES THAT EVERYTHING OF INTEREST		/EAG:100

/ BEFORE THE START OF THE CURRENT CHUNK HAS ALREADY BEEN	/EAG:100

/ PRESERVED.  ALL ADDRESSES ARE ASSUMED TO BE 18 BITS WIDE.	/EAG:100

/ IT ASSUMES THAT A TABLE'S DEFINING REGISTERS (????AD,		/EAG:100

/ ????BF, ????LN, AND ????BK) ARE ZERO BEFORE IT IS PRESERVED.	/EAG:100

/ IF THE TABLE IS NONEXISTENT THEN THEY MUST ALL BE ZERO	/EAG:100

/ EXCEPT FOR ????AD, WHICH SHOULD CONTAIN -1.			/EAG:100

/								/EAG:100

/ NOTE:  I HAVE INFORMALLY PROVED THIS ROUTINE TO BE CORRECT.	/EAG:100

/	I WOULD GREATLY APPRECIATE HEARING OF ANY BUGS WHICH	/EAG:100

/	ANYONE CLAIMS TO HAVE FOUND IN THIS ROUTINE.  THANX.	/EAG:100

/				ED GARDNER			/EAG:100

/								/EAG:100

/ CALLING SEQUENCE:						/EAG:100

/								/EAG:100

/ IN THE CALLING SEQUENCE DESCRIPTION BELOW THE PHRASE		/EAG:100

/ "THIS TABLE" REFERS TO THAT TABLE (MSBT OR BUFFER TABLE)	/EAG:100

/ WHICH IS BEING PRESERVED, AND THE PHRASE "OTHER TABLE"	/EAG:100

/ REFERS TO THE OTHER TABLE.  THE READER IS ENCOURAGED		/EAG:100

/ TO CHECK THE CALLING SEQUENCE EXAMPLES GIVEN IN MSBTSV	/EAG:100

/ ABOVE.  NOTE THAT ALL ARGUEMENTS ARE ACTUALLY INSTRUCIONS	/EAG:100

/ TO FETCH (TAD) OR STORE (DAC) THE VALUE DESIRED.		/EAG:100

/								/EAG:100

/	JMS MSSV.A						/EAG:100

/	  TAD <ADDRESS OF THIS TABLE WITHIN CORE IMAGE>		/EAG:100

/	  TAD <ADDRESS OF OTHER TABLE WITHIN CORE IMAGE>	/EAG:100

/	  TAD <????AD DEFINING REGISTER FOR OTHER TABLE>	/EAG:100

/	  TAD <????BF DEFINING REGISTER FOR OTHER TABLE>	/EAG:100

/	  TAD <????LN DEFINING REGISTER FOR OTHER TABLE>	/EAG:100

/	  TAD <LENGTH OF THIS TABLE>				/EAG:100

/	  DAC <????AD DEFINING REGISTER FOR THIS TABLE>		/EAG:100

/	  DAC <????BF DEFINING REGISTER FOR THIS TABLE>		/EAG:100

/	  DAC <????LN DEFINING REGISTER FOR THIS TABLE>		/EAG:100

/	  DAC <????BK DEFINING REGISTER FOR THIS TABLE>		/EAG:100

/	<RETURN>						/EAG:100

/								/EAG:100

								/EAG:100

MSSV.A	0							/EAG:100

	LAC CORADR		/ DETERMINE ADDRESS WITHIN	/EAG:100

	CLL!TCA			/ IMAGE CORRESPONDING TO TOP	/EAG:100

	TAD TRNLEN		/ OF TRANSFER BUFFER, AND	/EAG:100

	XCT* MSSV.A		/ CHECK IF TABLE WE'RE LOOKING	/EAG:100

	SNL!CLL!TCA		/ FOR IS ABOVE IT.		/EAG:100

	JMP* MSBTSV		/ IF IT IS, DONE WITH THIS	/EAG:100

				/ CHUNK SO EXIT MSBTSV.		/EAG:100

	TAD BUFLEN		/ OTHERWISE OBTAIN ADDRESS OF	/EAG:100

	TCA			/ TABLE RELATIVE TO BUFBAS.	/EAG:100

	DAC MSSV.X		/ REMEMBER WHERE TABLE IS NOW.	/EAG:100

	SNL!SZA			/ CHECK IF IT'S ABOVE BUFBAS	/EAG:100

	AND (377)		/ AND TRUNCATE IF SO.		/EAG:100

	DAC MSSV.Y		/ REMEMBER WHERE TABLE IS GOING	/EAG:100

	CLA			/ TO BE PRESERVED.		/EAG:100

	LAC* MSSV.A		/ ASSUME OTHER TABLE ALREADY	/EAG:100

	CLL!TCA			/ PRESERVED AND CHECK IF ITS	/EAG:100

	ISZ MSSV.A		/ BUFFER CONTAINS PART OF THIS	/EAG:100

	XCT* MSSV.A		/ TABLE.  COMPUTE ADDRESS	/EAG:100

	TCA			/ (WITHIN ITS PRESERVED BUFFER)	/EAG:100

	ISZ MSSV.A		/ OF THIS TABLE.		/EAG:100

	XCT* MSSV.A						/EAG:100

	DAC MSSV.W		/ REMEMBER IN CASE WE NEED IT.	/EAG:100

	TCA							/EAG:100

	ISZ MSSV.A		/ COMPARE AGAINST END ADDRESS	/EAG:100

	XCT* MSSV.A		/ OF ITS PRESERVED BUFFER	/EAG:100

	TCA			/ LINK WILL BE CLEAR IF THIS	/EAG:100

	ISZ MSSV.A		/ TABLE STARTS WITHIN OTHER	/EAG:100

	XCT* MSSV.A		/ TABLE'S PRESERVED BUFFER.	/EAG:100

	SZL!CLA			/ CHECK THIS, THEN VERIFY THAT	/EAG:197

	JMP MSSV.B		/ OTHER TABLE IS PRESERVED BY	/EAG:197

	XCT* MSSV.A		/ CHECKING THAT ITS ????LN IS	/EAG:197

	SNA			/ NON-ZERO.  IF THIS TABLE	/EAG:197

	JMP MSSV.B		/ STARTS WITHIN PRESERVED	/EAG:197

				/ BUFFER CONTINUE, ELSE		/EAG:197

				/ ADVANCE TO MSSV.B		/EAG:197

	LAC BUFBAS		/ GET ADDRESS (WITHIN OTHER	/EAG:100

	TCA			/ TABLE'S PRESERVED BUFFER) OF	/EAG:100

	TAD MSSV.W		/ THIS TABLE RELATIVE TO BUFBAS	/EAG:100

	DAC MSSV.Y		/ AND SAVE IN MSSV.Y.		/EAG:100

MSSV.B	LAC MSSV.Y		/ CALCULATE ADDRESS RELATIVE TO	/EAG:100

	ISZ MSSV.A		/ BUFBAS OF TOP OF THIS TABLE	/EAG:100

	XCT* MSSV.A		/ AND ROUND UP TO MULTIPLE	/EAG:100

	AAC 377			/ OF 400 (DISK BLOCK BOUNDARY)	/EAG:100

	AND (777400)		/ TO GET ADDITIONAL LENGTH WE	/EAG:100

	DAC MSSV.Z		/ ARE ABOUT TO PRESERVE.	/EAG:100

	LAC BUFBAS		/ POINT X11 TO WHERE WE WILL	/EAG:100

	AAC -1			/ COPY TO (IF WE COPY)		/EAG:100

	DAC* (X11)						/EAG:100

	LAW 777400		/ ADJUST BASE ADDRESS OF	/EAG:100

	AND MSSV.Y		/ TABLE (RELATIVE TO BUFBAS)	/EAG:100

	TCA			/ BY HOW MUCH IS ALREADY	/EAG:100

	TAD MSSV.X		/ PRESERVED AND TRUNCATE	/EAG:100

	AND (777400)		/ TO GET ADDRESS FROM WHERE	/EAG:100

	TAD BUFBAS		/ WE WILL COPY, AND PUT		/EAG:100

	AAC -1			/ IN X10.			/EAG:100

	DAC* (X10)						/EAG:100

	CMA			/ CALCULATE OFFSET RELATIVE TO	/EAG:100

	TAD BUFBAS		/ BUFBAS OF END OF TABLE (I.E.	/EAG:100

	TCA!STL			/ END OF PORTION WHICH WILL BE	/EAG:100

	TAD MSSV.Z		/ COPIED) AND COMPARE AGAINST	/EAG:100

	TAD BUFLEN		/ LENGTH OF TRANSFER BUFFER, TO	/EAG:100

	SZL!SNA!TCA		/ CHECK IF STUFF TO BE COPIED	/EAG:100

	JMP MSSV.C		/ OVERFLOWS TRANSFER BUFFER.	/EAG:100

	TAD MSSV.Z		/ IT OVERFLOWS THE BUFFER --	/EAG:100

	DAC MSSV.Z		/ REVISE LENGTH SO COPY WILL	/EAG:100

	LAC MSSV.A		/ STOP AT END OF TRANSFER	/EAG:100

	AAC 4			/ BUFFER, AND DON'T SET UP	/EAG:100

	DAC MSSV.A		/ PRESERVED BUFFER DEFINING	/EAG:100

	JMP MSSV.D		/ REGISTERS (UNTIL NEXT TIME).	/EAG:100

								/EAG:100

MSSV.C	LAC MSSV.Y		/ STUFF TO BE COPIED EXISTS	/EAG:100

	TAD BUFBAS		/ WITHIN TRANSFER BUFFER, SO	/EAG:100

	ISZ MSSV.A		/ SET UP PRESERVED TABLE	/EAG:100

	XCT* MSSV.A		/ DEFINING REGISTERS AS TABLE	/EAG:100

	LAC MSSV.Y		/ PRESERVATION WILL BE COMPLETE	/EAG:100

	AND (777400)		/ AFTER WE EXIT HERE.  SET UP	/EAG:100

	TAD BUFBAS		/ ????AD ABOVE, ???BF HERE.	/EAG:100

	ISZ MSSV.A						/EAG:100

	XCT* MSSV.A						/EAG:100

	DAC MSSV.W		/ SAVE FOR BELOW.		/EAG:100

	LAC BUFBAS		/ SET UP ????LN			/EAG:100

	TAD MSSV.Z						/EAG:100

	TCA							/EAG:100

	TAD MSSV.W						/EAG:100

	ISZ MSSV.A						/EAG:100

	XCT* MSSV.A						/EAG:100

	LAC MSSV.X		/ SET UP ????BK			/EAG:100

	TAD BUFBAS						/EAG:100

	CLL!TCA							/EAG:100

	TAD TRNBUF						/EAG:100

	CMA							/EAG:100

	LRS+10			/ NOTE:  NEGATIVE BLOCK OFFSETS	/EAG:100

	TAD TRNBLK		/ ARE POSSIBLE, IN WHICH CASE	/EAG:100

	ISZ MSSV.A		/ THE LINK WILL BE SET.		/EAG:100

	XCT* MSSV.A						/EAG:100

MSSV.D	LAC MSSV.Z		/ UPDATE BUFBAS AND BUFLEN TO	/EAG:100

	TAD BUFBAS		/ PROVIDE ROOM FOR PRESERVED	/EAG:100

	DAC BUFBAS		/ TABLE BUFFER.			/EAG:100

	LAC BUFLEN		/ WHEN UPDATING BUFLEN		/EAG:100

	STL			/ VERIFY THAT WE DON'T		/EAG:100

	TAD MSSV.Z		/ RUN OUT OF (BUFFER) MEMORY.	/EAG:100

	DAC BUFLEN						/EAG:100

	LAC MSSV.X		/ COMPARE FROM AND TO ADDRESSES	/EAG:100

	SAD MSSV.Y		/ TO SEE IF COPY IS NEEDED.	/EAG:100

	JMP MSSV.F		/ IT'S NOT NEEDED -- SKIP IT.	/EAG:100

	LAC MSSV.Z		/ IF LENGTH IS ZERO WE CAN	/EAG:100

	SNA!TCA			/ ALSO SKIP IT, ELSE GET TWO'S	/EAG:100

	JMP MSSV.F		/ COMPLEMENT FOR LOOP COUNTER.	/EAG:100

	DAC MSSV.W						/EAG:100

MSSV.E	LAC* X10		/ COPY AND PRESERVE TABLE	/EAG:100

	DAC* X11		/ IMAGE.			/EAG:100

	ISZ MSSV.W		/ DONE?				/EAG:100

	JMP MSSV.E		/ NO.				/EAG:100

	LAC BUFLEN		/ COMPUTE ADDRESS OF END OF	/EAG:100

	CMA			/ TRANSFER BUFFER, AND CHECK	/EAG:100

	TAD BUFBAS		/ IF COPY EXTENDED TO IT.	/EAG:100

	SAD* (X10)		/ IF IT DID, EXIT FROM MSBTSV	/EAG:100

	JMP* MSBTSV		/ RATHER THAN NORMAL RETURN	/EAG:100

MSSV.F	JMP* MSSV.A		/ NORMAL RETURN			/EAG:100

								/EAG:100

								/EAG:100

MSSV.W	0			/ TEMPORARY USED ABOVE		/EAG:100

								/EAG:100

MSSV.X	-1			/ TEMP TO HOLD OFFSET RELATIVE	/EAG:100

				/ TO BUFBAS OF WHERE TABLE IS	/EAG:100

				/ COMING FROM.			/EAG:100

								/EAG:100

MSSV.Y	-1			/ TEMP TO HOLD OFFSET RELATIVE	/EAG:100

				/ TO BUFBAS OF WHERE TABLE IS	/EAG:100

				/ GOING TO.			/EAG:100

								/EAG:100

MSSV.Z	0			/ TEMP TO HOLD LENGTH OF TABLE	/EAG:100

				/ SEGMENT TO BE COPIED.		/EAG:100

	.TITLE SETUP -- INITIALIZE DISK TRANSFERS

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE INITIALIZES THE BUFFER ADDRESSES AND WORD	/EAG:100

/ COUNTS FOR ALL DISK TRANSFERS.  THE BUFFER ADDRESSES		/EAG:100

/ ARE MADE TO REFER TO THE TRANSFER BUFFER -- I.E. BUFBAS.	/EAG:100

/ THE WORD COUNTS ARE SET UP TO BE THE TRANSFER BUFFER LENGTH	/EAG:100

/ (IN BUFLEN) OR THE TRANSFER LENGTH REMAINING (IN LENLFT),	/EAG:100

/ WHICHEVER IS SHORTER.						/EAG:100

/								/EAG:100

								/EAG:100

SETUP	0							/EAG:100

	LAC BUFBAS		/ POINT BUFFER POINTERS TO	/EAG:100

	DAC PUTBF1		/ TRANSFER BUFFER		/EAG:100

	DAC PUTBF2						/EAG:100

	DAC GETBF1						/EAG:100

	DAC GETBF2						/EAG:100

	AAC -1			/ .MTRAN WANTS ADDRESS -1	/EAG:100

	DAC TRNBUF						/EAG:100

	LAC BUFLEN		/ DETERMINE WHETHER BUFLEN OR	/EAG:100

	TCA!STL			/ LENLFT IS SHORTER.  NOTE THAT	/EAG:100

	TAD LENLFT		/ BOTH ARE ALREADY NEGATIVE.	/EAG:100

	SNL!TCA			/ SKIP IF BUFLEN SHORTER.	/EAG:100

	CLA			/ LENLFT SHORTER, SO USE IT.	/EAG:100

	TAD LENLFT		/ GET CORRECT LENGTH		/EAG:100

	DAC PUTLN1		/ AND PUT IT EVERYWHERE.	/EAG:100

	DAC PUTLN2						/EAG:100

	DAC GETLN1						/EAG:100

	DAC GETLN2						/EAG:100

	DAC TRNLEN						/EAG:100

	JMP* SETUP		/ DONE -- RETURN		/EAG:100

	.TITLE TRAN -- ROUTINE TO TRANSFER TO/FROM QAREA

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE PERFORMS THE TRANSFERS TO AND FROM THE		/EAG:100

/ QAREA.  IT DOES THIS BY USING THE MONITOR TRAN ROUTINE	/EAG:100

/ (.MTRAN).  BEFORE CALLING THIS ROUTINE TRNBLK, TRNBUF,	/EAG:100

/ AND TRNLEN MUST BE SET UP.  TRNBUF AND TRNLEN ARE NORMALLY	/EAG:100

/ SET UP BY THE ROUTINE SETUP.					/EAG:100

/								/EAG:100

/ THE LINK INDICATES THE TRANSFER DIRECTION.  IF THE LINK	/EAG:100

/ IS SET WHEN THIS ROUTINE IS CALLED THEN CORE IS WRITTEN	/EAG:100

/ OUT TO THE QAREA.  IF THE LINK IS CLEAR THE QAREA IS		/EAG:100

/ READ INTO CORE.						/EAG:100

/								/EAG:100

/ THIS ROUTINE IS PERFECTLY CAPABLE OF READING AND WRITING	/EAG:100

/ AREAS OF THE DISK OUTSIDE OF THE QAREA, BUT WE NEVER		/EAG:100

/ HAVE A NEED TO DO SO.						/EAG:100

/								/EAG:100

								/EAG:100

TRNBLK	-1			/ STARTING DISK BLOCK NUMBER	/EAG:100

TRNBUF	-2			/ STARTING CORE ADDRESS -1	/EAG:100

TRNLEN	0			/ WORD COUNT (2'S COMPLEMENT)	/EAG:100

TRAN	0			/ ENTRY POINT/RETURN ADDRESS	/EAG:100

	LAC (TRNBLK)		/ POINT AC TO PARAMETER BLOCK	/EAG:100

	.MTRAN			/ AND INVOKE MONITOR TRAN RTN.	/EAG:100

	HLT			/ .MTRAN SHOULD RETURN THROUGH	/EAG:100

				/ TRAN.  THIS HLT IS FOR DEBUG.	/EAG:100

	.TITLE ERROR -- ROUTINE TO ISSUE FATAL ERROR MESSAGE

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE IS CALLED TO TYPE OUT A FATAL ERROR MESSAGE.	/EAG:100

/ FOLLOWING THE MESSAGE IT CHECKS FOR BATCH AND BOSS MODES,	/EAG:100

/ AND EXITS APPROPRIATELY.  IF IN BOSS MODE IT CAUSES THE	/EAG:100

/ CURRENT JOB TO BE ABORTED.  IF IN NON-BOSS BATCH MODE		/EAG:100

/ IT CAUSES XVM/DOS TO LEAVE BATCH MODE (SIMILAR TO IOPS	/EAG:100

/ ERRORS).							/EAG:100

/								/EAG:100

/ CALLING SEQUENCE:						/EAG:100

/								/EAG:100

/	JMS ERROR						/EAG:100

/	  .TEXT <"DESCRIPTION OF ERROR."<015>>			/EAG:101

/								/EAG:100

/ THE ERROR DESCRIPTION SHOULD BE FOLLOWED WITH A PERIOD.	/EAG:101

/ THE ACTUAL ERROR MESSAGE PRINTED IS AS FOLLOWS:		/EAG:100

/								/EAG:100

/	QFILE ERROR -- <DESCRIPTION OF ERROR.><CR>		/EAG:101

/	OPERATION ABORTED.<CR>					/EAG:101

/								/EAG:100

								/EAG:100

ERROR	0							/EAG:100

	.INIT -3,1,0		/ INITIALIZE CONSOLE		/EAG:100

	.WRITE -3,2,ERR.HD,100	/ OUTPUT ERROR MESSAGE HEADER	/EAG:100

	LAC ERROR		/ PUT ADDRESS OF ERROR		/EAG:100

	AND (77777)		/ DESCRIPTION (FROM CALLING	/EAG:100

	DAC ERR.BF		/ SEQUENCE) INTO .WRITE.	/EAG:100

	.WRITE -3,2,XX,100	/ OUTPUT ERROR DESCRIPTION	/EAG:100

ERR.BF=.-2							/EAG:100

	.WRITE -3,2,ERR.TR,100	/ OUTPUT ERROR MESSAGE TRAILER.	/EAG:100

	.WAIT -3						/EAG:100

	LAC* (SC.BOS)		/ CHECK FOR BOSS MODE		/EAG:100

	AND (SC.BMD)						/EAG:100

	SNA			/ SKIP IF WE'RE IN IT		/EAG:100

	JMP ERR.0		/ JMP IF WE'RE NOT		/EAG:100

	LAC* (SC.BOS)		/ SET JOB ABORT BIT (SC.BAB)	/EAG:100

	AND (777777-SC.BAB)					/EAG:100

	XOR (SC.BAB)						/EAG:100

	DAC* (SC.BOS)						/EAG:100

	.EXIT			/ THEN EXIT			/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE IF NOT IN BOSS MODE					/EAG:100

								/EAG:100

ERR.0	LAC* (SC.NMF)		/ CLEAR BATCH MODE ENABLE	/EAG:100

	AND (777777-SC.BCH)	/ FLAG IF IT'S SET		/EAG:100

	DAC* (SC.NMF)						/EAG:100

	.EXIT			/ THEN EXIT			/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

ERR.HD	.TEXT <"QFILE ERROR -- "<175>>				/EAG:100

								/EAG:100

ERR.TR	.TEXT <"OPERATION ABORTED."<015>>			/EAG:100

	.TITLE WARN -- ROUTINE TO ISSUE RECOVERABLE ERROR MESSAGE

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THIS ROUTINE ISSUES A RECOVERABLE ERROR MESSAGE AND THEN	/EAG:100

/ PROMPTS THE USER TO FIND OUT WHETHER TO PROCEED WITH OR	/EAG:100

/ ABORT THE CURRENT OPERATION.  BEFORE DOING THIS WE CHECK	/EAG:100

/ TO SEE IF WE'RE IN EITHER BOSS MODE OR NON-BOSS BATCH		/EAG:100

/ MODE.  IF IN EITHER FORM OF BATCHING MODE ALL ERRORS ARE	/EAG:100

/ FATAL, SO WE CONVERT THE CALL TO US TO A CALL TO ERROR.	/EAG:100

/								/EAG:100

/ CALLING SEQUENCE:						/EAG:100

/								/EAG:100

/	JMS WARN						/EAG:100

/	  .TEXT <"DESCRIPTION OF ERROR."<015>>			/EAG:101

/	  .TEXT <<011>"DESCRIPTION OF RECOVERY PROCEDURE"<175>>	/EAG:101

/	<RETURN HERE TO PROCEED>				/EAG:100

/								/EAG:100

/ THE ERROR DESCRIPTION SHOULD BE TERMINATED WITH A PERIOD.	/EAG:101

/ THE RECOVERY PROCEDURE DESCRIPTION SHOULD BE PRECEEDED	/EAG:101

/ BY A TAB.							/EAG:101

/								/EAG:101

/ IF THE USER OPTS TO ABORT THE OPERATION THIS ROUTINE		/EAG:100

/ DOES NOT RETURN TO ITS CALLER, BUT INSTEAD DOES A .EXIT	/EAG:100

/ BACK TO THE NON-RESIDENT MONITOR.				/EAG:100

/								/EAG:100

/ THE ACTUAL MESSAGE OUTPUT IS AS FOLLOWS:			/EAG:100

/								/EAG:100

/	QFILE WARNING -- <DESCRIPTION OF ERROR.><CR>		/EAG:101

/		<DESC. OF RECOV. PROC.> AND PROCEED? (Y/N)	/EAG:101

/								/EAG:100

/ RESPONSES MAY BE TERMINATED WITH A CARRAIGE RETURN OR		/EAG:100

/ ALT MODE.  THE RESPONSE "Y" CAUSES US TO PROCEED AND		/EAG:100

/ RECOVER FROM THE ERROR.  THE RESPONSE "N" CAUSES US		/EAG:101

/ TO PRINT THE FOLLOWING MESSAGE:				/EAG:101

/								/EAG:101

/	OPERATION ABORTED.					/EAG:101

/								/EAG:101

/ AND ABORT THE CURRENT OPERATION.  ANY OTHER RESPONSE CAUSES	/EAG:101

/ THE MESSAGE TO BE REPEATED.  IF, HOWEVER, AN ERROR OCCURS	/EAG:100

/ WHILE READING THE REPLY, A NEGATIVE RESPONSE IS SIMULATED.	/EAG:100

/								/EAG:100

								/EAG:100

WARN	0							/EAG:100

	LAC WARN		/ GIVE RETURN ADDRESS TO ERROR,	/EAG:100

	DAC ERROR		/ IN CASE WE'RE IN ONE OF THE	/EAG:100

	LAC* (SC.NMF)		/ BATCHING MODES.  CHECK FOR	/EAG:100

	AND (SC.BCH)		/ THESE MODES, AND GO TO ERROR	/EAG:100

	SZA			/ IF WE'RE IN ONE OF THEM.	/EAG:100

	JMP ERROR+1						/EAG:100

	.INIT -3,1,0		/ INITIALIZE CONSOLE OUTPUT	/EAG:100

	.INIT -2,0,0		/ AND CONSOLE INPUT		/EAG:100

	.WRITE -3,2,WRN.HD,100	/ OUTPUT MESSAGE HEADER		/EAG:100

	LAC WARN		/ PUT ADDRESS OF MESSAGE	/EAG:100

	AND (77777)		/ DESCRIPTION INTO .WRITE.	/EAG:100

	DAC WRN.B1						/EAG:100

	.WRITE -3,2,XX,100	/ OUTPUT ERROR DESCRIPTION	/EAG:100

								/EAG:100

WRN.B1=.-2							/EAG:100

	LAW 777000		/ CALCULATE ADDRESS OF		/EAG:100

	AND* WRN.B1		/ RECOVERY PROCEDURE		/EAG:100

	SWHA			/ DESCRIPTION, AND		/EAG:100

	CLL!RAL			/ PUT INTO .WRITE.		/EAG:100

	TAD WRN.B1						/EAG:100

	AND (77777)						/EAG:100

	DAC WRN.B2						/EAG:100

	.WRITE -3,2,XX,100	/ OUTPUT RECOV. PROC. DESC.	/EAG:100

WRN.B2=.-2							/EAG:100

	.WRITE -3,2,WRN.TR,100	/ OUTPUT MESSAGE TRAILER	/EAG:100

	.WAIT -3						/EAG:100

	.READ -2,2,WRN.IB,6	/ INPUT USER RESPONSE		/EAG:101

	.WAIT -2						/EAG:100

	LAC WRN.IB		/ CHECK FOR ERROR		/EAG:100

	SAD (2002)						/EAG:100

	SKP							/EAG:100

	JMP WRN.2		/ ERROR -- GO DO .EXIT		/EAG:100

	LAW 777760		/ MASK OUT TWO CHARACTERS	/EAG:100

	AND WRN.IB+2						/EAG:100

	SAD (544320)		/ ARE THEY "Y"<CR> ?		/EAG:100

	JMP WRN.1						/EAG:100

	SAD (547720)		/ "Y"<ALT MODE> ?		/EAG:100

	JMP WRN.0						/EAG:100

	SAD (470320)		/ "N"<CR> ?			/EAG:100

	JMP WRN.3						/EAG:100

	SAD (473720)		/ "N"<ALT MODE> ?		/EAG:100

	JMP WRN.2						/EAG:100

	JMP WARN+1		/ ILLEGAL RESPONSE -- REPEAT	/EAG:100

				/ MESSAGE.			/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE ON POSITIVE RESPONSES				/EAG:100

								/EAG:100

WRN.0	.WRITE -3,2,WRN.CR,100	/ OUTPUT CARRAIGE RETURN	/EAG:101

WRN.1	LAW 777000		/ CALCULATE ADDRESS OF RETURN	/EAG:100

	AND* WRN.B2						/EAG:100

	SWHA							/EAG:100

	CLL!RAL							/EAG:100

	TAD WRN.B2						/EAG:100

	DAC WARN						/EAG:100

	JMP* WARN		/ AND RETURN			/EAG:100

								/EAG:100

								/EAG:100

/ COME HERE ON NEGATIVE RESPONSES				/EAG:100

								/EAG:100

WRN.2	.WRITE -3,2,WRN.CR,100	/ OUTPUT CARRAIGE RETURN	/EAG:101

WRN.3	.WRITE -3,2,WRN.AB,100	/ OUTPUT ABORT MESSAGE		/EAG:100

	.WAIT -3						/EAG:100

	.EXIT							/EAG:100

								/EAG:100

								/EAG:100

WRN.HD	.TEXT <"QFILE WARNING -- "<175>>			/EAG:101

								/EAG:100

WRN.TR	.TEXT <" AND PROCEED?  (Y/N) "<175>>			/EAG:101

								/EAG:100

WRN.IB	3000			/ RESPONSE INPUT BUFFER		/EAG:101

	0							/EAG:100

	0							/EAG:100

	0							/EAG:100

								/EAG:100

WRN.CR	.TEXT <<015>>						/EAG:101

								/EAG:101

WRN.AB	.TEXT <"OPERATION ABORTED."<015>>			/EAG:101

	.TITLE DEFINE TRANSFER BUFFER

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE FOLLOWING LOCATIONS DEFINE THE TRANSFER BUFFER		/EAG:100

/ AND/OR REFER TO ITS CONTENTS.  THE TRANSFER BUFFER		/EAG:100

/ IS INITIALLY SET UP TO BE AS LARGE AS POSSIBLE, AND		/EAG:100

/ IS SUBSEQUENTLY SHORTENED TO PROVIDE ROOM FOR THE		/EAG:100

/ .SCOM, MSBT, AND BUFFER TABLE BUFFERS.			/EAG:100

/								/EAG:100

								/EAG:100

BUFBAS	-1			/ CONTAINS THE BASE ADDRESS	/EAG:100

				/ OF THE TRANSFER BUFFER	/EAG:100

								/EAG:100

BUFLEN	0			/ CONTAINS THE TWO'S COMPLEMENT	/EAG:100

				/ OF THE LENGTH OF THE TRANSFER	/EAG:100

				/ BUFFER.  THE LENGTH IS ALWAYS	/EAG:100

				/ A MULTIPLE OF 400 -- I.E. AN	/EAG:100

				/ INTEGRAL NUMBER OF BLOCKS.	/EAG:100

								/EAG:100

LENLFT	0			/ CONTAINS THE TWO'S COMPLEMENT	/EAG:100

				/ OF THE LENGTH (WORDS) LEFT TO	/EAG:100

				/ TO BE TRANSFERRED BEFORE THE	/EAG:100

				/ END OF THE IMAGE IS REACHED.	/EAG:100

								/EAG:100

CORADR	-1			/ CONTAINS THE BASE ADDRESS	/EAG:100

				/ OF THE CHUNK OF THE IMAGE	/EAG:100

				/ CURRENTLY IN MEMORY (AN	/EAG:100

				/ ADDRESS WITHIN THE CORE	/EAG:100

				/ IMAGE).  NOTE THAT SINCE	/EAG:100

				/ THIS ADDRESS IS FOR THE	/EAG:100

				/ CHUNK LAST BROUGHT INTO	/EAG:100

				/ CORE, IT CORRESPONDS TO	/EAG:100

				/ THE ADDRESS OF THE WORD	/EAG:100

				/ STORED AT (TRNBUF)+1,		/EAG:100

				/ RATHER THAN THE WORD		/EAG:100

				/ POINTED TO BY BUFBAS.		/EAG:100

	.TITLE DEFINE .SCOM BUFFER

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE FOLLOWING LOCATIONS ARE SET UP BY SCMSAV TO DEFINE	/EAG:100

/ THE BUFFER CONTAINING THE PRESERVED (IN CORE) COPY OF		/EAG:100

/ THE IMAGE'S .SCOM.  THE BUFFER CONTENTS BEGIN AND END		/EAG:100

/ ON A BLOCK BOUNDARY (WITHIN THE QAREA) AND MAY OVERLAP	/EAG:100

/ WITH THE MSBT AND/OR BUFFER TABLE BUFFERS.			/EAG:100

/								/EAG:100

/ SCMBUF, SCMBLK, AND SCMLEN ARE USED TO TRAN THE .SCOM		/EAG:100

/ BUFFER INTO THE QAREA.  SCMSW IS A FLAG INDICATING		/EAG:100

/ WHETHER THIS TRANSFER IS NECESSARY.  SCMADR IS USED TO	/EAG:100

/ ADDRESS .SCOM LOCATIONS PRESERVED WITHIN THE BUFFER.		/EAG:100

/								/EAG:100

								/EAG:100

SCMADR	0			/ CONTAINS ZERO IF .SCOM	/EAG:100

				/ BUFFER NOT SET UP YET.	/EAG:100

				/ IF NON-ZERO IT CONTAINS	/EAG:100

				/ THE ADDRESS (IN CORE) OF	/EAG:100

				/ LOCATION ZERO RELATIVE TO	/EAG:100

				/ THE CONTENTS OF THE .SCOM	/EAG:100

				/ BUFFER.  THUS THE IMAGE'S	/EAG:100

				/ SC.MOD WILL BE IN LOCATION	/EAG:100

				/ (SCMADR)+SC.MOD.		/EAG:100

								/EAG:100

SCMBUF	-1			/ BASE ADDRESS OF .SCOM BUFFER	/EAG:100

								/EAG:100

SCMLEN	0			/ TWO'S COMPLEMENT OF .SCOM	/EAG:100

				/ BUFFER LENGTH			/EAG:100

								/EAG:100

SCMBLK	-1			/ DISK BLOCK NUMBER		/EAG:100

				/ CORRESPONDING TO BASE OF	/EAG:100

				/ .SCOM BUFFER			/EAG:100

								/EAG:100

SCMSW	-1			/ .SCOM BUFFER MODIFIED SWITCH.	/EAG:100

				/ STAYS -1 UNTIL .SCOM IS	/EAG:100

				/ MODIFIED, THEN CLEARED.  USED	/EAG:100

				/ TO ELIMINATE NUGATORY WRITES.	/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE FOLLOWING LOCATIONS ARE SET UP BY CHKIMG.  THEY ARE	/EAG:100

/ POINTERS TO SPECIFIC .SCOM LOCATIONS WITHIN THE .SCOM		/EAG:100

/ BUFFER.  NAMING CONVENTION -- LOCATION ISCXXX IS A		/EAG:100

/ POINTER TO THE IMAGE'S SC.XXX.  NOTE THAT SC.CQB IS		/EAG:100

/ THREE WORDS LONG, AND ISCCQB DEFINES A THREE WORD BLOCK	/EAG:100

/ OF POINTERS.							/EAG:100

/								/EAG:100

								/EAG:100

ISCCOD	-1							/EAG:100

ISCMOD	-1							/EAG:100

ISCMSZ	-1							/EAG:100

ISCAMS	-1							/EAG:100

ISCSLT	-1							/EAG:100

ISCVTF	-1							/EAG:100

ISCNMF	-1							/EAG:100

ISCSDV	-1							/EAG:100

ISCCQF	-1							/EAG:100

ISCCQB	-1							/EAG:100

	-1							/EAG:100

	-1							/EAG:100

	.TITLE DEFINE MSBT BUFFER

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE FOLLOWING LOCATIONS ARE SET UP BY THE ROUTINE MSBTSV	/EAG:100

/ TO DEFINE THE MSBT (MASS STORAGE BUSY TABLE) BUFFER.		/EAG:100

/ THE MSBT BUFFER CONTAINS A COPY OF SOME INTEGRAL NUMBER	/EAG:100

/ OF DISK BLOCKS, EACH OF WHICH CONTAINS A PORTION OF THE	/EAG:100

/ MSBT.  MSBTSV PRESERVES THE MSBT IN THIS MANNER SO THAT	/EAG:100

/ IT CAN BE EXAMINED AND, IF DESIRED, MODIFIED AND WRITTEN	/EAG:100

/ OUT ONTO THE QAREA.  THE MSBT BUFFER MAY OVERLAP THE		/EAG:100

/ .SCOM BUFFER AND/OR THE BUFFER TABLE BUFFER.			/EAG:100

/								/EAG:100

/ MSBTBF, MSBTBK, AND MSBTLN ARE USED TO TRAN THE MSBT		/EAG:100

/ BUFFER OUT TO THE QAREA.  MSBTAD, MSBTNM, MSBTEN, AND		/EAG:100

/ MSBTSZ ARE USED TO ACCESS THE PRESERVED COPY OF THE		/EAG:100

/ IMAGE'S MSBT.  MSBTSW IS A SWITCH WHICH INDICATES WHEN	/EAG:100

/ THE MSBT HAS BEEN MODIFIED, AND THUS NEED TO BE WRITTEN	/EAG:100

/ OUT TO THE QAREA.						/EAG:100

/								/EAG:100

/ NOTE THAT THE ROUTINE MSSV.A IS PARTICULARLY SENSITIVE	/EAG:100

/ TO THE INITIAL VALUES OF MANY OF THESE LOCATIONS (I.E.	/EAG:100

/ THE VALUES ASSEMBLED IN BELOW).				/EAG:100

/								/EAG:100

								/EAG:100

MSBTAD	0			/ ZERO WHEN THE MSBT BUFFER	/EAG:100

				/ HASN'T BEEN SET UP YET.	/EAG:100

				/ MINUS ONE INDICATES THAT THE	/EAG:100

				/ MSBT IS NONEXISTENT -- I.E.	/EAG:100

				/ THE NUMBER OF ENTRIES IS	/EAG:100

				/ ZERO.  ANY OTHER NON-ZERO	/EAG:100

				/ VALUE IS THE BASE ADDRESS	/EAG:100

				/ WITHIN THE MSBT BUFFER OF	/EAG:100

				/ THE PRESERVED COPY OF THE	/EAG:100

				/ IMAGE'S MSBT.			/EAG:100

								/EAG:100

MSBTNM	-1			/ NUMBER OF ENTRIES IN MSBT.	/EAG:100

				/ I.E., A COPY OF SC.ACT	/EAG:100

								/EAG:100

MSBTEN	-1			/ LENGTH OF A MSBT ENTRY.	/EAG:100

				/ I.E., A COPY OF SC.BTL	/EAG:100

								/EAG:100

MSBTSZ	-1			/ TOTAL SIZE OF MSBT.		/EAG:100

				/ I.E., (MSBTNM)*(MSBTEN)	/EAG:100

								/EAG:100

MSBTBF	0			/ BASE ADDRESS OF MSBT BUFFER	/EAG:100

								/EAG:100

MSBTBK	0			/ DISK BLOCK NUMBER		/EAG:100

				/ CORRESPONDING TO BASE OF	/EAG:100

				/ MSBT BUFFER.			/EAG:100

								/EAG:100

MSBTLN	0			/ TWO'S COMPLEMENT OF MSBT	/EAG:100

				/ BUFFER LENGTH			/EAG:100

								/EAG:100

MSBTSW	-1			/ SWITCH TO INDICATE THAT MSBT	/EAG:100

				/ HAS BEEN MODIFIED AND THUS	/EAG:100

				/ MUST BE WRITTEN OUT.  -1	/EAG:100

				/ UNTIL MSBT MODIFIED, THEN 0.	/EAG:100

	.TITLE DEFINE BUFFER TABLE BUFFER

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

/								/EAG:100

/ THE FOLLOWING LOCATIONS ARE SET UP BY MSBTSV TO DEFINE THE	/EAG:100

/ BUFFER TABLE BUFFER.  THE BUFFER TABLE BUFFER CONTAINS A	/EAG:100

/ COPY OF SOME INTEGRAL NUMBER OF DISK BLOCKS (WITHIN THE	/EAG:100

/ QAREA) WHICH CONTAIN THE BUFFER TABLE.  THE BUFFER TABLE	/EAG:100

/ BUFFER MAY OVERLAP THE .SCOM BUFFER AND/OR THE MSBT BUFFER.	/EAG:100

/								/EAG:100

/ LOCATION BFTB?? BELOW CORRESPONDS ALMOST EXACTLY WITH		/EAG:100

/ LOCATION MSBT?? ABOVE (IN THE MSBT BUFFER).  THEREFORE	/EAG:100

/ THE DESCRIPTIONS GIVEN BELOW WILL BE QUITE BRIEF.		/EAG:100

/								/EAG:100

/ NOTE THAT THE ROUTINE MSSV.A IS PARTICULARLY SENSITIVE	/EAG:100

/ TO THE INITIAL VALUES OF SEVERAL OF THESE LOCATIONS --	/EAG:100

/ I.E. THE VALUES ASSEMBLED IN BELOW.				/EAG:100

/								/EAG:100

								/EAG:100

BFTBAD	0			/ ZERO IF BUFFER NOT SET UP	/EAG:100

				/ YET.  -1 IF BUFFER TABLE	/EAG:100

				/ DOESN'T EXIST.  OTHERWISE	/EAG:100

				/ CONTAINS ADDRESS OF BUFFER	/EAG:100

				/ TABLE.			/EAG:100

								/EAG:100

BFTBNM	-1			/ NUMBER OF ENTRIES		/EAG:100

				/ (I.E. LENGTH) OF		/EAG:100

				/ BUFFER TABLE.			/EAG:100

				/ COPY OF SC.BNM		/EAG:100

								/EAG:100

BFTBBF	0			/ BASE ADDRESS OF BUFFER	/EAG:100

				/ TABLE BUFFER			/EAG:100

								/EAG:100

BFTBBK	0			/ BASE DISK BLOCK OF BUFFER	/EAG:100

				/ TABLE BUFFER			/EAG:100

								/EAG:100

BFTBLN	0			/ TWO'S COMPLEMENT OF LENGTH	/EAG:100

				/ OF BUFFER TABLE BUFFER	/EAG:100

								/EAG:100

BFTBSW	-1			/ SWITCH TO INDICATE IF BUFFER	/EAG:100

				/ TABLE BUFFER HAS BEEN		/EAG:100

				/ MODIFIED AND THUS NEEDS TO	/EAG:100

				/ BE WRITTEN OUT		/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

								/EAG:100

	.END IN							/EAG:100
