Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/nml/nmutbl.lst
There are no other files named nmutbl.lst in the archive.
								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   1
								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (1)

;	  0001	! NET:<GROSSMAN>NMUTBL.BLI.2 16-Feb-82 16:11:28, Edit by GROSSMAN
;	  0002	!
;	  0003	! Fix a dot bug in TABLE_CLEAR. It caused the table block to be released twice
;	  0004	! which is a no no.
;	  0005	!
;	  0006	! NET:<PECKHAM.DEVELOPMENT>NMUTBL.BLI.2 13-Feb-82 22:39:41, Edit by PECKHAM
;	  0007	!
;	  0008	! Ident 02.
;	  0009	! Fix argument ordering on NMU$MEMORY_RELEASE in NMU$TABLE_CLEAR.
;	  0010	!
;	  0011	! NET:<DECNET20-V3P1.NMU>NMUTBL.BLI.2 23-Jun-81 09:00:21, Edit by JENNESS
;	  0012	!
;	  0013	!    Readability improvements.  Correct copyright date.  Add
;	  0014	!    NMU$TABLE_MAX routine.
								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   2
								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (2)

;	  0015	
;	  0016	module NMUTBL (                         ! Table data base manager
;	  0017			ident = 'X00.02'
;	  0018			) =
;	  0019	begin
;	  0020	
;	  0021	!
;	  0022	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0023	!                    DIGITAL EQUIPMENT CORPORATION
;	  0024	!                        Maynard, Massachusetts
;	  0025	!
;	  0026	!     This software is furnished under a license and may  be  used
;	  0027	!     and copied only in accordance with the terms of such license
;	  0028	!     and with the inclusion of the above copyright notice.   This
;	  0029	!     software  or any other copies thereof may not be provided or
;	  0030	!     otherwise made available to any other person.  No  title  to
;	  0031	!     and ownership of the software is hereby transferred.
;	  0032	!
;	  0033	!     The information  in  this  software  is  subject  to  change
;	  0034	!     without  notice  and should not be construed as a commitment
;	  0035	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0036	!
;	  0037	!     DIGITAL assumes no responsibility for the use or reliability
;	  0038	!     of  its  software  on  equipment  which  is  not supplied by
;	  0039	!     DIGITAL.
;	  0040	!
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   3
X00.02								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (3)

;	  0041	
;	  0042	!++
;	  0043	!
;	  0044	! Facility: LSG DECnet Management
;	  0045	!
;	  0046	! Abstract: This set of routines manages a table data base.  This data base
;	  0047	!           is a linked list of tables.  To the outside world it looks like
;	  0048	!           a table manager that has a very large (infinite until memory
;	  0049	!           runs out) vector.
;	  0050	!
;	  0051	!           Insertion - A free cell in any existing table is assigned
;	  0052	!                       to the specified value.  The index (absolute
;	  0053	!                       from start of the data base) is returned.
;	  0054	!
;	  0055	!           Fetch -     A index into the data base is used to search
;	  0056	!                       for a entry in one of the linked tables.
;	  0057	!
;	  0058	!           Delete -    A index into the data base is used to search
;	  0059	!                       for a entry that is to be made available for
;	  0060	!                       subsequent insertions.
;	  0061	!
;	  0062	!           Change -    A index into the data base is used to search
;	  0063	!                       for a entry whose value is changed.
;	  0064	!
;	  0065	!           Clear -     The storage used by a table data base is released
;	  0066	!                       to the memory manager.
;	  0067	!
;	  0068	!           Max -       Return the maximum index currently available
;	  0069	!                       in the table data base (not necessarily used).
;	  0070	!
;	  0071	! Environment: TOPS20, TOPS10 or MCB RSX task
;	  0072	!
;	  0073	! Author: Steven M. Jenness	Creation date: 30-Mar-81
;	  0074	!
;	  0075	! Modified by:
;	  0076	!
;	  0077	!--
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   4
X00.02								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (4)

;	  0078	
;	  0079	!
;	  0080	! Include files
;	  0081	!
;	  0082	
;	  0083	library 'NMULIB';                       ! Get all required definitions
;	  0084	
;	  0085	!
;	  0086	! Global routines
;	  0087	!
;	  0088	
;	  0089	forward routine
;	  0090	    NMU$TABLE_ROUTINES;                   ! Declare global entries
;	  0091	
;	  0092	!
;	  0093	! Equated symbols
;	  0094	!
;	  0095	
;	  0096	literal
;	  0097	       MAX_INDEX_PER_BLOCK = 16;
;	  0098	
;	  0099	!
;	  0100	! Structure definitions
;	  0101	!
;	  0102	
;	  0103	$field
;	  0104	      TABLE_BLOCK_FIELDS =
;	  0105	      set
;	  0106	      TBL_FIRST = [$integer],           ! First index in this block
;	  0107	      TBL_LAST = [$integer],            ! Last index in this block
;	  0108	      TBL_FLAGS = [$bits (MAX_INDEX_PER_BLOCK)], ! Entry allocated flags
;	  0109	      TBL_NEXT = [$address],            ! Address of next table block
;	  0110	      TBL_DATA = [$sub_block (0)]       ! Beginning of data array
;	  0111	      tes;
;	  0112	
;	  0113	literal
;	  0114	       TABLE_FIELDS_SIZE = $field_set_size,
;	  0115	       TABLE_BLOCK_ALLOCATION =
;	  0116	             $field_set_units + (MAX_INDEX_PER_BLOCK * %upval);
;	  0117	
;	  0118	macro
;	  0119	     TABLE_BLOCK = block [TABLE_FIELDS_SIZE] field (TABLE_BLOCK_FIELDS) %;
;	  0120	
;	  0121	macro
;	  0122	     TABLE_FLAGS = bitvector [16] %;
;	  0123	
;	  0124	!
;	  0125	! External references
;	  0126	!
;	  0127	
;	  0128	external routine
;	  0129	         NMU$MEMORY_MANAGER;
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   5
X00.02								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (4)

;	  0130	
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   6
X00.02								 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (5)

;	  0131	
;	  0132	%global_routine ('NMU$TABLE_CLEAR', TABLE_BASE) : novalue =
;	  0133	
;	  0134	!++
;	  0135	! Functional description:
;	  0136	!
;	  0137	!        This routine clears a table data base.  It releases all
;	  0138	!        table blocks to the memory manager.
;	  0139	!
;	  0140	! Formal parameters:
;	  0141	!
;	  0142	!        .TABLE_BASE  Address of table base cell
;	  0143	!
;	  0144	! Implicit inputs: none
;	  0145	! Implicit outputs:
;	  0146	!
;	  0147	!        ..TABLE_BASE is set to zero
;	  0148	!
;	  0149	! Routine value: none
;	  0150	! Side effects: none
;	  0151	!
;	  0152	!--
;	  0153	
;	  0154	    begin
;	  0155	    local
;	  0156	         TABLE : ref TABLE_BLOCK,
;	  0157	         OLD_TABLE;
;	  0158	
;	  0159	    TABLE = ..TABLE_BASE;
;	  0160	    .TABLE_BASE = 0;
;	  0161	
;	  0162	    while (OLD_TABLE = .TABLE) neq 0
;	  0163	    do
;	  0164	      begin
;	  0165	      TABLE = .TABLE [TBL_NEXT];
;	  0166	      NMU$MEMORY_RELEASE (.OLD_TABLE, TABLE_BLOCK_ALLOCATION);
;	  0167	      end;
;	  0168	
;	  0169	    end;					! End of NMU$TABLE_CLEAR


						.TITLE	NMUTBL
						.IDENT	/X00.02/

						.GLOBL	UM.RESET, UM.INITIALIZE, UM.GET
						.GLOBL	UM.RELEASE


						.SBTTL	UT.CLEAR NMU$TABLE_CLEAR as UT_CLEAR
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			UT.CLEAR::
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   7
X00.02		NMU$TABLE_CLEAR as UT_CLEAR			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (5)

						JSR	R1,$SAVE2			;					0132
000004	017601  000010 				MOV	@10(SP),R1			; TABLE.BASE,TABLE			0159
000010	005076  000010 				CLR	@10(SP)				; TABLE.BASE				0160
000014	010102 				1$:	MOV	R1,R2				; TABLE,OLD.TABLE			0162
000016	001411 					BEQ	2$
000020	016101  000006 				MOV	6(R1),R1			; *(TABLE),TABLE			0165
000024	010246 					MOV	R2,-(SP)			; OLD.TABLE,*				0166
000026	012746  000050 				MOV	#50,-(SP)
000032	004767  000000G				JSR	PC,UM.RELEASE
000036	022626 					CMP	(SP)+,(SP)+			;					0164
000040	000765 					BR	1$				;					0162
000042	000207 				2$:	RTS	PC				;					0132
; Routine Size:  18 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  6 words
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   8
X00.02		NMU$TABLE_CLEAR as UT_CLEAR			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (6)

;	  0170	
;	  0171	%global_routine ('NMU$TABLE_INSERT', TABLE_BASE, VALUE) =
;	  0172	
;	  0173	!++
;	  0174	! Functional description:
;	  0175	!
;	  0176	!        This routine inserts a value into a table data base.  It searches
;	  0177	!        all the linked tables for a free entry to use.  If no free entry
;	  0178	!        exists, it creates a new table block and links it at the end of the
;	  0179	!        table list.  The index returned is used for any future reference
;	  0180	!        to the table data base entry.
;	  0181	!
;	  0182	! Formal parameters:
;	  0183	!
;	  0184	!        .TABLE_BASE    Address of cell containing base address of table list
;	  0185	!        .VALUE         Fullword value to be inserted into list
;	  0186	!
;	  0187	! Routine value:
;	  0188	!
;	  0189	!        Index value into table data base
;	  0190	!
;	  0191	! Side effects: none
;	  0192	!
;	  0193	!--
;	  0194	
;	  0195	    begin
;	  0196	    local
;	  0197	         TABLE : ref TABLE_BLOCK,
;	  0198	         PREV_TABLE : ref TABLE_BLOCK,
;	  0199	         INDEX, LOCAL_INDEX;
;	  0200	!
;	  0201	! Point to the first table block in the table list.
;	  0202	! Indicate that there is no previously seen table block.
;	  0203	!
;	  0204	    TABLE = ..TABLE_BASE;
;	  0205	    PREV_TABLE = 0;
;	  0206	!
;	  0207	! Search list of table blocks for one that hasn't been
;	  0208	! completely filled.  If an unallocated entry is found,
;	  0209	! put the specified value into and flag it taken.
;	  0210	!
;	  0211	    until .TABLE eql 0
;	  0212	    do
;	  0213	      if .TABLE [TBL_FLAGS] eql 0
;	  0214	      then
;	  0215	          begin
;	  0216	          PREV_TABLE = .TABLE;
;	  0217	          TABLE = .TABLE [TBL_NEXT];
;	  0218	          end
;	  0219	      else
;	  0220	          begin
;	  0221	          bind
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page   9
X00.02		NMU$TABLE_INSERT as UT_INSERT			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (6)

;	  0222	              FLAGS = TABLE [TBL_FLAGS] : TABLE_FLAGS,
;	  0223	              TABLE_DATA = TABLE [TBL_DATA] : vector [MAX_INDEX_PER_BLOCK];
;	  0224	
;	  0225	          incr I from 1 to MAX_INDEX_PER_BLOCK
;	  0226	          do
;	  0227	            if .FLAGS [.I - 1] eql 1
;	  0228	            then
;	  0229	                begin
;	  0230	                FLAGS [.I - 1] = 0;
;	  0231	                TABLE_DATA [.I - 1] = .VALUE;
;	  0232	                return (.TABLE [TBL_FIRST] + .I - 1);
;	  0233	                end;
;	  0234	          end;
;	  0235	
;	  0236	    TABLE = NMU$MEMORY_GET (TABLE_BLOCK_ALLOCATION);
;	  0237	
;	  0238	    if .PREV_TABLE eql 0
;	  0239	    then
;	  0240	        begin
;	  0241	        TABLE [TBL_FIRST] = 1;
;	  0242	        .TABLE_BASE = .TABLE;
;	  0243	        end
;	  0244	    else
;	  0245	        begin
;	  0246	        TABLE [TBL_FIRST] = .PREV_TABLE [TBL_FIRST] + MAX_INDEX_PER_BLOCK;
;	  0247	        PREV_TABLE [TBL_NEXT] = .TABLE;
;	  0248	        end;
;	  0249	
;	  0250	    TABLE [TBL_LAST] = .TABLE [TBL_FIRST] + MAX_INDEX_PER_BLOCK - 1;
;	  0251	    TABLE [TBL_FLAGS] = -1;
;	  0252	
;	  0253	    begin
;	  0254	    bind
;	  0255	        FLAGS = TABLE [TBL_FLAGS] : TABLE_FLAGS,
;	  0256	        TABLE_DATA = TABLE [TBL_DATA] : vector [MAX_INDEX_PER_BLOCK];
;	  0257	
;	  0258	    FLAGS [0] = 0;
;	  0259	    TABLE_DATA [0] = .VALUE;
;	  0260	
;	  0261	    end;
;	  0262	
;	  0263	    .TABLE [TBL_FIRST]
;	  0264	
;	  0265	    end;					! End of NMU$TABLE_INSERT


						.SBTTL	UT.INSERT NMU$TABLE_INSERT as UT_INSERT
000000	004167  000000G			UT.INSERT::
						JSR	R1,$SAVE5			;					0171
000004	005746 					TST	-(SP)
000006	017646  000022 				MOV	@22(SP),-(SP)			; TABLE.BASE,TABLE			0204
000012	005005 					CLR	R5				; PREV.TABLE				0205
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  10
X00.02		NMU$TABLE_INSERT as UT_INSERT			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (6)

000014	005716 				1$:	TST	(SP)				; TABLE					0211
000016	001501 				2$:	BEQ	6$
000020	012700  000004 				MOV	#4,R0				;					0213
000024	061600 					ADD	(SP),R0				; TABLE,*
000026	010066  000002 				MOV	R0,2(SP)
000032	005710 					TST	(R0)
000034	001005 					BNE	3$
000036	011605 					MOV	(SP),R5				; TABLE,PREV.TABLE			0216
000040	010500 					MOV	R5,R0				; TABLE,*				0217
000042	016016  000006 				MOV	6(R0),(SP)			; *(TABLE),TABLE
000046	000763 					BR	2$				;					0213
000050	012701  000001 			3$:	MOV	#1,R1				; *,I					0225
000054	010102 				4$:	MOV	R1,R2				; I,*					0227
000056	005302 					DEC	R2
000060	010203 					MOV	R2,R3
000062	072327  177775 				ASH	#-3,R3
000066	066603  000002 				ADD	2(SP),R3
000072	010346 					MOV	R3,-(SP)
000074	010246 					MOV	R2,-(SP)
000076	042716  177770 				BIC	#177770,(SP)
000102	012746  000001 				MOV	#1,-(SP)
000106	005046 					CLR	-(SP)
000110	004767  000000G				JSR	PC,BL$GT2
000114	062706  000010 				ADD	#10,SP
000120	005300 					DEC	R0
000122	001032 					BNE	5$
000124	010346 					MOV	R3,-(SP)			;					0230
000126	010246 					MOV	R2,-(SP)
000130	042716  177770 				BIC	#177770,(SP)
000134	012746  000001 				MOV	#1,-(SP)
000140	005046 					CLR	-(SP)
000142	004767  000000G				JSR	PC,BL$PU2
000146	012700  000010 				MOV	#10,R0				;					0231
000152	066600  000010 				ADD	10(SP),R0			; TABLE,*
000156	010004 					MOV	R0,R4
000160	010200 					MOV	R2,R0
000162	006300 					ASL	R0
000164	060004 					ADD	R0,R4
000166	016614  000032 				MOV	32(SP),(R4)			; VALUE,*
000172	010100 					MOV	R1,R0				; I,*					0232
000174	067600  000010 				ADD	@10(SP),R0			; TABLE,*
000200	005300 					DEC	R0
000202	062706  000010 				ADD	#10,SP				;					0227
000206	000455 					BR	9$				;					0229
000210	005201 				5$:	INC	R1				; I					0225
000212	020127  000020 				CMP	R1,#20				; I,*
000216	003716 					BLE	4$
000220	000675 					BR	1$				;					0211
000222	012746  000050 			6$:	MOV	#50,-(SP)			;					0236
000226	004767  000000G				JSR	PC,UM.GET
000232	010066  000002 				MOV	R0,2(SP)			; *,TABLE
000236	005705 					TST	R5				; PREV.TABLE				0238
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  11
X00.02		NMU$TABLE_INSERT as UT_INSERT			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (6)

000240	001005 					BNE	7$
000242	012710  000001 				MOV	#1,(R0)				; *,TABLE				0241
000246	010076  000026 				MOV	R0,@26(SP)			; TABLE,TABLE.BASE			0242
000252	000410 					BR	8$				;					0238
000254	011576  000002 			7$:	MOV	(R5),@2(SP)			; PREV.TABLE,TABLE			0246
000260	062776  000020  000002 			ADD	#20,@2(SP)			; *,TABLE
000266	016665  000002  000006 			MOV	2(SP),6(R5)			; TABLE,*(PREV.TABLE)			0247
000274	016600  000002 			8$:	MOV	2(SP),R0			; TABLE,*				0250
000300	011060  000002 				MOV	(R0),2(R0)			; TABLE,*(TABLE)
000304	062760  000017  000002 			ADD	#17,2(R0)			; *,*(TABLE)
000312	012760  177777  000004 			MOV	#-1,4(R0)			; *,*(TABLE)				0251
000320	142760  000001  000004 			BICB	#1,4(R0)			; *,*(TABLE)				0258
000326	016660  000024  000010 			MOV	24(SP),10(R0)			; VALUE,*(TABLE)			0259
000334	005726 					TST	(SP)+				;					0195
000336	017600  000000 				MOV	@0(SP),R0			; TABLE,*				0171
000342	022626 				9$:	CMP	(SP)+,(SP)+
000344	000207 					RTS	PC
; Routine Size:  115 words,	Routine Base:  $CODE$ + 0044
; Maximum stack depth per invocation:  13 words
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  12
X00.02		NMU$TABLE_INSERT as UT_INSERT			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (7)

;	  0266	
;	  0267	%global_routine ('NMU$TABLE_FETCH', TABLE_BASE, INDEX, VALUE) =
;	  0268	
;	  0269	!++
;	  0270	! Functional description:
;	  0271	!
;	  0272	!        This routine gets a fullword value from the specified table data
;	  0273	!        base.  The index passed is used to search the data base for the
;	  0274	!        appropriate value.
;	  0275	!
;	  0276	! Formal parameters:
;	  0277	!
;	  0278	!        .TABLE_BASE    Address of cell containing base address of table
;	  0279	!        .INDEX         Index number into data base
;	  0280	!
;	  0281	! Implicit inputs: none
;	  0282	! Implicit outputs:
;	  0283	!
;	  0284	!        VALUE    Value found in data base
;	  0285	!
;	  0286	! Routine value:
;	  0287	!
;	  0288	!        $true    Index is valid, output register VALUE contains value
;	  0289	!        $false   Index is invalid
;	  0290	!
;	  0291	! Side effects: none
;	  0292	!
;	  0293	!--
;	  0294	
;	  0295	    begin
;	  0296	    local
;	  0297	         TABLE : ref TABLE_BLOCK;
;	  0298	
;	  0299	    TABLE = ..TABLE_BASE;
;	  0300	
;	  0301	    until .TABLE eql 0
;	  0302	    do
;	  0303	      if (.INDEX geq .TABLE [TBL_FIRST]) and (.INDEX leq .TABLE [TBL_LAST])
;	  0304	      then
;	  0305	          begin
;	  0306	          bind
;	  0307	              FLAGS = TABLE [TBL_FLAGS] : TABLE_FLAGS,
;	  0308	              TABLE_DATA = TABLE [TBL_DATA] : vector [MAX_INDEX_PER_BLOCK];
;	  0309	
;	  0310	          if .FLAGS [.INDEX - .TABLE [TBL_FIRST]] eql 0
;	  0311	          then
;	  0312	              begin
;	  0313	              .VALUE = .TABLE_DATA [.INDEX - .TABLE [TBL_FIRST]];
;	  0314	              return $true;
;	  0315	              end
;	  0316	          else
;	  0317	              return $false;
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  13
X00.02		NMU$TABLE_FETCH as UT_FETCH			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (7)

;	  0318	          end
;	  0319	      else
;	  0320	          TABLE = .TABLE [TBL_NEXT];
;	  0321	
;	  0322	    $false
;	  0323	    end;					! End of NMU$TABLE_FETCH


						.SBTTL	UT.FETCH NMU$TABLE_FETCH as UT_FETCH
000000	004167  000000G			UT.FETCH::
						JSR	R1,$SAVE4			;					0267
000004	017604  000020 				MOV	@20(SP),R4			; TABLE.BASE,TABLE			0299
000010	016603  000016 				MOV	16(SP),R3			; INDEX,*				0303
000014	005704 					TST	R4				; TABLE					0301
000016	001451 				1$:	BEQ	3$
000020	020314 					CMP	R3,(R4)				; *,TABLE				0303
000022	002444 					BLT	2$
000024	020364  000002 				CMP	R3,2(R4)			; *,*(TABLE)
000030	003041 					BGT	2$
000032	012701  000004 				MOV	#4,R1				;					0310
000036	060401 					ADD	R4,R1				; TABLE,*
000040	010302 					MOV	R3,R2
000042	161402 					SUB	(R4),R2				; TABLE,*
000044	010200 					MOV	R2,R0
000046	072027  177775 				ASH	#-3,R0
000052	060001 					ADD	R0,R1
000054	010146 					MOV	R1,-(SP)
000056	010246 					MOV	R2,-(SP)
000060	042716  177770 				BIC	#177770,(SP)
000064	012746  000001 				MOV	#1,-(SP)
000070	005046 					CLR	-(SP)
000072	004767  000000G				JSR	PC,BL$GT2
000076	062706  000010 				ADD	#10,SP
000102	005700 					TST	R0
000104	001016 					BNE	3$
000106	012701  000010 				MOV	#10,R1				;					0313
000112	060401 					ADD	R4,R1				; TABLE,*
000114	010200 					MOV	R2,R0
000116	006300 					ASL	R0
000120	060001 					ADD	R0,R1
000122	011176  000014 				MOV	(R1),@14(SP)			; *,VALUE
000126	012700  000001 				MOV	#1,R0				;					0310
000132	000207 					RTS	PC
000134	016404  000006 			2$:	MOV	6(R4),R4			; *(TABLE),TABLE			0320
000140	000726 					BR	1$				;					0301
000142	005000 				3$:	CLR	R0				;					0267
000144	000207 					RTS	PC
; Routine Size:  51 words,	Routine Base:  $CODE$ + 0412
; Maximum stack depth per invocation:  10 words
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  14
X00.02		NMU$TABLE_FETCH as UT_FETCH			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (8)

;	  0324	
;	  0325	%global_routine ('NMU$TABLE_DELETE', TABLE_BASE, INDEX) =
;	  0326	
;	  0327	!++
;	  0328	! Functional description:
;	  0329	!
;	  0330	!        This routine frees up a specified table data base entry.
;	  0331	!
;	  0332	! Formal parameters:
;	  0333	!
;	  0334	!        .TABLE_BASE    Address of cell containing base address of table
;	  0335	!        .INDEX         Index number into data base
;	  0336	!
;	  0337	! Routine value:
;	  0338	!
;	  0339	!        $true    Index was valid, entry deleted
;	  0340	!        $false   Index was invalid
;	  0341	!
;	  0342	! Side effects: none
;	  0343	!
;	  0344	!--
;	  0345	
;	  0346	    begin
;	  0347	    local
;	  0348	         TABLE : ref TABLE_BLOCK;
;	  0349	
;	  0350	    TABLE = ..TABLE_BASE;
;	  0351	
;	  0352	    until .TABLE eql 0
;	  0353	    do
;	  0354	      if (.INDEX geq .TABLE [TBL_FIRST]) and (.INDEX leq .TABLE [TBL_LAST])
;	  0355	      then
;	  0356	          begin
;	  0357	          bind
;	  0358	              FLAGS = TABLE [TBL_FLAGS] : TABLE_FLAGS;
;	  0359	
;	  0360	          FLAGS [.INDEX - .TABLE [TBL_FIRST]] = 1;
;	  0361	          return $true;
;	  0362	          end
;	  0363	      else
;	  0364	          TABLE = .TABLE [TBL_NEXT];
;	  0365	
;	  0366	    $false
;	  0367	    end;					! End of NMU$TABLE_DELETE


						.SBTTL	UT.DELETE NMU$TABLE_DELETE as UT_DELETE
000000	004167  000000G			UT.DELETE::
						JSR	R1,$SAVE4			;					0325
000004	017604  000016 				MOV	@16(SP),R4			; TABLE.BASE,TABLE			0350
000010	016603  000014 				MOV	14(SP),R3			; INDEX,*				0354
000014	005704 					TST	R4				; TABLE					0352
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  15
X00.02		NMU$TABLE_DELETE as UT_DELETE			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (8)

000016	001437 				1$:	BEQ	3$
000020	020314 					CMP	R3,(R4)				; *,TABLE				0354
000022	002432 					BLT	2$
000024	020364  000002 				CMP	R3,2(R4)			; *,*(TABLE)
000030	003027 					BGT	2$
000032	012702  000004 				MOV	#4,R2				;					0360
000036	060402 					ADD	R4,R2				; TABLE,*
000040	010301 					MOV	R3,R1
000042	161401 					SUB	(R4),R1				; TABLE,*
000044	010100 					MOV	R1,R0
000046	072027  177775 				ASH	#-3,R0
000052	060002 					ADD	R0,R2
000054	010246 					MOV	R2,-(SP)
000056	010146 					MOV	R1,-(SP)
000060	042716  177770 				BIC	#177770,(SP)
000064	012746  000001 				MOV	#1,-(SP)
000070	011646 					MOV	(SP),-(SP)
000072	004767  000000G				JSR	PC,BL$PU2
000076	062706  000010 				ADD	#10,SP				;					0354
000102	012700  000001 				MOV	#1,R0				;					0356
000106	000207 					RTS	PC
000110	016404  000006 			2$:	MOV	6(R4),R4			; *(TABLE),TABLE			0364
000114	000740 					BR	1$				;					0352
000116	005000 				3$:	CLR	R0				;					0325
000120	000207 					RTS	PC
; Routine Size:  41 words,	Routine Base:  $CODE$ + 0560
; Maximum stack depth per invocation:  10 words
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  16
X00.02		NMU$TABLE_DELETE as UT_DELETE			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (9)

;	  0368	
;	  0369	%global_routine ('NMU$TABLE_CHANGE', TABLE_BASE, INDEX, VALUE) =
;	  0370	
;	  0371	!++
;	  0372	! Functional description:
;	  0373	!
;	  0374	!        This routine changes a value associated with a particular
;	  0375	!        index in the table data base.  It assumes that a value
;	  0376	!        was previously inserted and assigned the specified index.
;	  0377	!
;	  0378	! Formal parameters:
;	  0379	!
;	  0380	!        .TABLE_BASE    Address of cell containing base address of table
;	  0381	!        .INDEX         Index number into data base
;	  0382	!        .VALUE         New value to insert
;	  0383	!
;	  0384	! Routine value:
;	  0385	!
;	  0386	!        $true    Index was valid, value changed
;	  0387	!        $false   Index was invalid, no change made
;	  0388	!
;	  0389	! Side effects: none
;	  0390	!
;	  0391	!--
;	  0392	
;	  0393	    begin
;	  0394	    local
;	  0395	         TABLE : ref TABLE_BLOCK;
;	  0396	
;	  0397	    TABLE = ..TABLE_BASE;
;	  0398	
;	  0399	    until .TABLE eql 0
;	  0400	    do
;	  0401	      if (.INDEX geq .TABLE [TBL_FIRST]) and (.INDEX leq .TABLE [TBL_LAST])
;	  0402	      then
;	  0403	          begin
;	  0404	          bind
;	  0405	              FLAGS = TABLE [TBL_FLAGS] : TABLE_FLAGS,
;	  0406	              TABLE_DATA = TABLE [TBL_DATA] : vector [MAX_INDEX_PER_BLOCK];
;	  0407	
;	  0408	          if .FLAGS [.INDEX - .TABLE [TBL_FIRST]] eql 0
;	  0409	          then
;	  0410	              begin
;	  0411	              TABLE_DATA [.INDEX - .TABLE [TBL_FIRST]] = .VALUE;
;	  0412	              return $true;
;	  0413	              end
;	  0414	          else
;	  0415	              return $false;
;	  0416	          end
;	  0417	      else
;	  0418	          TABLE = .TABLE [TBL_NEXT];
;	  0419	
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  17
X00.02		NMU$TABLE_CHANGE as UT_CHANGE			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (9)

;	  0420	    $false
;	  0421	    end;					! End of NMU$TABLE_CHANGE


						.SBTTL	UT.CHANGE NMU$TABLE_CHANGE as UT_CHANGE
000000	004167  000000G			UT.CHANGE::
						JSR	R1,$SAVE4			;					0369
000004	017604  000020 				MOV	@20(SP),R4			; TABLE.BASE,TABLE			0397
000010	016603  000016 				MOV	16(SP),R3			; INDEX,*				0401
000014	005704 					TST	R4				; TABLE					0399
000016	001451 				1$:	BEQ	3$
000020	020314 					CMP	R3,(R4)				; *,TABLE				0401
000022	002444 					BLT	2$
000024	020364  000002 				CMP	R3,2(R4)			; *,*(TABLE)
000030	003041 					BGT	2$
000032	012701  000004 				MOV	#4,R1				;					0408
000036	060401 					ADD	R4,R1				; TABLE,*
000040	010302 					MOV	R3,R2
000042	161402 					SUB	(R4),R2				; TABLE,*
000044	010200 					MOV	R2,R0
000046	072027  177775 				ASH	#-3,R0
000052	060001 					ADD	R0,R1
000054	010146 					MOV	R1,-(SP)
000056	010246 					MOV	R2,-(SP)
000060	042716  177770 				BIC	#177770,(SP)
000064	012746  000001 				MOV	#1,-(SP)
000070	005046 					CLR	-(SP)
000072	004767  000000G				JSR	PC,BL$GT2
000076	062706  000010 				ADD	#10,SP
000102	005700 					TST	R0
000104	001016 					BNE	3$
000106	012701  000010 				MOV	#10,R1				;					0411
000112	060401 					ADD	R4,R1				; TABLE,*
000114	010200 					MOV	R2,R0
000116	006300 					ASL	R0
000120	060001 					ADD	R0,R1
000122	016611  000014 				MOV	14(SP),(R1)			; VALUE,*
000126	012700  000001 				MOV	#1,R0				;					0408
000132	000207 					RTS	PC
000134	016404  000006 			2$:	MOV	6(R4),R4			; *(TABLE),TABLE			0418
000140	000726 					BR	1$				;					0399
000142	005000 				3$:	CLR	R0				;					0369
000144	000207 					RTS	PC
; Routine Size:  51 words,	Routine Base:  $CODE$ + 0702
; Maximum stack depth per invocation:  10 words
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  18
X00.02		NMU$TABLE_CHANGE as UT_CHANGE			 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (10)

;	  0422	
;	  0423	%global_routine ('NMU$TABLE_MAX', TABLE_BASE) =
;	  0424	
;	  0425	!++
;	  0426	! Functional description:
;	  0427	!
;	  0428	!        This routine returns the maximum table index currently
;	  0429	!        available.  It does not imply that the returned value
;	  0430	!        is the maximum allocated index.
;	  0431	!
;	  0432	! Formal parameters:
;	  0433	!
;	  0434	!        .TABLE_BASE    Address of cell containing base address of table
;	  0435	!
;	  0436	! Routine value:
;	  0437	!
;	  0438	!        <>0    Maximum table index
;	  0439	!         =0    No table yet
;	  0440	!
;	  0441	! Side effects: none
;	  0442	!
;	  0443	!--
;	  0444	
;	  0445	    begin
;	  0446	    local
;	  0447	         TABLE : ref TABLE_BLOCK,
;	  0448	         HIGHEST_TABLE : ref TABLE_BLOCK;
;	  0449	
;	  0450	!
;	  0451	! Start at the beginning table block in the table.
;	  0452	! If no table has been started return a zero max index.
;	  0453	!
;	  0454	    if (TABLE = ..TABLE_BASE) eql 0
;	  0455	    then return 0;
;	  0456	
;	  0457	!
;	  0458	! Search to the end of the table
;	  0459	!
;	  0460	    until .TABLE eql 0
;	  0461	    do
;	  0462	      begin
;	  0463	      HIGHEST_TABLE = .TABLE;                    
;	  0464	      TABLE = .TABLE [TBL_NEXT];
;	  0465	      end;
;	  0466	
;	  0467	!
;	  0468	! Return highest index from last found table block
;	  0469	!
;	  0470	    .HIGHEST_TABLE [TBL_LAST]
;	  0471	
;	  0472	    end;					! End of NMU$TABLE_MAX
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  19
X00.02		NMU$TABLE_MAX as UT_MAX				 3-Jan-1983 17:26:37	DNET61:<MCB.NML>NMUTBL.BLI.1 (10)


						.SBTTL	UT.MAX NMU$TABLE_MAX as UT_MAX
000000	010146 				UT.MAX::MOV	R1,-(SP)			;					0423
000002	017600  000004 				MOV	@4(SP),R0			; TABLE.BASE,TABLE			0454
000006	001003 					BNE	2$
000010	005000 					CLR	R0				;					0455
000012	000407 					BR	4$
000014	001404 				1$:	BEQ	3$				;					0460
000016	010001 				2$:	MOV	R0,R1				; TABLE,HIGHEST.TABLE			0463
000020	016000  000006 				MOV	6(R0),R0			; *(TABLE),TABLE			0464
000024	000773 					BR	1$				;					0460
000026	016100  000002 			3$:	MOV	2(R1),R0			; *(HIGHEST.TABLE),*			0423
000032	012601 				4$:	MOV	(SP)+,R1
000034	000207 					RTS	PC
; Routine Size:  15 words,	Routine Base:  $CODE$ + 1050
; Maximum stack depth per invocation:  2 words


;	  0473	
;	  0474	end						! End of NMUTBL
;	  0475	eludom



;					OTS external references
						.GLOBL	BL$GT2, $SAVE5, $SAVE4, $SAVE2
						.GLOBL	BL$PU2


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $CODE$				  291	    RO ,  I  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  DNET61:<MCB.NML>NMULIB.L16.1		      2716        41         1         0





; Size:		291 code + 0 data words
; Run Time:	00:06.0
; Elapsed Time:	00:09.4
; Memory Used:	38 pages
NMUTBL								24-May-1985 13:29:20	TOPS-20 Bliss-16 2A(530)	    Page  20
X00.02		NMU$TABLE_MAX as UT_MAX							

; Compilation Complete
FLAGS				 222#	 227	 230#	 255#	 258#	 307#	 310	 358#	 360#	 405#	 408
HIGHEST_TABLE			 448	 463#	 470
I				 225	 227	 230	 231	 232
INDEX				 199	 267	 303	 310	 313	 325	 354	 360	 369	 401	 408	 411
LOCAL_INDEX			 199
MAX_INDEX_PER_BLOCK		  97#	 108	 116	 223	 225	 246	 250	 256	 308	 406
NMU$MEMORY_GET			 236
NMU$MEMORY_MANAGER		 129*
NMU$MEMORY_RELEASE		 166
NMU$TABLE_ROUTINES		  90
NMUTBL				  16#
OLD_TABLE			 157	 162#	 166
PREV_TABLE			 198	 205#	 216#	 238	 246	 247#
TABLE_BASE			 132	 159	 160#	 171	 204	 242#	 267	 299	 325	 350	 369	 397
				 423	 454
TABLE_BLOCK			 119#	 156	 197	 198	 297	 348	 395	 447	 448
TABLE_BLOCK_ALLOCATION		 115#	 166	 236
TABLE_BLOCK_FIELDS		 104#	 119
TABLE_DATA			 223#	 231#	 256#	 259#	 308#	 313	 406#	 411#
TABLE_FIELDS_SIZE		 114#	 119
TABLE_FLAGS			 122#	 222	 255	 307	 358	 405
TABLE				 156	 159#	 162	 165#	 197	 204#	 211	 213	 216	 217#	 222	 223
				 232	 236#	 241#	 242	 246#	 247	 250#	 251#	 255	 256	 263	 297
				 299#	 301	 303	 307	 308	 310	 313	 320#	 348	 350#	 352	 354
				 358	 360	 364#	 395	 397#	 399	 401	 405	 406	 408	 411	 418#
				 447	 454#	 460	 463	 464#
TBL_DATA			 110#	 223	 256	 308	 406
TBL_FIRST			 106#	 232	 241	 246	 250	 263	 303	 310	 313	 354	 360	 401
				 408	 411
TBL_FLAGS			 108#	 213	 222	 251	 255	 307	 358	 405
TBL_LAST			 107#	 250	 303	 354	 401	 470
TBL_NEXT			 109#	 165	 217	 247	 320	 364	 418	 464
VALUE				 171	 231	 259	 267	 313#	 369	 411
$ADDRESS			 109
$BITS				 108
$FALSE				 317	 322	 366	 415	 420
$FIELD				 103
$FIELD_SET_SIZE			 114
$FIELD_SET_UNITS		 116
$INTEGER			 106	 107
$SUB_BLOCK			 110
$TRUE				 314	 361	 412
%GLOBAL_ROUTINE			 132#	 171#	 267#	 325#	 369#	 423#