10 ! PROGRAM TO CONVERT RP03 REGISTERS TO ACTUAL BLOCK #
20 ! AND THEN BACK TO AED CYL, HEAD AND SECTOR
21 ! WILL READ DATA FROM RP0ER.RPT, RP1ER.RPT AND RP2ER.RPT
25 DIM A$[6],B$[62]V,SS(5),CS(51)
26 OPEN #4, "SEEK.RPT/WR"
27 OPEN #3, "DP0ER.RPT/RO" : IF END #3 GOTO 250
28 PRINT #4 "ERROR REPORT FOR DP0   ";DDAT$();" AT ";TIM$()
29 LX=0 : FOR I=1 TO 5 : SS(I)=0 : NEXT I
30 FOR I=1 TO 51 : CS(I)=0 : NEXT I
31 DA=0 : CA=0
32 INPUT LINE #3,B$
33 IF POS(B$,"LOGGED")>0 THEN PRINT #4 : PRINT #4, SEG$(B$,11,34);SEG$(B$,41,60)
34 IF SBS$(B$,9,4)="RPCA" THEN CA=OCT(SBS$(B$,25,6))
35 IF SBS$(B$,9,4)="RPDA" THEN DA=OCT(SBS$(B$,25,6))
36 IF SBS$(B$,9,8)="VOLUME L" THEN  PRINT #4 SBS$(B$,9,30)
37 IF SBS$(B$,9,4)="RPDS" THEN  PRINT #4 SBS$(B$,9,40)
38 IF SBS$(B$,9,4)="RPM1" THEN  PRINT #4 SBS$(B$,9,40)
39 IF SBS$(B$,12,4)="K NA" THEN  PRINT #4 SBS$(B$,9,40)
40 IF SBS$(B$,12,4)="K UI" THEN  PRINT #4 SBS$(B$,9,40)
41 IF SBS$(B$,1,4)="RETR" THEN  PRINT #4 SBS$(B$,1,30)
42 IF SBS$(B$,1,4)="VECT" THEN  GOTO 50
45 GOTO 32
50 SU=INT(DA/256)		: ! CALCULATE SURFACE (0 = FIRST SURFACE)
55 SO=INT((DA-SU*256)/16)	: ! CALCULATE CURRENT SECTOR
60 SE=DA-SU*256-SO*16		: ! CALCULATE ERROR SECTOR (0=FIRST SECTOR)
70 PRINT #4 "RP CYL","OCT. = ";OCT$(CA)," DEC. = ";CA
80 PRINT #4 "RP SUR","OCT. = ";OCT$(SU)," DEC. = ";SU
90 PRINT #4 "RP SEC","OCT. = ";OCT$(SE)," DEC. = ";SE
100 BN=CA*200+SU*10+SE
110 PRINT #4 "BLOCK #","OCT. = ";OCT$(BN/8);OCT$(BN-8*INT(BN/8)),
120 PRINT #4 " DEC. = ";BN
130 CY=INT(BN/160)
140 SU=INT((BN-CY*160)/32)
141 SS(SU+1)=SS(SU+1)+1		: ! COUNT A SURFACE ERROR
143 CS(INT(CY/16+1))=CS(INT(CY/16+1))+1	: ! COUNT A CYLINDER ERROR
150 SE=BN-CY*160-SU*32
170 PRINT #4 "SM CYL","OCT. = ";OCT$(CY)," DEC. = ";CY
180 PRINT #4 "SM SUR","OCT. = ";OCT$(SU)," DEC. = ";SU
190 PRINT #4 "SM SEC","OCT. = ";OCT$(SE)," DEC. = ";SE
195 LX=LX+1 : IF LX=4 THEN  PRINT #4 : PRINT #4 : PRINT #4 : LX=0
200 GOTO 31
250 CLOSE  3
251 PRINT #4 : PRINT #4, CHR$(12);"SURFACE","# OF ERRORS"
252 PRINT : PRINT "SURFACE","# OF ERRORS"
253 FOR I=1 TO 5
254 PRINT #4, I-1,SS(I)
255 PRINT I-1,SS(I) : SS(I)=0
256 NEXT I
257 PRINT #4 : PRINT #4, "CYLINDER","# OF ERRORS"
258 PRINT : PRINT "CYLINDER","# OF ERRORS"
259 FOR I=1 TO 51
260 PRINT FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
261 PRINT #4, FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
262 NEXT I
263 OPEN #3, "DP1ER.RPT/RO"
270 IF END #3 THEN 300
280 PRINT #4, CHR$(12)
282 PRINT #4 "ERROR REPORT FOR DP1   ";DDAT$();" AT ";TIM$()
290 GOTO 29
300 CLOSE 3
301 PRINT #4 : PRINT #4, CHR$(12);"SURFACE","# OF ERRORS"
302 PRINT : PRINT "SURFACE","# OF ERRORS"
303 FOR I=1 TO 5
304 PRINT #4, I-1,SS(I)
305 PRINT I-1,SS(I) : SS(I)=0
306 NEXT I
307 PRINT #4 : PRINT #4, "CYLINDER","# OF ERRORS"
308 PRINT : PRINT "CYLINDER","# OF ERRORS"
309 FOR I=1 TO 51
310 PRINT FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
311 PRINT #4, FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
312 NEXT I
315 OPEN #3, "DP2ER.RPT/RO"
320 IF END #3 THEN 350
330 PRINT #4 CHR$(12)
332 PRINT #4 "ERROR REPORT FOR DP2   ";DDAT$();" AT ";TIM$()
340 GOTO 29
350 CLOSE 3
351 PRINT #4 : PRINT #4, CHR$(12);"SURFACE","# OF ERRORS"
352 PRINT : PRINT "SURFACE","# OF ERRORS"
353 FOR I=1 TO 5
354 PRINT #4, I-1,SS(I)
355 PRINT I-1,SS(I) : SS(I)=0
356 NEXT I
357 PRINT #4 : PRINT #4, "CYLINDER","# OF ERRORS"
358 PRINT : PRINT "CYLINDER","# OF ERRORS"
359 FOR I=1 TO 51
360 PRINT FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
361 PRINT #4, FRMT$(I*16-16,4);" > ";FRMT$(I*16-1,4),CS(I)
362 NEXT I
363 CLOSE 
364 EXIT 
