

; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 1

; Digital Equipment Corporation

;

;00100  0001	MODULE LNK_VMALLO (IDENT='X01.09') =

;00200  0002	

;00300  0003	BEGIN

;00400  0004	!

;00500  0005	!

;00600  0006	! Copyright (C) 1976, 1977, 1978

;00700  0007	! Digital Equipment Corporation,  Maynard, Massachusetts  01754

;00800  0008	!

;00900  0009	! This software is furnished under a license for use only on  a

;01000  0010	! single computer system and may be copied only with the inclu-

;01100  0011	! sion of the above copyright notice.  This  software,  or  any

;01200  0012	! other  copies  thereof, may not be provided or otherwise made

;01300  0013	! available to any other person except for use on  such  system

;01400  0014	! and  to  one who agrees to these license terms.  Title to and

;01500  0015	! ownership of the software shall at all times remain in DEC.

;01600  0016	!

;01700  0017	! The information in this software is subject to change without

;01800  0018	! notice and should not be construed as a commitment by Digital

;01900  0019	! Equipment Corporation.

;02000  0020	!

;02100  0021	! DEC assumes no responsibility for the use or  reliability  of

;02200  0022	! its software on equipment which is not supplied by DEC.

;02300  0023	!

;02400  0024	!

;02500  0025	!

;02600  0026	!

;02700  0027	!

;02800  0028	!++

;02900  0029	!

;03000  0030	! MODULE: LNK_VMALLO

;03100  0031	!

;03200  0032	! FACILITY: LINKER

;03300  0033	!

;03400  0034	! ABSTRACT: ALLOCATION OF VIRTUAL MEMORY TO IMAGE.

;03500  0035	!

;03600  0036	! HISTORY:

;03700  0037	!

;03800  0038	!	VERSION: X01.00

;03900  0039	!

;04000  0040	!	AUTHOR: T.J. PORTER 30-MAR-77

;04100  0041	!

;04200  0042	!	MODIFICATIONS:

;04300  0043	!

;04400  0044	! NO.	DATE		PROGRAMMER	PURPOSE

;04500  0045	! ---	----		----------	-------

;04600  0046	! 001	24-JUN-77	T.J. PORTER	CROSS REFERENCE OF SYMBOLS BY VALUE

;04700  0047	! 002	07-OCT-77	T.J. PORTER	UPDATE TO NEW ISD FORMAT AND ADD

;04800  0048	!						SYMBOLIC BASE ADDRESS

;04900  0049	! 003	07-DEC-77	T.J. PORTER	ADD SHAREABLE IMAGE MEMORY ALLOCATION

;05000  0050	! 004	05-JAN-78	T.J. PORTER	ADD STACK TO SHAREABLE SO THEY MAY RUN

;05100  0051	! 005	21-APR-78	T.J. PORTER	REQUIRE FILE CLEAN UP

;05200  0052	! 006	25-APR-78	T.J. PORTER	SUPPRESS EMPTY PAGES FROM IMAGE

;05300  0053	! 007	13-JUN-78	T.J. PORTER	REWORKED FOR CLUSTERING AND 

;05400  0054	!						SHAREABLE IMAGES

;05410  0055	! 008	16-JUL-78	T.J. PORTER	ALLOCATE A BASE ADDRESS TO A P-SECTION



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 1-1

; Digital Equipment Corporation

;

;05420  0056	!						EVEN IN CASE IT IS OF ZERO

;05430  0057	!						LENGTH.

;05440  0058	! 009	19-JUL-78	T.J. PORTER	MARK THE ISD'S OF THE HIGHEST

;05450  0059	!						P0 CLUSTER IF GLOBAL

;05500  0060	!--



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2

; Digital Equipment Corporation

;

;05600  0061	     

;05700  0062	!

;05800  0063	!++

;05900  0064	!

;06000  0065	! FUNCTIONAL DESCRIPTION:

;06100  0066	!

;06200  0067	!	THIS MODULE CONTAINS THE VIRTUAL MEMORY ALLOCATION LOGIC

;06300  0068	!	OF THE LINKER. THERE IS ONE ROUTINE:

;06400  0069	!		LNK$VMALLO()

;06500  0070	!	WHICH ALLOCATES MEMORY TO P-SECTIONS OF EACH OF THE 

;06600  0071	!	FOUR POSSIBLE IMAGE SECTIONS, READ-ONLY, READ-WRITE

;06700  0072	!	EXECUTE-ONLY AND EXECUTE-WRITE, AS WELL AS TO 

;06800  0073	!	THE USER STACK.

;06900  0074	!	AS EACH IMAGE-SECTION IS BUILT, THE P-SECTIONS WHOSE

;07000  0075	!	ATTRIBUTES MATCH THOSE OF THE IMAGE SECTION ARE

;07100  0076	!	ASSIGNED A BASE ADDRESS IN LEXICAL ORDER. AS EACH

;07200  0077	!	IS ASSIGNED ITS BASE ADDRESS, ANY RELOCATABLE SYMBOLS OWNED

;07300  0078	!	BY THAT P-SECTION ARE RELOCATED BY ADDITION OF 

;07400  0079	!	THE ALIGNED P-SECTION BASE ADDRESS.

;07500  0080	!	AFTER ALL REQUIRED IMAGE SECTIONS HAVE BEEN BUILT

;07600  0081	!	THE HEADER SIZE IS CALCULATED AND THE BASE VIRTUAL

;07700  0082	!	BLOCK NUMBER IN EACH ISD (ON SINGLY LINKED LIST)

;07800  0083	!	IS RELOCATED BY THE NUMBER OF HEADER BLOCKS.

;07900  0084	!

;08000  0085	!--

;08100  0086	!

;08200  0087	LIBRARY

;08300  0088		'SYS$LIBRARY:LIB.L32';					! SYSTEM USER DATA STRUCTURES

;08500  0089	REQUIRE

;08600  0090		'PREFIX';				! GENERAL DATA, MACROS ETC.

;08700  0282	REQUIRE

;08800  0283		'DATBAS';				! DATA BASE DESCRIPTION

;08900  0515	REQUIRE

;09000  0516		'SYMFMT';				! SYMBOL TABLE FORMATS.

;09100  0601	!

;09200  0602	FORWARD ROUTINE

;09300  0603		ALLOCLUSTER : NOVALUE,					! GATHER P-SECTIONS INTO I-SECTIONS FOR CURRENT CLUSTER

;09400  0604		RELOCLUSTER : NOVALUE,					! RELOCATE CONTENTS OF CURRENT CLUSTER

;09500  0605		STACK_ISECTBLD : NOVALUE,				! BUILD USER STACK IMAGE SECTION

;09600  0606		NORMAL_ISECTBLD : NOVALUE,				!   "   NORMAL USER ISECT

;09700  0607		BUILDISD : NOVALUE;					! CREATE ISD

;09800  0608	REQUIRE

;09900  0609		'ISGENC';				! GENERATION CONTROL TABLES

;10000  1186	!

;10100  1187	EXTERNAL

;10200  1188		LNK$AL_VALCTLTB,					! ADDRESS OF CREF BY VALUE CONTROL TABLE

;10300  1189		LNK$GL_TFRPSC : REF BLOCK[,BYTE],			! POINTER TO P-SECT CONTAING USER

;10400  1190		LNK$GL_TFRADR,						! TRANSFER ADDRESS

;10500  1191		LNK$GL_DBGTFPS : REF BLOCK[,BYTE],			! POINTER TO PSECTION CONTAINING DEBUG

;10600  1192		LNK$GL_DBGTFR,						! TRANSFER ADDRESS

;10700  1193		LNK$GL_CTLMSK,						! LINK CONTROL MASK

;10800  1194		LNK$GL_MINVA,						! LOWEST VIRTUAL ADDRESS ALLOCATED

;10900  1195		LNK$GL_CLULST : VECTOR[2],				! CLUSTER DESCRIPTOR LISTHEAD

;11000  1196		LNK$GL_CURCLU : REF BLOCK[,BYTE],			! CURRENT CLUSTER DESCRIPTOR POINTER

;11050  1197		LNK$GL_DEFCLU : BLOCK[,BYTE],				! DEFAULT CLUSTER



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-1

; Digital Equipment Corporation

;

;11060  1198		LNK$GL_FVMLST : REF BLOCK[,BYTE];			! FREE V.M. LIST ENTRY

;11100  1199	!

;11200  1200	EXTERNAL ROUTINE

;11300  1201		CRF$INSRTREF,						! CROSS REFERENCE INSERTION

;11400  1202		LNK$ALLOBLK,						! DYNAMIC MEMORY ALLOCATOR

;11500  1203		LNK$ALLOVIRMEM,						! ALLOCATE SPECIFICE REGION OF VIRTUAL MEMORY

;11600  1204		LNK$FINDVIRMEM,						! FIND A LARGE ENOUGH REGION OF   "      "

;11700  1205		LNK$ERRMSG,						! ERROR MESSAGE HANDLER

;11800  1206		LNK$FNDPSCMSK;						! FIND P-SECTIONS BY MASK

;11900  1207	!

;12000  1208	EXTERNAL LITERAL

;12100  1209		LNK$S_DBG : SHORT,					! CONTAINS FULL DEBUGGING

;12200  1210		LNK$S_EXE : SHORT,					! IF SET PRODUCING NORMAL EXECUTABLE IMAGE

;12300  1211		LNK$S_IMAGE : SHORT,					! IMAGE PRODUCTION ENABLE FLAG

;12400  1212		LNK$S_LONG : SHORT,					! SET FOR LONG FORM MAP

;12500  1213		LNK$S_PICIMG : SHORT,					! IMAGE IS POSITION INDEPENDENT

;12600  1214		LNK$S_SYMTBL : SHORT,					! SYMBOL TABLE TO PRODUCE

;12700  1215		LNK$S_SYS : SHORT,					! IF SET PRODUCE SYSTEM IMAGE

;12800  1216		ERM$C_BASESYM : BYTLIT,					! BAD BASE ADDRESS SYMBOL

;12900  1217		ERM$C_CONFMEM : BYTLIT,					! CONFLICTING MEMORY REQUIREMENTS

;13000  1218		ERM$C_INSVIRMEM : BYTLIT,				! INSUFFICIENT VIRTUAL MEMORY

;13100  1219		ERM$C_PSCOVFLO : BYTLIT,				! VIRTUAL MEMORY OVERFLOW IN PSECTION ALLOCATION

;13200  1220		ERM$C_STKOVFLO : BYTLIT,				! STACK OVERFLOW

;13300  1221		SEV$C_FATAL : SHORT,					! FATAL ERROR CODE

;13400  1222		SEV$C_DIAG : SHORT;					! DIAGNOSTIC ERROR CODE

;13500  1223	!

;13600  1224	GLOBAL

;13700  1225		LNK$GL_MAPLST,						! LIST OF P-SECTIONS FOR MAP OUTPUT (IN V.A. ORDER)

;13800  1226		LNK$GW_STACK : WORD,					! STACK SIZE (PAGES)

;13900  1227		LNK$GW_NISECTS : WORD;					! NUMBER OF IMAGE SECTIONS

;14000  1228	!

;14100  1229	GLOBAL LITERAL

;14200  1230		DEF$C_STACK = 20,					! DEFAULT STACK SIZE (PAGES)

;14300  1231		DEF$C_BASE = %X'200';					! DEFAULT BASE ADDRESS

;14400  1232	!

;14500  1233	!	GENERATE IMAGE SECTION GENERATION CONTROL TABLES

;14600  1234	!

;14700  1235	ISGENTBL(EXE,							! EXECUTABLE IMAGE

;14800P 1236		_U_R_,RDWRTEXEREL,					! READ ONLY PART

;14900P 1237		_U_RW,RDWRTEXEREL,					! READ WRITE DATA

;15000P 1238		_U_X_,RDWRTEXEREL,					! EXECUTE ONLY

;15100P 1239		_U_XW,RDWRTEXEREL,					! OVERWRITTEN CODE

;15200P 1240		_STACK,0);						! STACK -- MUST BE LAST

;15300  1241	ISGENTBL(SYS,							! SYSTEM IMAGE

;15400P 1242		S_ALONE,PSC$M_REL);					! IS A SINGLE SECTION

;15500  1243	ISGENTBL(SHR,							! SHAREABLE IMAGE

;15600P 1244		_S_R_,SHRPICMASK,

;15700P 1245		_S_RW,SHRPICMASK,

;15800P 1246		_S_X_,SHRPICMASK,

;15900P 1247		_S_XW,SHRPICMASK,

;16000P 1248		___R_,SHRPICMASK,

;16100P 1249		___RW,SHRPICMASK,

;16200P 1250		___X_,SHRPICMASK,

;16300P 1251		___XW,SHRPICMASK,

;16400P 1252		_SPR_,SHRPICMASK,



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-2

; Digital Equipment Corporation

;

;16500P 1253		_SPRW,SHRPICMASK,

;16600P 1254		_SPX_,SHRPICMASK,

;16700P 1255		_SPXW,SHRPICMASK,

;16800P 1256		__PR_,SHRPICMASK,

;16900P 1257		__PRW,SHRPICMASK,

;17000P 1258		__PX_,SHRPICMASK,

;17100P 1259		__PXW,SHRPICMASK,

;17200P 1260		_STACK,0);						! MUST BE THE LAST

;17300  1261	OWN

;17400  1262		ISECT_BASE,						! BASE OF THE IMAGE SECTION

;17500  1263		CNTRL_REG_ADDR : INITIAL(SYSTEM_SPACE),			! CONTROL REGION ADDRESS (FOR NEXT ISECT ALLOCATED DOWNWARD)

;17600  1264		ISECT : BYTE,						! I-SECT CONTROL TABLE INDEX

;17700  1265		NUMISECTS : BYTE,					! POTENTIAL NUMBER OF ISECTS IN THIS CLUSTER OF IMAGE

;17800  1266		ISECTGENTBL : REF BLOCKVECTOR[,ISC$C_SIZE,BYTE],	! ISECT GENERATION TABLE FOR CURRENT CLUSTER

;17900  1267		ISCTDESC : REF BLOCK[,BYTE];				! I-SECT DESCRIPTOR BLOCK

;18000  1268	!

;18100  1269	GLOBAL ROUTINE LNK$VMALLO : NOVALUE =

;18200  1270	BEGIN

;18300  1271	!++

;18400  1272	!	THIS ROUTINE IS THE DRIVER FOR MEMORY ALLOCATION. IT ASSUMES THAT

;18500  1273	!	VIRTUAL MEMORY FOR NON-PIC SHAREABLE IMAGES (IF ANY) HAS BEEN

;18600  1274	!	ALLOCATED AND REFLECTED IN THE CLUSTER FLAG CLU$V_BASED.

;18700  1275	!

;18800  1276	!	TWO PASES OF THE CLUSTER LIST ARE MADE. THE FIRST PASS ALLOCATES

;18900  1277	!	SPECIFIC ADDRESS SPACE TO CLUSTERS WHICH HAVE BEEN GIVEN A

;19000  1278	!	BASE ADDRESS (BUT ARE NOT NON-PIC SHAREABLE). THE SECOND PASS

;19100  1279	!	ALLOCATES MEMORY TO POSITION INDEPENDENT SHAREABLE IMAGES AND

;19200  1280	!	OTHER USER CLUSTERS NOT EXPLICITLY POSITIONED. THIS IS DONE IN

;19300  1281	!	CLUSTER LIST ORDER AND THE FIRST SPACE LARGE ENOUGH FROM THE BASE

;19400  1282	!	OF THE REGION IS ALLOCATED.

;19500  1283	!--

;19600  1284	LOCAL	BASEADDRSYM : REF BLOCK[,BYTE],				! THE SYMBOL TABLE ENTRY FOR THE SYMBOL

;19610  1285		HIGHCLUSTER : REF BLOCK[,BYTE];				! POINTER TO HIGHEST ADDRESSED CLUSTER

;19700  1286	!

;19800  1287	LNK$GL_CURCLU = LNK$GL_CLULST[0];				! START AT TOP OF CLUSTER LIST

;19900  1288	WHILE (LNK$GL_CURCLU = .LNK$GL_CURCLU[CLU$L_NXTCLU]) NEQ 0	! GET NEXT CLUSTER DESCRIPTOR

;20000  1289	DO IF NOT .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_SHRIMG>		! AND IF A USER CLUSTER WITH A

;20100  1290	      AND .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_BASED>		! BASE ADDRESS SPECIFIED

;20200  1291	      THEN BEGIN						! ITS TIME HAS COME

;20300  1292			LNK$GL_CTLMSK<LNK$S_PICIMG,1,0> = FALSE;	! THE IMAGE IS NON-PIC

;20400  1293		IF .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_SYMBAS>		! IF THE ADDRESS IS SYMBOLICALLY SPECIFIED

;20500  1294		THEN BEGIN						! FIRST FIGURE OUT IF VALID

;20600  1295			BASEADDRSYM = .LNK$GL_CURCLU[CLU$L_BASE];	! CELL CONTAINS POINTER TO THE SYMBOL TABLE ENTRY

;20700  1296			IF (.BASEADDRSYM[SYM$W_FLAGS] AND (SYM$M_DEF	! FIRST CHECK ABSOLUTE DEFINITION

;20800  1297				OR SYM$M_REL)) NEQ SYM$M_DEF

;20900  1298			THEN BEGIN

;21000  1299				LNK$ERRMSG(ERM$C_BASESYM,SEV$C_DIAG,	! AND ISSUE ERROR IF NOT

;21100  1300					BASEADDRSYM[SYM$B_NAMLNG]);

;21200  1301				IF .LNK$GL_CTLMSK<LNK$S_SYS,1,0>	! IF A SYSTEM IMAGE SET THE

;21300  1302				THEN LNK$GL_CURCLU[CLU$L_BASE] = SYSTEM_SPACE		! BASE ADDRESS FOR IT

;21400  1303				ELSE LNK$GL_CURCLU[CLU$L_BASE] = 0;			! OTHERWISE DEFAULT TO ZERO

;21500  1304			     END

;21600  1305			ELSE LNK$GL_CURCLU[CLU$L_BASE] = .BASEADDRSYM[SYM$L_VALUE] +	! OTHERWISE SET THE BASE ADDRESS

;21700  1306					511 AND NOT 511;		! TO NEXT PAGE BEYOND VALUE

;21710  1307			IF .LNK$GL_CTLMSK<LNK$S_SYS,1,0>		! IF A SYSTEM IMAGE SYMBOLICALLY



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-3

; Digital Equipment Corporation

;

;21720  1308			THEN LNK$GL_FVMLST[FVM$L_ADDRESS] = .LNK$GL_CURCLU[CLU$L_BASE];	! BASED THEN SET V.M. BASE

;21800  1309		     END;

;21900  1310		ALLOCLUSTER();						! GO ALLOCATE THE CLUSTER

;22000  1311		IF NOT LNK$ALLOVIRMEM(.LNK$GL_CURCLU[CLU$L_BASE],	! CONTENTS TO VIRTUAL MEMORY

;22100  1312			.LNK$GL_CURCLU[CLU$L_PAGES])			! THEN ATTEMPT TO ALLOCATE THAT REGION

;22200  1313		THEN BEGIN

;22300  1314			LNK$GL_CTLMSK<LNK$S_IMAGE,1,0> = FALSE;		! TURN OFF IMAGE PRODUCTION

;22400  1315			LNK$ERRMSG(ERM$C_CONFMEM,SEV$C_DIAG,		! AND ISSUE ERROR ON FAILURE

;22500  1316			.LNK$GL_CURCLU[CLU$L_BASE],.LNK$GL_CURCLU[CLU$L_PAGES],

;22600  1317			LNK$GL_CURCLU[CLU$B_NAMLNG]);

;22700  1318		     END

;22710  1319		ELSE IF .HIGHCLUSTER EQL 0					! IF NO HIGH CLUSTER

;22720  1320		     OR .LNK$GL_CURCLU[CLU$L_BASE] GTR .HIGHCLUSTER[CLU$L_BASE]	! OR THIS IS BEYOND IT

;22730  1321		     THEN HIGHCLUSTER = .LNK$GL_CURCLU;				! SET NEW HIGH

;22800  1322		END;

;22900  1323	!

;23000  1324	! ALL EXPLICITLY BASED VIRTUAL MEMORY HAS NOW BEEN ALLOCATED. NOW MAKE

;23100  1325	! ANOTHER PASS DOWN THE CLUSTER LIST, ALLOCATING MEMORY THE THE POSITION

;23200  1326	! INDEPENDENT SHAREABLE IMAGES AND USER DEFINED CLUSTERS WHICH HAVE NO

;23300  1327	! EXPLICIT ADDRESS SPECIFICATION.

;23400  1328	!

;23500  1329	BASEADDRSYM = .LNK$GL_MINVA;					! SAVE MINIMUM ADDRESS

;23600  1330	IF LNK$ALLOVIRMEM(0,1)						! FORCE ALLOCATE FIRST PAGE IF STILL FREE

;23700  1331	THEN LNK$GL_MINVA = .BASEADDRSYM;				! RESTORE MINIMUM ADDRESS IF SUCCEEDED

;23800  1332	LNK$GL_CURCLU = LNK$GL_CLULST[0];				! START AT TOP OF LIST

;23900  1333	WHILE (LNK$GL_CURCLU = .LNK$GL_CURCLU[CLU$L_NXTCLU]) NEQ 0		! GET NEXT CLUSTER DESCRIPTOR

;24000  1334	DO BEGIN

;24100  1335		IF NOT .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_BASED>		! IF BASE ADDRESS NOT YET ESTABLISHED

;24200  1336		THEN BEGIN

;24300  1337			IF NOT .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_SHRIMG>	! IF IT IS NOT A SHAREABLE IMAGE

;24400  1338			THEN ALLOCLUSTER();					! CLUSTER, GATHER P-SECTIONS

;24500  1339			IF NOT LNK$FINDVIRMEM(LNK$GL_CURCLU[CLU$L_BASE],	! ATTEMPT TO FIND ENOUGH MEMORY

;24600  1340					.LNK$GL_CURCLU[CLU$L_PAGES])		! FOR CLUSTER, RETURNING BASE ADDRESS

;24700  1341			THEN BEGIN

;24800  1342				LNK$ERRMSG(ERM$C_INSVIRMEM,SEV$C_DIAG,		! BUT ISSUE ERROR IF INSUFFICIENT

;24900  1343					.LNK$GL_CURCLU[CLU$L_PAGES],

;25000  1344					LNK$GL_CURCLU[CLU$B_NAMLNG]);

;25100  1345				LNK$GL_CTLMSK<LNK$S_IMAGE,1,0> = FALSE;		! AND DISABLE IMAGE OUTPUT

;25200  1346			     END

;25210  1347			ELSE IF .HIGHCLUSTER EQL 0					! IF NO HIGH CLUSTER

;25220  1348			     OR .LNK$GL_CURCLU[CLU$L_BASE] GTR .HIGHCLUSTER[CLU$L_BASE]	! OR THIS IS BEYOND IT

;25230  1349			     THEN HIGHCLUSTER = .LNK$GL_CURCLU;				! SET NEW HIGH

;25300  1350		     END;

;25400  1351		RELOCLUSTER();							! RELOCATE CONTENT OF CLUSTER

;25500  1352	   END;

;25505  1353	ISCTDESC = HIGHCLUSTER[CLU$L_FSTISD];				! SET POINTER AT TOP OF LIST

;25510  1354	IF .(HIGHCLUSTER[CLU$W_FLAGS])<CLU$V_SHRIMG>			! IF HIGHEST CLUSTER IS A SHAREABLE

;25515  1355	AND .LNK$GL_CTLMSK<LNK$S_EXE,1,0>				! IMAGE IN AN EXECUTABLE IMAGE

;25520  1356	THEN WHILE (ISCTDESC = .ISCTDESC[ISD$L_NXTISD]) NEQ 0		! GO DOWN LIST AND

;25525  1357	     DO BEGIN

;25530  1358		BIND CURHDRISD = ISCTDESC[ISD$AL_HDRISD] : BLOCK[,BYTE];

;25535  1359		IF .CURHDRISD[ISD$V_GBL]				! IF GLOBAL

;25540  1360		THEN CURHDRISD[ISD$V_LASTCLU] = TRUE;			! MARK AS IN LAST CLUSTER

;25545  1361		END;

;25550  1362	!



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-4

; Digital Equipment Corporation

;

;25600  1363	IF .LNK$GL_TFRPSC NEQ 0							! IF A TRANSFER ADDRESS EXISTS

;25700  1364	THEN LNK$GL_TFRADR = .LNK$GL_TFRADR + .LNK$GL_TFRPSC[PSC$L_BASE];	! THEN RELOCATE IT

;25800  1365	IF .LNK$GL_DBGTFPS NEQ 0						! IF A DEBUGGER TRANSFER ADDRESS

;25900  1366	THEN LNK$GL_DBGTFR = .LNK$GL_DBGTFR + .LNK$GL_DBGTFPS[PSC$L_BASE];	! RELOCATE IT ALSO

;26000  1367	RETURN;									! MEMORY ALLOCATION/RELOCATION COMPLETE

;26100  1368	END;						! OF ROUTINE.





							    .TITLE  LNK_VMALLO

							    .IDENT  \X01.09\



							    .PSECT  $PLIT$,NOWRT,NOEXE,2



					      00000 P.AAA:  .ASCII  \_U_R_\<0><0><0>					      ;

					      00008 P.AAB:  .ASCII  \_U_RW\<0><0><0>					      ;

					      00010 P.AAC:  .ASCII  \_U_X_\<0><0><0>					      ;

					      00018 P.AAD:  .ASCII  \_U_XW\<0><0><0>					      ;

					      00020 P.AAE:  .ASCII  \_STACK\<0><0>					      ;

					      00028 P.AAF:  .ASCII  \S_ALONE\<0>					      ;

					      00030 P.AAG:  .ASCII  \_S_R_\<0><0><0>					      ;

					      00038 P.AAH:  .ASCII  \_S_RW\<0><0><0>					      ;

					      00040 P.AAI:  .ASCII  \_S_X_\<0><0><0>					      ;

					      00048 P.AAJ:  .ASCII  \_S_XW\<0><0><0>					      ;

					      00050 P.AAK:  .ASCII  \___R_\<0><0><0>					      ;

					      00058 P.AAL:  .ASCII  \___RW\<0><0><0>					      ;

					      00060 P.AAM:  .ASCII  \___X_\<0><0><0>					      ;

					      00068 P.AAN:  .ASCII  \___XW\<0><0><0>					      ;

					      00070 P.AAO:  .ASCII  \_SPR_\<0><0><0>					      ;

					      00078 P.AAP:  .ASCII  \_SPRW\<0><0><0>					      ;

					      00080 P.AAQ:  .ASCII  \_SPX_\<0><0><0>					      ;

					      00088 P.AAR:  .ASCII  \_SPXW\<0><0><0>					      ;

					      00090 P.AAS:  .ASCII  \__PR_\<0><0><0>					      ;

					      00098 P.AAT:  .ASCII  \__PRW\<0><0><0>					      ;

					      000A0 P.AAU:  .ASCII  \__PX_\<0><0><0>					      ;

					      000A8 P.AAV:  .ASCII  \__PXW\<0><0><0>					      ;

					      000B0 P.AAW:  .ASCII  \_STACK\<0><0>					      ;



							    .PSECT  $OWN$,NOEXE,2



					      00000 EXE_ISECTS:

							    .BYTE   5							      ;

					      00001	    .BLKB   3

					      00004 EXE_ISGENTBL:

							    .WORD   328							      ;

					      00006 	    .WORD   8							      ;

					      00008 	    .BYTE   0							      ;

					      00009 	    .BYTE   16							      ;

					      0000A 	    .BYTE   0							      ;

					      0000B 	    .BYTE   0							      ;

					      0000C 	    .ADDRESS  P.AAA						      ;

					      00010 	    .BYTE   0							      ;

					      00011 	    .WORD   328							      ;

					      00013 	    .WORD   264							      ;

					      00015 	    .BYTE   0							      ;

					      00016 	    .BYTE   16							      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-5

; Digital Equipment Corporation

;

					      00017 	    .BYTE   0							      ;

					      00018 	    .BYTE   10							      ;

					      00019 	    .ADDRESS  P.AAB						      ;

					      0001D 	    .BYTE   0							      ;

					      0001E 	    .WORD   328							      ;

					      00020 	    .WORD   72							      ;

					      00022 	    .BYTE   0							      ;

					      00023 	    .BYTE   16							      ;

					      00024 	    .BYTE   0							      ;

					      00025 	    .BYTE   0							      ;

					      00026 	    .ADDRESS  P.AAC						      ;

					      0002A 	    .BYTE   0							      ;

					      0002B 	    .WORD   328							      ;

					      0002D 	    .WORD   328							      ;

					      0002F 	    .BYTE   0							      ;

					      00030 	    .BYTE   16							      ;

					      00031 	    .BYTE   0							      ;

					      00032 	    .BYTE   10							      ;

					      00033 	    .ADDRESS  P.AAD						      ;

					      00037 	    .BYTE   0							      ;

					      00038 	    .WORD   0							      ;

					      0003A 	    .WORD   8							      ;

					      0003C 	    .BYTE   -3							      ;

					      0003D 	    .BYTE   12							      ;

					      0003E 	    .BYTE   0							      ;

					      0003F 	    .BYTE   12							      ;

					      00040 	    .ADDRESS  P.AAE						      ;

					      00044 	    .BYTE   0							      ;

					      00045 SYS_ISECTS:

							    .BYTE   1							      ;

					      00046	    .BLKB   2

					      00048 SYS_ISGENTBL:

							    .WORD   8							      ;

					      0004A 	    .WORD   8							      ;

					      0004C 	    .BYTE   0							      ;

					      0004D 	    .BYTE   16							      ;

					      0004E 	    .BYTE   0							      ;

					      0004F 	    .BYTE   0							      ;

					      00050 	    .ADDRESS  P.AAF						      ;

					      00054 	    .BYTE   0							      ;

					      00055 SHR_ISECTS:

							    .BYTE   17							      ;

					      00056	    .BLKB   2

					      00058 SHR_ISGENTBL:

							    .WORD   361							      ;

					      0005A 	    .WORD   40							      ;

					      0005C 	    .BYTE   1							      ;

					      0005D 	    .BYTE   16							      ;

					      0005E 	    .BYTE   0							      ;

					      0005F 	    .BYTE   0							      ;

					      00060 	    .ADDRESS  P.AAG						      ;

					      00064 	    .BYTE   0							      ;

					      00065 	    .WORD   361							      ;

					      00067 	    .WORD   296							      ;

					      00069 	    .BYTE   1							      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-6

; Digital Equipment Corporation

;

					      0006A 	    .BYTE   16							      ;

					      0006B 	    .BYTE   0							      ;

					      0006C 	    .BYTE   8							      ;

					      0006D 	    .ADDRESS  P.AAH						      ;

					      00071 	    .BYTE   0							      ;

					      00072 	    .WORD   361							      ;

					      00074 	    .WORD   104							      ;

					      00076 	    .BYTE   1							      ;

					      00077 	    .BYTE   16							      ;

					      00078 	    .BYTE   0							      ;

					      00079 	    .BYTE   0							      ;

					      0007A 	    .ADDRESS  P.AAI						      ;

					      0007E 	    .BYTE   0							      ;

					      0007F 	    .WORD   361							      ;

					      00081 	    .WORD   360							      ;

					      00083 	    .BYTE   1							      ;

					      00084 	    .BYTE   16							      ;

					      00085 	    .BYTE   0							      ;

					      00086 	    .BYTE   8							      ;

					      00087 	    .ADDRESS  P.AAJ						      ;

					      0008B 	    .BYTE   0							      ;

					      0008C 	    .WORD   361							      ;

					      0008E 	    .WORD   8							      ;

					      00090 	    .BYTE   2							      ;

					      00091 	    .BYTE   16							      ;

					      00092 	    .BYTE   0							      ;

					      00093 	    .BYTE   0							      ;

					      00094 	    .ADDRESS  P.AAK						      ;

					      00098 	    .BYTE   0							      ;

					      00099 	    .WORD   361							      ;

					      0009B 	    .WORD   264							      ;

					      0009D 	    .BYTE   2							      ;

					      0009E 	    .BYTE   16							      ;

					      0009F 	    .BYTE   0							      ;

					      000A0 	    .BYTE   10							      ;

					      000A1 	    .ADDRESS  P.AAL						      ;

					      000A5 	    .BYTE   0							      ;

					      000A6 	    .WORD   361							      ;

					      000A8 	    .WORD   72							      ;

					      000AA 	    .BYTE   2							      ;

					      000AB 	    .BYTE   16							      ;

					      000AC 	    .BYTE   0							      ;

					      000AD 	    .BYTE   0							      ;

					      000AE 	    .ADDRESS  P.AAM						      ;

					      000B2 	    .BYTE   0							      ;

					      000B3 	    .WORD   361							      ;

					      000B5 	    .WORD   328							      ;

					      000B7 	    .BYTE   2							      ;

					      000B8 	    .BYTE   16							      ;

					      000B9 	    .BYTE   0							      ;

					      000BA 	    .BYTE   10							      ;

					      000BB 	    .ADDRESS  P.AAN						      ;

					      000BF 	    .BYTE   0							      ;

					      000C0 	    .WORD   361							      ;

					      000C2 	    .WORD   41							      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-7

; Digital Equipment Corporation

;

					      000C4 	    .BYTE   3							      ;

					      000C5 	    .BYTE   16							      ;

					      000C6 	    .BYTE   0							      ;

					      000C7 	    .BYTE   0							      ;

					      000C8 	    .ADDRESS  P.AAO						      ;

					      000CC 	    .BYTE   0							      ;

					      000CD 	    .WORD   361							      ;

					      000CF 	    .WORD   297							      ;

					      000D1 	    .BYTE   3							      ;

					      000D2 	    .BYTE   16							      ;

					      000D3 	    .BYTE   0							      ;

					      000D4 	    .BYTE   8							      ;

					      000D5 	    .ADDRESS  P.AAP						      ;

					      000D9 	    .BYTE   0							      ;

					      000DA 	    .WORD   361							      ;

					      000DC 	    .WORD   105							      ;

					      000DE 	    .BYTE   3							      ;

					      000DF 	    .BYTE   16							      ;

					      000E0 	    .BYTE   0							      ;

					      000E1 	    .BYTE   0							      ;

					      000E2 	    .ADDRESS  P.AAQ						      ;

					      000E6 	    .BYTE   0							      ;

					      000E7 	    .WORD   361							      ;

					      000E9 	    .WORD   361							      ;

					      000EB 	    .BYTE   3							      ;

					      000EC 	    .BYTE   16							      ;

					      000ED 	    .BYTE   0							      ;

					      000EE 	    .BYTE   8							      ;

					      000EF 	    .ADDRESS  P.AAR						      ;

					      000F3 	    .BYTE   0							      ;

					      000F4 	    .WORD   361							      ;

					      000F6 	    .WORD   9							      ;

					      000F8 	    .BYTE   4							      ;

					      000F9 	    .BYTE   16							      ;

					      000FA 	    .BYTE   0							      ;

					      000FB 	    .BYTE   0							      ;

					      000FC 	    .ADDRESS  P.AAS						      ;

					      00100 	    .BYTE   0							      ;

					      00101 	    .WORD   361							      ;

					      00103 	    .WORD   265							      ;

					      00105 	    .BYTE   4							      ;

					      00106 	    .BYTE   16							      ;

					      00107 	    .BYTE   0							      ;

					      00108 	    .BYTE   10							      ;

					      00109 	    .ADDRESS  P.AAT						      ;

					      0010D 	    .BYTE   0							      ;

					      0010E 	    .WORD   361							      ;

					      00110 	    .WORD   73							      ;

					      00112 	    .BYTE   4							      ;

					      00113 	    .BYTE   16							      ;

					      00114 	    .BYTE   0							      ;

					      00115 	    .BYTE   0							      ;

					      00116 	    .ADDRESS  P.AAU						      ;

					      0011A 	    .BYTE   0							      ;

					      0011B 	    .WORD   361							      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-8

; Digital Equipment Corporation

;

					      0011D 	    .WORD   329							      ;

					      0011F 	    .BYTE   4							      ;

					      00120 	    .BYTE   16							      ;

					      00121 	    .BYTE   0							      ;

					      00122 	    .BYTE   10							      ;

					      00123 	    .ADDRESS  P.AAV						      ;

					      00127 	    .BYTE   0							      ;

					      00128 	    .WORD   0							      ;

					      0012A 	    .WORD   8							      ;

					      0012C 	    .BYTE   -3							      ;

					      0012D 	    .BYTE   12							      ;

					      0012E 	    .BYTE   0							      ;

					      0012F 	    .BYTE   12							      ;

					      00130 	    .ADDRESS  P.AAW						      ;

					      00134 	    .BYTE   0							      ;

					      00135	    .BLKB   3

					      00138 ISECT_BASE:

							    .BLKB   4

					      0013C CNTRL_REG_ADDR:

							    .LONG   -2147483648						      ;

					      00140 ISECT:  .BLKB   1

					      00141 NUMISECTS:

							    .BLKB   1

					      00142	    .BLKB   2

					      00144 ISECTGENTBL:

							    .BLKB   4

					      00148 ISCTDESC:

							    .BLKB   4



							    .PSECT  $GLOBAL$,NOEXE,2



					      00000 LNK$GL_MAPLST::

							    .BLKB   4

					      00004 LNK$GW_STACK::

							    .BLKB   2

					      00006 LNK$GW_NISECTS::

							    .BLKB   2



						    SYM$C_MAXLNG==	15

						    FDB$C_SIZE==	75

						    LNK$S_NEWUDF==	0

						    LNK$S_LIBR==	1

						    LNK$S_SHR==		2

						    LNK$S_SELSER==	3

						    LNK$S_OPTION==	4

						    LNK$S_DEBUGER==	5

						    LNK$S_LIBEXTR==	6

						    LNK$S_LIBSRCH==	7

						    LNK$M_NEWUDF==	1

						    LNK$M_LIBR==	2

						    LNK$M_SHR==		4

						    LNK$M_SELSER==	8

						    LNK$M_OPTION==	16

						    LNK$M_DEBUGER==	32

						    LNK$M_LIBEXTR==	64



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-9

; Digital Equipment Corporation

;

						    LNK$M_LIBSRCH==	128

						    PMT$L_PSCDES==	0

						    PMT$L_MODCON==	1

						    PMT$L_SYMLST==	1

						    PMT$C_SIZE==	8

						    OMD$C_SIZE==	2080

						    OMD$M_NOPSCT==	1

						    OMD$S_NOPSCT==	0

						    OMD$M_NOBIN==	2

						    OMD$S_NOBIN==	1

						    OMD$M_SHRIMG==	4

						    OMD$S_SHRIMG==	2

						    OMD$M_SELSER==	8

						    OMD$S_SELSER==	3

						    OMD$M_MAPMOD==	16

						    OMD$S_MAPMOD==	4

						    OMD$M_DEBUGER==	32

						    OMD$S_DEBUGER==	5

						    PSC$C_SIZE==	43

						    MPC$C_SIZE==	17

						    LID$C_SIZE==	4

						    CLU$C_SIZE==	55

						    CLU$S_BASED==	0

						    CLU$S_SYMBAS==	1

						    CLU$S_SHRIMG==	2

						    CLU$S_PIC==		3

						    CLU$S_COPY==	4

						    CLU$S_OPEN==	5

						    CLU$S_PENDING==	6

						    FVM$C_SIZE==	12

						    SYM$C_TBLSIZ==	128

						    SYM$C_SIZE==	42

						    OBJ$C_MAXRECTYP==	5

						    GPS$C_SIZE==	24

						    PSC$M_PIC==		1

						    PSC$M_LIB==		2

						    PSC$M_OVR==		4

						    PSC$M_REL==		8

						    PSC$M_GBL==		16

						    PSC$M_SHR==		32

						    PSC$M_EXE==		64

						    PSC$M_RD==		128

						    PSC$M_WRT==		256

						    PSC$M_SUPRES==	32768

						    GSY$C_SIZE==	4

						    SYM$S_WEAK==	0

						    SYM$S_DEF==		1

						    SYM$S_UNI==		2

						    SYM$S_REL==		3

						    SYM$S_SHRIMG==	11

						    SYM$S_REDEF==	12

						    SYM$S_SUPRES==	13

						    SYM$S_GSTMISS==	14

						    SYM$S_ENTMSK==	15

						    SYM$M_WEAK==	1



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-10

; Digital Equipment Corporation

;

						    SYM$M_DEF==		2

						    SYM$M_UNI==		4

						    SYM$M_REL==		8

						    SYM$M_SHRIMG==	2048

						    SYM$M_REDEF==	4096

						    SYM$M_SUPRES==	8192

						    SYM$M_GSTMISS==	16384

						    SYM$M_ENTMSK==	32768

						    SRF$C_SIZE==	20

						    SDF$C_SIZE==	25

						    EPM$C_SIZE==	27

						    PRO$C_SIZE==	27

						    FML$C_SIZE==	2

						    ARG$C_SIZE==	2

						    ARG$K_UNKNOWN==	0

						    ARG$K_VALUE==	1

						    ARG$K_REF==		2

						    ARG$K_DESC==	3

						    MHD$C_SIZE==	20

						    EOM$C_SIZE==	7

						    OBJ$C_EOMMIN==	2

						    OBJ$C_EOMMAX==	7

						    TIR$C_STA_GBL==	0

						    TIR$C_STA_SB==	1

						    TIR$C_STA_SW==	2

						    TIR$C_STA_LW==	3

						    TIR$C_STA_PB==	4

						    TIR$C_STA_PW==	5

						    TIR$C_STA_PL==	6

						    TIR$C_STA_UB==	7

						    TIR$C_STA_UW==	8

						    TIR$C_STA_BFI==	9

						    TIR$C_STA_WFI==	10

						    TIR$C_STA_LFI==	11

						    TIR$C_STA_EPM==	12

						    TIR$C_STA_CKARG==	13

						    TIR$C_MAXSTACOD==	13

						    TIR$C_MINSTOCOD==	20

						    TIR$C_STO_SB==	20

						    TIR$C_STO_SW==	21

						    TIR$C_STO_L==	22

						    TIR$C_STO_BD==	23

						    TIR$C_STO_WD==	24

						    TIR$C_STO_LD==	25

						    TIR$C_STO_LI==	26

						    TIR$C_STO_PIDR==	27

						    TIR$C_STO_PICR==	28

						    TIR$C_STO_RSB==	29

						    TIR$C_STO_RSW==	30

						    TIR$C_STO_RL==	31

						    TIR$C_STO_VPS==	32

						    TIR$C_STO_USB==	33

						    TIR$C_STO_USW==	34

						    TIR$C_STO_RUB==	35

						    TIR$C_STO_RUW==	36



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-11

; Digital Equipment Corporation

;

						    TIR$C_STO_B==	37

						    TIR$C_STO_W==	38

						    TIR$C_STO_RB==	39

						    TIR$C_STO_RW==	40

						    TIR$C_MAXSTOCOD==	40

						    TIR$C_MINOPRCOD==	50

						    TIR$C_OPR_NOP==	50

						    TIR$C_OPR_ADD==	51

						    TIR$C_OPR_SUB==	52

						    TIR$C_OPR_MUL==	53

						    TIR$C_OPR_DIV==	54

						    TIR$C_OPR_AND==	55

						    TIR$C_OPR_IOR==	56

						    TIR$C_OPR_EOR==	57

						    TIR$C_OPR_NEG==	58

						    TIR$C_OPR_COM==	59

						    TIR$C_OPR_INSV==	60

						    TIR$C_OPR_ASH==	61

						    TIR$C_OPR_USH==	62

						    TIR$C_OPR_ROT==	63

						    TIR$C_OPR_SEL==	64

						    TIR$C_OPR_REDEF==	65

						    TIR$C_MAXOPRCOD==	65

						    TIR$C_MINCTLCOD==	80

						    TIR$C_CTL_SETRB==	80

						    TIR$C_CTL_AUGRB==	81

						    TIR$C_MAXCTLCOD==	81

						    ISC$C_SIZE==	13

						    ISD$C_SIZE==	48

						    IHD$K_SHR==		2

						    IHD$K_ACTIVOFF==	40

						    IHD$K_SYMDBGOFF==	56

						    IHD$K_IMGIDOFF==	68

						    IHD$K_PATCHOFF==	124

						    IHD$K_MAXLENGTH==	124

						    HDR$K_FILLCHR==	255

						    HDR$K_MINFILL==	2

						    DEF$C_STACK==	20

						    DEF$C_BASE==	512

							    .GLOBL  LNK$AL_VALCTLTB, LNK$GL_TFRPSC, LNK$GL_TFRADR

							    .GLOBL  LNK$GL_DBGTFPS, LNK$GL_DBGTFR, LNK$GL_CTLMSK, LNK$GL_MINVA

							    .GLOBL  LNK$GL_CLULST, LNK$GL_CURCLU, LNK$GL_DEFCLU, LNK$GL_FVMLST

							    .GLOBL  CRF$INSRTREF, LNK$ALLOBLK, LNK$ALLOVIRMEM, LNK$FINDVIRMEM

							    .GLOBL  LNK$ERRMSG, LNK$FNDPSCMSK, LNK$S_DBG, LNK$S_EXE

							    .GLOBL  LNK$S_IMAGE, LNK$S_LONG, LNK$S_PICIMG, LNK$S_SYMTBL

							    .GLOBL  LNK$S_SYS, ERM$C_BASESYM, ERM$C_CONFMEM, ERM$C_INSVIRMEM

							    .GLOBL  ERM$C_PSCOVFLO, ERM$C_STKOVFLO, SEV$C_FATAL, SEV$C_DIAG



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 00000 	    .ENTRY  LNK$VMALLO, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 1269

		         55	0000G  CF  9E 00002 	    MOVAB   LNK$ERRMSG, R5					      ;

		         56	0000'  CF  9E 00007 	    MOVAB   ISCTDESC, R6					      ;

		         57	       00  D0 0000C 	    MOVL    #LNK$S_IMAGE, R7					      ;

		         58	       00  D0 0000F 	    MOVL    #LNK$S_SYS, R8					      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-12

; Digital Equipment Corporation

;

		         59	       00  D0 00012 	    MOVL    #SEV$C_DIAG, R9					      ;

		         5A	0000G  CF  9E 00015 	    MOVAB   LNK$GL_CTLMSK, R10					      ;

		         5B	0000G  CF  9E 0001A 	    MOVAB   LNK$GL_CURCLU, R11					      ;

		         6B	0000G  CF  9E 0001F 	    MOVAB   LNK$GL_CLULST, LNK$GL_CURCLU			      ; 1287

		         7B	       9B  D0 00024 1$:     MOVL    @LNK$GL_CURCLU, LNK$GL_CURCLU			      ; 1288

				       03  12 00027 	    BNEQ    2$							      ;

				     00AD  31 00029 	    BRW     12$							      ;

		         50	       6B  D0 0002C 2$:     MOVL    LNK$GL_CURCLU, R0					      ; 1289

	   F0	    24   A0	       02  E0 0002F 	    BBS     #2, 36(R0), 1$					      ;

		         EC	  24   A0  E9 00034 	    BLBC    36(R0), 1$						      ; 1290

	   00	         6A	       00  E5 00038 	    BBCC    #LNK$S_PICIMG, LNK$GL_CTLMSK, 3$			      ; 1292

	   56	    24   A0	       01  E1 0003C 3$:     BBC     #1, 36(R0), 7$					      ; 1293

	   52	         50	       1C  C1 00041 	    ADDL3   #28, R0, R2						      ; 1295

		         53	       62  D0 00045 	    MOVL    (R2), BASEADDRSYM					      ;

		         50	  1E   A3  3C 00048 	    MOVZWL  30(BASEADDRSYM), R0					      ; 1296

		         50 FFFFFFF5   8F  CA 0004C 	    BICL2   #-11, R0						      ;

		         02	       50  D1 00053 	    CMPL    R0, #2						      ; 1297

				       22  13 00056 	    BEQL    5$							      ;

				  08   A3  9F 00058 	    PUSHAB  8(BASEADDRSYM)					      ; 1300

		         7E	       59  9A 0005B 	    MOVZBL  R9, -(SP)						      ; 1299

		         7E	  00G  8F  9A 0005E 	    MOVZBL  #ERM$C_BASESYM, -(SP)				      ;

		         65	       03  FB 00062 	    CALLS   #3, LNK$ERRMSG					      ;

	   52	         6B	       1C  C1 00065 	    ADDL3   #28, LNK$GL_CURCLU, R2				      ; 1302

	   09	         6A	       58  E1 00069 	    BBC     R8, LNK$GL_CTLMSK, 4$				      ; 1301

		         62 80000000   8F  D0 0006D 	    MOVL    #-2147483648, (R2)					      ; 1302

				       14  11 00074 	    BRB     6$							      ; 1301

				       62  D4 00076 4$:     CLRL    (R2)						      ; 1303

				       10  11 00078 	    BRB     6$							      ; 1296

	   50	         63 000001FF   8F  C1 0007A 5$:     ADDL3   #511, (BASEADDRSYM), R0				      ; 1305

	   62	         50 000001FF   8F  CB 00082 	    BICL3   #511, R0, (R2)					      ; 1306

	   09	         6A	       58  E1 0008A 6$:     BBC     R8, LNK$GL_CTLMSK, 7$				      ; 1307

		         50	0000G  CF  D0 0008E 	    MOVL    LNK$GL_FVMLST, R0					      ; 1308

		    04   A0	       62  D0 00093 	    MOVL    (R2), 4(R0)						      ;

		  0000V  CF	       00  FB 00097 7$:     CALLS   #0, ALLOCLUSTER					      ; 1310

		         50	       6B  D0 0009C 	    MOVL    LNK$GL_CURCLU, R0					      ; 1312

		         7E	  1C   A0  7D 0009F 	    MOVQ    28(R0), -(SP)					      ; 1311

		  0000G  CF	       02  FB 000A3 	    CALLS   #2, LNK$ALLOVIRMEM					      ;

		         1A	       50  E8 000A8 	    BLBS    R0, 9$						      ;

	   00	         6A	       57  E5 000AB 	    BBCC    R7, LNK$GL_CTLMSK, 8$				      ; 1314

		         50	       6B  D0 000AF 8$:     MOVL    LNK$GL_CURCLU, R0					      ; 1317

				  27   A0  9F 000B2 	    PUSHAB  39(R0)						      ;

		         7E	  1C   A0  7D 000B5 	    MOVQ    28(R0), -(SP)					      ; 1315

		         7E	       59  9A 000B9 	    MOVZBL  R9, -(SP)						      ;

		         7E	  00G  8F  9A 000BC 	    MOVZBL  #ERM$C_CONFMEM, -(SP)				      ;

		         65	       05  FB 000C0 	    CALLS   #5, LNK$ERRMSG					      ;

				       11  11 000C3 	    BRB     11$							      ; 1311

				       54  D5 000C5 9$:     TSTL    HIGHCLUSTER						      ; 1319

				       0A  13 000C7 	    BEQL    10$							      ;

		         50	       6B  D0 000C9 	    MOVL    LNK$GL_CURCLU, R0					      ; 1320

		    1C   A4	  1C   A0  D1 000CC 	    CMPL    28(R0), 28(HIGHCLUSTER)				      ;

				       03  15 000D1 	    BLEQ    11$							      ;

		         54	       6B  D0 000D3 10$:    MOVL    LNK$GL_CURCLU, HIGHCLUSTER				      ; 1321

				     FF4B  31 000D6 11$:    BRW     1$							      ; 1289

		         53	0000G  CF  D0 000D9 12$:    MOVL    LNK$GL_MINVA, BASEADDRSYM				      ; 1329

				       01  DD 000DE 	    PUSHL   #1							      ; 1330



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-13

; Digital Equipment Corporation

;

				       7E  D4 000E0 	    CLRL    -(SP)						      ;

		  0000G  CF	       02  FB 000E2 	    CALLS   #2, LNK$ALLOVIRMEM					      ;

		         05	       50  E9 000E7 	    BLBC    R0, 13$						      ;

		  0000G  CF	       53  D0 000EA 	    MOVL    BASEADDRSYM, LNK$GL_MINVA				      ; 1331

		         6B	0000G  CF  9E 000EF 13$:    MOVAB   LNK$GL_CLULST, LNK$GL_CURCLU			      ; 1332

		         7B	       9B  D0 000F4 14$:    MOVL    @LNK$GL_CURCLU, LNK$GL_CURCLU			      ; 1333

				       53  13 000F7 	    BEQL    19$							      ;

		         50	       6B  D0 000F9 	    MOVL    LNK$GL_CURCLU, R0					      ; 1335

		         45	  24   A0  E8 000FC 	    BLBS    36(R0), 18$						      ;

	   05	    24   A0	       02  E0 00100 	    BBS     #2, 36(R0), 15$					      ; 1337

		  0000V  CF	       00  FB 00105 	    CALLS   #0, ALLOCLUSTER					      ; 1338

		         50	       6B  D0 0010A 15$:    MOVL    LNK$GL_CURCLU, R0					      ; 1340

				  20   A0  DD 0010D 	    PUSHL   32(R0)						      ; 1339

				  1C   A0  9F 00110 	    PUSHAB  28(R0)						      ;

		  0000G  CF	       02  FB 00113 	    CALLS   #2, LNK$FINDVIRMEM					      ;

		         19	       50  E8 00118 	    BLBS    R0, 16$						      ;

		         50	       6B  D0 0011B 	    MOVL    LNK$GL_CURCLU, R0					      ; 1344

				  27   A0  9F 0011E 	    PUSHAB  39(R0)						      ;

				  20   A0  DD 00121 	    PUSHL   32(R0)						      ; 1342

		         7E	       59  9A 00124 	    MOVZBL  R9, -(SP)						      ;

		         7E	  00G  8F  9A 00127 	    MOVZBL  #ERM$C_INSVIRMEM, -(SP)				      ;

		         65	       04  FB 0012B 	    CALLS   #4, LNK$ERRMSG					      ;

	   13	         6A	       57  E5 0012E 	    BBCC    R7, LNK$GL_CTLMSK, 18$				      ; 1345

				       11  11 00132 	    BRB     18$							      ; 1339

				       54  D5 00134 16$:    TSTL    HIGHCLUSTER						      ; 1347

				       0A  13 00136 	    BEQL    17$							      ;

		         50	       6B  D0 00138 	    MOVL    LNK$GL_CURCLU, R0					      ; 1348

		    1C   A4	  1C   A0  D1 0013B 	    CMPL    28(R0), 28(HIGHCLUSTER)				      ;

				       03  15 00140 	    BLEQ    18$							      ;

		         54	       6B  D0 00142 17$:    MOVL    LNK$GL_CURCLU, HIGHCLUSTER				      ; 1349

		  0000V  CF	       00  FB 00145 18$:    CALLS   #0, RELOCLUSTER					      ; 1351

				       A8  11 0014A 	    BRB     14$							      ; 1333

	   66	         54	       14  C1 0014C 19$:    ADDL3   #20, HIGHCLUSTER, ISCTDESC				      ; 1353

	   18	    24   A4	       02  E1 00150 	    BBC     #2, 36(HIGHCLUSTER), 21$				      ; 1354

	   14	         6A	       00  E1 00155 	    BBC     #LNK$S_EXE, LNK$GL_CTLMSK, 21$			      ; 1355

		         76	       96  D0 00159 20$:    MOVL    @ISCTDESC, ISCTDESC					      ; 1356

				       0F  13 0015C 	    BEQL    21$							      ;

	   50	         66	       0C  C1 0015E 	    ADDL3   #12, ISCTDESC, R0					      ; 1358

		         F3	  08   A0  E9 00162 	    BLBC    8(R0), 20$						      ; 1359

		    08   A0	  80   8F  88 00166 	    BISB2   #128, 8(R0)						      ; 1360

				       EC  11 0016B 	    BRB     20$							      ; 1356

		         50	0000G  CF  D0 0016D 21$:    MOVL    LNK$GL_TFRPSC, R0					      ; 1363

				       06  13 00172 	    BEQL    22$							      ;

		  0000G  CF	  0C   A0  C0 00174 	    ADDL2   12(R0), LNK$GL_TFRADR				      ; 1364

		         50	0000G  CF  D0 0017A 22$:    MOVL    LNK$GL_DBGTFPS, R0					      ; 1365

				       06  13 0017F 	    BEQL    23$							      ;

		  0000G  CF	  0C   A0  C0 00181 	    ADDL2   12(R0), LNK$GL_DBGTFR				      ; 1366

					   04 00187 23$:    RET     							      ; 1269



; Routine Size:  392 bytes





;26200  1369	ROUTINE ALLOCLUSTER : NOVALUE =

;26300  1370	BEGIN

;26400  1371	!



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-14

; Digital Equipment Corporation

;

;26500  1372	!	THIS ROUTINE INDEXES DOWN THE I-SECTION GENERATION CONTROL

;26600  1373	!	TABLE, CALLING THE I-SECT SPECIFIC ROUTINE.

;26700  1374	!	FIRST HOWEVER ESTABLISH THE BASE ADDRESS IF IT WAS SYMBOLIC

;26800  1375	!

;26900  1376	ISECT_BASE = .LNK$GL_CURCLU[CLU$L_BASE];			! START AT BASE DETERMINED BY COMMAND

;27000  1377	ISCTDESC = LNK$GL_CURCLU[CLU$L_FSTISD];				! INITIALIZE TO LISTHEAD FOR ISECTIONS

;27100  1378	IF .LNK$GL_CTLMSK<LNK$S_EXE,1,0>				! IF NORMAL EXE IMAGE POINT TO

;27200  1379	THEN BEGIN

;27300  1380		ISECTGENTBL = EXE_ISGENTBL;				! ITS CONTROL TABLE AND SET 

;27400  1381		NUMISECTS = .EXE_ISECTS;				! NUMBER OF POTENTIAL ISECTS PER CLUSTER

;27500  1382	     END

;27600  1383	ELSE IF .LNK$GL_CTLMSK<LNK$S_SYS,1,0>				! POINT TO SYSTEM IMAGE CONTROL TABLE

;27700  1384		THEN BEGIN

;27800  1385			ISECTGENTBL = SYS_ISGENTBL;			! AND THEN

;27900  1386			NUMISECTS = .SYS_ISECTS;			! POTENTIAL NUMBER OF ISECTS

;28000  1387		     END

;28100  1388		ELSE BEGIN						! IT MUST BE A SHAREABLE IMAGE

;28200  1389			ISECTGENTBL = SHR_ISGENTBL;			! SO SET THE CONTROL TABLE

;28300  1390			NUMISECTS = .SHR_ISECTS;			! AND NUMBER OF ISECTS PER CLUSTER

;28400  1391		     END;

;28500  1392	!

;28600  1393	INCR ILOOP FROM 1 TO .NUMISECTS DO				! INCREMENT THROUGH GENERATION

;28700  1394	BEGIN								! CONTROL TABLE

;28800  1395		ISECT = .ILOOP;						! REMEMBER INDEX

;28900  1396		ISECT_BASE = (.ISECT_BASE+511) AND NOT 511;		! ROUND UP NEXT PAGE

;29000  1397		IF .ISECTGENTBL[.ISECT-1,ISC$B_CODE] EQL STACK_CODE	! CALL THE BUILD ROUTINE BASED ON

;29100  1398		THEN STACK_ISECTBLD()					! THE KIND OF ISECT .. STACK

;29200  1399		ELSE NORMAL_ISECTBLD();					! AND ALL OTHERS

;29300  1400	END;

;29310  1401	IF .ISCTDESC[ISD$L_NXTISD] EQL -1				! IF AN ALLOCATED ISD IS UNUSED

;29315  1402	THEN BEGIN

;29320  1403		ISCTDESC = .LNK$GL_CURCLU[CLU$L_LSTISD];		! THEN DISCONNECT IT FROM LIST

;29330  1404		ISCTDESC[ISD$L_NXTISD] = 0;

;29340  1405	     END;

;29400  1406	RETURN;

;29500  1407	END;











					 080C 00188 ALLOCLUSTER:

							    .WORD   Save R2,R3,R11					      ; 1369

		         5B	0000'  CF  9E 0018A 	    MOVAB   ISCTDESC, R11					      ;

		         50	0000G  CF  D0 0018F 	    MOVL    LNK$GL_CURCLU, R0					      ; 1376

		    F0   AB	  1C   A0  D0 00194 	    MOVL    28(R0), ISECT_BASE					      ;

	   6B	         50	       14  C1 00199 	    ADDL3   #20, R0, ISCTDESC					      ; 1377

	   0E	  0000G  CF	       00  E1 0019D 	    BBC     #LNK$S_EXE, LNK$GL_CTLMSK, 1$			      ; 1378

		    FC   AB	FEBC   CB  9E 001A3 	    MOVAB   EXE_ISGENTBL, ISECTGENTBL				      ; 1380

		    F9   AB	FEB8   CB  90 001A9 	    MOVB    EXE_ISECTS, NUMISECTS				      ; 1381

				       20  11 001AF 	    BRB     3$							      ; 1378

	   0E	  0000G  CF	       00  E1 001B1 1$:     BBC     #LNK$S_SYS, LNK$GL_CTLMSK, 2$			      ; 1383

		    FC   AB	FF00   CB  9E 001B7 	    MOVAB   SYS_ISGENTBL, ISECTGENTBL				      ; 1385

		    F9   AB	FEFD   CB  90 001BD 	    MOVB    SYS_ISECTS, NUMISECTS				      ; 1386

				       0C  11 001C3 	    BRB     3$							      ; 1383



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-15

; Digital Equipment Corporation

;

		    FC   AB	FF10   CB  9E 001C5 2$:     MOVAB   SHR_ISGENTBL, ISECTGENTBL				      ; 1389

		    F9   AB	FF0D   CB  90 001CB 	    MOVB    SHR_ISECTS, NUMISECTS				      ; 1390

		         53	  F9   AB  9A 001D1 3$:     MOVZBL  NUMISECTS, R3					      ; 1393

				       52  D4 001D5 	    CLRL    ILOOP						      ;

				       35  11 001D7 	    BRB     6$							      ;

		    F8   AB	       52  90 001D9 4$:     MOVB    ILOOP, ISECT					      ; 1395

	   50	    F0   AB 000001FF   8F  C1 001DD 	    ADDL3   #511, ISECT_BASE, R0				      ; 1396

      F0   AB	         50 000001FF   8F  CB 001E6 	    BICL3   #511, R0, ISECT_BASE				      ;

		         50	  F8   AB  9A 001EF 	    MOVZBL  ISECT, R0						      ; 1397

		         50	       0D  C4 001F3 	    MULL2   #13, R0						      ;

		         50	  FC BB40  9E 001F6 	    MOVAB   @ISECTGENTBL[R0], R0				      ;

		    FD   8F	  F7   A0  91 001FB 	    CMPB    -9(R0), #253					      ;

				       07  12 00200 	    BNEQ    5$							      ;

		  0000V  CF	       00  FB 00202 	    CALLS   #0, STACK_ISECTBLD					      ; 1398

				       05  11 00207 	    BRB     6$							      ; 1397

		  0000V  CF	       00  FB 00209 5$:     CALLS   #0, NORMAL_ISECTBLD					      ; 1399

	   C7	         52	       53  F3 0020E 6$:     AOBLEQ  R3, ILOOP, 4$					      ; 1393

	      FFFFFFFF   8F	  00   BB  D1 00212 	    CMPL    @ISCTDESC, #-1					      ; 1401

				       0C  12 0021A 	    BNEQ    7$							      ;

		         50	0000G  CF  D0 0021C 	    MOVL    LNK$GL_CURCLU, R0					      ; 1403

		         6B	  18   A0  D0 00221 	    MOVL    24(R0), ISCTDESC					      ;

				  00   BB  D4 00225 	    CLRL    @ISCTDESC						      ; 1404

					   04 00228 7$:     RET     							      ; 1369



; Routine Size:  161 bytes





;29600  1408	ROUTINE RELOCLUSTER : NOVALUE =

;29700  1409	BEGIN

;29800  1410	!

;29900  1411	!	THIS ROUTINE RELOCATES THE CONTENTS OF THE CURRENT CLUSTER. THIS MEANS

;30000  1412	!	GOING DOWN EACH OF THE I-SECTION AND P-SECTION LISTS AND ADDING

;30100  1413	!	THE CLUSTER BASE TO THEIR BASES. IN ADDITION, FOR EACH P-SECTION,

;30200  1414	!	THE LIST OF SYMBOLS IS SCANNED AND THOSE THAT ARE RELOCATABLE ARE

;30300  1415	!	ALSO RELOCATED BY THE CLUSTER BASE ADDRESS. IN THE PROCESS OF DOING THIS

;30400  1416	!	EACH P-SECTION DESCRIPTOR IS REMOVE FROM THE CLUSTER LIST AND PUT

;30500  1417	!	ON THE MAPPING LIST IN VIRTUAL ADDRESS ORDER FOR LATER MAP

;30600  1418	!	OUTPUT.

;30700  1419	!

;30800  1420	!		IF THE CURRENT CLUSTER HAS ALREADY BEEN BASED, HOWEVER, THE

;30900  1421	!	RELOCATION IS NOT DONE - THE P-SECTIONS ARE MERELY MOVED TO THE

;31000  1422	!	MAPPING LIST.

;31100  1423	!

;31200  1424	LOCAL

;31300  1425		MAPPEDPSC : REF BLOCK[,BYTE],

;31400  1426		NXTMAPPEDPSC : REF BLOCK[,BYTE],

;31500  1427		PSCTDESC : REF BLOCK[,BYTE],

;31600  1428		SYMBOL : REF BLOCK[,BYTE];

;31700  1429	ISCTDESC = LNK$GL_CURCLU[CLU$L_FSTISD];				! INITIALIZE TO LISTHEAD FOR ISECTIONS

;31800  1430	IF NOT .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_BASED>		! IF CLUSTER NOT ALREADY BASED (I.E. RELOCATED)

;31900  1431	THEN WHILE (ISCTDESC = .ISCTDESC[ISD$L_NXTISD]) NEQ 0		! GET NEXT ISD IN LIST

;32000  1432		DO BEGIN

;32100  1433			BIND HDRISD = ISCTDESC[ISD$AL_HDRISD] : BLOCK[,BYTE];	! POINT TO HEADER PART

;32200  1434			IF NOT .HDRISD[ISD$V_P1]				! IF NOT CONTROL REGION

;32300  1435			THEN HDRISD[ISD$V_VPG] = .HDRISD[ISD$V_VPG] + 			! ADD THE CLUSTER BASE PAGE



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-16

; Digital Equipment Corporation

;

;32400  1436						(.LNK$GL_CURCLU[CLU$L_BASE] ^ -9);	! TO I-SECTION PAGE NUMBER

;32500  1437		END;

;32600  1438	WHILE (PSCTDESC = .LNK$GL_CURCLU[CLU$L_FSTPSC]) NEQ 0			! GET FIRST ON LIST OF P-SECTIONS

;32700  1439	DO IF .PSCTDESC[PSC$L_ISECT] EQL 0					! IF P-SECTION NOT ALLOCATED TO MEMORY

;32750  1440	   AND (.PSCTDESC[PSC$W_FLAGS] AND (PSC$M_LIB OR PSC$M_GBL)) EQL 0	! AND IS NOT GLOBAL OR IN SHAREABLE

;32800  1441	   AND NOT .LNK$GL_CTLMSK<LNK$S_SHR,1,0>				! AND NOT A SHAREABLE OR

;32900  1442	   AND NOT .LNK$GL_CTLMSK<LNK$S_DBG,1,0>				! DEBUGGABLE IMAGE

;33000  1443	   AND NOT .LNK$GL_CTLMSK<LNK$S_SYMTBL,1,0>				! AND NO SYMBOL TABLE

;33100  1444	   THEN LNK$GL_CURCLU[CLU$L_FSTPSC] = .PSCTDESC[PSC$L_NXTPSC]		! REMOVE IT FROM LIST

;33200  1445	   ELSE BEGIN

;33300  1446		MAPPEDPSC = LNK$GL_MAPLST;					! MAPPED P-SECTIONS

;33400  1447		IF NOT .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_BASED>		! IF NOT YET RELOCATED

;33500  1448		THEN BEGIN

;33600  1449			IF (.PSCTDESC[PSC$W_FLAGS] AND PSC$M_REL) NEQ 0		! AND THIS P-SECTION IS RELOCATABLE

;33700  1450			THEN PSCTDESC[PSC$L_BASE] = .PSCTDESC[PSC$L_BASE] +

;33800  1451						.LNK$GL_CURCLU[CLU$L_BASE];	! ADD CLUSTER BASE TO ITS BASE

;33900  1452			SYMBOL = .PSCTDESC[PSC$L_SYMLST];			! GO DOWN LIST OF

;34000  1453			WHILE .SYMBOL NEQ 0					! SYMBOLS OWNED BY

;34100  1454			DO BEGIN						! P-SECTION AND ADD ITS

;34200  1455				IF (.SYMBOL[SYM$W_FLAGS] AND SYM$M_REL) NEQ 0	! BASE TO ANY THAT

;34250  1456				THEN BEGIN

;34300  1457					SYMBOL[SYM$L_VALUE]=.SYMBOL[SYM$L_VALUE]+	! ARE RELOCATABLE

;34400  1458						.LNK$GL_CURCLU[CLU$L_BASE];

;34416  1459					IF .LNK$GL_CTLMSK<LNK$S_LONG,1,0>		 ! IF A LONG FORM MAP IS REQUIRED

;34432  1460					AND (.SYMBOL[SYM$W_FLAGS] AND SYM$M_SUPRES) EQL 0 ! AND THE SYMBOL IS NOT  SUPPRESSED

;34448  1461					THEN CRF$INSRTREF(LNK$AL_VALCTLTB,		 ! THEN INSERT THIS SYMBOL

;34464  1462						SYMBOL[SYM$L_VALUE],SYMBOL[SYM$B_NAMLNG],! AS A REFERENCE TO ITS

;34480  1463						.SYMBOL[SYM$W_FLAGS],0);	! OWN VALUE RELOCATED

;34490  1464				     END;

;34500  1465				SYMBOL = .SYMBOL[SYM$L_PSCLST];			! MOVE ON TO NEXT

;34600  1466			   END;

;34700  1467		     END;

;34800  1468		WHILE (NXTMAPPEDPSC = .MAPPEDPSC[PSC$L_NXTPSC]) NEQ 0		! GET POINTER TO NEXT P-SECTION

;34900  1469		DO IF .NXTMAPPEDPSC[PSC$L_BASE] GTRU .PSCTDESC[PSC$L_BASE]	! IF NEXT IS BEYOND THIS P-SECTION

;35000  1470			THEN EXITLOOP

;35100  1471			ELSE MAPPEDPSC = .NXTMAPPEDPSC;

;35200  1472		LNK$GL_CURCLU[CLU$L_FSTPSC] = .PSCTDESC[PSC$L_NXTPSC];		! REMOVE FROM CLUSTER LIST

;35300  1473		PSCTDESC[PSC$L_NXTPSC] = .MAPPEDPSC[PSC$L_NXTPSC];		! AND PUT ON THE MAPPING

;35400  1474		MAPPEDPSC[PSC$L_NXTPSC] = .PSCTDESC				! P-SECTION LIST

;35500  1475	   END;

;35600  1476	RETURN;

;35700  1477	END;











					 0E7C 00229 RELOCLUSTER:

							    .WORD   Save R2,R3,R4,R5,R6,R9,R10,R11			      ; 1408

		         59	0000G  CF  9E 0022B 	    MOVAB   LNK$GL_CURCLU, R9					      ;

		         5A	0000G  CF  9E 00230 	    MOVAB   LNK$GL_CTLMSK, R10					      ;

		         5B	0000'  CF  9E 00235 	    MOVAB   ISCTDESC, R11					      ;

		         51	       69  D0 0023A 	    MOVL    LNK$GL_CURCLU, R1					      ; 1429

	   6B	         51	       14  C1 0023D 	    ADDL3   #20, R1, ISCTDESC					      ;

		         25	  24   A1  E8 00241 	    BLBS    36(R1), 2$						      ; 1430



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-17

; Digital Equipment Corporation

;

		         7B	       9B  D0 00245 1$:     MOVL    @ISCTDESC, ISCTDESC					      ; 1431

				       20  13 00248 	    BEQL    2$							      ;

	   50	         6B	       0C  C1 0024A 	    ADDL3   #12, ISCTDESC, R0					      ; 1433

	   F2	    06   A0	       05  E0 0024E 	    BBS     #5, 6(R0), 1$					      ; 1434

	   52	    1C   A1	  F7   8F  78 00253 	    ASHL    #-9, 28(R1), R2					      ; 1436

      04   A0	         17	       00  EF 00259 	    EXTZV   #0, #23, 4(R0), R3					      ; 1435

				       53     0025E									      ;

		         53	       52  C0 0025F 	    ADDL2   R2, R3						      ;

	   17	         00	       53  F0 00262 	    INSV    R3, #0, #23, 4(R0)					      ;

				  04   A0     00266									      ;

				       DB  11 00268 	    BRB     1$							      ; 1431

		         54	       69  D0 0026A 2$:     MOVL    LNK$GL_CURCLU, R4					      ; 1438

		         52	  0C   A4  D0 0026D 3$:     MOVL    12(R4), PSCTDESC					      ;

				       01  12 00271 	    BNEQ    4$							      ;

					   04 00273 	    RET     							      ;

				  14   A2  D5 00274 4$:     TSTL    20(PSCTDESC)					      ; 1439

				       18  12 00277 	    BNEQ    6$							      ;

		         12	  19   A2  93 00279 	    BITB    25(PSCTDESC), #18					      ; 1440

				       12  12 0027D 	    BNEQ    6$							      ;

	   0E	         6A	       02  E0 0027F 	    BBS     #2, LNK$GL_CTLMSK, 6$				      ; 1441

	   0A	         6A	       00  E0 00283 	    BBS     #LNK$S_DBG, LNK$GL_CTLMSK, 6$			      ; 1442

	   06	         6A	       00  E0 00287 	    BBS     #LNK$S_SYMTBL, LNK$GL_CTLMSK, 6$			      ; 1443

		    0C   A4	       62  D0 0028B 	    MOVL    (PSCTDESC), 12(R4)					      ; 1444

				       DC  11 0028F 5$:     BRB     3$							      ; 1439

		         56	0000'  CF  9E 00291 6$:     MOVAB   LNK$GL_MAPLST, MAPPEDPSC				      ; 1446

		         41	  24   A4  E8 00296 	    BLBS    36(R4), 10$						      ; 1447

	   05	    19   A2	       03  E1 0029A 	    BBC     #3, 25(PSCTDESC), 7$				      ; 1449

		    0C   A2	  1C   A4  C0 0029F 	    ADDL2   28(R4), 12(PSCTDESC)				      ; 1450

		         53	  08   A2  D0 002A4 7$:     MOVL    8(PSCTDESC), SYMBOL					      ; 1452

				       53  D5 002A8 8$:     TSTL    SYMBOL						      ; 1453

				       2F  13 002AA 	    BEQL    10$							      ;

	   24	    1E   A3	       03  E1 002AC 	    BBC     #3, 30(SYMBOL), 9$					      ; 1455

		         50	       69  D0 002B1 	    MOVL    LNK$GL_CURCLU, R0					      ; 1458

		         63	  1C   A0  C0 002B4 	    ADDL2   28(R0), (SYMBOL)					      ; 1457

	   19	         6A	       00  E1 002B8 	    BBC     #LNK$S_LONG, LNK$GL_CTLMSK, 9$			      ; 1459

	   14	    1E   A3	       0D  E0 002BC 	    BBS     #13, 30(SYMBOL), 9$					      ; 1460

				       7E  D4 002C1 	    CLRL    -(SP)						      ; 1461

		         7E	  1E   A3  3C 002C3 	    MOVZWL  30(SYMBOL), -(SP)					      ;

				  08   A3  9F 002C7 	    PUSHAB  8(SYMBOL)						      ; 1462

				       53  DD 002CA 	    PUSHL   SYMBOL						      ; 1461

				0000G  CF  9F 002CC 	    PUSHAB  LNK$AL_VALCTLTB					      ;

		  0000G  CF	       05  FB 002D0 	    CALLS   #5, CRF$INSRTREF					      ;

		         53	  04   A3  D0 002D5 9$:     MOVL    4(SYMBOL), SYMBOL					      ; 1465

				       CD  11 002D9 	    BRB     8$							      ; 1453

		         55	       66  D0 002DB 10$:    MOVL    (MAPPEDPSC), NXTMAPPEDPSC				      ; 1468

				       0C  13 002DE 	    BEQL    11$							      ;

		    0C   A2	  0C   A5  D1 002E0 	    CMPL    12(NXTMAPPEDPSC), 12(PSCTDESC)			      ; 1469

				       05  1A 002E5 	    BGTRU   11$							      ;

		         56	       55  D0 002E7 	    MOVL    NXTMAPPEDPSC, MAPPEDPSC				      ; 1471

				       EF  11 002EA 	    BRB     10$							      ; 1468

		         50	       69  D0 002EC 11$:    MOVL    LNK$GL_CURCLU, R0					      ; 1472

		    0C   A0	       62  D0 002EF 	    MOVL    (PSCTDESC), 12(R0)					      ;

		         62	       66  D0 002F3 	    MOVL    (MAPPEDPSC), (PSCTDESC)				      ; 1473

		         66	       52  D0 002F6 	    MOVL    PSCTDESC, (MAPPEDPSC)				      ; 1474

				       94  11 002F9 	    BRB     5$							      ; 1438



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-18

; Digital Equipment Corporation

;

					   04 002FB 12$:    RET     							      ; 1408



; Routine Size:  211 bytes





;35800  1478	ROUTINE STACK_ISECTBLD : NOVALUE =

;35900  1479	BEGIN

;36000  1480	!

;36100  1481	!	THIS ROUTINE BUILDS A DEMAND ZERO IMAGE SECTION FOR

;36200  1482	!	USER STACK, IF ANY AND IF ON THE LAST CLUSTER.

;36300  1483	!

;36400  1484	IF .LNK$GW_STACK NEQ 0						! IF THERE IS SOME STACK

;36500  1485	AND (.LNK$GL_CURCLU[CLU$L_NXTCLU] EQL 0				! AND WE ARE ON THE LAST CLUSTER

;36550  1486	    OR .LNK$GL_CURCLU EQL LNK$GL_DEFCLU)

;36600  1487	THEN BEGIN

;36700  1488		IF (ISECT_BASE = .CNTRL_REG_ADDR - .LNK$GW_STACK*512)	! SET BASE OF STACK

;36800  1489			LSSU CONTROL_REGION				! IF IT GOES BELOW CONTROL REGION

;36900  1490		THEN LNK$ERRMSG(ERM$C_STKOVFLO,SEV$C_FATAL,		! AN ERROR

;37000  1491				.LNK$GW_STACK,.ISECT_BASE);

;37100  1492		IF .ISCTDESC[ISD$L_NXTISD] EQL 0			! IF CURRENT ISD IS THE LAST

;37200  1493		THEN BEGIN						! ONE IN USE

;37300  1494			LNK$ALLOBLK(ISD$C_SIZE,ISCTDESC[ISD$L_NXTISD]);	! GO ALLOCATE A NEW DESCRIPTOR

;37400  1495			ISCTDESC = .ISCTDESC[ISD$L_NXTISD];		! AND LINK TO THE PREVIOUS ONE

;37500  1496		     END;

;37600  1497		BUILDISD(.LNK$GW_STACK);				! GO CREATE ISD

;37700  1498		CNTRL_REG_ADDR = .ISECT_BASE;				! UPDATE CONTROL REGION POINTER

;37800  1499	   END;

;37900  1500	RETURN;								! AND ALL DONE

;38000  1501	END;								! OF STACK ALLOCATOR











					 0C00 002FC STACK_ISECTBLD:

							    .WORD   Save R10,R11					      ; 1478

		         5A	0000'  CF  9E 002FE 	    MOVAB   LNK$GW_STACK, R10					      ;

		         5B	0000'  CF  9E 00303 	    MOVAB   ISCTDESC, R11					      ;

				       6A  B5 00308 	    TSTW    LNK$GW_STACK					      ; 1484

				       5B  13 0030A 	    BEQL    4$							      ;

				0000G  DF  D5 0030C 	    TSTL    @LNK$GL_CURCLU					      ; 1485

				       0C  13 00310 	    BEQL    1$							      ;

		         50	0000G  CF  9E 00312 	    MOVAB   LNK$GL_DEFCLU, R0					      ; 1486

		         50	0000G  CF  D1 00317 	    CMPL    LNK$GL_CURCLU, R0					      ;

				       49  12 0031C 	    BNEQ    4$							      ;

		         50	       6A  3C 0031E 1$:     MOVZWL  LNK$GW_STACK, R0					      ; 1488

	   50	         50	       09  78 00321 	    ASHL    #9, R0, R0						      ; 0000

	   50	    F4   AB	       50  C3 00325 	    SUBL3   R0, CNTRL_REG_ADDR, R0				      ; 1488

		    F0   AB	       50  D0 0032A 	    MOVL    R0, ISECT_BASE					      ;

	      40000000   8F	       50  D1 0032E 	    CMPL    R0, #1073741824					      ; 1489

				       12  1E 00335 	    BGEQU   2$							      ;

				  F0   AB  DD 00337 	    PUSHL   ISECT_BASE						      ; 1490

		         7E	       6A  3C 0033A 	    MOVZWL  LNK$GW_STACK, -(SP)					      ;

		         7E	       00  9A 0033D 	    MOVZBL  #SEV$C_FATAL, -(SP)					      ;

		         7E	  00G  8F  9A 00340 	    MOVZBL  #ERM$C_STKOVFLO, -(SP)				      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-19

; Digital Equipment Corporation

;

		  0000G  CF	       04  FB 00344 	    CALLS   #4, LNK$ERRMSG					      ;

				  00   BB  D5 00349 2$:     TSTL    @ISCTDESC						      ; 1492

				       0C  12 0034C 	    BNEQ    3$							      ;

				       6B  DD 0034E 	    PUSHL   ISCTDESC						      ; 1494

				       30  DD 00350 	    PUSHL   #48							      ;

		  0000G  CF	       02  FB 00352 	    CALLS   #2, LNK$ALLOBLK					      ;

		         7B	       9B  D0 00357 	    MOVL    @ISCTDESC, ISCTDESC					      ; 1495

		         7E	       6A  3C 0035A 3$:     MOVZWL  LNK$GW_STACK, -(SP)					      ; 1497

		  0000V  CF	       01  FB 0035D 	    CALLS   #1, BUILDISD					      ;

		    F4   AB	  F0   AB  D0 00362 	    MOVL    ISECT_BASE, CNTRL_REG_ADDR				      ; 1498

					   04 00367 4$:     RET     							      ; 1478



; Routine Size:  108 bytes





;38100  1502	ROUTINE NORMAL_ISECTBLD : NOVALUE =

;38200  1503	BEGIN

;38300  1504	!

;38400  1505	!	THIS ROUTINE BUILDS THE NORMAL IMAGE-SECTIONS OF THE 

;38500  1506	!	PROGRAM REGION BY GATHERING COMPATIBLE P-SECTIONS IN

;38600  1507	!	LEXICAL ORDER

;38700  1508	!

;38800  1509	LOCAL

;38900  1510		AROUND,

;39000  1511		CURRENT_BASE,

;39100  1512		ISECT_BLKS,

;39200  1513		PSCTDESC : REF BLOCK[,BYTE],

;39300  1514		SYMBOL : REF BLOCK[,BYTE];

;39400  1515	!

;39500  1516	BIND

;39600  1517		ATTRIBMASK = .ISECTGENTBL[.ISECT-1,ISC$W_MASK],		! CREATE MORE

;39700  1518		ATTRIBVALUE = .ISECTGENTBL[.ISECT-1,ISC$W_MATCH];	! CONVENIENT NAMES

;39800  1519	!

;39900  1520	CURRENT_BASE = .ISECT_BASE;					! SET FIRST P-SECT BASE

;40000  1521	WHILE LNK$FNDPSCMSK(ATTRIBMASK,ATTRIBVALUE,PSCTDESC) DO		! LOOP FINDING P-SECTS

;40100  1522	BEGIN								! WITH APPROPRIATE ATTRIBUTES

;40200  1523		IF .ISCTDESC[ISD$L_NXTISD] EQL 0			! IF WE HAVEN'T ALLOCATED AN ISECT

;40300  1524		THEN BEGIN						! DESCRIPTOR THAT WASN'T USED

;40400  1525			LNK$ALLOBLK(ISD$C_SIZE,ISCTDESC[ISD$L_NXTISD]);	! GO ALLOCATE DESCRIPTOR

;40500  1526			ISCTDESC = .ISCTDESC[ISD$L_NXTISD];		! AND LINK TO THE PREVIOUS ONE

;40600  1527			ISCTDESC[ISD$L_NXTISD] = -1;			! TEMPORARILY MARK AS ALLOCATED

;40700  1528		     END;

;41500  1529		AROUND = (1^.PSCTDESC[PSC$B_ALIGN]) - 1;		! COMPUTE THE ADJUSTMENT FOR ALIGNING

;41600  1530		CURRENT_BASE = (.CURRENT_BASE + .AROUND) AND NOT .AROUND;! AND DO IT THEN

;41700  1531		PSCTDESC[PSC$L_BASE] = .CURRENT_BASE;			! SET P-SECT BASE

;41800  1532		SYMBOL = .PSCTDESC[PSC$L_SYMLST];			! GO DOWN LIST OF

;41900  1533		WHILE .SYMBOL NEQ 0 DO					! SYMBOLS OWNED BY

;42000  1534		BEGIN							! P-SECTION AND ADD ITS

;42100  1535			IF (.SYMBOL[SYM$W_FLAGS] AND SYM$M_REL) NEQ 0	! BASE TO ANY THAT

;42200  1536			THEN BEGIN

;42300  1537				SYMBOL[SYM$L_VALUE]=.SYMBOL[SYM$L_VALUE]+	! ARE RELOCATABLE

;42400  1538						  .CURRENT_BASE;

;42500  1539				IF .LNK$GL_CTLMSK<LNK$S_LONG,1,0>		 ! IF A LONG FORM MAP IS REQUIRED

;42550  1540				AND .(LNK$GL_CURCLU[CLU$W_FLAGS])<CLU$V_BASED>	! AND CLUSTER IS NOW BASED

;42600  1541				AND (.SYMBOL[SYM$W_FLAGS] AND SYM$M_SUPRES) EQL 0 ! AND THE SYMBOL IS NOT  SUPPRESSED



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-20

; Digital Equipment Corporation

;

;42700  1542				THEN CRF$INSRTREF(LNK$AL_VALCTLTB,		 ! THEN INSERT THIS SYMBOL

;42800  1543					SYMBOL[SYM$L_VALUE],SYMBOL[SYM$B_NAMLNG],! AS A REFERENCE TO ITS

;42900  1544						.SYMBOL[SYM$W_FLAGS],0);	! OWN VALUE RELOCATED

;43000  1545			     END;

;43100  1546			SYMBOL = .SYMBOL[SYM$L_PSCLST];				! MOVE ON TO NEXT

;43200  1547		END;

;43400  1548		PSCTDESC[PSC$L_ISECT] = .ISCTDESC;				! SAVE ISD ADDRESS

;43600  1549		CURRENT_BASE = .CURRENT_BASE + .PSCTDESC[PSC$L_LENGTH];		! THEN UPDATE FOR THE NEXT

;43700  1550	END;

;43800  1551	ISECT_BLKS = (.CURRENT_BASE - .ISECT_BASE+511)/512;		! COMPUTE NUMBER OF BLOCKS

;43850  1552	IF .ISCTDESC[ISD$L_NXTISD] EQL -1				! IF A DESCRIPTOR WAS ALLOCATED

;43900  1553	THEN BUILDISD(.ISECT_BLKS);					! THEN CREATE ISD

;44000  1554	LNK$GL_CURCLU[CLU$L_PAGES] = .LNK$GL_CURCLU[CLU$L_PAGES] + .ISECT_BLKS;		! ADD I-SECTION SIZE TO CLUSTER SIZE

;44100  1555	ISECT_BASE = .CURRENT_BASE;					! SET BASE OF NEXT I-SECT

;44200  1556	RETURN;								! AND DONE

;44300  1557	END;











					 08FC 00368 NORMAL_ISECTBLD:

							    .WORD   Save R2,R3,R4,R5,R6,R7,R11				      ; 1502

		         5B	0000'  CF  9E 0036A 	    MOVAB   ISCTDESC, R11					      ;

		         5E	       04  C2 0036F 	    SUBL2   #4, SP						      ;

		         50	  F8   AB  9A 00372 	    MOVZBL  ISECT, R0						      ; 1517

		         50	       0D  C4 00376 	    MULL2   #13, R0						      ;

		         50	  FC   AB  C0 00379 	    ADDL2   ISECTGENTBL, R0					      ;

		         57	  F3   A0  3C 0037D 	    MOVZWL  -13(R0), R7						      ; 1503

		         50	  F8   AB  9A 00381 	    MOVZBL  ISECT, R0						      ; 1518

		         50	       0D  C4 00385 	    MULL2   #13, R0						      ;

		         50	  FC   AB  C0 00388 	    ADDL2   ISECTGENTBL, R0					      ;

		         56	  F5   A0  3C 0038C 	    MOVZWL  -11(R0), R6						      ; 1503

		         54	  F0   AB  D0 00390 	    MOVL    ISECT_BASE, CURRENT_BASE				      ; 1520

				4040   8F  BB 00394 1$:     PUSHR   #^M<R6,SP>						      ; 1521

				       57  DD 00398 	    PUSHL   R7							      ;

		  0000G  CF	       03  FB 0039A 	    CALLS   #3, LNK$FNDPSCMSK					      ;

		         76	       50  E9 0039F 	    BLBC    R0, 6$						      ;

				  00   BB  D5 003A2 	    TSTL    @ISCTDESC						      ; 1523

				       10  12 003A5 	    BNEQ    2$							      ;

				       6B  DD 003A7 	    PUSHL   ISCTDESC						      ; 1525

				       30  DD 003A9 	    PUSHL   #48							      ;

		  0000G  CF	       02  FB 003AB 	    CALLS   #2, LNK$ALLOBLK					      ;

		         7B	       9B  D0 003B0 	    MOVL    @ISCTDESC, ISCTDESC					      ; 1526

		    00   BB	       01  CE 003B3 	    MNEGL   #1, @ISCTDESC					      ; 1527

		         53	       6E  D0 003B7 2$:     MOVL    PSCTDESC, R3					      ; 1529

	   50	         01	  18   A3  78 003BA 	    ASHL    24(R3), #1, R0					      ;

	   55	         50	       01  C3 003BF 	    SUBL3   #1, R0, AROUND					      ;

	   50	         54	       55  C1 003C3 	    ADDL3   AROUND, CURRENT_BASE, R0				      ; 1530

	   54	         50	       55  CB 003C7 	    BICL3   AROUND, R0, CURRENT_BASE				      ;

		    0C   A3	       54  D0 003CB 	    MOVL    CURRENT_BASE, 12(R3)				      ; 1531

		         52	  08   A3  D0 003CF 	    MOVL    8(R3), SYMBOL					      ; 1532

				       52  D5 003D3 3$:     TSTL    SYMBOL						      ; 1533

				       36  13 003D5 	    BEQL    5$							      ;

	   2B	    1E   A2	       03  E1 003D7 	    BBC     #3, 30(SYMBOL), 4$					      ; 1535



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-21

; Digital Equipment Corporation

;

		         62	       54  C0 003DC 	    ADDL2   CURRENT_BASE, (SYMBOL)				      ; 1537

	   22	  0000G  CF	       00  E1 003DF 	    BBC     #LNK$S_LONG, LNK$GL_CTLMSK, 4$			      ; 1539

		         50	0000G  CF  D0 003E5 	    MOVL    LNK$GL_CURCLU, R0					      ; 1540

		         19	  24   A0  E9 003EA 	    BLBC    36(R0), 4$						      ;

	   14	    1E   A2	       0D  E0 003EE 	    BBS     #13, 30(SYMBOL), 4$					      ; 1541

				       7E  D4 003F3 	    CLRL    -(SP)						      ; 1542

		         7E	  1E   A2  3C 003F5 	    MOVZWL  30(SYMBOL), -(SP)					      ;

				  08   A2  9F 003F9 	    PUSHAB  8(SYMBOL)						      ; 1543

				       52  DD 003FC 	    PUSHL   SYMBOL						      ; 1542

				0000G  CF  9F 003FE 	    PUSHAB  LNK$AL_VALCTLTB					      ;

		  0000G  CF	       05  FB 00402 	    CALLS   #5, CRF$INSRTREF					      ;

		         52	  04   A2  D0 00407 4$:     MOVL    4(SYMBOL), SYMBOL					      ; 1546

				       C6  11 0040B 	    BRB     3$							      ; 1533

		    14   A3	       6B  D0 0040D 5$:     MOVL    ISCTDESC, 20(R3)					      ; 1548

		         54	  10   A3  C0 00411 	    ADDL2   16(R3), CURRENT_BASE				      ; 1549

				     FF7C  31 00415 	    BRW     1$							      ; 1521

	   50	         54	  F0   AB  C3 00418 6$:     SUBL3   ISECT_BASE, CURRENT_BASE, R0			      ; 1551

		         50	01FF   C0  9E 0041D 	    MOVAB   511(R0), R0						      ;

	   53	         50 00000200   8F  C7 00422 	    DIVL3   #512, R0, ISECT_BLKS				      ;

	      FFFFFFFF   8F	  00   BB  D1 0042A 	    CMPL    @ISCTDESC, #-1					      ; 1552

				       07  12 00432 	    BNEQ    7$							      ;

				       53  DD 00434 	    PUSHL   ISECT_BLKS						      ; 1553

		  0000V  CF	       01  FB 00436 	    CALLS   #1, BUILDISD					      ;

		         50	0000G  CF  D0 0043B 7$:     MOVL    LNK$GL_CURCLU, R0					      ; 1554

		    20   A0	       53  C0 00440 	    ADDL2   ISECT_BLKS, 32(R0)					      ;

		    F0   AB	       54  D0 00444 	    MOVL    CURRENT_BASE, ISECT_BASE				      ; 1555

					   04 00448 	    RET     							      ; 1502



; Routine Size:  225 bytes





;44400  1558	ROUTINE BUILDISD (NPAGES) : NOVALUE =

;44500  1559	BEGIN

;44600  1560	!

;44700  1561	!	ROUTINE TO ALLOCATE AN IMAGE SECTION DESCRIPTOR AND

;44800  1562	!	FILL IN ITS FIELDS, THEN LINK ON TO THE ISD LIST

;44900  1563	!	NPAGES = NUMBER OF PAGES TO ALLOCATE IN SECTION.

;45000  1564	!

;45100  1565	BIND

;45200  1566		HDRISD = ISCTDESC[ISD$AL_HDRISD] : BLOCK[,BYTE],	! SET POINTER TO PART FOR HEADER

;45300  1567		MATCHCTRL = .ISECTGENTBL[.ISECT-1,ISC$B_MATCTL],	! ISD MATCH CONTROL

;45400  1568		ISECTFLAGS = .ISECTGENTBL[.ISECT-1,ISC$B_FLAGS],	! I-SECT FLAGS

;45500  1569		ISCPFC = .ISECTGENTBL[.ISECT-1,ISC$B_PFC],		! PAGE FAULT CLUSTER PARAMETER

;45600  1570		ISDSIZE = .ISECTGENTBL[.ISECT-1,ISC$B_SIZE],		! ISD SIZE PARAMETER

;45700  1571		ISDTYPE = .ISECTGENTBL[.ISECT-1,ISC$B_CODE];		! ISECTION TYPE

;45800  1572	!

;45900  1573	IF ISDSIZE EQL 0 THEN RETURN;					! SKIP NULL ISECT DESCRIPTOR

;46000  1574	ISCTDESC[ISD$L_NXTISD] = 0;					! ENSURE END OF LIST

;46100  1575	ISCTDESC[ISD$Q_BUFADR] = 0;					! NO BUFFER FOR ITS BINARY YET

;46200  1576	ISCTDESC[ISD$Q_BUFADR] + 4 = 0;					! SO ZERO THE QUADWORD

;46300  1577	LNK$GW_NISECTS = .LNK$GW_NISECTS + 1;				! COUNT THIS ISECTION

;46400  1578	HDRISD[ISD$W_SIZE] = ISDSIZE;					! AND COPY INTO ISD

;46500  1579	HDRISD[ISD$W_PAGCNT] = .NPAGES;					! INSERT PAGE COUNT

;46600  1580	HDRISD[ISD$L_VPNPFC] = .ISECT_BASE ^-9;				! INSERT VIRTUAL PAGE ADDRESS

;46610  1581	IF (HDRISD[ISD$B_PFC] = MINU(.NPAGES,.LNK$GL_CURCLU[CLU$B_PFC])) EQL 0 ! IF NO PFC GIVEN FOR CLUSTER



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-22

; Digital Equipment Corporation

;

;46700  1582	THEN HDRISD[ISD$B_PFC] = MINU(ISCPFC,.NPAGES);			! PFC IS MINIMUM OF DEFAULT

;46800  1583									! VALUE AND NUMBER OF PAGES

;46900  1584	HDRISD[ISD$L_FLAGS] = ISECTFLAGS;				! INSERT FLAGS

;47000  1585	HDRISD[ISD$V_MATCHCTL] = MATCHCTRL;				! INSERT THE MATCH CONTROL FIELD

;47100  1586	HDRISD[ISD$B_TYPE] = ISDTYPE;					! AND TYPE

;47200  1587	HDRISD[ISD$L_VBN] = 0;						! SET NO RELATIVE DISK BLOCK YET ALLOCATED

;47300  1588	LNK$GL_CURCLU[CLU$L_LSTISD] = .ISCTDESC;			! WHICH WILL BE ADJUSTED LATER

;47400  1589	RETURN;								! SAVE END POINTER

;47500  1590	END;		! OF ISECT DESCRIPTOR BUILDER











					 08FC 00449 BUILDISD:

							    .WORD   Save R2,R3,R4,R5,R6,R7,R11				      ; 1558

		         5B	0000'  CF  9E 0044B 	    MOVAB   ISECT, R11						      ;

		         54	  08   AB  D0 00450 	    MOVL    ISCTDESC, R4					      ; 1566

	   51	         54	       0C  C1 00454 	    ADDL3   #12, R4, R1						      ;

		         50	  04   AB  D0 00458 	    MOVL    ISECTGENTBL, R0					      ; 1567

		         52	       6B  9A 0045C 	    MOVZBL  ISECT, R2						      ;

		         52	       0D  C4 0045F 	    MULL2   #13, R2						      ;

		         55	  FF A240  9A 00462 	    MOVZBL  -1(R2)[R0], R5					      ; 1559

		         52	       6B  9A 00467 	    MOVZBL  ISECT, R2						      ; 1568

		         52	       0D  C4 0046A 	    MULL2   #13, R2						      ;

		         56	  FA A240  9A 0046D 	    MOVZBL  -6(R2)[R0], R6					      ; 1559

		         52	       6B  9A 00472 	    MOVZBL  ISECT, R2						      ; 1569

		         52	       0D  C4 00475 	    MULL2   #13, R2						      ;

		         57	  F9 A240  9A 00478 	    MOVZBL  -7(R2)[R0], R7					      ; 1559

		         52	       6B  9A 0047D 	    MOVZBL  ISECT, R2						      ; 1570

		         52	       0D  C4 00480 	    MULL2   #13, R2						      ;

		         53	  F8 A240  9A 00483 	    MOVZBL  -8(R2)[R0], R3					      ; 1559

		         52	       6B  9A 00488 	    MOVZBL  ISECT, R2						      ; 1571

		         52	       0D  C4 0048B 	    MULL2   #13, R2						      ;

		         50	  F7 A240  9A 0048E 	    MOVZBL  -9(R2)[R0], R0					      ; 1559

				       53  D5 00493 	    TSTL    R3							      ; 1573

				       5E  13 00495 	    BEQL    4$							      ;

				       64  D4 00497 	    CLRL    (R4)						      ; 1574

		         52	  04   A4  9E 00499 	    MOVAB   4(R4), R2						      ; 1575

				       62  7C 0049D 	    CLRQ    (R2)						      ;

				0000'  CF  B6 0049F 	    INCW    LNK$GW_NISECTS					      ; 1577

		         61	       53  B0 004A3 	    MOVW    R3, (R1)						      ; 1578

		    02   A1	  04   AC  B0 004A6 	    MOVW    NPAGES, 2(R1)					      ; 1579

      04   A1	    F8   AB	  F7   8F  78 004AB 	    ASHL    #-9, ISECT_BASE, 4(R1)				      ; 1580

		         53	0000G  CF  D0 004B2 	    MOVL    LNK$GL_CURCLU, R3					      ; 1581

		         52	  04   AC  D0 004B7 	    MOVL    NPAGES, R2						      ;

      26   A3	         08	       00  ED 004BB 	    CMPZV   #0, #8, 38(R3), R2					      ;

				       52     004C0									      ;

				       04  1E 004C1 	    BGEQU   1$							      ;

		         52	  26   A3  9A 004C3 	    MOVZBL  38(R3), R2						      ;

		    07   A1	       52  90 004C7 1$:     MOVB    R2, 7(R1)						      ;

				       52  D5 004CB 	    TSTL    R2							      ;

				       11  12 004CD 	    BNEQ    3$							      ;

		         52	       57  D0 004CF 	    MOVL    R7, R2						      ; 1582

		    04   AC	       52  D1 004D2 	    CMPL    R2, NPAGES						      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 05:03:08	DBB3:[LINKER.SRC]LNKVMALLO.B32;11				Page 2-23

; Digital Equipment Corporation

;

				       04  1B 004D6 	    BLEQU   2$							      ;

		         52	  04   AC  D0 004D8 	    MOVL    NPAGES, R2						      ;

		    07   A1	       52  90 004DC 2$:     MOVB    R2, 7(R1)						      ;

		    08   A1	       56  D0 004E0 3$:     MOVL    R6, 8(R1)						      ; 1584

	   03	         04	       55  F0 004E4 	    INSV    R5, #4, #3, 8(R1)					      ; 1585

				  08   A1     004E8									      ;

		    0B   A1	       50  90 004EA 	    MOVB    R0, 11(R1)						      ; 1586

				  0C   A1  D4 004EE 	    CLRL    12(R1)						      ; 1587

		    18   A3	       54  D0 004F1 	    MOVL    R4, 24(R3)						      ; 1588

					   04 004F5 4$:     RET     							      ; 1558



; Routine Size:  173 bytes





;47600  1591	END ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $GLOBAL$       	     8    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $OWN$          	   332    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $PLIT$         	   184  NOWRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	  1270  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        28         0       226











; Size:		1270 code + 524 data bytes

; Run Time:	01:48.8

; Elapsed Time:	01:53.0

; Memory Used:	454 pages

; Compilation Complete

