IDENT 1DL,LDO
PERIPH
BASE MIXED
SST
EOR$ EQU 1 DEFINE EOR POSITION ADVANCE
MSR$ EQU 1 DEFINE ERROR PROCESSING FOR *RNS*
*COMMENT 1DL - DISPLAY OVERLAY LOADER.
COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
TITLE 1DL - DISPLAY OVERLAY LOADER.
SPACE 4
*** 1DL - DISPLAY OVERLAY LOADER.
* G. R. MANSFIELD. 70/12/11.
SPACE 4
*** 1DL MAY BE CALLED TO LOAD OVERLAYS FROM MASS STORAGE
* FOR DISPLAY PROGRAMS. THE OVERLAYS ARE ASSUMED TO BEGIN AT
* THE MASS STORAGE ADDRESS SPECIFIED BY THE FIRST OVERLAY
* WHICH HAS THE SAME FIRST 2 CHARACTERS OF THE REQUESTED
* OVERLAY AND CONTINUE IN A CONTIGUOUS BLOCK,
SPACE 4
*** CALL.
*
*
*T 18/ *1DL*,6/ CP,12/ CH,24/ NAME
* CP CONTROL POINT NUMBER
* CH CHANNEL FOR TRANSMISSION OF OVERLAY
* IF CH IS GREATER THAN 77 THEN A CM TRANSFER WILL BE
* SELECTED TO THE RECEIVING PPS MSG. BUFFER. CH MUST BE
* THE RECEIVING PPS INPUT REGISTER ADDRESS.
* NAME OVERLAY NAME
SPACE 4
*** COMMUNICATION.
*
*
* WHEN 1DL IS READY TO TRANSMIT THE OVERLAY TO THE
* CALLING PROGRAM, BYTE 2 OF THE INPUT REGISTER IS SET TO
* 7777B. 1DL THEN WAITS FOR BYTE 2 OF THE INPUT REGISTER TO
* BE SET TO 0. IF THIS DOES NOT TAKE PLACE WITHIN 1 SECOND,
* 1DL EXITS TO PP RESIDENT, THUS ABORTING THE OVERLAY LOAD.
* IF A CM TRANSFER IS SELECTED, THE FOLLOWING ADDITIONAL
* INTERFACE REQUIREMENTS MUST BE FOLLOWED.
* 1. AFTER 1DL READY TO SEND IS DETECTED, RECEIVER MUST
* ZERO HIS OUTPUT REGISTER AND THEN SET BYTE 2 OF HIS
* INPUT REGISTER TO ZERO. -READY TO RECEIVE
* 2. RECEIVER READS HIS OUTPUT REGISTER. IF BYTE 4 IS
* ZERO, DELAY 128 MICROSECS AND READ AGAIN. IF BYTE
* 4 IS NON-ZERO THE LOWER 6 BITS CONTAIN THE BLOCK
* WORD-COUNT AND THE UPPER 6 BITS CONTAIN A FLAG.
* THE FLAG INDICATES DATA IS IN THE MSG. BUFFER.
* IF THE WORD COUNT IS ZERO,THE LAST BLOCK HAS ALREADY
* BEEN RECEIVED AND THE TRANSFER IS COMPLETE.
* 3 IF THE WORD-COUNT IS NON-ZERO, READ FROM THE MSG.
* BUFFER (WORD-COUNT) WORDS. OTHERWISE, END.
* 4. ZERO THE OUTPUT REGISTER TO INDICATE TO 1DL THAT
* THE DATA HAS BEEN REMOVED FROM THE BUFFER AND GO TO
* STEP 2.
*
* *WARNING* - DIRECT CHANNEL TRANSFERS ARE LIMITED TO *MXPC*
* SECTORS; ANY DATA BEYOND THIS LIMIT IS IGNORED. ON CM
* TRANSFERS AFTER *MXPC* SECTORS, IT IS POSSIBLE FOR *1DL* TO
* BE TRAPPED BY A STORAGE MOVE OR DROP. IF A PAUSE OCCURS,
* THE CM TRANSFER PROTOCOL (IN WHICH THE TWO PP-S MONITOR
* EACH OTHER-S OUTPUT REGISTERS) WILL BREAK DOWN. SINCE
* *1DL* CANNOT TELL WHETHER OR NOT A PAUSE ACTUALLY OCCURRED,
* *1DL* MUST THEREFORE RESYNCHRONIZE THE TRANSFER AFTER EACH
* *MXPC* SECTORS. *1DL* WILL DO THIS BY STARTING OVER WITH
* THE INITIAL PROTOCOL (*1DL* SETTING BYTE 2 OF ITS INPUT
* REGISTER SET TO 7777B AND THE CALLING PP SETTING IT TO ZERO).
* THEREFORE, THE CALLING PP MUST BE PREPARED TO PAUSE (IF *1DL*
* PAUSES) AND TO RESYNCHRONIZE THE TRANSFER (IN ANY EVENT)
* AFTER EACH *MXPC* SECTORS ARE TRANSFERRED.
SPACE 4
*CALL COMPCHI
*CALL COMPMAC
*CALL COMSMSP
*CALL COMSPIM
SPACE 4
**** DIRECT LOCATION ASSIGNMENTS.
T8 EQU 16 *7SE* PARAMETER WORD
CN EQU 20 CM WORD BUFFER (5 LOCATIONS)
OV EQU 25 OVERLAY NAME
BO EQU 26 BUFFER OVERFLOW
TN EQU 30 - 34 TRANSFER DIRECT CELLS
CW EQU 40 - 44 CM TRANSFER CONTROL WORD
****
SPACE 4
* ASSEMBLY CONSTANT.
CH EQU CHDS TRANSMISSION CHANNEL
WT EQU 6 CM WORDS PER CM TRANSFER
TITLE MAIN PROGRAM.
LDO SPACE 4
** LDO - MAIN PROGRAM.
ORG PPFW
LDO RJM PRS PRESET PROGRAM
LDN 0
RJM SFO SEARCH FOR OVERLAY
NJN LDO.1 IF FOUND
LJM DPP
* INITIATE TRANSMISSION.
LDO.1 PAUSE NE
AOD IR+2
STD TN SAVE CHANNEL OR CM FLAG (IF CM THE OA)
LDO0.2 LCN 0 SET TRANSMIT REQUEST
STD IR+2
STD TN+1 SET PRIMARY TIMEOUT COUNTER
LDN 3
STD TN+2 SET SECONDARY TIMEOUT COUNTER
LDD IA
CWD IR
LDO1 SOD TN+1
NJN LDO1.1 IF TIME NOT UP YET
SOD TN+2
ZJN LDO2 IF TIME UP
LCN 0
STD TN+1 RESET PRIMARY TIMEOUT COUNTER
LDO1.1 LDC 160
LDOA EQU *-2
SBN 1
NJN *-1
LDD IA READ RESPONSE
CRD CM
LDD CM+2
NJN LDO1 IF RECEIVE NOT READY
* TRANSMIT OVERLAY.
LDD TN
SHN -6
NJN LDO3 IF CM TRANSFER DESIRED
LDM BUF+4 FORM PP WORD COUNT
SHN 2
ADM BUF+4
IJM *,CH WAIT FOR ACTIVE CHANNEL
OAM BUF,CH OUTPUT OVERLAY
FJM *,CH
DCN CH+40
DPP MONITOR DPPM DROP PP
LJM PPR EXIT TO PP RESIDENT
* CLEAR READY TO SEND FLAG AND CHANGE THIRD CHARACTER OF NAME
* SO THAT THE RECEIVING PPU FIGURES OUT *1DL* IS GOING TO DROP.
LDO2 LDN 0
STD IR+2
LDD IR+1 CHANGE NAME
LPN 77
STD IR+1
LDD IA
CWD IR
LCN 0 DELAY
SBN 1
NJN *-1
UJN DPP
LDO3 LDC 4000+WT INITIALIZE TRANSFER COUNT
STD CW+4
LDD TN SAVE MESSAGE BUFFER ADDRESS
ADN 1
STD TN+1
LDM BUF+4 SET WORD COUNT
STD TN+2
LDN WT SET WORDS PER TRANSFER
STD TN+3
LDO4 LDD TN+2 CHECK LAST BLOCK
SBD TN+3
PJN LDO5 IF MORE THAN WT WORDS LEFT
RAD CW+4 UPDATE WORD COUNT IN BLOCK
LPN 77
ZJN LDO8 IF END OF BUFFER / DATA
LDO5 LDN 77 DELAY
SBN 1
NJN *-1
LDD TN
CRD CM
LDD CM+4
NJN LDO5 IF NOT READY TO SEND
LDD TN+1
CWM BUF,TN+3 TRANSFER BLOCK
LDOB EQU *-1
SBN WT+1
CWD CW SET DATA READY
LDN WT*5 UPDATE BLOCK ADDRESS
RAM LDOB
LDD CW+4
LPN 77
NJN LDO7 IF NOT END OF TRANSFER
LDO6 LJM DPP
LDO7 LCN WT
RAD TN+2
PJN LDO4 IF STILL MORE WORDS TO TRANSFER
LDO8 LDD BO
NJN LDO9 IF BUFFER OVERFLOW
LDC 4000 SET NULL TRANSFER
STD CW+4
UJN LDO5
LDO9 STM BUF+4 SET REMAINING WORD COUNT
LDN 0 CLEAR BUFFER OVERFLOW
STD BO
PSN
* UJN LDO10 (CM RESIDENT OVERLAY)
LDOC EQU *-1
SETMS READSYS
LDC BUF+5
STM LDOB
SBN 2 (BUF+3)
STD CN PPU ADDRESS
LDO10 LDN MXPC
STD CN+4
RJM SFO GET THE REST OF THE OVERLAY
LJM LDO0.2 RESYNCHRONIZE THE TRANSFER
SFO SPACE 4,15
** SFO - SEARCH FOR OVERLAY.
*
* ENTRY (A) = 0 IF INITIAL ENTRY.
* (A) .NE. 0 IF CONTINUATION ENTRY.
* (T4 - T7) = MASS STORAGE PARAMETERS IF CONTINUATION
* ENTRY AND NOT CM RESIDENT OVERLAY.
*
* EXIT (A) = 0 IF NOT FOUND.
* (BUF - BUF+N) = OVERLAY FOUND.
* (T4 - T7) = MASS STORAGE PARAMETERS IF INITIAL ENTRY
* AND NOT CM RESIDENT OVERLAY.
*
* USES BO, CN - CN+4, T4 - T7.
*
* CALLS SPL, RNS.
*
* MACROS ENDMS, SETMS.
SFO9 LDI CN
STD CN+1
LDM 1,CN
STD CN+2
LDD CN READ NEXT SECTOR
RJM RNS
SFO10 LDD CN+1 RESTORE 2 BYTES
STI CN
LDD CN+2
STM 1,CN
LDC 500 ADVANCE SECTOR ADDRESS
RAD CN
LDD T1 CHECK WORD COUNT
SHN -6
ZJN SFO12 IF EOR
SOD CN+4
SFO11 NJN SFO9 IF MORE SECTORS WILL FIT INTO BUFFER
LDM BUF+4
ADC -100*MXPC
ZJN SFO12 IF NEXT SECTOR EOR
STD BO WORDS LEFT OVER
LDC MXPC*100 SET MAXIMUM WORD COUNT
STM BUF+4
SFO12 ENDMS
SFO13 LDN 1 INDICATE OVERLAY FOUND
SFO SUBR ENTRY/EXIT
NJN SFO11 IF NOT FIRST ENTRY
* NJN SFO3 IF NOT FIRST ENTRY (CM RESIDENT OVERLAY)
SFOA EQU *-1
* SEARCH PLD FOR FIRST OVERLAY OF GROUP.
SFO1 RJM SPL SEARCH PLD
ZJN SFOX IF OVERLAY NOT FOUND
MJP SFO6 IF FOUND IN *RPL*
SETMS READSYS
SFO2 LDD CN READ NEXT SECTOR
RJM RNS
NJN SFO5 IF NOT EMPTY SECTOR
ENDMS
* LDN 0 RETURN WITH (A) = 0
UJN SFOX
SFO3 LDC BUF RESET TRANSFER ADDRESS
STM LDOB
LDM BUF+4
UJN SFO7 READ REST OF OVERLAY
SFO4 LDD T1 CHECK SECTOR WORD COUNT
SHN -6
ZJN SFO2 IF SHORT SECTOR
LDD CN READ NEXT SECTOR
RJM RNS
UJN SFO4 LOOP
* CHECK OVERLAY NAME.
SFO5 LDM 2,CN
SHN 6
LMD IR+4
SHN 6
LMM 3,CN
LMD IR+3
NJN SFO4 IF NO MATCH
LDN MXPC SET MAXIMUM SECTOR COUNT
STD CN+4
LJM SFO10 READ OVERLAY
* READ CM RESIDENT OVERLAY.
SFO6 LDD T4+3
SFO7 STD T4
SBK MXPC*100
MJN SFO8 IF OVERLAY FITS IN BUFFER
STD BO SAVE REMAINDER
LDC MXPC*100
STD T4
SFO8 LDD T4+1
LPN 77
SHN 14
LMD T4+2
CRM BUF,T4 READ IN OVERLAY
ISTORE LDOC,(UJN LDO10)
ISTORE SFOA,(NJN SFO3)
LDD T4 SET TRANSFER SIZE
STM BUF+4
RAD T4+2 UPDATE READ ADDRESS
SHN -14
RAD T4+1
UJP SFO13 SET OVERLAY FOUND
MSR SPACE 4,10
** MSR - MASS STORAGE ERROR PROCESSOR FOR *COMPRNS*.
*
* LOOP TRYING TO READ THE SECTOR UNTIL NO ERROR IS ENCOUNTERED.
* THE DRIVER WILL AUTOMATICALLY SWITCH TO DIFFERENT SYSTEM
* DEVICES.
MSR1 SOM MSRA
ZJP DPP IF RETRY LIMIT EXHAUSTED
MSR2 LDD CN RETRY THE READ
RJM RDS
MJN MSR1 IF ERROR
MSR SUBR ENTRY/EXIT
SFA EST,T5
ADK EQDE
CRD CM READ EST ENTRY
LDD CM
SHN 21-12
MJN MSR2 IF ERROR ON SYSTEM DEVICE
* CALL *7SE* TO REMOVE THE ASR ENTRY FOR THE OVERLAY.
LDN IR+3 SET *7SE* CALL PARAMETERS
STD T8
EXECUTE 7SE,BUF
LJM SFO1 RETRY
MSRA CON 10D ERROR RETRY LIMIT
SPACE 4,10
* COMMON DECKS.
*CALL COMPRNS
SPL SPACE 4,15
** SPL - SEARCH PERIPHERAL LIBRARY DIRECTORY.
*
* ENTRY (IR+3 - IR+4) = OVERLAY NAME.
*
* EXIT (A) = 0 IF NEITHER THE OVERLAY NOR FIRST OVERLAY OF
* GROUP FOUND.
* (A) .GT. 0 IF OVERLAY OR FIRST OVERLAY OF GROUP FOUND.
* (A) .LT. 0 IF OVERLAY FOUND IN *RPL*.
* (T4 - T7) = MASS STORAGE PARAMETERS.
* (CN) = BUFFER ADDRESS.
* (BO) = 0 IF OVERLAY FOUND.
*
* USES BO, CN, OV, CM - CM+4, T4 - T7.
*
* MACROS MONITOR, SFA.
SPL3 STD BO CLEAR BUFFER OVERFLOW
LDC BUF-2 SET BUFFER ADDRESS
STD CN
SPL SUBR ENTRY/EXIT
LDD IA MOVE OVERLAY NAME TO MONITOR CALL
CRD CM+3-4
MONITOR SPLM REQUEST LIBRARY SEARCH
LDD OA SET LOAD PARAMETERS
CRD T4
LDD CM+1
SCN 77
ZJN SPL3 IF MASS STORAGE RESIDENT
SHN -7
NJN SPL1.2 IF NOT IN *RPL*
STD BO CLEAR BUFFER OVERFLOW
LDD T4+4 CHECK FOR DUMMY *SFP* ENTRY
ADD T4+3
ZJN SPLX IF OVERLAY NOT FOUND
LCN 1
SPL1.1 UJN SPLX SET FOUND IN *RPL*
SPL1 SHN -7
ZJN SPLX IF IN *RPL*
SPL1.2 SHN -1
NJN SPL1 IF 16 BIT OVERLAY
LDD IR+3
LMN 1R9
NJN SPL1 IF NOT CALL FOR DISPLAY OVERLAY
LDD IR+4 PRESET FIRST OVERLAY IN GROUP
SCN 77
* LMN 1RA-1
STD OV
SPL2 AOD OV ADVANCE FIRST OVERLAY IN GROUP
STD CM+3
LMD IR+4
ZJN SPL1.1 IF REQUESTED OVERLAY INACCESSIBLE
LDN 1R9 SET NAME IN MONITOR CALL
STD CM+2
MONITOR SPLM REQUEST LIBRARY SEARCH
LDD OA SET LOAD PARAMETERS
CRD T4
LDD CM+1
SCN 77
NJN SPL2 IF NOT MASS STORAGE RESIDENT
SFA EST,T5
ADK EQDE
CRD CM
LDD CM
SHN 21-12
PJN SPL2 IF NOT SYSTEM DEVICE
LDN 0
LJM SPL3 RETURN
SPACE 4,10
** BUFFER.
BUF EQU *+2
BUFL EQU EPFW-BUF BUFFER LENGTH
MXPC EQU BUFL/500 MAXIMUM PRU COUNT
PRS SPACE 4,10
** PRS - PRESET PROGRAM.
*
* USES T1, T2, CM - CM+4.
*
* MACROS SFA.
PRS1 RAI T2 MODIFY CHANNEL INSTRUCTION
AOD T1 ADVANCE TABLE ADDRESS
PRS2 LDI T1 SET NEXT INSTRUCTION
STD T2
LDD IR+2 CHECK CHANNEL
CHTL *
SBN CH
NJN PRS1 LOOP FOR ALL CHANNEL INSTRUCTIONS
PRS SUBR ENTRY/EXIT
LDN DSEQ
SFA EST FETCH EST ENTRY FOR DISPLAY
ADK EQAE
CRD CM
LDD CM+2 SET TIMEOUT DELAY
RAM LDOA
LDN ZERL CLEAR CONTROL WORD
CRD CW
LDD IR+2 CHECK CHANNEL
SHN -6
NJN PRSX IF CM TRANSFER SELECTED
LDC TCHS SET CHANNEL TABLE
STD T1
UJN PRS2 ENTER LOOP
TCHS SPACE 4
** TCHS - CHANNEL TABLE.
TCHS CHTB
SPACE 4
END