

; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE PATLST (

;	0002			%IF %VARIANT EQL 1

;     L 0003			%THEN

;	0004				ADDRESSING_MODE (EXTERNAL = LONG_RELATIVE, NONEXTERNAL = LONG_RELATIVE),

;	0005			%FI

;	0006			IDENT = 'X01.04') =

;	0007	BEGIN

;	0008	

;	0009	! Copyright (C) 1976,1977,1978

;	0010	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0011	!

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

;	0013	! single computer system and may be copied only with the inclusion

;	0014	! of the above copyright notice. This software, or any

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

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

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

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

;	0019	!

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

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

;	0022	! Equipment Corporation.

;	0023	!

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

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

;	0026	!

;	0027	! FACILITY:	PATCH

;	0028	!

;	0029	!++

;	0030	! FUNCTIONAL DESCRIPTION:

;	0031	!

;	0032	!	CREATES AND ADDS ITEMS TO A LINKED LIST

;	0033	!

;	0034	! Version:	X01.04

;	0035	!

;	0036	! History:

;	0037	!	Author:

;	0038	!		Carol Peters, 28 Oct 1976: Version 01

;	0039	!

;	0040	!	Modified by:

;	0041	!		Kathleen Morse, 19 Oct 1977: Version X01.00

;	0042	!

;	0043	! Revision history:

;	0044	!  NO	DATE		PROGRAMMER		PURPOSE

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

;	0046	!

;	0047	!  00	11-OCT-77	K.D. MORSE		ADAPT VERSION 8 FOR PATCH.

;	0048	!  01	05-JAN-78	K.D. MORSE		NO CHANGES FOR VERS 9.

;	0049	!						INSTEAD OWN STORAGE. (10)

;	0050	!  02	25-APR-78	K.D. MORSE		CONVERT TO NATIVE COMPILER.

;	0051	!  03	18-MAY-78	K.D. MORSE		NO CHANGES FOR VERS 11-13.

;	0052	!  04	13-JUN-78	K.D. MORSE		ADD FAO COUNTS TO SIGNALS.

;	0053	!

;	0054	!--



; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 2

; Digital Equipment Corporation

;

;	0055	FORWARD ROUTINE

;	0056		PAT$ADD_ARG,						! CREATES A LINKED LIST OR ADDS A NEW ENTRY TO IT

;	0057		PAT$FREE_ARG : NOVALUE;					! FREES A LINKED LIST

;	0058	

;	0059	LIBRARY 'SYS$LIBRARY:STARLET.L32';

;	0060	REQUIRE 'SRC$:PATPCT.REQ';

;	0076	REQUIRE 'SRC$:BSTRUC.REQ';

;	0127	REQUIRE 'SRC$:LISTEL.REQ';

;	0146	REQUIRE 'SRC$:VXSMAC.REQ';

;	0186	REQUIRE 'SRC$:SYSSER.REQ';

;      R0194	SWITCHES LIST (SOURCE);

;      R0195	

;      R0196	EXTERNAL ROUTINE

;      R0197		PAT$fao_out;		! formats a line and outputs to the terminal

;      R0198	

;      R0199	SWITCHES LIST (NOSOURCE);

;	0244	

;	0245	EXTERNAL ROUTINE

;	0246		PAT$FREEZ,						! GETS A PIECE OF FREE STORAGE

;	0247		PAT$FREERELEASE;					! RELEASES FREE STORAGE

;	0248	

;	0249	EXTERNAL

;	0250		PAT$GL_HEAD_LST,					! ADDRESS OF HEAD OF LINKED LIST

;	0251		PAT$GL_TAIL_LST;					! ADDRESS OF TAIL OF LINKED LIST



; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 3

; Digital Equipment Corporation

;

;	0252	GLOBAL ROUTINE PAT$ADD_ARG (EXPRESSION) =

;	0253	

;	0254	!++

;	0255	! FUNCTIONAL DESCRIPTION:

;	0256	!

;	0257	!	ADDS AN ELEMENT TO A LINKED LIST OR CREATES A LINKED

;	0258	!	LIST AND INSERTS THE FIRST ELEMENT.

;	0259	!	THE ADDRESS OF THE HEAD OF THE LIST IS AT PAT$GL_HEAD_LST

;	0260	!	AND THE ADDRESS OF THE TAIL AT PAT$GL_TAIL_LST.

;	0261	!	THIS ROUTINE ONLY PUTS A SINGLE VALUE IN THE LIST ELEMENT,

;	0262	!	AND IT PUTS IT AT THE LONGWORD AFTER THE POINTER.

;	0263	!

;	0264	! CALLING SEQUENCE:

;	0265	!

;	0266	!	PAT$ADD_ARG (EXPRESSION)

;	0267	!

;	0268	! INPUTS:

;	0269	!

;	0270	!	EXPRESSION	- VALUE TO PUT IN LIST ELEMENT

;	0271	!

;	0272	! IMPLICIT INPUTS:

;	0273	!

;	0274	!	THE HEAD AND TAIL OF THE LINKED LIST.

;	0275	!	THE LENGTH OF A LIST ELEMENT (LIST_ELEM_LEN).

;	0276	!

;	0277	! OUTPUTS:

;	0278	!

;	0279	!	THE ADDRESS OF THE NEW ELEMENT IF SPACE FOR THE LIST

;	0280	!	ELEMENT WAS FOUND. OTHERWISE A ZERO.

;	0281	!

;	0282	! IMPLICIT OUTPUTS:

;	0283	!

;	0284	!	NONE

;	0285	!

;	0286	! ROUTINE VALUE:

;	0287	!

;	0288	!	THE POINTER TO THE ELEMENT, OR A ZERO IF NO ELEMENT WAS ALLOCATED.

;	0289	!

;	0290	! SIDE EFFECTS:

;	0291	!

;	0292	!	THE LIST ELEMENT IS WRITTEN. THE TAIL OF THE LIST IS REWRITTEN.

;	0293	!	IF THE LIST WAS CREATED, BOTH THE HEAD AND THE TAIL ARE WRITTEN

;	0294	!	TO THEIR GLOBAL VARIABLE NAMES.

;	0295	!

;	0296	!--

;	0297	

;	0298	BEGIN

;	0299	

;	0300	LOCAL

;	0301		POINTER;

;	0302	

;	0303	POINTER = PAT$FREEZ (LIST_ELEM_LEN);

;	0304	IF (.PAT$GL_HEAD_LST EQL 0)

;	0305	THEN

;	0306		PAT$GL_HEAD_LST = .POINTER



; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 3-1

; Digital Equipment Corporation

;

;	0307	ELSE

;	0308		LIST_ELEM_FLINK (.PAT$GL_TAIL_LST) = .POINTER;

;	0309	LIST_ELEM_FLINK (.POINTER) = 0;

;	0310	PAT$GL_TAIL_LST = .POINTER;

;	0311	LIST_ELEM_EXP1 (.POINTER) = .EXPRESSION;

;	0312	RETURN .POINTER

;	0313	END;





							    .TITLE  PATLST

							    .IDENT  \X01.04\



							    .GLOBL  PAT$FAO_OUT, PAT$FREEZ, PAT$FREERELEASE, PAT$GL_HEAD_LST

							    .GLOBL  PAT$GL_TAIL_LST

							    .WEAK   ACCESS_CHECK



							    .PSECT  _PAT$CODE,NOWRT,2



					 0800 00000 	    .ENTRY  PAT$ADD_ARG, Save R11				      ; 0252

		         5B 00000000G  EF  9E 00002 	    MOVAB   PAT$GL_HEAD_LST, R11				      ;

				       04  DD 00009 	    PUSHL   #4							      ; 0303

	      00000000G  EF	       01  FB 0000B 	    CALLS   #1, PAT$FREEZ					      ;

				       6B  D5 00012 	    TSTL    PAT$GL_HEAD_LST					      ; 0304

				       05  12 00014 	    BNEQ    1$							      ;

		         6B	       50  D0 00016 	    MOVL    POINTER, PAT$GL_HEAD_LST				      ; 0306

				       07  11 00019 	    BRB     2$							      ; 0304

	      00000000G  FF	       50  D0 0001B 1$:     MOVL    POINTER, @PAT$GL_TAIL_LST				      ; 0308

				       60  D4 00022 2$:     CLRL    (POINTER)						      ; 0309

	      00000000G  EF	       50  D0 00024 	    MOVL    POINTER, PAT$GL_TAIL_LST				      ; 0310

		    04   A0	  04   AC  D0 0002B 	    MOVL    EXPRESSION, 4(POINTER)				      ; 0311

					   04 00030 	    RET     							      ; 0252



; Routine Size:  49 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 4

; Digital Equipment Corporation

;

;	0314	GLOBAL ROUTINE PAT$FREE_ARG : NOVALUE =

;	0315	

;	0316	!++

;	0317	! FUNCTIONAL DESCRIPTION:

;	0318	!

;	0319	!	FREES EACH ELEMENT OF A LINKED LIST, AND ZEROES THE

;	0320	!	POINTER TO THE LIST.

;	0321	!	THIS ROUTINE IS INTENDED TO BE CALLED AT THE END OF

;	0322	!	PROCESSING OF A COMPLETE COMMAND LINE.

;	0323	!

;	0324	! CALLING SEQUENCE:

;	0325	!

;	0326	!	PAT$FREE_ARG ()

;	0327	!

;	0328	! INPUTS:

;	0329	!

;	0330	!	NONE

;	0331	!

;	0332	! IMPLICIT INPUTS:

;	0333	!

;	0334	!	THE HEAD OF THE LINKED LIST.

;	0335	!	THE LENGTH OF A LIST ELEMENT (LIST_ELEM_LEN).

;	0336	!

;	0337	! OUTPUTS:

;	0338	!

;	0339	!	NONE

;	0340	!

;	0341	! IMPLICIT OUTPUTS:

;	0342	!

;	0343	!	NONE

;	0344	!

;	0345	! ROUTINE VALUE:

;	0346	!

;	0347	!	NOVALUE

;	0348	!

;	0349	! SIDE EFFECTS:

;	0350	!

;	0351	!	THE ELEMENTS OF THE LIST ARE RETURNED TO THE FREE STORAGE POOL.

;	0352	!

;	0353	!--

;	0354	

;	0355	BEGIN

;	0356	

;	0357	LOCAL

;	0358		POINTER1,

;	0359		POINTER2;

;	0360	

;	0361	IF (POINTER1 = .PAT$GL_HEAD_LST) EQL 0

;	0362	THEN RETURN

;	0363	ELSE DO

;	0364		BEGIN

;	0365		POINTER2 = .LIST_ELEM_FLINK (.POINTER1);

;	0366		PAT$FREERELEASE (.POINTER1, LIST_ELEM_LEN);

;	0367		END

;	0368	UNTIL (POINTER1 = .POINTER2) EQL 0;



; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 4-1

; Digital Equipment Corporation

;

;	0369	PAT$GL_HEAD_LST = 0;

;	0370	END;











					 080C 00031 	    .ENTRY  PAT$FREE_ARG, Save R2,R3,R11			      ; 0314

		         5B 00000000G  EF  9E 00033 	    MOVAB   PAT$GL_HEAD_LST, R11				      ;

		         52	       6B  D0 0003A 	    MOVL    PAT$GL_HEAD_LST, POINTER1				      ; 0361

				       15  13 0003D 	    BEQL    2$							      ;

		         53	       62  D0 0003F 1$:     MOVL    (POINTER1), POINTER2				      ; 0365

				       04  DD 00042 	    PUSHL   #4							      ; 0366

				       52  DD 00044 	    PUSHL   POINTER1						      ;

	      00000000G  EF	       02  FB 00046 	    CALLS   #2, PAT$FREERELEASE					      ;

		         52	       53  D0 0004D 	    MOVL    POINTER2, POINTER1					      ; 0368

				       ED  12 00050 	    BNEQ    1$							      ;

				       6B  D4 00052 	    CLRL    PAT$GL_HEAD_LST					      ; 0369

					   04 00054 2$:     RET     							      ; 0314



; Routine Size:  36 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 03:09:03	DBB3:[PATCH.SRC]PATLST.B32;2					Page 5

; Digital Equipment Corporation

;

;	0371	END

;	0372	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

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

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









;				LIBRARY STATISTICS

;

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

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]STARLET.L32;1		      2688         0         0       107











; Size:		85 code + 0 data bytes

; Run Time:	00:04.2

; Elapsed Time:	00:07.7

; Memory Used:	132 pages

; Compilation Complete

