IDENT 6DX,MSFW
PERIPH
BASE MIXED
SST
TITLE 6DX - UEM DRIVER.
*COMMENT 6DX - UEM DRIVER.
COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
SPACE 4,10
***** 6DX - UEM DRIVER.
* C. B. LOSCHEIDER. 81/03/04.
SPACE 4,10
*** 6DX PROVIDES THE CAPABILITY TO ACCESS UEM.
SPACE 4,10
*** ORGANIZATION OF UEM.
* UEM IS TREATED AS A SINGLE DEVICE.
*
* EQUIPMENT TYPE IS *DE*.
*
* SECTORS/TRACK = SLDE (20B, 40B, 100B, OR 200B).
*
* WORDS/TRACK = 101B*SLDE.
SPACE 4,10
** ENTRY CONDITIONS.
*
*
* (T5) = EST ORDINAL.
* (T6) = TRACK.
* (T7) = SECTOR.
SPACE 4,10
*CALL COMPMAC
*CALL COMSDFS
*CALL COMSMSP
*CALL COMSPIM
SPACE 4,10
* ASSEMBLY CONSTANTS.
DEC MICRO 1,, 6DX DECK NAME
EJECT
** ENTRY POINT TRANSFERS.
ORG MSFW
CON PRS PRESET ADDRESS
RDS CON 0 ENTRY
UJN RDS. ENTER DRIVER
WDS CON 0 ENTRY
UJN WDS. ENTER DRIVER
EMS SPACE 4,10
** EMS - END MASS STORAGE OPERATION.
*
* EXIT (A) = 0.
* (UEMG) = EM SHIFT FOR CALCULATING HEADER ADDRESS.
* (UEMH) = EM SHIFT FOR CALCULATING EM ADDRESS.
.EMS SUBR ENTRY/EXIT
LDN 0
STM CHRV
UJN .EMSX RETURN
RDS SPACE 4,10
** RDS - READ SECTOR.
*
* ENTRY (A) = BUFFER ADDRESS FOR SECTOR.
*
* EXIT (A) = 0 IF TRANSFER COMPLETE.
* = ERROR CODE IF ERROR OCCURRED.
*
* CALLS UEM.
RDS. LPC 7777
UJN UEM SET BUFFER ADDRESSES
WDS SPACE 4,10
** WDS - WRITE SECTOR.
*
* ENTRY (A) = BUFFER ADDRESS FOR SECTOR.
*
* EXIT (A) = 0 IF TRANSFER COMPLETE.
* = ERROR CODE IF ERROR OCCURRED.
*
* CALLS UEM.
WDS. LPC 7777
LMC 1S15
* UJN UEM SET BUFFER ADDRESSES
UEM SPACE 4,15
** UEM - UEM TRANSFER.
*
* ENTRY (A) = 3/ O,3/,12/ BUFFER ADDRESS.
* O = 0 FOR READ REQUEST.
* = 1 FOR WRITE REQUEST.
* (UEMG) = EM SHIFT FOR CALCULATING HEADER ADDRESS.
* (UEMH) = EM SHIFT FOR CALCULATING EM ADDRESS.
*
* EXIT (A) .LT. 0, IF UNRECOVERED ERROR.
*
* MACROS MSERR.
UEM STM UEMD SET BUFFER ADDRESS FOR HEADER
ADN 2
STM UEME
SHN -17 SAVE READ/WRITE FLAG FOR *7DX*
STI D1
SHN 1 SET RETURN INDEX
STD CM
ERRNZ RDS+2-WDS CODE DEPENDS ON VALUE
SHN 7-1 SET READ / WRITE INSTRUCTIONS
LMC CRMI+ON
STM UEMD-1
LMN HN&ON
STM UEME-1
LDM RDS,CM SET RETURN ADDRESS
STM UEMF
LDC ** LARGEST TRACK VALUE
UEMA EQU *-1
SBD T6
MJN UEM1 IF TRACK TOO LARGE
LDD T7
SBM SLM
MJN UEM2 IF SECTOR OKAY
* INVALID MASS STORAGE ADDRESS.
UEM1 LDN ADDE SET ADDRESS ERROR
STM ERRA
MSERR 7DX CALL *7DX* ERROR PROCESSOR
* VALID MASS STORAGE ADDRESS.
UEM2 LDD T6 HEADER ADDRESS = TRACK*101B*SLDE+SECTOR
LPC 3777
SHN 1
STD CM+1
SHN 6
RAD CM+1
SHN -14
UEMG SHN 4-1
* SHN 4-1+EMTS (EMTS = TRACK SHIFT)
STD CM
LDD CM+1
UEMH SHN 4-1
* SHN 4-1+EMTS (EMTS = TRACK SHIFT)
LMD T7 ADD SECTOR NUMBER
STD CM+1
SHN -14
RAD CM
LDC 0 CM ADDR = HEADER ADDR + UEM BASE ADDR
UEMB EQU *-1
RAD CM+1
SHN -14
ADC 0
UEMC EQU *-1
RAD CM
SRD CM+2 SAVE R-REGISTER
LDD CM+1 PUT UPPER 18 ADDR BITS IN R-REGISTER
SCN 77
SHN 6
LMD CM
SHN 6
STD T2
SHN -14
STD T1
LRD T1
LDD CM+1 PUT LOWER 6 ADDR BITS IN A-REGISTER
LPN 77
STD CM+1
LMC 400000
CRM *,ON READ/WRITE HEADER
UEMD EQU *-1
LDD T7 DATA ADDRESS = HEADER + SLDE +77 * SECTOR
SHN 6
SBD T7
ADM SLM
ADD CM+1
LMC 400000
CRM *,HN READ/WRITE DATA
UEME EQU *-1
LRD CM+2 RESTORE R-REGISTER
LDN 0 INDICATE NO ERRORS
STM CHRV
UEM3 LJM * RETURN
UEMF EQU *-1
PRS SPACE 4,10
** PRS - PRESET.
*
* ENTRY (CM - CM+4) = EST ENTRY.
PRS LDK MEFL SET EM SHIFT
CRM PRSA,ON
LDM PRSA+2
SHN -5
LPN 3
ADC SHNI+4-1
STM UEMG UPDATE SHIFT INSTRUCTIONS
STM UEMH
LDC UEML GET UEM BASE ADDRESS
CRM PRSA,ON
LDM PRSA
SHN 21-2
STM UEMC
SHN 13-21
SCN 77
STM UEMB
LDD CM+4 SET LARGEST TRACK
SHN 3
ADK TDGL
CRM PRSA,ON
SOM PRSA
ADC 4000
STM UEMA
LJM SMSX RETURN
PRSA BSS 0 FIVE BYTES FOR READING LARGEST TRACK
.1 SET *+5+4-MSFW CHECK FOR OVERFLOW
.1 SET .1/5
.1 SET MSFW+.1*5
.2 SET PPFW-5-*-5 BYTES AVAILABLE BEFORE OVERFLOW
ERRNG PPFW-5-.1 DRIVER OVERFLOWS INTO *PPFW*-5
7DX MSOVL 7702,T2,EPFW-1,(UEM ERROR PROCESSOR.)
SPACE 4,10
***** 7DX - UEM ERROR PROCESSOR.
* C. B. LOSCHEIDER. 81/03/04.
SPACE 4,10
*** *7DX* IS CALLED WHEN AN UNRECOVERABLE UEM ABORT
* HAS OCCURRED. THE ONLY ERROR WHICH MAY OCCUR
* IS AN ADDRESSING ERROR.
SPACE 4,10
QUAL
BEGIN BSSN PRS
ERRA BSSN 1 ERROR FLAG WORD
ERRNG DEFW-* *7DX*/COMMON ERROR PROCESSOR CONFLICT
END BSSN
QUAL *
MSE SPACE 4,25
** MSE - MASS STORAGE ERROR PROCESSOR.
*
* ENTRY ((D1)) = 0 IF READ, 1 IF WRITE.
* (UEMD) = PP BUFFER ADDRESS OF HEADER.
* (ERRA) = ERROR CODE AS DEFINED IN *COMSMSP*.
* (T1) = UEMD.
* (T2) = ERRA.
* (T5) = EQUIPMENT.
* (T6) = LOGICAL TRACK.
* (T7) = LOGICAL SECTOR.
*
* EXIT (T2) = READ BUFFER ADDRESS FOR *7EK*.
* (DEDT) = 8/0, 4/*6DX* DRIVER TYPE.
* (DEEC) = ERROR CODE.
* (DENR) = 0.
* (DERC) = 0.
* (DERW) = 1 IF WRITE REQUEST, 0 IF READ REQUEST.
* (DEST) = 0.
* (DEWR) = 0.
* (RDCT) = 5/0, 1/1, 6/0.
* (MB+2) = DRIVER DEPENDENT PART OF BML MESSAGE.
* 24/0, 12/W, 24/A.
* W = WORD COUNT.
* A = EXTENDED MEMORY ERROR ADDRESS.
*
* USES T2, CM - CM+4.
*
* MACROS MSERR.
DDX ENTRY *7DX* ENTRY
LDI D1 SET READ/WRITE FLAG
STM DERW
LDK /COMSDFS/D6DX SAVE DRIVER TYPE
STM DEDT
LDD HN SET RECOVERY IN PROGRESS FLAG
STM RDCT
LDI T2 SET ERROR CODE
STM DEEC
LDK MEFL
CRD CM
LDD CM+2
SHN -5
LPN 3
RAM DDXA
LDD T6 HEADER ADDRESS = TRACK*101B*SLDE+SECTOR
LPC 3777
DDXA SHN 4
* SHN 4+EMTS (EMTS = TRACK SHIFT)
STD CM+4
SHN -6
STD CM+3
SHN -6
RAD CM+3
LDD CM+4
LPN 77
SHN 6
ADD T7
RAD CM+4
SHN -14
RAD CM+3
LDN 1 SAVE WORD COUNT FOR BML MESSAGE
STD CM+2
LDN 0 CLEAR UNUSED FIELDS IN BML MESSAGE
STD CM+1
STD CM
STM DENR INITIALIZE *NON-RECOVERABLE ERROR* FLAG
STM DERC INITIALIZE RETRY COUNT
STM DEST INITIALIZE ERROR PROCESSING CONTROL WORD
ERRNZ RTC.AD *7DX* ASSUMES NO RETRY WILL BE ATTEMPTED
STM DEWR INITIALIZE *DATA WRITTEN/READ* FLAG
LDI T1 SET ADDRESS OF BUFFER HEADER
STD T2
LDD MA SAVE DEPENDENT PART OF BML MESSAGE
ADN 2
CWD CM
MSERR 7EK EXECUTE *7EK*
ERRNG 10000-* *7DX* HAS OVERFLOWED
BSS 10000-* SPARES (ADJUST ORIGIN BY 5 AS REQUIRED)
CON DDX-1 (T0) = ENTRY ADDRESS - 1
CON UEMD (T1) = BUFFER HEADER ADDRESS
CON ERRA (T2) = ADDRESS OF WORD CONTAINING
ERROR FLAG
ERRNZ LN-* ILLEGAL PROGRAM LENGTH
QUAL *
END