VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37

TABLE OF CONTENTS



     7-    1	**** VFYCCK VERSION M0101 ****

    10-   96	CKLBN - CHECK ALLOCATION OF THE LBN

    11-  163	MULTAL, BLKFRE

    12-  200	WRITE FILE HEADER

    12-  228	FORMAT STRINGS

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 7





      1						.TITLE	VFYCCK M0101, VFY - CONSISTENCY CHECK LOGIC

						.SBTTL	**** VFYCCK VERSION M0101 ****

						.IDENT	/M0101/

      2					; ALTERED:

      3					; ANDREW C. GOLDSTEIN  26-JUL-78  10:30

      4					;

      5					;

      6					; COPYRIGHT (C) 1977

      7					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

      8					;

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

     10					; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

     11					; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

     12					; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

     13					; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

     14					; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

     15					; REMAIN IN DEC.

     16					;

     17					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

     18					; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

     19					; CORPORATION.

     20					;

     21					; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

     22					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     23

     24					;

     25					; PETER H. LIPMAN 31-OCT-74

     26					; ALTERED  THURSDAY 31-OCT-74 9:35

     27					;

     28						.MCALL	CALL,CALLR,RETURN,GET$,PUT$

     29						.MCALL	FHDL2$,HMBL2$	;FILE HEADER & HOME BLOCK OFFSETS.

     30	000000					FHDL2$	DEF$L		;DEFINE FILE HEADER OFFSETS LOCALLY.

     31	000000					HMBL2$	DEF$L		;DEFINE HOME BLOCK OFFSETS LOCALLY.

     32	000000					PURE.I

     33

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 8

**** VFYCCK VERSION M0101 ****



     35					;+

     36					;

     37					; ** CONCHK - PERFORM THE HEADER MAP AREA CONSISTENCY CHECK

     38					;

     39					; INPUTS:

     40					;

     41					;	R1=ADDRESS OF HEADER

     42					;	INDEX*F.NRBD+2=ADDRESS OF HEADER

     43					;

     44					; OUTPUTS:

     45					;

     46					;

     47					;	ALL REGISTERS ALTERED

     48					;

     49					;-

     50	000000	132761 	000200 	000065 	CONCHK::BITB	#SC.MDL,H.SCHA(R1) ;IS FILE MARKED FOR DELETE?

     51	000006	001440 				BEQ	20$		;BRANCH IF NO

     52					;

     53					; FILE IS MARKED FOR DELETE

     54					;

     55	000010	012701 	000117'			MOV	#LO17MG,R1	;FILE IS MARKED FOR DELETE

     56	000014	005002 				CLR	R2

     57	000016					CALL	OUTC

     58	000022	032767 	000000G	000000G		BIT	#UNDLBT,VFYCTL	;UNDELETING DELETED FILES

     59	000030	001427 				BEQ	20$		;BRANCH IF NO

     60	000032	012700 	000000G			MOV	#INDEX,R0

     61	000036	016760 	000000G	000002G		MOV	NXTFID,F.RCNM+2(R0)

     62	000044	116760 	000005G	000001G		MOVB	NXTFID+5,F.RCNM+1(R0)	;FILE ID IS 24 BITS.

     63	000052	016001 	000002G			MOV	F.NRBD+2(R0),R1

     64	000056	142761 	000200 	000065 		BICB	#SC.MDL,H.SCHA(R1) ;RESET THE MARKED FOR DELETE BIT

     65	000064					CALL	WTHEDR

     66	000070	016760 	000000G	000002G		MOV	NXTFID,F.RCNM+2(R0)

     67	000076	116760 	000005G	000001G		MOVB	NXTFID+5,F.RCNM+1(R0)	;FILE ID IS 24 BITS.

     68	000104					CALL	RDHEDR		;RE-READ THE HEADER, REESTABLISH CONTEXT

     69	000110				20$:

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 9

**** VFYCCK VERSION M0101 ****



     71					;

     72					; ENTER HERE TO CHECK THE CONSISTENCY BUT IGNORE THE MARKED FOR DELETE BIT

     73					;

     74	000110	016701 	000000C		CONCK1::MOV	INDEX+F.NRBD+2,R1	;MAKE R1 POINT TO FILE HEADER.

     75	000114	005000 				CLR 	R0

     76	000116	156100 	000001 			BISB	H.MPOF(R1),R0		;MAP AREA OFFSET TO R0.

     77	000122	006300 				ASL	R0			;CONVERT TO BYTES.

     78	000124	060100 				ADD	R1,R0			;R0 NOW POINTS TO THE MAP AREA.

     79

     80	000126				40$:	CALL	GET1RP			;GET ONE RETRIEVAL POINTER.

     81	000132	103002 				BCC	50$			;BR IF WE GOT A POINTER.

     82	000134					CALLR	TRMOUT			;NO MORE POINTERS, ALL DONE.

     83					;

     84					; R2,R3 -- LBN.    R4,R5 -- COUNT.

     85					;

     86	000140				50$:	CALL	CKLBN			;CHECK ONE CLUSTER.

     87	000144	066703 	000000G			ADD	SBCLUS,R3		;INCREMENT THE LBN

     88	000150	005502 				ADC	R2

     89	000152	166705 	000000G			SUB	SBCLUS,R5		;DECREMENT THE BLOCK COUNT.

     90	000156	005604 				SBC	R4

     91	000160	010546 				MOV	R5,-(SP)		;DOUBLE WORD COMPARE

     92	000162	050426 				BIS	R4,(SP)+		;AGAINST ZERO.

     93	000164	001365 				BNE	50$			;LOOP FOR ALL BLOCKS IN ONE RP.

     94	000166	000757 				BR	40$			;LOOP FOR ALL RP IN MAP AREA.

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 10

CKLBN - CHECK ALLOCATION OF THE LBN



     96						.SBTTL	CKLBN - CHECK ALLOCATION OF THE LBN

     97					; R1=BIT MASK, R2,R3=RECORD NUMBER

     98					; CHECK THE ALLOCATION OF THE LBN

     99	000170	004567 	000000G		CKLBN::	JSR	R5,.SAVR1

    100	000174	010046 				MOV	R0,-(SP)

    101					;

    102					; IS BLOCK NUMBER IN RANGE ?

    103					;

    104	000176	010267 	000000G			MOV	R2,LBN		;SAVE CURRENT LOGICAL BLOCK NO.

    105	000202	010367 	000002G			MOV	R3,LBN+2

    106	000206	020267 	000000G			CMP	R2,MAXLBN

    107	000212	001002 				BNE	5$

    108	000214	020367 	000002G			CMP	R3,MAXLBN+2

    109	000220	103407 			5$:	BLO	10$

    110

    111					; BLOCK NUMBER OUT OF RANGE

    112	000222	005267 	000000G			INC	NBAD

    113	000226	012701 	000033'			MOV	#LO04MG,R1

    114	000232					CALL	OUTLB		;REPORT BAD BLOCK NUMBER

    115	000236	000475 				BR	50$		;AND SKIP THE BIT MAP CHECKS

    116					;

    117					; CHECK IF CLUSTER IS ALLOCATED.

    118					;

    119	000240				10$:	CALL	LBNBIT

    120	000244	012700 	000000G			MOV	#TBTMAP,R0	;CHECK THE TEMP BIT MAP

    121	000250					CALL	BITREC

    122	000254					GET$	R0,,,RDERR

    123	000266	030167 	000000G			BIT	R1,BITWRD	;SHOULD BE SET=FREE

    124	000272	001005 				BNE	20$		;BRANCH IF IT IS OK

    125					;

    126					; CLUSTER IS MULTIPLY ALLOCATED, RECORD IN TEMP BITMAP AND GIVE ERR MSG.

    127					;

    128	000274	005267 	000000G			INC	NMULT

    129	000300					CALL	MULTAL		;MULTIPLE ALLOCATION

    130	000304	000411 				BR	25$

    131					;

    132					; MARK IT ALLOCATED, SO NEXT PASS CHECK IT.

    133					;

    134	000306	040167 	000000G		20$:	BIC	R1,BITWRD	;MARK IT ALLOCATED

    135	000312					CALL	BITREC

    136	000316					PUT$	R0,,,WRTERR

    137					;

    138					; NOW CHECK THE REAL STORAGE BITMAP.

    139					;

    140	000330	012700 	000000G		25$:	MOV	#BITMAP,R0	;NOW CHECK THE REAL BIT MAP

    141	000334					CALL	BITREC

    142	000340					GET$	R0,,,RDERR

    143	000352	030167 	000000G			BIT	R1,BITWRD	;SHOULD ALREADY BE ALLOCATE

    144	000356	001425 				BEQ	50$		;BRANCH IF IT IS

    145					;

    146					; CLUSTER IS MARKED FREE, BUT IS ACTUALLY PART OF SOME FILE.

    147					;

    148	000360	032767 	000000G	000000G		BIT	#RBUILD,VFYCTL	;REBUILDING BIT MAP?

    149	000366	001004 				BNE	30$		;BRANCH IF YES, SKIP ERROR MSG

    150	000370	005267 	000000G			INC	NFREE

    151	000374					CALL	BLKFRE		;BLOCK IN USE, MARKED FREE

    152					;

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 10-1

CKLBN - CHECK ALLOCATION OF THE LBN



    153					; FIX THE ERROR IF UPDATE SWITCH IS ON.

    154					;

    155	000400	032767 	000000G	000000G	30$:	BIT	#UPDATE,VFYCTL  ;FIXING THIS TYPE OF ERROR?

    156	000406	001411 				BEQ	50$		;BRANCH IF NO

    157	000410	040167 	000000G			BIC	R1,BITWRD

    158	000414					CALL	BITREC		;UPDATE BIT TABLE

    159	000420					PUT$	R0,,,WRTERR

    160	000432	012600 			50$:	MOV	(SP)+,R0

    161	000434					RETURN

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 11

MULTAL, BLKFRE



    163						.SBTTL	MULTAL, BLKFRE

    164					; RECORD MULTIPLE ALLOCATION ERROR

    165					; CALLING SEQUENCE:

    166					;	CALL	MULTAL

    167					; INPUTS:

    168					;	R0=TEMP BIT MAP FDB ADDRESS

    169					;	R1=BIT TO TEST IN WORD

    170					;	R2,R3 =WORD NUMBER TO TEST

    171					; OUTPUTS:

    172					;	ALL REGISTERS PRESERVED

    173					; OPERATION:

    174					;	RECORDS THE MULTIPLY ALLOCATED BLOCK IN THE MULT ALLOC

    175					; PORTION OF THE TEMP BITMAP, AND SEND THE ERROR MESSAGE TO THE LISTING

    176					;-

    177	000436				MULTAL::CALL	$SAVAL

    178	000442	005267 	000000G			INC	MLTALC		;COUNT THESE ERRORS

    179	000446	016705 	000000G			MOV	NBTBLK,R5	;NO. OF BLOCKS IN BITMAP

    180	000452	000305 				SWAB	R5		;MULTIPLY BY 256.

    181	000454	105005 				CLRB	R5

    182	000456	060503 				ADD	R5,R3

    183	000460	005502 				ADC	R2

    184					; NOW R2,R3 ARE THE WORD NO. INTO THE MULTIPLE ALLOCATION BITMAP

    185	000462					CALL	BITREC

    186	000466					GET$	R0,,,RDERR

    187	000500	040167 	000000G			BIC	R1,BITWRD

    188	000504					CALL	BITREC

    189	000510					PUT$	R0,,,WRTERR	;NOTE BLOCK IN USE

    190	000522	012701 	000000'			MOV	#LO03MG,R1

    191	000526					CALL	OUTLB

    192	000532					RETURN

    193					;

    194					; BLOCK WAS FOUND FREE. SHOULD HAVE BEEN MARKED IN USE

    195	000534				BLKFRE::CALL	$SAVAL

    196	000540	012701 	000063'			MOV	#LO06MG,R1

    197	000544					CALL	OUTLB

    198	000550					RETURN

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 12

WRITE FILE HEADER



    200						.SBTTL	WRITE FILE HEADER

    201					;+

    202					; WRITE FILE HEADER

    203					; INPUTS:

    204					;	R0=FDB ADDRESS

    205					;	F.RCNM = FILE ID, MUST ADD IN OFFSET

    206					; OUTPUTS:

    207					;	C=0 IF OK, C=1 IF ERROR, MESSAGE WRITTEN IF ERROR

    208					;	IF SUCCESSFUL, ALL REGISTERS PRESERVED

    209					;	IF UNSUCCESSFUL, ALL REGISTERS ARE ALTERED

    210					;-

    211	000552				WTHEDR::CALL	$SAVAL

    212	000556	012704 	000377 			MOV	#255.,R4

    213	000562	016002 	000002G			MOV	F.NRBD+2(R0),R2

    214	000566	005003 				CLR	R3

    215	000570	062203 			10$:	ADD	(R2)+,R3	;CALCULATE NEW CHECKSUM

    216	000572					SOB	R4,10$

    217	000576	010312 				MOV	R3,@R2		;STORE THE NEW CHECKSUM

    218	000600	066760 	000000G	000002G		ADD	INXOFF,F.RCNM+2(R0)

    219	000606	005560 	000000G			ADC	F.RCNM(R0)

    220	000612					CALL	.POSRC

    221	000616	103404 				BCS	20$

    222	000620					PUT$	R0

    223	000624	103401 				BCS	20$

    224	000626					RETURN

    225	000630	012701 	000152'		20$:	MOV	#LO22MG,R1	;ERROR WRITING INDEX FILE

    226	000634					CALLR	HDRERR

    227

    228						.SBTTL	FORMAT STRINGS

    229	000000					.PSECT

    230

    231	000000					MSGZ	LO03,<	MULTIPLE ALLOCATION	%O,%P>

    232	000000					MSGZ	LO04,<	BAD BLOCK NUMBER	%O,%P>

    233	000000					MSGZ	LO06,<	BLOCK IS MARKED FREE	%O,%P>

    234	000000					MSGZ	LO17,<	FILE IS MARKED FOR DELETE>

    235	000000					MSGZ	LO22,<	I/O ERROR WRITING FILE HEADER - ERROR CODE %D.>

    236						.EVEN

    237					;

    238					;

    239		000001 				.END

VFYCCK M0101, VFY - CONSISTENCY	MACRO M1110  22-AUG-78 00:37  PAGE 12-1

SYMBOL TABLE



BITMAP= ****** GX	H.FIEX= 000106   	H.RSVF= 000042   	LO03MG= 000000R     003	R$$EIS= 000000

BITREC= ****** GX	H.FLEV= 000006   	H.RVN = 000046   	LO03SZ= 000033   	R$$MSG= 000000

BITWRD= ****** GX	H.FMAX= 000034   	H.SBCL= 000016   	LO04MG= 000033R     003	R$$11M= 000001

BLKFRE  000534RG    002	H.FNUM= 000010   	H.SCHA= 000065   	LO04SZ= 000030   	SBCLUS= ****** GX

CKLBN   000170RG    002	H.FOWN= 000074   	H.SEMK= 000104   	LO06MG= 000063R     003	SC.BAD= 000100

CONCHK  000000RG    002	H.FPRO= 000100   	H.SMMX= 000110   	LO06SZ= 000034   	SC.DIR= 000040

CONCK1  000110RG    002	H.FRVN= 000014   	H.SNAM= 000714   	LO17MG= 000117R     003	SC.MDL= 000200

FP.DEL= 000010   	H.FSEG= 000004   	H.UCHA= 000064   	LO17SZ= 000033   	S.HDHD= 000114

FP.EXE= 000004   	H.FSEQ= 000012   	H.UFAT= 000024   	LO22MG= 000152R     003	S.IDHD= 000202

FP.RDV= 000001   	H.HBLB= 000000   	H.USE = 000072   	LO22SZ= 000060   	S.MPHD= 000000

FP.WRV= 000002   	H.HBVB= 000020   	H.VCHA= 000052   	MAXLBN= ****** GX	TBTMAP= ****** GX

F.NRBD= ****** GX	H.IBLB= 000030   	H.VDAT= 000074   	MLTALC= ****** GX	TRMOUT= ****** GX

F.RCNM= ****** GX	H.IBSZ= 000040   	H.VLEV= 000014   	MULTAL  000436RG    002	UC.CON= 000200

GET1RP= ****** GX	H.IBVB= 000026   	H.VOWN= 000054   	NBAD  = ****** GX	UC.DLK= 000100

HDRERR= ****** GX	H.IDOF= 000000   	H.VPRO= 000064   	NBTBLK= ****** GX	UNDLBT= ****** GX

H.ACOF= 000002   	H.IHLB= 000010   	H.VSMX= 000060   	NB.NXD= 020000   	UPDATE= ****** GX

H.AHLB= 000004   	H.IHVB= 000024   	H.WISZ= 000104   	NFREE = ****** GX	VFYCTL= ****** GX

H.AHVB= 000022   	H.INDF= 000760   	INDEX = ****** GX	NMULT = ****** GX	WRTERR= ****** GX

H.CHK1= 000072   	H.INDN= 000730   	INXOFF= ****** GX	NXTFID= ****** GX	WTHEDR  000552RG    002

H.CHK2= 000776   	H.INDO= 000744   	I.BKDT= 000052   	OUTC  = ****** GX	$SAVAL= ****** GX

H.CKSM= 000776   	H.LRUC= 000105   	I.CRDT= 000022   	OUTLB = ****** GX	$$$T1 = 000067

H.DFPR= 000066   	H.MPOF= 000001   	I.EXDT= 000042   	PAR$$$= 000000   	.GET  = ****** G

H.DRPR= 000070   	H.NVOL= 000050   	I.FNAM= 000000   	RBUILD= ****** GX	.POSRC= ****** GX

H.DVTY= 000044   	H.PRIV= 000073   	I.RVDT= 000032   	RDERR = ****** GX	.PUT  = ****** G

H.EFNU= 000016   	H.PROG= 000074   	I.RVNO= 000020   	RDHEDR= ****** GX	.SAVR1= ****** GX

H.EFSQ= 000020   	H.PROJ= 000076   	I.ULAB= 000062   	R$$DPB= 000001   	...GBL= 000000

H.ERVN= 000022   	H.RPRO= 000102   	LBN   = ****** GX	R$$DYM= 000001   	...TPC= 001000

H.FCHA= 000064   	H.RSOF= 000003   	LBNBIT= ****** GX



. ABS.	000000	   000

      	000000	   001

PURE$I	000640	   002

MSGSTR	000232	   003

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  5210 WORDS  ( 21 PAGES)

DYNAMIC MEMORY:  5940 WORDS  ( 22 PAGES)

ELAPSED TIME:  00:00:23

EXE$:VFYCCK,LIS$:VFYCCK/-SP=SRC$:PIPMAC,VFYCCK

