VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37

TABLE OF CONTENTS



     7-    1	**** VFYFRE VERSION M0100 ****

     7-   29	FREE BLOCKS COMMAND

    10-  183	FORMAT STRINGS

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 7





      1						.TITLE	VFYFRE M0100, VFY - FREE COMMAND

						.SBTTL	**** VFYFRE VERSION M0100 ****

						.IDENT	/M0100/

      2					;

      3					; COPYRIGHT (C) 1977

      4					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

      5					;

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

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

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

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

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

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

     12					; REMAIN IN DEC.

     13					;

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

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

     16					; CORPORATION.

     17					;

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

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

     20

     21					;

     22					; PETER H. LIPMAN 28-OCT-74

     23					; ALTERED TUESDAY 29-OCT-74 8:45

     24					;

     25						.MCALL	CALL,RETURN,GET$

     26

     27	000000					PURE.I

     28

     29						.SBTTL	FREE BLOCKS COMMAND

     30					;+

     31					; OUTPUT THE COUNT OF FREE BLOCKS - ADD TMP FILE BACK IN

     32					;

     33					; INPUTS:

     34					;

     35					;	R0=BITMAP FDB ADDRESS

     36					;	R3=FORMAT STRING FOR MESSAGE

     37					;

     38					; OUTPUTS:

     39					;

     40					;	ALL REGISTERS ALTERED

     41					;-

     42	000000	010346 			OUTFRE::MOV	R3,-(SP)	;SAVE FORMAT STRING

     43	000002					CALL	MAPFRE		;RETURNS R1,R2=FREE COUNT

     44	000006	032767 	000000G	000000G		BIT	#SAMDEV,TMPCTL	;IF TMP FILE IS ON THIS DEVICE

     45	000014	001403 				BEQ	10$

     46	000016	066702 	000000C			ADD	TBTMAP+F.HIBK+2,R2 ;ADD TMP FILE BLOCKS BACK IN

     47	000022	005501 				ADC	R1

     48	000024	012603 			10$:	MOV	(SP)+,R3

     49	000026	005004 				CLR	R4

     50	000030					CALL	PRTFRE		;AND PRINT OUT THE RESULT

     51	000034					RETURN

     52					;

     53					; R0=FDB ADDRESS OF BITMAP, FILE IS OPEN

     54	000036				FREEPR::CALL	MAPFRE		;GET COUNT OF FREE BLOCKS

     55	000042	012703 	000000G			MOV	#MOPRM,R3

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 7-1

FREE BLOCKS COMMAND



     56	000046	010304 				MOV	R3,R4

     57	000050	010013 				MOV	R0,@R3

     58	000052	062723 	000000G			ADD	#F.DVNM,(R3)+	;ADDRESS OF DEVICE NAME

     59	000056	016023 	000000G			MOV	F.UNIT(R0),(R3)+ ;UNIT NUMBER

     60	000062	012703 	000046'			MOV	#LO45MG,R3

     61	000066					CALL	PRTFRE

     62	000072	000167 	000000G			JMP	RSTART

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 8

FREE BLOCKS COMMAND



     64					;+

     65					; PRINT THE FREE BLOCK INFORMATION

     66					; CALLING SEQUENCE:

     67					;	CALL	PRTFRE

     68					; INPUTS:

     69					;	R1,R2 = FREE BLOCK COUNT (R2 = LOW ORDER BITS)

     70					;	R3=FORMAT STRING FOR INITIAL MESSAGE

     71					;	R4=PARAMETER BLOCK ADDRESS FOR INITIAL MESSAGE

     72					;	MAXLBN, MAXLBN+2 = TOTAL BLOCKS ON DEVICE

     73					; OUTPUTS:

     74					;	ALL REGISTERS ALTERED

     75					; OPERATION:

     76					;	CALL EDMSG WITH FIRST PART OF MESSAGE AS SPECIFIED IN

     77					; THE FORAMT STRING AND PARAMETER BLOCK ADDRESS

     78					;	THEN IT FORMATS THE STRING:

     79					;	NNN. BLOCKS FREE, NNN. BLOCKS USED OUT OF NNN.

     80					; WHERE THE NNN VALUES ARE ALL COVERTED FROM DOUBLE PRECISION BINARY

     81					;-

     82	000076	010246 			PRTFRE::MOV	R2,-(SP)

     83	000100	010146 				MOV	R1,-(SP)	;SP = ADR OF DBL PRECISION FREE COUNT

     84	000102	010301 				MOV	R3,R1		;SET UP TO CALL EDMSG

     85	000104	010402 				MOV	R4,R2

     86	000106	016700 	000000C			MOV	FDBOUT+F.NRBD+2,R0 ;CONVERTS STRING INTO OUTPUT BUFFER

     87	000112					CALL	$EDMSG		; "INDEX INDICATES"

     88	000116	010601 				MOV	SP,R1		;R1=ADR OF 2 WORD FREE COUNT

     89	000120	005002 				CLR	R2		;ZERO SUPPRESS

     90	000122					CALL	$CDDMG		;CONVERT DBL PRECISION TO DECIMAL MAG

     91	000126	012701 	000000'			MOV	#LO40MG,R1

     92	000132	005002 				CLR	R2

     93	000134					CALL	$EDMSG		;". BLOCKS FREE "

     94					;

     95					; CALCULATE HOW MANY BLOCKS ARE USED

     96	000140	016701 	000000G			MOV	MAXLBN,R1

     97	000144	016702 	000002G			MOV	MAXLBN+2,R2

     98	000150	166602 	000002 			SUB	2(SP),R2

     99	000154	005601 				SBC	R1

    100	000156	162601 				SUB	(SP)+,R1

    101	000160	010216 				MOV	R2,@SP

    102	000162	010146 				MOV	R1,-(SP)

    103	000164	010601 				MOV	SP,R1		;R1=ADR OF 2 WORD USED COUNT

    104	000166	005002 				CLR	R2		;ZERO SUPPRESS

    105	000170					CALL	$CDDMG		;CONVERT TO MAGNITUDE DECIMAL

    106	000174	022626 				CMP	(SP)+,(SP)+	;CLEAR 2 WORDS FROM STACK

    107	000176	012701 	000020'			MOV	#LO41MG,R1

    108	000202	005002 				CLR	R2

    109	000204					CALL	$EDMSG		;". BLOCKS USED OUT OF "

    110	000210	012701 	000000G			MOV	#MAXLBN,R1	;R1=ADR OF 2 WORD TOTAL BLOCK COUNT

    111	000214	005002 				CLR	R2

    112	000216					CALL	$CDDMG

    113	000222	112720 	000056 			MOVB	#'.,(R0)+

    114	000226	010001 				MOV	R0,R1		;CALCULATE STRING LENGTH IN R1

    115	000230	166701 	000000C			SUB	FDBOUT+F.NRBD+2,R1

    116	000234					CALL	OUT2		;OUTPUT THE LINE

    117	000240					RETURN

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 9

FREE BLOCKS COMMAND



    119					;

    120					; COUNT THE FREE BLOCKS IN A BIT MAP

    121					; INPUTS:

    122					;	R0=FDB OF DESIRED BIT MAP

    123					;	FBTBLK = FIRST VBN OF BIT MAP BLOCKS

    124					;	NBTBLK = NO. OF BIT MAP BLOCKS

    125					; OUTPUTS:

    126					;	R1,R2=NO. OF FREE BLOCKS

    127					;	R0 PRESERVED, R3-R5 ALTERED

    128	000242	010046 			MAPFRE::MOV	R0,-(SP)

    129	000244	012701 	001000 			MOV	#512.,R1

    130	000250	012702 	000000G			MOV	#BITBUF,R2

    131	000254					CALL	SETREC		;SET 1 BLOCK RECORDS

    132	000260	016760 	000000G	000002G		MOV	FBTBLK,F.RCNM+2(R0)

    133	000266	016701 	000000G			MOV	MAXLBN,R1

    134	000272	016702 	000002G			MOV	MAXLBN+2,R2	;NUMBER OF BLOCKS TO CHECK

    135					;

    136					; DIVIDE NUMBER OF BLOCKS BY CLUSTER FACTOR.

    137					;

    138	000276	016700 	000000G			MOV	SBCLUS,R0	;CLUSTER FACTOR BECOMES DIVISOR.

    139	000302					CALL	$DDIV		;DOUBLE PRECISION DIVIDE.

    140	000306	010104 				MOV	R1,R4		;NUMBER OF CLUSTERS TO R4,R5

    141	000310	010205 				MOV	R2,R5		;FOR INPUT TO BITCNT ROUTINE BELOW.

    142	000312	016703 	000000G			MOV	NBTBLK,R3	;NUMBER OF BIT MAP BLOCKS

    143	000316	005002 				CLR	R2

    144	000320	005001 				CLR	R1

    145	000322	011600 			10$:	MOV	@SP,R0

    146	000324					CALL	BITCNT

    147	000330	060002 				ADD	R0,R2

    148	000332	005501 				ADC	R1

    149	000334	162705 	010000 			SUB	#10000,R5

    150	000340	005604 				SBC	R4

    151	000342					SOB	R3,10$

    152	000346	012600 				MOV	(SP)+,R0

    153	000350					RETURN

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 10

FREE BLOCKS COMMAND



    155					;

    156					; READ ONE BIT MAP MAP BLOCK AND COUNT THE FREE CLUSTERS.

    157					; INPUTS:

    158					;	R0=FDB OF BIT MAP FILE, RECORD NUMBER SET TO NEXT BLOCK TO READ

    159					;	R4,R5=NO. OF CLUSTERS LEFT TO CHECK IN BITMAP

    160					; OUTPUTS:

    161					;	R0=COUNT OF FREE BLOCKS

    162					;	R1-R5 PRESERVED

    163	000352				BITCNT::GET$	R0,,,RDERR

    164	000364	004567 	000000G			JSR	R5,.SAVR1	;SAVE REGISTERS R1-R5

    165	000370	005000 				CLR	R0		;INIT FREE BLOCK COUNTER

    166	000372	005704 				TST	R4		;IF HIGH ORDER BITS OF LBN COUNT NOT 0

    167	000374	001402 				BEQ	10$

    168	000376	012705 	010000 			MOV	#10000,R5	;GUARANTEE THAT WE CHECK ALL BITS

    169	000402	012704 	000400 		10$:	MOV	#256.,R4	; NO. OF WORDS

    170	000406	012703 	000000G			MOV	#BITBUF,R3	;STARTING ADDRESS OF WORDS

    171	000412	012702 	000020 		20$:	MOV	#16.,R2		;NO. OF BITS PER WORD

    172	000416	012301 				MOV	(R3)+,R1	;GET NEXT WORD TO R1

    173	000420	000241 			30$:	CLC

    174	000422	006001 				ROR	R1

    175	000424	103002 				BCC	40$

    176	000426	066700 	000000G			ADD	SBCLUS,R0	;COUNT BITS THAT ARE ON. EACH BIT = ONE CLUSTER.

    177	000432	005305 			40$:	DEC	R5

    178	000434	001404 				BEQ	50$		;BRANCH IF RUN OUT OF BLOCKS TO CHECK

    179	000436					SOB	R2,30$

    180	000442					SOB	R4,20$

    181	000446				50$:	RETURN

    182

    183						.SBTTL	FORMAT STRINGS

    184	000000					.PSECT

    185

    186	000000					MSGZ	LO40,<. BLOCKS FREE, >

    187	000000					MSGZ	LO41,<. BLOCKS USED OUT OF >

    188	000000					MSGZ	LO45,<%N%2A%O: HAS >

    189						.EVEN

    190					;

    191					;

    192		000001 				.END

VFYFRE M0100, VFY - FREE COMMAN	MACRO M1110  22-AUG-78 00:37  PAGE 10-1

SYMBOL TABLE



BITBUF= ****** GX	F.UNIT= ****** GX	MOPRM = ****** GX	R$$DPB= 000001   	TBTMAP= ****** GX

BITCNT  000352RG    002	LO40MG= 000000R     003	NBTBLK= ****** GX	R$$DYM= 000001   	TMPCTL= ****** GX

FBTBLK= ****** GX	LO40SZ= 000020   	NB.NXD= 020000   	R$$EIS= 000000   	$CDDMG= ****** GX

FDBOUT= ****** GX	LO41MG= 000020R     003	OUTFRE  000000RG    002	R$$MSG= 000000   	$DDIV = ****** GX

FREEPR  000036RG    002	LO41SZ= 000026   	OUT2  = ****** GX	R$$11M= 000001   	$EDMSG= ****** GX

F.DVNM= ****** GX	LO45MG= 000046R     003	PAR$$$= 000000   	SAMDEV= ****** GX	$$$T1 = 000067

F.HIBK= ****** GX	LO45SZ= 000016   	PRTFRE  000076RG    002	SBCLUS= ****** GX	.GET  = ****** G

F.NRBD= ****** GX	MAPFRE  000242RG    002	RDERR = ****** GX	SETREC= ****** GX	.SAVR1= ****** GX

F.RCNM= ****** GX	MAXLBN= ****** GX	RSTART= ****** GX



. ABS.	000000	   000

      	000000	   001

PURE$I	000450	   002

MSGSTR	000064	   003

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  3104 WORDS  ( 13 PAGES)

DYNAMIC MEMORY:  3828 WORDS  ( 14 PAGES)

ELAPSED TIME:  00:00:16

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

