Google
 

Trailing-Edge - PDP-10 Archives - AP-4178E-RM - swskit-sources/dbdrv.lis
There are no other files named dbdrv.lis in the archive.
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 1


      1						.TITLE	DBDRV -- RP04 DRIVER
      2						.IDENT	/010040/
      3						.LIST	MEB
      4					;
      5					;
      6					;
      7					;                             COPYRIGHT (C) 1974, 1978 BY
      8					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      9					;
     10					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     11					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     12					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     13					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     14					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     15					;
     16					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     17					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     18					;       CORPORATION.
     19					;
     20					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     21					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     22					;
     23					;
     24					;
     25					;
     26					;		AUTHOR:   D. N. CUTLER
     27					;		DATE:     2-JUL-74
     28					;		VERSION:  10-04
     29					;
     30					;
     31					;
     32					; MODIFICATIONS:
     33					;
     34					;	NO.		DATE		PROGRAMMER
     35					;	---		----		----------
     36					;	001		17-JUN-75	R. MCLEAN
     37					;	002		19-JUL-76	J. MASSE
     38					;	003		28-MAR-77	A. PECKHAM	FIX POWER FAIL RECOVERY
     39					;	004		27-JUL-77	R. BELANGER	ADD 18-BIT ECC CORRECTION
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 2


     41					;
     42					; CONDITIONAL ASSEMBLY SWITCH DEFINITIONS
     43					;
     44
     45		000001 			$DIRAC	=1
     46
     47					;R$$JPO	=1			;IF DEFINED, INCLUDE TRACK OFFSETTING
     48
     49		000001 			R$$E18 =1			; +++004 IF DEFINED, INCLUDE 18-BIT ECC CORRECTION
     50
     51					;R$$E16 =1			; +++004 IF DEFINED, INCLUDE 16-BIT ECC CORRECTION
     52
     53					;
     54					; MACRO LIBRARY CALLS
     55					;
     56
     57						.MCALL	WTSE$,CLEF$,MRKT$,QIOW$,DIR$,CALL,RETURN,.STKM,QIOSY$,WSIG$S
     58
     59	000000					QIOSY$
     60
     61
     62
     63					; DEVICE REGISTER AND STATUS BIT DEFINITIONS
     64
     65
     66		176700 			RPEXP=176700			;RPCS1 EXTERNAL PAGE ADDRESS
     67
     68
     69
     70		000000 			RPCS1=0				;CONTROL STATUS REGISTER 1
     71
     72		040000 			TRE=40000			;TRANSFER ERROR
     73		020000 			MCPE=20000			;MASSBUS CONTROL PARITY ERROR
     74		004000 			DVA=4000			;DRIVE AVAILABLE
     75
     76
     77
     78		000002 			RPWC=2				;WORD COUNT REGISTER
     79
     80		000004 			RPBA=4				;BUFFER ADDRESS REGISTER
     81
     82		000006 			RPDA=6				;DESIRED TRACK/SECTOR REGISTER
     83
     84
     85
     86		000010 			RPCS2=10			;CONTROL STATUS REGISTER 2
     87
     88		100000 			DLT=100000			;DATA LATE ERROR
     89		040000 			WCE=40000			;WRITE CHECK ERROR
     90		020000 			UPE=20000			;UNIBUS PARITY ERROR
     91		010000 			NED=10000			;NONEXISTENT DISK ERROR
     92		004000 			NEM=4000			;NONEXISTENT MEMORY ERROR
     93		002000 			PGE=2000			;PROGRAMMING ERROR
     94		001000 			MXF=1000			;MISSED TRANSFER ERROR
     95		000400 			MDPE=400			;MASSBUS DATA PARITY ERROR
     96
     97
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 2-1


     98
     99		000012 			RPDS=12				;DRIVE STATUS REGISTER
    100
    101		040000 			ERR=40000			;ERROR SUMMARY BIT
    102		010000 			MOL=10000			;MEDIUM ONLINE
    103		004000 			WRL=4000			;WRITE LOCKED DRIVE
    104		001000 			PGM=1000			;PROGRAM MODE
    105		000200 			DRY=200				;DRIVE READY
    106		000100 			VV=100				;VOLUME VALID
    107
    108
    109
    110		000014 			RPER1=14			;ERROR SUMMARY REGISTER
    111
    112		100000 			DCK=100000			;DATA CHECK ERROR
    113		040000 			UNS=40000			;DRIVE UNSAFE
    114		020000 			OPI=20000			;OPERATION INCOMPLETE
    115		010000 			DTE=10000			;DRIVE TIMING ERROR
    116		004000 			WLE=4000			;WRITE LOCK ERROR
    117		002000 			IAE=2000			;INVALID DISK ADDRESS
    118		001000 			AOE=1000			;ADDRESS OVERFLOW
    119		000400 			HCRC=400			;HEADER CRC ERROR
    120		000200 			HCE=200				;HEADER COMPARE ERROR
    121		000100 			ECH=100				;ECC HARD ERROR
    122		000040 			WCF=40				;WRITE CLOCK FAILURE
    123		000020 			FER=20				;FORMAT ERROR
    124		000010 			CPE=10				;CONTROL BUS PARITY ERROR
    125		000004 			RMR=4				;REGISTER MODIFY REFUSED
    126		000002 			ILR=2				;ILLEGAL REGISTER
    127		000001 			ILF=1				;ILLEGAL FUNCTION
    128
    129
    130
    131		000016 			RPAS=16				;ATTENTION SUMMARY REGISTER
    132
    133		000020 			RPLA=20				;LOOKAHEAD REGISTER
    134
    135		000022 			RPDBR=22			;DATA BUFFER REGISTER
    136
    137		000024 			RPMR=24				;MAINTENENCE REGISTER
    138
    139		000026 			RPDT=26				;DRIVE TYPE REGISTER
    140
    141		000030 			RPSN=30				;DRIVE SERIAL NUMBER
    142
    143
    144		000032 			RPOF=32				;DRIVE OFFSET REGISTER
    145
    146		010000 			FMT22=10000			;FORMAT (1=16 BIT)
    147		004000 			ECI=4000			;ECC INHIBIT
    148		002000 			HCI=2000			;HEADER COMPARE INHIBIT
    149
    150
    151		000034 			RPDC=34				;DESIRED CYLINDER NUMBER
    152
    153		000044 			RPEC1=44			;ECC POSITION REGISTER
    154
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 2-2


    155		000046 			RPEC2=46			;ECC PATTERN REGISTER
    156
    157					;
    158					; ERROR RETRY COUNT
    159					;
    160
    161		000010 			RETRY=8.			;CONTROLLER ERROR RETRY COUNT
    162
    163
    164					; LOCAL DATA
    165					;
    166					;
    167
    168	000000				RPHD::	.STKM	0,0,0,0,0,0,0,DBINI,174000,RPSTK
	000046	000000 	000000 	000000 		.WORD	0,0,0,0
	000054	000000
	000074	174000 	000440'	000260'		.WORD	174000,DBINI,RPSTK
	000130	000005 				.WORD	5
	000132	000000G				.WORD	TTPEN
	000134	000000 				.WORD	0
	000136	000000 				.WORD	0
	000140	000000 				.WORD	0
	000142	000000 				.WORD	0
	000144	000000 				.WORD	0
	000146	000000 				.WORD	0
	000150	000000 				.WORD	0
	000152	000000 				.WORD	0
	000154	000000 				.WORD	0
	000156	000000 				.WORD	0
	000260	000000 				.WORD	0
	000262	000000 				.WORD	0
	000264	000000 				.WORD	0
	000266	000000 				.WORD	0
	000270	000000 				.WORD	0
	000272	000000 				.WORD	0
	000274	000440'				.WORD	DBINI
	000276	174000 				.WORD	174000
    169
    170	000300				WFIOD:	WTSE$	E.IOD
	000300	   051 	   002 			.BYTE	41.,2
	000302	000000G				.WORD	E.IOD
    171
    172	000304				CLIOD:	CLEF$	E.IOD		;CLEAR I/O DONE FLAG
	000304	   037 	   002 			.BYTE	31.,2
	000306	000000G				.WORD	E.IOD
    173
    174	000310				RPWLO:	WTSE$	E.NIR		;WAIT FOR QIO
	000310	   051 	   002 			.BYTE	41.,2
	000312	000000G				.WORD	E.NIR
    175
    176	000314				MKDNR::	MRKT$	1,74.*10,0,0	;WAIT FOR FIX
	000314	   027 	   005 			.BYTE	23.,5
	000316	000001 				.WORD	1
	000320	001120 				.WORD	74.*10
	000322	000000 				.WORD	0
	000324	000000 				.WORD	0
    177
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 2-3


    178	000326				WFDNR::	WTSE$	1		;WAIT
	000326	   051 	   002 			.BYTE	41.,2
	000330	000001 				.WORD	1
    179
    180	000332				MSGDPB:	QIOW$	IO.WVB,1,1,1,0,0,<,MSGSIZ>
	000332	   003 	   010 			.BYTE	3,$$$ARG
	000334	011000 				.WORD	IO.WVB
	000336	000001 				.WORD	1
	000340	   001 	   001 			.BYTE	1,1
	000342	000000 				.WORD	0
	000344	000000 				.WORD	0
	000346	000000 				.WORD
	000350	000016 				.WORD	MSGSIZ
    181
    182	000352	   015 	   012 	   104 	DNMSG:	.ASCII	<15><12>"DB NOT RDY"<15><12>
	000355	   102 	   040 	   116
	000360	   117 	   124 	   040
	000363	   122 	   104 	   131
	000366	   015 	   012
    183
    184	000370	   015 	   012 	   104 	DUNS:	.ASCII	<15><12>"DB UNSAFE "<15><12>
	000373	   102 	   040 	   125
	000376	   116 	   123 	   101
	000401	   106 	   105 	   040
	000404	   015 	   012
    185						.EVEN
    186
    187		000016 			MSGSIZ	=14.			;MESSAGE SIZE
    188
    189					;
    190					; CONTROLLER IMPURE DATA TABLES
    191					;
    192
    193	000406				RTTBL:	.BLKW	1		;RETRY COUNT FOR CURRENT OPERATION
    194	000410	000000 			RPRNA:	.WORD	0		;ADDRESS OF RNA
    195	000412	000000 	000000 		RPBUF:	.WORD	0,0		;BUFFER ADDRESS
    196	000416	000000 			RPCNT:	.WORD	0		;SIZE
    197	000420	000000 			RPUNIT:	.WORD	0		;CURRENTLY ONLY 0
    198	000422	000000 			RPCW2:	.WORD	0
    199
    200
    201						.IF DF	R$$JPO
    202
    203					OFFAD:	.BLKW	1		;ADDRESS OF CURRENT OFFSET VALUE
    204
    205					;
    206					; OFFSET POSITIONING VALUE TABLE
    207					;
    208
    209					OFFTB:	.WORD	0		;RETURN TO CENTERLINE
    210						.WORD	20		;+400
    211						.WORD	220		;-400
    212						.WORD	40		;+800
    213						.WORD	240		;-800
    214						.WORD	60		;+1200
    215						.WORD	260		;-1200
    216						.WORD	0		;RETURN TO CENTERLINE
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 2-4


    217
    218						.ENDC		; R$$JPO
    219
    220						.IF DF	R$$E18
    221
    222	000424				ECCWRD:
    223	000424	000000 	000000 	000000 		.WORD	0,0,0
    224	000432				ECCMSK:
    225	000432	000000 	000000 	000000 		.WORD	0,0,0
    226
    227						.ENDC		; R$$E18
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 3


    229					;
    230					;+
    231					; **-DBINI-RH11-RP04 DISK PACK CONTROLLER INITIATOR
    232					;
    233					; THIS ROUTINE IS ENTERED FROM THE QUEUE I/O DIRECTIVE WHEN AN I/O REQUEST
    234					; IS QUEUED AND AT THE END OF A PREVIOUS I/O OPERATION TO PROPAGATE THE EXECU-
    235					; TION OF THE DRIVER. IF THE SPECIFIED CONTROLLER IS NOT BUSY, THEN AN ATTEMPT
    236					; IS MADE TO DEQUEUE THE NEXT I/O REQUEST. ELSE A RETURN TO THE CALLER IS
    237					; EXECUTED. IF THE DEQUEUE ATTEMPT IS SUCCESSFUL, THEN THE NEXT I/O OPER-
    238					; ATION IS INITIATED. A RETURN TO THE CALLER IS THEN EXECUTED.
    239					;
    240					; INPUTS:
    241					;
    242					;
    243					; OUTPUTS:
    244					;
    245					;	IF THE SPECIFIED CONTROLLER IS NOT BUSY AND AN I/O REQUEST IS WAIT-
    246					;	ING TO BE PROCESSED, THEN THE REQUEST IS DEQUEUED AND THE I/O OPER-
    247					;	ATION IS INITIATED.
    248					;-
    249
    250						.ENABL	LSB
    251
    252	000440				DBINI:	DIR$	#RPWLO		;WAIT FOR SOMETHING TO DO
	000440	012746 	000310'			MOV	#RPWLO,-(SP)
	000444	104375 				EMT	375
    253	000446	012700 	041104 			MOV	#"DB,R0		;DQ THE REQUEST
    254	000452					CALL	..DQRN
	000452	004767 	000000G			JSR	PC,..DQRN
    255	000456	103770 				BCS	DBINI		;NOTHING GO BACK TO SLEEP
    256
    257						.IF	NDF,$DIRAC
    258
    259						CMPB	.RPUNT,R2	;CORRECT UNIT FOR FE?
    260						BNE	4$		;NO -- ALL OK TO USE THIS UNIT
    261						TST	.FEACT		;ACTIVE FE?
    262						BEQ	4$		;NO -- DO IT MYSELF
    263						BIT	#EF.PR1,.COMEF+2 ;PRIMARY PROTOCOL RUNNING?
    264						BNE	4$		;NO -- DO REQUEST HERE
    265						MOV	#FE0PUD+U.RF,R2 ;REQUEUE
    266						CALL	..IPRI
    267						BIS	#EF.NIR,FETSK+A.EF ;SET EVENT FLAG
    268						BR	DBINI		;TRY AGAIN
    269
    270						.ENDC		; $DIRAC
    271
    272	000460	010167 	177724 		4$:	MOV	R1,RPRNA	;SAVE THE REQUST NODE ADDRESS
    273	000464	010367 	177726 			MOV	R3,RPCNT	;SAVE THE TRANSFER SIZE
    274	000470	010267 	177724 			MOV	R2,RPUNIT	;SAVE UNIT NUMBER
    275	000474	010567 	177714 			MOV	R5,RPBUF+2	;SAVE THE XFER ADDRESS
    276	000500	006304 				ASL	R4		;SHIF TO CORRECT POSITION
    277	000502	006304 				ASL	R4
    278	000504	006304 				ASL	R4
    279	000506	006304 				ASL	R4
    280	000510	010467 	177676 			MOV	R4,RPBUF	;SAVE ADDRESS (HIGH ORDER)
    281	000514	052767 	000171 	177670 		BIS	#171,RPBUF	;ASSUME READ LOGICAL FUNCTION
    282	000522	122761 	000002 	000001G		CMPB	#IO.RLB/256.,R.FC+1(R1) ;READ LOGICAL FUNCTION?
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 3-1


    283	000530	001412 				BEQ	10$		;IF EQ YES
    284	000532	122761 	000001 	000001G		CMPB	#IO.WLB/256.,R.FC+1(R1)
    285	000540	001403 				BEQ	5$
    286	000542	012703 	177776 			MOV	#IE.IFC,R3
    287	000546	000553 				BR	46$
    288	000550				5$:
    289	000550	162767 	000010 	177634 		SUB	#10,RPBUF	;CONVERT TO WRITE LOGICAL FUNCTION
    290	000556	012767 	000010 	177622 	10$:	MOV	#RETRY,RTTBL	;SET RETRY COUNT
    291
    292						.IF DF	R$$JPO
    293
    294						CLRB	RPCW2+1		;CLEAR HEADER COMPARE INHIBIT
    295						CALL	210$		;SET INITIAL OFFSET RECOVERY VALUES
    296
    297						.ENDC		; R$$JPO
    298
    299	000564	005002 				CLR	R2
    300	000566	156102 	000006G			BISB	R.PB+6(R1),R2
    301	000572	016100 	000010G			MOV	R.PB+10(R1),R0
    302	000576	010103 				MOV	R1,R3		;SAVE NODE ADDRESS
    303	000600	012701 	000020 			MOV	#16.,R1
    304
    305	000604	006300 			20$:	ASL	R0
    306	000606	006102 				ROL	R2		;
    307	000610	020227 	000574 			CMP	R2,#19.*20.	;PARTIAL REMAINDER LARGER THAN DIVISOR?
    308	000614	103403 				BLO	30$		;IF LO NO
    309	000616	162702 	000574 			SUB	#19.*20.,R2
    310	000622	005200 				INC	R0
    311	000624	005301 			30$:	DEC	R1
    312	000626	003366 				BGT	20$		;IF GT YES
    313	000630	010063 	000006G			MOV	R0,R.PB+6(R3)
    314	000634	010200 				MOV	R2,R0		;SET DIVIDEND TO TRACK/SECTOR REMAINDER
    315	000636	012701 	000024 			MOV	#20.,R1		;SET DIVISOR TO NUMBER OF SECTORS/TRACK
    316	000642					CALL	$DIV		;CALCULATE TRACK AND SECTOR
	000642	004767 	000000G			JSR	PC,$DIV
    317	000646	000300 				SWAB	R0		;SWAP TRACK TO HIGH BYTE
    318	000650	050100 				BIS	R1,R0		;MERGE TRACK
    319	000652	010063 	000010G			MOV	R0,R.PB+10(R3)
    320
    321					;
    322					; INITIATE I/O OPERATION
    323					;
    324
    325	000656	012703 	176710 		40$:	MOV	#RPEXP+RPCS2,R3	;GET ADDRESS OF CSR
    326	000662	012713 	000040 			MOV	#40,@R3		;CLEAR RH11+CONTROLLER
    327	000666	116713 	177526 			MOVB	RPUNIT,@R3
    328	000672	012703 	176700 			MOV	#RPEXP,R3
    329	000676	012713 	000021 		41$:	MOV	#21,@R3		; +++003 EXECUTE PACK ACK FUNCTION TO SET VV
    330	000702	032737 	000340 	000000G		BIT	#340,@#PS	;IN INTERRUPT SERVICE?
    331	000710	001007 				BNE	42$		;LEAVE IT ALONE -- MUST HAVE PORT HERE
    332	000712	032713 	004000 			BIT	#DVA,@R3	;DRIVE AVAILABLE?
    333	000716	001004 				BNE	42$		;YES -- USE IT
    334	000720					WSIG$S			;NO -- BETTER WAIT FOR IT
	000720	012746 				MOV	(PC)+,-(SP)
	000722	   061 	   001 			.BYTE	49.,1
	000724	104375 				EMT	375
    335	000726	000763 				BR	41$		;MAKE ANOTHER TRY
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 3-2


    336
    337	000730				42$:
    338	000730	012713 	000023 			MOV	#23,@R3		;PACK ACK AGAIN
    339	000734	032713 	004000 			BIT	#DVA,@R3	;WATCH FOR TIMING AND MISSING DRIVE
    340	000740	001756 				BEQ	41$		; MISSED IT -- TRY AGAIN
    341	000742	016702 	177442 		43$:	MOV	RPRNA,R2	;GET ADDRESS OF I/O PACKET
    342	000746	012703 	176710 			MOV	#RPEXP+RPCS2,R3	;POINT TO SECOND CSR
    343	000752	116713 	177442 			MOVB	RPUNIT,@R3 	;SELECT PROPER DRIVE
    344	000756	016243 	000010G			MOV	R.PB+10(R2),-(R3) ;INSERT TRACK/SECTOR ADDRESS
    345	000762	016743 	177426 			MOV	RPBUF+2,-(R3) 	;INSERT BUFFER ADDRESS
    346	000766	016743 	177424 			MOV	RPCNT,-(R3)	;INSERT NUMBER OF BYTES TO TRANSFER
    347	000772	006013 				ROR	@R3		;CONVERT TO WORD COUNT
    348	000774	005413 				NEG	@R3		;MAKE NEGATIVE WORD COUNT
    349	000776	005743 				TST	-(R3)		;POINT TO BEGINNING
    350
    351						.IF DF R$$JPO
    352
    353						CLR	-(SP)		;GET FORMAT BIT
    354						TSTB	RPCW2+1		;INHIBIT HEADER COMPARE?
    355						BEQ	45$		;IF EQ NO
    356						BIS	#HCI,@SP	;SET HEADER COMPARE INHIBIT
    357					45$:	MOV	(SP)+,RPOF(R3)	;SET OFFSET REGISTER
    358
    359						.ENDC		; R$$JPO
    360
    361	001000	012700 	000375 			MOV	#IE.DNR&377,R0	;ASSUME DRIVE NOT READY
    362	001004	016301 	000012 			MOV	RPDS(R3),R1	;GET CURRENT DRIVE STATUS
    363	001010	005101 				COM	R1		;COMPLEMENT STATUS
    364	001012	032701 	010300 			BIT	#MOL!DRY!VV,R1	;DRIVE READY?
    365	001016	001035 				BNE	47$		;IF NE NO
    366	001020	032763 	040000 	000014 		BIT	#UNS,RPER1(R3)	;DRIVE UNSAFE?
    367	001026	001052 				BNE	49$		;IF NE YES
    368	001030	016263 	000006G	000034 		MOV	R.PB+6(R2),RPDC(R3) ;SET DESIRED CYLINDER ADDRESS
    369	001036	016713 	177350 			MOV	RPBUF,@R3	;START FUNCTION
    370	001042	032737 	000340 	000000G		BIT	#340,@#PS	;CHECK FOR RESTART FROM INTERRUPT SERVICE LEVEL
    371	001050	001132 				BNE	85$		;YES -- RETURN FROM INTERRUPT
    372	001052					DIR$	#WFIOD		;WAIT FOR I/O DONE
	001052	012746 	000300'			MOV	#WFIOD,-(SP)
	001056	104375 				EMT	375
    373	001060					DIR$	#CLIOD		;CLEAR I/O DONE FLAG
	001060	012746 	000304'			MOV	#CLIOD,-(SP)
	001064	104375 				EMT	375
    374	001066	016701 	177316 			MOV	RPRNA,R1	;FIND THE REQUEST NODE
    375	001072	016703 	177314 			MOV	RPBUF,R3	;FIND THE I/O STATUS
    376	001076	016704 	177312 		46$:	MOV	RPBUF+2,R4	;BOTH HALVES
    377	001102					CALL	..IODN		;FINISH I/O
	001102	004767 	000000G			JSR	PC,..IODN
    378	001106	000167 	177326 			JMP	DBINI		;WAIT FOR NEXT
    379
    380	001112	012767 	000352'	177226 	47$:	MOV	#DNMSG,MSGDPB+Q.IOPL  ;SET FOR NOT READY MESSAGE
    381
    382	001120	032737 	000340 	000000G	48$:	BIT	#340,@#PS	;CHECK FOR ENTRY FROM PRI
    383	001126	001060 				BNE	60$		;YES -- GO RE-TRY
    384	001130					DIR$	#MSGDPB		;COMPLAIN
	001130	012746 	000332'			MOV	#MSGDPB,-(SP)
	001134	104375 				EMT	375
    385	001136					DIR$	#MKDNR		;WAIT FOR FIX
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 3-3


	001136	012746 	000314'			MOV	#MKDNR,-(SP)
	001142	104375 				EMT	375
    386	001144					DIR$	#WFDNR		;WAIT
	001144	012746 	000326'			MOV	#WFDNR,-(SP)
	001150	104375 				EMT	375
    387	001152	000641 				BR	40$		;AND TRY AGAIN
    388
    389	001154	012767 	000370'	177164 	49$:	MOV	#DUNS,MSGDPB+Q.IOPL  ;SET FOR UNSAFE MESSAGE
    390	001162	000756 				BR	48$		;TYPE MESSAGE
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4


    392					;
    393					;+
    394					; **-.DBINT-RH11-RP04 DISK PACK CONTROLLER INTERRUPTS
    395					;-
    396					;
    397
    398	001164	010046 			.DBINT::MOV	R0,-(SP)	;SAVE REGISTERS
    399	001166	010146 				MOV	R1,-(SP)
    400	001170	010246 				MOV	R2,-(SP)
    401	001172	010346 				MOV	R3,-(SP)
    402	001174	012702 	176700 			MOV	#RPEXP,R2	;GET ADDRESS OF CSR
    403
    404						.IF DF	R$$JPO
    405
    406						BIT	#40,@R2		;OFFSET OR RTC FUNCTION?
    407						BEQ	55$		;IF EQ YES
    408
    409						.IFTF		; R$$JPO
    410
    411	001200	012700 	000001 			MOV	#IS.SUC&377,R0	;ASSUME SUCCESSFUL TRANSFER
    412	001204	032712 	060000 			BIT	#TRE!MCPE,@R2	;ANY ERRORS?
    413	001210	001432 				BEQ	70$		;IF EQ NO
    414	001212	012700 	000374 			MOV	#IE.VER&377,R0	;ASSUME UNRECOVERABLE ERROR
    415	001216	016201 	000014 			MOV	RPER1(R2),R1	;GET CONTENTS OF ERROR REGISTER
    416	001222	032701 	047007 			BIT	#UNS!WLE!IAE!AOE!RMR!ILR!ILF,R1	;HARD ERROR?
    417	001226	001004 				BNE	50$		;IF NE YES
    418	001230	032762 	014000 	000010 		BIT	#NED!NEM,RPCS2(R2) ;HARD ERROR?
    419	001236	001447 				BEQ	100$		;IF EQ NO
    420	001240	032701 	004000 		50$:	BIT	#WLE,R1		;WRITE LOCK ERROR?
    421	001244	001403 				BEQ	52$		;IF EQ NO
    422	001246	012700 	000364 			MOV	#IE.WLK&377,R0	;SET WRITE LOCK ERROR
    423	001252	000415 				BR	80$		;
    424
    425	001254	032701 	003000 		52$:	BIT	#IAE!AOE,R1	;CHECK FOR ILLEGAL CYL
    426	001260	001412 				BEQ	80$		;NO --  UNRECOVERABLE ERROR
    427	001262	012700 	000354 			MOV	#IE.BLK&377,R0	;SET ILLEGAL BLOCK
    428	001266	000407 				BR	80$		;AND RETURN
    429
    430						.IFT		; R$$JPO
    431
    432					55$:	MOV	#IE.VER&377,R0	;ASSUME UNRECOVERABLE ERROR
    433						CMP	#OFFTB+16,OFFAD ;FINAL OFFSET TRIED?
    434						BEQ	70$		;IF EQ YES - ALL DONE
    435						BIT	#TRE!MCPE,@R2	;ANY ERRORS?
    436						BEQ	82$		;IF EQ NO - RETRY ORIGINAL FUNCTION
    437					;	BR	60$		;
    438
    439						.IFTF		; R$$JPO
    440
    441					;
    442					; DEVICE TIMEOUT RESULTS IN THE CURRENT OPERATION BEING REPEATED. TIMEOUTS ARE
    443					; USUALLY CAUSED BY POWERFAILURE BUT MAY ALSO BE THE RESULT OF A HARDWARE FAILURE
    444					;
    445
    446	001270	105367 	177112 		60$:	DECB	RTTBL		;RETRY FUNCTION?
    447
    448						.IFT		; R$$JPO
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-1


    449
    450						BGT	95$		;IF GT YES
    451
    452						.IFF		; R$$JPO
    453
    454	001274	003026 				BGT	82$		;IF GT YES
    455
    456						.IFTF		; R$$JPO
    457
    458	001276	016701 	177106 		70$:	MOV	RPRNA,R1	;GET ADDRESS OF I/O PACKET
    459	001302	016101 	000002G			MOV	R.PB+2(R1),R1	;SET FINAL VALUE OF SECOND STATUS WORD
    460	001306				80$:				;REF LABEL
    461	001306	012712 	000013 			MOV	#13,@R2		;RELEASE DUAL PORT
    462	001312	010067 	177074 			MOV	R0,RPBUF	;SAVE THE STATUS
    463	001316	010167 	177072 			MOV	R1,RPBUF+2
    464	001322	052767 	000000G	000001C		BIS	#EF.IOD,RPTSK+A.EF	;SET I/O DONE
    465	001330	152767 	000000G	000000G		BISB	#EV.SE,.SERFG+0	;DECLARE  SIG EVENT
    466	001336	012603 			85$:	MOV	(SP)+,R3	;RESTORE REGISTERS
    467	001340	012602 				MOV	(SP)+,R2
    468	001342	012601 				MOV	(SP)+,R1
    469	001344	012600 				MOV	(SP)+,R0
    470	001346	000137 	000000G			JMP	@#..INTX	;RETURN FROM INTERRUPTS
    471
    472
    473	001352	000167 	177300 		82$:	JMP	40$
    474
    475						.IFT		; R$$JPO
    476
    477					95$:	JMP	170$		;RESET TO OFFSET ZERO
    478
    479						.IFTF		; R$$JPO
    480
    481	001356	032762 	163400 	000010 	100$:	BIT	#DLT!WCE!UPE!PGE!MXF!MDPE,RPCS2(R2) ;CONTROLLER ERROR?
    482	001364	001341 				BNE	60$		;IF NE YES
    483
    484						.IFT		; R$$JPO
    485
    486						BIT	#DTE!HCE!HCRC,R1 ;DRIVE TIMING OR HEADER ERROR?
    487						BNE	105$		;IF NE YES
    488
    489						.IFTF		; R$$JPO
    490
    491	001366	005701 				TST	R1		;DATA CHECK ERROR?
    492	001370	100337 				BPL	60$		;IF PL NO
    493
    494						.IFF		; R$$JPO
    495
    496	001372	032701 	000100 			BIT	#ECH,R1		;ECC HARD ERROR?
    497	001376	001334 				BNE	60$		;IF NE YES
    498
    499						.ENDC		; R$$JPO
    500
    501					;
    502					; START ECC CORRECTION PROCEDURE
    503					;
    504					; FIRST CALCULATE THE BYTE OFFSET TO THE START OF BLOCK TRANSFERED
    505					;
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-2


    506
    507	001400	016200 	000002 		105$:	MOV	RPWC(R2),R0	;GET NEGATIVE NUMBER OF WORDS REMAINING
    508	001404	006300 				ASL	R0		;CONVERT TO NEGATIVE BYTES REMAINING
    509	001406	066700 	177004 			ADD	RPCNT,R0	;CALCULATE NUMBER OF BYTES TRANSFERED
    510
    511						.IF DF	R$$JPO
    512
    513						MOV	R0,-(SP)	;SAVE NUMBER OF BYTES TRANSFERED
    514						BEQ	150$		;IF EQ NO BYTES TRANSFERED
    515						BIT	#HCE!HCRC,R1	;HEADER COMPARE OR CRC ERROR?
    516						BNE	107$		;IF NE YES
    517
    518						.ENDC		; R$$JPO
    519
    520	001412	005300 				DEC	R0		;CALCULATE OFFSET TO START OF BLOCK
    521	001414	042700 	000777 		107$:	BIC	#777,R0		;CLEAR RESIDUE
    522
    523						.IF DF	R$$JPO
    524
    525						BIT	#DTE!ECH!HCE!HCRC,R1 ;ECC HARD ERROR?
    526						BNE	150$		;IF NE YES
    527						CALL	210$		;RESET RECOVERY PARAMETERS
    528
    529						.ENDC		; R$$JPO
    530
    531						.IF DF,	R$$E18
    532
    533					;
    534					; 18-BIT ECC CORRECTION ROUTINES
    535					;
    536					; THE WORD IN ERROR AND THE WORD FOLLOWING IT ARE SET UP AS A TRIPLET
    537					; (TWO 18-BIT WORDS) AS IS THE ECC CORRECTION MASK FROM THE CONTROLLER.
    538					; THE MASK TRIPLET IS POSITIONED OVER THE DATA TRIPLET, CORRECTION IS
    539					; APPLIED, AND THE TWO DATA WORDS RETUNED TO THE BUFFER. THE CURRENT
    540					; OPERATION THEN PROCEEDS NORMALLY.
    541					;
    542	001420	016203 	000044 			MOV	RPEC1(R2),R3	; LOOK AT POSITION REGISTER
    543	001424	001730 				BEQ	80$		; INCORRIGIBLE IF .EQ. 0
    544	001426	010300 				MOV	R3,R0		; POSITION REGISTER TO R0
    545	001430	005300 				DEC	R0		; MINUS 1
    546	001432	012701 	000022 			MOV	#^D18,R1	; DIVIDE BY 18.
    547	001436					CALL	$DIV		; SO
	001436	004767 	000000G			JSR	PC,$DIV
    548					;
    549					; COMPUTE THE ADDRESS OF THE WORD IN ERROR
    550					;
    551					;	R0 -- WORD OFFSET IN TRANSFER
    552					;	R1 -- SHIFT COUNT FOR ECC MASK
    553					;	R2 -- BASE OF CONTROLLER REGISTERS
    554					;	R3 -- OFFSET INTO TRANSFER BUFFER
    555					;
    556	001442	006300 				ASL	R0		; CONVERT TO BYTE OFFSET
    557	001444	016703 	176744 			MOV	RPBUF+2,R3	; BUFFER ADDRESS TO R3
    558	001450	060003 				ADD	R0,R3		; POINT TO WORD IN ERROR
    559					;
    560					; CONSTRUCT THE CORRECTION MASK TRIPLET
    561					;
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-3


    562	001452	012700 	000440'			MOV	#ECCMSK+6,R0	; POINT TO THE MASK BUFFER
    563	001456	005040 				CLR	-(R0)		; CLEAR IT OUT
    564	001460	005040 				CLR	-(R0)		; SO
    565	001462	016240 	000046 			MOV	RPEC2(R2),-(R0)	; SET THE MASK WORD IN THE BUFFER
    566	001466					CALL	141$		; SHIFT IT INTO CORRECT POSITION
	001466	004767 	000124 			JSR	PC,141$
    567					;
    568					; CONSTRUCT THE ERROR DATA TRIPLET
    569					;
    570	001472	005723 				TST	(R3)+		; POINT TO THE SECOND ERROR WORD
    571	001474	012700 	000432'			MOV	#ECCWRD+6,R0	; POINT TO THE ECC WORD BUFFER
    572	001500	005040 				CLR	-(R0)		; CLEAR IT OUT
    573	001502	005040 				CLR	-(R0)		; SO
    574	001504	011340 				MOV	(R3),-(R0)	; SET SECOND ERROR WORD IN BUFFER
    575	001506	012701 	000022 			MOV	#^D18,R1	; SHIFT IT INTO THE HIGH 18. BITS
    576	001512					CALL	141$		; SO
	001512	004767 	000100 			JSR	PC,141$
    577	001516	014310 				MOV	-(R3),(R0)	; SET THE FIRST ERROR WORD IN THE BUFFER
    578	001520	012701 	000432'			MOV	#ECCMSK,R1	; POINT TO THE SHIFTED MASK
    579					;
    580					; APPLY CORRECTION TO EACH WORD IN THE DATA TRIPLET
    581					;
    582	001524					CALL	130$		; CORRECT BITS 00 THRU 16
	001524	004767 	000054 			JSR	PC,130$
    583	001530					CALL	130$		; CORRECT BITS 17 THRU 32
	001530	004767 	000050 			JSR	PC,130$
    584	001534					CALL	130$		; CORRECT BITS 33 THRU 36
	001534	004767 	000044 			JSR	PC,130$
    585					;
    586					; REPLACE THE ERROR WORDS WITH THOSE JUST CORRECTED
    587					;
    588	001540	162700 	000006 			SUB	#6,R0		; BACK THE POINTER UP
    589	001544	011023 				MOV	(R0),(R3)+	; SET FIRST CORRECTED WORD IN BUFFER
    590	001546	012701 	177756 			MOV	#-^D18,R1	; SHIFT COUNT TO R1
    591	001552					CALL	141$		; SHIFT SECOND CORRECTED WORD DOWN
	001552	004767 	000040 			JSR	PC,141$
    592	001556	011013 				MOV	(R0),(R3)	; SET SECOND CORRECTED WORD IN BUFFER
    593					;
    594					; CONTINUE OR TERMINATE PREVIOUS OPERATION
    595					;
    596
    597						.ENDC	; R$$E18
    598
    599						.IF DF	R$$E16
    600
    601					;
    602					; SECOND CALCULATE BYTE OFFSET IN BLOCK AND POSITION PATTERN SHIFT COUNT
    603					;
    604
    605						MOV	RPEC1(R2),R1	;GET STARTING BIT NUMBER
    606						DEC	R1		;CONVERT TO RELATIVE BIT NUMBER
    607						MOV	R1,-(SP)	;SAVE STARTING RELATIVE BIT NUMBER
    608						BIC	#^C<17>,R1	;ISOLATE SHIFT COUNT
    609						BIC	R1,(SP)		;CLEAR SHIFT COUNT IN RELATIVE BIT NUMBER
    610						CLC			;CALCULATE OFFSET TO FIRST BYTE IN BLOCK
    611						ROR	(SP)		;
    612						ASR	(SP)		;
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-4


    613						ASR	(SP)		;
    614						ADD	(SP),R0		;CALCULATE OFFSET TO FIRST BYTE IN TRANSFER
    615
    616					;
    617					;
    618					; THIRD SHIFT CORRECTION PATTERN INTO PLACE
    619					;
    620
    621						MOV	RPEC2(R2),R3	;GET CORRECTION PATTERN WORD
    622						CLR	@SP		;CLEAR SECOND WORD
    623					110$:	DEC	R1		;ANY MORE SHIFTS TO PERFORM?
    624						BLT	120$		;IF LT NO
    625						ASL	R3		;DOUBLE LEFT SHIFT
    626						ROL	@SP		;
    627						BR	110$		;
    628
    629					;
    630					; FOURTH APPLY FIRST CORRECTION
    631					;
    632
    633					120$:	CALL	130$		;APPLY ECC CORRECTION
    634
    635					;
    636					; FIFTH APPLY SECOND CORRECTION
    637					;
    638
    639						MOV	(SP)+,R3	;RETRIEVE SECOND PATTERN WORD
    640						ADD	#2,R0		;UPDATE OFFSET TO TRANSFER
    641						CALL	130$		;APPLY ECC CORRECTION
    642
    643						.ENDC		; R$$E16
    644
    645					;
    646					; SIXTH FINISH OR CONTINUE PREVIOUS FUNCTION
    647					;
    648
    649	001560	012700 	000001 			MOV	#IS.SUC&377,R0	;ASSUME SUCCESSFUL TRANSFER
    650	001564	112712 	000011 			MOVB	#11,@R2		;CLEAR DRIVE ERRORS
    651
    652						.IF DF	R$$JPO
    653
    654						SUB	(SP)+,RPCNT	;ANY MORE WORDS TO TRANSFER?
    655
    656						.IFF		; R$$JPO
    657
    658	001570	005762 	000002 			TST	RPWC(R2)	;ANY MORE WORDS TO TRANSFER?
    659
    660						.IFTF		; R$$JPO
    661
    662	001574	001640 				BEQ	70$		;IF EQ NO
    663
    664						.IFT		; R$$JPO
    665
    666						MOV	RPBA(R2),RPBUF+2 ;SAVE BUFFER ADDRESS
    667						MOV	RPRNA,R1	;GET ADDRESS OF I/O PACKET
    668						MOV	RPDC(R2),R.PB+6(R1) ;SAVE CYLINDER ADDRESS
    669						MOV	RPDA(R2),R.PB+10(R1) ;SAVE TRACK/SECTOR ADDRESS
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-5


    670
    671						.ENDC		; R$$JPO
    672
    673	001576	116712 	176610 			MOVB	RPBUF,@R2	;RESTART PREVIOUS OPERATION
    674	001602	000655 				BR	85$
    675
    676						.IF DF,	R$$E18
    677
    678					;
    679					; APPLY CORRECTION TO ONE WORD IN THE ERROR TRIPLET
    680					;
    681					; INPUTS:
    682					;
    683					;	R0 POINTS TO WORD IN DATA TRIPLET TO BE CORRECTED
    684					;	R1 POINTS TO WORD IN MASK TRIPLET TO BE APPLIED TO DATA
    685					;
    686					; OUTPUTS:
    687					;
    688					;	R0 POINTS TO THE NEXT WORD IN THE DATA TRIPLET
    689					;	R1 POINTS TO THE NEXT WORD IN THE MASK TRIPLET
    690					;
    691	001604				130$:
    692	001604	011146 				MOV	(R1),-(SP)	; CURRENT MASK TO STACK
    693	001606	041016 				BIC	(R0),(SP)	; .NOT. MASK .AND. DATA
    694	001610	042110 				BIC	(R1)+,(R0)	; .NOT. DATA .AND. MASK
    695	001612	052620 				BIS	(SP)+,(R0)+	; DATA .OR. MASK
    696	001614				140$:
    697	001614					RETURN			; FOR MORE
	001614	000207 				RTS	PC
    698					;
    699					; SHIFT A TRIPLET EITHER RIGHT OR LEFT
    700					;
    701					; INPUTS:
    702					;
    703					;	R0 POINTS TO TRIPLET TO BE SHIFTED
    704					;	R1 HAS SHIFT COUNT -
    705					;		.GT. 0 => SHIFT LEFT
    706					;		.EQ. 0 => NO SHIFT
    707					;		.LT. 0 => SHIFT RIGHT
    708					;
    709					; NO REGISTERS ALTERED
    710					;
    711	001616				141$:
    712	001616	010146 				MOV	R1,-(SP)	; SAVE SHIFT COUNT
    713	001620	100407 				BMI	143$		; SHIFT RIGHT IF NEGATIVE
    714	001622	001414 				BEQ	145$		; GO AWAY IF .EQ. 0
    715	001624				142$:
    716	001624	006320 				ASL	(R0)+		; SHIFT AWAY TO THE LEFT
    717	001626	006120 				ROL	(R0)+		; PROPAGATE CARRY
    718	001630	006110 				ROL	(R0)		; FOR ALL THREE WORDS
    719	001632	024040 				CMP	-(R0),-(R0)	; BACK THE POINTER UP
    720	001634	077105 				SOB	R1,142$		; LOOP TILL DONE
    721	001636	000406 				BR	145$		; EXIT
    722						;
    723	001640				143$:
    724	001640	005401 				NEG	R1		; SO "SOB" WORKS
    725	001642				144$:
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-6


    726	001642	006220 				ASR	(R0)+		; SHIFT THE TRIPLE WORD RIGHT
    727	001644	006020 				ROR	(R0)+		; PROPAGATE CARRY
    728	001646	006010 				ROR	(R0)		; ALL THE WAY
    729	001650	024040 				CMP	-(R0),-(R0)	; BACK THE POINTER UP
    730	001652	077105 				SOB	R1,144$		; TRY FOR MORE
    731	001654				145$:
    732	001654	012601 				MOV	(SP)+,R1	; RESTORE SHIFT COUNT
    733	001656					RETURN			; TO CALLER
	001656	000207 				RTS	PC
    734
    735						.ENDC		; R$$E18
    736
    737						.IF DF	R$$E16
    738
    739					;
    740					; 16 BIT ECC CORRECTION ROUTINES
    741					;
    742
    743					130$:	CMP	R0,RPCNT	;BYTE OFFSET WITHIN RANGE?
    744						BHIS	140$		;IF HIS NO
    745						MOV	RPBUF+2,R1	;RETRIEVE STARTING BUFFER ADDRESS
    746						ADD	R0,R1		;CALCULATE ADDRESS OF WORD TO BE CORRECTED
    747						MOV	@R1,-(SP)	;COPY CURRENT DATA WORD
    748						BIC	R3,@R1		;.NOT.PATTERN.AND.DATA WORD
    749						BIC	(SP)+,R3	;.NOT.DATA WORD.AND.PATTERN
    750						BIS	R3,@R1		;PATTERN.OR.DATA WORD
    751					140$:	RETURN			;
    752
    753						.ENDC		; R$$E16
    754
    755					;
    756					; OFFSET RECOVERY
    757					;
    758
    759						.IF DF	R$$JPO
    760
    761					150$:	TST	(SP)+		;REMOVE COUNT FROM STACK
    762					155$:	TST	R0		;ANY GOOD SECTORS TRANSFERRED?
    763						BEQ	180$		;IF EQ NO
    764
    765					;
    766					; THE TRANSFER ENDED IN AN ECC HARD ERROR BUT THERE WERE SECTORS
    767					; TRANSFERED THAT CONTAINED GOOD DATA. SINCE THE ECC HARD ERROR COULD
    768					; HAVE BEEN CAUSED BY A CYLINDER CROSSING, THE GOOD DATA IS SAVED
    769					; AND THE TRANSFER IS RETRIED FROM THE POINT OF ERROR.
    770					;
    771
    772						ADD	R0,RPBUF+2	;UPDATE STARTING BUFFER ADDRESS
    773						ADCB	RPBUF+1		;PROPAGATE CARRY INTO EXTENSION BITS
    774						SUB	R0,RPCNT	;REDUCE BYTES REMAINING TO TRANSFER
    775						SWAB	R0		;CALCULATE NUMBER OF SECTORS TRANSFERED
    776						ASR	R0		;
    777						MOV	RPRNA,R1	;GET ADDRESS OF I/O PACKET
    778						ADD	R.PB+10(R1),R0	;UPDATE TRACK/SECTOR ADDRESS
    779					160$:	CMPB	#20.,R0		;SECTOR OVERFLOW?
    780						BHI	165$		;IF HI NO
    781						SUB	#20.,R0		;SUBTRACT OUT A SECTOR
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-7


    782						ADD	#1*256.,R0	;ADD IN A TRACK
    783						CMP	#19.*256.,R0	;TRACK OVERFLOW?
    784						BHI	160$		;IF HI NO
    785						SUB	#19.*256.,R0	;NORMALIZE TRACK ADDRESS
    786						INC	R.PB+6(R1)	;UPDATE CYLINDER ADDRESS
    787						BR	160$		;
    788
    789					165$:	MOV	R0,R.PB+10(R1)	;SET UPDATED TRACK/SECTOR ADDRESS
    790					170$:	CALL	220$		;RESET OFFSET TABLE ADDRESS
    791					175$:	MOV	#117,R1		;SET RTC FUNCTION
    792						MOVB	#16.,RTTBL+1 	;TRY 16. TIMES AT CENTERLINE
    793						BR	190$		;
    794
    795					;
    796					; NO GOOD DATA WAS TRANSFERED - CHECK IF OFFSET SHOULD BE CHANGED
    797					;
    798
    799					180$:	BIT	#DCK!DTE!ECH,R1	;DATA CHECK OR DRIVE TIMING ERROR?
    800						BNE	185$		;IF NE YES
    801						INCB	RPCW2+1		;SET HEADER COMPARE INHIBIT FLAG
    802					185$:	DECB	RTTBL+1		;CHANGE OFFSET?
    803						BGT	200$		;IF GT NO
    804						ADD	#2,OFFAD	;UPDATE OFFSET POINTER
    805						MOV	@OFFAD,R0	;GET NEXT OFFSET VALUE
    806						BEQ	175$		;IF EQ RETURN TO CENTERLINE
    807						MOV	#115,R1		;SET OFFSET FUNCTION
    808						MOVB	#2,RTTBL+1	;SET RECOVERY RETRY COUNT
    809					190$:	MOV	#TRE!11,@R2	;CLEAR CONTROLLER AND DRIVE
    810						MOV	R0,RPOF(R2)	;LOAD NEXT OFFSET VALUE
    811						CLRB	RPCW2+1		;CLEAR HEADER COMPARE INHIBIT FLAG
    812						MOVB	R1,@R2		;INITIATE OFFSET FUNCTION
    813						RETURN			;
    814					200$:	JMP	40$		;RETRY FUNCTION
    815
    816					;
    817					; SET OFFSET RECOVERY PARAMETERS
    818					;
    819
    820					210$:	MOVB	#1,RTTBL+1	;SET RECOVERY COUNT TO ONE
    821					220$:	MOV	#OFFTB-2,OFFAD ;SET OFFSET TABLE POINTER
    822						RETURN			;
    823
    824						.ENDC		; R$$JPO
    825
    826
    827						.DSABL	LSB
    828
    829
    830
    831		000001 				.END
DBDRV -- RP04 DRIVER	MACRO M1108  13-JAN-78 13:59  PAGE 4-8
SYMBOL TABLE

AOE   = 001000   	IE.EOF= 177766   	ILR   = 000002   	IO.RNE= 001020   	OPI   = 020000
A.EF  = ****** GX	IE.EOT= 177702   	IO.ACE= 007400   	IO.RTC= 003400   	PGE   = 002000
CLIOD   000304R  	IE.EOV= 177765   	IO.ACR= 006400   	IO.RTI= 016400   	PGM   = 001000
CPE   = 000010   	IE.EXP= 177676   	IO.ACW= 007000   	IO.RTK= 000060   	PS    = ****** GX
C.LEEF= 000002   	IE.FEX= 177717   	IO.ADS= 014000   	IO.RVB= 010400   	Q.IOAE= 000012
DBINI   000440R  	IE.FHE= 177705   	IO.APC= 014000   	IO.RWD= 002400   	Q.IOEF= 000006
DCK   = 100000   	IE.FOP= 177713   	IO.APV= 014010   	IO.RWU= 002540   	Q.IOFN= 000002
DLT   = 100000   	IE.HFU= 177744   	IO.ATT= 001400   	IO.R1C= 002400   	Q.IOLU= 000004
DNMSG   000352R  	IE.HWR= 177772   	IO.CCI= 014000   	IO.SAO= 004000   	Q.IOPL= 000014
DRY   = 000200   	IE.IDU= 177644   	IO.CCT= 002460   	IO.SCS= 013000   	Q.IOPR= 000007
DTE   = 010000   	IE.IEF= 177637   	IO.CLN= 003400   	IO.SDI= 013000   	Q.IOSB= 000010
DUNS    000370R  	IE.IFC= 177776   	IO.CON= 015400   	IO.SDO= 012400   	RETRY = 000010
DVA   = 004000   	IE.IFU= 177747   	IO.CRC= 001020   	IO.SEC= 002520   	RMR   = 000004
ECCMSK  000432R  	IE.ILL= 177726   	IO.CRE= 012000   	IO.SEM= 002440   	RPAS  = 000016
ECCWRD  000424R  	IE.ILU= 177640   	IO.CTI= 015400   	IO.SHT= 002410   	RPBA  = 000004
ECH   = 000100   	IE.INS= 177776   	IO.CTL= 016400   	IO.SLO= 005400   	RPBUF   000412R
ECI   = 004000   	IE.IPR= 177641   	IO.DAC= 010000   	IO.SMO= 002560   	RPCNT   000416R
EF.IOD= ****** GX	IE.ISQ= 177703   	IO.DCI= 014400   	IO.SNM= 002450   	RPCS1 = 000000
ERR   = 040000   	IE.ITI= 177643   	IO.DCT= 002470   	IO.SPB= 002420   	RPCS2 = 000010
EV.SE = ****** GX	IE.ITS= 177770   	IO.DEL= 012400   	IO.SPF= 002440   	RPCW2   000422R
E.IOD = ****** GX	IE.LCK= 177745   	IO.DET= 002000   	IO.SSO= 004400   	RPDA  = 000006
E.NIR = ****** GX	IE.LNL= 177646   	IO.DIS= 016000   	IO.SST= 002430   	RPDBR = 000022
FER   = 000020   	IE.MBK= 177721   	IO.DTI= 016000   	IO.STC= 002500   	RPDC  = 000034
FMT22 = 010000   	IE.MOD= 177753   	IO.ENA= 006000   	IO.STP= 016400   	RPDS  = 000012
HCE   = 000200   	IE.NBF= 177731   	IO.EOF= 003000   	IO.SYN= 003040   	RPDT  = 000026
HCI   = 002000   	IE.NBK= 177727   	IO.ESA= 002500   	IO.TRM= 002410   	RPEC1 = 000044
HCRC  = 000400   	IE.NFI= 177704   	IO.EXT= 011400   	IO.UNL= 000042   	RPEC2 = 000046
IAE   = 002000   	IE.NLN= 177733   	IO.FDX= 003020   	IO.WAT= 013400   	RPER1 = 000014
IE.ABO= 177761   	IE.NNC= 177674   	IO.FNA= 004400   	IO.WLB= 000400   	RPEXP = 176700
IE.ACT= 177771   	IE.NOD= 177751   	IO.HDX= 003010   	IO.WLS= 000410   	RPHD    000000RG
IE.ADP= 177636   	IE.NSF= 177746   	IO.HIS= 015000   	IO.WLV= 000500   	RPLA  = 000020
IE.ALN= 177736   	IE.OFL= 177677   	IO.INL= 002400   	IO.WVB= 011000   	RPMR  = 000024
IE.AST= 177660   	IE.ONP= 177773   	IO.ITI= 017000   	IO.XMT= 014400   	RPOF  = 000032
IE.BAD= 177777   	IE.OVR= 177756   	IO.KIL= 000012   	IO.XNA= 014410   	RPRNA   000410R
IE.BBE= 177710   	IE.PRI= 177760   	IO.LED= 012000   	IQ.Q  = 000002   	RPSN  = 000030
IE.BDI= 177714   	IE.RAC= 177724   	IO.LOV= 001010   	IQ.X  = 000001