BADFIN - FINISH BAD BLOCK PROCE	MACRO M1110  22-AUG-78 02:07  PAGE 2





      1					.TITLE	BADFIN - FINISH BAD BLOCK PROCESSING

      2					.IDENT	/04/

      3					;

      4					;

      5					; COPYRIGHT (C) 1974,1975,1976,1977

      6					;

      7					;

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

      9					; SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION

     10					; OF  THE  ABOVE COPYRIGHT  NOTICE.  THIS SOFTWARE, OR  ANY  OTHER

     11					; COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE  MADE AVAILABLE

     12					; TO  ANY  OTHER PERSON  EXCEPT  FOR USE ON SUCH SYSTEM AND TO ONE

     13					; WHO AGREES TO THESE LICENSE TERMS.  TITLE  TO  AND  OWNERSHIP OF

     14					; THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DIGITAL.

     15					;

     16					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT  TO CHANGE WITHOUT

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

     18					; EQUIPMENT CORPORATION.

     19					;

     20					; DIGITAL ASSUMES NO  RESPONSIBILITY FOR THE USE OR RELIABILITY OF

     21					; ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

     22					;

     23					;

     24					; VERSION 04

     25					;

     26					; J. MASSE 01-JUL-74

     27					;

     28					;

     29					; MODIFIED BY:

     30					;

     31					;	P. J. BEZEREDI 01-NOV-76

     32					;

     33					;		PB010 -- BREAK BAD INTO SEPERATE MODULES.

     34					;

     35					;

     36						.IF DF	R$$11M!R$$11S

     37					.MACRO	SOB	REG,LABEL

     38						DEC	REG

     39						BNE	LABEL

     40					.ENDM	SOB

     41						.ENDC

BADFIN - FINISH BAD BLOCK PROCE	MACRO M1110  22-AUG-78 02:07  PAGE 3





     43					;+

     44					; **-$FINI-FINISH BAD BLOCK PROCESSING

     45					;

     46					; ROUTINE TO WRITE OUT BAD BLOCK FILE AND GENERALLY CLEAN UP

     47					;

     48					;

     49					; INPUTS:

     50					;

     51					;	NONE.

     52					;

     53					; OUTPUTS:

     54					;

     55					;	'$BADBK' IS WRITTEN TO THE DISK AND THE TOTAL NUMBER OF

     56					;	BAD BLOCKS FOUND IS SENT TO "CO".

     57					;

     58					;	NOTE -- '$FINI' EXITS DIRECTLY TO '$MSG'

     59					;

     60					;-

     61

     62	000000	012767 	000012'	000000G	$FINI::	MOV	#10$,$IEBLK	;SET TRANSFER ADDRESS FOR 'WRITE'

     63	000006					CALL	$BADCK		;SEE IF THERE WERE ANY BAD BLOCKS

     64									;DURING THE LAST WHOLE BUFFER TRANSFER

     65	000012	105764 	000000G		10$:	TSTB	BB.CNT(R4)	;ANY BAD BLOCKS IN THE LAST POINTER?

     66	000016	001410 				BEQ	20$		;IF EQ NO

     67	000020	105364 	000000G			DECB	BB.CNT(R4)	;ALLOW FOR BIAS OF -1

     68	000024	062767 	000000C	000000G		ADD	#$PTRSZ/2,BB.USD  ;ADD LAST POINTER TO "WORDS USED" COUNT

     69	000032	062704 	000000G			ADD	#$PTRSZ,R4	;ADVANCE TO NEXT POSITION

     70	000036	000403 				BR	30$

     71	000040	005014 			20$:	CLR	(R4)		;NOTHING IN LAST POINTER

     72	000042	005064 	000002 			CLR	2(R4)

     73	000046	105767 	000000G		30$:	TSTB	$LTDSK		; "LAST-TRACK" DISK?

     74	000052	001407 				BEQ	35$		;IF EQ NO

     75	000054	105767 	000000G			TSTB	$SWOVR		;OVERRIDE IN EFFECT?

     76	000060	001004 				BNE	35$		;IF NE YES

     77	000062					CALL	$LTRCK		;YES, UPDATE LAST TRACK INFO

     78	000066	103046 				BCC	80$		;IF CC OK

     79	000070	000443 				BR	75$		;ERROR

     80	000072	012700 	000377 		35$:	MOV	#255.,R0	;SET UP TO CALCULATE CHECKSUM

     81	000076	012701 	000000G			MOV	#$BADBK,R1

     82	000102	005002 				CLR	R2

     83	000104	062102 			40$:	ADD	(R1)+,R2	;CHECKSUM = SUM OF FIRST 255 WORDS

     84	000106					SOB	R0,40$		;CALCULATE CHECKSUM

     85	000112	010211 				MOV	R2,(R1)		;STORE CHECKSUM IN BAD BLOCK BUFFER

     86	000114	012700 	000400 			MOV	#256.,R0	;SET UP TO FIND LAST GOOD BLOCK --

     87									;'$LBNH' AND '$LBNL' ARE NOW POINTING

     88									;TO LAST BLOCK + 1

     89	000120	162767 	000001 	000000G	50$:	SUB	#1,$LBNL	;DECREMENT LBN BY 1 -- DOUBLE PRECISION

     90	000126	005667 	000000G			SBC	$LBNH

     91	000132					CALL	$MATCH		;SEARCH BAD BLOCK FILE FOR THIS LBN

     92	000136	103403 				BCS	60$		;IF CS NOT IN FILE

     93	000140					SOB	R0,50$		;IT'S BAD, CHECK PREVIOUS LBN

     94	000144	000413 				BR	70$		;ERROR -- LAST 256. BLOCKS WERE BAD

     95	000146	012705 	000000G		60$:	MOV	#$BADBK,R5	;PUT BUFFER ADDRESS IN R5

     96	000152					CALL	$WRITE		;WRITE OUT BAD BLOCK FILE TO LAST GOOD BLOCK

     97	000156	103012 				BCC	80$		;IF CC OK

     98	000160					CALL	$WRITE		;ELSE TRY IT TWICE MORE

     99	000164	103403 				BCS	70$		;IF CS ERROR

BADFIN - FINISH BAD BLOCK PROCE	MACRO M1110  22-AUG-78 02:07  PAGE 3-1





    100	000166					CALL	$WRITE

    101	000172	103004 				BCC	80$		;IF CC OK

    102	000174	012700 	000000G		70$:	MOV	#$MSG14,R0	;FAILED TO WRITE BAD BLOCK FILE

    103	000200	000167 	000000G		75$:	JMP	$MESAG		;EXIT FATAL

    104	000204	012700 	000000G		80$:	MOV	#$MS12A,R0	;PUT MESSAGE ADDRESS IN R0 FOR 'CBTA'

    105	000210	016701 	000000G			MOV	$BBCNT,R1	;TOTAL # OF BAD BLOCKS FOUND --> R1

    106	000214	001403 				BEQ	85$		;IF EQ NO BAD BLOCKS

    107	000216	012767 	000000G	000000G		MOV	#EX$ERR,$STATS	;SET ERROR EXIT STATUS

    108	000224	005002 			85$:	CLR	R2		;SET FOR LEADING ZERO SUPPRESS

    109	000226					CALL	$CBDMG		;CONVERT TO ASCII FOR OUTPUT

    110	000232	112720 	000056 			MOVB	#'.,(R0)+	;STORE DECIMAL INDICATOR

    111	000236	112720 	000015 			MOVB	#15,(R0)+	;STORE CR-LF AT END OF ASCII STRING

    112	000242	112720 	000012 			MOVB	#12,(R0)+

    113	000246	105010 				CLRB	(R0)		;ZERO LAST CHARACTER FOR 'MESAGE'

    114	000250	012700 	000000G			MOV	#$MSG12,R0	;TOTAL # OF BAD BLOCKS

    115	000254	000167 	000000G			JMP	$MSG		;EXIT GOOD

    116

    117		000001 				.END

BADFIN - FINISH BAD BLOCK PROCE	MACRO M1110  22-AUG-78 02:07  PAGE 3-2

SYMBOL TABLE



A$$CHK= 000000   	G$$TPP= 000000   	M$$MUP= 000000   	R$$NDH= 000144   	T$$TRW= 000000

A$$CPS= 000000   	G$$TSS= 000000   	M$$NET= 000000   	R$$NDL= 000001   	T$$VBF= 000000

A$$NSI= 000000   	G$$TTK= 000000   	M$$OVR= 000000   	R$$SND= 000000   	U$$MHI= 000040

A$$PRI= 000000   	I$$RAR= 000000   	N$$CON= 000144   	R$$VAX= 000000   	U$$MLO= 120000

A$$TRP= 000000   	I$$RDN= 000000   	N$$LDV= 000001   	R$$X11= 000001   	U$$MRN= 170324

BB.CNT= ****** GX	K$$CNT= 177546   	N$$MOV= 000021   	R$$11M= 000000   	V$$CTR= 000400

BB.USD= ****** GX	K$$CSR= 177546   	N$$MXM= 000400   	S$$WPC= 000036   	X$$DBT= 000000

C$$CDA= 000001   	K$$LDC= 000000   	N$$TMO= 000012   	S$$WPR= 000005   	$BADBK= ****** GX

C$$CKP= 000000   	K$$TPS= 000074   	P$$D70= 000000   	S$$WRG= 000000   	$BADCK= ****** GX

C$$ORE= 002000   	LD$DB = 000000   	P$$GMX= 000000   	S$$YSZ= 030000   	$BBCNT= ****** GX

C$$OVL= 000000   	LD$DK = 000000   	P$$LAS= 000000   	T$$ACR= 000000   	$CBDMG= ****** GX

C$$RSH= 177564   	LD$DS = 000000   	P$$P11= 000001   	T$$BTW= 000000   	$FINI   000000RG

D$$BUG= 177514   	LD$DT = 000000   	P$$P45= 000000   	T$$BUF= 000000   	$IEBLK= ****** GX

D$$H11= 000002   	LD$DX = 000000   	P$$RFL= 000000   	T$$CCA= 000000   	$LBNH = ****** GX

D$$IAG= 000000   	LD$LP = 000000   	P$$RTY= 000000   	T$$CCO= 000000   	$LBNL = ****** GX

D$$ISK= 000000   	LD$MM = 000000   	P$$R11= 000001   	T$$CTR= 000000   	$LTDSK= ****** GX

D$$L11= 000001   	LD$PP = 000000   	P$$SRF= 000000   	T$$C11= 000001   	$LTRCK= ****** GX

D$$M11= 000001   	LD$PR = 000000   	P$$TPT= 000000   	T$$GMC= 000000   	$MATCH= ****** GX

D$$SHF= 000000   	LD$TT = 000000   	Q$$OPT= 000014   	T$$GTS= 000000   	$MESAG= ****** GX

D$$YNC= 000000   	L$$ASG= 000000   	R$$DER= 000000   	T$$J16= 000001   	$MSG  = ****** GX

D$$YNM= 000000   	L$$DRV= 000000   	R$$EXV= 000000   	T$$KMG= 000000   	$MSG12= ****** GX

EX$ERR= ****** GX	L$$P11= 000001   	R$$JPO= 000000   	T$$LWC= 000000   	$MSG14= ****** GX

E$$DVC= 000000   	L$$11R= 000000   	R$$JP1= 000001   	T$$MAN= 016703   	$MS12A= ****** GX

E$$NSI= 000000   	M$$CRB= 000124   	R$$JS1= 000001   	T$$RNE= 000000   	$PTRSZ= ****** GX

E$$PER= 000000   	M$$CRX= 000000   	R$$KWC= 000000   	T$$RPR= 000000   	$STATS= ****** GX

E$$XPR= 000000   	M$$EXT= 000000   	R$$K11= 000001   	T$$RST= 000000   	$SWOVR= ****** GX

F$$AST= 000000   	M$$FCS= 000000   	R$$LKL= 000000   	T$$RUB= 000000   	$WRITE= ****** GX

F$$LPP= 000000   	M$$MGE= 000000   	R$$NDC= 000006   	T$$SYN= 000000   	$$$R4 = 000000

F$$LVL= 000001



. ABS.	000000	   000

      	000260	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  3719 WORDS  ( 15 PAGES)

DYNAMIC MEMORY:  4884 WORDS  ( 18 PAGES)

ELAPSED TIME:  00:00:08

OBJ$:BADFIN,LIS$:BADFIN/-SP=SRC$:RSXMC/PA:1,BADFIN

