	.TITLE *** SAVE MCR FUNCTION ***

/

/ COPYRIGHT (C) 1976

/ 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 #32

/ EDIT #42	MAY-14-76 (SCR) MODIFY SAVE-REMOVE-INSTALL FIX

/ EDIT #43	MAY-18-76 (SCR) FIX TYPO IN CAL REFERENCE

/ EDIT #44	MAY-18-76 (SCR) OFF BY ONE FOR SNAM ON ATL

/ EDIT #45	MAY-18-76 (SCR) WAIT FOR DEALLOCATE ON REMBLKS
/ EDIT #46	MAY-19-76 (SCR) MESSAGE FOR SPURIOUS USR.XX TASK
/ EDIT #47	MAY-19-76 (SCR) #46 LOST AN INSTRUCTION
/ EDIT #48	 1 MAR 78 (PDH)	MAKE ADDITIONS FOR TASK TIMING;
/				SHORTEN SOME MESSAGES TO KEEP TASK
/				SMALL ENOUGH FOR MCR PARTITION.
/ EDIT #49	 4 MAR 78 (PDH)	BECAUSE OF SMALL NODE DEGRADATION, IT IS
/				NECESSARY TO REMOVE THAT PART OF EDIT #48
/				WHICH STOPS TASK TIMING WHEN DOING A
/				'SAVE'.  IT WILL NOW BE NECESSARY TO
/				MANUALLY STOP TASK TIMING BY SETTING
/				'TIMFLG' (LOCATION 312) TO ZERO AND
/				ABORTING 'TSKTM2'.
/ EDIT #50	 4 MAR 78 (PDH)	DO NOT ATTEMPT TO START TASK TIMING
/				IF IT IS ALREADY ON (DUE TO ATTEMPT TO
/				'SAVE' WHILE ON).
/
/
/ MCR FUNCTION -- SAVE        4 APR 72        H .KREJCI, R. MCLEAN,C. PROTEAU

/						D. MCMILLEN

/				30 JAN 73	D. VELTEN

/				25 JAN 74	M. HEBENSTREIT

/				27 JAN 75	M. HEBENSTREIT

/				3 JUNE 75	M. HEBENSTREIT

/ EDIT #32	SAV-REM-INS	7 APR 76	M. HEBENSTREIT

/

/ TASK NAME: "...SAV" TO SAVE THE IMAGE OF CORE IN THE 

/ SAVE AREA ON DISK UNIT ZERO.

/

/ THE FIRST LINE OF COMMAND INPUT FOR ANY MCR FUNCTION IS 

/ READ BY THE RESIDENT MCR TASK ("...MCR").  FOR THE "SAVE"

/ FUNCTION, THERE IS ONLY ONE LINE OF COMMAND INPUT, AND ITS

/ SYNTAX IS AS FOLLOWS:

/

/	SYNTAX = "SAV"$<NTC> <CR>/<AM>

/	    <NTC> = NON TERMINAL CHARACTERS

/	    <CR> = CAR RTN

/	    <AM> = ALTMODE
/	    $ -- "ANY NUMBER OF, INCLUDING ZERO"

/

/ THE RESIDENT MCR READS A LINE, FETCHES THE FIRST THREE CHARACTERS

/ TO FORM THE MCR FUNCTION TASK NAME ("...SAV"), FLUSHES CHARACTERS

/ THRU THE FIRST BREAK OR TERMINAL CHARACTER, REQUESTS "...SAV"

/ AND EXITS.

/

/ THE TASK "...SAV" SETS A RESTORE ENTRY POINT ADDRESS IN 'R1', TURNS

/ THE CLOCK & INTERRUPT SYSTEM OFF, RECORDS THE IMAGE OF CORE ON DISK

/ ZERO.

/

/ THE SYSTEM MAY BE RESTARTED BY USING A "WARM START BOOTSTRAP" WHICH

/ LOADS CORE FROM THE DISK, AND TRANSFERS CONTROL BACK TO THIS

/ TASK, WHICH TURNS THE CLOCK & INTERRUPT SYSTEM BACK ON, THUS RESTORING

/ THE SAVED ENVIRONMENT, AND EXITS.

/

/ A QUIESCENT SYSTEM IS ASSUMED WHENEVER THE "SAVE" MCR FUNCTION

/ IS USED.

/

/ THIS VERSION IS ADAPTED FOR USE WITH THE RP02, RK05, OR RF15.

/

////////////////////////////////////////////////////////////////////////

/

/CONDITIONAL ASSEMBLY:

/

/

/ DEFINING %RF15 PRODUCES A VERSION FOR THE RF15 SYSTEM

/ DEFINING %RK05 PRODUCES A VERSION FOR THE RK05 SYSTEM

/ DEFINING %RP02 PRODUCES A VERSION FOR THE RP02 SYSTEM

	.IFUND %RF15

	.IFUND %RK05

	.IFUND %RP02

	.END -- NO ASSEMBLY PARAMETERS SPECIFIED

	.ENDC

	.ENDC

	.ENDC

/ 

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/

 .TITLE *** MCR FUNCTION 'SAVE'

/

WC=36

CA=37

CLKQ1=246

CLKQ2=247

PDVL=252

ATL=244

R3=103

SIOA=706001

LIOR=706006

DLAL=707024

DLAH=707064

DSCF=707041

DSFX=707042

DSCN=707044

DSCD=707242

DSRS=707262

DSSF=707001

DPCA=706344

DPCS=706324	/CLEAR STATUS

DPLA=706304	/LOAD CYLINDER,HEAD,SECTOR ADDRESS

DPLF=706464	/EXECUTE

DPRSB=706332	/READ STATUS REG B

DPSE=706361	/SKIP ON ERROR

DPSJ=706341	/SKIP ON DONE

DPWC=706364	/LOAD WORD COUNT

DSCC=707021

CLON=700044

CLOF=700004

.ENB=705521

.INH=705522

WARMFL=207

ITVTB=256

FPHDWE=236

PRHDWE=235

MPEU=701742

X10=10

LVL5=41

KRS=700332

FPT=710314	/SKIP IF FLOATING POINT HARDWARE

MCRRI=171

CSIZE=136

RFACTB=210

RKACT0=414

RPACT0=364

DSAFLG=310
REMBLK=311
TIMFLG=312		/ TASK TIMING FLAG IN EXECUTIVE		/(048)
IDX=ISZ

ECLA=641000

SNAM=123

NDEL=112

NADD=107

PICK=120

PENP=115

POOL=240

PDVL=252

STL=242

S.N1=2

S.N2=3

S.DP=4

S.PB=5

S.DA=6

S.DB=7

S.TS=10

S.EP=11

PBDL=250

P.BA=4

P.SZ=5

R1=101

R2=102

/

SINOD=1	/SYNC INTERVAL FOR NODCNT

SUNOD=3	/SYNC UNIT FOR NODCNT

RINOD=2	/RE-SYNC INTERVAL FOR NODCNT

RUNOD=3	/RE-SYNC UNIT FOR NODCNT

SIPOL=113

SUPOL=2

RIPOL=1

RUPOL=3

SIAUT=132

SUAUT=2

RIAUT=5

RUAUT=3

/

	.EJECT

/

/ INITIALIZE THIS TASK

/
SAVE	LAC	(SAVE	/GET XR ADJUSTMENT		(MJH-32)

	AND	(70000

	TCA

	DAC	XADJ
	DAC	BOOTFL	/SET NON-ZERO THE FLAG THAT	(MJH-32)
			/SAYS WE MAY BE BOOTSTAPPING	(MJH-32)

			/IF ZERO FLAG SAYS SAVING	(MJH-32)

			/IF NOT FLAG SAYS BOOTING	(MJH-32)
	DZM	MTFLAG	/CLEAR COUNT OF INSTALL		(MJH-32)
			/SAV-REM-INS ENTRIES NOT	(MJH-32)
			/PUT IN STL DUE TO MT POOL	(MJH-32)
/

/ CANCEL THE SYSTEM TRANSIENT TASKS

/

	CAL	QCAN3	/CANCEL THE TASK 'AUTORM'

	CAL	QCAN2	/CANCEL THE TASK 'POLLER'

	CAL	QCAN	/CANCEL THE TASK 'NODCNT'

	CAL	QWAIT

/

	LAC	(400020	/RAISE TO API LEVEL 3 TO	(MJH-32)

	ISA		/PREVENT CHANGES TO ATL		(MJH-32)

			/WHILE CHECKING FOR A

			/QUIESCENT SYSTEM		(MJH-32)

/

/ SCAN THE ATL FOR ACTIVE TASKS

/

QLOC2	LAC	(ATL	/CHECK THE ATL FOR ACTIVE TASKS

	JMS	SETXR

QLOC3	LAC	0,X

	SAD	(ATL	/END OF ATL?

	JMP	QLOC4	/YES

	JMS	SETXR	/SET XR TO ACCESS NEXT NODE IN ATL

	LAC	2,X	/CHECK 1ST HALF OF NAME

	SAD	(042301	/DSA?

	JMP	IO1

	SAD	(042313	/DSK?

	JMP	IO1

	SAD	(565656	/MCR FUNCTION?

	JMP	MCR

	SAD	(242431	/TTY?

	JMP	IO1

	SAD	(111722	/IORD?

	JMP	IORD

	AND	(77

	SAD	(56	/IO HANDLER?

	SKP

	JMP	QERR	/NO -- ERROR

	LAC	3,X	/CHECK 2ND HALF OF IO HANDLER NAME

	SAD	(565656

	JMP	IO2

	JMP	QERR	/ERROR -- NOT AN IO HANDLER

IO1	LAC	3,X	/2ND HALF OF DSA OR DSK?

	SZA

	JMP	QERR	/NO -- ERROR

IO2	LAC	7,X	/STATUS OF IO HANDLERS MUST BE 3

	AND	(7

	SAD	(3

	JMP	QLOC3	/OK -- PROCESS NEXT NODE IN ATL

	JMP	QERR	/NO GOOD -- HANDLER ACTIVE

MCR	LAC	3,X	/PROCESS 2ND HALF OF NAME OF MCR FUNCT.

	SAD	(150322	/...MCR?

	JMP	QLOC3	/YES -- OK

	SAD	(230126	/...SAV?

	JMP	QLOC3	/YES -- OK

	JMP	QERR	/NO -- ERROR

IORD	LAC	3,X	/2ND HALF OF NAME D@@?

	SAD	(040000

	JMP	IO2

	JMP	QERR

/

/ SCAN THE PDVL FOR ANY I/O WHICH MAY BE QUEUED

/

QLOC4	LAC	(PDVL	/PREPARE TO SCAN PDVL FOR I/O REQUESTS

	JMS	SETXR

QLOC5	LAC	0,X

	SAD	(PDVL	/IS THIS THE END OF THE PDVL?

	JMP	QLOC1	/YES -- PURGE CLOCK QUEUE	(MJH-32)

	LMQ		/NO -- GET ADDRESS OF WD. 6 BUT SAVE WD. 0 IN MQ

	AAC	6

	DAC	QTEMP	/SAVE ADDR. OF WD. 6

	LACQ		/RESTORE AC WITH ADDR. OF WD. 0

	JMS	SETXR

	LAC	6,X	/EXAMINE WD. 6

	SAD	QTEMP	/WD. 6 SHOULD BE EQUAL TO ADDR. OF WD. 6!

	JMP	QLOC5	/CONTENTS=ADDRESS SO NO NODES IN QUEUE

	LAC	(QMES2	/THERE IS A NODE QUEUED -- ERROR

	DAC	QPRINT+4

	JMP	QERR

/

/ IF THERE'S ANYTHING IN THE CLOCK QUEUE PUT IT INTO POOL

/

QLOC1	LAC	(CLKQ1	/(042) PULL A QLOQUE QUEUE NODE

	DAC*	(R1	/(042)

	JMS*	(PICK	/(042)

	JMP	QLOC15	/(042) EMPTY, BACK TO LEVEL 7

	DAC*	(R2	/(042) AND GIVE NODE TO POOL

	LAC	(POOL	/(042)

	DAC*	(R1	/(042)

	JMS*	(NADD	/(042)

	JMP	QLOC1	/(042) AND DO THE NEXT ONE

QLOC15	DBK		/DROP BACK TO API LEVEL 7	(MJH-32)

	JMP	QLOC6	/EXIT THIS ROUTINE		(MJH-32)

/

/ SUBROUTINES, CPBS, AND MESSAGES FOR QUIESCENCE CHECK

/

SETXR	0	/SUBROUTINE TO ADJUST THE XR

	TAD	XADJ

	PAX

	JMP*	SETXR

QERR	DBK		/DROP TO API LEVEL 7		(MJH-32)

	CAL	QPRINT

	CAL	QWAIT

	JMP	ENDIT

QCAN	4	/CANCEL CPB FOR 'NODCNT'

	QEV

	.SIXBT "NOD"

	.SIXBT "CNT"

QCAN2	4

	0

	.SIXBT "POL"

	.SIXBT "LER"

QCAN3	4

	0

	.SIXBT "AUT"

	.SIXBT "ORM"

QPRINT	2700

	QEV

	3

	2

	QMES

QWAIT	20

	QEV
QMES	QMES2-QMES/2*1000
	0
	.ASCII "TASK ACTIVE - SAVE ERROR"<15>			/(048)
QMES2	QEV-QMES2/2*1000
	0
	.ASCII "I/O REQUESTS PENDING - SAVE ERROR"<15>		/(048)

QEV	0
QTEMP	0
/
	.EJECT

/

/ GET THE SYSTEM DISK'S MFD

/

QLOC6	DBK	/EXIT FROM QUIESENCE CHECK		(MJH-32)

	LAC	(3		/SET UP TO READ FIRST

	DAC	NUMWDS		/3 WORDS OF MFD

	LAC	(BUFF

	DAC	BUFADR

	.IFDEF %RP02

	LAC	(47040		/MFD FIXED BLOCK #

	.ENDC

	.IFUND %RP02

	LAC	(1777

	.ENDC

	DAC	BLOCK

	JMS	GETIN		/READ MFD

	LAC	BUFF+2		/POINTS TO SYSBLK

	DAC	BLOCK

	IAC

	SNA			/-1 INDICATES NO SYSBLK

	JMP	NOSAV

	LAC	(1000

	DAC	NUMWDS

	JMS	GETIN		/READ SYSBLK

	LAC	(SAVE

	AND	(70000

	TCA

	TAD	(BUFF

	PAX			/SET UP XR FOR SEARCH OF SYSBLK

				/FOR SAVE AREA

	TAD	BUFF		/FIRST WORD OF SYBLK CONTAINS ITS LENGTH+1

	AAC	-1

	PAL

NEXTIN	LAC	1,X		/GET FIRST HALF OF NAME

	SAD	RSXSAV

	SKP

	JMP	NOMTCH		/NO MATCH

	LAC	2,X		/TEST 2ND HALF

	SAD	RSXSAV+1

	JMP	GOTBLK

NOMTCH	AXS	7		/TEST WHETHER END OF SYSBLK REACHED

	JMP	NEXTIN		/NO,GET NEXT ENTRY

	JMP	NOSAV		/SAVE AREA NOT FOUND

GOTBLK	LAC	3,X		/BLOCK OF SAVE AREA IN THIRD WORD OF ENTRY

	DAC	BLOCK		/SAVE IT

	LAC*	(RFACTB)	/DOES RF HANDLER HAVE ALLOCATED

	SNA			/BLOCKS?

	JMP	RK		/NO.

	CAL	RFDEAL		/YES.  DEALLOCATE THEM.

	CAL	WFEV		/WAITFOR COMPLETION.

	DZM*	(RFACTB)	/ZERO OUT NUMBER OF WORDS ALLOCATED.

RK	LAC	(24		/DEAL ALL BLKS FOR RK AND RP HANDLERS

	LMQ

	LAC	(RKACT0

	JMS	DEAL

	LAC	(3

	LMQ

	LAC	(RPACT0

	JMS	DEAL

/

/ PURGE THE SAVE-REMOVE-INSTALL CHAIN OF BLOCKS

/

	LAC*	(REMBLK	/GET THE 1ST BLOCK IN CHAIN	(MJH-32)

ALLDON	JMS	GETBLK	/GET THE BLOCK			(MJH-32)

	LAC	(BUFF-1	/NO -- ZERO ALL BUT THE LAST WORD OF THE BLOCK

	DAC*	(X10

	LAW	-377	/SET UP A COUNTER OF WORDS TO ZERO(MJH-32)

	DAC	TEMP1	/				(MJH-32)

	DZM*	X10

	ISZ	TEMP1	/ARE WE DONE ZEROING?		(MJH-32)

	JMP	.-2	/NO -- CONTINUE			(MJH-32)

			/YES --

	LAC	BUFF+377	/SAVE PTR TO NEXT BLK	(MJH-32)

	DAC	TEMP		/			(MJH-32)

	LAW	-1	/SET PTR OF THIS BLK TO -1	(MJH-32)

	DAC	BUFF+377	/THIS SAYS ITS LAST BLK	(MJH-32)

	DAC	BUFF+376	/(042)LOGICAL EOF!

	CAL	PUT	/YES -- WRITE OUT THE ZEROD BLOCK

	CAL	WFEV

	LAC	EV	/WERE THERE ANY ERRORS?

	SPA

	JMP	PERR	/YES

	CLA		/SET DEVICE TO SHOW SYSDSK	(MJH-32)

	DAC	DEVICE	/				(MJH-32)

	LAC	(DEALRM	/SET DEAL CPB TO DEAL REMBLKS	(MJH-32)

	DAC	DEVICE-1				/(MJH-32)

DRM1	LAC	TEMP	/GET PTR TO NEXT BLK		(MJH-32)

	SAD	(-1	/IS THERE ANOTHER BLK?		(MJH-32)

	JMP	PUTDON	/NO -- QUIT			(MJH-32)

	JMS	GETBLK	/YES -- READ IT IN		(MJH-32)

	LAC	BUFF+377	/GET LINK TO NEXT BLK	(MJH-32)

	DAC	TEMP	/SAVE THE LINK			(MJH-32)

	LAC	REMCTA	/PREPARE TO DEAL BLK BY ENTERING(MJH-32)

	DAC	DEALRM+1	/DISK PLAT IN DEAL CTA	(MJH-32)

	LAC	REMCTA+1	/AND DISK ADDR ALSO	(MJH-32)

	DAC	DEALRM+2	/			(MJH-32)

	CAL	RFDEAL	/(043)

	CAL	WFEV	/(045)

	JMP	DRM1	/GO CHECK IF MORE TO DEAL	(MJH-32)

/

/ MESSAGES, CPBS AND MISC CODE FOR SAVE-REM-INS

/

GERR	LAC	(GMES

	SKP

PERR	LAC	(PMES

	DAC	QPRINT+4

	JMP	QERR

PMES	GMES-PMES/2*1000

	0
	.ASCII	'SAVE DISK PUT ERROR'<15>
GMES	PUT-GMES/2*1000
	0
	.ASCII	'SAVE DISK GET ERROR'<15>

PUT	3100

	EV

	1

	REMCTA

GET	3000

	EV

	1

	REMCTA

REMCTA	0

	0

	BUFF

	400

DEALRM	400		/				(MJH-32)

	XX		/				(MJH-32)

	XX		/				(MJH-32)

/

/ SUBROUTINE GETBLK -- READ INTO BUFFER THE DISK BLOCK IN AC

/

GETBLK	0					/	(MJH-32)

	LMQ		/CHANGE DISK BLOCK NUMBER	(MJH-32)

	LLSS!ECLA 10	/INTO PLATTER AND ADDR		(MJH-32)

	DAC	REMCTA	/AND STORE RESULTS IN THE	(MJH-32)

	LACQ		/GET/PUT CONTROL TABLE		(MJH-32)

	DAC	REMCTA+1 /				(MJH-32)

	CAL	GET	/READIN THE BLOCK		(MJH-32)

	CAL	WFEV	/WAIT TIL DONE			(MJH-32)

	LAC	EV	/ANY ERRORS?			(MJH-32)

	SPA		/				(MJH-32)

	JMP	GERR	/YES -- ERROR			(MJH-32)

	JMP*	GETBLK	/NO -- RETURN			(MJH-32)

	.EJECT

/

/ SAVE AN IMAGE OF THE SYSTEM

/

PUTDON	LAC*	(DSAFLG		/SET FLAG IN DSA TO -1 INDICATING THAT

	DAC	TEMP		/NO BIT MAPS ARE IN CORE.

	LAW	-1

	DAC*	TEMP

SAVE1	.INH			/INHIBIT INTERRUPTS

	DZM*	(MCRRI)		/CLEAR ^C MCR REQUEST INHIBIT FLAG

	LAC	(WSEP)		/SET RESTORE ENTRY IN R1 (FOR BOOTSTRAP)

	DAC*	(R1)

/

	LAC*	(001)		/SAVE LOC 001 IN R2

	DAC*	(R2)

	LAC*	(21)		/SAVE LOC 21 IN R3

	DAC*	(R3)

/

DKW	LAC*	(CSIZE)		/SETUP WORD-COUNT

	AAC	-27

	TCA

	DAC*	(WC)

	AAC	1		/SET UP MAGTAPE

	DAC*	(30)

	AAC	2

	DAC*	(32)		/SET UP DECTAPE

/

	LAC	(27)		/SETUP CURRENT ADDRESS REGISTER

	DAC*	(CA)

	AAC	2		/SET UP DECTAPE

	DAC*	(31)

	AAC	2

	DAC*	(33)		/SET UP MAGTAPE

	CLA!CMA

	DAC*	(WARMFL)	/SET UP WARMSTART FLAG

/

	LAC*	(CSIZE		/GET CORE SIZE

	AAC	-30		/LESS 30 SINCE READ STARTS AT LOC 30

	DAC	NUMWDS

	LAC	(30

	DAC	BUFADR

	LAC	WRITE

	DAC	FUNCT		/CHANGE FUNCTION TO WRITE

	JMS	GETIN		/WRITE CORE OUT IN SAVE AREA

	DZM	BOOTFL		/ZERO FLAG TO SAY WE'VE SAVED(MJH-32)

/

/ WARM START ENTRY POINT -- CONTROL IS TRANSFERRED HERE BY THE

/ WARM START BOOTSTRAP AFTER THE CORE IMAGE IS RESTORED.

/

/

/ TEST FOR RE-ENTRANT PACKAGE

/ ABORT IF REQUIRED ECO'S ARE MISSING.

/

WSEP	.INH			/INHIBIT INTERRUPTS

	LAC*	(R3)		/RESTORE LOC 21

	DAC*	(21)

	LAC*	(R2)		/RESTORE LOC 001

	DAC*	(001)

	LAC*	(ITVTB+1)	/SAVE INTERRUPT INSTRUCTION

	DAC	ITVTBS

	LAC	(TRAPV)		/SET TRAP ADDRESS

	DAC*	(ITVTB+1)	/IN LOC (41)

	LAC*	(LVL5)		/SAVE PREVIOUS CONTENTS OF TRANSFER VECTOR

	DAC	LVL5SV

	LAC	(JMP*	ITVTB+1)	/SET TO INTERRUPT TO TRANSFER VECTOR TABLE

	DAC*	(LVL5)		/PUT IN LVL5 ADDRESS (41)

	LAC	(402000)	/REQUEST LVL5 INTERRUPT

	ISA

	CLA			/GIVE MACHINE TIME TO INTERRUPT

	CMA

	LAC	(RETOK)		/SET UP TO TEST FOR FREE

	.ENB			/INSTRUCTION AFTER JMS

	JMS	FREE

FREE	0

	DAC*	(ITVTB+1)	/CHANGE LVL5 TRAP ADDRESS AND VERIFY FREE INSTRUCTION

RETOK	DBK			/DEBREAK FROM LEVL 5

	LAC	ITVTBS		/RESTORE INTERRUPT ADDRESS AND TRANSFER VECTOR'S

	DAC*	(ITVTB+1)

	LAC	LVL5SV		/RESTORE PREVIOUS TRANSFER VECTOR

	DAC*	(LVL5)

	JMP	ECOOK		/ECO'S ARE OK START RSX

/

/ TRAPV	ECO'S NOT INSTALLED ERROR

/

TRAPV	CAF			/INITIATE RSX TO PRINT

	ION			/ERROR MESSAGE

	LAC	(400000)	/TURN ON API AND PI BUT NOT CLOCK

	ISA

	CAL	TYPERR	/PRINT ERROR MESSAGE

	CAL	WFEV	/WAIT FOR ERROR MESSAGE TO FINISH

	HLT

	JMP	TRAPV	/LOOP ON MESSAGE YOU CAN'T RUN RSX!!!!!

/

/

ECOOK	CAF	

	XCT*	(FPHDWE)	/FP HARDWARE REQUIRED?

	JMP	NOFLOT	/NO MUST BE OK

	FPT		/YES CHECK FOR IT

	JMP	NOFLER	/ERROR NO FLOATING HARDWARE

NOFLOT	XCT*	(PRHDWE)	/PROTECTION AVAILABLE?

	JMP	NOPRHD	/NO DON'T CHECK FOR IT

	LAC	(401000)	/DECLARE SIGNIFIGANT EVENT TO SET UP

	ISA		/RELOCATION AND BOUNDARY REGISTERS

	NOP

	.INH

	IOF		/TURN OFF INTERRUPTS

	CAF		/CLEAR FLAGS AND TURN OFF API

	LAC*	(21)

	DAC	LVL5SV	/SAVE LOCATION 21

	LAC	(JMP*	10)	/SET UP RETURN

	DAC*	(21)

	LAC	(PRTN-1)

	DAC*	(X10)

	MPEU		/ENTER USER MODE

	NOP

LASTI	LAS		/VIOLATE USER MODE

	JMP	NOPROT	/NO PROTECTION FOUND

PRTN	LAC	LVL5SV	/RESTORE 21

	DAC*	(21)

	LAC*	(20

	AND	(77777

	SAD	(LASTI+1)

	JMP	NOREL

	CAF		/CLEAR ALL FLAGS

	.ENB		/ENABLE INTERRUPTS

NOPRHD	LAC	(400000)	/SET UP TO TURN API ON

	ION			/TURN PI ON

	ISA			/TURN API ON

	LAW	-1

	DAC*	(7)	/TURN CLOCK ON

	CLON

	KRS		/SELECT FULL DUPLEX

/

	.TITLE	SAVE-REMOVE-INSTALL CHAIN OF BLOCKS CHECKOUT

/

/ (THE CODE FOUND BETWEEN THE "*****" WAS ENTERED BY MJH 4/6/76 EDIT #99)

/ *********************

/

/

/ THE FOLLOWING CODE IS USED TO UPDATE THE INSTALL/REMOVE

/ CHAIN OF BLOCKS IN ORDER TO FIX THE SAVE-REMOVE-INSTALL

/ GLITCH. THE IDEA IS THAT EACH TIME THE STL IN CORE IS CHANGED,

/ THIS CHAIN OF DISK BLOCKS MUST ALSO CHANGE. WHENEVER A TASK IS

/ REMOVED, THE TASKS NAME IS ENTERED INTO THE CHAIN. WHENEVER A

/ TASK IS INSTALLED,  A COPY OF ITS STL NODE (LESS POINTERS) IS

/ ENTERED INTO THE CHAIN ALONG WITH THE TASKS PBDL DATA.

/ WHEN THE SYSTEM IS BOOTSTAPPED THE COPY OF SAVE WHICH IS

/ IN CORE READS THE CHAIN OF BLOCKS AND RECONSTRUCTS THE

/ STL FROM THE DATA FOUND IN THE BLOCKS.

/ WHENEVER A SAVE IS DONE (STL IN CORE MATCHES STL ON DISK)

/ THIS CHAIN OF BLOCKS IS PURGED.

/

/ THE STRUCTURE OF EACH BLOCK IS:

/

/	WORDS 0-375 USED FOR DATA ENTRIES

/	WORD 376 IS A POINTER TO 1ST FREE WORD IN BLOCK

/	WORD 377 IS A POINTER TO NEXT BLOCK OR -1

/

/ THE STRUCTURE OF A REMOVE ENTRY IS:

/

/	NTRY+0 -1 (FLAG SAYING THIS ENTRY IS A REMOVE)

/	NTRY+1 DISK ADDRESS FROM STL NODE

/

/ THE STRUCTURE OF AN INSTALL ENTRY IS:

/

/	NTRY+0 +1 (FLAG SAYING THIS ENTRY IS AN INSTALL)

/	NTRY+1 TASK NAME IN SIXBT 1ST HALF

/	NTRY+2 TASK NAME IN SIXBT 2ND HALF

/	NTRY+3 STL NODE WORD 4

/	NTRY+4 STL NODE WORD 5

/	NTRY+5 STL NODE WORD 6

/	NTRY+6 STL NODE WORD 7

/	NTRY+7 STL NODE WORD 10

/	NTRY+10 STL NODE WORD 11

/	NTRY+11 PARTITION NAME IN SIXBT 1ST HALF

/	NTRY+12 PARTITION NAME IN SIXBT 2ND HALF

/	NTRY+13 PARTITION BASE ADDRESS

/

/ NOTE THAT IT IS EXTREMELY IMPORTANT TO FILL UP DATA

/ ENTRIES IN THE REMOVE CHAIN IN THE ORDER THAT EACH

/ STL MODIFICATION WAS MADE.

/

/ NOTE ALSO THAT ALL TASKS WHICH ACCESS THIS CHAIN OF 

/ BLOCKS MUST RESIDE IN THE SAME PARTITION.

/ THOSE TASKS ARE: SAVE,TDV REM, MCR REM, TDV INS, MCR INS,

/ FININS, AND AUTORM.

/

INSSZ=14		/SIZE OF AN INSTALL ENTRY

REMSZ=2			/SIZE OF A REMOVE ENTRY

	.EJECT

/

/ START TO PROCESS THE CHAIN FOR STL RECONSTRUCTION

/

	LAC	BOOTFL	/HAVE WE JUST SAVED?

	SNA

	JMP	FINISH	/YES -- THEN DON'T SORT THRU CHAIN

			/NO --

	LAC*	(REMBLK	/GET 1ST BLK IN CHAIN
FIND1	JMS	GETBLK	/READIN THE BLOCK

	LAC	BUFF+376	/ARE THERE ANY ENTRIES?

	SAD	(-1		/(042) LOGICAL EOF

	JMP	ENDIT		/(042) NO MORE

	SPA			/(042) SKIP ON PLUS FORM

	CMA			/(042) MAKE MINUS PLUS

	TAD	(BUFF		/(042) POINT AT FIRST ILLEGAL ENTRY

	DAC	TEMP2		/(042) SAVE FOR LOOP CONTROL

	LAC	(BUFF		/YES -- SETUP TO ACCESS NTRY

	DAC	TEMP		/USE TEMP AS AN ENTRY POINTER
FIND0	LAC*	TEMP		/GET FLAGS WORD

	SMA			/IS IT A REMOVE ENTRY?

	JMP	FINDIN		/NO -- ITS AN INSTALL

	IDX	TEMP		/(042) POINT TO DISK ADDR

	.INH			/(042) CAN GRAB SYSTEM AT STARTUP

	LAC	(STL		/YES -- LOOK FOR THE TASK IN STL

	JMS	SETXR		/(042) XR FOR N,X

FINDL	LAC	0,X		/(042) FORWARD POINTER

	SAD	(STL		/(042) DONE

	JMP	RTRNND		/(042) DIDN'T FIND IT

	DAC	TEMP1		/(042) IN CASE THIS ONE'S IT

	JMS	SETXR		/(042) XR ADDRESSING

	LAC	S.DA,X		/(042) DISK ADDRESS

	SAD*	TEMP		/(042) SAME AS ONE IN REMOVE ENTRY

	SKP			/(042) SAME, GO PULL NODE

	JMP	FINDL		/(042) NOT SAME, KEEP ON LOOKING

	LAC	TEMP1		/(042) NODE ADDRESS

	DAC*	(R1		/(042) PULL NODE FROM STL

	JMS*	(NDEL		/(042)

	LAC	TEMP1		/(042) AND PLACE IN TO EMPTIES

	DAC*	(R2

	LAC	(POOL

	DAC*	(R1

	JMS*	(NADD

	LAC	TEMP1		/(042) SEARCH ATL FOR NAME

	AAC	2		/(044)

	DAC*	(R2

	LAC	(ATL

	DAC*	(R1

	JMS*	(SNAM		/IN CASE WAS A DORMANT HANDLER AT LAST

	JMP	RTRNND		/(042) NOT FOUND

	DAC*	(R1		/NODE FOUND -- PREP TO DELETE FROM ATL

	DAC	TEMP1		/SAVE ATL NODE ADDR

	JMS*	(NDEL		/DELETE NODE FROM ATL

	LAC	TEMP1		/RETURN ADDR OF NODE TO AC

	DAC*	(R2		/RETURN NODE TO POOL

	LAC	(POOL

	DAC*	(R1

	JMS*	(NADD		/RETURN NODE

RTRNND	.ENB

	IDX	TEMP		/(042) MOVE TO NEXT ENTRY

	JMP	NEXT		/GO SEE IF THERES ANOTHERE NTRY TO DO

/

/ PROCESS AN INSTALL ENTRY

/

FINDIN	LAW	-2		/(046) FLAG TO FIND USR.NN

	DAC	CHKSWT		/(046) COUNT UP TO 0 IF BOTH HALVES

	LAC	TEMP		/SETUP X10 AS AN ENTRY POINTER

	AAC	6		/POINT X10 AT TASK SIZE WORD

	DAC*	(X10

	DZM	BLOCK		/ZERO PBDL NODE ADDR

				/IT WILL STAY ZERO UNLESS PBDL NODE FOUND

	LAC*	X10		/GET TASK SIZE

	DAC	TSZ

	LAC*	X10		/GET NRM.EXM INDICATOR

	AND	(100000		/SET FLAG 0 FOR EXEC, NOT 0 FOR NRM TASK

	DAC	EP

	LAC*	X10		/GET PART NAME

	DAC	N1

	LAC*	X10

	DAC	N2

	LAC*	X10		/GET PART BASE

	DAC	PBS

	LAC	(N1		/SCAN PBDL FOR PARTITON NAMED

	DAC*	(R2

	LAC	(PBDL

	DAC*	(R1

	JMS*	(SNAM

	JMP	LOST		/NOT FOUND -- PARTITION LOST

	DAC	BLOCK		/FOUND -- SAVE ADDR OF PBDL NODE

	JMS	SETXR		/PREPARE TO ACCESS PBDL NODE

	LAC	EP		/WAS TASK EXEC MODE?

	SZA

	JMP	NRM		/NO -- ITS NRM MODE

	LAC	P.BA,X		/YES -- DOES PART BASE MATCH OLD BASE?

	SAD	PBS

	SKP

	JMP	LOST		/NO -- PARTITION LOST

				/YES --

NRM	LAC	EP		/GET TASK SIZE

	SZA!CMA			/REMOVE XVM MODE BITS IF PRESENT

	LAW	-1000

	AND	TSZ

	TCA			/WILL TASK FIT IN PART?

	TAD	P.SZ,X

	SPA

	JMP	LOST		/NO -- PART LOST

	CLA			/YES -- PREPARE TO INSERT NODE IN STL

	SKP			/A ZERO AC SAYS DON'T SET PART LOST BIT

LOST	LAC	(020000		/ENTER PART LOST BIT INTO TEMP1 FOR FUTURE

	DAC	TEMP1

	JMS*	(PENP		/GET A NODE FROM POOL

	JMP	NONE		/BUMP COUNTER IF POOL IS MT

	LMQ			/SAVE NODE ADDR IN MQ

	JMS	SETXR		/PREPARE TO ACCESS NODE

	LAC	TEMP		/SETUP X10 TO TRANSFER DATA TO NODE FROM BLK

	DAC*	(X10

	LAC*	X10		/GET TASK NAME 1ST HALF

	DAC	S.N1,X

	SAD	(252322		/(046) 1ST HALF USR.NN ?

	IDX	CHKSWT		/(046) YES, COUNT UP TO -1

	LAC*	X10		/GET TASK NAME 2ND HALF

	DAC	S.N2,X
	AND	(776060		/(046) CHECK FOR .NN
	SAD	(566060		/(046)
	ISZ	CHKSWT		/(046) SKIP ONLY IF BOTH HALVES!
	JMP	FIND11		/(046) NO MATCH, CHKSWT LEFT - !!
	LAC	S.N2,X		/(046) MAKE UP ASCII TEXT NN
	AND	(7700		/(046) FOR ERROR MESSAGE
	TAD	S.N2,X		/(046)SPLIT APART 6BIT TO MAKE ASCII
	AND	(17777		/(047)KILL THE 56, KEEP 2 CHAR'S
	ALSS	4		/(046) POSITIONED
	IAC			/(046) BIT FOR 1 IN 15 OF <CR>
	DAC	CHKSWT		/(046) TEXT SET UP, THIS IS + !

FIND11	LAC*	X10		/(046)GET FLAGS WORD

	AND	(757777		/REMOVE PART LOST BIT

	XOR	TEMP1		/ENTER PART LOST BIT IF PART WAS REALLY LOST

	DAC	S.DP,X

	LAC*	X10		/GET REST OF STL

	LAC	BLOCK		/THE LAC* X10 INCREMENTED X10 BUT WE'RE

				/REALLY NOT INTERESTED IN THE OLD PBDL

				/NODE ADDR ONLY THE CURRENT PBDL NODE ADDR.

				/THERE FORE IF THE PBDL NODE WAS FOUND, USE

				/ITS CURRENT ADDR IN THE NEW STL NODE. IF

				/PARTITION WAS NOT IN PBDL ZERO THIS STL WORD.

	DAC	S.PB,X

	LAC*	X10

	DAC	S.DA,X

	LAC*	X10

	DAC	S.DB,X

	LAC*	X10

	DAC	S.TS,X

	LAC*	X10

	DAC	S.EP,X

	LAC	(STL		/ENTER NODE INTO STL

	DAC*	(R1

	LACQ

	DAC*	(R2

	JMS*	(NADD		/ADD NODE TO STL

CHKNXT	LAC	TEMP		/BUMP TEMP TO POINT AT NEXT NTRY

	AAC	INSSZ

	DAC	TEMP

	LAC	CHKSWT		/(046) EIROR MESSAGE OUT

	SPA			/(046) SKIP IF YES

	JMP	NEXT		/(046) NO, CHECK END OF BLOCK

	LAC	(SPURI		/(046) ADDR OF MESSAGE

	DAC	NOAREA+4	/(046) INTO CAL

	CAL	NOAREA		/(046) TO OPR
	CAL	WFEV		/(046)

NEXT	LAC	TEMP		/IS THERE ANOTHER NTRY IN THIS BLK?

	SAD	TEMP2		/(042) END POINT

	SKP

	JMP	FIND0		/YES

FIND2	LAC	BUFF+376	/(042) LOGICAL EOF

	SPA		/(042) SKIP IF NOT

	JMP	ENDIT	/(042) DONE

	LAC	BUFF+377 /(042) NEXT BLOCK IN CHAIN

	JMP	FIND1	/(042)

ENDIT	LAC	MTFLAG		/HAS STL BEEN CORRECTLY (MJH-32)

	SNA			/RECONSTRUCTED?			(MJH-32)

	JMP	FINISH		/YES -- THEN SYNC THE TRANSCIENTS (MJH-32)

	LAC	(MESSTL		/NO -- TELL OPERATOR		(MJH-32)

	DAC	NOAREA+4

	CAL	NOAREA

	CAL	WFEV
FINISH	CAL	SYNC	/SYNC 'NODCNT'

	CAL	SYNC2	/SYNC 'POLLER'

	CAL	SYNC3	/SYNC 'AUTORM'
	CAL	QWAIT
	LAC*	(TIMFLG		/ IS TASK TIMING ALREADY ON?	/(050)
	SNA			/ DON'T TRY TO START IT TWICE!!	/(050)
	CAL	REQTTM		/ REQUEST TASK TIMING ROUTINE	/(048)
	CAL	REQCPB	/REQUEST ...MCR

	CAL	(10)

/
NONE	IDX	MTFLAG		/BUMP COUNT OF MISSING STL NODE	(MJH-32)
	JMP	CHKNXT		/GO CHECK NEXT NTRY		(MJH-32)
/
NOSAV	CAL	NOAREA	/WRITE ERROR MESSAGE, NO SAVE AREA
	CAL	WFEV
	JMP	FINISH						/(048)
/
REQTTM	01; 0;	.SIXBT	'TSKTM1' ; 0				/(048)
NOAREA	2700

	EV

	3		/LUN

	2		/DATA MODE

	NOAR		/BUFFER ADDRESS

MESSTL	NOAR-MESSTL/2*1000					/(MJH-32)

	0
	.ASCII "STL NOT ENTIRELY RECONSTRUCTED"<15>
NOAR	SPURI-NOAR/2*1000+2
	0
	.ASCII	'NO SAVE AREA ON SYSTEM DISK'<15>

SPURI	NOARE-SPURI/2*1000+2

	0

	.ASCII	'REMOVE SPURIOUS TASK USR.XX'<15>

CHKSWT=SPURI+14		/(046) REWRITE XX !

NOARE=.

NOREL	CAF		/CLEAR ALL FLAGS

	LAC	(400000)	/SET UP API AND PI

	ISA

	ION

	CAL	NORELH	/PRINT ERROR MESSAGE

	CAL	WFEV	/WAIT FOR MESSAGE

	HLT

	JMP	.-3	/TYPE IT AGAIN

/

NOPROT	LAC	LVL5SV	/RESTORE 21

	DAC*	(21)

	LAC	(400000)	/SET UP API

	ISA

	ION

	CAL	NOPROA	/NO PROTECTION HARDWARE

	CAL	WFEV

	HLT

	JMP	.-3

/

/BEFORE CALLING THIS I/O SUBROUTINE, LOAD AS FOLLOWS:

/ NUMWDS CONTAINS NUMBER OF WORDS TO TRANSFER

/ BUFADR CONTAINS BUFFER ADDRESS

/ BLOCK CONTAINS BLOCK NUMBER

/ FUNCT CONTAINS READ OR WRITE

/

GETIN	0

	LAW	-10	/SET ERROR COUNTER

	DAC	ERRCNT

	.IFDEF %RP02

	LAC	BLOCK	/CALCULATE CYLINDER,HEAD,SECTOR FROM BLOCK NO.

	LMQ

	CLA!CLL

	DIV

	310

	DAC	HEDAD

	LACQ

	ALS	12

	DAC	CYLAD

	LAC	HEDAD

	LMQ

	CLA!CLL

	DIV

	12

	DAC	SECTOR

	LACQ

	ALS	5

	DAC	HEDAD

	AND	(001740

	XOR	CYLAD

	XOR	SECTOR

	DAC	PAKAD	/WORD SET FOR DP 

TOP	LAC	(040000		/START A SEEK ACTION

	DPLF

	DPRSB		/THIS PROVIDES  A DELAY

	DPRSB		/AFTER WHICH THE SEEK PROCEEDS

	CLA		/EVEN THO UNIT IS DESELECTED.

	DPLF

	LAC	PAKAD

	DPLA		/LOAD BLOCK ADDRESS

	LAC	NUMWDS

	TCA

	DPWC		/LOAD WORD COUNT

	LAC	BUFADR

	DPCA

	DPRSB

	RAR		/TEST FOR DP NOT READY

	SZL

	JMP	TOP	/TRY AGAIN

	DPCS

	LAC	FUNCT

	DPLF		/WRITE OR READ FUNCTION

	DPRSB

	DPRSB

	DPSE		/ERROR?

	SKP

	JMP	TOP1	/YES, TRY AGAIN

	DPSJ		/DONE?

	JMP	.-4	/NO, TRY AGAIN

	JMP*	GETIN	/DONE

HEDAD	0	/HEAD ADDRESS

CYLAD	0	/CYLINDER ADDRESS

	.ENDC

	.IFDEF %RF15

TOP	DSCD

	CLL

	LAC	BLOCK

	LRS	12

	DLAH

	LAC	BLOCK

	AND	(1777

	ALS	10

	DLAL

	CLC

	TAD	BUFADR

	DAC*	(37

	LAC	NUMWDS

	TCA

	DAC*	(36

	LAC	FUNCT

	IOF

	.INH

	DSCF!DSFX!DSCN

	DSSF

	JMP	.-1

	.ENB

	ION

	DSRS

	SPA

	JMP	TOP1

	JMP*	GETIN

	.ENDC

	.IFDEF %RK05

TOP	LAC	(23402

	DAC	TCB

	LAC	(602

	DAC	TCB+1

	DZM	RKEV

	LAC	BLOCK

	DAC	TCB+3

	LAC	NUMWDS		/IF TRANSFER >64K

	AND	(600000		/SET BIT IN WORD 4

	SZA

	LAC	(4

	DAC	TCB+4

	LAC	BUFADR

	DAC	TCB+5

	LAC	NUMWDS

	TCA

	DAC	TCB+6

	LAC	FUNCT

	DAC	TCB+7

	DZM	TCB+10

	DZM	TCB+11

	DZM	TCB+12

	LAC	(TCB

	SIOA

	JMP	.-1

	LIOR

	LAC	RKEV

	SNA!RTL

	JMP	.-2

	SPA

	JMP	TOP1

	JMP*	GETIN

TCB	0

	402

RKEV	0

	0

	0

	0

	0

	0

	0

	0

	0

	.ENDC

TOP1	ISZ	ERRCNT

	JMP	TOP

	JMP	DSKERR

BLOCK	0

NUMWDS	0

BUFADR	0

SECTOR	0

PAKAD	0	/HOLDS ADDRESS ON DP

TEMP	0

TEMP1	0

TEMP2	0

ERRCNT	0

BOOTFL	0		/SAVE FLAG SET 0 ON SAVES	(MJH-32)

MTFLAG	0		/COUNT OF STL NODES NOT ENTERED (MJH-32)

CQFN	0		/ADDR OF 1ST NODE IN CKQ	(MJH-32)

CQLN	0		/ADDR OF LAST NODE IN CKQ	(MJH-32)

TSZ	0		/TASK SIZE			(MJH-32)

EP	0		/ZERO IF EXEC MODE, NOT ZERO IF NOT (MJH-32)

N1	0		/PBDL NODE NAME 1ST PART	(MJH-32)

N2	0		/PBDL NODE NAME 2ND PART	(MJH-32)

PBS	0		/PBDL NODE BASE			(MJH-32)

DEAL	0

	DAC	TEMP

	LACQ

	DAC	DEVICE

	LAW	-10

	DAC	TEMP1

DEAL2	LAC	TEMP

	DAC	RFDEAL+3

	LAC*	TEMP

	SNA

	JMP	DEAL1

	CAL	RFDEAL

	CAL	WFEV

	DZM*	TEMP

DEAL1	LAC	TEMP

	AAC	3

	DAC	TEMP

	ISZ	TEMP1

	JMP	DEAL2

	JMP*	DEAL

RSXSAV	.SIXBT 'RSXIMG'	/NAME OF SAVE AREA

BUFF	.BLOCK 1000	/BUFFER

	.IFDEF	%RP02

FUNCT	11000	/READ

	.ENDC

	.IFDEF	%RK05

FUNCT	4

	.ENDC

	.IFDEF	%RF15

FUNCT	2

	.ENDC

	.IFDEF %RP02

WRITE	021000	/WRITE FUNCTION FOR SAVING

	.ENDC

	.IFDEF %RF15

WRITE	4

	.ENDC

	.IFDEF %RK05

WRITE	2

	.ENDC

NOPROA	2700	/NO PROTECTION HARDWARE AVAILABLE

	EV

	3

	2

	NOPTM

NOPTM	NOPTE-NOPTM/2*1000+2

	0

	.ASCII	'RELOCATION NECESSARY'<15>

NOPTE=.

NORELH	2700

	EV

	3

	2

	NOREM
NOREM	NOREE-NOREM/2*1000+2
	0
	.ASCII	'PROTECT-RELOCATE SWITCH MUST BE IN RELOCATE POSITION'<15>

NOREE=.

/

NOFLER	CAF		/PRINT ERROR MESSAGE

	LAC	(NOP)	/FORCE NO FP OPTION

	DAC*	(FPHDWE)

	ION		/ENABLE INTERRUPTS TO PRINT THE MESSAGE

	LAC	(400000)

	ISA
	CAL	TYPFPE	/TYPE FLOATING POINT ERROR

	CAL	WFEV	/WAIT FIR IT

	HLT

	JMP	NOFLER	/PRINT IT AGAIN

/

/

TYPERR	2700	/TYPE ERROR MESSAGE

	EV

	3

	2

	ERRMSG-2

TYPDSK  2700

        EV

        3

        2

        DSKMSG

DSKMSG  DSKMGE-DSKMSG/2*1000+2

        0

        .ASCII "SAV - DISK ERROR"<15>

DSKMGE=.

DSKERR  CAL     TYPDSK

        CAL     WFEV

	CAL	REQCPB

        CAL     (10)

/

TYPFPE	2700	/TYPE FP ERROR

	EV

	3

	2

	FPERMS

/

FPERMS	FPERME-FPERMS/2*1000+2

	0
	.ASCII	'FP15 NECESSARY'<15>				/(048)

FPERME=.

/

WFEV	20	/WAIT FOR EVENT

	EV

/

EV	0	/ EVENT VARIABLE

XADJ	0

LVL5SV	0	/LOCATION 41 SAVE AREA

ITVTBS	0	/TRANSFER VECTOR SAVE AREA

/

ERRMSG	.ASCII	'RE-ENTRANT ECO PACKAGE NECESSARY TO RUN RSX'<15>

/

REQCPB	1

	0

	.SIXBT	"...MCR"

	0

/

RFDEAL	11600		/DEALLOCATE.

	EV

	1		/LUN 1 FOR DISK DRIVER.

	RFACTB		/CONTROL TABLE ADDRESS.

DEVICE	2

/

SYNC	14	/SYNC CPB FOR 'NODCNT'

	QEV

	.SIXBT "NOD"

	.SIXBT "CNT"

	3	/SYNC UNIT -- MIN.

	SINOD	/SCHEDULE INTERVAL

	SUNOD	/SCHEDULE UNIT -- MIN.

	RINOD	/RESCHEDULE INTERVAL

	RUNOD	/RESCHEDULE UNIT -- MIN

	0	/PRIORITY

/

SYNC2	14

	0

	.SIXBT "POL"

	.SIXBT "LER"

	3

	SIPOL

	SUPOL

	RIPOL

	RUPOL

	0

/

SYNC3	14

	0

	.SIXBT "AUT"

	.SIXBT "ORM"

	3

	SIAUT

	SUAUT

	RIAUT

	RUAUT

	0

/

	.END
