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





      1						.TITLE	INIDM

      2						.IDENT	/00/

      3

      4					;

      5					;

      6					; COPYRIGHT (C) 1976

      7					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      8					;

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

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

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

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

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

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

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

     16					; IN DEC.

     17					;

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

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

     20					; EQUIPMENT CORPORATION.

     21					;

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

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

     24					;

     25					; VERSION 00

     26					;

     27					; C. MONIA 30-JUL-76

     28					;

     29					; INITIALIZE DYNAMIC MEMORY

     30					;

     31					; MACRO LIBRARY CALLS

     32					;

     33

     34						.MCALL	DIR$,GPRT$,GTSK$

     35

     36					;

     37					; LOCAL DATA

     38					;

     39					; TASK IMAGE MEMORY LIMITS

     40					;

     41

     42	000000	000000 	000000 		LIMIT:	.LIMIT			;

     43

     44					;

     45					; 'GET PARTITION PARAMTERS' DPB

     46					;

     47

     48	000004				PDPB:	GPRT$	,TBUF		;

     49

     50					;

     51					; 'GET TASK PARAMTERS' DPB

     52					;

     53

     54	000014				TDPB:	GTSK$	TBUF		;

     55

     56					;

     57					; PARAMETER BUFFER

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





     58					;

     59

     60	000020				TBUF:	.BLKW	16.		;

     61

     62					;+

     63					; **-$INIDM-INITIALIZE DYNAMICALLY ALLOCATED STORAGE

     64					;

     65					; THIS SUBROUTINE IS CALLED TO ESTABLISH THE INITIAL STATE

     66					; OF THE CORE POOL REFERENCED BY THE SUBROUTINES WHICH ALLO-

     67					; CATE AND DEALLOCATE CORE BLOCKS. THE POOL CONSISTS OF ALL

     68					; MEMORY EXTENDING FROM THE END OF THE TASK IMAGE TO THE LAST

     69					; PHYSICAL LOCATION OWNED BY THE TASK.

     70					;

     71					; INPUTS:

     72					;

     73					;	R0=ADDRESS OF FREE CORE POOL LISTHEAD

     74					;

     75					; OUTPUTS:

     76					;

     77					;	R0=FIRST ADDRESS IN TASK

     78					;	R1=ADDRESS FOLLOWING TASK IMAGE

     79					;	R2=SIZE OF CORE POOL

     80					;

     81					;	ANY PREVIOUS TASK MEMORY EXTENSION IS DE-ALLOCATED. THE

     82					;	REMAINING FREE CORE AREA IS ALLOCATED TO THE MEMORY POOL.

     83					;-

     84

     85	000060				$INIDM::			;

     86	000060	016702 	177716 			MOV	LIMIT+2,R2	; GET ADDRESS OF CORE POOL

     87	000064	062702 	000003 			ADD	#3,R2		; ROUND UP TO NEXT 4-BYTE BOUNDARY

     88	000070	042702 	000003 			BIC	#3,R2		; ...

     89	000074	010210 				MOV	R2,(R0)		; SET ADDRESS OF POOL

     90	000076	005001 				CLR	R1		; RESET TASK SIZE

     91	000100					CALL	$EXTSK		; ...

     92	000104					DIR$	#PDPB		; GET PARTITION PARAMETERS

     93	000112	016700 	000000G			MOV	$DSW,R0		; SAVE STARTING VIRTUAL ADDRESS OF PARTITION

     94	000116					DIR$	#TDPB		; GET TASK PARAMETERS

     95	000124	010246 				MOV	R2,-(SP)	; SAVE ADDRESS OF CORE POOL

     96	000126	005022 				CLR	(R2)+		; CLEAR FIRST WORD OF DYNAMIC STORE

     97	000130	016712 	177716 			MOV	TBUF+32,(R2)	; SET PHYSICAL SIZE OF TASK

     98	000134	160016 				SUB	R0,(SP)		; COMPUTE APPARENT TASK SIZE

     99	000136	010001 				MOV	R0,R1		; COPY BASE ADDRESS OF TASK

    100	000140	061201 				ADD	(R2),R1		; COMPUTE NEXT ADDRESS AFTER TASK

    101	000142	162612 				SUB	(SP)+,(R2)	; SET SIZE OF FREE POOL

    102	000144	011202 				MOV	(R2),R2		; GET SIZE OF POOL

    103	000146					RETURN			;

    104

    105		000001 				.END

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

SYMBOL TABLE



CR    = 000015   	G.TSFW= 000024   	G.TSSY= 000034   	PDPB    000004R  	TDPB    000014R

FF    = 000014   	G.TSGC= 000017   	G.TSTN= 000000   	RX$IAS= 000003   	VT    = 000013

G.PRBA= 000006   	G.TSMT= 000022   	G.TSTS= 000032   	RX$11D= 000000   	$DSW  = ****** GX

G.PRFW= 000004   	G.TSNL= 000020   	G.TSVA= 000026   	RX$11M= 000001   	$EXTSK= ****** GX

G.PRPB= 000000   	G.TSPC= 000016   	G.TSVL= 000030   	RX$11S= 000002   	$INIDM  000060RG

G.PRPN= 000002   	G.TSPN= 000004   	HT    = 000011   	R$$11M= 000000   	$$    = 000001

G.PRPS= 000002   	G.TSPR= 000014   	LF    = 000012   	SPA   = 000040   	$$$OST= 000004

G.TSBA= 000002   	G.TSRN= 000010   	LIMIT   000000R  	TBUF    000020R  	$$$T1 = 000000

G.TSDU= 000036



. ABS.	000000	   000

      	000150	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  1436 WORDS  ( 6 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:08

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

