MACFLM	MACRO M1110  22-AUG-78 01:44  PAGE 2





      1						.IF NDF	W$$KST

      2

      3						.TITLE	INIVM

      4

      5						.IFF

      6

      7						.TITLE	INIVS

      8

      9						.ENDC

     10

     11						.IDENT	/05/

     12

     13					;

     14					; COPYRIGHT (C) 1976

     15					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

     16					;

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

     18					; SINGLE COMPUTER SYSTEM AND MAY  BE  COPIED   ONLY  WITH  THE

     19					; INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE,  OR

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

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

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

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

     24					; IN DEC.

     25					;

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

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

     28					; EQUIPMENT CORPORATION.

     29					;

     30					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF

     31					; ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     32					;

     33					; VERSION 04

     34					;

     35					; WRITTEN BY:

     36					;	CLARK A. D'ELIA		01-JUN-74

     37					;

     38					; MODIFICATIONS:

     39					;

     40					; NO.		DATE		PROGRAMMER

     41					; ---		----		----------

     42					;

     43					; 035		09-JAN-75	C. MONIA

     44					; 043		28-OCT-75	C. MONIA

     45					; 065		30-JUN-76	C. MONIA

     46					; 073		21-OCT-76	C. MONIA

     47					;

     48					;

     49					;+

     50					; **-$INIVM-*-INITIALIZE VIRTUAL MEMORY WORK FILE SYSTEM

     51					;

     52					; THIS ROUTINE INITIALIZES THE VIRTUAL MEMORY WORK FILE SUB-

     53					; SYSTEM.  TO DO THIS IT FORCES ALL PAGES TO BE NON-RESIDENT,

     54					; ALLOCATES THE FIRST PAGE, OPENS THE WORK FILE, AND MARKS

     55					; IT FOR DELETION WHEN CLOSED.

     56					;

     57					; INPUTS:

INIVM	MACRO M1110  22-AUG-78 01:44  PAGE 2-1





     58					;	R1=TOP TASK VIRTUAL ADDRESS

     59					;	$WRKPT CONTAINS ADDRESS OF WORK FILE FDB

     60					;	$FRHD  CONTAINS ADDRESS OF DYNAMIC MEMORY POOL

     61					;

     62					; OUTPUTS:

     63					;	C-BIT CLEAR  AND/OR  R0=0 INDICATES SUCCESS

     64					;

     65					;	-OR-

     66					;

     67					;	C-BIT SET INDICATES FAILURE  AND/OR

     68					;	      R0=-2 INDICATES WORK FILE OPEN FAILURE

     69					;	      R0=-1 INDICATES WORK FILE MARK FOR DELETE FAILURE

     70					;

     71					;-

     72

     73					;

     74					; MACRO LIBRARY CALLS

     75					;

     76

     77						.MCALL	FCSBT$

     78	000000					FCSBT$	DEF$L

     79						.MCALL	FDOFF$

     80	000000					FDOFF$	DEF$L

     81						.MCALL	OFNB$

     82

     83						.IF	DF	T$$MP

     84

     85						.MCALL	NMBLK$

     86

     87					WRKNM:	NMBLK$	WRKFIL,TMP

     88

     89						.ENDC

     90

     91

     92

     93	000000				$INIVM::			;

     94	000000					SAVRG			;++035 SAVE THE NON-VOLATILE REGISTERS

     95

     96						.IF DF	W$$KST

     97

     98						MOV	R1,$TPADR	; SET TOP ADDRESS IN TASK

     99						MOV	#$WRKAC,R0	; GET ADDRESS OF WORK FILE ACCESS COUNTS

    100

    101						.REPT	6

    102						CLR	(R0)+		; CLEAR ACCESS COUNTS

    103						.ENDR

    104

    105						.ENDC

    106

    107	000004	012767 	000001 	000000G		MOV	#1,$HGVAD	;++035 SET NEXT VIRTUAL ADDRESS TO 1

    108	000012	005067 	000000G			CLR	$PAGHD		;SET NO RESIDENT PAGES

    109	000016	005067 	000000G			CLR	$PAGLS		;++035 CLEAR POINTER TO RESIDENT PAGE LIST

    110	000022	005067 	000000G			CLR	$TIME		; RESET PAGE TIME

    111	000026	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE POOL LISTHEAD

    112	000032	012001 				MOV	(R0)+,R1	; GET ADDRESS OF CORE POOL

    113	000034	005010 				CLR	(R0)		; SECOND WORD OF LIST MUST BE ZERO

    114	000036	026127 	000002 	000000C		CMP	2(R1),#<N$MPAG*P$GSIZ> ; ENOUGH ROOM FOR FAST PAGE SEARCH

INIVM	MACRO M1110  22-AUG-78 01:44  PAGE 2-2





    115	000044	103406 				BLO	5$		; IF LO NO

    116	000046	012701 	001000 			MOV	#512.,R1	; SET SIZE OF RESIDENT PAGE LIST

    117	000052					CALL	$ALBLK		; ALLOCATE RESIDENT PAGE LIST

    118	000056	010067 	000000G			MOV	R0,$PAGLS	;++035 SAVE ADDRESS OF LIST

    119	000062				5$:				;

    120	000062	012701 	000000G			MOV	#P$GSIZ,R1	;PUT PAGE SIZE IN R1

    121	000066					CALL	$ALBLK		;ALLOCATE FIRST PAGE

    122	000072	010067 	000000G			MOV	R0,$PAGHD	;LINK IT TO RESIDENT PAGE LIST HEAD

    123	000076	016701 	000000G			MOV	$PAGLS,R1	;++035 GET ADDRESS OF RESIDENT PAGE LIST

    124	000102	001401 				BEQ	7$		;++035 IF EQ NONE

    125	000104	010011 				MOV	R0,(R1)		;++035 SET THIS PAGE RESIDENT

    126	000106				7$:				;

    127	000106	016700 	000000G			MOV	$WRKPT,R0	;POINT R0 TO WORK FILE FDB

    128	000112	005060 	000040 			CLR	F.ALOC(R0)	;FILE IS INITIALLY NON-CONTIGUOUS

    129	000116	012746 	177776 			MOV	#-2,-(SP)	;ASSUME FILE OPEN FAILURE (STS=-2)

    130

    131						.IF	DF	T$$MP

    132

    133						MOV	R0,R1		;++035 COPY FDB ADDRESS

    134						ADD	#F.FNB,R1	;++035 POINT TO FILENAME BLOCK

    135						CLR	R2		;++035 NO DATASET DESCRIPTOR

    136						MOV	#WRKNM,R3	;++035 SET ADDRESS OF DEFAULT FILENAME BLOCK

    137						CALL	.PARSE		;++035 ENTER TEMP. FILE NAME IN DIRECTORY

    138						BCS	10$		;++035 IF C/S PARSE FAILED

    139						INC	(SP)		;++035 SPECIFY SUCCESFUL PARSE

    140						OFNB$	R0,#<FO.WRT>	;++035 OPEN FILE FOR WRITE

    141						BCS	10$		;++035 IF C/S OPEN FAILURE

    142

    143						.IFF

    144

    145	000122					OFNB$	R0,#<FA.TMP!FO.WRT> ;CREATE TEMPORARY WORK FILE

    146	000134	103405 				BCS	10$		;BRANCH IF ERROR

    147	000136	005216 				INC	(SP)		;ASSUME MARK FOR DELETE FAILURE (STS=-1)

    148	000140					CALL	.MRKDL		;MARK FILE FOR DELETE AFTER CLOSE

    149	000144	103401 				BCS	10$		;BRANCH IF ERROR

    150

    151						.ENDC

    152

    153	000146	005216 				INC	(SP)		;SPECIFY SUCCESSFUL INIT (STS=0)

    154	000150	012600 			10$:	MOV	(SP)+,R0	;PUT STATUS IN R0

    155	000152					RETURN			;RETURN WITH C-BIT SET IF ERROR

    156

    157

    158		000001 				.END

INIVM	MACRO M1110  22-AUG-78 01:44  PAGE 2-3

SYMBOL TABLE



CH.AND= 000001   	FD.RAH= 000001   	F.BKVB= 000064   	F.SEQN= 000100   	PAR$$$= 000000

CR    = 000015   	FD.RAN= 000002   	F.CHR = 000075   	F.SPDV= 000072   	P$GSIZ= ****** GX

FA.APD= 000100   	FD.REC= 000001   	F.CNTG= 000034   	F.SPUN= 000074   	R$$11M= 000000

FA.CRE= 000010   	FD.RWM= 000001   	F.DFNB= 000046   	F.STBK= 000036   	R.FIX = 000001

FA.DLK= 001000   	FD.SDI= 000020   	F.DSPT= 000044   	F.UNIT= 000136   	R.SEQ = 000003

FA.ENB= 100000   	FD.SQD= 000040   	F.DVNM= 000134   	F.URBD= 000020   	R.VAR = 000002

FA.EXC= 002000   	FD.TTY= 000004   	F.EFBK= 000010   	F.VBN = 000064   	SPA   = 000040

FA.EXT= 000004   	FD.WBH= 000002   	F.EFN = 000050   	F.VBSZ= 000060   	S.FATT= 000016

FA.NSP= 000100   	FF    = 000014   	F.EOBB= 000032   	HT    = 000011   	S.FDB = 000140

FA.POS= 010000   	FF.CHR= 000005   	F.ERR = 000052   	LF    = 000012   	S.FNAM= 000006

FA.RD = 000001   	FF.NV = 000003   	F.FACC= 000043   	NB.DEV= 000200   	S.FNB = 000036

FA.RWD= 004000   	FF.POE= 000002   	F.FFBY= 000014   	NB.DIR= 000100   	S.FNBW= 000017

FA.SEQ= 040000   	FF.RWD= 000001   	F.FNAM= 000110   	NB.NAM= 000004   	S.FNTY= 000004

FA.SHR= 000040   	FF.RWF= 000006   	F.FNB = 000102   	NB.SD1= 000400   	S.FTYP= 000002

FA.TMP= 000020   	FF.SPC= 000004   	F.FTYP= 000116   	NB.SD2= 001000   	S.NFEN= 000020

FA.WCK= 020000   	FO.APD= 000106   	F.FVER= 000120   	NB.SNM= 000040   	VT    = 000013

FA.WRT= 000002   	FO.MFY= 000002   	F.HIBK= 000004   	NB.STP= 000020   	$ALBLK= ****** GX

FD.BLK= 000010   	FO.RD = 000001   	F.LUN = 000042   	NB.SVR= 000010   	$FRHD = ****** GX

FD.CCL= 000002   	FO.UPD= 000006   	F.MBCT= 000054   	NB.TYP= 000002   	$HGVAD= ****** GX

FD.COM= 020000   	FO.WRT= 000016   	F.MBC1= 000055   	NB.VER= 000001   	$INIVM  000000RG

FD.CR = 000002   	F.ACTL= 000076   	F.MBFG= 000056   	N$MPAG= ****** GX	$PAGHD= ****** GX

FD.DIR= 000010   	F.ALOC= 000040   	F.NRBD= 000024   	N.DID = 000024   	$PAGLS= ****** GX

FD.FTN= 000001   	F.BBFS= 000062   	F.NREC= 000030   	N.DVNM= 000032   	$SAVRG= ****** GX

FD.F11= 040000   	F.BDB = 000070   	F.OVBS= 000030   	N.FID = 000000   	$TIME = ****** GX

FD.INS= 000010   	F.BGBC= 000057   	F.RACC= 000016   	N.FNAM= 000006   	$WRKPT= ****** GX

FD.ISP= 002000   	F.BKDN= 000026   	F.RATT= 000001   	N.FTYP= 000014   	$$    = 000001

FD.MNT= 100000   	F.BKDS= 000020   	F.RCNM= 000034   	N.FVER= 000016   	.MRKDL= ****** GX

FD.OSP= 004000   	F.BKEF= 000050   	F.RCTL= 000017   	N.NEXT= 000022   	.OPFNB= ****** G

FD.PLC= 000004   	F.BKP1= 000051   	F.RSIZ= 000002   	N.STAT= 000020   	...GBL= 000000

FD.PRN= 000004   	F.BKST= 000024   	F.RTYP= 000000   	N.UNIT= 000034   	...TPC= 000140

FD.PSE= 010000



. ABS.	000000	   000

      	000154	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  2162 WORDS  ( 9 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:15

OBJ$:INIVM,LIS$:INIVM/-SP=SRC$:MACFLM,INIVM

