VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38

TABLE OF CONTENTS



     7-    1	**** VFYOPN VERSION M0113 ****

     8-   41	OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES

    12-  264	INITIALIZE THE BIT MAP FILES

    13-  346	OPEN ROUTINES FOR THE LISTING AND INDEX FILES

    14-  449	FORMAT STRINGS

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 7





      1						.TITLE	VFYOPN M0113, OPEN THE FILES

						.SBTTL	**** VFYOPN VERSION M0113 ****

						.IDENT	/M0113/

      2					; ALTERED:

      3					; ANDREW C. GOLDSTEIN  4-AUG-78  11:43

      4					;

      5					; COPYRIGHT (C) 1977

      6					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

      7					;

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

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

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

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

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

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

     14					; REMAIN IN DEC.

     15					;

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

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

     18					; CORPORATION.

     19					;

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

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

     22

     23					;

     24					; PETER H. LIPMAN 28-OCT-74

     25					; ALTERED FRIDAY 10-JAN-75 11:20

     26					;

     27					;	DHC001	9/6/77	ADD RETURN WITH STATUS

     28					;

     29						.MCALL	CALL,RETURN,GET$,PUT$,FDAT$R,FDRC$R,FDOP$R,CSI$

     30						.MCALL	OPEN$R,OPEN$W,OPEN$M,OPNT$D,OPNS$R,OPNS$M,GLUN$S

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

     32

     33	000000					CSI$

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

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

     36	000000					SCBL2$	DEF$L			;DEFINE HOME BLOCK OFFSETS LOCALLY.

     37

     38	000000					PURE.I

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 8

**** VFYOPN VERSION M0113 ****



     40

     41						.SBTTL	OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES

     42					;

     43					; OPEN THE LISTING AND BIT MAP FILES

     44					;

     45	000000				OPENF::	CALL	OPNOUT		;OPEN THE LISTING FILE

     46	000004	103460 				BCS	17$		;BRANCH IF FAILED

     47	000006	032767 	000000C	000000G		BIT	#LISTBT!RDCKBT!LOSTBT,VFYCTL ;IF /LI, /LO, OR /RC

     48	000014	001402 				BEQ	4$

     49	000016	000167 	000720 			JMP	50$		;NO BITMAP OR TEMP FILES NEEDED

     50					;

     51					; OPEN THE BITMAP FILE

     52					;

     53	000022	005067 	000000C		4$:	CLR	BITMAP+F.FNB+N.FID+2 ;SO I CAN SEE IF IT WAS FOUND

     54	000026	012700 	000000G		8$:	MOV	#BITMAP,R0

     55	000032	012760 	000000G	000000G		MOV	#STBLK,F.STBK(R0)

     56	000040					FDOP$R	R0,,,#BITDFN

     57	000046					FDRC$R	R0,#FD.PLC!FD.RAN

     58	000054	032767 	000000G	000000G		BIT	#UPDATE,VFYCTL

     59	000062	001406 				BEQ	10$

     60	000064					OPEN$M	R0		;OPEN THE BIT MAP FOR MODIFY

     61	000076	000405 				BR	15$

     62	000100				10$:	OPEN$R	R0		;OPEN THE BIT MAP FOR READ ONLY

     63	000112	103033 			15$:	BCC	20$		;BRANCH IF SUCCESSFULLY OPENED

     64	000114	122760 	000000G	000000G		CMPB	#IE.PRI,F.ERR(R0) ;REPORT PRIVILEGE VIOLATION IF ANY

     65	000122	001403 				BEQ	16$

     66	000124	005760 	000000C			TST	F.FNB+N.FID+2(R0)

     67	000130	001410 				BEQ	18$		;BRANCH IF FAILED TO FIND FILE ID

     68	000132				16$:	ERROUT	ER02,0,0	;FAILED TO OPEN BITMAP FILE

	000132	104426 				TRAP	X

	000134	000000G				.WORD	ER02SZ

	000136	000000G				.WORD	ER02MG

     69	000140	016767 	000000G	000000G		MOV	EX$WAR,.EXSTS	; SET STATUS TO WARNING			;DHC001

     70	000146	000167 	000000G		17$:	JMP	RSTART

     71	000152	012760 	000000G	000000C	18$:	MOV	#BITFID,F.FNB+N.FID(R0) ;USE KNOWN ID, AND TRY AGAIN

     72	000160	012760 	000000G	000000C		MOV	#BITFID,F.FNB+N.FID+2(R0)

     73	000166	012701 	000136'			MOV	#LO19MG,R1	;REPORT FAILURE TO FIND BITMAP

     74	000172	005002 				CLR	R2

     75	000174					CALL	OUT1

     76	000200	000712 				BR	8$

     77	000202				20$:	FDAT$R	R0,#R.FIX	;FIXED LENGTH RECORDS

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 9

OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES



     79					;

     80					; GET THE DEVICE GEOMETRY FROM THE OS DATA BASE VIA GLUN$

     81					;

     82	000210					GLUN$S	#BITLUN,#INXBIT		;GET LUN INFO.

     83	000226	016700 	000006G			MOV 	INXBIT+G.LUCW+2,R0	;# OF TRACKS & # OF SECTORS TO R0.

     84	000232	010001 				MOV	R0,R1			;SAVE TRACKS INFORMATION..

     85	000234	042700 	177400 			BIC	#^C377,R0		;ISOLATE THE SECTORS INFO.

     86	000240	105001 				CLRB	R1			;ISOLATE THE TRACKS INFO.

     87	000242	000301 				SWAB	R1			;MOV TRACK INFO TO LOW ORDER.

     88	000244					CALL	$MUL			;COMPUTE SECTORS PER CYLINDER.

     89	000250	010100 				MOV	R1,R0			;SECTORS PER CYLINDER TO R0.

     90	000252	005002 				CLR	R2			;ALWAYS LT 65K CYLINDERS.

     91	000254	016703 	000010G			MOV	INXBIT+G.LUCW+4,R3	;NUMBER OF CYLINDERS TO R3.

     92	000260					CALL	$DMUL			;COMPUTE BLOCKS PER VOLUME.

     93	000264	005700 				TST	R0			;CHECK ZERO HIGH ORDER

     94	000266	001015 				BNE	22$

     95	000270	020127 	050000 			CMP	R1,#10240.*2		;CHECK IF RL01

     96	000274	001411 				BEQ	21$			;BRANCH IF YES

     97	000276	020127 	120000 			CMP	R1,#20480.*2		;CHECK IF RL02

     98	000302	001406 				BEQ	21$

     99	000304	020127 	003722 			CMP	R1,#26.*77.		;CHECK IF FLOPPY

    100	000310	001004 				BNE	22$			;BRANCH IF NOT

    101	000312	012701 	000756 			MOV	#494.,R1		;GET LOGICAL SIZE OF FLOPPY

    102	000316	000401 				BR	22$

    103	000320	006201 			21$:	ASR	R1			;AND BY 2 FOR RL01/02

    104	000322	010067 	000000G		22$:	MOV	R0,LBN			;SAVE NUMBER OF BLOCKS ON

    105	000326	010167 	000002G			MOV	R1,LBN+2		;VOLUME FOR USE BELOW.

    106	000332	010067 	000000G			MOV	R0,MAXLBN

    107	000336	010167 	000002G			MOV	R1,MAXLBN+2

    108					;

    109					; READ THE STORAGE CONTROL BLOCK

    110					;

    111	000342	012700 	000000G			MOV	#BITMAP,R0		;ADDR OF BITMAP FDB TO R0.

    112	000346	012701 	001000 			MOV	#512.,R1

    113	000352	012702 	000000G			MOV	#INXBIT,R2

    114	000356					CALL	SETREC			;512 BYTE RECORDS

    115	000362					GET$	R0,,,RDERR		;READ VBN 1

    116	000374	016005 	000002G			MOV	F.NRBD+2(R0),R5		;R5=POINTER TO STORAGE CONTROL BLOCK

    117	000400	016003 	000002G			MOV	F.EFBK+2(R0),R3		;R3=ACTUAL SIZE OF FILE

    118	000404	162703 	000002 			SUB	#2,R3			; DEDUCT SCB AND (F.FFBY=0).

    119	000410	010367 	000000G			MOV	R3,NBTBLK		;SAVE NO OF BIT MAP BLOCKS

    120	000414	005002 				CLR	R2

    121					;

    122					; MULTIPLY THE CLUSTER FACTOR BY THE NUMBER OF BITS IN ONE BLOCK.

    123					;

    124	000416	016500 	000002 			MOV	C.SBCL(R5),R0		;STORAGE BIT MAP CLUSTER FACTOR TO R0.

    125	000422	010067 	000000G			MOV	R0,SBCLUS		; SAVE FOR LATER USE.

    126	000426	000300 				SWAB	R0			;FIRST MULTIPLY BY 256.

    127	000430	006300 				ASL	R0			;512

    128	000432	006300 				ASL	R0			;1024

    129	000434	006300 				ASL	R0			;2048

    130	000436	006300 				ASL	R0			;4096 BITS PER BLOCK.

    131					;

    132					; MULTIPLY (BLOCKS PER BIT MAP BLOCK) BY (NUMBER OF BIT MAP BLOCKS).

    133					;

    134	000440					CALL	$DMUL			;MULTIPLY R2,R3 BY R0, RESULT TO R0,R1

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 10

OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES



    136					;

    137					; THE STORAGE BITMAP FILE SHOULD BE LARGE ENOUGH TO SUPPORT

    138					; THE NUMBER OF BLOCKS INDICATED BY THE DEVICE GEOMETRY INFO

    139					;

    140	000444	026700 	000000G			CMP	LBN,R0			;BITMAP BIG ENOUGH ?

    141	000450	001002 				BNE	25$			;BR IF HIGH ORDER NE.

    142	000452	026701 	000002G			CMP	LBN+2,R1

    143	000456	101407 			25$:	BLOS	30$			;BR IF BIG ENOUGH.

    144					;

    145					; THE BIT MAP IS TOO SMALL. PUT OUT AN ERROR MSG AND QUIT.

    146					;

    147	000460	012701 	000000'			MOV	#LO01MG,R1		;"BIT MAP FILE TOO SMALL".

    148	000464	005002 				CLR	R2

    149	000466					CALL	OUT1

    150	000472	000167 	000000G			JMP	RSTART			;QUIT..

    151					;

    152					; THE VOLUME SIZE GIVEN IN THE STORAGE CONTROL BLOCK SHOULD AGREE WITH

    153					; THE VOLUME SIZE COMPUTED FROM THE DEVICE GEOMETRY INFORMATION.

    154					;

    155	000476	016503 	000004 		30$:	MOV	C.VSIZ(R5),R3		;VOL SIZE FRM SCB TO R2,R3.

    156	000502	016502 	000006 			MOV	C.VSIZ+2(R5),R2		;ODS-2 HAS LOW ORDER FIRST.

    157	000506	020267 	000000G			CMP	R2,LBN			;IS SCB OK ?

    158	000512	001004 				BNE	35$			;BR IF SCB OK

    159	000514	020367 	000002G			CMP	R3,LBN+2

    160	000520	001001 				BNE	35$			;BR IF SCB IS NO GOOD.

    161	000522	000412 				BR	38$

    162					;

    163					; STORAGE CONTROL BLOCK IS BAD. ISSUE A WARNING AND CONTINUE.

    164					;

    165	000524	012701 	000452'		35$:	MOV	#LO71MG,R1	;STORAGE CONTROL BLOCK BAD

    166	000530	005002 				CLR	R2

    167	000532					CALL	OUT1

    168	000536	012701 	000543'			MOV	#LO72MG,R1

    169	000542	005002 				CLR	R2

    170	000544					CALL	OUT1

    171	000550	012700 	000000G		38$:	MOV	#BITMAP,R0

    172	000554	012767 	000002 	000000G		MOV	#2,FBTBLK	;VBN OF FIRST BIT MAP BLOCK

    173	000562	012767 	000401 	000000G		MOV	#257.,MAPOFF	;NO. OF RECORDS TO ADD TO RECORD NO

    174	000570					FDRC$R	R0,#FD.RAN

    175	000576	032767 	000000G	000000G		BIT	#FREEBT,VFYCTL	;PRINT FREE BLOCKS LEFT?

    176	000604	001402 				BEQ	40$

    177	000606	000177 	000000G			JMP	@.FREP1		;YES

    178	000612	012701 	000002 		40$:	MOV	#2,R1

    179	000616	012702 	000000G			MOV	#BITWRD,R2

    180	000622					CALL	SETREC		;2 BYTE RECORDS

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 11

OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES



    182					;

    183					; OPEN THE TEMPORARY BIT MAP

    184					; THIS FILE IDEALLY SHOULD NOT BE ON THE DEVICE BEING VERIFIED.

    185					; IF IT IS, HOWEVER, VFY DOES NOTHING SPECIAL. THIS VERSION SHOULD NOT

    186					; BE RUN ON SYSTEMS EARLIER THAN RSX-11M V3, RSX-11D V6.2, OR IAS V2.0.

    187					; EARLIER SYSTEMS DO NOT HAVE THE STORAGE MAP WRITER INTERLOCK AND WILL CAUSE

    188					; THE STORAGE MAP TO BE MUNGED IF THE TEMP FILE IS ON THE DEVICE BEING VERIFIED.

    189	000626					FDAT$R	#TBTMAP,#R.FIX,#0,#2

    190	000652					FDRC$R	R0,#FD.RAN,#BITWRD,#2

    191					;

    192					; GET THE DEVICE NAME AND UNIT FOR THE TEMP FILE

    193					;

    194	000674					OPNT$D	R0		;CREATE AND MARK TEMP FILE FOR DELETE

    195	000714	103527 				BCS	85$

    196					;

    197					; CREATE TEMP BITM WITH ROOM FOR 2 MAPS

    198	000716	016701 	000000G			MOV	NBTBLK,R1

    199	000722	006301 				ASL	R1		;2* NO. OF BIT MAP BLOCKS

    200	000724	066701 	000000G			ADD	FBTBLK,R1	;PLUS THE 1ST VBN OF BIT MAP

    201	000730	005301 				DEC	R1		;-1 TO GET NO. OF BLOCKS

    202	000732	005002 				CLR	R2		;R2=NON CONTIGUOUS ALLOCATION

    203	000734					CALL	.EXTND		;ALLOCATE SPACE

    204	000740	103512 				BCS	78$

    205					;

    206					; OPEN THE INDEX FILE AND INITIALIZE

    207	000742				50$:	CALL	OPNINX

    208	000746	103515 				BCS	99$

    209	000750	032767 	000000G	000000G		BIT	#LOSTBT,VFYCTL	;/LO COMMAND?

    210	000756	001402 				BEQ	55$		;BRANCH IF NO

    211	000760	000177 	000000G			JMP	@.LOST1		;YES, GO DO THE LOST FILE SCAN

    212	000764	012702 	000000G		55$:	MOV	#MOPRM,R2

    213	000770	012712 	000000C			MOV	#INDEX+F.DVNM,@R2

    214	000774	016762 	000000C	000002 		MOV	INDEX+F.UNIT,2(R2)

    215	001002	012701 	000243'			MOV	#LO33MG,R1	;TITLE LINE FOR BITMAP/INDEX CONSISTENCY

    216	001006	032767 	000000C	000000G		BIT	#LISTBT!RDCKBT,VFYCTL

    217	001014	001005 				BNE	60$		;BRANCH IF LISTING OR READ CHECK

    218	001016	012701 	000243'			MOV	#LO33MG,R1	;TITLE LINE FOR BITMAP/INDEX CONSISTENCY

    219	001022					CALL	OUT1

    220	001026	000472 				BR	INIBIT		;GO DO THE CONSISTENCY CHECK

    221	001030	012701 	000327'		60$:	MOV	#LO34MG,R1	;TITLE FOR INDEX FILE LISTING

    222	001034	032767 	000000G	000000G		BIT	#LISTBT,VFYCTL	;ARE WE LISTING THE INDEX FILE?

    223	001042	001045 				BNE	70$		;BRANCH IF YES

    224					;

    225					; DOING A READ CHECK ON THE SPECIFIED DEVICE, CALCULATE AND

    226					; PRINT THE BLOCK COUNT TO BE USED IN READING THE FILES

    227					;

    228	001044	016700 	000000C			MOV	FDBOUT+F.BBFS,R0 ;BUFFER SPACE NEEDED BY LISTING FILE

    229	001050	062700 	000000C			ADD	#<<3*S.BFHD>+2000>,R0 ;TOTAL BUFFER SPACE NEEDED BY FCS

    230	001054	016701 	000000G			MOV	.DYSIZ,R1	;NO OF BYTES OF DYNAMIC MEMORY

    231	001060	160001 				SUB	R0,R1		;FORM NO. OF BYTES LEFT FOR READ CHECK BUF

    232	001062	042701 	000777 			BIC	#777,R1		;TRUNCATE TO INTEGRAL NO. OF BLOCKS

    233	001066	001447 				BEQ	110$		;BRANCH IF NOT ENOUGH SPACE LEFT

    234	001070	010146 				MOV	R1,-(SP)

    235	001072	010246 				MOV	R2,-(SP)

    236	001074	013700 	000000G			MOV	@#.FSRPT,R0

    237	001100					CALL	$RQCB		;ALLOCATE A BUFFER

    238	001104	103440 				BCS	110$		;BRANCH IF NO ROOM

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 11-1

OPEN THE LISTING, BITMAP, TEMP, AND INDEX FILES



    239	001106	012602 				MOV	(SP)+,R2

    240	001110	012601 				MOV	(SP)+,R1

    241	001112	010067 	000000G			MOV	R0,.DYBUF	;SAVE ADDRESS OF BUFFER

    242	001116	010167 	000000G			MOV	R1,.DYBYT	;AND IT'S SIZE IN BYTES

    243	001122	000301 				SWAB	R1

    244	001124	006201 				ASR	R1		;MAX BLOCKS AVAILABLE

    245	001126	016700 	000000G			MOV	.RCBLK,R0	;DID USER SPECIFY A BLOCKING FACTOR?

    246	001132	001402 				BEQ	62$		;BRANCH IF NO, USE THE DEFAULT

    247	001134	020001 				CMP	R0,R1		;DID HE ASK FOR MORE THAN IS AVAILABLE?

    248	001136	101401 				BLOS	65$		;BRANCH IF NO, USE HIS NUMBER

    249	001140	010100 			62$:	MOV	R1,R0		;USE THE DEFAULT (MAX) NO. OF BUFFERS

    250	001142	010067 	000000G		65$:	MOV	R0,.RCBLK	;SET NO. OF BLOCKS TO USE

    251	001146	010062 	000004 			MOV	R0,4(R2)	;SET NO. OF BLOCKS TO PRINT

    252	001152	012701 	000364'			MOV	#LO50MG,R1	;READ CHECK TITLE MESSAGE

    253	001156				70$:	CALL	OUT1

    254	001162	000167 	000000G			JMP	INXSC2

    255					;

    256					; FAILED TO EXTEND TEMPORARY BIT MAP

    257	001166				78$:	ERROUX	ER04,0,0

	001166	104427 				TRAP	X

	001170	000000G				.WORD	ER04SZ

	001172	000000G				.WORD	ER04MG

    258

    259					; FAILED TO OPEN TEMPORARY BIT MAP FILE

    260	001174				85$:	ERROUX	ER03,0,0

	001174	104427 				TRAP	X

	001176	000000G				.WORD	ER03SZ

	001200	000000G				.WORD	ER03MG

    261	001202	000167 	000000G		99$:	JMP	RSTART

    262	001206				110$:	ERROUX	ER17		;NOT ENOUGH DYNAMIC MEMORY SPACE

	001206	104403 				TRAP	X

	001210	000000G				.WORD	ER17SZ

	001212	000000G				.WORD	ER17MG

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 12

INITIALIZE THE BIT MAP FILES



    264						.SBTTL	INITIALIZE THE BIT MAP FILES

    265					;

    266					; INITIALIZE THE TEMPORARY BIT MAP AND THE REAL ONE IF REBUILDING

    267	001214	016767 	000000G	000000C	INIBIT:	MOV	MAPOFF,TBTMAP+F.RCNM+2

    268	001222	016767 	000000G	000000C		MOV	MAPOFF,BITMAP+F.RCNM+2

    269	001230	016701 	000000G			MOV	MAXLBN,R1

    270	001234	016702 	000002G			MOV	MAXLBN+2,R2

    271	001240	016700 	000000G			MOV	SBCLUS,R0	;CLUSTER FACTOR BECOMES DIVISOR.

    272	001244					CALL	$DDIV		;DOUBLE PRECISION DIVIDE R1,R2 BY R0.

    273	001250	010104 				MOV	R1,R4		;REARRANGE QUOTIENT TO SUIT THE

    274	001252	010205 				MOV	R2,R5		;ORIGINAL CODE. UGH !

    275	001254	010246 				MOV	R2,-(SP)	;SAVE FOR USE BELOW.

    276					;

    277					; CONVERT NUMBER OF BITS TO NUMBER OF WORDS.

    278					;

    279						.IF	GT,R$$EIS

    280						ASHC	#-4,R4

    281

    282						.IFF

    283	001256	012746 	000004 			MOV	#4,-(SP)	;RIGHT SHIFT R4, R5 4 BITS

    284	001262	006204 			10$:	ASR	R4

    285	001264	006005 				ROR	R5

    286	001266	005316 				DEC	(SP)

    287	001270	003374 				BGT	10$

    288	001272	005726 				TST	(SP)+		;POP THE EXHAUSTED SHIFT COUNT

    289						.ENDC

    290

    291	001274	010546 				MOV	R5,-(SP)	;KEEP TRACK OF WORDS WRITTEN IN LAST BLOCK

    292	001276	012767 	177777 	000000G		MOV	#-1,BITWRD	;BIT SET MEANS BLOCK FREE

    293	001304					CALL	INILP		;WRITE WORDS OF ALL ONE BITS INTO BIT MAP

    294	001310	016601 	000002 			MOV	2(SP),R1	;LOW ORDER BITS OF (MAXLBN/SBCLUS) TO R1.

    295	001314	005002 				CLR	R2

    296	001316	005226 				INC	(SP)+		;DISCARD (MAXLBN/SBCLUS).

    297	001320	042701 	177760 			BIC	#177760,R1

    298

    299						.IF	EQ,R$$EIS

    300	001324	001404 				BEQ	30$

    301	001326	000261 			20$:	SEC

    302	001330	006102 				ROL	R2		;SHIFT 1 BITS INTO R2 (R1) TIMES

    303	001332	005301 				DEC	R1

    304	001334	003374 				BGT	20$

    305	001336				30$:

    306

    307						.IFF

    308						MOV	#-1,R3

    309						ASHC	R1,R2		;SHIFT BITS INTO R2, COUNT IN R1

    310						.ENDC

    311

    312	001336	010267 	000000G			MOV	R2,BITWRD	;SAME BITS SET

    313	001342	012705 	000001 			MOV	#1,R5

    314	001346	005216 				INC	@SP		;NOTE ONE MORE WORD WRITTEN

    315	001350					CALL	INILP

    316					; FILL REMAINING WORDS IN LAST BLOCK WITH 0

    317	001354	012705 	000400 			MOV	#256.,R5

    318	001360	012603 				MOV	(SP)+,R3

    319	001362	042703 	177400 			BIC	#177400,R3

    320	001366	160305 				SUB	R3,R5		;R5=NO. OF WORDS LEFT IN BLOCK

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 12-1

INITIALIZE THE BIT MAP FILES



    321	001370	005067 	000000G			CLR	BITWRD		;ZERO THESE

    322	001374					CALL	INILP

    323	001400	012701 	001000 			MOV	#512.,R1	;SET THE FILE TO 1 BLOCK RECORDS

    324	001404	012702 	000000G			MOV	#INXBIT,R2

    325	001410					CALL	SETREC

    326	001414	016703 	000000G			MOV	NBTBLK,R3	;NO. OF BLOCKS IN BITMAP

    327	001420	016701 	000000G			MOV	FBTBLK,R1	;STARTING BLOCK NO. OF REGULAR BITMAP

    328	001424	010102 				MOV	R1,R2

    329	001426	060302 				ADD	R3,R2		;STARTING BLOCK NO. OF MULT ALLOC BITMAP

    330	001430	000167 	000000G			JMP	MULSCN

    331					;

    332					; R4,R5=DBL PRECISION NO. OF WORDS TO PUT ; R0-R3 PRESERVED R4,R5=0

    333	001434	012700 	000000G		INILP:	MOV	#TBTMAP,R0

    334	001440				10$:	PUT$	R0,,,WRTERR	;PUT A RECORD IN TEMP BIT MAP

    335	001452	032767 	000000G	000000G		BIT	#RBUILD,VFYCTL	;READ IF REBUILDING REAL BIT MAP

    336	001460	001411 				BEQ	20$

    337	001462					PUT$	#BITMAP,,,WRTERR ;PUT A RECORD IN THE REAL BIT MAP

    338	001500	012700 	000000G			MOV	#TBTMAP,R0

    339	001504	162705 	000001 		20$:	SUB	#1,R5		;DOUBLE PRECISION SOB

    340	001510	005604 				SBC	R4

    341	001512	010546 				MOV	R5,-(SP)

    342	001514	050426 				BIS	R4,(SP)+

    343	001516	001350 				BNE	10$

    344	001520					RETURN

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 13

OPEN ROUTINES FOR THE LISTING AND INDEX FILES



    346						.SBTTL	OPEN ROUTINES FOR THE LISTING AND INDEX FILES

    347					;+

    348					; OPEN THE OUTPUT FILE FOR LISTING OUTPUT

    349					; INPUTS:

    350					;	NONE

    351					; OUTPUTS:

    352					;	C=0 IF SUCCESSFUL

    353					;	C=1 IF FAILED TO OPEN - ERROR MESSAGE PRINTED

    354					;	ALL REGISTERS ALTERED

    355					;-

    356	001522	016767 	000000G	000000C	OPNOUT:	MOV	TIDEV,OUDFLT+N.DVNM ;ASSUME NO OUTPUT SPEC - OUTPUT TO TI:

    357	001530	016767 	000002G	000000C		MOV	TIDEV+2,OUDFLT+N.UNIT

    358	001536	005767 	000000G			TST	INSPEC		;IF NO INPUT SPEC

    359	001542	001411 				BEQ	5$		;THEN REALLY NO OUTPUT

    360	001544	032767 	000003 	000000G		BIT	#CS.DIF!CS.NMF,OUSPEC ;SEE IF OUTPUT FILE NAME

    361	001552	001405 				BEQ	5$		;BRANCH IF NONE

    362	001554	012767 	054523 	000000C		MOV	#"SY,OUDFLT+N.DVNM ;YES - USE "SY0"

    363	001562	005067 	000000C			CLR	OUDFLT+N.UNIT

    364

    365	001566				5$:	OPEN$W	#FDBOUT

    366	001604	103415 				BCS	50$

    367	001606	132760 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R0) ;UNLESS OUTPUT TO TTY

    368	001614	001007 				BNE	10$

    369	001616	112770 	000014 	000002G		MOVB	#14,@F.NRBD+2(R0) ;PUT OUT A FORM FEED

    370	001624	012701 	000001 			MOV	#1,R1

    371	001630					CALL	OUT2

    372	001634	000241 			10$:	CLC

    373	001636					RETURN

    374					;

    375					; FAILED TO OPEN THE LISTING FILE

    376	001640				50$:	ERROUT	ER14,0,0	;FAILED TO OPEN LISTING FILE

	001640	104426 				TRAP	X

	001642	000000G				.WORD	ER14SZ

	001644	000000G				.WORD	ER14MG

    377	001646	016767 	000000G	000000G		MOV	EX$WAR,.EXSTS	; SET STATUS TO WARNING			;DHC001

    378	001654	000261 				SEC

    379	001656					RETURN

    380					;

    381					;+

    382					; OPEN THE INDEX FILE AND INITIALIZE SOME LOCATIONS

    383					; INPUTS:

    384					;	NONE

    385					; OUTPUTS:

    386					;	C=0 IF SUCCESSFUL

    387					;	C=1 IF FAILED TO OPEN - ERROR MESSAGE SENT

    388					;	ALL REGISTERS ALTERED

    389					;-

    390	001660	005067 	000000C		OPNINX:	CLR	INDEX+F.FNB+N.FID+2 ;SO I CAN TELL IF FIND WORKED

    391	001664	012700 	000000G		45$:	MOV	#INDEX,R0

    392	001670	012760 	000000G	000000G		MOV	#STBLK,F.STBK(R0)

    393	001676	032767 	000000G	000000G		BIT	#UPDINX,VFYCTL	;IF DESIRE TO UPDATE INDEX FILE

    394	001704	001406 				BEQ	50$

    395	001706					OPNS$M	R0		;OPEN FOR SHARED MODIFY

    396	001720	000405 				BR	55$

    397	001722				50$:	OPNS$R	R0		;OTHERWISE JUST OPEN FOR SHARED READ

    398	001734	103033 			55$:	BCC	INIINX		;BRANCH IF OPENED SUCCESSFULLY

    399	001736	122760 	000000G	000000G		CMPB	#IE.PRI,F.ERR(R0) ;IF PRIVILEGE VIOLATION, JUST REPORT IT

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 13-1

OPEN ROUTINES FOR THE LISTING AND INDEX FILES



    400	001744	001417 				BEQ	90$

    401	001746	005760 	000000C			TST	F.FNB+N.FID+2(R0) ;IF FAILED TO FIND FILE ID

    402	001752	001014 				BNE	90$

    403	001754	012760 	000000G	000000C		MOV	#INXFID,F.FNB+N.FID(R0) ;USE THE KNOWN FILE ID

    404	001762	012760 	000000G	000000C		MOV	#INXFID,F.FNB+N.FID+2(R0)

    405	001770	012701 	000032'			MOV	#LO18MG,R1	;AND REPORT THE FAILURE

    406	001774	005002 				CLR	R2

    407	001776					CALL	OUT1

    408	002002	000730 				BR	45$		;NOW GO OPEN THE FILE BY ID

    409					;

    410					; FAILED TO OPEN INDEX FILE

    411	002004				90$:	ERROUT	ER15,0,0

	002004	104426 				TRAP	X

	002006	000000G				.WORD	ER15SZ

	002010	000000G				.WORD	ER15MG

    412	002012	016767 	000000G	000000G		MOV	EX$WAR,.EXSTS	; SET STATUS TO WARNING			;DHC001

    413	002020	000261 				SEC

    414	002022					RETURN

    415					;

    416					; SET UP THE INDEX FILE ATTRIBUTE SECTION

    417					;

    418	002024				INIINX::FDAT$R	R0,#R.FIX,,#512. ;FIX INDEX FILE ATTRIBUTE SECTION

    419					;

    420					; FOR ODS-2, THE INDEX FILE EOF IS APPROXIMATELY CORRECT, AS OPPOSED TO

    421					; BEING TOTALLY NON EXISTENT FOR ODS-1. FOR VERIFY, WE CAUSE F.HIBK AND

    422					; F.EFBK AND F.FFBY IN THE FDB, TO BE UPDATED FROM THE STATISTICS BLOCK.

    423					;

    424	002040	005060 	000000G			CLR	F.HIBK(R0)		; SO FIXEOF WILL UPDATE THE FDB FROM

    425	002044	005060 	000002G			CLR	F.HIBK+2(R0)		; THE STATISTICS BLOCK.

    426	002050					CALL	FIXEOF

    427					;

    428					; READ THE HOME BLOCK.

    429					;

    430	002054	012760 	000002 	000002G		MOV	#2,F.RCNM+2(R0)		;READ THE HOME BLOCK

    431	002062					GET$	R0,,,RDERR

    432	002074	016002 	000002G			MOV	F.NRBD+2(R0),R2

    433	002100	026227 	000014 	001001 		CMP	H.VLEV(R2),#1001	; STRUCTURE LEVEL 2, VERSION 1 ?

    434	002106	001405 				BEQ	10$			; BR IF IT IS.

    435	002110					ERROUT	ER20,0,0		; DISPLAY ERR MSG AND EXIT.

	002110	104426 				TRAP	X

	002112	000000G				.WORD	ER20SZ

	002114	000000G				.WORD	ER20MG

    436	002116	000167 	000000G			JMP	RSTART

    437	002122	016267 	000034 	000002G	10$:	MOV	H.FMAX(R2),MAXFNU+2	;MAXIMUM NUMBER OF FILES.

    438	002130	016267 	000036 	000000G		MOV	H.FMAX+2(R2),MAXFNU	;ODS-2 HAS LOW ORDER BITS FIRST.

    439	002136	016246 	000040 			MOV	H.IBSZ(R2),-(SP)	;INDEX BIT MAP SIZE TO TEMP.

    440	002142	011667 	000000G			MOV	(SP),SINXBT		;SAVE IT FOR LATER USE BY INXSCN.

    441	002146	066216 	000026 			ADD	H.IBVB(R2),(SP)		;COMPUTE (VBN-1) OF FIRST FILE HEADER.

    442	002152	005316 				DEC	(SP)			;NORMALIZE.

    443	002154	012667 	000000G			MOV	(SP)+,INXOFF		;SAVE IT FOR LATER.

    444	002160	016267 	000026 	000000G		MOV	H.IBVB(R2),IBVBN	;SAVE INDEX BIT MAP 1ST VBN.

    445	002166	005067 	000000G			CLR	NXTFID

    446	002172	105067 	000005G			CLRB	NXTFID+5		;FILE ID IS 24 BITS.

    447	002176					RETURN

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 14

FORMAT STRINGS



    449						.SBTTL	FORMAT STRINGS

    450	000000					.PSECT

    451

    452	000000					MSGZ	LO01,<BIT MAP FILE IS TOO SMALL>

    453	000000					MSG	LO18,<FAILED TO FIND INDEXF.SYS;1 IN MFD>

    454	000000					MSGZ	,< - WILL OPEN INDEX BY FILE ID 1,1>

    455	000000					MSG	LO19,<FAILED TO FIND BITMAP.SYS;1 IN MFD>

    456	000000					MSGZ	,< - WILL OPEN BITMAP BY FILE ID 2,2>

    457	000000					MSG	LO33,<%NCONSISTENCY CHECK OF INDEX AND BITMAP>

    458	000000					MSG1	,<^ ON %2A%O:^<15><12><0>>

    459	000000					MSG1	LO34,<^LISTING OF INDEX ON %2A%O:^<15><12><0>>

    460	000000					MSG	LO50,<READ CHECK OF FILES ON %2A%O: - BLOCKING FACTOR %D.>

    461	000000					MSG1	,<<15><12><0>>

    462	000000					MSG	LO71,<STORAGE CONTROL BLOCK (VBN 1 OF BITMAP.SYS) IS >

    463	000000					MSGZ	,<CORRUPTED>

    464	000000					MSGZ	LO72,<CONTINUING WITH VOLUME DATA FROM DEVICE DATA BASE>

    465						.EVEN

    466					;

    467					;

    468		000001 				.END

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 14-1

SYMBOL TABLE



BITDFN= ****** GX	FD.TTY= ****** GX	H.FPRO= 000100   	INXSC2= ****** GX	RSTART= ****** GX

BITFID= ****** GX	FIXEOF= ****** GX	H.FRVN= 000014   	I.BKDT= 000052   	R$$DPB= 000001

BITLUN= ****** GX	FO.MFY= ****** GX	H.FSEG= 000004   	I.CRDT= 000022   	R$$DYM= 000001

BITMAP= ****** GX	FO.RD = ****** GX	H.FSEQ= 000012   	I.EXDT= 000042   	R$$EIS= 000000

BITWRD= ****** GX	FO.WRT= ****** GX	H.HBLB= 000000   	I.FNAM= 000000   	R$$MSG= 000000

CS.DIF= 000002   	FP.DEL= 000010   	H.HBVB= 000020   	I.RVDT= 000032   	R$$11M= 000001

CS.DVF= 000004   	FP.EXE= 000004   	H.IBLB= 000030   	I.RVNO= 000020   	R.FIX = ****** GX

CS.EQU= 000040   	FP.RDV= 000001   	H.IBSZ= 000040   	I.ULAB= 000062   	SBCLUS= ****** GX

CS.INP= 000001   	FP.WRV= 000002   	H.IBVB= 000026   	LBN   = ****** GX	SC.BAD= 000100

CS.MOR= 000020   	FREEBT= ****** GX	H.IDOF= 000000   	LISTBT= ****** GX	SC.DIR= 000040

CS.NMF= 000001   	F.BBFS= ****** GX	H.IHLB= 000010   	LOSTBT= ****** GX	SC.MDL= 000200

CS.OUT= 000002   	F.DFNB= ****** GX	H.IHVB= 000024   	LO01MG= 000000R     003	SC.TRN= 000001

CS.WLD= 000010   	F.DVNM= ****** GX	H.INDF= 000760   	LO01SZ= 000032   	SETREC= ****** GX

C.CKSM= 000774   	F.EFBK= ****** GX	H.INDN= 000730   	LO18MG= 000032R     003	SINXBT= ****** GX

C.CMLD= 000002   	F.ERR = ****** GX	H.INDO= 000744   	LO18SZ= 000042   	STBLK = ****** GX

C.CYLN= 000020   	F.FACC= ****** GX	H.LRUC= 000105   	LO19MG= 000136R     003	SZ    = 000012

C.DEVD= 000006   	F.FNB = ****** GX	H.MPOF= 000001   	LO19SZ= 000042   	S.BFHD= ****** GX

C.DIRD= 000012   	F.HIBK= ****** GX	H.NVOL= 000050   	LO33MG= 000243R     003	S.HDHD= 000114

C.DSDS= 000006   	F.NRBD= ****** GX	H.PRIV= 000073   	LO33SZ= 000047   	S.IDHD= 000202

C.FILD= 000016   	F.RACC= ****** GX	H.PROG= 000074   	LO34MG= 000327R     003	S.MPHD= 000000

C.MKW1= 000024   	F.RATT= ****** GX	H.PROJ= 000076   	LO34SZ= 000035   	TBTMAP= ****** GX

C.MKW2= 000026   	F.RCNM= ****** GX	H.RPRO= 000102   	LO50MG= 000364R     003	TIDEV = ****** GX

C.SBCL= 000002   	F.RCTL= ****** GX	H.RSOF= 000003   	LO50SZ= 000063   	UC.CON= 000200

C.SECT= 000010   	F.RSIZ= ****** GX	H.RSVF= 000042   	LO71MG= 000452R     003	UC.DLK= 000100

C.SIZE= 000054   	F.RTYP= ****** GX	H.RVN = 000046   	LO71SZ= 000057   	UPDATE= ****** GX

C.STAT= 000024   	F.STBK= ****** GX	H.SBCL= 000016   	LO72MG= 000543R     003	UPDINX= ****** GX

C.SWAD= 000022   	F.UNIT= ****** GX	H.SCHA= 000065   	LO72SZ= 000062   	VFYCTL= ****** GX

C.TRAK= 000014   	F.URBD= ****** GX	H.SEMK= 000104   	MAPOFF= ****** GX	WRTERR= ****** GX

C.TYPR= 000000   	G.LUCW= 000004   	H.SMMX= 000110   	MAXFNU= ****** GX	X     = 000026

C.VSIZ= 000004   	G.LUFB= 000003   	H.SNAM= 000714   	MAXLBN= ****** GX	$DDIV = ****** GX

ER02MG= ****** GX	G.LUNA= 000000   	H.UCHA= 000064   	MG    = 000531R     003	$DMUL = ****** GX

ER02SZ= ****** GX	G.LUNU= 000002   	H.UFAT= 000024   	MOPRM = ****** GX	$MUL  = ****** GX

ER03MG= ****** GX	H.ACOF= 000002   	H.USE = 000072   	MULSCN= ****** GX	$RQCB = ****** GX

ER03SZ= ****** GX	H.AHLB= 000004   	H.VCHA= 000052   	NBTBLK= ****** GX	$$$OST= 000014

ER04MG= ****** GX	H.AHVB= 000022   	H.VDAT= 000074   	NB.NXD= 020000   	$$$T1 = 000067

ER04SZ= ****** GX	H.CHK1= 000072   	H.VLEV= 000014   	NXTFID= ****** GX	.DYBUF= ****** GX

ER14MG= ****** GX	H.CHK2= 000776   	H.VOWN= 000054   	N.DVNM= ****** GX	.DYBYT= ****** GX

ER14SZ= ****** GX	H.CKSM= 000776   	H.VPRO= 000064   	N.FID = ****** GX	.DYSIZ= ****** GX

ER15MG= ****** GX	H.DFPR= 000066   	H.VSMX= 000060   	N.UNIT= ****** GX	.EXSTS= ****** GX

ER15SZ= ****** GX	H.DRPR= 000070   	H.WISZ= 000104   	OPENF   000000RG    002	.EXTND= ****** GX

ER17MG= ****** GX	H.DVTY= 000044   	IBVBN = ****** GX	OPNINX  001660R     002	.FREP1= ****** GX

ER17SZ= ****** GX	H.EFNU= 000016   	IE.PRI= ****** GX	OPNOUT  001522R     002	.FSRPT= ****** GX

ER20MG= ****** GX	H.EFSQ= 000020   	INDEX = ****** GX	OUDFLT= ****** GX	.GET  = ****** G

ER20SZ= ****** GX	H.ERVN= 000022   	INIBIT  001214R     002	OUSPEC= ****** GX	.LOST1= ****** GX

EX$WAR= ****** GX	H.FCHA= 000064   	INIINX  002024RG    002	OUT1  = ****** GX	.MRKDL= ****** GX

FA.SHR= ****** GX	H.FIEX= 000106   	INILP   001434R     002	OUT2  = ****** GX	.OPEN = ****** G

FA.TMP= ****** GX	H.FLEV= 000006   	INSPEC= ****** GX	PAR$$$= 000000   	.PUT  = ****** G

FBTBLK= ****** GX	H.FMAX= 000034   	INXBIT= ****** GX	RBUILD= ****** GX	.RCBLK= ****** GX

FDBOUT= ****** GX	H.FNUM= 000010   	INXFID= ****** GX	RDCKBT= ****** GX	...GBL= 000000

FD.PLC= ****** GX	H.FOWN= 000074   	INXOFF= ****** GX	RDERR = ****** GX	...TPC= 000776

FD.RAN= ****** GX



. ABS.	000000	   000

      	000000	   001

PURE$I	002200	   002

MSGSTR	000625	   003

ERRORS DETECTED:  0

VFYOPN M0113, OPEN THE FILES	MACRO M1110  22-AUG-78 00:38  PAGE 14-2

SYMBOL TABLE





VIRTUAL MEMORY USED:  6836 WORDS  ( 27 PAGES)

DYNAMIC MEMORY:  8052 WORDS  ( 30 PAGES)

ELAPSED TIME:  00:00:45

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

