IDENT 0RT,RTRX
PERIPH J
BASE MIXED
SST
REL$ SET 0
QUAL$ EQU 1 DEFINE UNQUALIFIED COMMON DECKS
*COMMENT 0RT - RETURN TAPE RESOURCE.
COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
TITLE 0RT - RETURN TAPE RESOURCE.
SPACE 4,10
*** 0RT - RETURN TAPE RESOURCE.
*
* J. L. LARSON. 81/12/14.
SPACE 4,10
*** *0RT* IS A LOCATION FREE ROUTINE USED TO CLEAR
* THE ASSOCIATED VSN (RSXVID) FILE ENTRY AND UPDATE THE
* JOB DEMAND (RSXDID) FILE ENTRY FOR RETURN OF A TAPE RESOURCE.
*
* *0RT* IS CALLED BY *0DF* (RETURN/UNLOAD TAPE).
SPACE 4,10
*** ENTRY CONDITIONS.
*
* (FA) = RELATIVE FNT ADDRESS IN NFL
* ((LA)-1) = Y
* WHERE LA = LOAD ADDRESS
* Y = RESOURCE UPDATE CONTROL
* BIT 0 = 0, IF UPDATING ASSIGNED AND DEMAND
* 1, IF NOT UPDATING DEMAND COUNT
* (FS - FS+4) = FST INFORMATION
*
* USES DIRECT CELLS 0 - 17.
* *BFMS* MS SECTOR BUFFER.
SPACE 4,10
*** EXIT CONDITIONS.
*
* (A) .LT. 0 IF RESOURCE DEMAND FILE DEVICE INACCESSIBLE.
* (T5) = EST ORDINAL OF DEVICE, IF INACCESSIBLE.
* (FSTL OF FNT) UPDATED IN CM.
SPACE 4,10
** COMMON DECKS.
*CALL COMPMAC
*CALL COMSCPS
QUAL COMSMTX
*CALL COMSMTX
QUAL *
*CALL COMSPIM
*CALL COMSMSP
*CALL COMPREL
QUAL COMSRSX
*CALL COMSRSX
QUAL *
*CALL COMSSSD
*CALL COMSZOL
SPACE 4,10
**** DIRECT LOCATION ASSIGNMENTS.
FS EQU 20 - 24 FST INFORMATION (5 LOCATIONS)
RI EQU FS+2 RANDOM INDEX (2 LOCATIONS)
FA EQU 57 RELATIVE FNT ADDRESS IN NFL
SPACE 4,10
* ASSEMBLY CONSTANTS.
DFRA EQU BFMS+2+/COMSRSX/VDFI*5+3 DEMAND FILE RANDOM ADDRESS
TACT EQU BFMS+2+/COMSRSX/RVAL*5+3 TOTAL ASSIGNED COUNT
TDCT EQU BFMS+2+/COMSRSX/RVAL*5+4 TOTAL DEMAND COUNT
TRIX EQU BFMS+2+/COMSRSX/VDFI*5+2 TAPE RESOURCE INDEX
****
TITLE MAIN PROGRAM.
RTR SPACE 4,10
** RTR - MAIN ROUTINE.
ORG 5
RTR SUBR ENTRY/EXIT
RJM IFP INITIALIZE GLOBAL FNT PROCESSOR
LDD FS+4
SHN 21-2
MJN RTR1 IF PREVIOUS DEMAND FILE ERROR
LDN RVFO SET RESOURCE VSN FILE ORDINAL
RJM RRF READ VSN FILE ENTRY
* CLEAR VSN ENTRY.
LDM. DFRA SET DEMAND FILE RANDOM ADDRESS
STD RI
LDM. DFRA+1
STD RI+1
LDM. TRIX GET TAPE RESOURCE INDEX AND BYTE POINTER
SBD HN CONVERT BYTE POINTER TO ACCESS LEVEL
SHN 3
LMN 4
RAD FS+4
LDN 0
RJM CLE CLEAR VSN ENTRY
LDD FS+1
ZJN RTRX IF NO UDT ADDRESS
RTR1 LDN RDFO RESOURCE DEMAND FILE ORDINAL
RJM RRF READ DEMAND FILE ENTRY
* UJN URC UPDATE RESOURCE COUNTS
URC SPACE 4,10
* URC - UPDATE RESOURCE ASSIGNED AND DEMAND COUNTS.
*
* ENTRY (FS+4) = RESOURCE BYTE POINTER.
*
* EXIT TO *RTU* TO RELEASE TAPE UNIT.
*
* ERROR TO *HNG* IF RESOURCE COUNTS INVALID.
*
* USES T2.
URC BSS 0 ENTRY
LDD FS+4
SHN -3 CALCULATE RESOURCE BYTE NUMBER
LPN 77
STD T2
SHN 2
ADC BFMS+2+5
RAD T2
LDD FS+4
ADD TH CONVERT ACCESS LEVEL TO BYTE POINTER
SHN -11
SBN 5
MJN URC1 IF NOT IN SECOND WORD OF ENTRY
ADN 1 ADJUST TO SECOND WORD
URC1 RAD T2
* DECREMENT RESOURCE ASSIGNED COUNT AND TOTAL ASSIGNED COUNT.
LDC -100 DECREMENT RESOURCE ASSIGNED COUNT
RAI T2
MJN HNG IF RESOURCE ASSIGNED COUNT OUT OF RANGE
LDM. TDCT CHECK TOTAL DEMAND COUNT = 1
SBN 1
ZJN URC2 IF ONLY ONE CONCURRENT RESOURCE SCHEDULED
LDM -1
NJN URC3 IF UNLOAD (DECREMENT ASSIGNED COUNT)
* IF ALL DEMANDS SATISFIED, DECREMENT RESOURCE DEMAND COUNT
* AND TOTAL DEMAND COUNT.
URC2 LDM. TACT CHECK ALL DEMANDS SATISFIED
SBM. TDCT
MJN URC3 IF NOT ALL DEMANDS SATISFIED
SOI T2 DECREMENT RESOURCE DEMAND COUNT
SHN 21-5
MJN HNG IF RESOURCE DEMAND COUNT OUT OF RANGE
SOM. TDCT DECREMENT TOTAL DEMAND COUNT
MJN HNG IF TOTAL DEMAND COUNT NOT IN RANGE
URC3 SOM. TACT
PJN RTU IF TOTAL ASSIGNED COUNT NOT OUT OF RANGE
* UJN HNG HANG PP
HNG SPACE 4,10
** HNG - HANG PP.
*
* EXIT TO *RRF4* IF PP HANG CLEARED.
*
* MACROS MONITOR.
HNG BSS 0 ENTRY
MONITOR HNGM HANG PP
LJM RRF4 RELEASE CHANNEL AND EXIT
RTU SPACE 4,10
** RTU - RELEASE TAPE UNIT.
*
* ENTRY (FS - FS+4) = FST INFORMATION.
*
* EXIT TO *RTRX*.
*
* USES CM - CM+4.
*
* CALLS CLE, PAU.
*
* MACROS MONITOR.
RTU BSS 0 ENTRY
LDN 1
RJM CLE UPDATE DEMAND FILE ENTRY
* IF CALLED BY MAGNET, A *CLOSE/UNLOAD* OR *CLOSE/RETURN*
* REQUEST IS IN PROGRESS. IN THIS CASE, *1MT* WILL INITIATE
* THE UNIT RETURN PROCESSING.
LDD IA SET CALLING CONTROL POINT ADDRESS
CRD CM
LDD CM+1
LPN 37
SHN 7
ADK JCIW GET SUBSYSTEM ID
CRD CM
LDD CM+2
LMK MTSI
ZJN RTU2 IF CALLED BY MAGNET
LDN ZERL
CRD CM
LDN /COMSMTX/RTF SET RETURN REQUEST
STD CM
LDD MA
CWD CM
RTU1 RJM PAU PAUSE
LDD FS+1 SET *UFRQ* ADDRESS
ADK /COMSMTX/UFRQ
STD CM+4
LDN 5 SET WRITE AND INCREMENT TAPE ACTIVITY
STD CM+1
LDD HN SET NUMBER OF WORDS TO WRITE
STD CM+3
LCN 7777-MTSI
STD CM+2
MONITOR TDAM MAKE TAPE RETURN REQUEST
LDD CM+1
ZJN RTU2 IF COMPLETE
SBN 1
ZJN RTU1 IF MAGNET MOVING
LDD FS SET EST ORDINAL
STD CM+1
MONITOR DEQM DROP EQUIPMENT
* LDN 0 SET RETURN COMPLETE
RTU2 LJM RTRX RETURN
TITLE SUBROUTINES.
RRF SPACE 4,15
** RRF - READ RESOURCE FILE ENTRY.
*
* ENTRY (A) = FNT ORDINAL OF RESOURCE FILE.
* (RI - RI+1) = RANDOM INDEX OF RESOURCE FILE ENTRY.
*
* EXIT (T5 - T7) = RESOURCE FILE MS PARAMETERS.
* (BFMS) = RESOURCE FILE ENTRY (MS SECTOR).
*
* ERROR TO *RTRX* IF FILE EMPTY, RANDOM INDEX ERROR,
* OR SECTOR READ ERROR.
*
* USES T1, T3, CM - CM+4, T5 - T5+4.
*
* CALLS CLE, CRA, PAU, RDS, SFI.
*
* MACROS SETMS, SFA.
RRF SUBR ENTRY/EXIT
STD T3
SFA FNT GET RESOURCE FILE FST ENTRY
ADN FSTG
CRD T5
LDD T6
ZJN RRF1 IF FILE UNUSED
SETMS IO,RW
LDD CM+4 FETCH FWA OF TRT
SHN 3
ADN TRLL
CRD CM
LDD CM+3
LPN 77
SHN 14
LMD CM+4
SBD TH 4000/4
STM CRAA+1
SHN -14
LMC ADCI
STM CRAA
LDD RI
ADD RI+1
RRF1 ZJN RRF5 IF NO RANDOM INDEX
RRF2 RJM PAU PAUSE
* LDN SFIN
ERRNZ SFIN CODE DEPENDS ON VALUE
* STD T1
SFA FNT,T3 INTERLOCK RESOURCE FILE
RJM SFI
NJN RRF2 IF INTERLOCK UNAVAILABLE
RJM CRA
MJN RRF4 IF RANDOM ADDRESS ERROR
LDC BFMS
RJM. RDS READ SECTOR
MJN RRF3 IF READ ERROR
LJM RRFX RETURN
RRF3 SHN 21-12
MJN RRF4 IF NON-RECOVERABLE ERROR
SOM RRFA
RRF4 LCN 0 RELEASE FILE WITH NO UPDATE
RJM CLE
* LDN 0 SET EXIT CONDITION
RRFA ADN 0
* LCN 77 (RECOVERABLE MS ERROR ENCOUNTERED)
RRF5 LJM RTRX RETURN
CLE SPACE 4,25
** CLE - CLEAR/UPDATE FILE ENTRY.
*
* ENTRY (A) = 0, IF CLEAR FILE ENTRY.
* (A) .GT. 0, IF UPDATE FILE ENTRY.
* (A) .LT. 0, IF RELEASE CHANNEL WITH NO UPDATE.
* (T3) = FNT ORDINAL OF RESOURCE FILE.
* (FA) = RELATIVE FNT ADDRESS IN NFL.
* (T5 - T7) = RESOURCE FILE MS PARAMETERS.
* (FS - FS+4) = FST INFORMATION.
* (BFMS) = RESOURCE FILE ENTRY (MS SECTOR).
*
* EXIT RESOURCE FILE SECTOR REWRITTEN FROM BFMS BUFFER
* FOR ENTRY CONDITION (A) .GE. 0.
*
* ERROR TO *RRF3* IF MASS STORAGE ERROR.
*
* USES T1, CM - CM+4.
*
* CALLS SFI, WDS.
*
* MACROS ENDMS, SFA.
CLE SUBR EXTRY/EXIT
NJN CLE2 IF UPDATE ONLY
LDC 500
STD T1
CLE1 LDN 0 CLEAR SECTOR BUFFER
STM. BFMS+1,T1
SOD T1
NJN CLE1 IF MORE TO CLEAR
CLE2 MJN CLE3 IF NO SECTOR TO WRITE
LDC BFMS+WLSF WRITE SECTOR
RJM. WDS
MJP RRF3 IF WRITE ERROR
NFA FA,R
ADN FSTL UPDATE FST INFORMATION
CWD FS
CLE3 ENDMS END MASS STORAGE OPERATION
LDN CFIN CLEAR FILE INTERLOCK OPTION
STD T1
SFA FNT,T3 ABSOLUTE ADDRESS OF RESOURCE FILE FNT
RJM SFI CLEAR RESOURCE FILE INTERLOCK
UJP CLEX RETURN
PAU SPACE 4,10
** PAU - PAUSE AND CHECK FOR OPERATOR OVERRIDE.
*
* EXIT (A) = (T1) = 0.
*
* ERROR TO *RTRX* IF OPERATOR OVERRIDE ERROR FLAG.
*
* USES T1.
*
* MACROS DELAY, PAUSE.
PAU SUBR ENTRY/EXIT
LDN 20 DELAY TWO MILLISECONDS
STD T1
PAU1 SOD T1
ZJN PAUX IF END OF DELAY
DELAY
PAUSE
LDD CM+1
LMN ORET
NJN PAU1 IF NOT OPERATOR OVERRIDE
LJM RTRX EXIT
SPACE 4,10
** COMMON DECKS.
IRA$ SET 1 DEFINE INITIALIZATION
REL$ SET 1
*CALL COMPCRA
FNT$ EQU 1 ASSEMBLE SYSTEM FNT PROCESSOR
IFP$ EQU 1 ASSEMBLE REMOTE INITIALIZATION CODE
*CALL COMPGFP
SFI$ EQU 1 SELECT IMMEDIATE RETURN FROM *SFI*
*CALL COMPSFI
IFP HERE CODE TO INITIALIZE SYSTEM FNT PROCESSOR
SPACE 4,10
RSTR
SPACE 4,10
OVERFLOW 5,ZRTL
END