Google
 

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

;	  0001	!NET:<BRANDT.DEVELOPMENT>NMLQUE.BLI.1 19-Jan-82 12:35:21, Edit by BRANDT
;	  0002	!
;	  0003	! Ident 09.
;	  0004	!   In routine LOCAL_REMOTE_CHECK change local variable
;	  0005	!   LOCAL_NODE_NUMBER to LOCAL_NODE_NUMB to prevent a conflict with
;	  0006	!   a macro named NML_LOCAL_NUMBER that is now a part of NMLLIB.
;	  0007	!   Of course we all know the correct solution would be to make the
;	  0008	!   macro name adhere to macro naming conventions, but this is easier
;	  0009	!   and we will never see this problem again, and ...
;	  0010	!
;	  0011	!NET:<BRANDT.DEVELOPMENT>NMLQUE.BLI.1 19-Jan-82 10:35:21, Edit by BRANDT
;	  0012	!
;	  0013	! Ident 08.
;	  0014	!   Add routine NML$REQUEST_TERMINATE to terminate an aborted request
;	  0015	!   having multiple response messages.
;	  0016	!
;	  0017	!NET:<BRANDT.DEVELOPMENT>NMLQUE.BLI.1 19-Nov-81 13:25:18, Edit by BRANDT
;	  0018	!
;	  0019	! Ident 07.
;	  0020	!   Fix NML$REQUEST_FINISH so it does not reference the request
;	  0021	!   block after calling the completion routine since the completion
;	  0022	!   routine releases the request block.
;	  0023	!
;	  0024	!NET:<DECNET20-V3P1.NML>NMLQUE.BLI.2 12-Aug-81 09:51:53, Edit by JENNESS
;	  0025	!
;	  0026	!    Ident 06.
;	  0027	!    Fix CANCEL routine (ABORT still doesn't work).  
;	  0028	!    Update coding conventions.
;	  0029	!    Increase request queue quotas for -36 bit versions.
;	  0030	!
;	  0031	!<DECNET20-V3P1.BASELEVEL-2.MCB>NMLQUE.BLI.2 10-Jun-81 11:03:40, Edit by SROBINSON
;	  0032	!
;	  0033	!    Make Local and Remote Queues Quota Scheduled
;	  0034	!
;	  0035	!<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLQUE.BLI.13  4-Jun-81 08:25:49, Edit by SROBINSON
;	  0036	!
;	  0037	!    Conditionalize routines not used in $MCB
;	  0038	!
;	  0039	!BL2SRC:<DECNET20-V3P1.BASELEVEL-2.MCB>NMLQUE.BLI.11 10-Feb-81 11:45:55, Edit by SROBINSON
;	  0040	!
;	  0041	!    Make Q_ENTRY_SIZE be Q_ENTRY_ALLOCATION
;	  0042	!
;	  0043	!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLQUE.BLI.10  9-Feb-81 09:01:55, Edit by GUNN
;	  0044	!
;	  0045	!    Make test on NICE return code treated as signed byte.
;	  0046	!
;	  0047	!NET:<DECNET20-V3P1.NMU>NMLQUE.BLI.6  3-Feb-81 10:02:33, Edit by JENNESS
;	  0048	!
;	  0049	!    Set state of request to RB$ACTIVE when giving to processor (REQUEST_NEXT).
;	  0050	!    Make byte pointer to response message (instead of using address as ptr)
;	  0051	!	and properly load the response code.
		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   2
								 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (2)

;	  0052	%title 'NMLQUE -- NICE Request Queue Management Routines'
;	  0053	module NMLQUE (				! NICE Request queueing module
;	  0054			ident = 'X01.09'
;	  0055			) =
;	  0056	begin
;	  0057	!
;	  0058	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0059	!                    DIGITAL EQUIPMENT CORPORATION
;	  0060	!                        Maynard, Massachusetts
;	  0061	!
;	  0062	!     This software is furnished under a license and may  be  used
;	  0063	!     and copied only in accordance with the terms of such license
;	  0064	!     and with the inclusion of the above copyright notice.   This
;	  0065	!     software  or any other copies thereof may not be provided or
;	  0066	!     otherwise made available to any other person.  No  title  to
;	  0067	!     and ownership of the software is hereby transferred.
;	  0068	!
;	  0069	!     The information  in  this  software  is  subject  to  change
;	  0070	!     without  notice  and should not be construed as a commitment
;	  0071	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0072	!
;	  0073	!     DIGITAL assumes no responsibility for the use or reliability
;	  0074	!     of  its  software  on  equipment  which  is  not supplied by
;	  0075	!     DIGITAL.
;	  0076	!
;	  0077	
;	  0078	!++
;	  0079	! Facility: LSG DECnet Network Management
;	  0080	!
;	  0081	! Abstract: This module provides the routines that control the
;	  0082	!           master request queue in the user level NML system.
;	  0083	!
;	  0084	! Environment: TOPS10/TOPS20 user mode, MCB RSX task level
;	  0085	!
;	  0086	! Author: Steven M. Jenness, Creation date: 23-Sep-80
;	  0087	!
;	  0088	!--
;	  0089	
;	  0090	!
;	  0091	! Include files
;	  0092	!
;	  0093	
;	  0094	library 'NMLLIB';				! All needed definitions
;	  0095	
;	  0096	!
;	  0097	! Global routines
;	  0098	!
;	  0099	
;	  0100	forward routine
;	  0101	    NML$REQUEST_MANAGER;			! Define global entry points
;	  0102	
;	  0103	!
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   3
X01.09								 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (2)

;	  0104	! Literal values
;	  0105	!
;	  0106	
;	  0107	literal
;	  0108	    MAX_REQUESTS_QUEUED =
;	L 0109	        %if $MCB
;	  0110	        %then 3
;	U 0111	        %else 100
;	  0112	        %fi ;
;	  0113	
;	  0114	!
;	  0115	! Local routines
;	  0116	!
;	  0117	
;	  0118	forward routine
;	U 0119	%if not $MCB %then
;	U 0120	    REQUEST_SEARCH,				! Abort/cancel scanning routine
;	U 0121	    SHOW_SCAN,					! Queue scan routine for SHOW
;	  0122	%fi
;	  0123	    LOCAL_REMOTE_CHECK : novalue;		! Determination of local/remote
;	  0124	
;	  0125	!
;	  0126	! Own storage
;	  0127	!
;	  0128	
;	  0129	own
;	  0130	    REQUEST_QUEUE : Q_HEADER,			! Queue of all requests
;	  0131	    LOCAL_QUEUE : QQ_HEADER,			! Local waiting requests
;	  0132	    REMOTE_QUEUE : QQ_HEADER,			! Remote waiting requests
;	  0133	    REQUEST_NUMBER;				! Last request number allocated
;	  0134	
;	  0135	!
;	  0136	! External references
;	  0137	!
;	  0138	
;	  0139	external routine
;	  0140	    NMU$QUEUE_MANAGER,			! Generalized queue management routines
;	  0141	    NMU$SCHED_MANAGER,			! Scheduler
;	  0142	    NMU$MEMORY_MANAGER,			! Memory management routines
;	  0143	    NMU$NETWORK_UTILITIES;		! Network interface
;	  0144	
;	  0145	!
;	  0146	! Definitions needed for debugging
;	  0147	!
;	  0148	
;	  0149	external
;	  0150	    %debug_data_base;
;	  0151	
;	  0152	    %module_name ('NMLQUE');
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   4
X01.09								 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (3)

;	  0153	
;	  0154	%global_routine ('NML$REQUEST_INITIALIZE') : novalue =
;	  0155	
;	  0156	!++
;	  0157	! Functional description:
;	  0158	!
;	  0159	!       This routine initializes the request manager.  All queues
;	  0160	!       of requests are cleared.
;	  0161	!
;	  0162	! Formal parameters: none
;	  0163	!
;	  0164	! Routine value: none
;	  0165	! Side effects: none
;	  0166	!
;	  0167	!--
;	  0168	
;	  0169	    begin
;	  0170	    NMU$QUEUE_RESET (REQUEST_QUEUE);
;	  0171	    NMU$QQUEUE_RESET (LOCAL_QUEUE, MAX_REQUESTS_QUEUED);
;	  0172	    NMU$QQUEUE_RESET (REMOTE_QUEUE, MAX_REQUESTS_QUEUED);
;	  0173	    end;					! End of NML$REQUEST_INITIALIZE


						.TITLE	NMLQUE NMLQUE -- NICE Request Queue Management Routine
						.IDENT	/X01.09/


000000						.PSECT	$OWN$,  D  
000000					REQUEST.QUEUE:
						.BLKW	3
000006					LOCAL.QUEUE:
						.BLKW	13
000034					REMOTE.QUEUE:
						.BLKW	13
000062					REQUEST.NUMBER:
						.BLKW	1


						.GLOBL	UQ.RESET, UQ.INSERT, UQ.REMOVE
						.GLOBL	UQ.EXTRACT, UQ.LENGTH, UQ.SCAN
						.GLOBL	UQ.SEXTRACT, US.CREATE, US.ABORT
						.GLOBL	US.FINI, US.COMPLETE, US.ERROR
						.GLOBL	US.INSERT, US.REMOVE, US.QRESET
						.GLOBL	US.QQINS, US.QQREM, US.QQSET, US.QQEXT
						.GLOBL	US.EVENT, US.WAIT, US.FLAG, US.SLEEP
						.GLOBL	US.CURRENT, US.DESCHEDULE, UM.RESET
						.GLOBL	UM.INITIALIZE, UM.GET, UM.RELEASE
						.GLOBL	UN.INIT, UN.LOCAL, UN.OPEN, UN.ACCEPT
						.GLOBL	UN.REJECT, UN.READ, UN.WRITE, UN.ABORT
						.GLOBL	UN.CLOSE, UN.STATUS, UN.VALIDATE
						.GLOBL	DEBUG
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   5
X01.09		NML$REQUEST_INITIALIZE as NL_INIT		 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (3)


						.SBTTL	NL.INIT NML$REQUEST_INITIALIZE as NL_INIT
000000						.PSECT	$CODE$,  RO 

000000	012746  000000'			NL.INIT::
						MOV	#REQUEST.QUEUE,-(SP)		;					0170
000004	004767  000000G				JSR	PC,UQ.RESET
000010	012716  000006'				MOV	#LOCAL.QUEUE,(SP)		;					0171
000014	012746  000003 				MOV	#3,-(SP)
000020	004767  000000G				JSR	PC,US.QQSET
000024	012716  000034'				MOV	#REMOTE.QUEUE,(SP)		;					0172
000030	012746  000003 				MOV	#3,-(SP)
000034	004767  000000G				JSR	PC,US.QQSET
000040	062706  000006 				ADD	#6,SP				;					0169
000044	000207 					RTS	PC				;					0154
; Routine Size:  19 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  4 words
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   6
X01.09		NML$REQUEST_INITIALIZE as NL_INIT		 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (4)

;	  0174	
;	  0175	%global_routine ('NML$REQUEST_ENTER', ENTRY : ref REQUEST_BLOCK) =
;	  0176	
;	  0177	!++
;	  0178	! Functional description:
;	  0179	!
;	  0180	!       This routine enters a request onto the master request queue.
;	  0181	!
;	  0182	! Formal parameters:
;	  0183	!
;	  0184	!       .ENTRY   Address of the request block to be entered
;	  0185	!
;	  0186	! Routine value:
;	  0187	!
;	  0188	!       The request number of entered request
;	  0189	!
;	  0190	! Side effects:
;	  0191	!
;	  0192	!       When the entry is made onto the request queue a processing
;	  0193	!       task may be scheduled.
;	  0194	!
;	  0195	!--
;	  0196	
;	  0197	    begin
;	  0198	
;	  0199	!
;	  0200	! Assign the next request number, clear the processing task id
;	  0201	! and set the request state to WAITING.
;	  0202	!
;	  0203	    ENTRY [RB_NUMBER] = (REQUEST_NUMBER = .REQUEST_NUMBER + 1);
;	  0204	    ENTRY [RB_TASK] = 0;
;	  0205	    ENTRY [RB_STATE] = RB$WAITING;
;	  0206	!
;	  0207	! Figure out whether the request is local or remote.
;	  0208	!
;	  0209	    LOCAL_REMOTE_CHECK (.ENTRY);
;	  0210	!
;	  0211	! Insert entry into master queue of entries and onto the
;	  0212	! appropriate queue of waiting requests.
;	  0213	!
;	  0214	    NMU$QUEUE_INSERT (REQUEST_QUEUE, ENTRY [RB_REQUEST_QUEUE]);
;	  0215	
;	  0216	    if .ENTRY [RB_TYPE] eql RT$LOCAL
;	  0217	    then
;	  0218		NMU$QQUEUE_INSERT (LOCAL_QUEUE, ENTRY [RB_PROCESS_QUEUE])
;	  0219	    else
;	  0220		NMU$QQUEUE_INSERT (REMOTE_QUEUE, ENTRY [RB_PROCESS_QUEUE]);
;	  0221	
;	  0222	!
;	  0223	! Return the request number.
;	  0224	!
;	  0225	    .ENTRY [RB_NUMBER]
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   7
X01.09		NML$REQUEST_ENTER as NL_RENTER			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (4)

;	  0226	    end;					! End of NML$REQUEST_ENTER


						.SBTTL	NL.RENTER NML$REQUEST_ENTER as NL_RENTER
000000	010146 				NL.RENTER::
						MOV	R1,-(SP)			;					0175
000002	016601  000004 				MOV	4(SP),R1			; ENTRY,*				0203
000006	016700  000062'				MOV	REQUEST.NUMBER,R0
000012	005200 					INC	R0
000014	010067  000062'				MOV	R0,REQUEST.NUMBER
000020	010061  000014 				MOV	R0,14(R1)
000024	005061  000020 				CLR	20(R1)				;					0204
000030	012761  000001  000022 			MOV	#1,22(R1)			;					0205
000036	010146 					MOV	R1,-(SP)			;					0209
000040	004767  000000V				JSR	PC,LOCAL.REMOTE.CHECK
000044	012716  000000'				MOV	#REQUEST.QUEUE,(SP)		;					0214
000050	010146 					MOV	R1,-(SP)
000052	004767  000000G				JSR	PC,UQ.INSERT
000056	012700  000006 				MOV	#6,R0				;					0218
000062	060100 					ADD	R1,R0
000064	026127  000016  000001 			CMP	16(R1),#1			;					0216
000072	001003 					BNE	1$
000074	012716  000006'				MOV	#LOCAL.QUEUE,(SP)		;					0218
000100	000402 					BR	2$
000102	012716  000034'			1$:	MOV	#REMOTE.QUEUE,(SP)		;					0220
000106	010046 				2$:	MOV	R0,-(SP)
000110	004767  000000G				JSR	PC,US.QQINS
000114	062706  000006 				ADD	#6,SP				;					0197
000120	016100  000014 				MOV	14(R1),R0			;					0175
000124	012601 					MOV	(SP)+,R1
000126	000207 					RTS	PC
; Routine Size:  44 words,	Routine Base:  $CODE$ + 0046
; Maximum stack depth per invocation:  5 words
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   8
X01.09		NML$REQUEST_ENTER as NL_RENTER			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (5)

;	  0227	
;	  0228	%routine ('LOCAL_REMOTE_CHECK', REQUEST : ref REQUEST_BLOCK) : novalue =
;	  0229	
;	  0230	!++
;	  0231	! Functional description:
;	  0232	!
;	  0233	!	This routine determines  whether a  request is  for the  local
;	  0234	!	node or is to be  sent out node for  a remote NML to  process.
;	  0235	!	This determination  is made  by comparing  the local  node  id
;	  0236	!	against the EXECUTOR node id for the request.
;	  0237	!
;	  0238	! Formal parameters:
;	  0239	!
;	  0240	!	.REQUEST    Address of request block
;	  0241	!
;	  0242	! Routine value: none
;	  0243	! Side effects:
;	  0244	!
;	  0245	!	REQUEST [RB_TYPE] is set to either RT$LOCAL or RT$REMOTE.
;	  0246	!
;	  0247	!--
;	  0248	
;	  0249	    begin
;	  0250	
;	  0251	    local
;	  0252		REQUEST_NODE_NUMBER,
;	  0253		LOCAL_NODE_NUMB,
;	  0254		REQUEST_ID_POINTER,
;	  0255		LOCAL_ID_POINTER;
;	  0256	
;	  0257	!
;	  0258	! Default the request type to local.
;	  0259	!
;	  0260	    REQUEST [RB_TYPE] = RT$LOCAL;
;	  0261	!
;	  0262	! Check for an EXECUTOR node id specified, if not
;	  0263	! then just return (local request).
;	  0264	!
;	  0265	    if .REQUEST [RB_EXECUTOR] eql 0 then return;
;	  0266	!
;	  0267	! Make pointers to the local node id and request id.
;	  0268	!
;	  0269	    LOCAL_ID_POINTER = NMU$NETWORK_LOCAL ();
;	  0270	    REQUEST_ID_POINTER = ch$ptr (.REQUEST [RB_EXECUTOR],,8);
;	  0271	    LOCAL_NODE_NUMB = GETW (LOCAL_ID_POINTER);
;	  0272	!
;	  0273	! Check request's node number.  If non zero then compare
;	  0274	! against the local node number.  If it is zero then compare
;	  0275	! the node names.
;	  0276	!
;	  0277	    if (REQUEST_NODE_NUMBER = GETW (REQUEST_ID_POINTER)) neq 0
;	  0278	    then
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page   9
X01.09		LOCAL_REMOTE_CHECK				 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (5)

;	  0279		if .REQUEST_NODE_NUMBER eql .LOCAL_NODE_NUMB
;	  0280		then return
;	  0281		else REQUEST [RB_TYPE] = RT$REMOTE
;	  0282	    else
;	  0283		if ch$eql (GETB (REQUEST_ID_POINTER), .REQUEST_ID_POINTER,
;	  0284			   GETB (LOCAL_ID_POINTER), .LOCAL_ID_POINTER)
;	  0285		then return
;	  0286		else REQUEST [RB_TYPE] = RT$REMOTE;
;	  0287	
;	  0288	    end;					! End of LOCAL_REMOTE_CHECK


						.SBTTL	LOCAL.REMOTE.CHECK LOCAL_REMOTE_CHECK
000000	004167  000000G			LOCAL.REMOTE.CHECK:
						JSR	R1,$SAVE4			;					0228
000004	005746 					TST	-(SP)
000006	016600  000016 				MOV	16(SP),R0			; REQUEST,*				0260
000012	012704  000016 				MOV	#16,R4
000016	060004 					ADD	R0,R4
000020	012714  000001 				MOV	#1,(R4)
000024	016001  000040 				MOV	40(R0),R1			;					0265
000030	001436 					BEQ	3$
000032	004767  000000G				JSR	PC,UN.LOCAL			;					0269
000036	010002 					MOV	R0,R2				; *,LOCAL.ID.POINTE
000040	112216 					MOVB	(R2)+,(SP)			; LOCAL.ID.POINTE,$$GETB.X		0271
000042	112266  000001 				MOVB	(R2)+,1(SP)			; LOCAL.ID.POINTE,$$GETB.X
000046	011603 					MOV	(SP),R3				; $$GETB.X,LOCAL.NODE.NUMB
000050	112116 					MOVB	(R1)+,(SP)			; REQUEST.ID.POIN,$$GETB.X		0277
000052	112166  000001 				MOVB	(R1)+,1(SP)			; REQUEST.ID.POIN,$$GETB.X
000056	011600 					MOV	(SP),R0				; $$GETB.X,REQUEST.NODE.NU
000060	001403 					BEQ	1$
000062	020003 					CMP	R0,R3				; REQUEST.NODE.NU,LOCAL.NODE.NUMB	0279
000064	001420 					BEQ	3$				;					0280
000066	000415 					BR	2$				;					0281
000070	005046 				1$:	CLR	-(SP)				;					0284
000072	112116 					MOVB	(R1)+,(SP)			; REQUEST.ID.POIN,*
000074	010146 					MOV	R1,-(SP)			; REQUEST.ID.POIN,*
000076	005046 					CLR	-(SP)
000100	112216 					MOVB	(R2)+,(SP)			; LOCAL.ID.POINTE,*
000102	010246 					MOV	R2,-(SP)			; LOCAL.ID.POINTE,*
000104	005046 					CLR	-(SP)
000106	004767  000000G				JSR	PC,BL$EQL
000112	062706  000012 				ADD	#12,SP
000116	006000 					ROR	R0
000120	103402 					BLO	3$				;					0285
000122	012714  000002 			2$:	MOV	#2,(R4)				;					0286
000126	005726 				3$:	TST	(SP)+				;					0228
000130	000207 					RTS	PC
; Routine Size:  45 words,	Routine Base:  $CODE$ + 0176
; Maximum stack depth per invocation:  12 words
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  10
X01.09		LOCAL_REMOTE_CHECK				 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (6)

;	  0289	
;	  0290	%global_routine ('NML$REQUEST_NEXT', REQUEST_TYPE) =
;	  0291	
;	  0292	!++
;	  0293	! Functional description:
;	  0294	!
;	  0295	!       This routine is called by the request processing tasks.  It
;	  0296	!       retrieves the next request to be processed of the type specified
;	  0297	!       (local/remote) and returns the address of the request block to
;	  0298	!       the caller for processing.
;	  0299	!
;	  0300	! Formal parameters:
;	  0301	!
;	  0302	!       .REQUEST_TYPE  RT$LOCAL   Local request
;	  0303	!                      RT$REMOTE  Remote request
;	  0304	!
;	  0305	! Routine value:
;	  0306	!
;	  0307	!      Request block address for processing
;	  0308	!
;	  0309	! Side effects:
;	  0310	!
;	  0311	!      The calling task is blocked until a request of the type
;	  0312	!      desired is queued for processing.
;	  0313	!
;	  0314	!--
;	  0315	
;	  0316	    begin
;	  0317	
;	  0318	    local
;	  0319	         REQUEST : ref REQUEST_BLOCK;
;	  0320	
;	  0321	!
;	  0322	! Get request entry from appropriate queue.
;	  0323	!
;	  0324	
;	  0325	    if .REQUEST_TYPE eql RT$LOCAL
;	  0326	    then
;	  0327		REQUEST = NMU$QQUEUE_REMOVE (LOCAL_QUEUE)
;	  0328	    else
;	  0329		REQUEST = NMU$QQUEUE_REMOVE (REMOTE_QUEUE);
;	  0330	
;	  0331	!
;	  0332	! Adjust entry address to account for master queue
;	  0333	! linkage info preceding processing queue info.
;	  0334	!
;	  0335	    REQUEST = .REQUEST - Q_ENTRY_ALLOCATION;
;	  0336	!
;	  0337	! Set the task id of the processing task for the request.
;	  0338	!
;	  0339	    REQUEST [RB_TASK] = NMU$SCHED_CURRENT ();
;	  0340	!
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  11
X01.09		NML$REQUEST_NEXT as NL_REMOVE			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (6)

;	  0341	! Set the request state to active
;	  0342	!
;	  0343	    REQUEST [RB_STATE] = RB$ACTIVE;
;	  0344	!
;	  0345	! Return the request address
;	  0346	!
;	  0347	    .REQUEST
;	  0348	    end;					! End of NML$REQUEST_NEXT


						.SBTTL	NL.REMOVE NML$REQUEST_NEXT as NL_REMOVE
000000	010146 				NL.REMOVE::
						MOV	R1,-(SP)			;					0290
000002	026627  000004  000001 			CMP	4(SP),#1			; REQUEST.TYPE,*			0325
000010	001003 					BNE	1$
000012	012746  000006'				MOV	#LOCAL.QUEUE,-(SP)		;					0327
000016	000402 					BR	2$
000020	012746  000034'			1$:	MOV	#REMOTE.QUEUE,-(SP)		;					0329
000024	004767  000000G			2$:	JSR	PC,US.QQREM
000030	010001 					MOV	R0,R1				; *,REQUEST
000032	162701  000006 				SUB	#6,R1				; *,REQUEST				0335
000036	004767  000000G				JSR	PC,US.CURRENT			;					0339
000042	010061  000020 				MOV	R0,20(R1)			; *,*(REQUEST)
000046	012761  000002  000022 			MOV	#2,22(R1)			; *,*(REQUEST)				0343
000054	005726 					TST	(SP)+				;					0316
000056	010100 					MOV	R1,R0				; REQUEST,*				0290
000060	012601 					MOV	(SP)+,R1
000062	000207 					RTS	PC
; Routine Size:  26 words,	Routine Base:  $CODE$ + 0330
; Maximum stack depth per invocation:  3 words
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  12
X01.09		NML$REQUEST_NEXT as NL_REMOVE			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (7)

;	  0349	
;	  0350	%global_routine ('NML$REQUEST_FINISH', REQUEST : ref REQUEST_BLOCK) =
;	  0351	
;	  0352	!++
;	  0353	! Functional description:
;	  0354	!
;	  0355	!       This routine is called by a task that has finished  processing
;	  0356	!       a request (with either a partial or full response).  The  NICE
;	  0357	!       return message pointer has been filled in.  If the state of the
;	  0358	!	request is "active" ([RB_STATE] eql RB$ACTIVE) and the return code
;	  0359	!       is 2 (multiple response) then the request state is set to 
;	  0360	!	"more responses coming" ([RB_STATE] = RB$MORE) and the request
;	  0361	!	block is left on the request queue. If the state is "active" and
;	  0362	!	the return code is 1 , the request is "done" and is removed from
;	  0363	!	the request queue. If the state is "more responses coming" 
;	  0364	!	([RB_STATE] eql RB$MORE) and the return code is not -128 then the
;	  0365	!	request is left on the queue.
;	  0366	!
;	  0367	! Formal parameters:
;	  0368	!
;	  0369	!       .REQUEST    Address of request block
;	  0370	!
;	  0371	! Routine value:
;	  0372	!
;	  0373	!	$true	  if state is RB$DONE at exit
;	  0374	!	$false	  Otherwise
;	  0375	!
;	  0376	! Side effects:
;	  0377	!
;	  0378	!       A call to the completion routine specific in the request
;	  0379	!       block is made.
;	  0380	!
;	  0381	!--
;	  0382	
;	  0383	    begin
;	  0384	
;	  0385	    $field SIGNED_BYTE =
;	  0386	        set
;	  0387	        VALUE = [0,0,8,1]               ! Signed eight bit byte
;	  0388	        tes;
;	  0389	
;	  0390	    local
;	  0391		RETURN_VALUE,
;	  0392		RESP_MSG,
;	  0393		RESP_CODE: block[1] field(SIGNED_BYTE) ; ! 8 bit signed return code 
;	  0394	
;	  0395	!
;	  0396	! Get response to request (1st byte in message)
;	  0397	!
;	  0398	    RESP_MSG = ch$ptr (.REQUEST [RB_RESPONSE],, 8);
;	  0399	    RESP_CODE = ch$rchar_a (RESP_MSG);
;	  0400	
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  13
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (7)

;	  0401	!
;	  0402	! If state is "active" then this is the first response we've
;	  0403	! seen. Set state to "more" if NICE return code is 2,
;	  0404	! otherwise state to "done" and remove the request from
;	  0405	! the queue.
;	  0406	!
;	  0407	! If the state is "more" and the return code is -128 then set
;	  0408	! state to "done" and remove request from the queue.
;	  0409	!
;	  0410	
;	  0411	    if .REQUEST [RB_STATE] eql RB$ACTIVE
;	  0412	    then
;	  0413	        begin
;	  0414		if (.RESP_CODE[VALUE] eql 2)
;	  0415		then
;	  0416		    REQUEST [RB_STATE] = RB$MORE
;	  0417		else
;	  0418		    begin
;	  0419		    REQUEST [RB_STATE] = RB$DONE;
;	  0420		    NMU$QUEUE_EXTRACT (REQUEST_QUEUE, REQUEST [RB_REQUEST_QUEUE]);
;	  0421		    end;
;	  0422	        end
;	  0423	    else if .REQUEST [RB_STATE] eql RB$MORE
;	  0424		 then if (.RESP_CODE[VALUE] eql -128)
;	  0425		      then
;	  0426			  begin
;	  0427			  REQUEST [RB_STATE] = RB$DONE;
;	  0428			  NMU$QUEUE_EXTRACT (REQUEST_QUEUE,
;	  0429				             REQUEST [RB_REQUEST_QUEUE]);
;	  0430			  end;
;	  0431	
;	  0432	    RETURN_VALUE = (if .REQUEST [RB_STATE] eql RB$DONE
;	  0433			    then $true
;	  0434			    else $false) ;
;	  0435	
;	  0436	!
;	  0437	! Call completion routine with request response.
;	  0438	! If request is done, completion routine releases request block.
;	  0439	!
;	  0440	    begin
;	  0441	
;	  0442	    bind routine
;	  0443		COMPLETION_ROUTINE = .REQUEST [RB_COMPLETION];
;	  0444	
;	  0445	    if COMPLETION_ROUTINE neq 0 then COMPLETION_ROUTINE (.REQUEST);
;	  0446	
;	  0447	    end;
;	  0448	!
;	  0449	! Return indication to processing routine whether the
;	  0450	! request is done yet.
;	  0451	!
;	  0452	
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  14
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (7)

;	  0453	    .RETURN_VALUE
;	  0454	
;	  0455	    end;					! End of NML$REQUEST_FINISH


						.SBTTL	NL.FINISH NML$REQUEST_FINISH as NL_FINISH
000000	004167  000000G			NL.FINISH::
						JSR	R1,$SAVE2			;					0350
000004	016602  000010 				MOV	10(SP),R2			; REQUEST,*				0398
000010	016200  000026 				MOV	26(R2),R0			; *,RESP.MSG
000014	112000 					MOVB	(R0)+,R0			; RESP.MSG,RESP.CODE			0399
000016	042700  177400 				BIC	#177400,R0			; *,RESP.CODE
000022	012701  000022 				MOV	#22,R1				;					0411
000026	060201 					ADD	R2,R1
000030	021127  000002 				CMP	(R1),#2
000034	001006 					BNE	1$
000036	120027  000002 				CMPB	R0,#2				; RESP.CODE,*				0414
000042	001011 					BNE	2$
000044	012711  000005 				MOV	#5,(R1)				;					0416
000050	000416 					BR	3$				;					0414
000052	021127  000005 			1$:	CMP	(R1),#5				;					0423
000056	001013 					BNE	3$
000060	120027  177600 				CMPB	R0,#-200			; RESP.CODE,*				0424
000064	001010 					BNE	3$
000066	012711  000003 			2$:	MOV	#3,(R1)				;					0427
000072	012746  000000'				MOV	#REQUEST.QUEUE,-(SP)		;					0428
000076	010246 					MOV	R2,-(SP)
000100	004767  000000G				JSR	PC,UQ.EXTRACT
000104	022626 					CMP	(SP)+,(SP)+			;					0426
000106	021127  000003 			3$:	CMP	(R1),#3				;					0432
000112	001003 					BNE	4$
000114	012701  000001 				MOV	#1,R1				; *,RETURN.VALUE
000120	000401 					BR	5$
000122	005001 				4$:	CLR	R1				; RETURN.VALUE
000124	005762  000044 			5$:	TST	44(R2)				;					0445
000130	001404 					BEQ	6$
000132	010246 					MOV	R2,-(SP)
000134	004772  000044 				JSR	PC,@44(R2)
000140	005726 					TST	(SP)+
000142	010100 				6$:	MOV	R1,R0				; RETURN.VALUE,*			0350
000144	000207 					RTS	PC
; Routine Size:  51 words,	Routine Base:  $CODE$ + 0414
; Maximum stack depth per invocation:  6 words
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  15
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (8)

;	  0456	!
;	  0457	!Routines that are not used in $MCB follow this conditional:
;	  0458	!
;	L 0459	%if not $MCB
;	U 0460	%then
;	U 0461	
;	U 0462	%global_routine ('NML$REQUEST_ABORT', R_NUMBER) =
;	U 0463	
;	U 0464	!++
;	U 0465	! Functional description:
;	U 0466	!
;	U 0467	!       This routine aborts the request with the specified
;	U 0468	!       request number.  The request is removed (if it exists)
;	U 0469	!       from either the ACTIVE or WAITING request queue.
;	U 0470	!
;	U 0471	! Formal parameters:
;	U 0472	!
;	U 0473	!       .R_NUMBER    Request number to abort
;	U 0474	!
;	U 0475	! Routine value:
;	U 0476	!
;	U 0477	!       $true    request was found and aborted
;	U 0478	!       $false   request was not found
;	U 0479	!
;	U 0480	! Side effects:
;	U 0481	!
;	U 0482	!       The completion routine for the request is called with
;	U 0483	!       a failure NICE return message.
;	U 0484	!
;	U 0485	!--
;	U 0486	
;	U 0487	    begin
;	U 0488	
;	U 0489	    local
;	U 0490	         REQUEST : ref REQUEST_BLOCK;
;	U 0491	
;	U 0492	    if (REQUEST = NMU$QUEUE_SCAN (REQUEST_QUEUE, .R_NUMBER, REQUEST_SEARCH)) neq 0
;	U 0493	    then
;	U 0494		begin
;	U 0495	
;	U 0496		bind routine
;	U 0497		    COMPLETION_ROUTINE = .REQUEST [RB_COMPLETION];
;	U 0498	
;	U 0499		if .REQUEST [RB_STATE] eql RB$ACTIVE
;	U 0500	        then NMU$SCHED_ABORT (.REQUEST [RB_TASK]);
;	U 0501	
;	U 0502	        NMU$QUEUE_EXTRACT (REQUEST_QUEUE, REQUEST [RB_REQUEST_QUEUE]);
;	U 0503	
;	U 0504	        if .REQUEST [RB_STATE] eql RB$WAITING
;	U 0505	        then
;	U 0506	            if .REQUEST [RB_TYPE] eql RT$LOCAL
;	U 0507	            then
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  16
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (8)

;	U 0508	                NMU$QQUEUE_EXTRACT (LOCAL_QUEUE, REQUEST [RB_PROCESS_QUEUE])
;	U 0509	            else
;	U 0510	                NMU$QQUEUE_EXTRACT (REMOTE_QUEUE, REQUEST [RB_PROCESS_QUEUE]);
;	U 0511	
;	U 0512		REQUEST [RB_STATE] = RB$CANCELLED;
;	U 0513	
;	U 0514		if COMPLETION_ROUTINE neq 0
;	U 0515	        then COMPLETION_ROUTINE (.REQUEST);
;	U 0516	
;	U 0517		$true
;	U 0518		end
;	U 0519	    else
;	U 0520		$false
;	U 0521	
;	U 0522	    end;					! End of NML$REQUEST_ABORT
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  17
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (9)

;	U 0523	
;	U 0524	%global_routine ('NML$REQUEST_TERMINATE', REQUEST : ref REQUEST_BLOCK) =
;	U 0525	
;	U 0526	!++
;	U 0527	! Functional description:
;	U 0528	!
;	U 0529	!       This routine is called to terminate a request that gets aborted
;	U 0530	!       during the processing of a sequence of multiple responses.
;	U 0531	!       A terminating response message (response code = -128) is created
;	U 0532	!	and the REQUEST_FINISH routine is called.  Therefore, any output
;	U 0533	!       that is queued for printing (including the error message causing
;	U 0534	!       the abort) will be sent	to the operator and any memory resources
;	U 0535	!       allocated for this request will get released.
;	U 0536	!
;	U 0537	! Formal parameters:
;	U 0538	!
;	U 0539	!       .REQUEST    Address of request block
;	U 0540	!
;	U 0541	! Routine value:
;	U 0542	!
;	U 0543	!	$true	  if state is RB$DONE at exit
;	U 0544	!	$false	  Otherwise
;	U 0545	!
;	U 0546	! Side effects:
;	U 0547	!
;	U 0548	!       See NML$REQUEST_FINISH
;	U 0549	!
;	U 0550	!--
;	U 0551	
;	U 0552	    begin
;	U 0553	
;	U 0554	    $field SIGNED_BYTE =
;	U 0555	        set
;	U 0556	        VALUE = [0,0,8,1]               ! Signed eight bit byte
;	U 0557	        tes;
;	U 0558	
;	U 0559	    local
;	U 0560		RESP_MSG,
;	U 0561		RESP_CODE: block[1] field(SIGNED_BYTE) ; ! 8 bit signed return code 
;	U 0562	
;	U 0563	!
;	U 0564	! Set response to request (1st byte in message) to -128
;	U 0565	!
;	U 0566	    RESP_MSG = ch$ptr (.REQUEST [RB_RESPONSE],, 8);
;	U 0567	    RESP_CODE[VALUE] = -128 ;
;	U 0568	    ch$wchar (.RESP_CODE,.RESP_MSG);
;	U 0569	
;	U 0570	    REQUEST [RB_RESPONSE_LENGTH] = 1 ;	! Length of response message
;	U 0571	
;	U 0572	    NML$REQUEST_FINISH (.REQUEST)	! Finish off in graceful manner
;	U 0573	
;	U 0574	    end;				! End of NML$REQUEST_TERMINATE
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  18
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (10)

;	U 0575	
;	U 0576	%global_routine ('NML$REQUEST_CANCEL', R_NUMBER) =
;	U 0577	
;	U 0578	!++
;	U 0579	! Functional description:
;	U 0580	!
;	U 0581	!       This routine cancels a request that is waiting to
;	U 0582	!       start processing.  Only requests that are still on
;	U 0583	!       the WAITING queue are affected.
;	U 0584	!
;	U 0585	! Formal parameters:
;	U 0586	!
;	U 0587	!       .R_NUMBER    Request number to cancel
;	U 0588	!
;	U 0589	! Routine value:
;	U 0590	!
;	U 0591	!       $true      if request was found and canceled
;	U 0592	!       $false     if request was not found on WAITING queue
;	U 0593	!
;	U 0594	! Side effects:
;	U 0595	!
;	U 0596	!       The completion routine for the request is called with
;	U 0597	!       a failure NICE return message.
;	U 0598	!
;	U 0599	!--
;	U 0600	
;	U 0601	    begin
;	U 0602	
;	U 0603	    local
;	U 0604	         REQUEST : ref REQUEST_BLOCK;
;	U 0605	
;	U 0606	    if (REQUEST = NMU$QUEUE_SCAN (REQUEST_QUEUE, .R_NUMBER, REQUEST_SEARCH)) neq 0
;	U 0607	    then
;	U 0608		begin
;	U 0609	
;	U 0610		bind routine
;	U 0611		    COMPLETION_ROUTINE = .REQUEST [RB_COMPLETION];
;	U 0612	
;	U 0613		if .REQUEST [RB_STATE] eql RB$WAITING
;	U 0614		then
;	U 0615		    begin
;	U 0616	            NMU$QUEUE_EXTRACT (REQUEST_QUEUE, REQUEST [RB_REQUEST_QUEUE]);
;	U 0617	
;	U 0618	            if .REQUEST [RB_TYPE] eql RT$LOCAL
;	U 0619	            then
;	U 0620	                NMU$QQUEUE_EXTRACT (LOCAL_QUEUE, REQUEST [RB_PROCESS_QUEUE])
;	U 0621	            else
;	U 0622	                NMU$QQUEUE_EXTRACT (REMOTE_QUEUE, REQUEST [RB_PROCESS_QUEUE]);
;	U 0623	
;	U 0624		    REQUEST [RB_STATE] = RB$CANCELLED;
;	U 0625	
;	U 0626		    if COMPLETION_ROUTINE neq 0
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  19
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (10)

;	U 0627	            then COMPLETION_ROUTINE (.REQUEST);
;	U 0628	
;	U 0629		    $true
;	U 0630		    end
;	U 0631		else
;	U 0632		    $false
;	U 0633	
;	U 0634		end
;	U 0635	    else
;	U 0636		$false
;	U 0637	
;	U 0638	    end;					! End of NML$REQUEST_CANCEL
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  20
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (11)

;	U 0639	
;	U 0640	%routine ('REQUEST_SEARCH', REQUEST : ref REQUEST_BLOCK, NUMBER) =
;	U 0641	
;	U 0642	!++
;	U 0643	! Functional description:
;	U 0644	!
;	U 0645	!       This routine is used by both REQUEST_ABORT and REQUEST_CANCEL
;	U 0646	!       to do the queue scanning for the desired request.
;	U 0647	!
;	U 0648	! Formal parameters:
;	U 0649	!
;	U 0650	!       .REQUEST     Address of request currently being checked
;	U 0651	!       .NUMBER	     Request number being searched for
;	U 0652	!
;	U 0653	! Routine value:
;	U 0654	!
;	U 0655	!       Zero (0) if request numbers didn't match
;	U 0656	!       Address of request block if the request numbers matched
;	U 0657	!
;	U 0658	! Side effects: none
;	U 0659	!
;	U 0660	!--
;	U 0661	
;	U 0662	    begin
;	U 0663	
;	U 0664	    if .REQUEST [RB_NUMBER] eql .NUMBER then .REQUEST else 0
;	U 0665	
;	U 0666	    end;					! End of REQUEST_SEARCH
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  21
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (12)

;	U 0667	
;	U 0668	%global_routine ('NML$REQUEST_SHOW', NEXT_R, R_BLOCK_ADR) =
;	U 0669	
;	U 0670	!++
;	U 0671	! Functional description:
;	U 0672	!
;	U 0673	!       This routine is called repeatedly to step through all
;	U 0674	!       the queues of requests (WAITING and ACTIVE).  Each
;	U 0675	!       time this routine returns it passes back the address of
;	U 0676	!       a block that contains the following information:
;	U 0677	!
;	U 0678	!          Request number
;	U 0679	!          Request state
;	U 0680	!          NICE message
;	U 0681	!          EXECUTOR node name
;	U 0682	!
;	U 0683	!       Also the NEXT_R parameter is updated so that the next
;	U 0684	!       call will step onto the next entry in the queues.
;	U 0685	!
;	U 0686	! Formal parameters:
;	U 0687	!
;	U 0688	!	.NEXT_R		Return next request that is greater or equal
;	U 0689	!			in magnitude to this number
;	U 0690	!
;	U 0691	!	.R_BLOCK_ADR	Address of cell to receive request block
;	U 0692	!			address
;	U 0693	! Routine value:
;	U 0694	!
;	U 0695	!       $false    no request was found
;	U 0696	!       $true     request block has been returned
;	U 0697	!
;	U 0698	! Side effects:
;	U 0699	!
;	U 0700	!       Note that the caller MUST release all the memory associated
;	U 0701	!       with each request block after use.
;	U 0702	!
;	U 0703	!--
;	U 0704	
;	U 0705	    begin
;	U 0706	
;	U 0707	    bind
;	U 0708		R_BLOCK = .R_BLOCK_ADR : ref REQUEST_BLOCK;
;	U 0709	
;	U 0710	    if (R_BLOCK = NMU$QUEUE_SCAN (REQUEST_QUEUE, ..NEXT_R, SHOW_SCAN)) neq 0
;	U 0711	    then
;	U 0712		begin
;	U 0713		.NEXT_R = .R_BLOCK [RB_NUMBER];
;	U 0714		$true
;	U 0715		end
;	U 0716	    else
;	U 0717		$false
;	U 0718	
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  22
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (12)

;	U 0719	    end;					! End of NML$REQUEST_SHOW
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  23
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (13)

;	U 0720	
;	U 0721	%routine ('SHOW_SCAN', ENTRY : ref REQUEST_BLOCK, DATA) =
;	U 0722	
;	U 0723	!++
;	U 0724	! Functional description:
;	U 0725	!
;	U 0726	!	If the ENTRY matches the request number specified, a
;	U 0727	!	copy of the entry is made and the address of the entry
;	U 0728	!	returned.
;	U 0729	!
;	U 0730	! Formal parameters:
;	U 0731	!
;	U 0732	!	.ENTRY    Address of current request queue entry
;	U 0733	!	.DATA    Scanning data (request number to find)
;	U 0734	!
;	U 0735	! Routine value:
;	U 0736	!
;	U 0737	!	Zero (0) if no match
;	U 0738	!	Address of copy block if match
;	U 0739	!
;	U 0740	! Side effects: none
;	U 0741	!
;	U 0742	!--
;	U 0743	
;	U 0744	    begin
;	U 0745	
;	U 0746	!
;	U 0747	! Get then next highest numbered request
;	U 0748	!
;	U 0749	
;	U 0750	    if .ENTRY [RB_NUMBER] gtr .DATA
;	U 0751	    then
;	U 0752		begin
;	U 0753		local
;	U 0754		    COPY : ref REQUEST_BLOCK;
;	U 0755	
;	U 0756		!
;	U 0757		! Make a copy of the request block
;	U 0758		!
;	U 0759	
;	U 0760		COPY = NMU$MEMORY_GET (REQUEST_BLOCK_ALLOCATION);
;	U 0761		COPY [RB_NUMBER] = .ENTRY [RB_NUMBER];
;	U 0762		COPY [RB_TYPE] = .ENTRY [RB_TYPE];
;	U 0763		COPY [RB_NICE] = .ENTRY [RB_NICE];
;	U 0764		COPY [RB_NICE_LENGTH] = .ENTRY [RB_NICE_LENGTH];
;	U 0765		COPY [RB_EXECUTOR] = .ENTRY [RB_EXECUTOR];
;	U 0766		COPY [RB_SOURCE] = .ENTRY [RB_SOURCE];
;	U 0767		COPY [RB_STATE] = .ENTRY [RB_STATE];
;	U 0768	!
;	U 0769	!****
;	U 0770	!****  Allocate space and copy the NICE and EXECUTOR strings ???
;	U 0771	!****  No, I don't think we can do that. The strings reside in the
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  24
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (13)

;	U 0772	!****  the additional data block.
;	U 0773	!****
;	U 0774	!
;	U 0775	
;	U 0776	        !
;	U 0777	        ! If there is a data block allocated copy it.
;	U 0778	        !
;	U 0779	
;	U 0780		if .ENTRY [RB_DATA_ALLOCATION] neq 0
;	U 0781		then
;	U 0782		    begin
;	U 0783	            COPY [RB_DATA] = NMU$MEMORY_GET (.ENTRY[RB_DATA_ALLOCATION]);
;	U 0784	            COPY [RB_DATA_ALLOCATION] = .ENTRY [RB_DATA_ALLOCATION] ;
;	U 0785	            ch$move (.ENTRY [RB_DATA_ALLOCATION],
;	U 0786		             ch$ptr(.ENTRY [RB_DATA],,(%bpval/%upval)),
;	U 0787	                     .ENTRY [RB_DATA_ALLOCATION]) ;
;	U 0788		    end;
;	U 0789	
;	U 0790		.COPY
;	U 0791		end
;	U 0792	    else
;	U 0793		0
;	U 0794	
;	U 0795	    end;					! End of SHOW_SCAN
;	  0796	%fi !End of %if not $MCB
;	  0797	
;	  0798	end						! End of module NMLQUE
;	  0799	eludom



;					OTS external references
						.GLOBL	$SAVE4, $SAVE2, BL$EQL


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $OWN$				   26	    RW ,  D  ,  LCL,  REL,  CON
;	 $CODE$				  185	    RO ,  I  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  DNET61:<MCB.NML>NMLLIB.L16.2		      2718       163         5         0
NMLQUE		NMLQUE -- NICE Request Queue Management Routine 24-May-1985 13:25:53	TOPS-20 Bliss-16 2A(530)	    Page  25
X01.09		NML$REQUEST_FINISH as NL_FINISH			 3-Jan-1983 01:52:37	DNET61:<MCB.NML>NMLQUE.BLI.1 (13)




; Size:		185 code + 26 data words
; Run Time:	00:05.7
; Elapsed Time:	00:09.2
; Memory Used:	40 pages
; Compilation Complete
CH$WCHAR			 568
COMPLETION_ROUTINE		 443*	 445	 497*	 514	 515	 611*	 626	 627
COPY				 754	 760#	 761#	 762#	 763#	 764#	 765#	 766#	 767#	 783#	 784#	 790
DATA				 721	 750
GETB				 283	 284
GETW				 271	 277
LOCAL_ID_POINTER		 255	 269#	 271	 284
LOCAL_NODE_NUMB			 253	 271#	 279
LOCAL_QUEUE			 131	 171	 218	 327	 508	 620
LOCAL_REMOTE_CHECK		 123	 209
MAX_REQUESTS_QUEUED		 108#	 171	 172
NEXT_R				 668	 710	 713#
NML$REQUEST_FINISH		 572
NML$REQUEST_MANAGER		 101
NMLQUE				  53#
NMU$MEMORY_GET			 760	 783
NMU$MEMORY_MANAGER		 142
NMU$NETWORK_LOCAL		 269
NMU$NETWORK_UTILITIES		 143
NMU$QQUEUE_EXTRACT		 508	 510	 620	 622
NMU$QQUEUE_INSERT		 218	 220
NMU$QQUEUE_REMOVE		 327	 329
NMU$QQUEUE_RESET		 171	 172
NMU$QUEUE_EXTRACT		 420	 428	 502	 616
NMU$QUEUE_INSERT		 214
NMU$QUEUE_MANAGER		 140*
NMU$QUEUE_RESET			 170
NMU$QUEUE_SCAN			 492	 606	 710
NMU$SCHED_ABORT			 500
NMU$SCHED_CURRENT		 339
NMU$SCHED_MANAGER		 141
NUMBER				 640	 664
QQ_HEADER			 131	 132
Q_ENTRY_ALLOCATION		 335
Q_HEADER			 130
RB$ACTIVE			 343	 411	 499
RB$CANCELLED			 512	 624
RB$DONE				 419	 427	 432
RB$MORE				 416	 423
RB$WAITING			 205	 504	 613
RB_COMPLETION			 443	 497	 611
RB_DATA				 783	 786
RB_DATA_ALLOCATION		 780	 783	 784	 785	 787
RB_EXECUTOR			 265	 270	 765
RB_NICE				 763
RB_NICE_LENGTH			 764
RB_NUMBER			 203	 225	 664	 713	 750	 761
RB_PROCESS_QUEUE		 218	 220	 508	 510	 620	 622
RB_REQUEST_QUEUE		 214	 420	 429	 502	 616
RB_RESPONSE			 398	 566
RB_RESPONSE_LENGTH		 570
RB_SOURCE			 766
RB_STATE			 205	 343	 411	 416	 419	 423	 427	 432	 499	 504	 512	 613
				 624	 767
RB_TASK				 204	 339	 500
RB_TYPE				 216	 260	 281	 286	 506	 618	 762
REMOTE_QUEUE			 132	 172	 220	 329	 510	 622
REQUEST				 228	 260#	 265	 270	 281#	 286#	 319	 327#	 329#	 335#	 339#	 343#
				 347	 350	 398	 411	 416#	 419#	 420	 423	 427#	 429	 432	 443
				 445	 490	 492#	 497	 499	 500	 502	 504	 506	 508	 510	 512#
				 515	 524	 566	 570#	 572	 604	 606#	 611	 613	 616	 618	 620
				 622	 624#	 627	 640	 664
REQUEST_BLOCK			 175	 228	 319	 350	 490	 524	 604	 640	 708	 721	 754
REQUEST_BLOCK_ALLOCATION	 760
REQUEST_ID_POINTER		 254	 270#	 277	 283
REQUEST_NODE_NUMBER		 252	 277#	 279
REQUEST_NUMBER			 133	 203#
REQUEST_QUEUE			 130	 170	 214	 420	 428	 492	 502	 606	 616	 710
REQUEST_SEARCH			 120	 492	 606
REQUEST_TYPE			 290	 325
RESP_CODE			 393	 399#	 414	 424	 561	 567#	 568
RESP_MSG			 392	 398#	 399	 560	 566#	 568
RETURN_VALUE			 391	 432#	 453
RT$LOCAL			 216	 260	 325	 506	 618
RT$REMOTE			 281	 286
R_BLOCK				 708#	 710#	 713
R_BLOCK_ADR			 668	 708
R_NUMBER			 462	 492	 576	 606
SHOW_SCAN			 121	 710
SIGNED_BYTE			 385#	 393	 554#	 561
VALUE				 387#	 414	 424	 556#	 567
$FALSE				 434	 520	 632	 636	 717
$FIELD				 385	 554
$MCB				 109	 119	 459
$TRUE				 433	 517	 629	 714
%DEBUG_DATA_BASE		 150
%GLOBAL_ROUTINE			 154#	 175#	 290#	 350#	 462#	 524#	 576#	 668#
%MODULE_NAME			 152
%ROUTINE			 228#	 640#	 721#