Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/nml/nmldlw.lst
There are no other files named nmldlw.lst in the archive.
								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   1
								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (1)

;	  0001	!RATS:<BANKS.MCB.NCPNML>NMLDLW.B16.5 19-Nov-84 13:01:46, Edit by BANKS
;	  0002	!
;	  0003	! Ident 23.
;	  0004	!  Fix still more errors in Ident 21 (cause: ignorance of Bliss).
;	  0005	!
;	  0006	!RATS:<BANKS.MCB.NCPNML>NMLDLW.B16.4 16-Nov-84 10:39:15, Edit by BANKS
;	  0007	!
;	  0008	! Ident 22.
;	  0009	!  Fix errors in Ident 21.
;	  0010	!
;	  0011	!RATS:<BANKS.MCB.NMLMCB>NMLDLW.B16.3 30-Oct-84 15:00:55, Edit by BANKS
;	  0012	!
;	  0013	! Ident 21.
;	  0014	!  More work on autodumping.  If the received Memory Dump Service Requested
;	  0015	!  message contains a dump count, copy this count ala NICE into the 
;	  0016	!  request block that we queue to the dumper.
;	  0017	!
;	  0018	!RATS:<BANKS.MCB.NMLMCB>NMLDLW.B16.2 23-Oct-84 15:23:56, Edit by BANKS
;	  0019	!
;	  0020	! Ident 20.
;	  0021	!  DLW_TASK is making some assumptions about the size of a received Request
;	  0022	!  Dump Service message.  If the message contains an optional field (present
;	  0023	!  in messages received from DMR-11s), the message will be ignored because
;	  0024	!  it isn't one of the valid lengths.  Change the code to allow any message
;	  0025	!  greater than or equal to the presumed eight bytes in length.
;	  0026	!
;	  0027	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2  3-Oct-82 17:39:21, Edit by PECKHAM
;	  0028	!
;	  0029	! Ident 19.
;	  0030	!  Fix DLW_TASK to handle passive loopback independent of SERVICE parameter:
;	  0031	!    Add service block parameter SB_SERVICE.
;	  0032	!    Make SET_SERVICE_BLOCK set SB_SERVICE from VDB.
;	  0033	!    Take out check of SERVICE parameter before MOP message has been read.
;	  0034	!    Check SB_SERVICE for ENABLED only for LOAD and DUMP requests.
;	  0035	!
;	  0036	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.4 27-Aug-82 11:06:06, Edit by PECKHAM
;	  0037	!
;	  0038	! Ident 18.
;	  0039	!  Re-enable auto-dumping.
;	  0040	!  A reponse buffer was being lost because NMLDTL allocates a buffer
;	  0041	!  on top of the one NMLDLW allocates.  Fix this by de-allocating any
;	  0042	!  response buffers before doing a NML$REQUEST_ENTER.
;	  0043	!
;	  0044	!NET:<BRANDT.DEVELOPMENT>NMLDLW.B16.1 9-Jul-82 18:28:22, Edit by BRANDT
;	  0045	!
;	  0046	! Ident 17.
;	  0047	!   Disable autodumping
;	  0048	!
;	  0049	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2 26-Jun-82 16:28:22, Edit by PECKHAM
;	  0050	!
;	  0051	! Ident 16.
;	  0052	! Truncate ERROR TEXT to 72 bytes for event parameter in LOG_SERVICE_EVENT.
								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   2
								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (1)

;	  0053	!
;	  0054	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2 23-Jun-82 12:21:20, Edit by PECKHAM
;	  0055	!
;	  0056	! Ident 15.
;	  0057	! Set privledged bits in request block.
;	  0058	!
;	  0059	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.4 21-Jun-82 23:15:55, Edit by PECKHAM
;	  0060	!
;	  0061	! Ident 14.
;	  0062	! Make the MOP prompt message (ENTER MOP MODE) as a one byte message.
;	  0063	! This conforms to the VMS/RSX agreed-upon protocol.
;	  0064	! Add support for SERVICE DEVICE checking during service requests.
;	  0065	! Add LOG_ABORTED_REQUEST for unrecognized requests.
;	  0066	!
;	  0067	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2  5-Jun-82 14:10:59, Edit by PECKHAM
;	  0068	!
;	  0069	! Ident 13.
;	  0070	! Increase MOP buffer length from 25 to 500 for loopback.
;	  0071	! Only use MOP buffer in DLW_TASK (Do not put in RB_DATA).
;	  0072	! (It was being left allocated during the entire loading process)
;	  0073	!
;	  0074	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2 22-May-82 18:44:47, Edit by PECKHAM
;	  0075	!
;	  0076	! Ident 12.
;	  0077	! Add SETUP_SERVICE_BLOCK to initialize various items including substate.
;	  0078	! Do not set substates AUTODUMPING or AUTOLOADING (let NMLDTL do it).
;	  0079	! Make sure not to start a service operation if substate is not
;	  0080	! cleared or AUTOSERVICE.  Optimize linkages.
;	  0081	!
;	  0082	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2 10-May-82 15:47:56, Edit by PECKHAM
;	  0083	!
;	  0084	! Ident 11.
;	  0085	! Interlock service function on circuit substate.
;	  0086	!
;	  0087	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2 28-Apr-82 12:06:12, Edit by PECKHAM
;	  0088	!
;	  0089	! Ident 10.
;	  0090	! Change NMU$DLX_* routine references to $NMU_DLX_* macro references.
;	  0091	! Add receive timeout values where needed.
;	  0092	!
;	  0093	!NET:<PECKHAM.DEVELOPMENT>N-NMLDLW.B16.16  9-Mar-82 15:45:47, Edit by PECKHAM
;	  0094	!
;	  0095	! Ident 09.
;	  0096	! Fix MEMORY_GET handling.
;	  0097	! Create seperate DLW_TASK for service operations so as not to hold up
;	  0098	! event logging task.
;	  0099	! Check SERVICE parameter *after* link is open instead of before
;	  0100	! (this is to cycle the circuit back to transport so it will restart).
;	  0101	!
;	  0102	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.2  9-Feb-82 09:04:34, Edit by PECKHAM
;	  0103	!
;	  0104	! Ident 08.
								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   3
								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (1)

;	  0105	! Remove EV_ETM (NMLEVT now can use TIME_* routines).
;	  0106	! Replace calls to LW_EVT by direct call to NML$DECLARE_EVENT.
;	  0107	!
;	  0108	!NET:<PECKHAM.DEVELOPMENT>NMLDLW.B16.8 18-Jan-82 21:27:32, Edit by PECKHAM
;	  0109	!
;	  0110	! Ident 07.
;	  0111	! Add "automatic line service" events
;	  0112	! Note : The event definitions cannot be obtained because they are in NMLLIB.
;	  0113	!        The routine LW_EVT will be put into a module which uses NMLLIB.
;	  0114	! LW_EVT is in NMLEVT for now (see NMLDLW.B16).
;	  0115	! Temporary EV_ETM routine for NMLEVT to get time (until it uses NMULIB).
;	  0116	!
;	  0117	!NET:<DECNET20-V3P0.XPT>NMLDLW.B16.2  6-Jan-82 08:47:25, Edit by WEBBER
;	  0118	!
;	  0119	! Ident 06.
;	  0120	! Fix bug in DLW_CALL, getting the service state (wrong ID passed).  Also,
;	  0121	! DLW_CALL should not service a circuit if it has an undefined service state.
;	  0122	!
;	  0123	!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLDLW.B16.24 21-Oct-81 11:31:19, Edit by PECKHAM
;	  0124	!
;	  0125	! Ident 05.
;	  0126	! Send MOP_MODE_RUNNING message when we get the link.
;	  0127	!
;	  0128	!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLDLW.B16.20 13-Oct-81 22:03:44, Edit by PECKHAM
;	  0129	!
;	  0130	! Ident 04.
;	  0131	! Avoid buffering on the stack by allocating REQuest block early
;	  0132	! and using its buffers.
;	  0133	! Add substate handling.
;	  0134	!
;	  0135	!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLDLW.B16.16 12-Oct-81 10:32:34, Edit by PECKHAM
;	  0136	!
;	  0137	! Ident 03.
;	  0138	! Do not initiate service function unless SERVICE ENABLED.
;	  0139	!
;	  0140	!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLDLW.B16.14 11-Oct-81 16:43:53, Edit by PECKHAM
;	  0141	!
;	  0142	! Ident 02.
;	  0143	! Add recognition of load/dump/loop requests.
;	  0144	!
;	  0145	module NMLDLW (		                        ! Data link watcher task
;	  0146			ident = 'X00.23'
;	  0147			) =
;	  0148	begin
;	  0149	
;	  0150	!
;	  0151	!                    COPYRIGHT (c) 1980, 1981, 1982, 1985
;	  0152	!                    DIGITAL EQUIPMENT CORPORATION
;	  0153	!                        Maynard, Massachusetts
;	  0154	!
;	  0155	!     This software is furnished under a license and may  be  used
;	  0156	!     and copied only in accordance with the terms of such license
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   4
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (1)

;	  0157	!     and with the inclusion of the above copyright notice.   This
;	  0158	!     software  or any other copies thereof may not be provided or
;	  0159	!     otherwise made available to any other person.  No  title  to
;	  0160	!     and ownership of the software is hereby transferred.
;	  0161	!
;	  0162	!     The information  in  this  software  is  subject  to  change
;	  0163	!     without  notice  and should not be construed as a commitment
;	  0164	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0165	!
;	  0166	!     DIGITAL assumes no responsibility for the use or reliability
;	  0167	!     of  its  software  on  equipment  which  is  not supplied by
;	  0168	!     DIGITAL.
;	  0169	!
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   5
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (2)

;	  0170	
;	  0171	!++
;	  0172	!
;	  0173	! Facility: LSG DECnet Management
;	  0174	!
;	  0175	! Abstract: This module contains the code for the MCB
;	  0176	!           Data Link Watcher.  When a event (Class 96 + 5,
;	  0177	!           type 13) comes into the event processor, it calls
;	  0178	!           these routines to process any MOP messages.
;	  0179	!
;	  0180	! Environment: MCB
;	  0181	!
;	  0182	! Author: Steven M. Jenness	Creation date: 30-May-81
;	  0183	!
;	  0184	!--
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   6
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (3)

;	  0185	
;	  0186	!
;	  0187	! Include files
;	  0188	!
;	  0189	
;	  0190	library 'NMULIB';                       ! Get all required definitions
;	  0191	
;	  0192	!
;	  0193	! Global routines
;	  0194	!
;	  0195	
;	L 0196	%if %bliss (bliss16)
;	  0197	%then linkage NML_LKG_DB = jsr (register = 5);
;	U 0198	%else macro NML_LKG_DB = bliss36c %;
;	  0199	%fi
;	  0200	
;	  0201	forward routine
;	  0202	    NML$DLW_CALL : novalue,             ! DLW event call
;	  0203	    NML$DLW_INITIALIZE : novalue;       ! DLW task creation/initialization
;	  0204	
;	  0205	!
;	  0206	! Local routines
;	  0207	!
;	  0208	
;	  0209	forward routine
;	  0210	    DLW_TASK : novalue,                       ! Data link watcher task
;	  0211	    DLW_RUNNING : NML_LKG_DB novalue,         ! Send MOP_MODE_RUNNING message
;	  0212	    DLW_DEQUEUE : novalue,                    ! Post process load/dump response
;	  0213	    SETUP_SERVICE_BLOCK : NML_LKG_DB novalue, ! Set info in service block
;	  0214	    LOG_ABORTED_REQUEST : NML_LKG_DB novalue, ! Log "aborted service request"
;	  0215	    LOG_PASSIVE_LOOPBACK : NML_LKG_DB novalue,! Log "passive loopback"
;	  0216	    LOG_SERVICE_EVENT : NML_LKG_DB novalue,   ! Log "automatic line service"
;	  0217	    SET_SUBSTATE : NML_LKG_DB novalue;        ! Set circuit substate
;	  0218	
;	  0219	
;	  0220	!
;	  0221	! Macros
;	  0222	!
;	  0223	
;	  0224	macro
;	M 0225	     CH$$ASCIC [ ] =                     !A pointer to an ASCIC string.
;	  0226	         ch$ptr(uplit(%string(%char(%charcount(%remaining)),%remaining))) % ;
;	  0227	
;	  0228	macro
;	M 0229	     CH$BYTE [B1, B2] =
;	M 0230	         (B1
;	M 0231	          %if not %null (B2)
;	M 0232	          %then
;	M 0233	               or (B2 ^ 8)
;	  0234	          %fi) %;
;	  0235	
;	  0236	!
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   7
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (3)

;	  0237	! Literal values
;	  0238	!
;	  0239	
;	  0240	literal
;	  0241	    RESPONSE_LENGTH = 256,              ! Length of response buffer in bytes
;	  0242	    RESPONSE_SIZE = ch$allocation (RESPONSE_LENGTH,8),
;	  0243	    RESPONSE_ALLOCATION = RESPONSE_SIZE * %upval ;
;	  0244	
;	  0245	$field
;	  0246	    SB_FIELDS =
;	  0247	        set
;	  0248	        SB_BLOCK = [$sub_block (0)],
;	  0249	        SB_RESPONSE_PTR = [$pointer],
;	  0250	        SB_LINK_ID = [$short_integer],
;	  0251	        SB_ENTITY_TYPE = [$short_integer],
;	  0252	        SB_ENTITY_PTR = [$pointer],
;	  0253	        SB_SUBSTATE = [$integer],
;	  0254	        SB_SERVICE = [$integer]
;	  0255	        tes;
;	  0256	
;	  0257	literal
;	  0258	    SB_SIZE = $field_set_size;
;	  0259	
;	  0260	macro
;	  0261	    SERVICE_BLOCK = block [SB_SIZE] field (SB_FIELDS) %;
;	  0262	
;	  0263	!
;	  0264	! Circuit parameter numbers
;	  0265	!
;	  0266	
;	  0267	literal
;	  0268	    CPARM_STATE = 0,                    ! Circuit STATE
;	  0269	    CPARM_SUBSTATE = 1,                 ! Circuit SUBSTATE
;	  0270	    CPARM_SERVICE = 100;                ! Circuit SERVICE
;	  0271	
;	  0272	!
;	  0273	! Circut STATE values
;	  0274	!
;	  0275	
;	  0276	literal
;	  0277	    CIRCUIT_ON = 0,
;	  0278	    CIRCUIT_OFF = 1,
;	  0279	    CIRCUIT_SERVICE = 2,
;	  0280	    CIRCUIT_CLEARED = 3;
;	  0281	
;	  0282	!
;	  0283	! Circuit SUBSTATE values
;	  0284	!
;	  0285	
;	  0286	literal
;	  0287	    CIRCUIT_NO_SUBSTATE = -1,
;	  0288	    CIRCUIT_STARTING = 0,
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   8
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (3)

;	  0289	    CIRCUIT_REFLECTING = 1,
;	  0290	    CIRCUIT_LOOPING = 2,
;	  0291	    CIRCUIT_LOADING = 3,
;	  0292	    CIRCUIT_DUMPING = 4,
;	  0293	    CIRCUIT_TRIGGERING = 5,
;	  0294	    CIRCUIT_AUTOSERVICE = 6,
;	  0295	    CIRCUIT_AUTOLOADING = 7,
;	  0296	    CIRCUIT_AUTODUMPING = 8,
;	  0297	    CIRCUIT_AUTOTRIGGERING = 9,
;	  0298	    CIRCUIT_SYNCHRONIZING = 10,
;	  0299	    CIRCUIT_FAILED = 11;
;	  0300	
;	  0301	!
;	  0302	! Circuit SERVICE values
;	  0303	!
;	  0304	
;	  0305	literal
;	  0306	    CIRCUIT_ENABLED = 0,
;	  0307	    CIRCUIT_DISABLED = 1;
;	  0308	
;	  0309	!
;	  0310	! Own Storage
;	  0311	!
;	  0312	
;	  0313	own
;	  0314	    SERVICE_REQUEST_QUEUE : SQ_HEADER;  ! Service Request queue...
;	  0315	
;	  0316	!
;	  0317	! External routines
;	  0318	!
;	  0319	
;	  0320	external routine
;	  0321	    NMU$MEMORY_MANAGER,                 ! Memory get/release routines
;	  0322	    NML$REQUEST_MANAGER,                ! NML NICE function management
;	  0323	    NMU$SCHED_MANAGER,                  ! Scheduler
;	  0324	    NML$GET_VDB_PARAMETER,              ! Get volatile data base parameter
;	  0325	    NML$SET_VDB_PARAMETER,              ! Set volatile data base parameter
;	  0326	    NML$CLR_VDB_PARAMETER,              ! Clear volatile data base parameter
;	  0327	    NML$DECLARE_EVENT : novalue;        ! Declare event internally to NML
;	  0328	
;	  0329	external
;	  0330	    %debug_data_base;
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page   9
X00.23								26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (4)

;	  0331	
;	  0332	%global_routine ('NML$DLW_CALL', CIRCUIT_ID) : novalue =
;	  0333	
;	  0334	!++
;	  0335	! Functional description:
;	  0336	!
;	  0337	!    This routine is the main body of the Data Link Watcher task.
;	  0338	!
;	  0339	!    It is called when a "Maintenance mode message received
;	  0340	!    during normal operations" event is received by the event
;	  0341	!    processor.  The circuit id is passed to indicate which
;	  0342	!    circuit the event occured on.
;	  0343	!
;	  0344	! Formal parameters:
;	  0345	!
;	  0346	!    .CIRCUIT_ID    Byte pointer to ASCIC circuit id
;	  0347	!
;	  0348	! Routine value: none
;	  0349	!
;	  0350	!--
;	  0351	
;	  0352	    begin
;	  0353	
;	  0354	    local
;	  0355		 REQ : ref REQUEST_BLOCK;
;	  0356	
;	  0357	    !
;	  0358	    ! Allocate request block
;	  0359	    ! Allocate response buffer
;	  0360	    !
;	  0361	
;	  0362	    if (REQ = NMU$MEMORY_GET (REQUEST_BLOCK_ALLOCATION)) eqla 0
;	  0363	    then
;	  0364	        return;
;	  0365	
;	  0366	    begin
;	  0367	
;	  0368	    local
;	  0369	         NICE_PTR;                      ! Nice message pointer
;	  0370	                                        ! Allocate six extra bytes here for the
;	  0371	                                        ! possible later addition of the dump
;	  0372	                                        ! count.  The original code here
;	  0373	                                        ! allocated six bytes for the circuit
;	  0374	                                        ! entity field.  Why so much?
;	  0375	    REQ [RB_NICE_ALLOCATION] = ch$allocation (40, 8)*%upval;
;	  0376	    if (REQ [RB_NICE] = NMU$MEMORY_GET (.REQ [RB_NICE_ALLOCATION])) eqla 0
;	  0377	    then
;	  0378	        begin
;	  0379	        NMU$MEMORY_RELEASE (.REQ, REQUEST_BLOCK_ALLOCATION);
;	  0380	        return;
;	  0381	        end;
;	  0382	    NICE_PTR = REQ [RB_NICE_POINTER] = ch$ptr (.REQ [RB_NICE],, 8);
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  10
X00.23		NML$DLW_CALL as NW_CAL				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (4)

;	  0383	
;	  0384	    PUTB (0, NICE_PTR);
;	  0385	    REQ [RB_NICE_ENTITY_TYPE] = CIRCUIT_;
;	  0386	    PUTB (.REQ [RB_NICE_ENTITY_TYPE], NICE_PTR);
;	  0387	    REQ [RB_NICE_ENTITY] = .NICE_PTR;
;	  0388	    NICE_PTR = ch$move (ch$rchar (.CIRCUIT_ID) + 1, .CIRCUIT_ID, .NICE_PTR);
;	  0389	    REQ [RB_NICE_LENGTH] = NICE_PTR = ch$diff (.NICE_PTR, .REQ [RB_NICE_POINTER]);
;	  0390	    end;
;	  0391	    NMU$SQUEUE_INSERT (SERVICE_REQUEST_QUEUE, .REQ);
;	  0392	    end;					! End of NML$DLW_CALL


						.TITLE	NMLDLW
						.IDENT	/X00.23/


000000						.PSECT	$OWN$,  D  
000000					SERVICE.REQUEST.QUEUE:
						.BLKW	6


						.GLOBL	UM.RESET, UM.INITIALIZE, UM.GET
						.GLOBL	UM.RELEASE, NL.INIT, NL.RENTER
						.GLOBL	NL.REMOVE, NL.FINISH, US.CREATE
						.GLOBL	US.ABORT, US.FINI, US.COMPLETE
						.GLOBL	US.ERROR, US.INSERT, US.REMOVE
						.GLOBL	US.QRESET, US.QQINS, US.QQREM
						.GLOBL	US.QQSET, US.QQEXT, US.EVENT, US.WAIT
						.GLOBL	US.FLAG, US.SLEEP, US.CURRENT
						.GLOBL	US.DESCHEDULE, NL.VGP, NL.VSP
						.GLOBL	NL.VCP, EV.DEC, DEBUG


						.SBTTL	NW.CAL NML$DLW_CALL as NW_CAL
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			NW.CAL::JSR	R1,$SAVE2			;					0332
000004	012746  000124 				MOV	#124,-(SP)			;					0362
000010	004767  000000G				JSR	PC,UM.GET
000014	005726 					TST	(SP)+
000016	010002 					MOV	R0,R2				; *,REQ
000020	001464 					BEQ	2$				;					0364
000022	012762  000050  000032 			MOV	#50,32(R2)			; *,*(REQ)				0375
000030	012701  000024 				MOV	#24,R1				;					0376
000034	060201 					ADD	R2,R1				; REQ,*
000036	012746  000050 				MOV	#50,-(SP)
000042	004767  000000G				JSR	PC,UM.GET
000046	005726 					TST	(SP)+
000050	010011 					MOV	R0,(R1)
000052	001007 					BNE	1$
000054	010246 					MOV	R2,-(SP)			; REQ,*					0379
000056	012746  000124 				MOV	#124,-(SP)
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  11
X00.23		NML$DLW_CALL as NW_CAL				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (4)

000062	004767  000000G				JSR	PC,UM.RELEASE
000066	022626 					CMP	(SP)+,(SP)+			;					0376
000070	000207 					RTS	PC				;					0378
000072	011162  000066 			1$:	MOV	(R1),66(R2)			; *,*(REQ)				0382
000076	011101 					MOV	(R1),R1				; *,NICE.PTR
000100	105021 					CLRB	(R1)+				; NICE.PTR				0384
000102	112762  000003  000074 			MOVB	#3,74(R2)			; *,*(REQ)				0385
000110	112721  000003 				MOVB	#3,(R1)+			; *,NICE.PTR				0386
000114	010162  000102 				MOV	R1,102(R2)			; NICE.PTR,*(REQ)			0387
000120	005046 					CLR	-(SP)				;					0388
000122	117616  000012 				MOVB	@12(SP),(SP)			; CIRCUIT.ID,*
000126	005216 					INC	(SP)
000130	016646  000012 				MOV	12(SP),-(SP)			; CIRCUIT.ID,*
000134	010146 					MOV	R1,-(SP)			; NICE.PTR,*
000136	004767  000000G				JSR	PC,BL$MOV
000142	010001 					MOV	R0,R1				; *,NICE.PTR
000144	166201  000066 				SUB	66(R2),R1			; *(REQ),NICE.PTR			0389
000150	010162  000030 				MOV	R1,30(R2)			; NICE.PTR,*(REQ)
000154	012716  000000'				MOV	#SERVICE.REQUEST.QUEUE,(SP)	;					0391
000160	010246 					MOV	R2,-(SP)			; REQ,*
000162	004767  000000G				JSR	PC,US.INSERT
000166	062706  000010 				ADD	#10,SP				;					0352
000172	000207 				2$:	RTS	PC				;					0332
; Routine Size:  62 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  8 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  12
X00.23		NML$DLW_CALL as NW_CAL				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (5)

;	  0393	
;	  0394	%global_routine ('NML$DLW_INITIALIZE') : novalue =
;	  0395	
;	  0396	!++
;	  0397	! Functional description:
;	  0398	!
;	  0399	!    This routine is called at startup time to initialize the Data
;	  0400	!    Link Watcher task.
;	  0401	!
;	  0402	! Formal parameters: none
;	  0403	!
;	  0404	! Routine value: none
;	  0405	!
;	  0406	!--
;	  0407	
;	  0408	    begin
;	  0409	    NMU$SQUEUE_RESET (SERVICE_REQUEST_QUEUE);
;	  0410	    NMU$SCHED_CREATE (DLW_TASK, 200, 0, ch$asciz ('LINK-WATCHER'));
;	  0411	    end;					! End of NML$DLW_INITIALIZE



000000						.PSECT	$PLIT$,  RO ,  D  
000000	   114     111     116 		P.AAA:	.ASCII	/LIN/
000003	   113     055     127 			.ASCII	/K-W/
000006	   101     124     103 			.ASCII	/ATC/
000011	   110     105     122 			.ASCII	/HER/
000014	   000     000 				.ASCII	<00><00>


						.SBTTL	NW.INI NML$DLW_INITIALIZE as NW_INI
000174						.PSECT	$CODE$,  RO 

000000	012746  000000'			NW.INI::MOV	#SERVICE.REQUEST.QUEUE,-(SP)	;					0409
000004	004767  000000G				JSR	PC,US.QRESET
000010	012716  000000V				MOV	#DLW.TASK,(SP)			;					0410
000014	012746  000310 				MOV	#310,-(SP)
000020	005046 					CLR	-(SP)
000022	012746  000000'				MOV	#P.AAA,-(SP)
000026	004767  000000G				JSR	PC,US.CREATE
000032	062706  000010 				ADD	#10,SP				;					0408
000036	000207 					RTS	PC				;					0394
; Routine Size:  16 words,	Routine Base:  $CODE$ + 0174
; Maximum stack depth per invocation:  5 words


;	  0412	
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  13
X00.23		NML$DLW_INITIALIZE as NW_INI			26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	  0413	
;	  0414	%routine ('DLW_TASK') : novalue =
;	  0415	
;	  0416	!++
;	  0417	! Functional description:
;	  0418	!
;	  0419	!    This routine is the main body of the Data Link Watcher task.
;	  0420	!    It handles service requests queued from NML$DLW_CALL.
;	  0421	!
;	  0422	! Formal parameters: none
;	  0423	!
;	  0424	! Routine value: none
;	  0425	!
;	  0426	!--
;	  0427	
;	  0428	    begin
;	  0429	
;	  0430	    label
;	  0431	        SERVICE_TASK;
;	  0432	
;	  0433	    literal
;	  0434	        MOP_BUFFER_LENGTH = 500,
;	  0435	        MOP_BUFFER_ALLOCATION = ch$allocation (MOP_BUFFER_LENGTH, 8)*%upval;
;	  0436	
;	  0437	    local
;	  0438	        REQ : ref REQUEST_BLOCK;
;	  0439	
;	  0440	!
;	  0441	! Run this task forever (until NML dies)
;	  0442	!
;	  0443	    while $true
;	  0444	    do
;	  0445	SERVICE_TASK :
;	  0446	      begin                             ! SERVICE_TASK block
;	  0447	
;	  0448	      local
;	  0449	          SB : SERVICE_BLOCK,
;	  0450	          MOP_BUFFER_ADR,
;	  0451	          MOP_BUFFER_PTR;
;	  0452	
;	  0453	      REQ = NMU$SQUEUE_REMOVE (SERVICE_REQUEST_QUEUE);
;	  0454	
;	  0455	      REQ [RB_RESPONSE_ALLOCATION] = RESPONSE_ALLOCATION;
;	  0456	      if (REQ [RB_RESPONSE] = NMU$MEMORY_GET (.REQ [RB_RESPONSE_ALLOCATION])) eqla 0
;	  0457	      then
;	  0458	          leave SERVICE_TASK with DLW_DEQUEUE (.REQ);
;	  0459	
;	  0460	      SETUP_SERVICE_BLOCK (SB [SB_BLOCK], .REQ);
;	  0461	      ch$wchar (NICE$_SUC, .SB [SB_RESPONSE_PTR]);
;	  0462	
;	  0463	      REQ [RB_EXECUTOR] = 0;
;	  0464	      REQ [RB_COMPLETION] = DLW_DEQUEUE;
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  14
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	  0465	      REQ[RB_PRV_LOCAL] = $true;
;	  0466	      REQ[RB_PRV_SERVICE] = $true;
;	  0467	
;	  0468	      if (MOP_BUFFER_ADR = NMU$MEMORY_GET (MOP_BUFFER_ALLOCATION)) eqla 0
;	  0469	      then
;	  0470	          leave SERVICE_TASK with DLW_DEQUEUE (.REQ);
;	  0471	
;	  0472	      MOP_BUFFER_PTR = ch$ptr (.MOP_BUFFER_ADR,, 8);
;	  0473	      !
;	  0474	      ! Try to open the link.
;	  0475	      !
;	  0476	
;	  0477	      if (SB [SB_LINK_ID] = $NMU_DLX_OPEN (DLX_OTHER, .SB [SB_ENTITY_PTR], .SB [SB_RESPONSE_PTR])) gtr 0
;	  0478	      then
;	  0479	          begin
;	  0480	
;	  0481	          label
;	  0482	              AUTOSERVICE;
;	  0483	
;	  0484	AUTOSERVICE :
;	  0485	          begin                         ! AUTOSERVICE block
;	  0486	
;	  0487	          local
;	  0488	              MSG_LEN,
;	  0489	              SERVICE_DEVICE;
;	  0490	
;	  0491	          !
;	  0492	          ! If the circuit is already being serviced, then ignore.
;	  0493	          !
;	  0494	
;	  0495	          if .SB [SB_SUBSTATE] neq CIRCUIT_NO_SUBSTATE
;	  0496	          then
;	  0497	              begin
;	  0498	              DLW_DEQUEUE (.REQ);
;	  0499	              leave AUTOSERVICE;
;	  0500	              end;
;	  0501	          !
;	  0502	          ! Put the circuit in AUTOSERVICE substate
;	  0503	          !
;	  0504	          SB [SB_SUBSTATE] = CIRCUIT_AUTOSERVICE;
;	  0505	          SET_SUBSTATE (SB [SB_BLOCK]);
;	  0506	          !
;	  0507	          ! Get the service device for verification.
;	  0508	          !
;	  0509	          if not NML$GET_VDB_PARAMETER (CIRCUIT_, .SB [SB_ENTITY_PTR],
;	  0510	                                        112, SERVICE_DEVICE)
;	  0511	          then SERVICE_DEVICE = -1;
;	  0512	
;	P 0513	          $NMU_DLX_WRITE (.SB [SB_LINK_ID], DLX_OTHER,
;	P 0514	                          ch$ptr (uplit (%char(MOP_MODE_RUNNING)),, 8), 1,
;	  0515	                          .SB [SB_RESPONSE_PTR]);
;	  0516	
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  15
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	P 0517	          while (MSG_LEN = $NMU_DLX_READ (.SB [SB_LINK_ID], DLX_DATA,
;	P 0518	                                         .MOP_BUFFER_PTR, MOP_BUFFER_LENGTH,,
;	  0519	                                         .SB [SB_RESPONSE_PTR])) gtr 0
;	  0520	          do
;	  0521	
;	  0522	              selectone ch$rchar (.MOP_BUFFER_PTR) of
;	  0523	                  set
;	  0524	                  [ENTER_MOP_MODE] :    ! Enter MOP Mode
;	  0525	                      DLW_RUNNING (SB [SB_BLOCK], .MOP_BUFFER_PTR);
;	  0526	                  [REQUEST_PROGRAM] :   ! Request Program
;	  0527	                      begin
;	  0528	                      macro
;	  0529	                          DEVTYPE = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 1)) %,
;	  0530	                          MOPVER = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 2)) %,
;	  0531	                          PGMTYPE = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 3)) %;
;	  0532	
;	  0533	                      !
;	  0534	                      ! If service is not enabled, ignore this request.
;	  0535	                      !
;	  0536	
;	  0537	                      if .SB [SB_SERVICE] neq CIRCUIT_ENABLED
;	  0538	                      then
;	  0539	                          begin
;	  0540	                          DLW_DEQUEUE (.REQ);
;	  0541	                          leave AUTOSERVICE;
;	  0542	                          end;
;	  0543	
;	  0544	                      if MSG_LEN lss 4
;	  0545	                      then
;	  0546	                          ch$wchar (0, ch$plus (.MOP_BUFFER_PTR, 3));
;	  0547	
;	  0548	                      if (.SERVICE_DEVICE geq 0) and
;	  0549	                         (DEVTYPE neq .SERVICE_DEVICE)
;	  0550	                      then
;	  0551	                          begin         ! DEVTYPE does not match
;	  0552	                          LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0553	                          exitloop;
;	  0554	                          end;
;	  0555	
;	  0556	                      if MOPVER neq 1
;	  0557	                      then
;	  0558	                          begin         ! MOPVER not 1
;	  0559	                          LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0560	                          exitloop;
;	  0561	                          end;
;	  0562	
;	  0563	                      selectone PGMTYPE of
;	  0564	                          set
;	  0565	                          [0 to 2] :
;	  0566	                              ;
;	  0567	                          [otherwise] :
;	  0568	                              begin     ! PGMTYPE invalid
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  16
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	  0569	                              LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0570	                              exitloop;
;	  0571	                              end;
;	  0572	                          tes;
;	  0573	
;	  0574	                      ch$wchar (0, .SB [SB_RESPONSE_PTR]);
;	  0575	                      LOG_SERVICE_EVENT (SB [SB_BLOCK], LOAD_);
;	  0576	                      ch$wchar (LOAD_, .REQ [RB_NICE_POINTER]);
;	  0577	                      if .REQ [RB_RESPONSE] neqa 0
;	  0578	                      then NMU$MEMORY_RELEASE (.REQ [RB_RESPONSE], .REQ [RB_RESPONSE_ALLOCATION]);
;	  0579	                      NML$REQUEST_ENTER (.REQ);
;	  0580	                      leave AUTOSERVICE;
;	  0581	                      end;
;	  0582	                  [MOP_MODE_RUNNING] :  ! MOP Mode Running
;	  0583	
;	  0584	                      if .MSG_LEN neq 1
;	  0585	                      then
;	  0586	                          begin
;	  0587	                          if .MSG_LEN geq 8
;	  0588	                          then
;	  0589	                              begin
;	  0590	                              macro
;	  0591	                                  DEVTYPE = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 1)) %,
;	  0592	                                  MOPVER = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 2)) %;
;	  0593	
;	  0594	                              local
;	  0595	                                  FEATURES;
;	  0596	
;	  0597	                              !
;	  0598	                              ! If service is not enabled, ignore this request.
;	  0599	                              !
;	  0600	
;	  0601	                              if .SB [SB_SERVICE] neq CIRCUIT_ENABLED
;	  0602	                              then
;	  0603	                                  begin
;	  0604	                                  DLW_DEQUEUE (.REQ);
;	  0605	                                  leave AUTOSERVICE;
;	  0606	                                  end;
;	  0607	
;	  0608	                              if (.SERVICE_DEVICE geq 0) and
;	  0609	                                 (DEVTYPE neq .SERVICE_DEVICE)
;	  0610	                              then
;	  0611	                                  begin ! DEVTYPE does not match
;	  0612	                                  LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0613	                                  exitloop;
;	  0614	                                  end;
;	  0615	
;	  0616	                              if MOPVER neq 1
;	  0617	                              then
;	  0618	                                  begin ! MOPVER not 1
;	  0619	                                  LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0620	                                  exitloop;
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  17
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	  0621	                                  end;
;	  0622	
;	  0623	                              FEATURES = ch$rchar (ch$plus (.MOP_BUFFER_PTR, 7));
;	  0624	
;	  0625	                              if .FEATURES <1, 1>
;	  0626	                              then
;	  0627	                                  begin
;	  0628	                                  local
;	  0629	                                       NICE_PTR,
;	  0630	                                       DUMP_COUNT: THIRTY_TWO_BIT;
;	  0631	                                  ch$wchar (0, .SB [SB_RESPONSE_PTR]);
;	  0632	                                  LOG_SERVICE_EVENT (SB [SB_BLOCK], DUMP_);
;	  0633	                                  ch$wchar (DUMP_, .REQ [RB_NICE_POINTER]);
;	  0634	                                  if .REQ [RB_RESPONSE] neqa 0
;	  0635	                                  then NMU$MEMORY_RELEASE (.REQ [RB_RESPONSE], .REQ [RB_RESPONSE_ALLOCATION]);
;	  0636	                                  NICE_PTR = ch$plus (.MOP_BUFFER_PTR, 3);
;	  0637	                                  GET32 (NICE_PTR, DUMP_COUNT);
;	  0638	                                  if ((.DUMP_COUNT or .(DUMP_COUNT+2)) nequ 0) and
;	  0639	                                     (.REQ[RB_NICE] neqa 0) and
;	  0640	                                     (.REQ[RB_NICE_LENGTH] + 6 leq .REQ[RB_NICE_ALLOCATION])
;	  0641	                                  then
;	  0642	                                      begin
;	  0643	                                      NICE_PTR = ch$plus (.REQ[RB_NICE_POINTER], .REQ[RB_NICE_LENGTH]);
;	  0644	                                      PUTB (136, NICE_PTR);       ! Code for dump count
;	  0645	                                      PUTB (0, NICE_PTR);         !  rounded out to 16 bits
;	  0646	                                      PUT32 (DUMP_COUNT, NICE_PTR); ! Store the dump count
;	  0647	                                      REQ[RB_NICE_LENGTH] = .REQ[RB_NICE_LENGTH] + 6;
;	  0648	                                      end;
;	  0649	                                  NML$REQUEST_ENTER (.REQ);
;	  0650	                                  leave AUTOSERVICE;
;	  0651	                                  end;
;	  0652	
;	  0653				      exitloop;
;	  0654	                              end
;	  0655	                          else
;	  0656	                              begin
;	  0657	                              LOG_ABORTED_REQUEST (SB [SB_BLOCK], 3);
;	  0658	                              exitloop;
;	  0659	                              end;
;	  0660	                          end;
;	  0661	
;	  0662	                  [LOOPBACK_TEST] :     ! Loopback Test
;	  0663	                      begin             ! Perform passive loopback algorithm:
;	  0664	                      SB [SB_SUBSTATE] = CIRCUIT_REFLECTING;
;	  0665	                      SET_SUBSTATE (SB [SB_BLOCK]);
;	  0666	                      LOG_PASSIVE_LOOPBACK (SB [SB_BLOCK]);
;	  0667	
;	  0668	                      do
;	  0669	                          begin
;	  0670	                          ch$wchar (LOOPED_DATA, .MOP_BUFFER_PTR);
;	  0671	
;	P 0672	                          if not $NMU_DLX_WRITE (.SB [SB_LINK_ID], DLX_OTHER,
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  18
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

;	P 0673	                                                 .MOP_BUFFER_PTR, .MSG_LEN,
;	  0674	                                                 .SB [SB_RESPONSE_PTR])
;	  0675	                          then exitloop;
;	  0676	
;	P 0677	                          MSG_LEN = $NMU_DLX_READ (.SB [SB_LINK_ID], DLX_DATA,
;	P 0678	                                                   .MOP_BUFFER_PTR, MOP_BUFFER_LENGTH,,
;	  0679	                                                   .SB [SB_RESPONSE_PTR]);
;	  0680	                          if .MSG_LEN leq 0 then exitloop;
;	  0681	                          end
;	  0682	                      while ch$rchar (.MOP_BUFFER_PTR) eql LOOPBACK_TEST;
;	  0683	
;	  0684	                      SB [SB_SUBSTATE] = CIRCUIT_AUTOSERVICE;
;	  0685	                      SET_SUBSTATE (SB [SB_BLOCK]);
;	  0686	                      LOG_PASSIVE_LOOPBACK (SB [SB_BLOCK]);
;	  0687	                      if .MSG_LEN leq 0 then exitloop;
;	  0688	                      DLW_RUNNING (SB [SB_BLOCK], .MOP_BUFFER_PTR);
;	  0689	                      end;
;	  0690	                  [LOOPED_DATA] :
;	  0691	                      exitloop;
;	  0692	                  tes;
;	  0693	
;	  0694	          if .SB [SB_SUBSTATE] neq CIRCUIT_NO_SUBSTATE
;	  0695	          then
;	  0696	              begin
;	  0697	              SB [SB_SUBSTATE] = CIRCUIT_NO_SUBSTATE;
;	  0698	              SET_SUBSTATE (SB [SB_BLOCK]);
;	  0699	              end;
;	  0700	
;	  0701	          DLW_DEQUEUE (.REQ);
;	  0702	          end;                          ! AUTOSERVICE block
;	  0703	
;	  0704	          $NMU_DLX_CLOSE (.SB [SB_LINK_ID]);
;	  0705	          NMU$MEMORY_RELEASE (.MOP_BUFFER_ADR, MOP_BUFFER_ALLOCATION);
;	  0706	          end;
;	  0707	
;	  0708	      end;                              ! SERVICE_TASK block
;	  0709	
;	  0710	    end;					! End of DLW_TASK



000016						.PSECT	$PLIT$,  RO ,  D  
000016	   014     000 			P.AAB:	.ASCII	<14><00>


						.GLOBL	UD.OPEN, UD.WRITE, UD.TREAD, UD.CLOSE


						.SBTTL	DLW.TASK DLW_TASK
000234						.PSECT	$CODE$,  RO 

000000	004167  000000G			DLW.TASK:
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  19
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

						JSR	R1,$SAVE5			;					0414
000004	162706  000026 				SUB	#26,SP
000010	012746  000000'			1$:	MOV	#SERVICE.REQUEST.QUEUE,-(SP)	;					0453
000014	004767  000000G				JSR	PC,US.REMOVE
000020	010001 					MOV	R0,R1				; *,REQ
000022	012766  000036  000002 			MOV	#36,2(SP)			;					0455
000030	060166  000002 				ADD	R1,2(SP)			; REQ,*
000034	012776  000400  000002 			MOV	#400,@2(SP)
000042	012704  000026 				MOV	#26,R4				;					0456
000046	060104 					ADD	R1,R4				; REQ,*
000050	012716  000400 				MOV	#400,(SP)
000054	004767  000000G				JSR	PC,UM.GET
000060	010014 					MOV	R0,(R4)
000062	001427 					BEQ	2$				;					0458
000064	012705  000014 				MOV	#14,R5				;					0460
000070	060605 					ADD	SP,R5				; SB,*
000072	010116 					MOV	R1,(SP)				; REQ,*
000074	004767  000000V				JSR	PC,SETUP.SERVICE.BLOCK
000100	112776  000001  000014 			MOVB	#1,@14(SP)			; *,SB					0461
000106	005061  000040 				CLR	40(R1)				; *(REQ)				0463
000112	012761  000000V 000044 			MOV	#DLW.DEQUEUE,44(R1)		; *,*(REQ)				0464
000120	052761  002400  000076 			BIS	#2400,76(R1)			; *,*(REQ)				0466
000126	012716  000764 				MOV	#764,(SP)			;					0468
000132	004767  000000G				JSR	PC,UM.GET
000136	010003 					MOV	R0,R3				; *,MOP.BUFFER.ADR
000140	001005 					BNE	4$
000142	010116 				2$:	MOV	R1,(SP)				; REQ,*					0470
000144	004767  000000V				JSR	PC,DLW.DEQUEUE
000150	000167  001326 			3$:	JMP	31$
000154	010302 				4$:	MOV	R3,R2				; MOP.BUFFER.ADR,MOP.BUFFER.PTR		0472
000156	012716  000004 				MOV	#4,(SP)				;					0477
000162	016646  000022 				MOV	22(SP),-(SP)			; SB+6,*
000166	016646  000016 				MOV	16(SP),-(SP)			; SB,*
000172	004767  000000G				JSR	PC,UD.OPEN
000176	022626 					CMP	(SP)+,(SP)+
000200	010066  000016 				MOV	R0,16(SP)			; *,SB+2
000204	003761 					BLE	3$
000206	026627  000024  177777 			CMP	24(SP),#-1			; SB+10,*				0495
000214	001407 					BEQ	5$
000216	010116 					MOV	R1,(SP)				; REQ,*					0498
000220	004767  000000V				JSR	PC,DLW.DEQUEUE
000224	162706  000010 				SUB	#10,SP				;					0499
000230	000167  001220 				JMP	30$
000234	012766  000006  000024 		5$:	MOV	#6,24(SP)			; *,SB+10				0504
000242	012705  000014 				MOV	#14,R5				;					0505
000246	060605 					ADD	SP,R5				; SB,*
000250	004767  000000V				JSR	PC,SET.SUBSTATE
000254	012716  000003 				MOV	#3,(SP)				;					0509
000260	016646  000022 				MOV	22(SP),-(SP)			; SB+6,*
000264	012746  000160 				MOV	#160,-(SP)
000270	012746  000014 				MOV	#14,-(SP)
000274	060616 					ADD	SP,(SP)				; SERVICE.DEVICE,*
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  20
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

000276	004767  000000G				JSR	PC,NL.VGP
000302	062706  000006 				ADD	#6,SP
000306	006000 					ROR	R0
000310	103403 					BLO	6$
000312	012766  177777  000006 			MOV	#-1,6(SP)			; *,SERVICE.DEVICE			0511
000320	016616  000016 			6$:	MOV	16(SP),(SP)			; SB+2,*				0515
000324	012746  000004 				MOV	#4,-(SP)
000330	012746  000016'				MOV	#P.AAB,-(SP)
000334	012746  000001 				MOV	#1,-(SP)
000340	016646  000022 				MOV	22(SP),-(SP)			; SB,*
000344	004767  000000G				JSR	PC,UD.WRITE
000350	016616  000026 			7$:	MOV	26(SP),(SP)			; SB+2,*				0519
000354	012746  000006 				MOV	#6,-(SP)
000360	010246 					MOV	R2,-(SP)			; MOP.BUFFER.PTR,*
000362	012746  000764 				MOV	#764,-(SP)
000366	005046 					CLR	-(SP)
000370	016646  000034 				MOV	34(SP),-(SP)			; SB,*
000374	004767  000000G				JSR	PC,UD.TREAD
000400	062706  000012 				ADD	#12,SP
000404	010066  000014 				MOV	R0,14(SP)			; *,MSG.LEN				0517
000410	003002 					BGT	9$				;					0519
000412	000167  001000 			8$:	JMP	28$
000416	121227  000006 			9$:	CMPB	(R2),#6				; MOP.BUFFER.PTR,*			0522
000422	001002 					BNE	10$				;					0525
000424	000167  000740 				JMP	25$
000430	121227  000010 			10$:	CMPB	(R2),#10			; MOP.BUFFER.PTR,*			0522
000434	001064 					BNE	13$
000436	005766  000036 				TST	36(SP)				; SB+12					0537
000442	001076 					BNE	14$				;					0540
000444	012700  000014 				MOV	#14,R0				;					0544
000450	060600 					ADD	SP,R0				; MSG.LEN,*
000452	020027  000004 				CMP	R0,#4
000456	002002 					BGE	11$
000460	105062  000003 				CLRB	3(R2)				; *(MOP.BUFFER.PTR)			0546
000464	016600  000016 			11$:	MOV	16(SP),R0			; SERVICE.DEVICE,*			0548
000470	002405 					BLT	12$
000472	005005 					CLR	R5				;					0549
000474	156205  000001 				BISB	1(R2),R5			; *(MOP.BUFFER.PTR),*
000500	020500 					CMP	R5,R0
000502	001074 					BNE	17$				;					0552
000504	126227  000002  000001 		12$:	CMPB	2(R2),#1			; *(MOP.BUFFER.PTR),*			0556
000512	001070 					BNE	17$				;					0559
000514	005000 					CLR	R0				;					0563
000516	156200  000003 				BISB	3(R2),R0			; *(MOP.BUFFER.PTR),*
000522	005700 					TST	R0
000524	002576 					BLT	20$
000526	020027  000002 				CMP	R0,#2
000532	003173 					BGT	20$				;					0569
000534	105076  000024 				CLRB	@24(SP)				; SB					0574
000540	012705  000024 				MOV	#24,R5				;					0575
000544	060605 					ADD	SP,R5				; SB,*
000546	012716  000017 				MOV	#17,(SP)
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  21
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

000552	004767  000000V				JSR	PC,LOG.SERVICE.EVENT
000556	112771  000017  000066 			MOVB	#17,@66(R1)			; *,*(REQ)				0576
000564	005714 					TST	(R4)				;					0577
000566	001551 					BEQ	19$
000570	011416 					MOV	(R4),(SP)			;					0578
000572	017646  000012 				MOV	@12(SP),-(SP)
000576	004767  000000G				JSR	PC,UM.RELEASE
000602	005726 					TST	(SP)+
000604	000542 					BR	19$				;					0579
000606	121227  000014 			13$:	CMPB	(R2),#14			; MOP.BUFFER.PTR,*			0522
000612	001153 					BNE	21$
000614	026627  000014  000001 			CMP	14(SP),#1			; MSG.LEN,*				0584
000622	001652 					BEQ	7$
000624	026627  000014  000010 			CMP	14(SP),#10			; MSG.LEN,*				0587
000632	002533 					BLT	20$
000634	005766  000036 				TST	36(SP)				; SB+12					0601
000640	001402 				14$:	BEQ	15$				;					0604
000642	000167  000600 				JMP	29$
000646	016600  000016 			15$:	MOV	16(SP),R0			; SERVICE.DEVICE,*			0608
000652	002405 					BLT	16$
000654	005005 					CLR	R5				;					0609
000656	156205  000001 				BISB	1(R2),R5			; *(MOP.BUFFER.PTR),*
000662	020500 					CMP	R5,R0
000664	001116 					BNE	20$				;					0612
000666	126227  000002  000001 		16$:	CMPB	2(R2),#1			; *(MOP.BUFFER.PTR),*			0616
000674	001112 				17$:	BNE	20$				;					0619
000676	005000 					CLR	R0				; FEATURES				0623
000700	156200  000007 				BISB	7(R2),R0			; *(MOP.BUFFER.PTR),FEATURES
000704	032700  000002 				BIT	#2,R0				; *,FEATURES				0625
000710	001640 					BEQ	8$
000712	105076  000024 				CLRB	@24(SP)				; SB					0631
000716	012705  000024 				MOV	#24,R5				;					0632
000722	060605 					ADD	SP,R5				; SB,*
000724	012716  000020 				MOV	#20,(SP)
000730	004767  000000V				JSR	PC,LOG.SERVICE.EVENT
000734	112771  000020  000066 			MOVB	#20,@66(R1)			; *,*(REQ)				0633
000742	005714 					TST	(R4)				;					0634
000744	001406 					BEQ	18$
000746	011416 					MOV	(R4),(SP)			;					0635
000750	017646  000012 				MOV	@12(SP),-(SP)
000754	004767  000000G				JSR	PC,UM.RELEASE
000760	005726 					TST	(SP)+
000762	012705  000003 			18$:	MOV	#3,R5				; *,NICE.PTR				0636
000766	060205 					ADD	R2,R5				; MOP.BUFFER.PTR,NICE.PTR
000770	112566  000020 				MOVB	(R5)+,20(SP)			; NICE.PTR,$$GET32.VALUE		0637
000774	112566  000021 				MOVB	(R5)+,21(SP)			; NICE.PTR,$$GET32.VALUE
001000	112566  000022 				MOVB	(R5)+,22(SP)			; NICE.PTR,$$GET32.VALUE+2
001004	112566  000023 				MOVB	(R5)+,23(SP)			; NICE.PTR,$$GET32.VALUE+2
001010	016600  000020 				MOV	20(SP),R0			; DUMP.COUNT,*				0638
001014	056600  000022 				BIS	22(SP),R0			; DUMP.COUNT+2,*
001020	001434 					BEQ	19$
001022	005761  000024 				TST	24(R1)				; *(REQ)				0639
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  22
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

001026	001431 					BEQ	19$
001030	016100  000030 				MOV	30(R1),R0			; *(REQ),*				0640
001034	062700  000006 				ADD	#6,R0
001040	020061  000032 				CMP	R0,32(R1)			; *,*(REQ)
001044	003022 					BGT	19$
001046	016105  000066 				MOV	66(R1),R5			; *(REQ),NICE.PTR			0643
001052	066105  000030 				ADD	30(R1),R5			; *(REQ),NICE.PTR
001056	112725  000210 				MOVB	#210,(R5)+			; *,NICE.PTR				0644
001062	105025 					CLRB	(R5)+				; NICE.PTR				0645
001064	116625  000020 				MOVB	20(SP),(R5)+			; $$PUT32.VALUE,NICE.PTR		0646
001070	116625  000021 				MOVB	21(SP),(R5)+			; $$PUT32.VALUE,NICE.PTR
001074	116625  000022 				MOVB	22(SP),(R5)+			; $$PUT32.VALUE+2,NICE.PTR
001100	116625  000023 				MOVB	23(SP),(R5)+			; $$PUT32.VALUE+2,NICE.PTR
001104	062761  000006  000030 			ADD	#6,30(R1)			; *,*(REQ)				0647
001112	010116 				19$:	MOV	R1,(SP)				; REQ,*					0649
001114	004767  000000G				JSR	PC,NL.RENTER
001120	000555 					BR	30$				;					0650
001122	012705  000024 			20$:	MOV	#24,R5				;					0657
001126	060605 					ADD	SP,R5				; SB,*
001130	012716  000003 				MOV	#3,(SP)
001134	004767  000000V				JSR	PC,LOG.ABORTED.REQUEST
001140	000526 					BR	28$				;					0658
001142	121227  000030 			21$:	CMPB	(R2),#30			; MOP.BUFFER.PTR,*			0522
001146	001120 					BNE	27$
001150	012766  000001  000034 			MOV	#1,34(SP)			; *,SB+10				0664
001156	012705  000024 				MOV	#24,R5				;					0665
001162	060605 					ADD	SP,R5				; SB,*
001164	004767  000000V				JSR	PC,SET.SUBSTATE
001170	012705  000024 				MOV	#24,R5				;					0666
001174	060605 					ADD	SP,R5				; SB,*
001176	004767  000000V				JSR	PC,LOG.PASSIVE.LOOPBACK
001202	016605  000014 				MOV	14(SP),R5			; MSG.LEN,*				0674
001206	112712  000032 			22$:	MOVB	#32,(R2)			; *,MOP.BUFFER.PTR			0670
001212	016616  000026 				MOV	26(SP),(SP)			; SB+2,*				0674
001216	012746  000004 				MOV	#4,-(SP)
001222	010246 					MOV	R2,-(SP)			; MOP.BUFFER.PTR,*
001224	010546 					MOV	R5,-(SP)
001226	016646  000032 				MOV	32(SP),-(SP)			; SB,*
001232	004767  000000G				JSR	PC,UD.WRITE
001236	062706  000010 				ADD	#10,SP
001242	032700  000001 				BIT	#1,R0
001246	001430 					BEQ	24$
001250	016616  000026 				MOV	26(SP),(SP)			; SB+2,*				0679
001254	012746  000006 				MOV	#6,-(SP)
001260	010246 					MOV	R2,-(SP)			; MOP.BUFFER.PTR,*
001262	012746  000764 				MOV	#764,-(SP)
001266	005046 					CLR	-(SP)
001270	016646  000034 				MOV	34(SP),-(SP)			; SB,*
001274	004767  000000G				JSR	PC,UD.TREAD
001300	010066  000026 				MOV	R0,26(SP)			; *,MSG.LEN				0677
001304	010005 					MOV	R0,R5				; MSG.LEN,*				0680
001306	003003 					BGT	23$
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  23
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (6)

001310	062706  000012 				ADD	#12,SP
001314	000405 					BR	24$
001316	062706  000012 			23$:	ADD	#12,SP				;					0669
001322	121227  000030 				CMPB	(R2),#30			; MOP.BUFFER.PTR,*			0682
001326	001727 					BEQ	22$
001330	012766  000006  000034 		24$:	MOV	#6,34(SP)			; *,SB+10				0684
001336	012705  000024 				MOV	#24,R5				;					0685
001342	060605 					ADD	SP,R5				; SB,*
001344	004767  000000V				JSR	PC,SET.SUBSTATE
001350	012705  000024 				MOV	#24,R5				;					0686
001354	060605 					ADD	SP,R5				; SB,*
001356	004767  000000V				JSR	PC,LOG.PASSIVE.LOOPBACK
001362	005766  000014 				TST	14(SP)				; MSG.LEN				0687
001366	003413 					BLE	28$
001370	012705  000024 			25$:	MOV	#24,R5				;					0688
001374	060605 					ADD	SP,R5				; SB,*
001376	010216 					MOV	R2,(SP)				; MOP.BUFFER.PTR,*
001400	004767  000000V				JSR	PC,DLW.RUNNING
001404	000167  176740 			26$:	JMP	7$				;					0522
001410	121227  000032 			27$:	CMPB	(R2),#32			; MOP.BUFFER.PTR,*
001414	001373 					BNE	26$
001416	026627  000034  177777 		28$:	CMP	34(SP),#-1			; SB+10,*				0694
001424	001410 					BEQ	29$
001426	012766  177777  000034 			MOV	#-1,34(SP)			; *,SB+10				0697
001434	012705  000024 				MOV	#24,R5				;					0698
001440	060605 					ADD	SP,R5				; SB,*
001442	004767  000000V				JSR	PC,SET.SUBSTATE
001446	010116 				29$:	MOV	R1,(SP)				; REQ,*					0701
001450	004767  000000V				JSR	PC,DLW.DEQUEUE
001454	016616  000026 			30$:	MOV	26(SP),(SP)			; SB+2,*				0704
001460	004767  000000G				JSR	PC,UD.CLOSE
001464	010316 					MOV	R3,(SP)				; MOP.BUFFER.ADR,*			0705
001466	012746  000764 				MOV	#764,-(SP)
001472	004767  000000G				JSR	PC,UM.RELEASE
001476	062706  000012 				ADD	#12,SP				;					0479
001502	005726 				31$:	TST	(SP)+				;					0443
001504	000167  176300 				JMP	1$
; Routine Size:  420 words,	Routine Base:  $CODE$ + 0234
; Maximum stack depth per invocation:  28 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  24
X00.23		DLW_TASK					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (7)

;	  0711	
;	  0712	%routine ('DLW_RUNNING', SB : ref SERVICE_BLOCK, MOP_BUFFER) : NML_LKG_DB novalue =
;	  0713	
;	  0714	!++
;	  0715	! Functional description:
;	  0716	!
;	  0717	!    This routine responds to an ENTER_MOP_MODE message with a
;	  0718	!    MOP_MODE_RUNNING message.
;	  0719	!
;	  0720	! Formal parameters:
;	  0721	!
;	  0722	!    .SB           Address of service block
;	  0723	!    .MOP_BUFFER   Address of allocated MOP buffer.
;	  0724	!
;	  0725	! Routine value: none
;	  0726	!
;	  0727	!--
;	  0728	
;	  0729	    begin
;	  0730	    local
;	  0731	         MOP_PTR;
;	  0732	
;	  0733	    MOP_PTR = ch$ptr (.MOP_BUFFER,, 8);
;	  0734	    PUTB (MOP_MODE_RUNNING,MOP_PTR);    ! CODE: MOP Mode Running
;	  0735	    PUTB (20,MOP_PTR);                  ! DEVTYPE: DTE device (TEMPORARY)
;	  0736	    PUTB (1,MOP_PTR);                   ! MOPVER: format version 1
;	  0737	    PUTB (%o'000',MOP_PTR);             ! MEMSIZE: 760000 (TEMPORARY)
;	  0738	    PUTB (%o'340',MOP_PTR);
;	  0739	    PUTB (%o'003',MOP_PTR);
;	  0740	    PUTB (%o'000',MOP_PTR);
;	  0741	    PUTB (1^2,MOP_PTR);                 ! FEATURES: Loopback
;	  0742	    MOP_PTR = ch$diff (.MOP_PTR, ch$ptr (.MOP_BUFFER,, 8));
;	P 0743	    $NMU_DLX_WRITE (.SB [SB_LINK_ID], DLX_OTHER,
;	P 0744	                   ch$ptr (.MOP_BUFFER,, 8), .MOP_PTR,
;	  0745	                   .SB [SB_RESPONSE_PTR]);
;	  0746	    end;					! End of DLW_RUNNING


						.SBTTL	DLW.RUNNING DLW_RUNNING
000000	010146 				DLW.RUNNING:
						MOV	R1,-(SP)			;					0712
000002	016600  000004 				MOV	4(SP),R0			; MOP.BUFFER,*				0733
000006	010001 					MOV	R0,R1				; *,MOP.PTR
000010	112721  000014 				MOVB	#14,(R1)+			; *,MOP.PTR				0734
000014	112721  000024 				MOVB	#24,(R1)+			; *,MOP.PTR				0735
000020	112721  000001 				MOVB	#1,(R1)+			; *,MOP.PTR				0736
000024	105021 					CLRB	(R1)+				; MOP.PTR				0737
000026	112721  000340 				MOVB	#340,(R1)+			; *,MOP.PTR				0738
000032	112721  000003 				MOVB	#3,(R1)+			; *,MOP.PTR				0739
000036	105021 					CLRB	(R1)+				; MOP.PTR				0740
000040	112721  000004 				MOVB	#4,(R1)+			; *,MOP.PTR				0741
000044	160001 					SUB	R0,R1				; *,MOP.PTR				0742
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  25
X00.23		DLW_RUNNING					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (7)

000046	016546  000002 				MOV	2(R5),-(SP)			; *(SB),*				0745
000052	012746  000004 				MOV	#4,-(SP)
000056	010046 					MOV	R0,-(SP)
000060	010146 					MOV	R1,-(SP)			; MOP.PTR,*
000062	011546 					MOV	(R5),-(SP)			; SB,*
000064	004767  000000G				JSR	PC,UD.WRITE
000070	062706  000012 				ADD	#12,SP				;					0729
000074	012601 					MOV	(SP)+,R1			;					0712
000076	000207 					RTS	PC
; Routine Size:  32 words,	Routine Base:  $CODE$ + 1744
; Maximum stack depth per invocation:  7 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  26
X00.23		DLW_RUNNING					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (8)

;	  0747	
;	  0748	%routine ('DLW_DEQUEUE', REQ : ref REQUEST_BLOCK) : novalue =
;	  0749	
;	  0750	!++
;	  0751	! Functional description:
;	  0752	!
;	  0753	!    This routine processing the response from a DLW NICE function
;	  0754	!    request.  If it is a DUMP_ request it will issue the corresponding
;	  0755	!    LOAD_ request.  If it is a LOAD_ request it will set the CIRCUIT
;	  0756	!    status to the appropriate value.  It will also free up any
;	  0757	!    memory allocated for the request.
;	  0758	!
;	  0759	! Formal parameters:
;	  0760	!
;	  0761	!    .REQ    Request block address
;	  0762	!
;	  0763	! Routine value: none
;	  0764	!
;	  0765	!--
;	  0766	
;	  0767	    begin
;	  0768	    local
;	  0769	         NICE_PTR,
;	  0770	         SB : SERVICE_BLOCK;
;	  0771	
;	  0772	    SETUP_SERVICE_BLOCK (SB [SB_BLOCK], .REQ);
;	  0773	    NICE_PTR = .REQ [RB_NICE_POINTER];
;	  0774	    begin
;	  0775	
;	  0776	    local
;	  0777	        FUNCTION_CODE;
;	  0778	
;	  0779	    if (FUNCTION_CODE = ch$rchar_a (NICE_PTR)) neq 0
;	  0780	    then LOG_SERVICE_EVENT (SB [SB_BLOCK], .FUNCTION_CODE);
;	  0781	
;	  0782	!
;	  0783	! If a dump was just done .. try to do a LOAD
;	  0784	! If a load was just done .. set the circuit substate
;	  0785	!
;	  0786	
;	  0787	    if .SB [SB_SUBSTATE] eql CIRCUIT_AUTOSERVICE
;	  0788	    then
;	  0789	        if .FUNCTION_CODE eql DUMP_
;	  0790	        then
;	  0791	            begin
;	  0792	            NICE_PTR = ch$plus (.NICE_PTR, -1);
;	  0793	            ch$wchar (LOAD_, .NICE_PTR);
;	  0794	            if .REQ [RB_RESPONSE] neqa 0
;	  0795	            then NMU$MEMORY_RELEASE (.REQ [RB_RESPONSE], .REQ [RB_RESPONSE_ALLOCATION]);
;	  0796	            NML$REQUEST_ENTER (.REQ);
;	  0797	            return;
;	  0798	            end
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  27
X00.23		DLW_DEQUEUE					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (8)

;	  0799	        else
;	  0800	            begin
;	  0801	            SB [SB_SUBSTATE] = CIRCUIT_NO_SUBSTATE;
;	  0802	            SET_SUBSTATE (SB [SB_BLOCK]);
;	  0803	            end;
;	  0804	
;	  0805	    end;
;	  0806	
;	  0807	    !
;	  0808	    ! Release all memory allocated for request
;	  0809	    !
;	  0810	
;	  0811	    if .REQ [RB_RESPONSE] neqa 0
;	  0812	    then NMU$MEMORY_RELEASE (.REQ [RB_RESPONSE], .REQ [RB_RESPONSE_ALLOCATION]);
;	  0813	
;	  0814	    if .REQ [RB_NICE] neqa 0
;	  0815	    then NMU$MEMORY_RELEASE (.REQ [RB_NICE], .REQ [RB_NICE_ALLOCATION]);
;	  0816	
;	  0817	    NMU$MEMORY_RELEASE (.REQ, REQUEST_BLOCK_ALLOCATION);
;	  0818	    end;					! End of DLW_DEQUEUE


						.SBTTL	DLW.DEQUEUE DLW_DEQUEUE
000000	004167  000000G			DLW.DEQUEUE:
						JSR	R1,$SAVE5			;					0748
000004	162706  000014 				SUB	#14,SP
000010	010605 					MOV	SP,R5				; SB,*					0772
000012	016603  000032 				MOV	32(SP),R3			; REQ,*
000016	010346 					MOV	R3,-(SP)
000020	004767  000000V				JSR	PC,SETUP.SERVICE.BLOCK
000024	016301  000066 				MOV	66(R3),R1			; *,NICE.PTR				0773
000030	005002 					CLR	R2				; FUNCTION.CODE				0779
000032	152102 					BISB	(R1)+,R2			; NICE.PTR,FUNCTION.CODE
000034	005702 					TST	R2				; FUNCTION.CODE
000036	001406 					BEQ	1$
000040	012705  000002 				MOV	#2,R5				;					0780
000044	060605 					ADD	SP,R5				; SB,*
000046	010216 					MOV	R2,(SP)				; FUNCTION.CODE,*
000050	004767  000000V				JSR	PC,LOG.SERVICE.EVENT
000054	026627  000012  000006 		1$:	CMP	12(SP),#6			; SB+10,*				0787
000062	001033 					BNE	4$
000064	020227  000020 				CMP	R2,#20				; FUNCTION.CODE,*			0789
000070	001020 					BNE	3$
000072	112741  000017 				MOVB	#17,-(R1)			; *,NICE.PTR				0793
000076	016300  000026 				MOV	26(R3),R0			;					0794
000102	001406 					BEQ	2$
000104	010016 					MOV	R0,(SP)				;					0795
000106	016346  000036 				MOV	36(R3),-(SP)
000112	004767  000000G				JSR	PC,UM.RELEASE
000116	005726 					TST	(SP)+
000120	010316 				2$:	MOV	R3,(SP)				;					0796
000122	004767  000000G				JSR	PC,NL.RENTER
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  28
X00.23		DLW_DEQUEUE					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (8)

000126	005726 					TST	(SP)+				;					0789
000130	000440 					BR	7$				;					0791
000132	012766  177777  000012 		3$:	MOV	#-1,12(SP)			; *,SB+10				0801
000140	012705  000002 				MOV	#2,R5				;					0802
000144	060605 					ADD	SP,R5				; SB,*
000146	004767  000000V				JSR	PC,SET.SUBSTATE
000152	016300  000026 			4$:	MOV	26(R3),R0			;					0811
000156	001406 					BEQ	5$
000160	010016 					MOV	R0,(SP)				;					0812
000162	016346  000036 				MOV	36(R3),-(SP)
000166	004767  000000G				JSR	PC,UM.RELEASE
000172	005726 					TST	(SP)+
000174	016300  000024 			5$:	MOV	24(R3),R0			;					0814
000200	001406 					BEQ	6$
000202	010016 					MOV	R0,(SP)				;					0815
000204	016346  000032 				MOV	32(R3),-(SP)
000210	004767  000000G				JSR	PC,UM.RELEASE
000214	005726 					TST	(SP)+
000216	010316 				6$:	MOV	R3,(SP)				;					0817
000220	012746  000124 				MOV	#124,-(SP)
000224	004767  000000G				JSR	PC,UM.RELEASE
000230	022626 					CMP	(SP)+,(SP)+			;					0767
000232	062706  000014 			7$:	ADD	#14,SP				;					0748
000236	000207 					RTS	PC
; Routine Size:  80 words,	Routine Base:  $CODE$ + 2044
; Maximum stack depth per invocation:  15 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  29
X00.23		DLW_DEQUEUE					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (9)

;	  0819	
;	  0820	%routine ('SETUP_SERVICE_BLOCK', SB : ref SERVICE_BLOCK, REQ : ref REQUEST_BLOCK) : NML_LKG_DB novalue =
;	  0821	
;	  0822	!++
;	  0823	! Functional description:
;	  0824	!
;	  0825	!    This routine sets up pertinent information from the request block into
;	  0826	!    the internal service block.
;	  0827	!
;	  0828	! Formal parameters:
;	  0829	!
;	  0830	!    .SB     Service block
;	  0831	!    .REQ    Request block
;	  0832	!
;	  0833	! Routine value: none
;	  0834	!
;	  0835	!--
;	  0836	
;	  0837	    begin
;	  0838	    SB [SB_RESPONSE_PTR] = ch$ptr (.REQ [RB_RESPONSE],, 8);
;	  0839	    SB [SB_ENTITY_TYPE] = .REQ [RB_NICE_ENTITY_TYPE];
;	  0840	    SB [SB_ENTITY_PTR] = .REQ [RB_NICE_ENTITY];
;	  0841	
;	  0842	    if not NML$GET_VDB_PARAMETER (.SB [SB_ENTITY_TYPE], .SB [SB_ENTITY_PTR],
;	  0843	                                  CPARM_SUBSTATE, SB [SB_SUBSTATE])
;	  0844	    then SB [SB_SUBSTATE] = CIRCUIT_NO_SUBSTATE;
;	  0845	
;	  0846	    if not NML$GET_VDB_PARAMETER (CIRCUIT_, .SB [SB_ENTITY_PTR],
;	  0847	                                  CPARM_SERVICE, SB [SB_SERVICE])
;	  0848	    then SB [SB_SERVICE] = CIRCUIT_DISABLED;
;	  0849	                                  
;	  0850	    end;					! End of SETUP_SERVICE_BLOCK


						.SBTTL	SETUP.SERVICE.BLOCK SETUP_SERVICE_BLOCK
000000	010146 				SETUP.SERVICE.BLOCK:
						MOV	R1,-(SP)			;					0820
000002	016600  000004 				MOV	4(SP),R0			; REQ,*					0838
000006	016015  000026 				MOV	26(R0),(R5)			; *,SB
000012	116065  000074  000004 			MOVB	74(R0),4(R5)			; *,*(SB)				0839
000020	105065  000005 				CLRB	5(R5)				; *(SB)
000024	012701  000006 				MOV	#6,R1				;					0840
000030	060501 					ADD	R5,R1				; SB,*
000032	016011  000102 				MOV	102(R0),(R1)
000036	016546  000004 				MOV	4(R5),-(SP)			; *(SB),*				0842
000042	011146 					MOV	(R1),-(SP)
000044	012746  000001 				MOV	#1,-(SP)
000050	012746  000010 				MOV	#10,-(SP)			;					0843
000054	060516 					ADD	R5,(SP)				; SB,*
000056	004767  000000G				JSR	PC,NL.VGP			;					0842
000062	062706  000010 				ADD	#10,SP
000066	006000 					ROR	R0
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  30
X00.23		SETUP_SERVICE_BLOCK				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (9)

000070	103403 					BLO	1$
000072	012765  177777  000010 			MOV	#-1,10(R5)			; *,*(SB)				0844
000100	012746  000003 			1$:	MOV	#3,-(SP)			;					0846
000104	011146 					MOV	(R1),-(SP)
000106	012746  000144 				MOV	#144,-(SP)
000112	012746  000012 				MOV	#12,-(SP)			;					0847
000116	060516 					ADD	R5,(SP)				; SB,*
000120	004767  000000G				JSR	PC,NL.VGP			;					0846
000124	062706  000010 				ADD	#10,SP
000130	006000 					ROR	R0
000132	103403 					BLO	2$
000134	012765  000001  000012 			MOV	#1,12(R5)			; *,*(SB)				0848
000142	012601 				2$:	MOV	(SP)+,R1			;					0820
000144	000207 					RTS	PC
; Routine Size:  51 words,	Routine Base:  $CODE$ + 2304
; Maximum stack depth per invocation:  6 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  31
X00.23		SETUP_SERVICE_BLOCK				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (10)

;	  0851	
;	  0852	%routine ('LOG_ABORTED_REQUEST', SB : ref SERVICE_BLOCK, REASON) : NML_LKG_DB novalue =
;	  0853	
;	  0854	!++
;	  0855	! Functional description:
;	  0856	!
;	  0857	!    This routine initiates an "aborted service request" event
;	  0858	!    for the specified entity.
;	  0859	!
;	  0860	! Formal parameters:
;	  0861	!
;	  0862	!    SB            Service block
;	  0863	!    .REASON       REASON code parameter value
;	  0864	!
;	  0865	! Routine value: none
;	  0866	!
;	  0867	!--
;	  0868	
;	  0869	    begin
;	  0870	
;	  0871	    local
;	  0872	        DATA : vector [ch$allocation (4, 8)],
;	  0873	        DATA_PTR;
;	  0874	
;	  0875	    DATA_PTR = ch$ptr (DATA,, 8);
;	  0876	    begin                               ! Parameter #3
;	  0877	
;	  0878	    literal
;	  0879	        DATA_ID = 0^15 + 3,
;	  0880	        DATA_TYPE = 1^7 + 0^6 + 1;
;	  0881	
;	  0882	    ch$wchar_a (DATA_ID and %o'377', DATA_PTR);
;	  0883	    ch$wchar_a (DATA_ID^-8 and %o'377', DATA_PTR);
;	  0884	    ch$wchar_a (DATA_TYPE, DATA_PTR);
;	  0885	    ch$wchar_a (.REASON, DATA_PTR);
;	  0886	    end;
;	  0887	    begin
;	  0888	
;	  0889	    local
;	  0890	        REB : RAW_EVENT_BLOCK;
;	  0891	
;	  0892	    REB [REB_EVENT_CODE] = 0^6 + 7;
;	  0893	    REB [REB_ENTITY_TYPE] = .SB [SB_ENTITY_TYPE];
;	  0894	    REB [REB_ENTITY_POINTER] = .SB [SB_ENTITY_PTR];
;	  0895	    REB [REB_DATA_POINTER] = ch$ptr (DATA,, 8);
;	  0896	    REB [REB_DATA_LENGTH] = ch$diff (.DATA_PTR, ch$ptr (DATA,, 8));
;	  0897	    REB [REB_TIME_BLOCK] = 0;
;	  0898	    NML$DECLARE_EVENT (REB);
;	  0899	    end;
;	  0900	    end;					! End of LOG_ABORTED_REQUEST
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  32
X00.23		LOG_ABORTED_REQUEST				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (10)

						.SBTTL	LOG.ABORTED.REQUEST LOG_ABORTED_REQUEST
000000	010546 				LOG.ABORTED.REQUEST:
						MOV	R5,-(SP)			;					0852
000002	162706  000024 				SUB	#24,SP
000006	012700  000020 				MOV	#20,R0				; *,DATA.PTR				0875
000012	060600 					ADD	SP,R0				; DATA,DATA.PTR
000014	112720  000003 				MOVB	#3,(R0)+			; *,DATA.PTR				0882
000020	105020 					CLRB	(R0)+				; DATA.PTR				0883
000022	112720  000201 				MOVB	#201,(R0)+			; *,DATA.PTR				0884
000026	116620  000030 				MOVB	30(SP),(R0)+			; REASON,DATA.PTR			0885
000032	012766  000007  000010 			MOV	#7,10(SP)			; *,REB+10				0892
000040	016566  000004  000014 			MOV	4(R5),14(SP)			; *(SB),REB+14				0893
000046	016516  000006 				MOV	6(R5),(SP)			; *(SB),REB				0894
000052	012766  000020  000004 			MOV	#20,4(SP)			; *,REB+4				0895
000060	060666  000004 				ADD	SP,4(SP)			; DATA,REB+4
000064	012705  000020 				MOV	#20,R5				;					0896
000070	060605 					ADD	SP,R5				; DATA,*
000072	010066  000006 				MOV	R0,6(SP)			; DATA.PTR,REB+6
000076	160566  000006 				SUB	R5,6(SP)			; *,REB+6
000102	005066  000016 				CLR	16(SP)				; REB+16				0897
000106	012746  000002 				MOV	#2,-(SP)			;					0898
000112	060616 					ADD	SP,(SP)				; REB,*
000114	004767  000000G				JSR	PC,EV.DEC
000120	062706  000026 				ADD	#26,SP				;					0852
000124	012605 					MOV	(SP)+,R5
000126	000207 					RTS	PC
; Routine Size:  44 words,	Routine Base:  $CODE$ + 2452
; Maximum stack depth per invocation:  13 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  33
X00.23		LOG_ABORTED_REQUEST				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (11)

;	  0901	
;	  0902	%routine ('LOG_PASSIVE_LOOPBACK', SB : ref SERVICE_BLOCK) : NML_LKG_DB novalue =
;	  0903	
;	  0904	!++
;	  0905	! Functional description:
;	  0906	!
;	  0907	!    This routine
;	  0908	!
;	  0909	! Formal parameters:
;	  0910	!
;	  0911	!    STATUS = (INITIATED, TERMINATED)
;	  0912	!
;	  0913	! Routine value: none
;	  0914	!
;	  0915	!--
;	  0916	
;	  0917	    begin
;	  0918	
;	  0919	    literal
;	  0920	        DATA_ID = 0^15 + 2,
;	  0921	        DATA_TYPE = 1^7 + 0^6 + 1,
;	  0922	        INITIATED = 0,
;	  0923	        TERMINATED = 1;
;	  0924	
;	  0925	    bind
;	  0926	        DATA_LEN = 4,
;	P 0927	        INITIATED_PTR = ch$ptr (uplit (ch$byte (
;	P 0928	            (DATA_ID and %o'377'),
;	P 0929	            (DATA_ID^-8 and %o'377'),
;	P 0930	            DATA_TYPE,
;	  0931	            INITIATED)),, 8),
;	P 0932	        TERMINATED_PTR = ch$ptr (uplit (ch$byte (
;	P 0933	            (DATA_ID and %o'377'),
;	P 0934	            (DATA_ID^-8 and %o'377'),
;	P 0935	            DATA_TYPE,
;	  0936	            TERMINATED)),, 8);
;	  0937	
;	  0938	    local
;	  0939	        REB : RAW_EVENT_BLOCK;
;	  0940	
;	  0941	    REB [REB_EVENT_CODE] = 0^6 + 6;
;	  0942	    REB [REB_ENTITY_TYPE] = .SB [SB_ENTITY_TYPE];
;	  0943	    REB [REB_ENTITY_POINTER] = .SB [SB_ENTITY_PTR];
;	  0944	
;	  0945	    if .SB [SB_SUBSTATE] eql CIRCUIT_REFLECTING
;	  0946	    then
;	  0947	        REB [REB_DATA_POINTER] = INITIATED_PTR
;	  0948	    else
;	  0949	        REB [REB_DATA_POINTER] = TERMINATED_PTR;
;	  0950	
;	  0951	    REB [REB_DATA_LENGTH] = DATA_LEN;
;	  0952	    REB [REB_TIME_BLOCK] = 0;
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  34
X00.23		LOG_PASSIVE_LOOPBACK				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (11)

;	  0953	    NML$DECLARE_EVENT (REB);
;	  0954	    end;					! End of LOG_PASSIVE_LOOPBACK



000020						.PSECT	$PLIT$,  RO ,  D  
000020	000002 				P.AAC:	.WORD	2
000022	000201 					.WORD	201
000024	000002 				P.AAD:	.WORD	2
000026	000601 					.WORD	601


	000004 				DATA.LEN=	    4
	000020'				INITIATED.PTR=	    P.AAC
	000024'				TERMINATED.PTR=     P.AAD


						.SBTTL	LOG.PASSIVE.LOOPBACK LOG_PASSIVE_LOOPBACK
002602						.PSECT	$CODE$,  RO 

000000	162706  000016 			LOG.PASSIVE.LOOPBACK:
						SUB	#16,SP				;					0902
000004	011766  000006 				MOV	(PC),6(SP)			; *,REB+10				0941
000010	016566  000004  000012 			MOV	4(R5),12(SP)			; *(SB),REB+14				0942
000016	016546  000006 				MOV	6(R5),-(SP)			; *(SB),REB				0943
000022	026527  000010  000001 			CMP	10(R5),#1			; *(SB),*				0945
000030	001004 					BNE	1$
000032	012766  000020' 000004 			MOV	#INITIATED.PTR,4(SP)		; *,REB+4				0947
000040	000403 					BR	2$				;					0945
000042	012766  000024' 000004 		1$:	MOV	#TERMINATED.PTR,4(SP)		; *,REB+4				0949
000050	012766  000004  000006 		2$:	MOV	#4,6(SP)			; *,REB+6				0951
000056	005066  000016 				CLR	16(SP)				; REB+16				0952
000062	012746  000002 				MOV	#2,-(SP)			;					0953
000066	060616 					ADD	SP,(SP)				; REB,*
000070	004767  000000G				JSR	PC,EV.DEC
000074	062706  000022 				ADD	#22,SP				;					0902
000100	000207 					RTS	PC
; Routine Size:  33 words,	Routine Base:  $CODE$ + 2602
; Maximum stack depth per invocation:  10 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  35
X00.23		LOG_PASSIVE_LOOPBACK				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (12)

;	  0955	
;	  0956	%routine ('LOG_SERVICE_EVENT', SB : ref SERVICE_BLOCK, FUNC_CODE) : NML_LKG_DB novalue =
;	  0957	
;	  0958	!++
;	  0959	! Functional description:
;	  0960	!
;	  0961	!    This routine initiates an "automatic line service" event
;	  0962	!    for the specified entity.
;	  0963	!
;	  0964	! Formal parameters:
;	  0965	!
;	  0966	!    SB            Service block
;	  0967	!    .FUNC_CODE    Function code (LOAD_, DUMP_)
;	  0968	!
;	  0969	! Routine value: none
;	  0970	!
;	  0971	!--
;	  0972	
;	  0973	    begin
;	  0974	
;	  0975	    local
;	  0976	        DATA : vector [ch$allocation (86, 8)],
;	  0977	        DATA_PTR;
;	  0978	
;	  0979	    DATA_PTR = ch$ptr (DATA,, 8);
;	  0980	    begin                               ! Parameter #0
;	  0981	
;	  0982	    literal
;	  0983	        DATA_ID = 0^15 + 0,
;	  0984	        DATA_TYPE = 1^7 + 0^6 + 1;
;	  0985	
;	  0986	    ch$wchar_a (DATA_ID and %o'377', DATA_PTR);
;	  0987	    ch$wchar_a (DATA_ID^-8 and %o'377', DATA_PTR);
;	  0988	    ch$wchar_a (DATA_TYPE, DATA_PTR);
;	  0989	    ch$wchar_a ((if .FUNC_CODE eql LOAD_ then 0 else 1), DATA_PTR);
;	  0990	    end;
;	  0991	    begin                               ! Parameter #1
;	  0992	
;	  0993	    literal
;	  0994	        DATA_ID = 0^15 + 1,
;	  0995	        AI_DATA_TYPE = 0^7 + 1^6,
;	  0996	        C_1_DATA_TYPE = 1^7 + 0^6 + 1,
;	  0997	        C_2_DATA_TYPE = 1^7 + 0^6 + 2,
;	  0998	        CM_1_DATA_TYPE = 1^7 + 1^6 + 1,
;	  0999	        CM_2_DATA_TYPE = 1^7 + 1^6 + 2,
;	  1000	        CM_3_DATA_TYPE = 1^7 + 1^6 + 3;
;	  1001	
;	  1002	    local
;	  1003	        CM_PTR,
;	  1004	        RESP_PTR;
;	  1005	
;	  1006	    RESP_PTR = .SB [SB_RESPONSE_PTR];
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  36
X00.23		LOG_SERVICE_EVENT				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (12)

;	  1007	    ch$wchar_a (DATA_ID and %o'377', DATA_PTR);
;	  1008	    ch$wchar_a (DATA_ID^-8 and %o'377', DATA_PTR);
;	  1009	    CM_PTR = .DATA_PTR;
;	  1010	    ch$wchar_a (CM_1_DATA_TYPE, DATA_PTR);
;	  1011	    ch$wchar_a (C_1_DATA_TYPE, DATA_PTR);
;	  1012	    ch$wchar_a (ch$rchar (.RESP_PTR), DATA_PTR);
;	  1013	
;	  1014	    if ch$rchar_a (RESP_PTR) gtr 127
;	  1015	    then
;	  1016	        begin
;	  1017	
;	  1018	        local
;	  1019	            LEN;
;	  1020	
;	  1021	        ch$wchar (CM_2_DATA_TYPE, .CM_PTR);
;	  1022	        ch$wchar_a (C_2_DATA_TYPE, DATA_PTR);
;	  1023	        ch$wchar_a (ch$rchar_a (RESP_PTR), DATA_PTR);
;	  1024	        ch$wchar_a (ch$rchar_a (RESP_PTR), DATA_PTR);
;	  1025	
;	  1026	        if (LEN = ch$rchar_a (RESP_PTR)) neq 0
;	  1027	        then
;	  1028	            begin
;	  1029	            LEN = min (.LEN, 72);
;	  1030	            ch$wchar (CM_3_DATA_TYPE, .CM_PTR);
;	  1031	            ch$wchar_a (AI_DATA_TYPE, DATA_PTR);
;	  1032	            ch$wchar_a (.LEN, DATA_PTR);
;	  1033	            DATA_PTR = ch$move (.LEN, .RESP_PTR, .DATA_PTR);
;	  1034	            end;
;	  1035	
;	  1036	        end;
;	  1037	
;	  1038	    end;
;	  1039	    begin
;	  1040	
;	  1041	    local
;	  1042	        REB : RAW_EVENT_BLOCK;
;	  1043	
;	  1044	    REB [REB_EVENT_CODE] = 0^6 + 3;
;	  1045	    REB [REB_ENTITY_TYPE] = .SB [SB_ENTITY_TYPE];
;	  1046	    REB [REB_ENTITY_POINTER] = .SB [SB_ENTITY_PTR];
;	  1047	    REB [REB_DATA_POINTER] = ch$ptr (DATA,, 8);
;	  1048	    REB [REB_DATA_LENGTH] = ch$diff (.DATA_PTR, ch$ptr (DATA,, 8));
;	  1049	    REB [REB_TIME_BLOCK] = 0;
;	  1050	    NML$DECLARE_EVENT (REB);
;	  1051	    end;
;	  1052	    end;					! End of LOG_SERVICE_EVENT


						.SBTTL	LOG.SERVICE.EVENT LOG_SERVICE_EVENT
000000	004167  000000G			LOG.SERVICE.EVENT:
						JSR	R1,$SAVE4			;					0956
000004	162706  000146 				SUB	#146,SP
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  37
X00.23		LOG_SERVICE_EVENT				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (12)

000010	012703  000020 				MOV	#20,R3				; *,DATA.PTR				0979
000014	060603 					ADD	SP,R3				; DATA,DATA.PTR
000016	105023 					CLRB	(R3)+				; DATA.PTR				0986
000020	105023 					CLRB	(R3)+				; DATA.PTR				0987
000022	112723  000201 				MOVB	#201,(R3)+			; *,DATA.PTR				0988
000026	026627  000162  000017 			CMP	162(SP),#17			; FUNC.CODE,*				0989
000034	001002 					BNE	1$
000036	005000 					CLR	R0
000040	000402 					BR	2$
000042	012700  000001 			1$:	MOV	#1,R0
000046	110023 				2$:	MOVB	R0,(R3)+			; *,DATA.PTR
000050	011504 					MOV	(R5),R4				; SB,RESP.PTR				1006
000052	112723  000001 				MOVB	#1,(R3)+			; *,DATA.PTR				1007
000056	105023 					CLRB	(R3)+				; DATA.PTR				1008
000060	010302 					MOV	R3,R2				; DATA.PTR,CM.PTR			1009
000062	112723  000301 				MOVB	#301,(R3)+			; *,DATA.PTR				1010
000066	112723  000201 				MOVB	#201,(R3)+			; *,DATA.PTR				1011
000072	112423 					MOVB	(R4)+,(R3)+			; RESP.PTR,DATA.PTR			1012
000074	126427  177777  000177 			CMPB	-1(R4),#177			; *(RESP.PTR),*				1014
000102	101436 					BLOS	4$
000104	112712  000302 				MOVB	#302,(R2)			; *,CM.PTR				1021
000110	112723  000202 				MOVB	#202,(R3)+			; *,DATA.PTR				1022
000114	112423 					MOVB	(R4)+,(R3)+			; RESP.PTR,DATA.PTR			1023
000116	112423 					MOVB	(R4)+,(R3)+			; RESP.PTR,DATA.PTR			1024
000120	005001 					CLR	R1				; LEN					1026
000122	152401 					BISB	(R4)+,R1			; RESP.PTR,LEN
000124	005701 					TST	R1				; LEN
000126	001424 					BEQ	4$
000130	010100 					MOV	R1,R0				; LEN,*					1029
000132	020027  000110 				CMP	R0,#110
000136	003402 					BLE	3$
000140	012700  000110 				MOV	#110,R0
000144	010001 				3$:	MOV	R0,R1				; *,LEN
000146	112712  000303 				MOVB	#303,(R2)			; *,CM.PTR				1030
000152	112723  000100 				MOVB	#100,(R3)+			; *,DATA.PTR				1031
000156	110123 					MOVB	R1,(R3)+			; LEN,DATA.PTR				1032
000160	010146 					MOV	R1,-(SP)			; LEN,*					1033
000162	010446 					MOV	R4,-(SP)			; RESP.PTR,*
000164	010346 					MOV	R3,-(SP)			; DATA.PTR,*
000166	004767  000000G				JSR	PC,BL$MOV
000172	010003 					MOV	R0,R3				; *,DATA.PTR
000174	062706  000006 				ADD	#6,SP				;					1028
000200	012766  000003  000010 		4$:	MOV	#3,10(SP)			; *,REB+10				1044
000206	016566  000004  000014 			MOV	4(R5),14(SP)			; *(SB),REB+14				1045
000214	016516  000006 				MOV	6(R5),(SP)			; *(SB),REB				1046
000220	012766  000020  000004 			MOV	#20,4(SP)			; *,REB+4				1047
000226	060666  000004 				ADD	SP,4(SP)			; DATA,REB+4
000232	012700  000020 				MOV	#20,R0				;					1048
000236	060600 					ADD	SP,R0				; DATA,*
000240	010366  000006 				MOV	R3,6(SP)			; DATA.PTR,REB+6
000244	160066  000006 				SUB	R0,6(SP)			; *,REB+6
000250	005066  000016 				CLR	16(SP)				; REB+16				1049
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  38
X00.23		LOG_SERVICE_EVENT				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (12)

000254	012746  000002 				MOV	#2,-(SP)			;					1050
000260	060616 					ADD	SP,(SP)				; REB,*
000262	004767  000000G				JSR	PC,EV.DEC
000266	062706  000150 				ADD	#150,SP				;					0956
000272	000207 					RTS	PC
; Routine Size:  94 words,	Routine Base:  $CODE$ + 2704
; Maximum stack depth per invocation:  60 words
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  39
X00.23		LOG_SERVICE_EVENT				26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (13)

;	  1053	
;	  1054	%routine ('SET_SUBSTATE', SB : ref SERVICE_BLOCK) : NML_LKG_DB novalue =
;	  1055	
;	  1056	!++
;	  1057	! Functional description:
;	  1058	!
;	  1059	!    This routine
;	  1060	!
;	  1061	! Formal parameters:
;	  1062	!
;	  1063	!    .SB     Service block
;	  1064	!
;	  1065	! Routine value: none
;	  1066	!
;	  1067	!--
;	  1068	
;	  1069	    begin
;	  1070	
;	  1071	    if .SB [SB_SUBSTATE] neq CIRCUIT_NO_SUBSTATE
;	  1072	    then
;	  1073	        NML$SET_VDB_PARAMETER (.SB [SB_ENTITY_TYPE], .SB [SB_ENTITY_PTR],
;	  1074	                               CPARM_SUBSTATE,
;	  1075	                               SB [SB_SUBSTATE])
;	  1076	    else
;	  1077	        NML$CLR_VDB_PARAMETER (.SB [SB_ENTITY_TYPE], .SB [SB_ENTITY_PTR],
;	  1078	                               CPARM_SUBSTATE);
;	  1079	                                  
;	  1080	    end;					! End of SET_SUBSTATE


						.SBTTL	SET.SUBSTATE SET_SUBSTATE
000000	026527  000010  177777 		SET.SUBSTATE:
						CMP	10(R5),#-1			; *(SB),*				1071
000006	001415 					BEQ	1$
000010	016546  000004 				MOV	4(R5),-(SP)			; *(SB),*				1073
000014	016546  000006 				MOV	6(R5),-(SP)			; *(SB),*
000020	012746  000001 				MOV	#1,-(SP)
000024	012746  000010 				MOV	#10,-(SP)			;					1075
000030	060516 					ADD	R5,(SP)				; SB,*
000032	004767  000000G				JSR	PC,NL.VSP			;					1073
000036	005726 					TST	(SP)+
000040	000410 					BR	2$				;					1071
000042	016546  000004 			1$:	MOV	4(R5),-(SP)			; *(SB),*				1077
000046	016546  000006 				MOV	6(R5),-(SP)			; *(SB),*
000052	012746  000001 				MOV	#1,-(SP)
000056	004767  000000G				JSR	PC,NL.VCP
000062	062706  000006 			2$:	ADD	#6,SP				;					1069
000066	000207 					RTS	PC				;					1054
; Routine Size:  28 words,	Routine Base:  $CODE$ + 3200
; Maximum stack depth per invocation:  5 words

;	  1081	
NMLDLW								24-May-1985 13:21:45	TOPS-20 Bliss-16 2A(530)	    Page  40
X00.23		SET_SUBSTATE					26-Nov-1984 15:12:10	DNET61:<MCB.NML>NMLDLW.B16.1 (13)

;	  1082	end                                     ! End of NMLDLW
;	  1083	eludom



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


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $OWN$				    6	    RW ,  D  ,  LCL,  REL,  CON
;	 $CODE$				  860	    RO ,  I  ,  LCL,  REL,  CON
;	 $PLIT$				   12	    RO ,  D  ,  LCL,  REL,  CON




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





;	  1084	! Local Modes:
;	  1085	! Mode:Bliss
;	  1086	! Comment Start:!
;	  1087	! Comment Column:40
;	  1088	! Comment Rounding:+1
;	  1089	! Auto Save Mode:2
;	  1090	! End:
; Size:		860 code + 18 data words
; Run Time:	00:17.2
; Elapsed Time:	00:24.8
; Memory Used:	91 pages
; Compilation Complete
AI_DATA_TYPE			 995#	1031
AUTOSERVICE			 482	 484	 499	 541	 580	 605	 650
B1				 229	 230
B2				 229	 231	 233
BLISS16				 196
CH$$ASCIC			 225#
CH$ASCIZ			 410
CH$BYTE				 229#	 927	 932
CH$WCHAR			 461	 546	 574	 576	 631	 633	 670	 793	1021	1030
CIRCUIT_			 385	 509	 846
CIRCUIT_AUTODUMPING		 296#
CIRCUIT_AUTOLOADING		 295#
CIRCUIT_AUTOSERVICE		 294#	 504	 684	 787
CIRCUIT_AUTOTRIGGERING		 297#
CIRCUIT_CLEARED			 280#
CIRCUIT_DISABLED		 307#	 848
CIRCUIT_DUMPING			 292#
CIRCUIT_ENABLED			 306#	 537	 601
CIRCUIT_FAILED			 299#
CIRCUIT_ID			 332	 388
CIRCUIT_LOADING			 291#
CIRCUIT_LOOPING			 290#
CIRCUIT_NO_SUBSTATE		 287#	 495	 694	 697	 801	 844	1071
CIRCUIT_OFF			 278#
CIRCUIT_ON			 277#
CIRCUIT_REFLECTING		 289#	 664	 945
CIRCUIT_SERVICE			 279#
CIRCUIT_STARTING		 288#
CIRCUIT_SYNCHRONIZING		 298#
CIRCUIT_TRIGGERING		 293#
CM_1_DATA_TYPE			 998#	1010
CM_2_DATA_TYPE			 999#	1021
CM_3_DATA_TYPE			1000#	1030
CM_PTR				1003	1009#	1021	1030
CPARM_SERVICE			 270#	 847
CPARM_STATE			 268#
CPARM_SUBSTATE			 269#	 843	1074	1078
C_1_DATA_TYPE			 996#	1011
C_2_DATA_TYPE			 997#	1022
DATA				 872	 875	 895	 896	 976	 979	1047	1048
DATA_ID				 879#	 882	 883	 920#	 928	 929	 933	 934	 983#	 986	 987	 994#
				1007	1008
DATA_LEN			 926#	 951
DATA_PTR			 873	 875#	 882	 883	 884	 885	 896	 977	 979#	 986	 987	 988
				 989	1007	1008	1009	1010	1011	1012	1022	1023	1024	1031	1032
				1033#	1048
DATA_TYPE			 880#	 884	 921#	 930	 935	 984#	 988
DEVTYPE				 529#	 549	 591#	 609
DLW_DEQUEUE			 212	 458	 464	 470	 498	 540	 604	 701
DLW_RUNNING			 211	 525	 688
DLW_TASK			 210	 410
DLX_DATA			 517	 677
DLX_OTHER			 477	 513	 672	 743
DUMP_COUNT			 630	 637	 638	 646
DUMP_				 632	 633	 789
ENTER_MOP_MODE			 524
FEATURES			 595	 623#	 625
FUNCTION_CODE			 777	 779#	 780	 789
FUNC_CODE			 956	 989
GET32				 637
INITIATED			 922#	 931
INITIATED_PTR			 927#	 947
LEN				1019	1026#	1029#	1032	1033
LOAD_				 575	 576	 793	 989
LOG_ABORTED_REQUEST		 214	 552	 559	 569	 612	 619	 657
LOG_PASSIVE_LOOPBACK		 215	 666	 686
LOG_SERVICE_EVENT		 216	 575	 632	 780
LOOPBACK_TEST			 662	 682
LOOPED_DATA			 670	 690
MOPVER				 530#	 556	 592#	 616
MOP_BUFFER_ADR			 450	 468#	 472	 705
MOP_BUFFER_ALLOCATION		 435#	 468	 705
MOP_BUFFER_LENGTH		 434#	 435	 518	 678
MOP_BUFFER_PTR			 451	 472#	 518	 522	 525	 529	 530	 531	 546	 591	 592	 623
				 636	 670	 673	 678	 682	 688
MOP_BUFFER			 712	 733	 742	 744
MOP_MODE_RUNNING		 514	 582	 734
MOP_PTR				 731	 733#	 734	 735	 736	 737	 738	 739	 740	 741	 742#	 744
MSG_LEN				 488	 517#	 544	 584	 587	 673	 677#	 680	 687
NICE$_SUC			 461
NICE_PTR			 369	 382#	 384	 386	 387	 388#	 389#	 629	 636#	 637	 643#	 644
				 645	 646	 769	 773#	 779	 792#	 793
NML$CLR_VDB_PARAMETER		 326	1077
NML$DECLARE_EVENT		 327	 898	 953	1050
NML$DLW_CALL			 202
NML$DLW_INITIALIZE		 203
NML$GET_VDB_PARAMETER		 324	 509	 842	 846
NML$REQUEST_ENTER		 579	 649	 796
NML$REQUEST_MANAGER		 322
NML$SET_VDB_PARAMETER		 325	1073
NMLDLW				 145#
NML_LKG_DB			 197#	 198#	 211	 213	 214	 215	 216	 217	 712#	 820#	 852#	 902#
				 956#	1054#
NMU$MEMORY_GET			 362	 376	 456	 468
NMU$MEMORY_MANAGER		 321*
NMU$MEMORY_RELEASE		 379	 578	 635	 705	 795	 812	 815	 817
NMU$SCHED_CREATE		 410
NMU$SCHED_MANAGER		 323
NMU$SQUEUE_INSERT		 391
NMU$SQUEUE_REMOVE		 453
NMU$SQUEUE_RESET		 409
PGMTYPE				 531#	 563
PUT32				 646
PUTB				 384	 386	 644	 645	 734	 735	 736	 737	 738	 739	 740	 741
RAW_EVENT_BLOCK			 890	 939	1042
RB_COMPLETION			 464
RB_EXECUTOR			 463
RB_NICE				 376	 382	 639	 814	 815
RB_NICE_ALLOCATION		 375	 376	 640	 815
RB_NICE_ENTITY			 387	 840
RB_NICE_ENTITY_TYPE		 385	 386	 839
RB_NICE_LENGTH			 389	 640	 643	 647
RB_NICE_POINTER			 382	 389	 576	 633	 643	 773
RB_PRV_LOCAL			 465
RB_PRV_SERVICE			 466
RB_RESPONSE			 456	 577	 578	 634	 635	 794	 795	 811	 812	 838
RB_RESPONSE_ALLOCATION		 455	 456	 578	 635	 795	 812
REASON				 852	 885
REB				 890	 892#	 893#	 894#	 895#	 896#	 897#	 898	 939	 941#	 942#	 943#
				 947#	 949#	 951#	 952#	 953	1042	1044#	1045#	1046#	1047#	1048#	1049#
				1050
REB_DATA_LENGTH			 896	 951	1048
REB_DATA_POINTER		 895	 947	 949	1047
REB_ENTITY_POINTER		 894	 943	1046
REB_ENTITY_TYPE			 893	 942	1045
REB_EVENT_CODE			 892	 941	1044
REB_TIME_BLOCK			 897	 952	1049
REQ				 355	 362#	 375#	 376#	 379	 382#	 385#	 386	 387#	 389#	 391	 438
				 453#	 455#	 456#	 458	 460	 463#	 464#	 465#	 466#	 470	 498	 540
				 576	 577	 578	 579	 604	 633	 634	 635	 639	 640	 643	 647#
				 649	 701	 748	 772	 773	 794	 795	 796	 811	 812	 814	 815
				 817	 820	 838	 839	 840
REQUEST_BLOCK			 355	 438	 748	 820
REQUEST_BLOCK_ALLOCATION	 362	 379	 817
REQUEST_PROGRAM			 526
RESPONSE_ALLOCATION		 243#	 455
RESPONSE_LENGTH			 241#	 242
RESPONSE_SIZE			 242#	 243
RESP_PTR			1004	1006#	1012	1014	1023	1024	1026	1033
SB				 449	 460	 461	 477#	 495	 504#	 505	 509	 513	 515	 517	 519
				 525	 537	 552	 559	 569	 574	 575	 601	 612	 619	 631	 632
				 657	 664#	 665	 666	 672	 674	 677	 679	 684#	 685	 686	 688
				 694	 697#	 698	 704	 712	 743	 745	 770	 772	 780	 787	 801#
				 802	 820	 838#	 839#	 840#	 842	 843	 844#	 846	 847	 848#	 852
				 893	 894	 902	 942	 943	 945	 956	1006	1045	1046	1054	1071
				1073	1075	1077
SB_BLOCK			 248#	 460	 505	 525	 552	 559	 569	 575	 612	 619	 632	 657
				 665	 666	 685	 686	 688	 698	 772	 780	 802
SB_ENTITY_PTR			 252#	 477	 509	 840	 842	 846	 894	 943	1046	1073	1077
SB_ENTITY_TYPE			 251#	 839	 842	 893	 942	1045	1073	1077
SB_FIELDS			 246#	 261
SB_LINK_ID			 250#	 477	 513	 517	 672	 677	 704	 743
SB_RESPONSE_PTR			 249#	 461	 477	 515	 519	 574	 631	 674	 679	 745	 838	1006
SB_SERVICE			 254#	 537	 601	 847	 848
SB_SIZE				 258#	 261
SB_SUBSTATE			 253#	 495	 504	 664	 684	 694	 697	 787	 801	 843	 844	 945
				1071	1075
SERVICE_BLOCK			 261#	 449	 712	 770	 820	 852	 902	 956	1054
SERVICE_DEVICE			 489	 510	 511#	 548	 549	 608	 609
SERVICE_REQUEST_QUEUE		 314	 391	 409	 453
SERVICE_TASK			 431	 445	 458	 470
SETUP_SERVICE_BLOCK		 213	 460	 772
SET_SUBSTATE			 217	 505	 665	 685	 698	 802
SQ_HEADER			 314
TERMINATED_PTR			 932#	 949
TERMINATED			 923#	 936
THIRTY_TWO_BIT			 630
$FIELD				 245
$FIELD_SET_SIZE			 258
$INTEGER			 253	 254
$NMU_DLX_CLOSE			 704
$NMU_DLX_OPEN			 477
$NMU_DLX_READ			 517	 677
$NMU_DLX_WRITE			 513	 672	 743
$POINTER			 249	 252
$SHORT_INTEGER			 250	 251
$SUB_BLOCK			 248
$TRUE				 443	 465	 466
%DEBUG_DATA_BASE		 330
%GLOBAL_ROUTINE			 332#	 394#
%REMAINING			 226
%ROUTINE			 414#	 712	 748#	 820	 852	 902	 956	1054