	.TITLE *** EXECUTE ***
/
/ COPYRIGHT (C) 1975
/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY
/ DEC.
/
	.EJECT
/ EDIT #14
/
/ RSX EXECUTE	10 JUN 70	H. KREJCI
/		5 FEB 72	R. MCLEAN
/		24 JAN 74	M. HEBENSTREIT
/		15 OCT 75	M. HEBENSTREIT
/
	.GLOBL	.RSXEX
/
/ INITIAL ENTRY (AC EXTENTION HAS BEEN SAVED) DETERMINE THE
/ BASE (LTBBSE) AND THE TOP (LTBTOP) OF THE LINK TABLE
/
INITAL	LAC	.RSXEX	/SET UP THE BANK PAGE MASK'S
TEMP	AAC	-1		/(MJH-14)
	DAC	TEMP		/(MJH-14)
	LAC*	TEMP		/(MJH-14)
	AND	(010000		/(MJH-14)
DISKAA	SZA!CLA			/(MJH-14)
	LAC	(10000)	/17777 FOR BANK 7777 FOR PAGE
	TAD	(7777)
BPMASK	DAC	BPMASK
	XOR	(77777)	/60000 FOR BANK 70000 FOR PAGE
PGBTS	DAC	PGBTS
	LAC	.RSXEX	/(THIS INSTRUCTION IS USE AS AN OPERAND)
TEMP1	AAC	-1
TEMP2	DAC	TEMP1
BUFX	AND	PGBTS
JMSEXU	DAC	TEMP2
LTBX1	LAC*	TEMP1
COUNT	DAC	JMSEXU
LTBX2	AND	BPMASK
LTBTOP	XOR	TEMP2
LTBBSE	DAC	LTBTOP
MAXADR	IAC
TOLINK	DAC	TEMP2
EV	LAC*	TEMP2
DSKUN	DAC	LTBBSE
LNKADR	LAC	INITAL	/SET FIRST ENTRY SWITCH TO NORMAL ENTRY (MOVE
MINADR	DAC	FESW	/"LAC RSXXCT" TO FESW)
TRWCT	JMP	FESW	/CONTINUE AS IF NORMAL ENTRY
/
/ ENTER HERE WHENEVER A NON-RESIDENT SUBROUTINE IS CALLED
/
.RSXEX	0
	CLA!RAR			/(MJH-14)
	DAC	SAVLNK		/(MJH-14)
FESW	JMP	INITAL	/FIRST ENTRY SWITCH -- REPLACED BY "LAC RSXXCT"
/
	AAC	-1		/ FETCH DISK ADDRESS, MIN
	DAC	TOLINK		/ADDRESS, AND MAX ADDRESS OF THE LINK
	AAC	6		/TO BE LOADED
	DAC	BUFX
	LAC*	BUFX
	DAC	DISKAA
	AND	(777400)
	DAC	LNKADR
	XOR*	BUFX
	ISZ	BUFX
	DAC	DSKUN
	LAC*	BUFX
	ISZ	BUFX
	DAC	MINADR
	LAC*	BUFX
	AND	(77777)	/MASK OFF ADDRESS
	DAC	MAXADR
	CMA
	TAD	MINADR	/DETERMINE TRANSFER LENGTH
	TCA!CLL
	DAC	TRWCT
	LAW	-10	/SET UP FOR 8 RETRYS ON DISK ERROR
	DAC	COUNT
RETRY	CAL	GET	/ISSUE DISK REQUEST
	LAC	LTBBSE
	SKP
LTBSCN	LAC	LTBX1		/SCAN LINK TABLE FOR ENTRIES FOR
	SAD	LTBTOP		/THE LINK JUST LOADED AND FOR ENTRIES
	JMP	RSACE		/FOR LINKS THAT HAVE BEEN OVERLAYED
	AAC	10
	DAC	LTBX2
	AAC	3
	DAC	LTBX1
	LAC*	LTBX2		/TEST FOR ENTRY FOR JUST LOADED LINK
	SAD	DISKAA
	JMP	LTBSN1
	ISZ	LTBX2
	LAC*	LTBX2	/LINK NOT OVERLAYED
	TCA			/IS GREATER THAN MAXADR OF THE LINK
	TAD	MAXADR	/JUST LOADED
	ISZ	LTBX2
	SPA
	JMP	LTBSCN
	LAC*	LTBX2		/LINK IS NOT OVERLAYED IF ITS MAXADR
	AND	(77777)
	TCA			/IS LESS THAN THE MINADR OF THE LINK
	TAD	MINADR		/JUST LOADED
	SMA!SZA
	JMP	LTBSCN
/
	LAC	LTBX2		/ENTRY FOR OVERLAYED LINK, SET THE
	AAC	-10		/SECOND WORD TO: JMS* (RSXXCT)
	DAC	LTBX2
	LAC	JMSEXU
LTBSN2	DAC*	LTBX2
	JMP	LTBSCN
/
LTBSN1	LAC	LTBX2		/ENTRY FOR THE LINK JUST LOADED,
	AAC	-6		/SET THE SECOND WORD TO: LAC .-2
	DAC	LTBX2
	AAC	-2
	AND	BPMASK
	XOR	(200000)
	JMP	LTBSN2
/
RSACE	CAL	WFGET	/WAIT FOR DISK READ TO COMPLETE
	LAC	EV	/WAS THERE A DISK ERROR?
	SMA
	JMP	CONTIN	/NO
	CAL	(5	/YES -- WAIT FOR THE NEXT SIGNIF. EVENT
	ISZ	COUNT	/ARE WE DONE WITH 8 RETRYS?
	JMP	RETRY	/NO -- TRY IT AGAIN
	CAL	(10	/YES -- EXIT !!!!!!!!!!!!!!!!!!!!!!
			/WE EXIT HERE BECAUSE EITHER THE DISK IS
			/MALFUNCTIONING OR THERE ARE NO NODES IN
			/THE POOL. IN EITHER CASE THE SYSTEM
			/WON'T LIVE VERY MUSCH LONGER SO EVEN IF
			/WE EXIT FROM RF...., RP...., RK...., 
			/OR MT.... LITTLE WILL BE HURT.
CONTIN	LAC	SAVLNK	/RESTORE LINK  (MJH-14)
	RAL!CLL		/(MJH-14)
	JMP*	TOLINK
/
GET	3000
	EV
	1
	DSKUN
WFGET	20
	EV
SAVLNK	0		/(MJH-14)
	.END
