ALBLK	MACRO M1110  22-AUG-78 01:38  PAGE 2





      1						.TITLE	ALBLK

      2						.IDENT	/03/                                                           ;**NEW**

      3					                                                                                ;**NEW**

      4					;                                                                               ;**NEW**

      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**

      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**

      7					;                                                                               ;**NEW**

      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**

      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**

     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**

     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**

     12					;                                                                               ;**NEW**

     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**

     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**

     15					; EQUIPMENT CORPORATION.                                                        ;**NEW**

     16					;                                                                               ;**NEW**

     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**

     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**

     19					;                                                                               ;**NEW**

     20					; VERSION 03                                                                   ;**NEW**

     21					;                                                                               ;**NEW**

     22					; D. N. CUTLER/C. MONIA 04-MAR-74                                               ;**NEW**

     23					;+                                                                              ;**-13

     24					; **-$ALBLK-ALLOCATE BLOCK

     25					;

     26					; THIS ROUTINE IS CALLED TO ALLOCATE A BLOCK OF STORAGE FROM THE FREE

     27					; STORAGE POOL. IF THE BLOCK CANNOT BE ALLOCATED, THEN A FATAL ERROR

     28					; MESSAGE IS ISSUED. ELSE THE BLOCK IS ALLOCATED AND ZEROED AND THE

     29					; ADDRESS IS RETURNED TO THE CALLER.

     30					;

     31					; INPUTS:

     32					;

     33					;	R1=SIZE OF BLOCK TO ALLOCATE IN BYTES.

     34					;

     35					; OUTPUTS:

     36					;

     37					;	R0=ADDRESS OF ALLOCATED BLOCK.

     38					;-

     39

     40	000000				$ALBLK::			;                                               ;**NEW**

     41	000000	010146 				MOV	R1,-(SP)	;SAVE SIZE OF BLOCK                             ;**-1

     42	000002					CALL	$GTCOR		; REQUEST A BLOCK OF STORAGE                    ;**NEW**

     43	000006	103006 				BCC	10$		;IF CC GOT IT                                   ;**-1

     44	000010	012702 	000000G			MOV	#$FRHD,R2	;GET ADDRESS OF FREE POOL HEADER

     45	000014	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY

     46	000016	   000G	   000G			.BYTE	E$R4,S$V2	;

     47	000020					CALL	$ERMSG		;ISSUE FATAL ERROR (NO RETURN)

     48	000024	012601 			10$:	MOV	(SP)+,R1	;RETRIEVE SIZE OF BLOCK

     49	000026	062701 	000003 			ADD	#3,R1		;ROUND TO NEXT 2 WORD BOUNDRY

     50	000032	042701 	000003 			BIC	#3,R1		;CLEAR EXECSS BITS

     51	000036	006201 				ASR	R1		;CONVERT TO WORDS

     52	000040	010002 				MOV	R0,R2		;COPY ADDRESS OF BLOCK

     53	000042	005022 			20$:	CLR	(R2)+		;CLEAR BLOCK

     54	000044					SOB	R1,20$		;REPEAT

     55	000050					RETURN			;

     56

     57		000001 				.END

ALBLK	MACRO M1110  22-AUG-78 01:38  PAGE 2-1

SYMBOL TABLE



CR    = 000015   	HT    = 000011   	SPA   = 000040   	$ALBLK  000000RG 	$GTCOR= ****** GX

E$R4  = ****** GX	LF    = 000012   	S$V2  = ****** GX	$ERMSG= ****** GX	$$    = 000001

FF    = 000014   	R$$11M= 000000   	VT    = 000013   	$FRHD = ****** GX



. ABS.	000000	   000

      	000052	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  580 WORDS  ( 3 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:06

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

