DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23

TABLE OF CONTENTS



    23-   28	IMPURE DATA

    23-   40	PURE DATA

    24-   51	MAIN BAD BLOCK ROUTINE

    25-   89	AUTOMATIC BAD BLOCK HANDLING

    26-  163	RK06/7 BAD BLOCK HANDLING

    27-  276	MANUAL BAD BLOCK ENTRY

    28-  311	BAD BLOCK LIST SUBROUTINE

    29-  417	STATE TABLE TO PARSE MANUAL BAD BLOCK DATA

    30-  439	ACTION ROUTINES FOR MANUAL BAD BLOCK PARSE

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 3





      1	000000					$BEGIN	DSCBD,0022,<DSC BAD BLOCK PROCESSING>

						.TITLE	DSCBD	X0022 - DSC BAD BLOCK PROCESSING

						.IDENT	"X0022"

      2

      3					;

      4					; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION,

      5					; MAYNARD, MASSACHUSETTS

      6					;

      7					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A

      8					; SINGLE  COMPUTER  SYSTEM AND MAY BE COPIED ONLY WITH THE IN-

      9					; CLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR

     10					; ANY  OTHER  COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE

     11					; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR  USE  ON  SUCH

     12					; SYSTEM  AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE

     13					; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL  TIMES  REMAIN

     14					; IN DIGITAL.

     15					;

     16					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITH-

     17					; OUT  NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY

     18					; DIGITAL EQUIPMENT CORPORATION.

     19					;

     20					; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY  FOR

     21					; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS

     22					; NOT SUPPLIED BY DIGITAL.

     23					;

     24					; ANDREW C. GOLDSTEIN  4-AUG-78  0:59

     25					; GEORGE RITTENBURG 12-SEPT.-77

     26						;RM03 AND RL01 SUPPORT ADDED

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 4

IMPURE DATA



     28						.SBTTL	IMPURE DATA

     29

     30					;

     31					; WORDS USED BY MANUAL BAD BLOCK INPUT

     32					;

     33	000000				BLOCK:	.BLKW	2		; LBN OF BAD AREA

     34	000004				COUNT:	.BLKW	2		; COUNT OF BLOCKS

     35	000010				FLAGS:	.BLKW	1		; FLAGS WORD, CONTAINING:

     36		000001 				BA.END = 1		; EXIT FLAG

     37

     38

     39

     40						.SBTTL	PURE DATA

     41

     42					;

     43					; PROMPT STRING TO ASK FOR MANUAL BAD BLOCK DATA

     44					;

     45	000012	   104 	   123 	   103 	PROMPT:	.ASCII	"DSC> BAD="

	000015	   076 	   040 	   102

	000020	   101 	   104 	   075

     46		000011 			PROMPL = .-PROMPT

     47

     48

     49						.EVEN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 5

MAIN BAD BLOCK ROUTINE



     51						.SBTTL	MAIN BAD BLOCK ROUTINE

     52

     53					;+

     54					;

     55					; *** - $DSCBD	DSC BAD BLOCK PROCESSING

     56					;

     57					; THIS ROUTINE CONSTRUCTS THE INTERNAL BAD BLOCK TABLE FROM THE

     58					; BAD BLOCK MAP ON THE OUTPUT DISK.

     59					;

     60					; INPUTS:

     61					;

     62					;	OUTLUN ASSIGNED TO DISK

     63					;	$OUDEV POINTING TO DEVICE TABLE ENTRY

     64					;

     65					; OUTPUTS:

     66					;

     67					;	BAD BLOCK MAP IN $BADBK

     68					;

     69					;-

     70

     71	000024				$DSCBD::

     72	000024					LET $BADP := #$BADBK		; INIT BAD BLOCK POINTER

     73	000032					$CALL AUTO			; DO NORMAL AUTOMATIC PROCESSING

     74	000036					IF #KY.MAN SET.IN $OFLAG

     75	000046					  $CALL MANUAL			; DO MANUAL BAD BLOCK PROCESSING

     76	000052					END

     77					;

     78					; IF THE LAST CLUSTER OF THE VOLUME IS PARTIALLY OFF THE END

     79					; OF THE TRUE VOLUME, DUE TO ROUND UP, MARK IT BAD.

     80					;

     81	000052					LET R2 := $VOLSZ - #1		; GET LAST LBN OF VOLUME,

     82	000060					LET R1 := $VOLSZ+2 - CARRY	; ROUNDED UP TO NEXT CLUSTER

     83	000066					DCOMP R1,R2 $CW2,$CW3		; COMPARE TO TRUE SIZE

     84	000100					IF RESULT IS HIS

     85	000102					  $CALL MAKBAD <,R1,R2,#1>	; MARK ONE CLUSTER BAD

     86	000112					END

     87	000112					RETURN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 6

AUTOMATIC BAD BLOCK HANDLING



     89						.SBTTL	AUTOMATIC BAD BLOCK HANDLING

     90

     91					;

     92					; THIS ROUTINE READS THE BAD BLOCK DESCRIPTOR FROM THE END OF THE

     93					; VOLUME, VERIFIES IT, AND FORMATS THE DATA INTO THE ALLOCATION MAP.

     94					; IF THE DISK IS AN RK06 OR RK07, CONTROL PASSES TO THE RK06/7 BAD

     95					; BLOCK ROUTINE. THE RK06/7 IS IDENTIFIED BY THE VOLUME SIZE. ONE OF

     96					; THESE DAYS WHEN WE DEFINE DEVICE TYPE CODES WE WILL BE ABLE TO DO

     97					; THIS A BIT MORE CLEANLY.RL01 AND RM03 ADDED 12-SEPT.-77

     98					;

     99					; FIRST SEARCH FROM THE BACK OF THE VOLUME FOR THE DESCRIPTOR.

    100					;

    101

    102	000114				AUTO:

    103	000114					IF #KY.NAU OFF.IN $OFLAG	; DO ONLY IF REQUESTED

    104	000124					  BEGIN AUTOB

    105	000124					    LET R2 := $CW2		; GET END OF VOLUME

    106	000130					    LET R3 := $CW3

    107	000134					    IF R2 EQ #0 AND R3 EQ #RK06SZ GOTO RK06

    108	000146					    IF R2 EQ #0 AND R3 EQ #RK07SZ GOTO RK06

    109	000160					   IF R2 EQ #0 AND R3 EQ #RL01SZ GOTO RL01

    110	000172					   IF R2 EQ #2 AND R3 EQ #RM03SZ GOTO RM03

    111	000206					    BEGIN FIND

    112	000206					      PUSH #32.

    113	000212					      FOR (SP) := (SP) DOWNTO #0

    114	000212						LET R3 := R3 - #01	; BACK UP ONE BLOCK

    115	000216						LET R2 := R2 - CARRY

    116	000220						$CALL $RDWLN <#OUTLUN,,R2,R3,#$B1HD> ; READ A BLOCK

    117	000234						ON.NOERROR

    118	000236						  $CALL $CKSUM		; CHECK THE CHECKSUM

    119	000242						  ON.NOERROR

    120	000244						    LET R4 := R5

    121	000246						    IF (R4)+ EQ #1401 LEAVE FIND ; CHECK FOR FORMAT WORD

    122	000254						  END

    123	000254						ELSE			; LOOP ONLY ON PARITY ERROR

    124	000256						  IFB (R4) NE #IE.VER

    125	000264						   LET $FLAG1 := $FLAG1 SET.BY #KY.NIP

    126	000272						   ERROR  ER.IOR	; SEND ERROR MESSAGE

    127	000274						 END

    128	000274						END

    129	000274						LET $B1HD+B.STAT := #0	; DISCARD THE BUFFER FOR RETRY

    130	000300					      END LOOP

    131	000310					      ERRP ER.NBD		; BAD BLOCK DATA NOT FOUND

    132	000312					      LEAVE AUTOB

    133	000314					    END FIND

    134	000314	005726 				    TST (SP)+			; CLEAN THE STACK

    135					;

    136					; BAD BLOCK DESCRIPTOR IS FOUND. FIRST MAKE AN ENTRY FOR THE

    137					; DESCRIPTOR ITSELF.

    138					;

    139	000316					    $CALL MAKBAD <,R2,R3,#0>

    140					;

    141					; NOW ENTER EACH BAD CLUSTER INTO THE BAD BLOCK LIST.

    142					;

    143	000332					    PUSH (R4)+			; PUT COUNT ON STACK

    144	000334					    LET 1(SP) :B= #0

    145	000340					    LET (SP) := (SP) R.SHIFT 1

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 6-1

AUTOMATIC BAD BLOCK HANDLING



    146	000342					    IF RESULT IS NE		; IF MAP IS NOT EMPTY

    147

    148	000344					      FOR (SP) := (SP) DOWNTO #0

    149	000344						LET R1 := #0

    150	000346						LET R1 :B= R1 SET.BY (R4)+ ; HIGH ORDER LBN

    151	000350						LET R3 := #0

    152	000352						LET R3 :B= R3 SET.BY (R4)+ ; GET COUNT FIELD

    153	000354						LET R2 := (R4)+		; LOW ORDER LBN

    154	000356						$CALL MAKBAD <,R1,R2,R3> ; ENTER CLUSTER IN BAD BLOCK LIST

    155	000362						ON.ERROR THEN ERRP ER.BBD ; BAD DATA IN DESCRIPTOR

    156	000366					      END LOOP

    157	000376					    END

    158	000376					  END AUTOB

    159	000376	005726 				  TST (SP)+			; CLEAN COUNT OFF STACK

    160	000400					END

    161	000400					RETURN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 7

RK06/7 BAD BLOCK HANDLING



    163						.SBTTL	RK06/7 BAD BLOCK HANDLING

    164					; RL01 AND RM03 SUPPORT ADDED

    165					;

    166					; RANDOM CONSTANTS FOR THIS ROUTINE.

    167					;

    168		064766 			RK06SZ	= 27126.		; SIZE OF RK06

    169		151036 			RK07SZ	= 53790.		; SIZE OF RK07

    170		024000 			RL01SZ  =10240.		;SIZE OF RL01

    171		001140 			RM03SZ  =1140			;SIZE OF RM03 (LO ORDER)

    172									;HI ORDER = 2

    173					;CYL	= 411.				; NUMBER OF CYLINDERS RK06

    174					; 815 CYL. RK07,256-RL01,823-RM03.

    175		000003 			TRK6	= 3			; 3 SURFACES FOR RK06 AND RK07

    176		000005 			TRK3	= 5			; 5 SURFACES FOR RM03

    177		000002 			TRK1  = 2			; 2 SURFACES FOR RL01

    178		000024 			SECT1	= 20.			;20 SECTORS/TRK RL01

    179		000040 			SECT3	= 32.			;32 SECTORS/TRK RM03

    180		000026 			SECT6	= 22.			;22 SECTORS/TRK RK06/07

    181		000012 			UBDAT1	= 10.			;LAST 10 SCTRS ARE FOR USER DATA-RL01

    182		000026 			UBDAT3	= 22.			;LAST 22 SCTRS ARE FOR USER DATA RM03

    183		000014 			UBDAT6	= 12.			;LAST 12  "    FOR USER DATA RK06/07

    184	000402				RL1FLG:	.BLKW  1	;RL01 FLAG

    185	000404				SECT:	.BLKW  1	;NO.SCTRS/TRK,THIS DISK

    186	000406				UBDATA:	.BLKW  1		;NO. USER DATA BLKS,THIS DISK

    187	000410				TEMP:	.BLKW   1		;TEMP. STORAGE FOR BAD SCTR NO.

    188	000412				TRK:	.BLKW	1		; NUMBER OF SURFACES OF THIS DISK

    189

    190					;

    191					; THIS ROUTINE READS THE BAD BLOCK MAP FROM THE LAST TRACK OF THE RK06/7

    192					; AND ENTERS IT IN THE BAD BLOCK TABLE. 22 SECTOR MODE DATA IS FOUND IN

    193					; THE FIRST EVEN NUMBERED SECTOR THAT READS WITHOUT A PARITY ERROR.

    194					; THE SAME FOR RL01 AND RM03 DISKS

    195					;

    196

    197	000414				RK06:	LET TRK := #TRK6		; SET UP NUMBER OF SURFACES

    198	000422					LET SECT := #SECT6		; SET SCTRS/TRK

    199	000430					LET UBDATA := #UBDAT6		; SET NO. USER DATA BLKS

    200	000436					GOTO SPECOM

    201

    202	000440				RM03:	LET TRK := #TRK3		; SET NO. SURFACES

    203	000446					LET SECT := #SECT3		; SET SCTRS/TRK

    204	000454					LET UBDATA := #UBDAT3		; SET NO. USER DATA BLKS

    205	000462					GOTO SPECOM

    206

    207	000464				RL01:	LET TRK := #TRK1		; SET NO. SURFACES

    208	000472					LET SECT := #SECT1		; SET SCTRS/TRK

    209	000500					LET UBDATA := #UBDAT1		; SET NO. USER DATA BLKS

    210	000506					LET RL1FLG := #1		; SET RL01 FLAG

    211					;

    212					; FIRST, MARK THE LAST TRACK OF THE DISK BAD

    213					;

    214	000514				SPECOM:	PUSH R2,R3				; SAVE VOLUME SIZE

    215	000520					LET R3 := R3 - SECT		; BACK UP TO START OF LAST TRACK

    216	000524					LET R2 := R2 - CARRY

    217	000526					LET R4 := SECT - #1	; NO. SCTRS TO MAKE BAD MINUS 1

    218	000534					PUSH	R2,R3		;SAVE LBN BEGIN LAST TRACK

    219	000540					$CALL MAKBAD <,R2,R3,R4>

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 7-1

RK06/7 BAD BLOCK HANDLING



    220	000552					POP R3,R2			; RECOVER START OF LAST TRACK

    221	000556					IF #KY.NAU OFF.IN $OFLAG

    222	000566					  REPEAT			; LOOP FOR FACTORY & USER DATA

    223	000566					    BEGIN FIND

    224	000566					      REPEAT

    225	000566						$CALL $RDWLN <#OUTLUN,,R2,R3,#$B1HD> ; READ A BLOCK

    226	000602						ON.NOERROR LEAVE FIND

    227	000604						IFB (R4) NE #IE.VER

    228	000612						   LET $FLAG1 := $FLAG1 SET.BY #KY.NIP

    229	000620						   ERROR  ER.IOR	; SEND ERROR MESSAGE

    230	000622						END

    231	000622						LET $B1HD+B.STAT := #0	; DISCARD THE BUFFER FOR RETRY

    232	000626						LET R3 := R3 + #2	; TRY THE NEXT SECTOR

    233	000632						LET R2 := R2 - CARRY

    234	000634						IF R2 HI 2(SP) THEN GOTO WARN  ;NO BAD DATA

    235	000644					      UNTIL R2 EQ 2(SP) AND R3 HIS (SP)

    236					; UNTIL WHOLE TRACK HAS BEEN TRIED

    237	000656				WARN:	      ERRP ER.NBD		; PRINT MESSAGE

    238	000660					      LEAVE LOOP

    239	000662					    END FIND

    240					;

    241					; NOW ENTER EACH BAD CLUSTER INTO THE BAD BLOCK LIST.

    242					;

    243	000662					    PUSH R2,R3			; SAVE CURRENT BLOCK NUMBER

    244	000666					      LET R4 := R5 + #6.	; POINT TO START OF DATA

    245	000674					      IF (R4)+ NE #0 THEN ERROR ER.DGP ; NON-ZERO MEANS DO NOT USE

    246	000702					    REPEAT

    247	000702					      LET R0 := (R4)+		; GET NEXT CYLINDER NUMBER

    248	000704					      IF R0 EQ #-1 LEAVE LOOP	; -1 IS END OF DATA

    249	000712					      LET R0 := R0 OFF.BY #100000 ; MASK OFF FLAG BIT

    250	000716					      $CALL $MUL <R0,TRK>	; COMPUTE NUMBER OF TRACKS

    251	000726					      LET TEMP := (R4)+		; GET TRACK AND SECTOR

    252	000732					      LET R3 := TEMP

    253	000736	000303 				      SWAB R3

    254	000740					      LET R3 := R3 OFF.BY #^C177 ; ISOLATE TRACK

    255	000744					      LET TEMP := TEMP OFF.BY #^C377 ; ISOLATE SECTOR

    256	000752					      IF RL1FLG EQ #0 THEN GOTO CONT	;NOT RL01

    257	000762					      LET TEMP := TEMP R.SHIFT 1	;ADJUST SCTR FOR RL01

    258	000766				CONT:	      LET R1 := R1 + R3		; ADD IN TRACK NUMBER

    259	000770					      $CALL $DMUL <SECT,,#0,R1>	; COMPUTE NUMBER OF SECTORS

    260	001006					      LET R2 := R1 + TEMP	;COMPUTE LBN

    261	001014					      LET R0  := R0 + CARRY

    262	001016					      $CALL MAKBAD <,R0,R2,#0>	; MARK 1 SECTOR BAD

    263	001030					      ON.ERROR THEN ERRP ER.BBD	; BAD DATA IN DESCRIPTOR

    264	001034					    UNTIL R4 HIS #$BUF1+512.	; LOOP UNTIL END OF BUFFER

    265	001042					    LET $B1HD+B.STAT := #0

    266	001046					    LET R3 := $CW3 - (SP)+	; SEE HOW FAR WE WERE FOM THE END

    267	001054					    LET R2 := $CW2 - CARRY - (SP)+

    268	001064					    IF R2 EQ #0 AND R3 LE UBDATA LEAVE LOOP	; OUT IF USER DATA ALREADY SEEN

    269	001076					    LET R3 := $CW3 - UBDATA	; POINT TO FIRST BLOCK OF USER DATA

    270	001106					    LET R2 := $CW2 - CARRY

    271	001114					  END LOOP

    272	001116					END

    273	001116	022626 				CMP (SP)+,(SP)+			; CLEAN THE STACK

    274	001120					RETURN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 8

MANUAL BAD BLOCK ENTRY



    276						.SBTTL	MANUAL BAD BLOCK ENTRY

    277

    278					;

    279					; THIS ROUTINE ACCEPTS BAD BLOCK DATA TYPED IN BY THE USER

    280					; AFTER THE MANUAL OPTION HAS BEEN SPECIFIED IN THE COMMAND LINE.

    281					;

    282					; IT PROMPTS WITH THE STRING "DSC> BAD=". THE REPLY IS IN THE

    283					; FORM "NNNN,MMMM", WHERE NNNN IS THE STARTING LBN OF THE BAD AREA

    284					; AND MMMM IS AN OPTIONAL COUNT. IF THE COUNT IS NOT PRESENT IT

    285					; IS ASSUMED TO BE 1. THIS ROUTINE WILL LOOP AND PROMPT FOR

    286					; ADDITIONAL DATA UNTIL TERMINATED BY A NULL LINE.

    287					;

    288

    289	001122				MANUAL:

    290	001122					PUSH GCLFLG			; SAVE MCR FLAG AND

    291	001126					LET GCLFLG := #0		; CLEAR IT TO FORCE INPUT

    292	001132					REPEAT

    293	001132					  $CALL .GTCML <,,,#PROMPL,#PROMPT> ; GET INPUT LINE

    294	001146					  $CALL .TPARS <,#0,#BKYTB,R3,R4,#BSTRT> ; PARSE IT

    295	001166					  ON.ERROR

    296	001170					    ERRP ER.BSY			; SYNTAX ERROR

    297	001172					  ELSE

    298	001174					    IF #BA.END SET.IN FLAGS LEAVE LOOP

    299	001204					    IF COUNT+2 NE #0

    300	001212					      ERRP ER.BCT		; COUNT MUST BE ONE WORD

    301	001214					    ELSE

    302	001216					      LET R3 := COUNT - #1

    303	001224					      $CALL MAKBAD <,BLOCK+2,BLOCK,R3>

    304	001240					      ON.ERROR THEN ERRP ER.BRG ; BLOCK OUT OF RANGE

    305	001244					    END

    306	001244					  END

    307	001244					END <REPEAT LOOP>

    308	001246					POP GCLFLG			; RESTORE MCR FLAG

    309	001252					RETURN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 9

BAD BLOCK LIST SUBROUTINE



    311						.SBTTL	BAD BLOCK LIST SUBROUTINE

    312

    313					;+

    314					;

    315					; THIS ROUTINE ENTERS THE DISK CLUSTERS CONTAINING THE INDICATED

    316					; BLOCKS INTO THE BAD BLOCK LIST. IF ALL OR PART OF THE BLOCKS

    317					; INDICATED ARE REDUNDANT, THEY ARE MERGED INTO THE APPROPRIATE

    318					; CLUSTER.

    319					;

    320					; INPUTS:

    321					;

    322					;	R1 = HIGH ORDER STARTING LBN

    323					;	R2 = LOW ORDER STARTING LBN

    324					;	R3 = BLOCK COUNT - 1

    325					;

    326					; R4 IS PRESERVED

    327					;

    328					;-

    329

    330	001254				MAKBAD:

    331	001254					LET R5 := $BADP				; GET BAD BLOCK TABLE POINTER

    332	001260					PUSH R1,R2				; SAVE LBN

    333	001264					LET R2 := R2 + R3			; COMPUTE LBN PLUS COUNT

    334	001266					LET R1 := R1 + CARRY

    335	001270					$CALL $DDIV <$CLF,R1,R2>		; COMPUTE UPPER CLUSTER BOUNDARY

    336	001300					LET R3 := R2 + #01			; INCLUDE WHOLE CLUSTER

    337	001306					LET R2 := R1 + CARRY

    338	001312					$CALL $DMUL <$CLF,,R2,R3>		; CONVERT BACK TO LBN

    339	001322					LET (R5)+ := R1				; STORE IN NEW TABLE ENTRY

    340	001324					LET (R5)+ := R0

    341	001326					POP R2,R1				; GET BACK STARTING LBN

    342	001332					$CALL $DDIV <$CLF,R1,R2>		; COMPUTE LOW CLUSTER BOUNDARY

    343	001342					LET R3 := R2

    344	001344					LET R2 := R1

    345	001346					$CALL $DMUL <$CLF,,R2,R3>		; AND CONVERT BACK TO LBN

    346	001356					LET (R5)+ := R1				; STORE STARTING LBN

    347	001360					LET (R5)+ := R0

    348	001362					LET R5 := R5 - #8.			; BACK UP POINTER

    349	001366					DCOMP 2(R5),(R5), $VOLSZ+2,$VOLSZ	; CHECK IF WITHIN VOLUME

    350	001402					IF RESULT IS HI THEN RETURN ERROR	; BLOCKS OUT OF BOUNDS

    351					;

    352					; NOW SEARCH THE BAD BLOCK MAP FOR AN AREA THAT OVERLAPS OR IS

    353					; ADJACENT TO THE NEW AREA. IF ONE IS FOUND, MERGE THEM.

    354					;

    355	001410					BEGIN TEST

    356	001410					  LET R3 := #$BADBK

    357	001414					  REPEAT

    358	001414					    IF R3 HIS $BADP LEAVE LOOP		; STOP AT END OF TABLE

    359	001422					    LET R1 := (R3)+			; GET COUNT

    360	001424					    LET R0 := (R3)+

    361	001426					    BEGIN MERGE

    362	001426					      PUSH 2(R3),(R3)			; MAKE TWO COPIES OF LBN

    363	001434					      PUSH 2(R3),(R3)

    364	001442					      LET (SP) := (SP) + R1		; ADD COUNT TO COMPUTE

    365	001444					      LET 2(SP) := 2(SP) + CARRY + R0	; END LBN

    366

    367	001454					      DCOMP 2(R3),(R3), 6(R5),4(R5)	; COMPARE START LBN'S

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 9-1

BAD BLOCK LIST SUBROUTINE



    368	001470					      IF RESULT IS LO

    369	001472						DCOMP 2(SP),(SP), 6(R5),4(R5)	; COMPARE END TO START

    370	001506						IF RESULT IS LO LEAVE MERGE	; NO OVERLAP

    371	001510						IF RESULT IS HI GOTO TESTE	; OVERLAP

    372	001512						GOTO USE2			; ADJACENT

    373	001514					      END

    374	001514					      IF RESULT IS HI			; (FROM FIRST COMPARE)

    375	001516						LET 4(SP) := 4(R5)		; CONSIDER USING START

    376	001524						LET 6(SP) := 6(R5)		; OF NEW AREA

    377	001532						DCOMP 2(R3),(R3), 2(R5),(R5)	; COMPARE START TO END

    378	001544						IF RESULT IS HI LEAVE MERGE	; NO OVERLAP

    379	001546						IF RESULT IS LO GOTO TESTE	; OVERLAP

    380	001550					      ELSE				; FIRST COMPARE WAS EQUAL

    381	001552				TESTE:		DCOMP 2(SP),(SP), 2(R5),(R5)	; COMPARE END TO END

    382	001564						IF RESULT IS LO

    383	001566				USE2:		  LET (SP) := (R5)		; USE END OF NEW REGION

    384	001570						  LET 2(SP) := 2(R5)

    385	001576						END

    386	001576					      END

    387					;

    388					; IF WE MAKE IT TO HERE WE HAVE FOUND AN OLD AREA THAT OVERLAPS

    389					; OR IS ADJACENT TO THE NEW ONE. THE STACK CONTAINS END LBN,

    390					; FOLLOWED BY START LBN, OF THE MERGED AREA.

    391					;

    392	001576	024343 				      CMP -(R3),-(R3)			; BACK UP TO START OF POINTER

    393	001600					      LET (SP) := (SP) - 4(SP)		; COMPUTE COUNT FROM

    394	001604					      LET 2(SP) := 2(SP) - CARRY - 6(SP) ; LBN'S

    395	001616					      LET (R3)+ := POP			; AND FILL IN OLD POINTER

    396	001620					      LET (R3)+ := POP			; WITH NEW DATA

    397	001622					      LET (R3)+ := POP

    398	001624					      LET (R3)+ := POP

    399	001626					      LEAVE TEST			; END OF PROCEDURE

    400	001630					    END MERGE

    401

    402	001630					    LET SP := SP + #8.			; END OF THIS TEST - CLEAN STACK

    403	001634	022323 				    CMP (R3)+,(R3)+			; BUMP TO NEXT TABLE ENTRY

    404	001636					  END <REPEAT LOOP>			; AND LOOP THRU TABLE

    405					;

    406					; THE ENTIRE TABLE HAS BEEN SEARCHED AND NO OVERLAPS HAVE BEEN

    407					; FOUND. CONVERT THE NEW ENTRY INTO THE STANDARD COUNT, LBN FORMAT

    408					; AND BUMP THE END OF TABLE POINTER.

    409					;

    410	001640					  IF R5 HIS #$BADND THEN ERROR ER.BFU	; TABLE FULL

    411	001650					  LET (R5) := (R5) - 4(R5)

    412	001654					  LET 2(R5) := 2(R5) - CARRY - 6(R5)

    413	001666					  LET $BADP := R5 + #8.

    414	001700					END TEST

    415	001700					RETURN

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 10

STATE TABLE TO PARSE MANUAL BAD BLOCK DATA



    417						.SBTTL	STATE TABLE TO PARSE MANUAL BAD BLOCK DATA

    418

    419						.MCALL	ISTAT$,STATE$,TRAN$

    420

    421	001702					ISTAT$	BSTB,BKYTB

    422

    423	001702					STATE$	BSTRT

    424	001702					TRAN$	$EOS,$EXIT,,BA.END,FLAGS ; EXIT ON NULL LINE

    425	001702					TRAN$	$NUMBR,,SETN		; LBN

    426

    427	001702					STATE$

    428	001702					TRAN$	$EOS,$EXIT		; EXIT ON NO COUNT

    429	001702					TRAN$	<',>

    430

    431	001702					STATE$

    432	001702					TRAN$	$NUMBR,,SETC		; COUNT

    433

    434	001702					STATE$

    435	001702					TRAN$	$EOS,$EXIT

    436

    437	001702					STATE$

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 11

ACTION ROUTINES FOR MANUAL BAD BLOCK PARSE



    439						.SBTTL	ACTION ROUTINES FOR MANUAL BAD BLOCK PARSE

    440

    441					;

    442					; SET LBN

    443					;

    444	001702				SETN:	LET BLOCK := .PNUMB

    445	001710					LET BLOCK+2 := .PNUMH

    446	001716					LET COUNT := #1

    447	001724					LET COUNT+2 := #0

    448	001730					LET FLAGS := #0

    449	001734					RETURN

    450					;

    451					; SET COUNT

    452					;

    453	001736				SETC:	LET COUNT := .PNUMB

    454	001744					LET COUNT+2 := .PNUMH

    455	001752					RETURN

    456

    457

    458

    459		000001 				.END

DSCBD	X0022 - DSC BAD BLOCK P	MACRO M1110  21-AUG-78 20:23  PAGE 11-1

SYMBOL TABLE



AUTO    000114R  	E4      001116R  	L31     001244R  	TRK1  = 000002   	$E$   = 000001

AUTOB = 000000   	E5      000662R  	L32     001244R  	TRK3  = 000005   	$FLAG1= ****** GX

BA.END= 000001   	E6      000656R  	L33     001410R  	TRK6  = 000003   	$I$   = 000001

BKYTB   000000RG    003	E7      001042R  	L34     001514R  	TYPS0 = 000003   	$K$   = 000011

BLOCK   000000R  	FIND  = 000005   	L35     001552R  	TYPS1 = 000000   	$K$L  = 000012

BSTB    000000RG    002	FLAGS   000010R  	L36     001576R  	TYPS2 = 000003   	$K$T  = 000005

BSTRT   000000R     002	GCLFLG= ****** GX	L37     001576R  	TYPS3 = 000000   	$L    = 000014

B.STAT= ****** GX	IE.VER= ****** GX	L4      000160R  	TYPS4 = 000000   	$LAMDA= 000300

B0      000124R  	IIII  = 177777   	L40     001650R  	TYPS5 = 000000   	$L$   = 000000

B1      000206R  	KY.MAN= ****** GX	L5      000172R  	TYPS6 = 000000   	$MUL  = ****** GX

B10     001132R  	KY.NAU= ****** GX	L6      000206R  	UBDATA  000406R  	$NUMBR= 000302

B11     001410R  	KY.NIP= ****** GX	L7      000256R  	UBDAT1= 000012   	$OFLAG= ****** GX

B12     001414R  	LBLS0 = 000011   	MAKBAD  001254R  	UBDAT3= 000026   	$O$   = 000000

B13     001426R  	LBLS1 = 000040   	MANUAL  001122R  	UBDAT6= 000014   	$R    = 177777

B2      000212R  	LBLS2 = 000013   	MERGE = 000013   	USE2    001566R  	$RAD50= 000316

B3      000344R  	LBLS3 = 000036   	OUTLUN= ****** GX	WARN    000656R  	$RDWLN= ****** GX

B4      000566R  	LBLS4 = 000037   	PROMPL= 000011   	$ALPHA= 000322   	$STRNG= 000304

B5      000566R  	LBLS5 = 000012   	PROMPT  000012R  	$ANY  = 000320   	$SUBXP= 000310

B6      000566R  	LBLS6 = 000011   	RK06    000414R  	$BADBK= ****** GX	$SUPMC= 000043

B7      000702R  	L0      000052R  	RK06SZ= 064766   	$BADND= ****** GX	$T    = 000041

CONT    000766R  	L1      000112R  	RK07SZ= 151036   	$BADP = ****** GX	$T1   = 000003

COUNT   000004R  	L10     000254R  	RL01    000464R  	$BLANK= 000306   	$T2   = 000011

ER.BBD= ****** GX	L11     000274R  	RL01SZ= 024000   	$BUF1 = ****** GX	$VOLSZ= ****** GX

ER.BCT= ****** GX	L12     000274R  	RL1FLG  000402R  	$B1HD = ****** GX	$XXX$ = 000001

ER.BFU= ****** GX	L13     000376R  	RM03    000440R  	$CKSUM= ****** GX	$Y$   = 000000

ER.BRG= ****** GX	L14     000366R  	RM03SZ= 001140   	$CLF  = ****** GX	$Z$   = 000000

ER.BSY= ****** GX	L15     001116R  	SECT    000404R  	$CW2  = ****** GX	$$S   = 000001

ER.DGP= ****** GX	L16     000622R  	SECT1 = 000024   	$CW3  = ****** GX	$$T   = 000040

ER.IOR= ****** GX	L17     000644R  	SECT3 = 000040   	$DDIV = ****** GX	$$TT  = 000036

ER.NBD= ****** GX	L2      000400R  	SECT6 = 000026   	$DIDDO= 000000   	$$$FLG= 177777

E0      000376R  	L21     000702R  	SETC    001736R  	$DIGIT= 000324   	$$$KEY= 177777

E1      000314R  	L22     000762R  	SETN    001702R  	$DMUL = ****** GX	$$$STA= 000000

E10     001246R  	L23     001034R  	SPECOM  000514R  	$DNUMB= 000314   	.GTCML= ****** GX

E11     001700R  	L25     001076R  	TEMP    000410R  	$DSCBD  000024RG 	.PNUMB= ****** GX

E12     001640R  	L26     001174R  	TEST  = 000011   	$EF$  = 000000   	.PNUMH= ****** GX

E13     001630R  	L27     001244R  	TESTE   001552R  	$EOS  = 000312   	.TPARS= ****** GX

E2      000310R  	L3      000146R  	TRK     000412R  	$EXIT = 000000   	.$T   = 000004

E3      000376R  	L30     001216R



. ABS.	000000	   000

      	001754	   001

$STATE	000032	   002

$KTAB 	000000	   003

$KSTR 	000000	   004

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  13147 WORDS  ( 52 PAGES)

DYNAMIC MEMORY:  14388 WORDS  ( 55 PAGES)

ELAPSED TIME:  00:05:13

EXE$:DSCBD,LIS$:DSCBD/-SP=SRC$:SMAC/PA:1,DSCPRE,DSCBD

