Google
 

Trailing-Edge - PDP-10 Archives - TOPS-20_V6.1_DECnetSrc_7-23-85 - mcb/xpt/tlilin.lst
There is 1 other file named tlilin.lst in the archive. Click here to see a list.
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   1
								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0001	module TLILIN	(
;	  0002			IDENT = 'X01650'
;	  0003			) =
;	  0004	begin
;	  0005	
;	  0006	!
;	  0007	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0008	!                    DIGITAL EQUIPMENT CORPORATION
;	  0009	!                        Maynard, Massachusetts
;	  0010	!
;	  0011	!     This software is furnished under a license and may  be  used
;	  0012	!     and copied only in accordance with the terms of such license
;	  0013	!     and with the inclusion of the above copyright notice.   This
;	  0014	!     software  or any other copies thereof may not be provided or
;	  0015	!     otherwise made available to any other person.  No  title  to
;	  0016	!     and ownership of the software is hereby transferred.
;	  0017	!
;	  0018	!     The information  in  this  software  is  subject  to  change
;	  0019	!     without  notice  and should not be construed as a commitment
;	  0020	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0021	!
;	  0022	!     DIGITAL assumes no responsibility for the use or reliability
;	  0023	!     of  its  software  on  equipment  which  is  not supplied by
;	  0024	!     DIGITAL.
;	  0025	!
;	  0026	
;	  0027	!++
;	  0028	! FACILITY:	Transport
;	  0029	!
;	  0030	! ABSTRACT:
;	  0031	!
;	  0032	!	Line Support module for Transport Line Interface: handles all
;	  0033	!	changes in circuit state, brings circuit up and down.
;	  0034	!
;	  0035	! ENVIRONMENT:	MCB
;	  0036	!
;	  0037	! AUTHOR: L. Webber , CREATION DATE: 23-Jul-79
;	  0038	!
;	  0039	! MODIFIED BY:
;	  0040	!
;	  0041	!	L. Webber, 23-Jul-79 : VERSION 01
;	  0042	!
;	  0043	! 1.01	26-Oct-79, L. Webber
;	  0044	!	Modified to allocate all its own buffers
;	  0045	!
;	  0046	! 1.02	19-Dec-79, L. Webber
;	  0047	!	Modifications to break out Transport Line Interface into its
;	  0048	!	own process
;	  0049	!
;	  0050	! 1.03	3-Jan-80, L. Webber
;	  0051	!	Remove the OT state
;	  0052	!
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   2
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0053	! 1.04	2-Apr-80, L. Webber
;	  0054	!	Modify to support node and line sub-data-bases
;	  0055	!
;	  0056	! 1.05	16-May-80, L. Webber
;	  0057	!	Convert LIX to/from line index
;	  0058	!
;	  0059	! 1.06	30-Jun-80, L. Webber
;	  0060	!	Modify to use MCBLIB macros
;	  0061	!
;	  0062	! 1.07	A. Peckham, 15-Oct-80
;	  0063	!	Update to use new function modifiers.
;	  0064	!
;	  0065	! 1.08  L. Webber, 20-Nov-80
;	  0066	!	Put in DTE detection for TOPS-20 adjacent nodes.
;	  0067	!
;	  0068	! 1.09	L. Webber, 11-Dec-80
;	  0069	!	Modify to support MCB 3.1
;	  0070	!
;	  0071	! 1.10	L. Webber, 12-Jan-80
;	  0072	!	Make INI_LIN and TERM_LIN linkages CALL$; return Network
;	  0073	!	Management codes for the two functions.
;	  0074	!
;	  0075	! 1.11	L. Webber, 27-Feb-81
;	  0076	!	Fix bug in TI processing: if a bad message is received, return
;	  0077	!	the message to the DLL.
;	  0078	!
;	  0079	! 1.12	L. Webber, 17-Mar-81
;	  0080	!	Make all fetch references to LINEstate UNSAFE, so that they
;	  0081	!	always cause the data base to be re-referenced.
;	  0082	!
;	  0083	! 1.13	L. Webber, 26-Mar-81
;	  0084	!	Put Phase II DLL block size into Node Init; make segment size the
;	  0085	!	same.
;	  0086	!
;	  0087	! 1.14	L. Webber, 27-Mar-81
;	  0088	!	Add reason code to event logging data
;	  0089	!
;	  0090	! 1.15	L. Webber, 1-Apr-81
;	  0091	!	Fix LINE_FAIL linkage to include modifier; this is only necessary
;	  0092	!	to humor the Test Bed, and adds no code.
;	  0093	!
;	  0094	! 1.16	L. Webber, 1-Apr-81
;	  0095	!	Fix so that RCV_TI and RCV_OTI reject initialization on remote
;	  0096	!	blksize LARGER than local, not smaller.
;	  0097	!
;	  0098	! 1.17	L. Webber, 6-Apr-81
;	  0099	!	Add code for initialization timer.
;	  0100	!
;	  0101	! 1.18	L. Webber, 10-Apr-81
;	  0102	!	Release node ID block on line down (for Phase II nodes).
;	  0103	!
;	  0104	! 1.19	L. Webber, 13-Apr-81
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   3
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0105	!	Fix mapping bug in RCV_OTI
;	  0106	!
;	  0107	! 1.20	L. Webber, 1-May-81
;	  0108	!	Fix LINTIM to put LIX into CCB gotten and dispatched.
;	  0109	!
;	  0110	! 1.21	L. Webber, 27-May-81
;	  0111	!	Modify to support the new DLL Interface.  This is a major modification.
;	  0112	!	Some of the changes involved are:
;	  0113	!
;	  0114	!	o  The $DLL_REQUEST_CIRCUIT and $DLL_RELEASE_CIRCUIT functions to
;	  0115	!	   the DLL have been introduced.  These functions are queued functions
;	  0116	!	   (they use CCBs).
;	  0117	!	o  "Start" and "stop" have been replaced by $DLL_INITIALIZE and
;	  0118	!	   $DLL_STOP.  These functions are queued functions.
;	  0119	!	o  Because it is not necessary to stop a running circuit before doing
;	  0120	!	   a $DLL_INITIALIZE, the DP state has been eliminated.
;	  0121	!	o  TLI now monitors the DLL circuit state by means of state change AST
;	  0122	!	   CCBs from the DLL.  These state changes trigger many of the
;	  0123	!	   Transport line events once triggered by CCB completions.
;	  0124	!	o  The circuit identification over the DLL Interface has been simpli-
;	  0125	!	   fied.  The circuit is always identified to the DLL by "provider
;	  0126	!	   PIX"; this quantity is set in LINEindex by the Network Management
;	  0127	!	   code prior to TLI being invoked.  The Transport identification for
;	  0128	!	   the circuit, the index of the circuit's entry in the line data base,
;	  0129	!	   is passed to the DLL by $DLL_REQUEST_CIRCUIT and to Network Manage-
;	  0130	!	   ment by the Transport Network Management code; any subsequent calls
;	  0131	!	   to Transport about the circuit uses the Transport ID.  LIXxlate has
;	  0132	!	   been eliminated.  The index of a circuit's data base entry may be
;	  0133	!	   found in the LINEnumber field in the entry.
;	  0134	!
;	  0135	! 1.22	L. Webber, 27-May-81
;	  0136	!	Fix LINEDN so that a running line that goes down loses its node type
;	  0137	!	immediately.
;	  0138	!
;	  0139	! 1.23	L. Webber, 28-May-81
;	  0140	!	Put a canned password in the send OTV code.
;	  0141	!
;	  0142	! 1.24	L. Webber, 1-Jun-81
;	  0143	!	Modify all LOG_EVENT calls to pass the NMXid.
;	  0144	!
;	  0145	! 1.25	L. Webber, 3-Jun-81
;	  0146	!	Zero out link field when CCB_CMP removes a CCB from LINEccb.
;	  0147	!
;	  0148	! 1.26	L. Webber, 19-Jun-81
;	  0149	!	When a REQUEST_CIRCUIT completes, do a LINE_EVENT with the returned
;	  0150	!	status.
;	  0151	!
;	  0152	! 1.27	L. Webber, 22-Jun-81
;	  0153	!	Fix bug in REQ_COMPLETE which was saving the returned CCB in LINEevent
;	  0154	!	without noticing there was already one there.
;	  0155	!
;	  0156	! 1.28	L. Webber, 22-Jun-81
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   4
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0157	!	Change all $DLRCE's to straight $MCB_SCHEDULE_CCB's
;	  0158	!
;	  0159	! 1.29	L. Webber, 30-Jun-81
;	  0160	!	Fix REQUEST_CIRCUIT to get the provider PIX out of the line data base,
;	  0161	!	not the function CCB.
;	  0162	!
;	  0163	! 1.30	L. Webber, 23-Jul-81
;	  0164	!	Fix LINE_EVENT and REQUEST_CIRCUIT to distinguish whether the circuit
;	  0165	!	is ON or OFF.
;	  0166	!
;	  0167	! 1.31	L. Webber, 3-Aug-81
;	  0168	!	Fix resource retry for FUNCreini to bring the line down if it is
;	  0169	!	running.
;	  0170	!
;	  0171	! 1.32	L. Webber, 5-Aug-81
;	  0172	!	Fix LINE_EVENT so that two successive RUNNING state notifications
;	  0173	!	won't cause a SIGNAL_STOP.
;	  0174	!
;	  0175	! 1.33	L. Webber, 12-Aug-81
;	  0176	!	Finish up fix 1.32; a RUNNING can even occur in DT state.
;	  0177	!
;	  0178	! 1.34	L. Webber, 12-Aug-81
;	  0179	!	Fix LINE_EVENT so that it logs events on transient/persistent errors
;	  0180	!	UNLESS it's an entry to MOP, not IF.
;	  0181	!
;	  0182	! 1.35	L. Webber, 19-Aug-81
;	  0183	!	Fix LINE_EVENT so that a state transition to SYNCHRONIZING or RUNNING
;	  0184	!	causes a $DLL_STOP to be (re-)issued.
;	  0185	!
;	  0186	! 1.36	L. Webber, 20-Aug-81
;	  0187	!	Fix LINE_EVENT not to change the line state on a transient error, but
;	  0188	!	to wait for the DLL state change notification.
;	  0189	!
;	  0190	! 1.37	L. Webber, 20-Aug-81
;	  0191	!	Fix SEND_TV to put in the (null) function value.
;	  0192	!
;	  0193	! 1.38	L. Webber, 8-Sep-81
;	  0194	!	Fix REQ_COMPLETE not to initialize the circuit unless Network
;	  0195	!	Management has set it ON.
;	  0196	!
;	  0197	! 1.39	L. Webber, 10-Sep-81
;	  0198	!	Fix INI_LIN always to set the circuit state to DS when it wants to
;	  0199	!	initialize the circuit, even if it can't get the buffer to do the
;	  0200	!	initialization.  This allows the circuit to be brought up with only
;	  0201	!	one buffer.
;	  0202	!
;	  0203	! 1.40	L. Webber, 11-Sep-81
;	  0204	!	Create the macro SAVSDB, which normally would just put a buffer
;	  0205	!	address into LINEevent.  Currently, because of scarceness of buffers,
;	  0206	!	it releases the buffer.
;	  0207	!
;	  0208	! 1.41	L. Webber, 15-Sep-81
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   5
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0209	!	Fix RCV_OTI so that it doesn't clear LINEevent when LINEevent contains
;	  0210	!	a restart code.
;	  0211	!
;	  0212	! 1.42	A. Peckham, 21-Sep-81
;	  0213	!	Change transient and persistent error response strategy in LINE_EVENT.
;	  0214	!
;	  0215	! 1.43	L. Webber, 24-Sep-81
;	  0216	!	Modify event logging to use new macros for building the event buffer.
;	  0217	!
;	  0218	! 1.44	L. Webber, 2-Oct-81
;	  0219	!	Fix transient error processing so that, when it reinitializes the
;	  0220	!	circuit, it sets the state to DS.
;	  0221	!
;	  0222	! 1.45	A. Peckham, 6-Oct-81
;	  0223	!	Only re-initialize line on WARNING status codes in LINE_EVENT.
;	  0224	!
;	  0225	! 1.46	L. Webber, 20-Oct-81
;	  0226	!	Add a "Reset" line flag to communicate to Decision that a circuit being
;	  0227	!	taken down had a Phase II node adjacent.  This is because it is
;	  0228	!	necessary to zero out the node type immediately.
;	  0229	!
;	  0230	! 1.47	L. Webber, 28-Oct-81
;	  0231	!	Fix the transient/permanent error processing to declare a running
;	  0232	!	circuit down instead of just restarting it.
;	  0233	!
;	  0234	! 1.48	L. Webber, 29-Oct-81
;	  0235	!	Add code to "pause" a circuit for a few seconds after bringing it
;	  0236	!	down, before bringing it back up or closing it down for good.
;	  0237	!
;	  0238	! 1.49	L. Webber, 4-Nov-81
;	  0239	!	Fix dot bug in 1.48.
;	  0240	!
;	  0241	! 1.50	L. Webber, 5-Nov-81
;	  0242	!	Take out 1.48; it didn't help anything.
;	  0243	!
;	  0244	! 1.51	L. Webber, 4-Jan-82
;	  0245	!	Release the CTL/STP CCB when it comes back from the provider in
;	  0246	!	    REL_CMP.
;	  0247	!	Zero out FNC/MOD in CCB GETCCB gets (for debugging).
;	  0248	!
;	  0249	! 1.52	L. Webber, 12-Jan-82
;	  0250	!	Fix a dot bug in RCV_TV.
;	  0251	!
;	  0252	! 1.53	L. Webber, 12-Mar-82
;	  0253	!	Fix RCV_TI to get a CCB to declare the circut up, rather than waiting
;	  0254	!	for the TI transmit to complete (it may already have done so).
;	  0255	!
;	  0256	! 1.54	L. Webber, 22-Mar-82
;	  0257	!	Add support for the Ph2Circuit circuit type.  This circuit will only
;	  0258	!	talk to Phase II nodes.
;	  0259	!
;	  0260	! 1.55	A. Peckham, 19-Apr-82
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   6
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (1)

;	  0261	!	Eliminate references to LOG_EVENT, GETLINE.
;	  0262	!       Work on INILIN to count down its own timers.
;	  0263	!
;	  0264	! 1.56	A. Peckham, 6-May-82
;	  0265	!	Eliminate references to RLS_BLK, GET_BLK.
;	  0266	!
;	  0267	! 1.57	A. Peckham, 2-Jul-82
;	  0268	!	Rework line handling.
;	  0269	!       Add false node-init code, but do not enable.
;	  0270	!
;	  0271	! 1.58	A. Peckham, 6-Jul-82
;	  0272	!	Utilize new XPT data base for initialization passwords.
;	  0273	!
;	  0274	! 1.59	A. Peckham, 8-Jul-82
;	  0275	!       Start initialization clock after TI is transmitted, instead of
;	  0276	!	DLL_RUNNING transition.  More work on password data base.
;	  0277	!       Rename RCV_OTI to RCV_NI.
;	  0278	!
;	  0279	! 1.60	A. Peckham, 23-Aug-82
;	  0280	!       Fix bug in RCV_NI which caused the DN20 to recognize only KLs
;	  0281	!       with even node numbers.  On the node number, bit 0 instead of bit 7
;	  0282	!       was being tested for the node number extension.
;	  0283	!
;	  0284	! 1.61	A. Peckham, 10-Sep-82
;	  0285	!       Add mechanism for getting initial circuit cost from DLL layer:
;	  0286	!         LINRVR: Zero out C_PRM1 before sending $DLL_REQUEST_CIRCUIT.
;	  0287	!         CCPSTR: If Lcv is zero, move C_PRM1 to Lcv, and if that is zero,
;	  0288	!                 set it to one.
;	  0289	!
;	  0290	! 1.62	A. Peckham, 13-Sep-82
;	  0291	!       Maintain Block_size in RCV_NI and RCV_TI.
;	  0292	!
;	  0293	! 1.63	A. Peckham,  4-Oct-82
;	  0294	!       Do not check user-ECO field of TI message in RCV_TI.
;	  0295	!
;	  0296	! 1.64	A. Peckham,  5-Dec-82
;	  0297	!       Acomodate RSX bug in RCV_TI by not verifying full TI length.
;	  0298	!
;	  0299	! 1.65  D. Brannon,  22-Sep-83
;	  0300	!	Correct the Data Link blocksize check for the TI message
;	  0301	!	in RCV_TI.
;	  0302	!
;	  0303	!--
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   7
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (2)

;	  0304	
;	  0305	!
;	  0306	! INCLUDE FILES:
;	  0307	!
;	  0308	
;	  0309	require 'XPTMAC';
;	  0407	
;	  0408	!
;	  0409	! TABLE OF CONTENTS
;	  0410	!
;	L 0411	%if %bliss(bliss16)
;	  0412	%then linkage TLI_LKG_LINEb_CCB = jsr (register = 5, register = 4),
;	  0413	              TLI_LKG_LINEb_FNC = jsr (register = 5, register = 0);
;	U 0414	%else macro TLI_LKG_LINEb_CCB = bliss36c %,
;	U 0415	            TLI_LKG_LINEb_FNC = bliss36c %;
;	  0416	%fi
;	  0417	
;	  0418	forward routine
;	  0419	    BAD_MSG: LINKAGE_DB_CCB novalue,
;	  0420	    CCB_CMP: LINKAGE_DB novalue,
;	  0421	    CCPSTP: MCB_DB_CCB novalue,
;	  0422	    CCPSTR: MCB_DB_CCB novalue,
;	  0423	    CIRCUIT_DOWN: LINKAGE_DB novalue,
;	  0424	    CIRCUIT_STATE: LINKAGE_DB_CCB novalue,
;	  0425	    CIRCUIT_UP: LINKAGE_DB novalue,
;	  0426	    CKTOFF: LINKAGE_DB_CCB novalue,
;	  0427	    CKTON: LINKAGE_DB_CCB novalue,
;	  0428	    GET_FALSE_NI: LINKAGE_DB_CCB novalue,
;	  0429	    GET_PWDb,
;	  0430	    INI_LIN: CALL$ novalue,
;	  0431	    LD_CMP: MCB_DB_CCB novalue,
;	  0432	    LINRVR: LINKAGE_DB novalue,
;	  0433	    LOG_PACKET_HEADER: LINKAGE_DB_CCB novalue,
;	  0434	    LU_CMP: MCB_DB_CCB novalue,
;	  0435	    NEW_FUNCTION: TLI_LKG_LINEb_FNC novalue,
;	  0436	    NEW_STATE: TLI_LKG_LINEb_FNC novalue,
;	  0437	    NEXT_ACTION: LINKAGE_DB novalue,
;	  0438	    NEXT_STATE: TLI_LKG_LINEb_FNC novalue,
;	  0439	    RCV_HLO: LINKAGE_DB_CCB novalue,
;	  0440	    RCV_NI: LINKAGE_DB_CCB novalue,
;	  0441	    RCV_NV: LINKAGE_DB_CCB novalue,
;	  0442	    RCV_TI: LINKAGE_DB_CCB novalue,
;	  0443	    RCV_TV: LINKAGE_DB_CCB novalue,
;	  0444	    TERM_LIN: CALL$ novalue,
;	  0445	    TLIAST: LINKAGE_DB_CCB_MOD novalue,
;	  0446	    XCPDAT: MCB_DB_CCB novalue,
;	  0447	    XCPINI: MCB_DB_CCB novalue,
;	  0448	    XCPSTP: MCB_DB_CCB novalue;
;	  0449	
;	  0450	!
;	  0451	! MACROS:
;	  0452	!
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   8
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (2)

;	  0453	
;	M 0454	macro RAD50(NAME) =
;	M 0455	    %IF %BLISS(BLISS16) %THEN %rad50_11
;	M 0456	    %ELSE %IF %BLISS(BLISS36) %THEN %rad50_10
;	M 0457	    %FI %FI
;	  0458	    %string(NAME) %;
;	  0459	
;	  0460	!
;	  0461	! EQUATED SYMBOLS:
;	  0462	!
;	  0463	
;	  0464	!
;	  0465	! OWN STORAGE:
;	  0466	!
;	  0467	
;	  0468	!
;	  0469	! EXTERNAL REFERENCES:
;	  0470	!
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page   9
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

;	  0471	global routine BAD_MSG (LINEb,CCB,CODE): LINKAGE_DB_CCB novalue =
;	  0472	
;	  0473	!++
;	  0474	! FUNCTIONAL DESCRIPTION:
;	  0475	!
;	  0476	!  Processes an invalid message.  In any part of the initialization
;	  0477	!  sequence where the DLL has been started, this event will cause the
;	  0478	!  initialization sequence to be restarted (or started from the RU state).
;	  0479	!  In the rest of the initialization sequence and all of the termination
;	  0480	!  sequence, the event is ignored.
;	  0481	!
;	  0482	! FORMAL PARAMETERS
;	  0483	!
;	  0484	!	LINEb	Address of data base entry for the circuit over which the
;	  0485	!		bad message was received
;	  0486	!
;	  0487	!       CCB	CCB pointing to bad message.  This parameter is
;	  0488	!		meaningful for reason codes 1-8.
;	  0489	!
;	  0490	!	CODE	Reason message is bad:
;	  0491	!
;	  0492	!		0	None of this routine's business
;	  0493	!		1	Unexpected TI or TV when circuit is up
;	  0494	!		2	Unexpected message during initialization
;	  0495	!		3	Version skew
;	  0496	!		4	Out-of-range or invalid node ID
;	  0497	!		5	Invalid remote blocksize
;	  0498	!		6	Invalid verification seed in TI
;	  0499	!		7	Format error
;	  0500	!		8	Verification reject
;	  0501	!               9	Resource failure during initialization
;	  0502	!
;	  0503	! IMPLICIT INPUTS
;	  0504	!
;	  0505	!	LINEstate
;	  0506	!
;	  0507	! ROUTINE VALUE:
;	  0508	! COMPLETION CODES:
;	  0509	!
;	  0510	!	NONE.
;	  0511	!
;	  0512	! SIDE EFFECTS:
;	  0513	!
;	  0514	!	May commence or restart initialization.
;	  0515	!
;	  0516	!--
;	  0517	
;	  0518	begin
;	  0519	map CCB: ref block field(C_XPT_fields);
;	  0520	require 'XPTSYM';
;	  0557	bind REASON = uplit(!	DNA "reason"	CODE parameter
;	  0558	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  10
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

;	  0559				0,		!	0
;	  0560				2,		!	1
;	  0561				2,		!	2
;	  0562				6,		!	3
;	  0563				7,		!	4
;	  0564				8,		!	5
;	  0565				9,		!	6
;	  0566				2,		!	7
;	  0567				0,		!	8
;	  0568				0):		!	9
;	  0569		      vector;
;	  0570	local PTR,RET;
;	  0571	
;	  0572	if .CODE eql 0 then return;
;	  0573	
;	  0574	PTR = .CCB[C_ADDR];
;	  0575	
;	  0576	!
;	  0577	! Log an event
;	  0578	!
;	  0579	
;	  0580	$NM_LOG_BEGIN();
;	  0581	
;	  0582	case .CODE from 1 to 9 of		! Fill event buffer and determine code
;	  0583	set
;	  0584	
;	  0585	[1]:		begin			! Unexpected TI or TV, running circuit:
;	  0586	    RET = 4^6+$XPT$E_LSF;
;	  0587	    COUNTER_INCREMENT(LINEb,XPTlinedn); !   increment circuit failure counter
;	  0588	    LOG_PACKET_HEADER(.LINEb,.CCB);	!   move packet hdr into event buffer
;	  0589	    PARAMETER_C_1(5,REASON[.CODE]);	!   log the reason code
;	  0590			end;
;	  0591	
;	  0592	[2]:		begin			! Unexpected message while initializing
;	  0593	    RET = 4^6+$XPT$E_ISF;
;	  0594	    COUNTER_INCREMENT(LINEb,XPTini_fail);!  increment init. failure counter
;	  0595	    LOG_PACKET_HEADER(.LINEb,.CCB);	!   move packet hdr into event buffer
;	  0596	    PARAMETER_C_1(5,REASON[.CODE]);	!   log the reason code
;	  0597			end;
;	  0598	
;	  0599	[3 to 6]:	begin			! Version skew, out-of-range/invalid
;	  0600	    local VALUE;			! node ID, invalid remote blocksize,
;	  0601	    pointer P;				! or invalid verification seed:
;	  0602	    P = ch$plus(.PTR,6);		!
;	  0603	    RET = 4^6+$XPT$E_IOF;
;	  0604	    COUNTER_INCREMENT(LINEb,XPTini_fail);!  increment init. failure counter,
;	  0605	    LOG_PACKET_HEADER(.LINEb,.CCB);	!   move packet hdr into event buffer
;	  0606	    if .CODE eql 3 then begin		!   packet header
;	  0607		PARAMETER_CM(6,3);		!   and the version
;	  0608		VALUE = getb(P);		!   (if needed)
;	  0609		PARAMETER_DU_1(,VALUE);		!
;	  0610		VALUE = getb(P);
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  11
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

;	  0611		PARAMETER_DU_1(,VALUE);
;	  0612		VALUE = getb(P);
;	  0613		PARAMETER_DU_1(,VALUE);
;	  0614		end;
;	  0615	    PARAMETER_C_1(5,REASON[.CODE]);	!   log the reason code
;	  0616			end;
;	  0617	
;	  0618	[7]:		begin			! Format error:
;	  0619	    RET = 4^6+$XPT$E_FMT;
;	  0620	    COUNTER_INCREMENT(XPTDB,XPTfmt_loss);!  increment format loss counter
;	  0621	    LOG_PACKET_HEADER(.LINEb,.CCB);	!   move packet hdr into event buffer
;	  0622	    PARAMETER_C_1(5,REASON[.CODE]);	!   log the reason code
;	  0623			end;
;	  0624	
;	  0625	[8]:		begin			! Verification reject:
;	  0626	    local VALUE;
;	  0627	    pointer P;
;	  0628	    P = ch$plus(.PTR,1);
;	  0629	    RET = 4^6+$XPT$E_VER;
;	  0630	    COUNTER_INCREMENT(XPTDB,XPTver_rej);!  increment verification counter
;	  0631	    PARAMETER_CM(3,1);			!   and move in
;	  0632	    VALUE = getw(P);			!   the source
;	  0633	    PARAMETER_DU_2(,VALUE);		!   node address
;	  0634			end;
;	  0635	
;	  0636	[9]:		begin			! Resource failure while initializing:
;	  0637	    RET = 4^6+$XPT$E_ISF;
;	  0638	    COUNTER_INCREMENT(LINEb,XPTini_fail);!  increment init. failure counter
;	  0639	    PARAMETER_C_1(5,REASON[.CODE]);	!   log the reason code
;	  0640			end;
;	  0641	
;	  0642	[outrange]:	;
;	  0643	
;	  0644	tes;
;	  0645	$NM_LOG_END(.RET,.NMXid);               ! Log the event
;	  0646	
;	  0647	CALL$L(INI_LIN,.LINEb);                 ! Re-initialize the line
;	  0648	end;				!End of BAD_MSG


						.TITLE	TLILIN
						.IDENT	/X01650/


000000						.PSECT	$PLIT$,  RO ,  D  
000000	000000 				P.AAA:	.WORD	0
000002	000002 					.WORD	2
000004	000002 					.WORD	2
000006	000006 					.WORD	6
000010	000007 					.WORD	7
000012	000010 					.WORD	10
000014	000011 					.WORD	11
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  12
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

000016	000002 					.WORD	2
000020	000000 					.WORD	0
000022	000000 					.WORD	0


						.GLOBL	.CRDAT, $NLBEG, $IC8, $DPC1, $DPCM
						.GLOBL	$TPDU1, $TPDU2, $NLEND


	000000'				; REASON
					U.34=		    P.AAA


						.SBTTL	BAD.MSG
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			BAD.MSG::
					U.1:	JSR	R1,$SAVE5			;					0471
000004	005746 					TST	-(SP)
000006	010546 					MOV	R5,-(SP)
000010	016602  000022 				MOV	22(SP),R2			; CODE,*				0572
000014	001002 					BNE	1$
000016	000167  000424 				JMP	15$
000022	016401  000020 			1$:	MOV	20(R4),R1			; *(CCB),PTR				0574
000026	004767  000000G				JSR	PC,$NLBEG			;					0580
000032	010200 					MOV	R2,R0				;					0582
000034	005300 					DEC	R0
000036	020027  000010 				CMP	R0,#10
000042	101162 					BHI	14$
000044	006300 					ASL	R0
000046	066007  000024'				ADD	P.AAB(R0),PC			; Case dispatch
000052	000556 				2$:	BR	14$
000054	012703  000410 			3$:	MOV	#410,R3				; *,RET					0586
000060	011605 					MOV	(SP),R5				;					0587
000062	062705  000102 				ADD	#102,R5
000066	000405 					BR	5$
000070	012703  000414 			4$:	MOV	#414,R3				; *,RET					0593
000074	011605 					MOV	(SP),R5				;					0594
000076	062705  000103 				ADD	#103,R5
000102	010500 				5$:	MOV	R5,R0
000104	000455 					BR	8$
000106	062701  000006 			6$:	ADD	#6,R1				; *,PTR					0602
000112	012703  000415 				MOV	#415,R3				; *,RET					0603
000116	011605 					MOV	(SP),R5				;					0604
000120	062705  000103 				ADD	#103,R5
000124	010500 					MOV	R5,R0
000126	004767  000000G				JSR	PC,$IC8
000132	011605 					MOV	(SP),R5				;					0605
000134	004767  000000V				JSR	PC,U.15
000140	020227  000003 				CMP	R2,#3				;					0606
000144	001042 					BNE	9$
000146	012746  000006 				MOV	#6,-(SP)			;					0607
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  13
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

000152	012700  000003 				MOV	#3,R0
000156	004767  000000G				JSR	PC,$DPCM
000162	005004 					CLR	R4				; VALUE					0608
000164	152104 					BISB	(R1)+,R4			; P,VALUE
000166	110400 					MOVB	R4,R0				; VALUE,*				0609
000170	004767  000000G				JSR	PC,$TPDU1
000174	005004 					CLR	R4				; VALUE					0610
000176	152104 					BISB	(R1)+,R4			; P,VALUE
000200	110400 					MOVB	R4,R0				; VALUE,*				0611
000202	004767  000000G				JSR	PC,$TPDU1
000206	005004 					CLR	R4				; VALUE					0612
000210	152104 					BISB	(R1)+,R4			; P,VALUE
000212	110400 					MOVB	R4,R0				; VALUE,*				0613
000214	004767  000000G				JSR	PC,$TPDU1
000220	005726 					TST	(SP)+				;					0606
000222	000413 					BR	9$				;					0615
000224	012703  000404 			7$:	MOV	#404,R3				; *,RET					0619
000230	016700  000002G				MOV	.CRDAT+2,R0			;					0620
000234	062700  000133 				ADD	#133,R0
000240	004767  000000G			8$:	JSR	PC,$IC8
000244	011605 					MOV	(SP),R5				;					0621
000246	004767  000000V				JSR	PC,U.15
000252	012746  000005 			9$:	MOV	#5,-(SP)			;					0622
000256	010201 					MOV	R2,R1
000260	006301 					ASL	R1
000262	116100  000000'				MOVB	U.34(R1),R0
000266	000445 					BR	12$
000270	005201 				10$:	INC	R1				; PTR					0628
000272	012703  000406 				MOV	#406,R3				; *,RET					0629
000276	016700  000002G				MOV	.CRDAT+2,R0			;					0630
000302	062700  000135 				ADD	#135,R0
000306	004767  000000G				JSR	PC,$IC8
000312	012746  000003 				MOV	#3,-(SP)			;					0631
000316	012700  000001 				MOV	#1,R0
000322	004767  000000G				JSR	PC,$DPCM
000326	112166  000004 				MOVB	(R1)+,4(SP)			; P,X					0632
000332	112166  000005 				MOVB	(R1)+,5(SP)			; P,X
000336	016600  000004 				MOV	4(SP),R0			; X,VALUE
000342	004767  000000G				JSR	PC,$TPDU2			;					0633
000346	000417 					BR	13$				;					0625
000350	012703  000414 			11$:	MOV	#414,R3				; *,RET					0637
000354	011605 					MOV	(SP),R5				;					0638
000356	062705  000103 				ADD	#103,R5
000362	010500 					MOV	R5,R0
000364	004767  000000G				JSR	PC,$IC8
000370	012746  000005 				MOV	#5,-(SP)			;					0639
000374	006302 					ASL	R2
000376	116200  000000'				MOVB	U.34(R2),R0
000402	004767  000000G			12$:	JSR	PC,$DPC1
000406	005726 				13$:	TST	(SP)+				;					0636
000410	010300 				14$:	MOV	R3,R0				; RET,*					0645
000412	011602 					MOV	(SP),R2
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  14
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (3)

000414	016201  000034 				MOV	34(R2),R1
000420	004767  000000G				JSR	PC,$NLEND
000424	011646 					MOV	(SP),-(SP)			;					0647
000426	012746  000001 				MOV	#1,-(SP)
000432	012746  000000V				MOV	#U.12,-(SP)
000436	004767  000000G				JSR	PC,$CALL
000442	062706  000006 				ADD	#6,SP				;					0518
000446	022626 				15$:	CMP	(SP)+,(SP)+			;					0471
000450	000207 					RTS	PC

; Routine Size:  149 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  12 words


000024						.PSECT	$PLIT$,  RO ,  D  

					P.AAB:						; CASE Table for BAD.MSG+0046		0582
000024	000002 					.WORD	2				; [3$]
000026	000016 					.WORD	16				; [4$]
000030	000034 					.WORD	34				; [6$]
000032	000034 					.WORD	34				; [6$]
000034	000034 					.WORD	34				; [6$]
000036	000034 					.WORD	34				; [6$]
000040	000152 					.WORD	152				; [7$]
000042	000216 					.WORD	216				; [10$]
000044	000276 					.WORD	276				; [11$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  15
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (4)

;	  0649	routine CCB_CMP (LINEb): LINKAGE_DB novalue =
;	  0650	
;	  0651	!++
;	  0652	! FUNCTIONAL DESCRIPTION:
;	  0653	!
;	  0654	!  Terminates all pending function CCBs for a circuit with "success".
;	  0655	!
;	  0656	! FORMAL PARAMETERS
;	  0657	!
;	  0658	!	LINEb	Address of the line data base entry whose function CCB
;	  0659	!		queue is to be cleared out.
;	  0660	!
;	  0661	! IMPLICIT INPUTS
;	  0662	!
;	  0663	!	LINEccb
;	  0664	!
;	  0665	! ROUTINE VALUE:
;	  0666	! COMPLETION CODES:
;	  0667	!
;	  0668	!	NONE.
;	  0669	!
;	  0670	! SIDE EFFECTS:
;	  0671	!
;	  0672	!	NONE.
;	  0673	!
;	  0674	!--
;	  0675	
;	  0676	begin
;	  0677	
;	  0678	require 'XPTSYM';
;	  0715	
;	  0716	while true do
;	  0717	    begin
;	  0718	    local CCB: ref block field (C_XPT_fields);
;	  0719	    if (CCB = .LINEccb) eqla 0 then exitloop;   ! If there is a CCB,
;	  0720	    LINEccb = .CCB[C_LNK];              ! then de-link it,
;	  0721	    CCB[C_FNC] = FC_CCP;		!  terminate the CCB
;	  0722	    CCB[C_STS] = NM$SUC;		!  with a "success" code;
;	  0723	    $MCB_SCHEDULE_CCB(.CCB);
;	  0724	    end;
;	  0725	
;	  0726	end;			!End of CCB_CMP


						.GLOBL	$SCHED


						.SBTTL	CCB.CMP
000452						.PSECT	$CODE$,  RO 

000000	010446 				; CCB.CMP
					U.2:	MOV	R4,-(SP)			;					0649
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  16
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (4)

000002	016504  000050 			1$:	MOV	50(R5),R4			; *(LINEB),CCB				0719
000006	001413 					BEQ	2$
000010	011465  000050 				MOV	(R4),50(R5)			; CCB,*(LINEB)				0720
000014	112764  000022  000012 			MOVB	#22,12(R4)			; *,*(CCB)				0721
000022	012764  000001  000014 			MOV	#1,14(R4)			; *,*(CCB)				0722
000030	004767  000000G				JSR	PC,$SCHED			;					0723
000034	000762 					BR	1$				;					0716
000036	012604 				2$:	MOV	(SP)+,R4			;					0649
000040	000207 					RTS	PC

; Routine Size:  17 words,	Routine Base:  $CODE$ + 0452
; Maximum stack depth per invocation:  2 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  17
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (5)

;	  0727	global routine CCPSTR (LINEb,CCB): MCB_DB_CCB novalue =
;	  0728	
;	  0729	!++
;	  0730	! FUNCTIONAL DESCRIPTION:
;	  0731	!
;	  0732	!  This is a REQUEST complete.
;	  0733	!
;	  0734	! FORMAL PARAMETERS
;	  0735	!
;	  0736	!	CCB	Function CCB
;	  0737	!
;	  0738	! IMPLICIT INPUTS
;	  0739	!
;	  0740	!	LINEstate
;	  0741	!
;	  0742	! ROUTINE VALUE:
;	  0743	! COMPLETION CODES:
;	  0744	!
;	  0745	!	NONE.
;	  0746	!
;	  0747	! SIDE EFFECTS:
;	  0748	!
;	  0749	!--
;	  0750	
;	  0751	begin
;	  0752	map CCB: ref block field(C_fields);
;	  0753	require 'XPTSYM';
;	  0790	
;	  0791	LINEfunction = 0;
;	  0792	
;	  0793	!
;	  0794	!  Get the initial line cost if necessary.
;	  0795	!
;	  0796	
;	  0797	if .Lcv eql 0
;	  0798	then if (Lcv = .CCB[C_PRM1]) eql 0
;	  0799	     then Lcv = .Lcv + 1;
;	  0800	
;	  0801	!
;	  0802	!  Set the Transport circuit state, depending on whether the circuit
;	  0803	!  is ON or OFF.
;	  0804	!
;	  0805	
;	  0806	if .NMstate eql ON
;	  0807	then NEW_STATE (.LINEb, DS);
;	  0808	
;	  0809	!
;	  0810	!  Simulate a line state change event
;	  0811	!
;	  0812	
;	  0813	CIRCUIT_STATE(.LINEb,.CCB);
;	  0814	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  18
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (5)

;	  0815	$MCB_RETURN_CCB (.CCB);
;	  0816	CCB_CMP(.LINEb);			! Clear out circuit's function queue
;	  0817	NEXT_ACTION (.LINEb);
;	  0818	end;                                    ! End of CCPSTR


						.GLOBL	$CCBRT


						.SBTTL	CCPSTR
000000	105065  000040 			CCPSTR::
					U.4:	CLRB	40(R5)				; *(LINEB)				0791
000004	012700  000020 				MOV	#20,R0				;					0797
000010	060500 					ADD	R5,R0				; LINEB,*
000012	005710 					TST	(R0)
000014	001004 					BNE	1$
000016	016410  000024 				MOV	24(R4),(R0)			; *(CCB),*				0798
000022	001001 					BNE	1$
000024	005210 					INC	(R0)				;					0799
000026	105765  000037 			1$:	TSTB	37(R5)				; *(LINEB)				0806
000032	001004 					BNE	2$
000034	012700  000004 				MOV	#4,R0				;					0807
000040	004767  000000V				JSR	PC,U.18
000044	004767  000000V			2$:	JSR	PC,U.6				;					0813
000050	004767  000000G				JSR	PC,$CCBRT			;					0815
000054	004767  177656 				JSR	PC,U.2				;					0816
000060	004767  000000V				JSR	PC,U.19				;					0817
000064	000207 					RTS	PC				;					0727

; Routine Size:  27 words,	Routine Base:  $CODE$ + 0514
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  19
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (6)

;	  0819	global routine CCPSTP (LINEb,CCB): MCB_DB_CCB novalue =
;	  0820	
;	  0821	!++
;	  0822	! FUNCTIONAL DESCRIPTION:
;	  0823	!
;	  0824	!  This is a RELEASE complete.
;	  0825	!
;	  0826	! FORMAL PARAMETERS
;	  0827	!
;	  0828	!	CCB	Function CCB
;	  0829	!
;	  0830	! IMPLICIT INPUTS
;	  0831	!
;	  0832	!	LINEstate
;	  0833	!
;	  0834	! ROUTINE VALUE:
;	  0835	! COMPLETION CODES:
;	  0836	!
;	  0837	!	NONE.
;	  0838	!
;	  0839	! SIDE EFFECTS:
;	  0840	!
;	  0841	!--
;	  0842	
;	  0843	begin
;	  0844	map CCB: ref block field(C_fields);
;	  0845	require 'XPTSYM';
;	  0882	
;	  0883	LINEfunction = 0;
;	  0884	DLLstate = DLL_FREE;                    ! We are no longer using this circuit
;	  0885	Freeing = false;                        !   and complete freeing process
;	  0886	OWNED = false;
;	  0887	$MCB_RETURN_CCB(.CCB);			! Return the CCB
;	  0888	CCB_CMP(.LINEb);			! Post all function CCBs complete
;	  0889	NEXT_ACTION (.LINEb);
;	  0890	end;                                    ! End of CCPSTP


						.SBTTL	CCPSTP
000000	105065  000040 			CCPSTP::
					U.3:	CLRB	40(R5)				; *(LINEB)				0883
000004	105065  000006 				CLRB	6(R5)				; *(LINEB)				0884
000010	042715  004400 				BIC	#4400,(R5)			; *,LINEB				0886
000014	004767  000000G				JSR	PC,$CCBRT			;					0887
000020	004767  177624 				JSR	PC,U.2				;					0888
000024	004767  000000V				JSR	PC,U.19				;					0889
000030	000207 					RTS	PC				;					0819

; Routine Size:  13 words,	Routine Base:  $CODE$ + 0602
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  20
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (7)

;	  0891	routine CIRCUIT_DOWN (LINEb): LINKAGE_DB novalue =
;	  0892	
;	  0893	!++
;	  0894	! FUNCTIONAL DESCRIPTION:
;	  0895	!
;	  0896	!
;	  0897	! FORMAL PARAMETERS
;	  0898	!
;	  0899	!       LINEb - line data base
;	  0900	!
;	  0901	! IMPLICIT INPUTS
;	  0902	!
;	  0903	!	None
;	  0904	!
;	  0905	! ROUTINE VALUE:
;	  0906	! COMPLETION CODES:
;	  0907	!
;	  0908	!	NONE.
;	  0909	!
;	  0910	! SIDE EFFECTS:
;	  0911	!
;	  0912	!	NONE.
;	  0913	!--
;	  0914	
;	  0915	begin
;	  0916	require 'XPTSYM';
;	  0953	
;	  0954	case .LINEstate from HA to RU of	! Actions are based
;	  0955	    set					! circuit states:
;	  0956	    [RU,TC]:				!   Running -
;	  0957	        NEW_STATE (.LINEb, LR);
;	  0958	    [DT]:                               !   Terminate
;	  0959	        NEXT_STATE (.LINEb, OFF);
;	  0960	    [TI,TV]:                            !   Handshaking -
;	  0961	        NEW_STATE (.LINEb, DS);
;	  0962	    [inrange]:
;	  0963	        ;                               !   Otherwise - do nothing
;	  0964	    tes;
;	  0965	
;	  0966	end;			!End of CIRCUIT_DOWN


						.SBTTL	CIRCUIT.DOWN
000000	111500 				; CIRCUIT.DOWN
					U.5:	MOVB	(R5),R0				; LINEB,*				0954
000002	006300 					ASL	R0
000004	066007  000046'				ADD	P.AAC(R0),PC			; Case dispatch
000010	012700  000003 			1$:	MOV	#3,R0				;					0957
000014	000407 					BR	4$
000016	012700  000002 			2$:	MOV	#2,R0				;					0959
000022	004767  000000V				JSR	PC,U.20
000026	000207 					RTS	PC				;					0954
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  21
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (7)

000030	012700  000004 			3$:	MOV	#4,R0				;					0961
000034	004767  000000V			4$:	JSR	PC,U.18
000040	000207 				5$:	RTS	PC				;					0891

; Routine Size:  17 words,	Routine Base:  $CODE$ + 0634
; Maximum stack depth per invocation:  1 word


000046						.PSECT	$PLIT$,  RO ,  D  

					P.AAC:						; CASE Table for CIRCUIT.DOWN+0004	0954
000046	000030 					.WORD	30				; [5$]
000050	000006 					.WORD	6				; [2$]
000052	000030 					.WORD	30				; [5$]
000054	000030 					.WORD	30				; [5$]
000056	000030 					.WORD	30				; [5$]
000060	000020 					.WORD	20				; [3$]
000062	000020 					.WORD	20				; [3$]
000064	000000 					.WORD	0				; [1$]
000066	000000 					.WORD	0				; [1$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  22
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (8)

;	  0967	routine CIRCUIT_STATE (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  0968	
;	  0969	!++
;	  0970	! FUNCTIONAL DESCRIPTION:
;	  0971	!
;	  0972	!
;	  0973	! FORMAL PARAMETERS
;	  0974	!
;	  0975	!       LINEb - line data base
;	  0976	!       CCB - CCB containing the state notification
;	  0977	!
;	  0978	! IMPLICIT INPUTS
;	  0979	!
;	  0980	!	None
;	  0981	!
;	  0982	! ROUTINE VALUE:
;	  0983	! COMPLETION CODES:
;	  0984	!
;	  0985	!	NONE.
;	  0986	!
;	  0987	! SIDE EFFECTS:
;	  0988	!
;	  0989	!	NONE.
;	  0990	!--
;	  0991	
;	  0992	begin
;	  0993	map CCB: ref block field (C_XPT_fields);
;	  0994	require 'XPTSYM';
;	  1031	
;	  1032	selectone .CCB[C_STS] of
;	  1033	    set
;	  1034	
;	  1035	!
;	  1036	!  Transition to OFF (or MAINTENANCE, which is equivalent to Transport)
;	  1037	!
;	  1038	
;	  1039	    [DLL$_STATE_OFF]:
;	  1040	        begin
;	  1041	        DLLstate = DLL_OFF;
;	  1042	        CIRCUIT_DOWN(.LINEb);
;	  1043	        end;
;	  1044	    [DLL$_STATE_MAINTENANCE]:
;	  1045	        begin
;	  1046	        DLLstate = DLL_MAINTENANCE;
;	  1047	        CIRCUIT_DOWN(.LINEb);
;	  1048	        end;
;	  1049	    [DLL$_STATE_SYNCHRONIZING]:
;	  1050	        begin
;	  1051	        local CB: ref block field (C_XPT_fields);
;	  1052	        DLLstate = DLL_SYNCHRONIZING;
;	  1053	        end;
;	  1054	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  23
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (8)

;	  1055	    [DLL$_STATE_RUNNING]:
;	  1056	        begin
;	  1057	        DLLstate = DLL_RUNNING;
;	  1058	        CIRCUIT_UP(.LINEb);
;	  1059	        end;
;	  1060	
;	  1061	    tes;
;	  1062	
;	  1063	end;			!End of CIRCUIT_STATE


						.SBTTL	CIRCUIT.STATE
000676						.PSECT	$CODE$,  RO 

000000	016400  000014 			; CIRCUIT.STATE
					U.6:	MOV	14(R4),R0			; *(CCB),*				1032
000004	020027  100043 				CMP	R0,#-77735
000010	001004 					BNE	1$
000012	112765  000001  000006 			MOVB	#1,6(R5)			; *,*(LINEB)				1041
000020	000406 					BR	2$				;					1042
000022	020027  100073 			1$:	CMP	R0,#-77705			;					1032
000026	001006 					BNE	3$
000030	112765  000003  000006 			MOVB	#3,6(R5)			; *,*(LINEB)				1046
000036	004767  177674 			2$:	JSR	PC,U.5				;					1047
000042	000207 					RTS	PC				;					1032
000044	020027  100053 			3$:	CMP	R0,#-77725
000050	001004 					BNE	4$
000052	112765  000002  000006 			MOVB	#2,6(R5)			; *,*(LINEB)				1052
000060	000207 					RTS	PC				;					1032
000062	020027  100063 			4$:	CMP	R0,#-77715
000066	001005 					BNE	5$
000070	112765  000004  000006 			MOVB	#4,6(R5)			; *,*(LINEB)				1057
000076	004767  000000V				JSR	PC,U.7				;					1058
000102	000207 				5$:	RTS	PC				;					0967

; Routine Size:  34 words,	Routine Base:  $CODE$ + 0676
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  24
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (9)

;	  1064	routine CIRCUIT_UP (LINEb): LINKAGE_DB novalue =
;	  1065	
;	  1066	!++
;	  1067	! FUNCTIONAL DESCRIPTION:
;	  1068	!
;	  1069	!
;	  1070	! FORMAL PARAMETERS
;	  1071	!
;	  1072	!       LINEb - line data base
;	  1073	!
;	  1074	! IMPLICIT INPUTS
;	  1075	!
;	  1076	!	None
;	  1077	!
;	  1078	! ROUTINE VALUE:
;	  1079	! COMPLETION CODES:
;	  1080	!
;	  1081	!	NONE.
;	  1082	!
;	  1083	! SIDE EFFECTS:
;	  1084	!
;	  1085	!	NONE.
;	  1086	!--
;	  1087	
;	  1088	begin
;	  1089	require 'XPTSYM';
;	  1126	local CB: ref block field (C_XPT_FIELDS);
;	  1127	
;	  1128	if .LINEstate eql DS
;	  1129	then NEXT_STATE (.LINEb, TI);
;	  1130	
;	  1131	end;			!End of CIRCUIT_UP


						.SBTTL	CIRCUIT.UP
000000	121527  000004 			; CIRCUIT.UP
					U.7:	CMPB	(R5),#4				; LINEB,*				1128
000004	001004 					BNE	1$
000006	012700  000005 				MOV	#5,R0				;					1129
000012	004767  000000V				JSR	PC,U.20
000016	000207 				1$:	RTS	PC				;					1064

; Routine Size:  8 words,	Routine Base:  $CODE$ + 1002
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  25
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (10)

;	  1132	global routine CKTOFF (LINEb, CCB): LINKAGE_DB_CCB novalue =
;	  1133	
;	  1134	!++
;	  1135	! FUNCTIONAL DESCRIPTION:
;	  1136	!
;	  1137	! Releases a circuit to the DLL.
;	  1138	!
;	  1139	! FORMAL PARAMETERS
;	  1140	!
;	  1141	!	CCB	Function CCB
;	  1142	!
;	  1143	!		CCB[C_LIN]	Index of data base entry for circuit
;	  1144	!		CCB[C_PRM2]	Provider PIX
;	  1145	!
;	  1146	! IMPLICIT INPUTS
;	  1147	!
;	  1148	!	LINEccb
;	  1149	!
;	  1150	! ROUTINE VALUE:
;	  1151	! COMPLETION CODES:
;	  1152	!
;	  1153	!	NONE.
;	  1154	!
;	  1155	! SIDE EFFECTS:
;	  1156	!
;	  1157	!	NONE.
;	  1158	!
;	  1159	!--
;	  1160	
;	  1161	begin
;	  1162	map CCB: ref block field (C_XPT_FIELDS);
;	  1163	require 'XPTSYM';
;	  1200	
;	  1201	!
;	  1202	!  Queue the function CCB into the data base
;	  1203	!
;	  1204	
;	  1205	CCB[C_LNK] = .LINEccb;
;	  1206	LINEccb = .CCB;
;	  1207	
;	  1208	Freeing = true;                         !   indicate we're freeing
;	  1209	
;	  1210	!
;	  1211	!  If the circuit needs to be brought down, start with that.
;	  1212	!  Otherwise, get to the releasing.
;	  1213	!
;	  1214	
;	  1215	if .LINEstate neq HA                    ! If not halted,
;	  1216	then NEW_STATE (.LINEb, DT)             ! start it on the road to HA state.
;	  1217	else begin
;	  1218	     LINEfunction = FUNCrelease;
;	  1219	     NEXT_ACTION (.LINEb);
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  26
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (10)

;	  1220	     end;
;	  1221	
;	  1222	end;				!End of CKTOFF


						.SBTTL	CKTOFF
000000	016514  000050 			CKTOFF::
					U.8:	MOV	50(R5),(R4)			; *(LINEB),CCB				1205
000004	010465  000050 				MOV	R4,50(R5)			; CCB,*(LINEB)				1206
000010	052715  004000 				BIS	#4000,(R5)			; *,LINEB				1208
000014	105715 					TSTB	(R5)				; LINEB					1215
000016	001405 					BEQ	1$
000020	012700  000001 				MOV	#1,R0				;					1216
000024	004767  000000V				JSR	PC,U.18
000030	000207 					RTS	PC				;					1215
000032	112765  000002  000040 		1$:	MOVB	#2,40(R5)			; *,*(LINEB)				1218
000040	004767  000000V				JSR	PC,U.19				;					1219
000044	000207 					RTS	PC				;					1132

; Routine Size:  19 words,	Routine Base:  $CODE$ + 1022
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  27
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (11)

;	  1223	global routine CKTON (LINEb, CCB): LINKAGE_DB_CCB novalue =
;	  1224	
;	  1225	!++
;	  1226	! FUNCTIONAL DESCRIPTION:
;	  1227	!
;	  1228	! Issues a request for a circuit to the DLL.
;	  1229	!
;	  1230	! FORMAL PARAMETERS
;	  1231	!
;	  1232	!	CCB	Function CCB
;	  1233	!
;	  1234	!		CCB[C_LIN]	Line number (index to data base entry)
;	  1235	!		CCB[C_PRM2]	Provider PIX
;	  1236	!
;	  1237	! IMPLICIT INPUTS
;	  1238	!
;	  1239	!	LINEccb
;	  1240	!
;	  1241	! ROUTINE VALUE:
;	  1242	! COMPLETION CODES:
;	  1243	!
;	  1244	!	NONE.
;	  1245	!
;	  1246	! SIDE EFFECTS:
;	  1247	!
;	  1248	!	NONE.
;	  1249	!
;	  1250	!--
;	  1251	
;	  1252	begin
;	  1253	map CCB: ref block field (C_XPT_FIELDS);
;	  1254	require 'XPTSYM';
;	  1291	
;	  1292	!
;	  1293	!  Queue the function CCB into the data base
;	  1294	!
;	  1295	
;	  1296	CCB[C_LNK] = .LINEccb;
;	  1297	LINEccb = .CCB;
;	  1298	
;	  1299	OWNED = true;                           ! Set state to "owned"
;	  1300	
;	  1301	!
;	  1302	!  Line will be halted.
;	  1303	!  Start it on the road to RU state.
;	  1304	!
;	  1305	
;	  1306	LINEfunction = FUNCrequest;
;	  1307	LINRVR(.LINEb);
;	  1308	end;				!End of CKTON
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  28
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (11)

						.SBTTL	CKTON
000000	016514  000050 			CKTON::
					U.9:	MOV	50(R5),(R4)			; *(LINEB),CCB				1296
000004	010465  000050 				MOV	R4,50(R5)			; CCB,*(LINEB)				1297
000010	052715  000400 				BIS	#400,(R5)			; *,LINEB				1299
000014	112765  000001  000040 			MOVB	#1,40(R5)			; *,*(LINEB)				1306
000022	004767  000000V				JSR	PC,U.14				;					1307
000026	000207 					RTS	PC				;					1223

; Routine Size:  12 words,	Routine Base:  $CODE$ + 1070
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  29
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (12)

;	  1309	routine GET_FALSE_NI (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  1310	
;	  1311	!++
;	  1312	! FUNCTIONAL DESCRIPTION:
;	  1313	!
;	  1314	!  Constructs the False_NI_msg.
;	  1315	!
;	  1316	! FORMAL PARAMETERS
;	  1317	!
;	  1318	!       LINEb - line data base
;	  1319	!
;	  1320	! IMPLICIT INPUTS
;	  1321	!
;	  1322	!	None
;	  1323	!
;	  1324	! ROUTINE VALUE:
;	  1325	! COMPLETION CODES:
;	  1326	!
;	  1327	!	NONE.
;	  1328	!
;	  1329	! SIDE EFFECTS:
;	  1330	!
;	  1331	!	NONE.
;	  1332	!
;	  1333	!--
;	  1334	
;	  1335	begin
;	  1336	map CCB: ref block field (C_XPT_FIELDS);
;	  1337	require 'XPTSYM';
;	  1374	pointer PTR;
;	  1375	
;	  1376	if ch$rchar (.CCB[C_ADDR]) eql OTI_CTLflg
;	  1377	then begin                              ! Copy and update NI.
;	  1378	     PTR = .False_NI_msg_ADDR;
;	  1379	     ch$move(.CCB[C_CNT],.CCB[C_ADDR],.PTR);
;	  1380	     False_NI_msg_CNT = .CCB [C_CNT];
;	  1381	     PTR = ch$plus(.PTR,2);             ! Bypass MSGFLG and SUBFLG
;	  1382	     do 0 while biton(getb(PTR),%o'200'); ! NODEADDR,
;	  1383	     begin                              ! NODENAME
;	  1384	     local TMP;
;	  1385	     TMP = getb(PTR);
;	  1386	     PTR = ch$plus(.PTR,.TMP);
;	  1387	     end;
;	  1388	     PTR = ch$plus(.PTR,1);             !  SERVICES
;	  1389	     if .Request_OTV
;	  1390	     then ch$wchar((ch$rchar(.PTR) or 1),.PTR);
;	  1391	     PTR = ch$plus(.PTR,1);             !  REQUESTS
;	  1392	     byt$short_string(PH2size,PTR);     ! Put in the maximum blocksize
;	  1393	     byt$short_string(PH2size,PTR);     !  and the maximum segment size
;	  1394	     putw($MAXlk,PTR);                  !  and the maximum number of links
;	  1395	     end;
;	  1396	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  30
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (12)

;	  1397	end;			!End of GET_FALSE_NI


						.SBTTL	GET.FALSE.NI
000000	004167  000000G			; GET.FALSE.NI
					U.10:	JSR	R1,$SAVE5			;					1309
000004	005746 					TST	-(SP)
000006	127427  000020  000130 			CMPB	@20(R4),#130			; *(CCB),*				1376
000014	001070 					BNE	3$
000016	016700  000002G				MOV	.CRDAT+2,R0			;					1378
000022	016005  000172 				MOV	172(R0),R5			; *,PTR
000026	016446  000022 				MOV	22(R4),-(SP)			; *(CCB),*				1379
000032	016446  000020 				MOV	20(R4),-(SP)			; *(CCB),*
000036	010546 					MOV	R5,-(SP)			; PTR,*
000040	004767  000000G				JSR	PC,BL$MOV
000044	016700  000002G				MOV	.CRDAT+2,R0
000050	016460  000022  000174 			MOV	22(R4),174(R0)			; *(CCB),*				1380
000056	062705  000002 				ADD	#2,R5				; *,PTR					1381
000062	105725 				1$:	TSTB	(R5)+				; PTR					1382
000064	100776 					BMI	1$
000066	005004 					CLR	R4				; TMP					1385
000070	152504 					BISB	(R5)+,R4			; PTR,TMP
000072	060405 					ADD	R4,R5				; TMP,PTR				1386
000074	005205 					INC	R5				; PTR					1388
000076	032710  001000 				BIT	#1000,(R0)			;					1389
000102	001405 					BEQ	2$
000104	005004 					CLR	R4				;					1390
000106	151504 					BISB	(R5),R4				; PTR,*
000110	052704  000001 				BIS	#1,R4
000114	110415 					MOVB	R4,(R5)				; *,PTR
000116	005205 				2$:	INC	R5				; PTR					1391
000120	016000  000126 				MOV	126(R0),R0			; *,NUM					1392
000124	110025 					MOVB	R0,(R5)+			; NUM,PTR
000126	000300 					SWAB	R0				; NUM
000130	110025 					MOVB	R0,(R5)+			; NUM,PTR
000132	016700  000002G				MOV	.CRDAT+2,R0			;					1393
000136	016000  000126 				MOV	126(R0),R0			; *,NUM
000142	110025 					MOVB	R0,(R5)+			; NUM,PTR
000144	000300 					SWAB	R0				; NUM
000146	110025 					MOVB	R0,(R5)+			; NUM,PTR
000150	016700  000002G				MOV	.CRDAT+2,R0			;					1394
000154	016066  000032  000006 			MOV	32(R0),6(SP)			; *,X
000162	116625  000006 				MOVB	6(SP),(R5)+			; X,PTR
000166	116625  000007 				MOVB	7(SP),(R5)+			; X,PTR
000172	062706  000006 				ADD	#6,SP				;					1377
000176	005726 				3$:	TST	(SP)+				;					1309
000200	000207 					RTS	PC

; Routine Size:  65 words,	Routine Base:  $CODE$ + 1120
; Maximum stack depth per invocation:  11 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  31
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (13)

;	  1398	routine GET_PWDb (ADDR) =
;	  1399	
;	  1400	!++
;	  1401	! FUNCTIONAL DESCRIPTION:
;	  1402	!
;	  1403	!  Returns a password data base address for the given node.
;	  1404	!
;	  1405	! FORMAL PARAMETERS
;	  1406	!
;	  1407	!       ADDR - Node address
;	  1408	!
;	  1409	! IMPLICIT INPUTS
;	  1410	!
;	  1411	!	None
;	  1412	!
;	  1413	! ROUTINE VALUE:
;	  1414	! COMPLETION CODES:
;	  1415	!
;	  1416	!       Address of PWDb.
;	  1417	!
;	  1418	! SIDE EFFECTS:
;	  1419	!
;	  1420	!	NONE.
;	  1421	!
;	  1422	!--
;	  1423	
;	  1424	begin
;	  1425	require 'XPTSYM';
;	  1462	
;	  1463	$TLI_for_each_PWDb_do_begin
;	  1464	    if .PWDnode eql 0 then return .PWDb;
;	  1465	    if .PWDnode eql .ADDR then return .PWDb;
;	  1466	$TLI_next_PWDb_end;
;	  1467	
;	  1468	0                                       ! Never gets here
;	  1469	end;			!End of GET_PWDb


						.SBTTL	GET.PWDB
000000	010146 				; GET.PWDB
					U.11:	MOV	R1,-(SP)			;					1398
000002	016700  000002G				MOV	.CRDAT+2,R0			;					1461
000006	016001  000152 				MOV	152(R0),R1			; *,PWDB
000012	001412 					BEQ	4$
000014	016100  000002 			1$:	MOV	2(R1),R0			; *(PWDB),*				1464
000020	001403 					BEQ	2$
000022	020066  000004 				CMP	R0,4(SP)			; *,ADDR				1465
000026	001002 					BNE	3$
000030	010100 				2$:	MOV	R1,R0				; PWDB,*
000032	000403 					BR	5$
000034	011101 				3$:	MOV	(R1),R1				; PWDB,PWDB
000036	001366 					BNE	1$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  32
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (13)

000040	005000 				4$:	CLR	R0				;					1398
000042	012601 				5$:	MOV	(SP)+,R1
000044	000207 					RTS	PC

; Routine Size:  19 words,	Routine Base:  $CODE$ + 1322
; Maximum stack depth per invocation:  2 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  33
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (14)

;	  1470	global routine INI_LIN (LINEb_): CALL$ novalue =
;	  1471	
;	  1472	!++
;	  1473	! FUNCTIONAL DESCRIPTION:
;	  1474	!
;	  1475	!  Initializes a circuit, i.e., starts it up and transport-initializes it.
;	  1476	!
;	  1477	! FORMAL PARAMETERS
;	  1478	!
;	  1479	!       LINEb - line data base
;	  1480	!
;	  1481	! IMPLICIT INPUTS
;	  1482	!
;	  1483	!	LINEstate
;	  1484	!
;	  1485	! ROUTINE VALUE:
;	  1486	! COMPLETION CODES:
;	  1487	!
;	  1488	!	NONE.
;	  1489	!
;	  1490	! SIDE EFFECTS:
;	  1491	!
;	  1492	!	Changes circuit state.  Declares circuit "down" if it is not already.
;	  1493	!	Aborts a Terminate sequence.
;	  1494	! NOTE:	This routine acquires a free CCB.  If it is unable to do so, it
;	  1495	!	will place the function requested in the LINEfunction entry for the
;	  1496	!	circuit.  Upon timeout, the function will be rescheduled.
;	  1497	!
;	  1498	!--
;	  1499	
;	  1500	begin
;	  1501	local LINEb;
;	  1502	require 'XPTSYM';
;	  1539	LINEb = .LINEb_;
;	  1540	!
;	  1541	!  Do initialization action depending on the circuit state
;	  1542	!
;	  1543	
;	  1544	case .LINEstate from HA to RU of
;	  1545	    set
;	  1546	    [RU,TC,OFF]:                        ! If XPT possibly notified,
;	  1547	        NEW_STATE (.LINEb, LR);         ! then make sure line_down is done.
;	  1548	    [HA,DT,TI,TV]:                      ! otherwise
;	  1549	        NEW_STATE (.LINEb, DS);         ! initialize line.
;	  1550	    [inrange]:
;	  1551	        ;                               ! (already initializing)
;	  1552	    tes;
;	  1553	
;	  1554	end;				!End of INI_LIN


						.SBTTL	INI.LIN
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  34
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (14)

000000	016505  000002 			INI.LIN::
					U.12:	MOV	2(R5),R5			; LINEB.(.AP.),LINEB			1539
000004	111500 					MOVB	(R5),R0				; LINEB,*				1544
000006	006300 					ASL	R0
000010	066007  000070'				ADD	P.AAD(R0),PC			; Case dispatch
000014	012700  000003 			1$:	MOV	#3,R0				;					1547
000020	000402 					BR	3$
000022	012700  000004 			2$:	MOV	#4,R0				;					1549
000026	004767  000000V			3$:	JSR	PC,U.18
000032	000207 				4$:	RTS	PC				;					1470

; Routine Size:  14 words,	Routine Base:  $CODE$ + 1370
; Maximum stack depth per invocation:  1 word


000070						.PSECT	$PLIT$,  RO ,  D  

					P.AAD:						; CASE Table for INI.LIN+0010		1544
000070	000006 					.WORD	6				; [2$]
000072	000006 					.WORD	6				; [2$]
000074	000000 					.WORD	0				; [1$]
000076	000016 					.WORD	16				; [4$]
000100	000016 					.WORD	16				; [4$]
000102	000006 					.WORD	6				; [2$]
000104	000006 					.WORD	6				; [2$]
000106	000000 					.WORD	0				; [1$]
000110	000000 					.WORD	0				; [1$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  35
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (15)

;	  1555	global routine LD_CMP (LINEb,CCB): MCB_DB_CCB novalue =
;	  1556	
;	  1557	!++
;	  1558	! FUNCTIONAL DESCRIPTION:
;	  1559	!
;	  1560	!  Processes "line down" completion
;	  1561	!
;	  1562	! FORMAL PARAMETERS
;	  1563	!
;	  1564	!	CCB[C_LIN] - circuit that is now "down"
;	  1565	!
;	  1566	! IMPLICIT INPUTS
;	  1567	!
;	  1568	!	LINEstate
;	  1569	!
;	  1570	! ROUTINE VALUE:
;	  1571	! COMPLETION CODES:
;	  1572	!
;	  1573	!	NONE.
;	  1574	!
;	  1575	! SIDE EFFECTS:
;	  1576	!
;	  1577	!	Changes circuit state.  If in initialization sequence, starts
;	  1578	!	DLL reinitialization of circuit.  If in termination sequence,
;	  1579	!	either returns SDB to pool or (if requested to release circuit)
;	  1580	!	tell the DLL to release the circuit.
;	  1581	!
;	  1582	!--
;	  1583	
;	  1584	begin
;	  1585	map CCB: ref block field (C_XPT_FIELDS);
;	  1586	require 'XPTSYM';
;	  1623	
;	  1624	LINEfunction = 0;
;	  1625	$MCB_RETURN_CCB (.CCB);
;	  1626	
;	  1627	case .LINEstate from HA to RU of
;	  1628	    set
;	  1629	    [LR]:                               ! Continuing initialization:
;	  1630	        NEXT_STATE (.LINEb, DS);
;	  1631	    [OFF]:                              ! Continuing termination:
;	  1632	        NEXT_STATE (.LINEb, HA);
;	  1633	    [inrange]:
;	  1634		NEXT_ACTION (.LINEb);
;	  1635	    tes;
;	  1636	
;	  1637	end;				!End of LD_CMP


						.SBTTL	LD.CMP
001424						.PSECT	$CODE$,  RO 
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  36
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (15)

000000	105065  000040 			LD.CMP::
					U.13:	CLRB	40(R5)				; *(LINEB)				1624
000004	004767  000000G				JSR	PC,$CCBRT			;					1625
000010	111500 					MOVB	(R5),R0				; LINEB,*				1627
000012	006300 					ASL	R0
000014	066007  000112'				ADD	P.AAE(R0),PC			; Case dispatch
000020	012700  000004 			1$:	MOV	#4,R0				;					1630
000024	000401 					BR	3$
000026	005000 				2$:	CLR	R0				;					1632
000030	004767  000000V			3$:	JSR	PC,U.20
000034	000207 					RTS	PC				;					1627
000036	004767  000000V			4$:	JSR	PC,U.19				;					1634
000042	000207 					RTS	PC				;					1555

; Routine Size:  18 words,	Routine Base:  $CODE$ + 1424
; Maximum stack depth per invocation:  1 word


000112						.PSECT	$PLIT$,  RO ,  D  

					P.AAE:						; CASE Table for LD.CMP+0014		1627
000112	000016 					.WORD	16				; [4$]
000114	000016 					.WORD	16				; [4$]
000116	000006 					.WORD	6				; [2$]
000120	000000 					.WORD	0				; [1$]
000122	000016 					.WORD	16				; [4$]
000124	000016 					.WORD	16				; [4$]
000126	000016 					.WORD	16				; [4$]
000130	000016 					.WORD	16				; [4$]
000132	000016 					.WORD	16				; [4$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  37
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

;	  1638	global routine LINRVR (LINEb): LINKAGE_DB novalue =
;	  1639	
;	  1640	!++
;	  1641	! FUNCTIONAL DESCRIPTION:
;	  1642	!
;	  1643	!  Called by main Transport timer routine.
;	  1644	!  This routine performs resource recovery.
;	  1645	!
;	  1646	!  RESOURCE RECOVERY
;	  1647	!
;	  1648	!  If a function code (distinguished from a SDB address by being only one
;	  1649	!  byte in significance) is in LINEfunction for a circuit, the routine will
;	  1650	!  attempt to get an SDB for the circuit.  If it succeeds, the SDB will be
;	  1651	!  passed to the routine if the routine takes a CCB, and returned otherwise.
;	  1652	!  The routine to be retried will depend on the value of LINEfunction.
;	  1653	!
;	  1654	! FORMAL PARAMETERS
;	  1655	!
;	  1656	!	NONE.
;	  1657	!
;	  1658	! IMPLICIT INPUTS
;	  1659	!
;	  1660	!	LINEfunction
;	  1661	!
;	  1662	! ROUTINE VALUE:
;	  1663	! COMPLETION CODES:
;	  1664	!
;	  1665	!	NONE.
;	  1666	!
;	  1667	! SIDE EFFECTS:
;	  1668	!
;	  1669	!
;	  1670	!--
;	  1671	
;	  1672	begin
;	  1673	require 'XPTSYM';
;	  1710	
;	  1711	if .LINEfunction leq 0 then return;
;	  1712	
;	  1713	case .LINEfunction from FUNClo to FUNChi of
;	  1714	    set
;	  1715	    [FUNCrequest] :
;	  1716	        begin
;	  1717	        local CCB: ref block field (C_XPT_FIELDS);
;	  1718	        if not $MCB_GET_CCB(CCB) then return;
;	  1719	        CCB[C_PRM1] = 0;
;	  1720	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1721	        $DLL_REQUEST_CIRCUIT(.CCB);
;	  1722	        end;
;	  1723	    [FUNCrelease]:
;	  1724	        begin
;	  1725	        local CCB: ref block field (C_XPT_FIELDS);
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  38
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

;	  1726	        if not $MCB_GET_CCB(CCB) then return;
;	  1727	        LINEstate = HA;
;	  1728	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1729	        $DLL_RELEASE_CIRCUIT(.CCB);
;	  1730	        end;
;	  1731	    [FUNCinitialize]:
;	  1732	        begin
;	  1733	        local CCB: ref block field (C_XPT_FIELDS);
;	  1734	        if not $MCB_GET_CCB(CCB) then return;
;	  1735	        LINEstate = DS;
;	  1736	        Ph2circuit = false;
;	  1737	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1738	        $DLL_INITIALIZE(.CCB);
;	  1739	        end;
;	  1740	    [FUNCstop]:
;	  1741	        begin
;	  1742	        local CCB: ref block field (C_XPT_FIELDS);
;	  1743	        if not $MCB_GET_CCB(CCB) then return;
;	  1744	        LINEstate = DT;
;	  1745	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1746	        $DLL_STOP(.CCB);
;	  1747	        end;
;	  1748	    [FUNC_TI]:
;	  1749	        begin
;	  1750	        local CCB: ref block field (C_XPT_FIELDS);
;	  1751	        if not $MCB_GET_CCB(CCB) then return;
;	  1752	        CCB[C_XPT_TYPE] = FUNC_TI;
;	  1753	        CCB[C_BIAS] = 0;
;	  1754	        if not (.Ph2only or .Ph2circuit)
;	  1755	        then begin
;	  1756	             CCB[C_ADDR] = .TI_msg_ADDR;
;	  1757	             CCB[C_CNT] = .TI_msg_CNT;
;	  1758	             end
;	  1759	        else if .Intercept
;	  1760	             then begin
;	  1761	                  CCB[C_ADDR] = .NI_msg_ADDR;
;	  1762	                  CCB[C_CNT] = .NI_msg_CNT;
;	  1763	                  end
;	  1764	             else begin
;	  1765	                  CCB[C_ADDR] = .False_NI_msg_ADDR;
;	  1766	                  CCB[C_CNT] = .False_NI_msg_CNT;
;	  1767	                  end;
;	  1768	        Send_TI = false;
;	  1769	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1770	        $DLL_TRANSMIT(.CCB);
;	  1771	        end;
;	  1772	    [FUNC_TV]:
;	  1773	        begin
;	  1774	        local CCB: ref block field (C_XPT_FIELDS),
;	  1775	              PWDb: ref PWDblock;
;	  1776	        if not $MCB_GET_CCB(CCB) then return;
;	  1777	        CCB[C_XPT_TYPE] = FUNC_TV;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  39
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

;	  1778	        PWDb = GET_PWDb (.Nid);
;	  1779	        if not (.Ph2only or .Ph2circuit)
;	  1780	        then begin
;	  1781	             CCB[C_ADDR] = PWD3TVmsg_ptr;
;	  1782	             CCB[C_CNT] = PWD3TVmsg_len;
;	  1783	             end
;	  1784	        else begin
;	  1785	             CCB[C_ADDR] = PWD2TVmsg_ptr;
;	  1786	             CCB[C_CNT] = PWD2TVmsg_len;
;	  1787	             end;
;	  1788	        Send_TV = false;
;	  1789	        CCB[C_HANDLE] = .DLLhandle;     !  and DLL handle
;	  1790	        $DLL_TRANSMIT(.CCB);
;	  1791	        end;
;	  1792	    [FUNCline_up]:
;	  1793	        begin
;	  1794	        local CCB: ref block field (C_XPT_FIELDS);
;	  1795	        if not $MCB_GET_CCB(CCB) then return;
;	  1796	        XPTstate = ON;
;	  1797	        LINEstate = TC;
;	  1798	        CCB[C_HANDLE] = .XPThandle;     !  and XPT handle
;	  1799	        CCB[C_MOD] = TM_INI;            !   "line up" CCB
;	  1800	        CCB[C_FNC] = FC_RCP;            !   and queue it
;	  1801	        $MCB_SCHEDULE_CCB(.CCB);        !   to Transport
;	  1802	        end;
;	  1803	    [FUNCline_down]:
;	  1804	        begin
;	  1805	        local CCB: ref block field (C_XPT_FIELDS);
;	  1806	        if not $MCB_GET_CCB(CCB) then return;
;	  1807	        XPTstate = OFF;
;	  1808	        case .LINEstate_desired from HA to RU of
;	  1809	            set
;	  1810	            [LR,DS,TI,TV,TC,RU]: LINEstate = LR;
;	  1811	            [DT,OFF,HA]: LINEstate = OFF;
;	  1812	            tes;
;	  1813	
;	  1814	        if .Nty eql TOPS20
;	  1815	        then begin                      ! TOPS20 node:
;	  1816	             False_NI_LINEb = 0;        !   no longer available
;	  1817	             $XPT_for_each_LINEb_do_begin       ! Stop all adjacent
;	  1818	                 if .Ph2circuit and not .Intercept      ! aspiring
;	  1819	                 then CALL$L(TERM_LIN,.LINEb);  ! Phase II nodes
;	  1820	             $XPT_next_LINEb_end;
;	  1821	             end;
;	  1822	
;	  1823	        Nty = 0;                        ! Zero out adjacent node type
;	  1824	
;	  1825	        CCB[C_HANDLE] = .XPThandle;     !  and XPT handle
;	  1826	        CCB[C_MOD] = TM_TRM;            !   "line down" CCB
;	  1827	        CCB[C_FNC] = FC_RCP;            !   and queue it
;	  1828	        $MCB_SCHEDULE_CCB(.CCB);        !   to Transport
;	  1829	        end;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  40
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

;	  1830	    tes;
;	  1831	
;	  1832	LINEfunction = -.LINEfunction;
;	  1833	end;				!End of LINRVR


						.GLOBL	$CCBGT


						.SBTTL	LINRVR
001470						.PSECT	$CODE$,  RO 

000000	004167  000000G			LINRVR::
					U.14:	JSR	R1,$SAVE4			;					1638
000004	012746  000040 				MOV	#40,-(SP)			;					1711
000010	060516 					ADD	R5,(SP)				; LINEB,*
000012	105776  000000 				TSTB	@0(SP)
000016	003002 					BGT	2$
000020	000167  000776 			1$:	JMP	28$
000024	117600  000000 			2$:	MOVB	@0(SP),R0			;					1713
000030	005300 					DEC	R0
000032	006300 					ASL	R0
000034	066007  000134'				ADD	P.AAF(R0),PC			; Case dispatch
000040	004767  000000G			3$:	JSR	PC,$CCBGT			;					1718
000044	103765 					BCS	1$
000046	005064  000024 				CLR	24(R4)				; *(CCB)				1719
000052	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1720
000060	112764  000010  000012 			MOVB	#10,12(R4)			; *,*(CCB)				1721
000066	000431 					BR	6$
000070	004767  000000G			4$:	JSR	PC,$CCBGT			;					1726
000074	103751 					BCS	1$
000076	105015 					CLRB	(R5)				; LINEB					1727
000100	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1728
000106	112764  000010  000012 			MOVB	#10,12(R4)			; *,*(CCB)				1729
000114	000435 					BR	8$
000116	004767  000000G			5$:	JSR	PC,$CCBGT			;					1734
000122	103736 					BCS	1$
000124	112715  000004 				MOVB	#4,(R5)				; *,LINEB				1735
000130	042765  001000  000002 			BIC	#1000,2(R5)			; *,*(LINEB)				1736
000136	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1737
000144	112764  000002  000012 			MOVB	#2,12(R4)			; *,*(CCB)				1738
000152	112764  000002  000013 		6$:	MOVB	#2,13(R4)			; *,*(CCB)
000160	000503 					BR	13$
000162	004767  000000G			7$:	JSR	PC,$CCBGT			;					1743
000166	103714 					BCS	1$
000170	112715  000001 				MOVB	#1,(R5)				; *,LINEB				1744
000174	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1745
000202	112764  000002  000012 			MOVB	#2,12(R4)			; *,*(CCB)				1746
000210	112764  000004  000013 		8$:	MOVB	#4,13(R4)			; *,*(CCB)
000216	000464 					BR	13$
000220	004767  000000G			9$:	JSR	PC,$CCBGT			;					1751
000224	103675 					BCS	1$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  41
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

000226	112764  000005  000032 			MOVB	#5,32(R4)			; *,*(CCB)				1752
000234	005064  000016 				CLR	16(R4)				; *(CCB)				1753
000240	012702  000020 				MOV	#20,R2				;					1756
000244	060402 					ADD	R4,R2				; CCB,*
000246	016700  000002G				MOV	.CRDAT+2,R0
000252	012701  000022 				MOV	#22,R1				;					1757
000256	060401 					ADD	R4,R1				; CCB,*
000260	012703  000002 				MOV	#2,R3				;					1754
000264	060503 					ADD	R5,R3				; LINEB,*
000266	032713  002000 				BIT	#2000,(R3)
000272	001010 					BNE	10$
000274	032713  001000 				BIT	#1000,(R3)
000300	001005 					BNE	10$
000302	016012  000154 				MOV	154(R0),(R2)			;					1756
000306	016011  000156 				MOV	156(R0),(R1)			;					1757
000312	000414 					BR	12$				;					1754
000314	032713  000400 			10$:	BIT	#400,(R3)			;					1759
000320	001405 					BEQ	11$
000322	016012  000160 				MOV	160(R0),(R2)			;					1761
000326	016011  000162 				MOV	162(R0),(R1)			;					1762
000332	000404 					BR	12$				;					1759
000334	016012  000172 			11$:	MOV	172(R0),(R2)			;					1765
000340	016011  000174 				MOV	174(R0),(R1)			;					1766
000344	042715  001000 			12$:	BIC	#1000,(R5)			; *,LINEB				1768
000350	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1769
000356	112764  000002  000012 			MOVB	#2,12(R4)			; *,*(CCB)				1770
000364	105064  000013 				CLRB	13(R4)				; *(CCB)
000370	000167  000416 			13$:	JMP	26$
000374	004767  000000G			14$:	JSR	PC,$CCBGT			;					1776
000400	103607 					BCS	1$
000402	112764  000006  000032 			MOVB	#6,32(R4)			; *,*(CCB)				1777
000410	016546  000004 				MOV	4(R5),-(SP)			; *(LINEB),*				1778
000414	004767  177212 				JSR	PC,U.11
000420	032765  002000  000002 			BIT	#2000,2(R5)			; *,*(LINEB)				1779
000426	001025 					BNE	15$
000430	032765  001000  000002 			BIT	#1000,2(R5)			; *,*(LINEB)
000436	001021 					BNE	15$
000440	116002  000026 				MOVB	26(R0),R2			; *(PWDB),*				1781
000444	060002 					ADD	R0,R2				; PWDB,*
000446	010200 					MOV	R2,R0
000450	062700  000027 				ADD	#27,R0
000454	010064  000020 				MOV	R0,20(R4)			; *,*(CCB)
000460	116064  000003  000022 			MOVB	3(R0),22(R4)			; *,*(CCB)				1782
000466	105064  000023 				CLRB	23(R4)				; *(CCB)
000472	062764  000004  000022 			ADD	#4,22(R4)			; *,*(CCB)
000500	000410 					BR	16$				;					1779
000502	010064  000020 			15$:	MOV	R0,20(R4)			; PWDB,*(CCB)				1785
000506	062764  000014  000020 			ADD	#14,20(R4)			; *,*(CCB)
000514	012764  000012  000022 			MOV	#12,22(R4)			; *,*(CCB)				1786
000522	042715  002000 			16$:	BIC	#2000,(R5)			; *,LINEB				1788
000526	016564  000032  000010 			MOV	32(R5),10(R4)			; *(LINEB),*(CCB)			1789
000534	112764  000002  000012 			MOVB	#2,12(R4)			; *,*(CCB)				1790
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  42
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

000542	105064  000013 				CLRB	13(R4)				; *(CCB)
000546	004767  000000G				JSR	PC,$SCHED
000552	005726 					TST	(SP)+				;					1773
000554	000520 					BR	27$				;					1713
000556	004767  000000G			17$:	JSR	PC,$CCBGT			;					1795
000562	103517 					BCS	28$
000564	042776  177400  000000 			BIC	#177400,@0(SP)			;					1796
000572	112715  000007 				MOVB	#7,(R5)				; *,LINEB				1797
000576	016564  000026  000010 			MOV	26(R5),10(R4)			; *(LINEB),*(CCB)			1798
000604	112764  000014  000013 			MOVB	#14,13(R4)			; *,*(CCB)				1799
000612	000474 					BR	25$				;					1800
000614	004767  000000G			18$:	JSR	PC,$CCBGT			;					1806
000620	103500 					BCS	28$
000622	042776  177400  000000 			BIC	#177400,@0(SP)			;					1807
000630	052776  001000  000000 			BIS	#1000,@0(SP)
000636	116500  000042 				MOVB	42(R5),R0			; *(LINEB),*				1808
000642	006300 					ASL	R0
000644	066007  000154'				ADD	P.AAG(R0),PC			; Case dispatch
000650	112715  000003 			19$:	MOVB	#3,(R5)				; *,LINEB				1810
000654	000402 					BR	21$				;					1808
000656	112715  000002 			20$:	MOVB	#2,(R5)				; *,LINEB				1811
000662	126527  000002  000005 		21$:	CMPB	2(R5),#5			; *(LINEB),*				1814
000670	001035 					BNE	24$
000672	016700  000002G				MOV	.CRDAT+2,R0			;					1815
000676	005060  000170 				CLR	170(R0)				;					1816
000702	016002  000020 				MOV	20(R0),R2			; *,LINEB
000706	016003  000022 				MOV	22(R0),R3			; *,$XPT$LINEB.CNT
000712	001424 					BEQ	24$
000714	032762  001000  000002 		22$:	BIT	#1000,2(R2)			; *,*(LINEB)				1818
000722	001415 					BEQ	23$
000724	032762  000400  000002 			BIT	#400,2(R2)			; *,*(LINEB)
000732	001011 					BNE	23$
000734	010246 					MOV	R2,-(SP)			; LINEB,*				1819
000736	012746  000001 				MOV	#1,-(SP)
000742	012746  000000V				MOV	#U.26,-(SP)
000746	004767  000000G				JSR	PC,$CALL
000752	062706  000006 				ADD	#6,SP
000756	062702  000104 			23$:	ADD	#104,R2				; *,LINEB
000762	077324 					SOB	R3,22$				; $XPT$LINEB.CNT,*			0000
000764	105065  000002 			24$:	CLRB	2(R5)				; *(LINEB)				1823
000770	016564  000026  000010 			MOV	26(R5),10(R4)			; *(LINEB),*(CCB)			1825
000776	112764  000016  000013 			MOVB	#16,13(R4)			; *,*(CCB)				1826
001004	112764  000016  000012 		25$:	MOVB	#16,12(R4)			; *,*(CCB)				1827
001012	004767  000000G			26$:	JSR	PC,$SCHED			;					1828
001016	105476  000000 			27$:	NEGB	@0(SP)				;					1832
001022	005726 				28$:	TST	(SP)+				;					1638
001024	000207 					RTS	PC

; Routine Size:  267 words,	Routine Base:  $CODE$ + 1470
; Maximum stack depth per invocation:  10 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  43
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (16)

000134						.PSECT	$PLIT$,  RO ,  D  

					P.AAF:						; CASE Table for LINRVR+0034		1713
000134	000000 					.WORD	0				; [3$]
000136	000030 					.WORD	30				; [4$]
000140	000056 					.WORD	56				; [5$]
000142	000122 					.WORD	122				; [7$]
000144	000160 					.WORD	160				; [9$]
000146	000334 					.WORD	334				; [14$]
000150	000554 					.WORD	554				; [18$]
000152	000516 					.WORD	516				; [17$]

					P.AAG:						; CASE Table for LINRVR+0644		1808
000154	000006 					.WORD	6				; [20$]
000156	000006 					.WORD	6				; [20$]
000160	000006 					.WORD	6				; [20$]
000162	000000 					.WORD	0				; [19$]
000164	000000 					.WORD	0				; [19$]
000166	000000 					.WORD	0				; [19$]
000170	000000 					.WORD	0				; [19$]
000172	000000 					.WORD	0				; [19$]
000174	000000 					.WORD	0				; [19$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  44
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (17)

;	  1834	routine LOG_PACKET_HEADER (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  1835	
;	  1836	!++
;	  1837	! FUNCTIONAL DESCRIPTION:
;	  1838	!
;	  1839	!  Constructs the False_NI_msg.
;	  1840	!
;	  1841	! FORMAL PARAMETERS
;	  1842	!
;	  1843	!       LINEb - line data base
;	  1844	!
;	  1845	! IMPLICIT INPUTS
;	  1846	!
;	  1847	!	None
;	  1848	!
;	  1849	! ROUTINE VALUE:
;	  1850	! COMPLETION CODES:
;	  1851	!
;	  1852	!	NONE.
;	  1853	!
;	  1854	! SIDE EFFECTS:
;	  1855	!
;	  1856	!	NONE.
;	  1857	!
;	  1858	!--
;	  1859	
;	  1860	begin
;	  1861	map CCB: ref block field (C_XPT_FIELDS);
;	  1862	require 'XPTSYM';
;	  1899	local TMP;
;	  1900	pointer PTR;
;	  1901	
;	  1902	PTR = .CCB[C_ADDR];
;	  1903	PARAMETER_CM(0,2);                      ! Multiple fields, 2
;	  1904	TMP=getb(PTR);                          ! Message type
;	  1905	PARAMETER_H_1(,TMP);                    ! Hex field, 1 byte: routing flags
;	  1906	TMP=getw(PTR);                          ! Decimal unsigned, 2 bytes:
;	  1907	PARAMETER_DU_2(,TMP);                   !   source node address
;	  1908	end;			!End of LOG_PACKET_HEADER


						.GLOBL	$TPH1


						.SBTTL	LOG.PACKET.HEADER
002516						.PSECT	$CODE$,  RO 

000000	004167  000000G			; LOG.PACKET.HEADER
					U.15:	JSR	R1,$SAVE5			;					1834
000004	005746 					TST	-(SP)
000006	016404  000020 				MOV	20(R4),R4			; *(CCB),PTR				1902
000012	005046 					CLR	-(SP)				;					1903
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  45
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (17)

000014	012700  000002 				MOV	#2,R0
000020	004767  000000G				JSR	PC,$DPCM
000024	005005 					CLR	R5				; TMP					1904
000026	152405 					BISB	(R4)+,R5			; PTR,TMP
000030	110500 					MOVB	R5,R0				; TMP,*					1905
000032	004767  000000G				JSR	PC,$TPH1
000036	112466  000002 				MOVB	(R4)+,2(SP)			; PTR,X					1906
000042	112466  000003 				MOVB	(R4)+,3(SP)			; PTR,X
000046	016605  000002 				MOV	2(SP),R5			; X,TMP
000052	010500 					MOV	R5,R0				; TMP,*					1907
000054	004767  000000G				JSR	PC,$TPDU2
000060	022626 					CMP	(SP)+,(SP)+			;					1834
000062	000207 					RTS	PC

; Routine Size:  26 words,	Routine Base:  $CODE$ + 2516
; Maximum stack depth per invocation:  9 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  46
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (18)

;	  1909	global routine LU_CMP (LINEb,CCB): MCB_DB_CCB novalue =
;	  1910	
;	  1911	!++
;	  1912	! FUNCTIONAL DESCRIPTION:
;	  1913	!
;	  1914	!  Processes a "line up" completion from Decision.
;	  1915	!
;	  1916	! FORMAL PARAMETERS
;	  1917	!
;	  1918	!	CCB[C_LIN] - circuit that is now "up"
;	  1919	!
;	  1920	! IMPLICIT INPUTS
;	  1921	!
;	  1922	!	LINEstate
;	  1923	!
;	  1924	! ROUTINE VALUE:
;	  1925	! COMPLETION CODES:
;	  1926	!
;	  1927	!	NONE.
;	  1928	!
;	  1929	! SIDE EFFECTS:
;	  1930	!
;	  1931	!	Changes circuit state.  Returns parameter CCB to SDB pool.
;	  1932	!
;	  1933	!--
;	  1934	
;	  1935	begin
;	  1936	map CCB: ref block field (C_XPT_fields);
;	  1937	require 'XPTSYM';
;	  1974	
;	  1975	LINEfunction = 0;
;	  1976	$MCB_RETURN_CCB(.CCB);
;	  1977	
;	  1978	if .LINEstate eql TC
;	  1979	then NEXT_STATE (.LINEb, RU)
;	  1980	else NEXT_ACTION (.LINEb);
;	  1981	
;	  1982	end;				!End of LU_CMP 


						.SBTTL	LU.CMP
000000	105065  000040 			LU.CMP::
					U.16:	CLRB	40(R5)				; *(LINEB)				1975
000004	004767  000000G				JSR	PC,$CCBRT			;					1976
000010	121527  000007 				CMPB	(R5),#7				; LINEB,*				1978
000014	001005 					BNE	1$
000016	012700  000010 				MOV	#10,R0				;					1979
000022	004767  000000V				JSR	PC,U.20
000026	000207 					RTS	PC				;					1978
000030	004767  000000V			1$:	JSR	PC,U.19				;					1980
000034	000207 					RTS	PC				;					1909
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  47
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (18)

; Routine Size:  15 words,	Routine Base:  $CODE$ + 2602
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  48
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (19)

;	  1983	routine NEW_FUNCTION (LINEb,FUNC): TLI_LKG_LINEb_FNC novalue =
;	  1984	
;	  1985	!++
;	  1986	! FUNCTIONAL DESCRIPTION:
;	  1987	!
;	  1988	!  Set up a new function and initiate it.
;	  1989	!
;	  1990	! FORMAL PARAMETERS
;	  1991	!
;	  1992	!	LINEB	address of the line data base
;	  1993	!	FUNC	the new function to initiate.
;	  1994	!
;	  1995	! IMPLICIT INPUTS
;	  1996	!
;	  1997	!	None
;	  1998	!
;	  1999	! ROUTINE VALUE: TRUE/FALSE
;	  2000	! COMPLETION CODES:
;	  2001	!
;	  2002	!	None
;	  2003	!
;	  2004	! SIDE EFFECTS:
;	  2005	!       None
;	  2006	!--
;	  2007	
;	  2008	begin
;	  2009	require 'XPTSYM';
;	  2046	
;	  2047	LINEfunction = .FUNC;
;	  2048	LINRVR (.LINEb);
;	  2049	end;                                    ! End of NEW_FUNCTION


						.SBTTL	NEW.FUNCTION
000000	110065  000040 			; NEW.FUNCTION
					U.17:	MOVB	R0,40(R5)			; FUNC,*(LINEB)				2047
000004	004767  176620 				JSR	PC,LINRVR			;					2048
000010	000207 					RTS	PC				;					1983

; Routine Size:  5 words,	Routine Base:  $CODE$ + 2640
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  49
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (20)

;	  2050	routine NEW_STATE (LINEb,STATE): TLI_LKG_LINEb_FNC novalue =
;	  2051	
;	  2052	!++
;	  2053	! FUNCTIONAL DESCRIPTION:
;	  2054	!
;	  2055	!  Set the line on the way to the given new state
;	  2056	!
;	  2057	! FORMAL PARAMETERS
;	  2058	!
;	  2059	!	LINEB	address of the line data base
;	  2060	!	STATE	the desired new state.
;	  2061	!
;	  2062	! IMPLICIT INPUTS
;	  2063	!
;	  2064	!	None
;	  2065	!
;	  2066	! ROUTINE VALUE: TRUE/FALSE
;	  2067	! COMPLETION CODES:
;	  2068	!
;	  2069	!	None
;	  2070	!
;	  2071	! SIDE EFFECTS:
;	  2072	!       None
;	  2073	!--
;	  2074	
;	  2075	begin
;	  2076	require 'XPTSYM';
;	  2113	
;	  2114	LINEstate_desired = .STATE;
;	  2115	if .LINEfunction geq 0
;	  2116	then LINEfunction = 0
;	  2117	else if .LINEfunction lss 0
;	  2118	     then selectone .LINEfunction of
;	  2119	              set
;	  2120	              [-FUNC_TI,-FUNC_TV]:
;	  2121	                  LINEfunction = 0;
;	  2122	              [otherwise]:
;	  2123	                  ;
;	  2124	              tes;
;	  2125	NEXT_ACTION (.LINEb);
;	  2126	end;                                    ! End of NEW_STATE


						.SBTTL	NEW.STATE
000000	110065  000042 			; NEW.STATE
					U.18:	MOVB	R0,42(R5)			; STATE,*(LINEB)			2114
000004	012700  000040 				MOV	#40,R0				;					2115
000010	060500 					ADD	R5,R0				; LINEB,*
000012	105710 					TSTB	(R0)
000014	002401 					BLT	1$
000016	000406 					BR	2$				;					2116
000020	121027  177772 			1$:	CMPB	(R0),#-6			;					2118
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  50
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (20)

000024	002404 					BLT	3$
000026	121027  177773 				CMPB	(R0),#-5
000032	003001 					BGT	3$
000034	105010 				2$:	CLRB	(R0)				;					2121
000036	004767  000000V			3$:	JSR	PC,U.19				;					2125
000042	000207 					RTS	PC				;					2050

; Routine Size:  18 words,	Routine Base:  $CODE$ + 2652
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  51
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

;	  2127	routine NEXT_ACTION (LINEb): LINKAGE_DB novalue =
;	  2128	
;	  2129	!++
;	  2130	! FUNCTIONAL DESCRIPTION:
;	  2131	!
;	  2132	!  Find the next action for the line.
;	  2133	!
;	  2134	! FORMAL PARAMETERS
;	  2135	!
;	  2136	!	LINEB	address of the line data base
;	  2137	!
;	  2138	! IMPLICIT INPUTS
;	  2139	!
;	  2140	!	None
;	  2141	!
;	  2142	! ROUTINE VALUE: TRUE/FALSE
;	  2143	! COMPLETION CODES:
;	  2144	!
;	  2145	!	None
;	  2146	!
;	  2147	! SIDE EFFECTS:
;	  2148	!       None
;	  2149	!--
;	  2150	
;	  2151	begin
;	  2152	require 'XPTSYM';
;	  2189	
;	  2190	case .LINEstate_desired from HA to RU of
;	  2191	    set
;	  2192	    [HA]:
;	  2193	        begin
;	  2194	        Listen_clock = 0;
;	  2195	        Send_TI = false;
;	  2196	        Send_TV = false;
;	  2197	
;	  2198	        if .LINEfunction neq 0 then return;
;	  2199	
;	  2200	        if .LINEstate eql HA then return;
;	  2201	
;	  2202	        selectone .DLLstate of
;	  2203	            set
;	  2204	            [DLL_OFF,DLL_FREE]:
;	  2205	                ;
;	  2206	            [otherwise]:
;	  2207	                return NEW_FUNCTION (.LINEb, FUNCstop);
;	  2208	            tes;
;	  2209	
;	  2210	        if .XPTstate eql ON
;	  2211	        then return NEW_FUNCTION (.LINEb, FUNCline_down);
;	  2212	
;	  2213	        if .Freeing and (.DLLstate neq DLL_FREE)
;	  2214	        then return NEW_FUNCTION (.LINEb, FUNCrelease);
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  52
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

;	  2215	
;	  2216	        LINEstate = .LINEstate_desired;
;	  2217	        end;
;	  2218	    [DT]:
;	  2219	        begin
;	  2220	        Listen_clock = 0;
;	  2221	        Send_TI = false;
;	  2222	        Send_TV = false;
;	  2223	
;	  2224	        if .LINEfunction neq 0 then return;
;	  2225	
;	  2226	        if .LINEstate eql DT then return;
;	  2227	
;	  2228	        return NEW_FUNCTION (.LINEb, FUNCstop);
;	  2229	        end;
;	  2230	    [OFF]:
;	  2231	        begin
;	  2232	        Listen_clock = 0;
;	  2233	        Send_TI = false;
;	  2234	        Send_TV = false;
;	  2235	
;	  2236	        if .LINEfunction neq 0 then return;
;	  2237	
;	  2238	        if .LINEstate eql OFF then return;
;	  2239	
;	  2240	        selectone .DLLstate of
;	  2241	            set
;	  2242	            [DLL_OFF,DLL_FREE]:
;	  2243	                ;
;	  2244	            [otherwise]:
;	  2245	                return NEW_FUNCTION (.LINEb, FUNCstop);
;	  2246	            tes;
;	  2247	
;	  2248	        return NEW_FUNCTION (.LINEb, FUNCline_down);
;	  2249	        end;
;	  2250	    [LR]:
;	  2251	        begin
;	  2252	        Listen_clock = 0;
;	  2253	        Send_TI = false;
;	  2254	        Send_TV = false;
;	  2255	
;	  2256	        if .LINEfunction neq 0 then return;
;	  2257	
;	  2258	        if .LINEstate eql LR then return;
;	  2259	
;	  2260	        return NEW_FUNCTION (.LINEb, FUNCline_down);
;	  2261	        end;
;	  2262	    [DS]:
;	  2263	        begin
;	  2264	        Listen_clock = 0;
;	  2265	        Send_TI = false;
;	  2266	        Send_TV = false;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  53
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

;	  2267	
;	  2268	        if .LINEfunction neq 0 then return;
;	  2269	
;	  2270	        if .LINEstate eql DS then return;
;	  2271	
;	  2272	        return NEW_FUNCTION (.LINEB, FUNCinitialize);
;	  2273	        end;
;	  2274	    [TI]:                               ! Line running; Waiting for TI
;	  2275	        begin
;	  2276	
;	  2277	        if .DLLstate neq DLL_RUNNING then return;
;	  2278	
;	  2279	        If .LINEstate neq TI
;	  2280	        then begin
;	  2281	             LINEstate = TI;
;	  2282	             Send_TI = true;
;	  2283	             end;
;	  2284	
;	  2285	        if .LINEfunction neq 0 then return;
;	  2286	
;	  2287	        selectone true of
;	  2288	            set
;	  2289	            [.Send_TI]:
;	  2290	                return NEW_FUNCTION (.LINEB, FUNC_TI);
;	  2291	            [.Send_TV]:
;	  2292	                return NEW_FUNCTION (.LINEB, FUNC_TV);
;	  2293	            [otherwise]:
;	  2294	                ;
;	  2295	            tes;
;	  2296	
;	  2297	        return;
;	  2298	        end;
;	  2299	    [TV]:                               ! TI received; waiting for TV
;	  2300	        begin
;	  2301	
;	  2302	        if .DLLstate neq DLL_RUNNING then return;
;	  2303	
;	  2304	        if .Nty eql 0 then return;
;	  2305	
;	  2306	        LINEstate = TV;
;	  2307	
;	  2308	        if .LINEfunction neq 0 then return;
;	  2309	
;	  2310	        selectone true of
;	  2311	            set
;	  2312	            [.Send_TI]:
;	  2313	                return NEW_FUNCTION (.LINEB, FUNC_TI);
;	  2314	            [.Send_TV]:
;	  2315	                return NEW_FUNCTION (.LINEB, FUNC_TV);
;	  2316	            [otherwise]:
;	  2317	                ;
;	  2318	            tes;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  54
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

;	  2319	
;	  2320	        return;
;	  2321	        end;
;	  2322	    [TC]:                               ! TI(/TV) exchanged
;	  2323	        begin
;	  2324	
;	  2325	        if .LINEfunction neq 0 then return;
;	  2326	
;	  2327	        if .DLLstate neq DLL_RUNNING then return;
;	  2328	
;	  2329	        selectone true of
;	  2330	            set
;	  2331	            [.Send_TI]:
;	  2332	                return NEW_FUNCTION (.LINEB, FUNC_TI);
;	  2333	            [.Send_TV]:
;	  2334	                return NEW_FUNCTION (.LINEB, FUNC_TV);
;	  2335	            [otherwise]:
;	  2336	                ;
;	  2337	            tes;
;	  2338	
;	  2339	        if .Nty neq 0
;	  2340	        then return NEW_FUNCTION (.LINEB, FUNCline_up);
;	  2341	
;	  2342	        return;
;	  2343	        end;
;	  2344	    [RU]:
;	  2345	        begin
;	  2346	
;	  2347	        if .LINEfunction neq 0 then return;
;	  2348	
;	  2349	        if .DLLstate neq DLL_RUNNING then return;
;	  2350	
;	  2351	        if .XPTstate neq ON then return;
;	  2352	
;	  2353	        if .LINEstate eql RU then return;
;	  2354	
;	  2355	        Listen_clock = 0;		! Stop the initialization timer.
;	  2356	        LINEstate = RU;
;	  2357	        CCB_CMP(.LINEb);                ! Clean out the function CCB queue
;	  2358	
;	  2359	        selectone .Nty of
;	  2360	            set
;	  2361	            [Full,Small]:
;	  2362	                Listen_clock = .Listen_timer;
;	  2363	            [TOPS20]:
;	  2364	                begin
;	  2365	                False_NI_LINEb = .LINEb;
;	  2366	                $XPT_for_each_LINEb_do_begin    ! Start up all adjacent
;	  2367	                    if .Ph2circuit and not .Intercept   ! aspiring
;	  2368	                    then CALL$L(INI_LIN,.LINEb);        ! Phase II nodes
;	  2369	                $XPT_next_LINEb_end;
;	  2370	                end;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  55
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

;	  2371	            [otherwise]:
;	  2372	                ;
;	  2373	            tes;
;	  2374	
;	  2375	        return;
;	  2376	        end;
;	  2377	    tes;
;	  2378	
;	  2379	end;                                    ! End of NEXT_ACTION


						.SBTTL	NEXT.ACTION
000000	004167  000000G			; NEXT.ACTION
					U.19:	JSR	R1,$SAVE5			;					2127
000004	012701  000040 				MOV	#40,R1				;					2198
000010	060501 					ADD	R5,R1				; LINEB,*
000012	116500  000042 				MOVB	42(R5),R0			; *(LINEB),*				2190
000016	006300 					ASL	R0
000020	066007  000176'				ADD	P.AAH(R0),PC			; Case dispatch
000024	005065  000046 			1$:	CLR	46(R5)				; *(LINEB)				2194
000030	042715  003000 				BIC	#3000,(R5)			; *,LINEB				2196
000034	105711 					TSTB	(R1)				;					2198
000036	001165 					BNE	14$
000040	105715 					TSTB	(R5)				; LINEB					2200
000042	001554 					BEQ	12$
000044	116500  000006 				MOVB	6(R5),R0			; *(LINEB),*				2202
000050	002452 					BLT	5$
000052	020027  000001 				CMP	R0,#1
000056	003047 					BGT	5$				;					2207
000060	105761  000001 				TSTB	1(R1)				;					2210
000064	001460 					BEQ	7$				;					2211
000066	032715  004000 				BIT	#4000,(R5)			; *,LINEB				2213
000072	001405 					BEQ	2$
000074	105700 					TSTB	R0
000076	001403 					BEQ	2$
000100	012700  000002 				MOV	#2,R0				;					2214
000104	000564 					BR	19$
000106	116515  000042 			2$:	MOVB	42(R5),(R5)			; *(LINEB),LINEB			2216
000112	000207 					RTS	PC				;					2190
000114	005065  000046 			3$:	CLR	46(R5)				; *(LINEB)				2220
000120	042715  003000 				BIC	#3000,(R5)			; *,LINEB				2222
000124	105711 					TSTB	(R1)				;					2224
000126	001166 					BNE	21$
000130	121527  000001 				CMPB	(R5),#1				; LINEB,*				2226
000134	001566 					BEQ	22$
000136	000417 					BR	5$				;					2228
000140	005065  000046 			4$:	CLR	46(R5)				; *(LINEB)				2232
000144	042715  003000 				BIC	#3000,(R5)			; *,LINEB				2234
000150	105711 					TSTB	(R1)				;					2236
000152	001154 					BNE	21$
000154	121527  000002 				CMPB	(R5),#2				; LINEB,*				2238
000160	001554 					BEQ	22$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  56
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

000162	116500  000006 				MOVB	6(R5),R0			; *(LINEB),*				2240
000166	002403 					BLT	5$
000170	020027  000001 				CMP	R0,#1
000174	003414 					BLE	7$
000176	012700  000004 			5$:	MOV	#4,R0				;					2245
000202	000525 					BR	19$
000204	005065  000046 			6$:	CLR	46(R5)				; *(LINEB)				2252
000210	042715  003000 				BIC	#3000,(R5)			; *,LINEB				2254
000214	105711 					TSTB	(R1)				;					2256
000216	001162 					BNE	24$
000220	121527  000003 				CMPB	(R5),#3				; LINEB,*				2258
000224	001570 					BEQ	25$
000226	012700  000007 			7$:	MOV	#7,R0				;					2260
000232	000511 					BR	19$
000234	005065  000046 			8$:	CLR	46(R5)				; *(LINEB)				2264
000240	042715  003000 				BIC	#3000,(R5)			; *,LINEB				2266
000244	105711 					TSTB	(R1)				;					2268
000246	001146 					BNE	24$
000250	121527  000004 				CMPB	(R5),#4				; LINEB,*				2270
000254	001554 					BEQ	25$
000256	012700  000003 				MOV	#3,R0				;					2272
000262	000475 					BR	19$
000264	126527  000006  000004 		9$:	CMPB	6(R5),#4			; *(LINEB),*				2277
000272	001172 					BNE	28$
000274	121527  000005 				CMPB	(R5),#5				; LINEB,*				2279
000300	001404 					BEQ	10$
000302	112715  000005 				MOVB	#5,(R5)				; *,LINEB				2281
000306	052715  001000 				BIS	#1000,(R5)			; *,LINEB				2282
000312	105711 				10$:	TSTB	(R1)				;					2285
000314	001161 					BNE	28$
000316	032715  001000 				BIT	#1000,(R5)			; *,LINEB				2287
000322	001037 					BNE	15$				;					2290
000324	032715  002000 				BIT	#2000,(R5)			; *,LINEB				2287
000330	001553 					BEQ	28$
000332	000441 					BR	17$				;					2292
000334	126527  000006  000004 		11$:	CMPB	6(R5),#4			; *(LINEB),*				2302
000342	001146 					BNE	28$
000344	105765  000002 				TSTB	2(R5)				; *(LINEB)				2304
000350	001543 					BEQ	28$
000352	112715  000006 				MOVB	#6,(R5)				; *,LINEB				2306
000356	105711 					TSTB	(R1)				;					2308
000360	001137 					BNE	28$
000362	032715  001000 				BIT	#1000,(R5)			; *,LINEB				2310
000366	001015 					BNE	15$				;					2313
000370	032715  002000 				BIT	#2000,(R5)			; *,LINEB				2310
000374	001531 				12$:	BEQ	28$
000376	000417 					BR	17$				;					2315
000400	105711 				13$:	TSTB	(R1)				;					2325
000402	001126 					BNE	28$
000404	126527  000006  000004 			CMPB	6(R5),#4			; *(LINEB),*				2327
000412	001122 				14$:	BNE	28$
000414	032715  001000 				BIT	#1000,(R5)			; *,LINEB				2329
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  57
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)

000420	001403 					BEQ	16$
000422	012700  000005 			15$:	MOV	#5,R0				;					2332
000426	000413 					BR	19$
000430	032715  002000 			16$:	BIT	#2000,(R5)			; *,LINEB				2329
000434	001403 					BEQ	18$
000436	012700  000006 			17$:	MOV	#6,R0				;					2334
000442	000405 					BR	19$
000444	105765  000002 			18$:	TSTB	2(R5)				; *(LINEB)				2339
000450	001503 					BEQ	28$
000452	012700  000010 				MOV	#10,R0				;					2340
000456	004767  177240 			19$:	JSR	PC,U.17
000462	000207 					RTS	PC
000464	105711 				20$:	TSTB	(R1)				;					2347
000466	001074 					BNE	28$
000470	126527  000006  000004 			CMPB	6(R5),#4			; *(LINEB),*				2349
000476	001070 					BNE	28$
000500	105761  000001 				TSTB	1(R1)				;					2351
000504	001065 				21$:	BNE	28$
000506	121527  000010 				CMPB	(R5),#10			; LINEB,*				2353
000512	001462 				22$:	BEQ	28$
000514	005065  000046 				CLR	46(R5)				; *(LINEB)				2355
000520	112715  000010 				MOVB	#10,(R5)			; *,LINEB				2356
000524	004767  175004 				JSR	PC,U.2				;					2357
000530	116500  000002 				MOVB	2(R5),R0			; *(LINEB),*				2359
000534	020027  000002 				CMP	R0,#2
000540	002407 					BLT	23$
000542	020027  000003 				CMP	R0,#3
000546	003004 					BGT	23$
000550	016565  000024  000046 			MOV	24(R5),46(R5)			; *(LINEB),*(LINEB)			2362
000556	000207 					RTS	PC				;					2359
000560	020027  000005 			23$:	CMP	R0,#5
000564	001035 				24$:	BNE	28$
000566	016700  000002G				MOV	.CRDAT+2,R0			;					2364
000572	010560  000170 				MOV	R5,170(R0)			; LINEB,*				2365
000576	016005  000020 				MOV	20(R0),R5			; *,LINEB
000602	016001  000022 				MOV	22(R0),R1			; *,$XPT$LINEB.CNT
000606	001424 				25$:	BEQ	28$
000610	032765  001000  000002 		26$:	BIT	#1000,2(R5)			; *,*(LINEB)				2367
000616	001415 					BEQ	27$
000620	032765  000400  000002 			BIT	#400,2(R5)			; *,*(LINEB)
000626	001011 					BNE	27$
000630	010546 					MOV	R5,-(SP)			; LINEB,*				2368
000632	012746  000001 				MOV	#1,-(SP)
000636	012746  001370'				MOV	#INI.LIN,-(SP)
000642	004767  000000G				JSR	PC,$CALL
000646	062706  000006 				ADD	#6,SP
000652	062705  000104 			27$:	ADD	#104,R5				; *,LINEB
000656	077124 					SOB	R1,26$				; $XPT$LINEB.CNT,*			0000
000660	000207 				28$:	RTS	PC				;					2127

; Routine Size:  217 words,	Routine Base:  $CODE$ + 2716
; Maximum stack depth per invocation:  10 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  58
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (21)



000176						.PSECT	$PLIT$,  RO ,  D  

					P.AAH:						; CASE Table for NEXT.ACTION+0020	2190
000176	000000 					.WORD	0				; [1$]
000200	000070 					.WORD	70				; [3$]
000202	000114 					.WORD	114				; [4$]
000204	000160 					.WORD	160				; [6$]
000206	000210 					.WORD	210				; [8$]
000210	000240 					.WORD	240				; [9$]
000212	000310 					.WORD	310				; [11$]
000214	000354 					.WORD	354				; [13$]
000216	000440 					.WORD	440				; [20$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  59
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (22)

;	  2380	routine NEXT_STATE (LINEb,STATE): TLI_LKG_LINEb_FNC novalue =
;	  2381	
;	  2382	!++
;	  2383	! FUNCTIONAL DESCRIPTION:
;	  2384	!
;	  2385	!  This is called on an automatic line state change.  It only changes
;	  2386	!  the desired state is not forcing a different state.
;	  2387	!
;	  2388	! FORMAL PARAMETERS
;	  2389	!
;	  2390	!	LINEB	address of the line data base
;	  2391	!	STATE	the desired new state.
;	  2392	!
;	  2393	! IMPLICIT INPUTS
;	  2394	!
;	  2395	!	None
;	  2396	!
;	  2397	! ROUTINE VALUE: TRUE/FALSE
;	  2398	! COMPLETION CODES:
;	  2399	!
;	  2400	!	None
;	  2401	!
;	  2402	! SIDE EFFECTS:
;	  2403	!       None
;	  2404	!--
;	  2405	
;	  2406	begin
;	  2407	require 'XPTSYM';
;	  2444	
;	  2445	if .LINEstate_desired eql .LINEstate
;	  2446	then LINEstate_desired = .STATE;
;	  2447	
;	  2448	NEXT_ACTION (.LINEb);
;	  2449	end;                                    ! End of NEXT_STATE


						.SBTTL	NEXT.STATE
003600						.PSECT	$CODE$,  RO 

000000	126515  000042 			; NEXT.STATE
					U.20:	CMPB	42(R5),(R5)			; *(LINEB),LINEB			2445
000004	001002 					BNE	1$
000006	110065  000042 				MOVB	R0,42(R5)			; STATE,*(LINEB)			2446
000012	004767  177100 			1$:	JSR	PC,U.19				;					2448
000016	000207 					RTS	PC				;					2380

; Routine Size:  8 words,	Routine Base:  $CODE$ + 3600
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  60
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (23)

;	  2450	global routine RCV_HLO (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  2451	
;	  2452	!++
;	  2453	! FUNCTIONAL DESCRIPTION:
;	  2454	!
;	  2455	!
;	  2456	! FORMAL PARAMETERS
;	  2457	!
;	  2458	!	CCB[C_LIN] - Index of circuit data base entry
;	  2459	!	CCB[C_BIAS] - buffer descriptor for the NI
;	  2460	!
;	  2461	! IMPLICIT INPUTS
;	  2462	!
;	  2463	!	LINEstate
;	  2464	!
;	  2465	! ROUTINE VALUE:
;	  2466	! COMPLETION CODES:
;	  2467	!
;	  2468	!	NONE.
;	  2469	!
;	  2470	! SIDE EFFECTS:
;	  2471	!
;	  2472	!
;	  2473	!--
;	  2474	
;	  2475	begin
;	  2476	map CCB: ref block field(C_fields);
;	  2477	require 'XPTSYM';
;	  2514	label MSG_CHECK;
;	  2515	MSG_CHECK:
;	  2516	begin                                   ! MSG_CHECK
;	  2517	local CNT;
;	  2518	pointer PTR;
;	  2519	
;	  2520	! The message is already mapped.
;	  2521	
;	  2522	PTR = ch$plus(.CCB[C_ADDR],1);          ! Address buffer past HELLO flag
;	  2523	
;	  2524	if (CNT = .CCB[C_CNT] - 4) lss 0 then leave MSG_CHECK;
;	  2525	
;	  2526	!
;	  2527	!  Validate the source node address.
;	  2528	!
;	  2529	
;	  2530	if getw(PTR) neq .Nid
;	  2531	then begin                              ! Wrong source node:
;	  2532	     $NM_LOG_BEGIN();                   ! Build event buffer
;	  2533	     LOG_PACKET_HEADER(.LINEb,.CCB);	!   move packet hdr into event buffer
;	  2534	     PARAMETER_CM(4,1);                 !   and expected
;	  2535	     PARAMETER_DU_2(,Nid);              !   node address
;	  2536	     $NM_LOG_END(4^6+$XPT$E_LOF,.NMXid);
;	  2537	     CALL$L(INI_LIN,.LINEb);            !   signal the line should be killed
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  61
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (23)

;	  2538	     leave MSG_CHECK;
;	  2539	     end;
;	  2540	
;	  2541	!
;	  2542	!  Validate the data
;	  2543	!
;	  2544	
;	  2545	if .CNT neq getb(PTR)                   ! Extra or missing data bytes:
;	  2546	then begin                              !   fail
;	  2547	     CALL$L(INI_LIN,.LINEb);
;	  2548	     leave MSG_CHECK;
;	  2549	     end;
;	  2550	
;	  2551	if .CNT neq 0
;	  2552	then do begin
;	  2553	        if getb(PTR) neq %o'252'        !   wrong pattern:
;	  2554	        then begin
;	  2555	             $NM_LOG_BEGIN();           !  log the event
;	  2556	             PARAMETER_C_1(5,uplit(11));
;	  2557	             $NM_LOG_END(4^6+$XPT$E_LLF,.NMXid);
;	  2558	             CALL$L(INI_LIN,.LINEb);
;	  2559	             leave MSG_CHECK;
;	  2560	             end;
;	  2561	        end
;	  2562	     while (CNT = .CNT - 1) neq 0;
;	  2563	
;	  2564	end;                                    ! MSG_CHECK
;	  2565	end;				!End of RCV_HLO



000220						.PSECT	$PLIT$,  RO ,  D  
000220	000013 				P.AAI:	.WORD	13


						.SBTTL	RCV.HLO
003620						.PSECT	$CODE$,  RO 

000000	004167  000000G			RCV.HLO::
					U.21:	JSR	R1,$SAVE3			;					2450
000004	005746 					TST	-(SP)
000006	016402  000020 				MOV	20(R4),R2			; *(CCB),PTR				2522
000012	005202 					INC	R2				; PTR
000014	016403  000022 				MOV	22(R4),R3			; *(CCB),CNT				2524
000020	162703  000004 				SUB	#4,R3				; *,CNT
000024	100474 					BMI	7$
000026	112216 					MOVB	(R2)+,(SP)			; PTR,X					2530
000030	112266  000001 				MOVB	(R2)+,1(SP)			; PTR,X
000034	011600 					MOV	(SP),R0				; X,*
000036	020065  000004 				CMP	R0,4(R5)			; *,*(LINEB)
000042	001421 					BEQ	1$
000044	004767  000000G				JSR	PC,$NLBEG			;					2532
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  62
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (23)

000050	004767  176622 				JSR	PC,U.15				;					2533
000054	012746  000004 				MOV	#4,-(SP)			;					2534
000060	012700  000001 				MOV	#1,R0
000064	004767  000000G				JSR	PC,$DPCM
000070	016500  000004 				MOV	4(R5),R0			; *(LINEB),*				2535
000074	004767  000000G				JSR	PC,$TPDU2
000100	012700  000411 				MOV	#411,R0				;					2536
000104	000425 					BR	4$
000106	005000 				1$:	CLR	R0				;					2545
000110	152200 					BISB	(R2)+,R0			; PTR,*
000112	020300 					CMP	R3,R0				; CNT,*
000114	001402 					BEQ	2$
000116	010546 					MOV	R5,-(SP)			; LINEB,*				2547
000120	000424 					BR	5$
000122	005703 				2$:	TST	R3				; CNT					2551
000124	001434 					BEQ	7$
000126	122227  000252 			3$:	CMPB	(R2)+,#252			; PTR,*					2553
000132	001430 					BEQ	6$
000134	004767  000000G				JSR	PC,$NLBEG			;					2555
000140	012746  000005 				MOV	#5,-(SP)			;					2556
000144	116700  000220'				MOVB	P.AAI,R0
000150	004767  000000G				JSR	PC,$DPC1
000154	012700  000407 				MOV	#407,R0				;					2557
000160	016501  000034 			4$:	MOV	34(R5),R1			; *(LINEB),*
000164	004767  000000G				JSR	PC,$NLEND
000170	010516 					MOV	R5,(SP)				; LINEB,*				2558
000172	012746  000001 			5$:	MOV	#1,-(SP)
000176	012746  001370'				MOV	#INI.LIN,-(SP)
000202	004767  000000G				JSR	PC,$CALL
000206	062706  000006 				ADD	#6,SP				;					2559
000212	000401 					BR	7$
000214	077334 				6$:	SOB	R3,3$				; CNT,*					2562
000216	005726 				7$:	TST	(SP)+				;					2450
000220	000207 					RTS	PC

; Routine Size:  73 words,	Routine Base:  $CODE$ + 3620
; Maximum stack depth per invocation:  9 words
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  63
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

;	  2566	global routine RCV_NI (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  2567	
;	  2568	!++
;	  2569	! FUNCTIONAL DESCRIPTION:
;	  2570	!
;	  2571	!  Processes a received Node Init message (Phase II variety).  If we are in
;	  2572	!  the TI state (expecting a Transport Init), we will send a Node Init, a
;	  2573	!  Node Verify if one is requested, and declare a "line up".  (For sim-
;	  2574	!  plicity, this implementation will never request verification from a Phase
;	  2575	!  II node.) (The "line up" will be delayed until the transmit of the Trans-
;	  2576	!  port Init and Transport Verify have completed.)  The adjacent node type
;	  2577	!  for the circuit will be set to "Phase II".
;	  2578	!
;	  2579	! FORMAL PARAMETERS
;	  2580	!
;	  2581	!	CCB[C_LIN] - Index of circuit data base entry
;	  2582	!	CCB[C_BIAS] - buffer descriptor for the NI
;	  2583	!
;	  2584	! IMPLICIT INPUTS
;	  2585	!
;	  2586	!	LINEstate
;	  2587	!
;	  2588	! ROUTINE VALUE:
;	  2589	! COMPLETION CODES:
;	  2590	!
;	  2591	!	NONE.
;	  2592	!
;	  2593	! SIDE EFFECTS:
;	  2594	!
;	  2595	!	Will mark the node at the other end as Phase II and will perform
;	  2596	!	special Phase II processing against it from now on (until the circuit
;	  2597	!	goes down).  May commence or restart an initialization sequence if
;	  2598	!	we are in the wrong state.
;	  2599	!
;	  2600	!--
;	  2601	
;	  2602	begin
;	  2603	map CCB: ref block field (C_fields);
;	  2604	require 'XPTSYM';
;	  2641	label MSG_CHECK,TI_CHECK;
;	  2642	local GOOD,NODEADDR,NAMEPTR,REQUESTS,BLKSIZE,RET;
;	  2643	
;	  2644	MSG_CHECK:
;	  2645	begin                                   ! MSG_CHECK
;	  2646	pointer PTR;
;	  2647	
;	  2648	MAPBUF(.CCB,PTR);
;	  2649	
;	  2650	!
;	  2651	!  Validate the NI message; if it's no good, treat as a BAD_MSG
;	  2652	!
;	  2653	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  64
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

;	  2654	PTR = ch$plus(.PTR,2);                  ! Bypass MSGFLG and STARTTYPE
;	  2655	
;	  2656	begin                                   ! Get NODEADDR
;	  2657	if biton((NODEADDR = getb(PTR)),%o'200')
;	  2658	then begin
;	  2659	     NODEADDR = .NODEADDR <0, 7>;
;	  2660	     NODEADDR = .NODEADDR + getb(PTR)^7;
;	  2661	     end;
;	  2662	end;
;	  2663	
;	  2664	if .NODEADDR gtru NN
;	  2665	then begin
;	  2666	     GOOD = 4;                          ! Source address too large
;	  2667	     leave MSG_CHECK;
;	  2668	     end;
;	  2669	
;	  2670	begin
;	  2671	local LEN;
;	  2672	NAMEPTR = .PTR;
;	  2673	LEN = getb (PTR);                       ! Get node name length
;	  2674	
;	  2675	selectone .LEN of
;	  2676	    set
;	  2677	    [1 to 6]:
;	  2678	        begin
;	  2679	        PTR = ch$plus(.PTR,.LEN);       ! Bump pointer past name
;	  2680	        end;
;	  2681	    [otherwise]:
;	  2682	        begin
;	  2683	        GOOD = 7;
;	  2684	        leave MSG_CHECK;
;	  2685	        end;
;	  2686	    tes;
;	  2687	end;
;	  2688	
;	  2689	PTR = ch$plus(.PTR,1);                  ! Bypass FUNCTIONS
;	  2690	
;	  2691	REQUESTS = getb(PTR);                   ! Save REQUESTS
;	  2692	
;	  2693	BLKSIZE = getw(PTR);                    ! BLKSIZE
;	  2694	
;	  2695	if .BLKSIZE gtru .PH2size               ! BLKSIZE too large -
;	  2696	then begin
;	  2697	     GOOD = 5;                          !  fail initialization
;	  2698	     leave MSG_CHECK;
;	  2699	     end;
;	  2700	
;	C 2701	%(
;	C 2702	PTR = ch$plus(.PTR,2);                  ! NSPSIZE
;	C 2703	
;	C 2704	PTR = ch$plus(.PTR,2);                  ! MAXLNKS
;	C 2705	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  65
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

;	C 2706	PTR = ch$plus(.PTR,3);                  ! ROUTVER
;	C 2707	
;	C 2708	PTR = ch$plus(.PTR,3);                  ! COMMVER
;	C 2709	
;	C 2710	begin
;	C 2711	local LEN;
;	C 2712	LEN = GETB(PTR);
;	C 2713	PTR = ch$plus(.PTR,.LEN);               ! SYSVER
;	C 2714	end;
;	  2715	)%
;	  2716	
;	  2717	GOOD = 0;
;	  2718	end;                                    ! MSG_CHECK
;	  2719	
;	  2720	!
;	  2721	!  Dispatch on circuit state
;	  2722	!
;	  2723	
;	  2724	case .LINEstate from HA to RU of
;	  2725	    set
;	  2726	    [TI]:                               ! This is the big case
;	  2727	TI_CHECK:
;	  2728	        begin
;	  2729	        MAP$(.CCB[C_BIAS]);             ! Re-map the buffer
;	  2730	
;	  2731	        !
;	  2732	        !  Good Node Init - send Verification (if requested) and change state
;	  2733	        !
;	  2734	
;	  2735	        if .GOOD eql 0
;	  2736	        then begin
;	  2737	             Ph2circuit = true;
;	  2738	             if not .DTEcircuit         !  Not DTE circuit -
;	  2739	             then begin
;	  2740	                  if (not .Intercept) and
;	  2741	                     (.False_NI_LINEb eqla 0)
;	  2742	                  then begin
;	  2743	                       NEW_STATE (.LINEb, DT);
;	  2744	                       leave TI_CHECK;
;	  2745	                       end;
;	  2746	                  Nty = PhTwo;          !  type is standard Phase II
;	  2747	                  end
;	  2748	             else begin                 !  DTE circuit -
;	  2749	                  GET_FALSE_NI(.LINEb,.CCB);    ! Save NI for later
;	  2750	                  Nty = TOPS20;         !  Node type is TOPS-20
;	  2751	                  end;
;	  2752	             Nid = .NODEADDR;           ! Set node address,
;	  2753	             Nnml = getb (NAMEPTR);     ! name length,
;	  2754	             ch$move (.Nnml,.NAMEPTR,byt$ptr(Nnm));     ! and name.
;	  2755	             Block_size = .BLKSIZE;     ! Block size.
;	  2756	             if not .Ph2only            ! If Phase II NI not sent yet,
;	  2757	             then Send_TI = true;       ! then set to send one.
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  66
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

;	  2758	             if .REQUESTS<0,1> neq 0    ! If requested,
;	  2759	             then Send_TV = true;       ! set to send OTV.
;	  2760	             if .Request_OTV
;	  2761	             then NEXT_STATE (.LINEb, TV)  ! Wait for TV.
;	  2762	             else NEXT_STATE (.LINEb, TC); ! Request a line-up.
;	  2763	             end;
;	  2764	        end;
;	  2765	    [RU]:                               ! Circuit running, message unexpected -
;	  2766		GOOD = 1;                       !    and treat as garbage message
;	  2767	    [TV,TC]:				! Circuit initializing,
;	  2768		GOOD = 2;                       !    and treat as garbage message
;	  2769	    [inrange]:				! In middle of DLL protocol -
;	  2770	        GOOD = 0;
;	  2771	    tes;
;	  2772	
;	  2773	if .GOOD neq 0                          ! If error, then
;	  2774	then BAD_MSG(.LINEb,.CCB,.GOOD);        ! treat as garbage message
;	  2775	end;				!End of RCV_NI


						.GLOBL	KISAR6


						.SBTTL	RCV.NI
000000	004167  000000G			RCV.NI::
					U.22:	JSR	R1,$SAVE5			;					2566
000004	162706  000012 				SUB	#12,SP
000010	010566  000004 				MOV	R5,4(SP)
000014	016467  000016  000000G			MOV	16(R4),KISAR6			; *(CCB),*				2648
000022	016401  000020 				MOV	20(R4),R1			; *(CCB),PTR
000026	062701  000002 				ADD	#2,R1				; *,PTR					2657
000032	005002 					CLR	R2				; NODEADDR
000034	152102 					BISB	(R1)+,R2			; PTR,NODEADDR
000036	100010 					BPL	1$
000040	042702  177600 				BIC	#177600,R2			; *,NODEADDR				2659
000044	005000 					CLR	R0				;					2660
000046	152100 					BISB	(R1)+,R0			; PTR,*
000050	072027  000007 				ASH	#7,R0
000054	060200 					ADD	R2,R0				; NODEADDR,*
000056	010002 					MOV	R0,R2				; *,NODEADDR
000060	016705  000002G			1$:	MOV	.CRDAT+2,R5			;					2664
000064	020265  000016 				CMP	R2,16(R5)			; NODEADDR,*
000070	101403 					BLOS	2$
000072	012716  000004 				MOV	#4,(SP)				; *,GOOD				2666
000076	000437 					BR	6$				;					2667
000100	010103 				2$:	MOV	R1,R3				; PTR,NAMEPTR				2672
000102	005000 					CLR	R0				; LEN					2673
000104	152100 					BISB	(R1)+,R0			; PTR,LEN
000106	005700 					TST	R0				; LEN					2675
000110	003405 					BLE	3$
000112	020027  000006 				CMP	R0,#6				; LEN,*
000116	003002 					BGT	3$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  67
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

000120	060001 					ADD	R0,R1				; LEN,PTR				2679
000122	000403 					BR	4$				;					2675
000124	012716  000007 			3$:	MOV	#7,(SP)				; *,GOOD				2683
000130	000422 					BR	6$				;					2684
000132	005201 				4$:	INC	R1				; PTR					2691
000134	112166  000006 				MOVB	(R1)+,6(SP)			; PTR,REQUESTS
000140	105066  000007 				CLRB	7(SP)				; REQUESTS
000144	112166  000010 				MOVB	(R1)+,10(SP)			; PTR,X					2693
000150	112166  000011 				MOVB	(R1)+,11(SP)			; PTR,X
000154	016601  000010 				MOV	10(SP),R1			; X,BLKSIZE
000160	020165  000126 				CMP	R1,126(R5)			; BLKSIZE,*				2695
000164	101403 					BLOS	5$
000166	012716  000005 				MOV	#5,(SP)				; *,GOOD				2697
000172	000401 					BR	6$				;					2698
000174	005016 				5$:	CLR	(SP)				; GOOD					2717
000176	117600  000004 			6$:	MOVB	@4(SP),R0			;					2724
000202	006300 					ASL	R0
000204	066007  000222'				ADD	P.AAJ(R0),PC			; Case dispatch
000210	016467  000016  000000G		7$:	MOV	16(R4),KISAR6			; *(CCB),*				2729
000216	005716 					TST	(SP)				; GOOD					2735
000220	001140 					BNE	20$
000222	012700  000002 				MOV	#2,R0				;					2736
000226	066600  000004 				ADD	4(SP),R0
000232	010066  000002 				MOV	R0,2(SP)
000236	052710  001000 				BIS	#1000,(R0)			;					2737
000242	032710  010000 				BIT	#10000,(R0)			;					2738
000246	001021 					BNE	9$
000250	032710  000400 				BIT	#400,(R0)			;					2740
000254	001012 					BNE	8$
000256	005765  000170 				TST	170(R5)				;					2741
000262	001007 					BNE	8$
000264	016605  000004 				MOV	4(SP),R5			;					2743
000270	012700  000001 				MOV	#1,R0
000274	004767  176310 				JSR	PC,U.18
000300	000506 					BR	18$				;					2744
000302	112776  000004  000002 		8$:	MOVB	#4,@2(SP)			;					2746
000310	000407 					BR	10$				;					2738
000312	016605  000004 			9$:	MOV	4(SP),R5			;					2749
000316	004767  174534 				JSR	PC,U.10
000322	112776  000005  000002 			MOVB	#5,@2(SP)			;					2750
000330	016600  000004 			10$:	MOV	4(SP),R0			;					2752
000334	010260  000004 				MOV	R2,4(R0)			; NODEADDR,*
000340	112360  000007 				MOVB	(R3)+,7(R0)			; NAMEPTR,*				2753
000344	010002 					MOV	R0,R2				;					2754
000346	116200  000007 				MOVB	7(R2),R0
000352	010046 					MOV	R0,-(SP)
000354	010346 					MOV	R3,-(SP)			; NAMEPTR,*
000356	012700  000010 				MOV	#10,R0
000362	060200 					ADD	R2,R0
000364	010046 					MOV	R0,-(SP)
000366	004767  000000G				JSR	PC,BL$MOV
000372	016600  000012 				MOV	12(SP),R0			;					2755
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  68
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (24)

000376	010160  000016 				MOV	R1,16(R0)			; BLKSIZE,*
000402	032776  002000  000010 			BIT	#2000,@10(SP)			;					2756
000410	001002 					BNE	11$
000412	052710  001000 				BIS	#1000,(R0)			;					2757
000416	032766  000001  000014 		11$:	BIT	#1,14(SP)			; *,REQUESTS				2758
000424	001403 					BEQ	12$
000426	052776  002000  000012 			BIS	#2000,@12(SP)			;					2759
000434	032777  001000  000002G		12$:	BIT	#1000,@.CRDAT+2			;					2760
000442	001405 					BEQ	13$
000444	016605  000012 				MOV	12(SP),R5			;					2761
000450	012700  000006 				MOV	#6,R0
000454	000404 					BR	14$
000456	016605  000012 			13$:	MOV	12(SP),R5			;					2762
000462	012700  000007 				MOV	#7,R0
000466	004767  177044 			14$:	JSR	PC,U.20
000472	062706  000006 				ADD	#6,SP				;					2736
000476	000407 					BR	18$				;					2724
000500	012716  000001 			15$:	MOV	#1,(SP)				; *,GOOD				2766
000504	000405 					BR	19$				;					2724
000506	012716  000002 			16$:	MOV	#2,(SP)				; *,GOOD				2768
000512	000402 					BR	19$				;					2724
000514	005016 				17$:	CLR	(SP)				; GOOD					2770
000516	005716 				18$:	TST	(SP)				; GOOD					2773
000520	001406 				19$:	BEQ	21$
000522	011646 				20$:	MOV	(SP),-(SP)			; GOOD,*				2774
000524	016605  000006 				MOV	6(SP),R5
000530	004767  173202 				JSR	PC,BAD.MSG
000534	005726 					TST	(SP)+
000536	062706  000012 			21$:	ADD	#12,SP				;					2566
000542	000207 					RTS	PC

; Routine Size:  178 words,	Routine Base:  $CODE$ + 4042
; Maximum stack depth per invocation:  15 words


000222						.PSECT	$PLIT$,  RO ,  D  

					P.AAJ:						; CASE Table for RCV.NI+0204		2724
000222	000304 					.WORD	304				; [17$]
000224	000304 					.WORD	304				; [17$]
000226	000304 					.WORD	304				; [17$]
000230	000304 					.WORD	304				; [17$]
000232	000304 					.WORD	304				; [17$]
000234	000000 					.WORD	0				; [7$]
000236	000276 					.WORD	276				; [16$]
000240	000276 					.WORD	276				; [16$]
000242	000270 					.WORD	270				; [15$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  69
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (25)

;	  2776	global routine RCV_NV (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  2777	
;	  2778	!++
;	  2779	! FUNCTIONAL DESCRIPTION:
;	  2780	!
;	  2781	!  Processes a received Node Verification message.  If we
;	  2782	!  are expecting one, we will validate it and if valid, declare
;	  2783	!  the circuit up.  (If we have not received back the NI message we
;	  2784	!  sent, the "line up" will be delayed until we do.)
;	  2785	!
;	  2786	! FORMAL PARAMETERS
;	  2787	!
;	  2788	!	CCB[C_LIN] - Index of circuit data base entry
;	  2789	!	CCB[C_BIAS] - buffer descriptor for OTV's buffer
;	  2790	!
;	  2791	! IMPLICIT INPUTS
;	  2792	!
;	  2793	!	LINEstate
;	  2794	!
;	  2795	! ROUTINE VALUE:
;	  2796	! COMPLETION CODES:
;	  2797	!
;	  2798	!	NONE.
;	  2799	!
;	  2800	! SIDE EFFECTS:
;	  2801	!
;	  2802	!	May commence or restart an initialization sequence if we are in
;	  2803	!	the wrong state.
;	  2804	!
;	  2805	!--
;	  2806	
;	  2807	begin
;	  2808	map CCB: ref block field (C_fields);
;	  2809	require 'XPTSYM';
;	  2846	local GOOD;
;	  2847	label MSG_CHECK,TV_CHECK;
;	  2848	
;	  2849	MSG_CHECK:
;	  2850	begin                                   ! MSG_CHECK
;	  2851	local CNT;
;	  2852	pointer PTR;
;	  2853	MAPBUF(.CCB,PTR,CNT);
;	  2854	
;	  2855	!
;	  2856	!  Validate the NV message; if it's no good, treat as a BAD_MSG
;	  2857	!
;	  2858	
;	  2859	CNT = .CNT - 10;                        ! Account for full message
;	  2860	
;	  2861	if .CNT lss 0
;	  2862	then begin
;	  2863	     GOOD = 7;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  70
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (25)

;	  2864	     leave MSG_CHECK;
;	  2865	     end;
;	  2866	
;	  2867	GOOD = 0;
;	  2868	end;                                    ! MSG_CHECK
;	  2869	
;	  2870	!
;	  2871	!  Dispatch on circuit state
;	  2872	!
;	  2873	
;	  2874	case .LINEstate from HA to RU of
;	  2875	    set
;	  2876	    [TV]:                               ! This is the big case
;	  2877	TV_CHECK:
;	  2878	        begin
;	  2879	        local PWDb: ref PWDblock;
;	  2880	        pointer PTR;
;	  2881	
;	  2882	        if .GOOD neq 0 then leave TV_CHECK;
;	  2883	
;	  2884	        PWDb = GET_PWDb (.Nid);
;	  2885	        PTR = ch$plus (.CCB[C_ADDR],3);
;	  2886	
;	  2887	        if ch$rchar(byt$ptr (PWD2rcv)) neq 0
;	  2888	        then if ch$neq (8, .PTR, 8, byt$ptr (PWD2rcv), 0)
;	  2889	             then begin
;	  2890	                  GOOD = 8;
;	  2891	                  leave TV_CHECK;
;	  2892	                  end;
;	  2893	
;	  2894	        NEXT_STATE (.LINEb, TC);
;	  2895	        end;
;	  2896	    [RU]:                               ! Circuit running, message unexpected -
;	  2897		GOOD = 1;                       !    and treat as garbage message
;	  2898	    [TI,TC]:				! Circuit initializing,
;	  2899		GOOD = 2;                       !    and treat as garbage message
;	  2900	    [inrange]:				! In middle of DLL protocol -
;	  2901	        GOOD = 0;
;	  2902	    tes;
;	  2903	
;	  2904	if .GOOD neq 0
;	  2905	then BAD_MSG(.LINEb,.CCB,.GOOD);        ! Treat as garbage message
;	  2906	end;				!End of RCV_NV


						.SBTTL	RCV.NV
004606						.PSECT	$CODE$,  RO 

000000	004167  000000G			RCV.NV::
					U.23:	JSR	R1,$SAVE2			;					2776
000004	016467  000016  000000G			MOV	16(R4),KISAR6			; *(CCB),*				2853
000012	016400  000022 				MOV	22(R4),R0			; *(CCB),CNT
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  71
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (25)

000016	162700  000012 				SUB	#12,R0				; *,CNT					2859
000022	100003 					BPL	1$				;					2861
000024	012701  000007 				MOV	#7,R1				; *,GOOD				2863
000030	000401 					BR	2$				;					2864
000032	005001 				1$:	CLR	R1				; GOOD					2867
000034	111500 				2$:	MOVB	(R5),R0				; LINEB,*				2874
000036	006300 					ASL	R0
000040	066007  000244'				ADD	P.AAK(R0),PC			; Case dispatch
000044	005701 				3$:	TST	R1				; GOOD					2882
000046	001402 					BEQ	4$
000050	005746 					TST	-(SP)
000052	000441 					BR	6$
000054	016546  000004 			4$:	MOV	4(R5),-(SP)			; *(LINEB),*				2884
000060	004767  174430 				JSR	PC,U.11
000064	010002 					MOV	R0,R2				; *,PWDB
000066	016400  000020 				MOV	20(R4),R0			; *(CCB),PTR				2885
000072	062700  000003 				ADD	#3,R0				; *,PTR
000076	062702  000004 				ADD	#4,R2				;					2887
000102	105712 					TSTB	(R2)
000104	001420 					BEQ	5$
000106	012716  000010 				MOV	#10,(SP)			;					2888
000112	010046 					MOV	R0,-(SP)			; PTR,*
000114	012746  000010 				MOV	#10,-(SP)
000120	010246 					MOV	R2,-(SP)
000122	005046 					CLR	-(SP)
000124	004767  000000G				JSR	PC,BL$NEQ
000130	062706  000010 				ADD	#10,SP
000134	006000 					ROR	R0
000136	103003 					BCC	5$
000140	012701  000010 				MOV	#10,R1				; *,GOOD				2890
000144	000404 					BR	6$				;					2891
000146	012700  000007 			5$:	MOV	#7,R0				;					2894
000152	004767  176614 				JSR	PC,U.20
000156	005726 				6$:	TST	(SP)+				;					2874
000160	000407 					BR	10$
000162	012701  000001 			7$:	MOV	#1,R1				; *,GOOD				2897
000166	000405 					BR	11$				;					2874
000170	012701  000002 			8$:	MOV	#2,R1				; *,GOOD				2899
000174	000402 					BR	11$				;					2874
000176	005001 				9$:	CLR	R1				; GOOD					2901
000200	005701 				10$:	TST	R1				; GOOD					2904
000202	001404 				11$:	BEQ	12$
000204	010146 					MOV	R1,-(SP)			; GOOD,*				2905
000206	004767  172760 				JSR	PC,BAD.MSG
000212	005726 					TST	(SP)+
000214	000207 				12$:	RTS	PC				;					2776

; Routine Size:  71 words,	Routine Base:  $CODE$ + 4606
; Maximum stack depth per invocation:  9 words


000244						.PSECT	$PLIT$,  RO ,  D  
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  72
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (25)


					P.AAK:						; CASE Table for RCV.NV+0040		2874
000244	000132 					.WORD	132				; [9$]
000246	000132 					.WORD	132				; [9$]
000250	000132 					.WORD	132				; [9$]
000252	000132 					.WORD	132				; [9$]
000254	000132 					.WORD	132				; [9$]
000256	000124 					.WORD	124				; [8$]
000260	000000 					.WORD	0				; [3$]
000262	000124 					.WORD	124				; [8$]
000264	000116 					.WORD	116				; [7$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  73
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

;	  2907	global routine RCV_TI (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  2908	
;	  2909	!++
;	  2910	! FUNCTIONAL DESCRIPTION:
;	  2911	!
;	  2912	!  Processes a received Transport Init message.  If we are expecting
;	  2913	!  one, we will send a Transport Verify if one is requested and go either
;	  2914	!  to receive a Transport Verify (if we asked for one) or to declare a "line
;	  2915	!  up".  (If we have not received back the TI message we sent, the "line up"
;	  2916	!  will be delayed until we do.)
;	  2917	!
;	  2918	! FORMAL PARAMETERS
;	  2919	!
;	  2920	!	CCB[C_LIN] - Index of circuit data base entry for circuit
;	  2921	!	CCB[C_BIAS] - buffer descriptor for TI
;	  2922	!
;	  2923	! IMPLICIT INPUTS
;	  2924	!
;	  2925	!	LINEstate
;	  2926	!
;	  2927	! ROUTINE VALUE:
;	  2928	! COMPLETION CODES:
;	  2929	!
;	  2930	!	NONE.
;	  2931	!
;	  2932	! SIDE EFFECTS:
;	  2933	!
;	  2934	!	May commence or restart an initialization sequence if we are in
;	  2935	!	the wrong state.
;	  2936	!
;	  2937	!--
;	  2938	
;	  2939	begin
;	  2940	map CCB: ref block field (C_fields);
;	  2941	require 'XPTSYM';
;	  2978	local GOOD,NODEADDR,TIINFO,BLKSIZE;
;	  2979	label MSG_CHECK;
;	  2980	
;	  2981	!
;	  2982	!  If the circuit is a Ph2Circuit, ignore the message
;	  2983	!
;	  2984	
;	  2985	if .Ph2only then return;
;	  2986	
;	  2987	MSG_CHECK:
;	  2988	begin                                   ! MSG_CHECK
;	  2989	local CNT;
;	  2990	local CTLFLG;
;	  2991	pointer PTR;
;	  2992	
;	  2993	MAPBUF (.CCB,PTR,CNT);
;	  2994	
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  74
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

;	  2995	!
;	  2996	!  Validate the TI message; if it's no good, treat as a BAD_MSG
;	  2997	!
;	  2998	
;	  2999	!
;	  3000	!  Here, check to see that it's at least as long as the version field
;	  3001	!
;	  3002	
;	  3003	if (CNT = .CNT - 9) lss 0 then leave MSG_CHECK;
;	  3004	
;	  3005	!
;	  3006	!  In the following block, we store the interesting bits of the message
;	  3007	!  in local variables.  We can not look at them until we've checked
;	  3008	!  the version number.  We must pitch silently any message with a version
;	  3009	!  greater that what we support.  The other end may respond to our TI with
;	  3010	!  something we can deal with.
;	  3011	!
;	  3012	CTLFLG = getb(PTR);
;	  3013	NODEADDR = getw(PTR);
;	  3014	TIINFO = getb(PTR);
;	  3015	BLKSIZE = getw(PTR);
;	  3016	                                        ! TIVER
;	  3017	if ((getb(PTR) neq 1) or
;	  3018	    (getb(PTR) neq 3))
;	  3019	then begin
;	  3020	     GOOD = 3;				! Incompatible version number
;	  3021	     leave MSG_CHECK;
;	  3022	     end;
;	  3023	getb(PTR);
;	  3024	
;	  3025	if biton(.CTLFLG,%b'11110000')          ! Check the control header
;	  3026	then begin
;	  3027	     GOOD = 7;                          ! Reserved bits on - no good
;	  3028	     leave MSG_CHECK;
;	  3029	     end;
;	  3030	
;	  3031	if NODEADDR gtru NN		       ! SRCNODE
;	  3032	then begin
;	  3033	     GOOD = 4;                          ! Source node address too large
;	  3034	     leave MSG_CHECK;
;	  3035	     end;
;	  3036	
;	  3037	                                        ! TIINFO
;	  3038	if biton(.TIINFO,%b'11111000')
;	  3039	then begin
;	  3040	     GOOD = 7;                          ! Reserved bits on
;	  3041	     leave MSG_CHECK;
;	  3042	     end;
;	  3043	selectone .TIINFO<0,2,0> of
;	  3044	    set
;	  3045	    [2,3]:
;	  3046	        0;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  75
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

;	  3047	    [otherwise]:
;	  3048	        begin
;	  3049		GOOD = 7;                       ! Node type no good
;	  3050	        leave MSG_CHECK;
;	  3051	        end;
;	  3052	    tes;
;	  3053	
;	  3054	!
;	  3055	! A received Data Link blocksize greater than or equal
;	  3056	! to the maximum (message size of routing message
;	  3057	! containing NN nodes, hello message size, 246)
;	  3058	!
;	  3059	
;	  3060	if (.BLKSIZE lssu (NN^1 + 5)) or
;	  3061	   (.BLKSIZE lssu (3+.HELLO_MSG_CNT)) or
;	  3062	   (.BLKSIZE lssu 246)
;	  3063	then begin
;	  3064	     GOOD = 5;				! Remote blocksize too large
;	  3065	     leave MSG_CHECK;
;	  3066	     end;
;	  3067	
;	C 3068	%(
;	C 3069	if getb(PTR) neq 0                      ! RESERVED
;	C 3070	then begin
;	C 3071	     GOOD = 7;
;	C 3072	     end;
;	  3073	)%
;	  3074	
;	  3075	
;	  3076	GOOD = 0;				! Sorry, nothing wrong
;	  3077	end;                                    ! MSG_CHECK
;	  3078	
;	  3079	!
;	  3080	! Dispatch on circuit state
;	  3081	!
;	  3082	
;	  3083	case .LINEstate from HA to RU of
;	  3084	    set
;	  3085	    [TI]:                               ! This is the big case
;	  3086	        begin
;	  3087	        !
;	  3088	        !  Now process message
;	  3089	        !
;	  3090	
;	  3091	        if .GOOD eql 0
;	  3092	        then begin
;	  3093	             Nty = .TIINFO<0,2,0>;      ! Set routing type.
;	  3094	             Nid = .NODEADDR;           ! Save adjacent node address
;	  3095	             Nnml = 0;                  !  with no name.
;	  3096	             Block_size = .BLKSIZE;     ! This is his block size.
;	  3097	             if biton(.TIINFO,VFY_req)  ! and If requested,
;	  3098	             then Send_TV = true;       ! then schedule one sent.
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  76
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

;	  3099	             if .Request_TV
;	  3100	             then NEXT_STATE (.LINEb, TV)  ! Wait for TV.
;	  3101	             else NEXT_STATE (.LINEb, TC); ! Request a line-up.
;	  3102	             end;
;	  3103		if .GOOD eql 3
;	  3104		then return;			! If version skew, toss message
;	  3105	        end;
;	  3106	    [RU]:                               ! Circuit running, message unexpected -
;	  3107		GOOD = 1;                       !    and treat as garbage message
;	  3108	    [TV,TC]:				! Circuit initializing,
;	  3109		GOOD = 2;                       !    and treat as garbage message
;	  3110	    [inrange]:                          ! In middle of DLL protocol -
;	  3111	        GOOD = 0;
;	  3112	    tes;
;	  3113	
;	  3114	if .GOOD neq 0
;	  3115	then BAD_MSG(.LINEb,.CCB,.GOOD);        ! Treat as garbage message
;	  3116	end;				!End of RCV_TI


						.SBTTL	RCV.TI
005024						.PSECT	$CODE$,  RO 

000000	004167  000000G			RCV.TI::
					U.24:	JSR	R1,$SAVE5			;					2907
000004	024646 					CMP	-(SP),-(SP)
000006	010546 					MOV	R5,-(SP)
000010	010500 					MOV	R5,R0				;					2985
000012	032760  002000  000002 			BIT	#2000,2(R0)
000020	001402 					BEQ	1$
000022	000167  000442 				JMP	20$
000026	016467  000016  000000G		1$:	MOV	16(R4),KISAR6			; *(CCB),*				2993
000034	016400  000020 				MOV	20(R4),R0			; *(CCB),PTR
000040	016401  000022 				MOV	22(R4),R1			; *(CCB),CNT
000044	162701  000011 				SUB	#11,R1				; *,CNT					3003
000050	100513 					BMI	9$
000052	005003 					CLR	R3				; CTLFLG				3012
000054	152003 					BISB	(R0)+,R3			; PTR,CTLFLG
000056	112066  000004 				MOVB	(R0)+,4(SP)			; PTR,X					3013
000062	112066  000005 				MOVB	(R0)+,5(SP)			; PTR,X
000066	016666  000004  000002 			MOV	4(SP),2(SP)			; X,NODEADDR
000074	005005 					CLR	R5				; TIINFO				3014
000076	152005 					BISB	(R0)+,R5			; PTR,TIINFO
000100	112066  000004 				MOVB	(R0)+,4(SP)			; PTR,X					3015
000104	112066  000005 				MOVB	(R0)+,5(SP)			; PTR,X
000110	016602  000004 				MOV	4(SP),R2			; X,BLKSIZE
000114	122027  000001 				CMPB	(R0)+,#1			; PTR,*					3017
000120	001003 					BNE	2$
000122	122027  000003 				CMPB	(R0)+,#3			; PTR,*					3018
000126	001403 					BEQ	3$
000130	012701  000003 			2$:	MOV	#3,R1				; *,GOOD				3020
000134	000461 					BR	9$				;					3021
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  77
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

000136	005200 				3$:	INC	R0				; PTR					3023
000140	032703  000360 				BIT	#360,R3				; *,CTLFLG				3025
000144	001024 					BNE	5$				;					3027
000146	016700  000002G				MOV	.CRDAT+2,R0			;					3031
000152	012703  000002 				MOV	#2,R3
000156	060603 					ADD	SP,R3				; NODEADDR,*
000160	026003  000016 				CMP	16(R0),R3
000164	103003 					BHIS	4$
000166	012701  000004 				MOV	#4,R1				; *,GOOD				3033
000172	000442 					BR	9$				;					3034
000174	032705  000370 			4$:	BIT	#370,R5				; *,TIINFO				3038
000200	001006 					BNE	5$				;					3040
000202	010503 					MOV	R5,R3				; TIINFO,*				3043
000204	042703  177774 				BIC	#177774,R3
000210	020327  000002 				CMP	R3,#2
000214	103003 					BHIS	6$
000216	012701  000007 			5$:	MOV	#7,R1				; *,GOOD				3049
000222	000426 					BR	9$				;					3050
000224	016000  000016 			6$:	MOV	16(R0),R0			;					3060
000230	006300 					ASL	R0
000232	062700  000005 				ADD	#5,R0
000236	020200 					CMP	R2,R0				; BLKSIZE,*
000240	103413 					BLO	7$
000242	016700  000002G				MOV	.CRDAT+2,R0			;					3061
000246	016000  000166 				MOV	166(R0),R0
000252	062700  000003 				ADD	#3,R0
000256	020200 					CMP	R2,R0				; BLKSIZE,*
000260	103403 					BLO	7$
000262	020227  000366 				CMP	R2,#366				; BLKSIZE,*				3062
000266	103003 					BHIS	8$
000270	012701  000005 			7$:	MOV	#5,R1				; *,GOOD				3064
000274	000401 					BR	9$				;					3065
000276	005001 				8$:	CLR	R1				; GOOD					3076
000300	117600  000000 			9$:	MOVB	@0(SP),R0			;					3083
000304	006300 					ASL	R0
000306	066007  000266'				ADD	P.AAL(R0),PC			; Case dispatch
000312	005701 				10$:	TST	R1				; GOOD					3091
000314	001042 					BNE	14$
000316	010500 					MOV	R5,R0				; TIINFO,*				3093
000320	042700  177774 				BIC	#177774,R0
000324	011603 					MOV	(SP),R3
000326	105063  000002 				CLRB	2(R3)
000332	150063  000002 				BISB	R0,2(R3)
000336	010300 					MOV	R3,R0				;					3094
000340	016660  000002  000004 			MOV	2(SP),4(R0)			; NODEADDR,*
000346	105060  000007 				CLRB	7(R0)				;					3095
000352	010260  000016 				MOV	R2,16(R0)			; BLKSIZE,*				3096
000356	032705  000004 				BIT	#4,R5				; *,TIINFO				3097
000362	001402 					BEQ	11$
000364	052710  002000 				BIS	#2000,(R0)			;					3098
000370	032777  002000  000002G		11$:	BIT	#2000,@.CRDAT+2			;					3099
000376	001404 					BEQ	12$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  78
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (26)

000400	011605 					MOV	(SP),R5				;					3100
000402	012700  000006 				MOV	#6,R0
000406	000403 					BR	13$
000410	011605 				12$:	MOV	(SP),R5				;					3101
000412	012700  000007 				MOV	#7,R0
000416	004767  176132 			13$:	JSR	PC,U.20
000422	020127  000003 			14$:	CMP	R1,#3				; GOOD,*				3103
000426	001010 					BNE	18$
000430	000417 					BR	20$				;					3104
000432	012701  000001 			15$:	MOV	#1,R1				; *,GOOD				3107
000436	000405 					BR	19$				;					3083
000440	012701  000002 			16$:	MOV	#2,R1				; *,GOOD				3109
000444	000402 					BR	19$				;					3083
000446	005001 				17$:	CLR	R1				; GOOD					3111
000450	005701 				18$:	TST	R1				; GOOD					3114
000452	001406 				19$:	BEQ	20$
000454	010146 					MOV	R1,-(SP)			; GOOD,*				3115
000456	016605  000002 				MOV	2(SP),R5
000462	004767  172266 				JSR	PC,BAD.MSG
000466	005726 					TST	(SP)+
000470	062706  000006 			20$:	ADD	#6,SP				;					2907
000474	000207 					RTS	PC

; Routine Size:  159 words,	Routine Base:  $CODE$ + 5024
; Maximum stack depth per invocation:  11 words


000266						.PSECT	$PLIT$,  RO ,  D  

					P.AAL:						; CASE Table for RCV.TI+0306		3083
000266	000134 					.WORD	134				; [17$]
000270	000134 					.WORD	134				; [17$]
000272	000134 					.WORD	134				; [17$]
000274	000134 					.WORD	134				; [17$]
000276	000134 					.WORD	134				; [17$]
000300	000000 					.WORD	0				; [10$]
000302	000126 					.WORD	126				; [16$]
000304	000126 					.WORD	126				; [16$]
000306	000120 					.WORD	120				; [15$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  79
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (27)

;	  3117	global routine RCV_TV (LINEb,CCB): LINKAGE_DB_CCB novalue =
;	  3118	
;	  3119	!++
;	  3120	! FUNCTIONAL DESCRIPTION:
;	  3121	!
;	  3122	!  Processes a received Transport Verification message.  If we
;	  3123	!  are expecting one, we will validate it and if valid, declare
;	  3124	!  the circuit up.  (If we have not received back the TI message we
;	  3125	!  sent, the "line up" will be delayed until we do.)
;	  3126	!
;	  3127	! FORMAL PARAMETERS
;	  3128	!
;	  3129	!	CCB[C_LIN] - Index of circuit data base entry
;	  3130	!	CCB[C_BIAS] - buffer descriptor for TV's buffer
;	  3131	!
;	  3132	! IMPLICIT INPUTS
;	  3133	!
;	  3134	!	LINEstate
;	  3135	!
;	  3136	! ROUTINE VALUE:
;	  3137	! COMPLETION CODES:
;	  3138	!
;	  3139	!	NONE.
;	  3140	!
;	  3141	! SIDE EFFECTS:
;	  3142	!
;	  3143	!	May commence or restart an initialization sequence if we are in
;	  3144	!	the wrong state.
;	  3145	!
;	  3146	!--
;	  3147	
;	  3148	begin
;	  3149	map CCB: ref block field (C_fields);
;	  3150	require 'XPTSYM';
;	  3187	local GOOD;
;	  3188	label MSG_CHECK,TV_CHECK;
;	  3189	
;	  3190	MSG_CHECK:
;	  3191	begin                                   ! MSG_CHECK
;	  3192	local CNT;
;	  3193	pointer PTR;
;	  3194	MAPBUF(.CCB,PTR,CNT);
;	  3195	
;	  3196	!
;	  3197	!  Validate the TV message; if it's no good, treat as a BAD_MSG
;	  3198	!
;	  3199	
;	  3200	if (CNT = .CNT - 4) lss 0 then leave MSG_CHECK;
;	  3201	
;	  3202	begin                                   ! CTLFLG
;	  3203	local CTLFLG;
;	  3204	CTLFLG = getb(PTR);
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  80
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (27)

;	  3205	if biton(.CTLFLG,%b'11110000')          ! Check the control header
;	  3206	then begin
;	  3207	     GOOD = 7;                          ! Reserved bits on - no good
;	  3208	     leave MSG_CHECK;
;	  3209	     end;
;	  3210	end;
;	  3211	
;	  3212	if getw(PTR) neq .Nid                   ! SRCNODE
;	  3213	then begin
;	  3214	     GOOD = 4;                          ! Source node is not the adjacent node
;	  3215	     leave MSG_CHECK;
;	  3216	     end;
;	  3217	
;	C 3218	%(
;	C 3219	begin                                   ! FCNVAL
;	C 3220	local LEN;
;	C 3221	LEN = getb(PTR);
;	C 3222	PTR = ch$plus(.PTR,.LEN);
;	C 3223	end;
;	  3224	)%
;	  3225	
;	  3226	GOOD = 0;
;	  3227	end;                                    ! MSG_CHECK
;	  3228	
;	  3229	!
;	  3230	!  Dispatch on circuit state
;	  3231	!
;	  3232	
;	  3233	case .LINEstate from HA to RU of
;	  3234	    set
;	  3235	    [TV]:                               ! This is the big case
;	  3236	TV_CHECK:
;	  3237	        begin
;	  3238	        local PWDb: ref PWDblock;
;	  3239	        pointer PTR;
;	  3240	
;	  3241	        if .GOOD neq 0 then leave TV_CHECK;
;	  3242	
;	  3243	        PWDb = GET_PWDb (.Nid);
;	  3244	        PTR = ch$plus (.CCB[C_ADDR],3);
;	  3245	
;	  3246	        if .PWD3rcv_length neq 0
;	  3247	        then if (getb(PTR) neq .PWD3rcv_length) or
;	  3248	                 ch$neq (.PWD3rcv_length, .PTR,
;	  3249	                         .PWD3rcv_length, byt$ptr (PWD3rcv), 0)
;	  3250	             then begin
;	  3251	                  GOOD = 8;
;	  3252	                  leave TV_CHECK;
;	  3253	                  end;
;	  3254	
;	  3255	        NEXT_STATE (.LINEb, TC);
;	  3256	        end;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  81
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (27)

;	  3257	    [RU]:                               ! Circuit running, message unexpected -
;	  3258		GOOD = 1;                       !    and treat as garbage message
;	  3259	    [TI,TC]:				! Circuit initializing,
;	  3260		GOOD = 2;                       !    and treat as garbage message
;	  3261	    [inrange]:				! In middle of DLL protocol -
;	  3262	        GOOD = 0;
;	  3263	    tes;
;	  3264	
;	  3265	if .GOOD neq 0
;	  3266	then BAD_MSG(.LINEb,.CCB,.GOOD);        ! Treat as garbage message
;	  3267	end;				!End of RCV_TV


						.SBTTL	RCV.TV
005522						.PSECT	$CODE$,  RO 

000000	004167  000000G			RCV.TV::
					U.25:	JSR	R1,$SAVE3			;					3117
000004	005746 					TST	-(SP)
000006	016467  000016  000000G			MOV	16(R4),KISAR6			; *(CCB),*				3194
000014	016400  000020 				MOV	20(R4),R0			; *(CCB),PTR
000020	016401  000022 				MOV	22(R4),R1			; *(CCB),CNT
000024	162701  000004 				SUB	#4,R1				; *,CNT					3200
000030	100423 					BMI	3$
000032	005001 					CLR	R1				; CTLFLG				3204
000034	152001 					BISB	(R0)+,R1			; PTR,CTLFLG
000036	032701  000360 				BIT	#360,R1				; *,CTLFLG				3205
000042	001403 					BEQ	1$
000044	012701  000007 				MOV	#7,R1				; *,GOOD				3207
000050	000413 					BR	3$				;					3208
000052	112016 				1$:	MOVB	(R0)+,(SP)			; PTR,X					3212
000054	112066  000001 				MOVB	(R0)+,1(SP)			; PTR,X
000060	011600 					MOV	(SP),R0				; X,*
000062	020065  000004 				CMP	R0,4(R5)			; *,*(LINEB)
000066	001403 					BEQ	2$
000070	012701  000004 				MOV	#4,R1				; *,GOOD				3214
000074	000401 					BR	3$				;					3215
000076	005001 				2$:	CLR	R1				; GOOD					3226
000100	111500 				3$:	MOVB	(R5),R0				; LINEB,*				3233
000102	006300 					ASL	R0
000104	066007  000310'				ADD	P.AAM(R0),PC			; Case dispatch
000110	005701 				4$:	TST	R1				; GOOD					3241
000112	001402 					BEQ	5$
000114	005746 					TST	-(SP)
000116	000445 					BR	8$
000120	016546  000004 			5$:	MOV	4(R5),-(SP)			; *(LINEB),*				3243
000124	004767  173450 				JSR	PC,U.11
000130	010002 					MOV	R0,R2				; *,PWDB
000132	016400  000020 				MOV	20(R4),R0			; *(CCB),PTR				3244
000136	062700  000003 				ADD	#3,R0				; *,PTR
000142	116203  000026 				MOVB	26(R2),R3			; *(PWDB),*				3246
000146	001425 					BEQ	7$
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  82
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (27)

000150	112046 					MOVB	(R0)+,-(SP)			; PTR,*					3247
000152	105066  000001 				CLRB	1(SP)
000156	022603 					CMP	(SP)+,R3
000160	001015 					BNE	6$
000162	010316 					MOV	R3,(SP)				;					3249
000164	010046 					MOV	R0,-(SP)			; PTR,*
000166	010346 					MOV	R3,-(SP)
000170	010246 					MOV	R2,-(SP)			; PWDB,*
000172	062716  000027 				ADD	#27,(SP)
000176	005046 					CLR	-(SP)
000200	004767  000000G				JSR	PC,BL$NEQ
000204	062706  000010 				ADD	#10,SP
000210	006000 					ROR	R0
000212	103003 					BCC	7$
000214	012701  000010 			6$:	MOV	#10,R1				; *,GOOD				3251
000220	000404 					BR	8$				;					3252
000222	012700  000007 			7$:	MOV	#7,R0				;					3255
000226	004767  175624 				JSR	PC,U.20
000232	005726 				8$:	TST	(SP)+				;					3233
000234	000407 					BR	12$
000236	012701  000001 			9$:	MOV	#1,R1				; *,GOOD				3258
000242	000405 					BR	13$				;					3233
000244	012701  000002 			10$:	MOV	#2,R1				; *,GOOD				3260
000250	000402 					BR	13$				;					3233
000252	005001 				11$:	CLR	R1				; GOOD					3262
000254	005701 				12$:	TST	R1				; GOOD					3265
000256	001404 				13$:	BEQ	14$
000260	010146 					MOV	R1,-(SP)			; GOOD,*				3266
000262	004767  171770 				JSR	PC,BAD.MSG
000266	005726 					TST	(SP)+
000270	005726 				14$:	TST	(SP)+				;					3117
000272	000207 					RTS	PC

; Routine Size:  94 words,	Routine Base:  $CODE$ + 5522
; Maximum stack depth per invocation:  11 words


000310						.PSECT	$PLIT$,  RO ,  D  

					P.AAM:						; CASE Table for RCV.TV+0104		3233
000310	000142 					.WORD	142				; [11$]
000312	000142 					.WORD	142				; [11$]
000314	000142 					.WORD	142				; [11$]
000316	000142 					.WORD	142				; [11$]
000320	000142 					.WORD	142				; [11$]
000322	000134 					.WORD	134				; [10$]
000324	000000 					.WORD	0				; [4$]
000326	000134 					.WORD	134				; [10$]
000330	000126 					.WORD	126				; [9$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  83
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (28)

;	  3268	global routine TERM_LIN (LINEb): CALL$ novalue =
;	  3269	
;	  3270	!++
;	  3271	! FUNCTIONAL DESCRIPTION:
;	  3272	!
;	  3273	!  Terminates a circuit, i.e., stops the circuit at the Data Link Level and
;	  3274	!  generates a "line down" event.  The sequence that this routine starts
;	  3275	!  differs from that of INI_LIN in that the circuit will not be restarted;
;	  3276	!  to restart the circuit, call INI_LIN.
;	  3277	!
;	  3278	! FORMAL PARAMETERS
;	  3279	!
;	  3280	!       LINEb - line data base
;	  3281	!
;	  3282	! IMPLICIT INPUTS
;	  3283	!
;	  3284	!	LINEstate
;	  3285	!
;	  3286	! ROUTINE VALUE:
;	  3287	! COMPLETION CODES:
;	  3288	!
;	  3289	!	NONE.
;	  3290	!
;	  3291	! SIDE EFFECTS:
;	  3292	!
;	  3293	!	Changes circuit state.  Declares circuit "down" if it is not down
;	  3294	!	already.  Terminates a Initialize sequence.
;	  3295	! NOTE:	This routine acquires a free CCB.  If it is unable to get one,
;	  3296	!	the function requested will be put in the LINEfunction cell for the
;	  3297	!	circuit.  The function will be retried on timeout.
;	  3298	!
;	  3299	!--
;	  3300	
;	  3301	begin
;	  3302	require 'XPTSYM';
;	  3339	
;	  3340	begin                                   ! Kill all start requests
;	  3341	local Chain;
;	  3342	Chain = .LINEccb;
;	  3343	LINEccb = 0;
;	  3344	while true do
;	  3345	    begin
;	  3346	    local CCB: ref block field (C_fields);
;	  3347	    if (CCB = .Chain) eqla 0 then exitloop;
;	  3348	    Chain = .CCB[C_LNK];
;	  3349	    if (.CCB[C_MOD] eql FM_STR)         !  If this is...
;	  3350	    then begin                          !    ...an initialization function,
;	  3351	         CCB[C_STS] = CE_DIS;           !      then return the CCB to the
;	  3352	         CCB[C_FNC] = FC_CCP;           !      caller with a failure code
;	  3353	         $MCB_SCHEDULE_CCB(.CCB);
;	  3354	         end
;	  3355	    else begin                          ! otherwise
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  84
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (28)

;	  3356	         CCB[C_LNK] = .LINEccb;         ! hold on to it.
;	  3357	         LINEccb = .CCB;
;	  3358	         end;
;	  3359	    end;
;	  3360	end;
;	  3361	
;	  3362	!
;	  3363	!  Do termination processing depending on the circuit state
;	  3364	!
;	  3365	
;	  3366	case .LINEstate from HA to RU of
;	  3367	    set
;	  3368	    [OFF,DT]:                           ! Do nothing
;	  3369	        ;
;	  3370	    [HA]:                               ! Already halted -
;	  3371		CCB_CMP(.LINEb);		!  clean out function queue
;	  3372	    [inrange]:				! Start termination:
;	  3373	        NEW_STATE (.LINEb, DT);
;	  3374	    tes;
;	  3375	
;	  3376	end;				!End of TERM_LIN


						.SBTTL	TERM.LIN
006016						.PSECT	$CODE$,  RO 

000000	016505  000002 			TERM.LIN::
					U.26:	MOV	2(R5),R5			; LINEB(.AP.),*				3342
000004	012701  000050 				MOV	#50,R1
000010	060501 					ADD	R5,R1
000012	011100 					MOV	(R1),R0				; *,CHAIN
000014	005011 					CLR	(R1)				;					3343
000016	010004 				1$:	MOV	R0,R4				; CHAIN,CCB				3347
000020	001421 					BEQ	3$
000022	011400 					MOV	(R4),R0				; CCB,CHAIN				3348
000024	126427  000013  000002 			CMPB	13(R4),#2			; *(CCB),*				3349
000032	001011 					BNE	2$
000034	012764  177520  000014 			MOV	#-260,14(R4)			; *,*(CCB)				3351
000042	112764  000022  000012 			MOVB	#22,12(R4)			; *,*(CCB)				3352
000050	004767  000000G				JSR	PC,$SCHED			;					3353
000054	000760 					BR	1$				;					3349
000056	011114 				2$:	MOV	(R1),(R4)			; *,CCB					3356
000060	010411 					MOV	R4,(R1)				; CCB,*					3357
000062	000755 					BR	1$				;					3344
000064	111500 				3$:	MOVB	(R5),R0				;					3366
000066	006300 					ASL	R0
000070	066007  000332'				ADD	P.AAN(R0),PC			; Case dispatch
000074	000207 				4$:	RTS	PC
000076	004767  172332 			5$:	JSR	PC,U.2				;					3371
000102	000207 					RTS	PC				;					3366
000104	012700  000001 			6$:	MOV	#1,R0				;					3373
000110	004767  174520 				JSR	PC,U.18
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  85
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (28)

000114	000207 				7$:	RTS	PC				;					3268

; Routine Size:  39 words,	Routine Base:  $CODE$ + 6016
; Maximum stack depth per invocation:  1 word


000332						.PSECT	$PLIT$,  RO ,  D  

					P.AAN:						; CASE Table for TERM.LIN+0070		3366
000332	000002 					.WORD	2				; [5$]
000334	000020 					.WORD	20				; [7$]
000336	000020 					.WORD	20				; [7$]
000340	000010 					.WORD	10				; [6$]
000342	000010 					.WORD	10				; [6$]
000344	000010 					.WORD	10				; [6$]
000346	000010 					.WORD	10				; [6$]
000350	000010 					.WORD	10				; [6$]
000352	000010 					.WORD	10				; [6$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  86
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (29)

;	  3377	global routine TLIAST (DATABASE,CCB,MODIFIER): LINKAGE_DB_CCB_MOD novalue =
;	  3378	
;	  3379	!++
;	  3380	! FUNCTIONAL DESCRIPTION:
;	  3381	!
;	  3382	! Processes an asynchronous event from the DLL.  There are three types of
;	  3383	! asynchronous events:
;	  3384	!
;	  3385	!	o  State Change		This allows Transport to follow the DLL
;	  3386	!				state.  State changes drive part of the
;	  3387	!				TLI state machine.
;	  3388	!
;	  3389	!	o  Transient Error	These are "software" errors, which indicate
;	  3390	!				an interruption of the DLL protocol on
;	  3391	!				the circuit.  Receipt of such an error will
;	  3392	!				cause Transport to recycle the circuit, if
;	  3393	!				it is up.
;	  3394	!
;	  3395	!	o  Persistent Error	These are errors from which the device or
;	  3396	!				protocol cannot recover on its own.  If it
;	  3397	!				is a warning, recovery can be made through
;	  3398	!                               initialization, otherwise stop using
;	  3399	!                               the circuit.
;	  3400	!
;	  3401	! All transient and persistent errors (except entry to MOP) cause logging of
;	  3402	! circuit events; no state change does so directly.
;	  3403	!
;	  3404	! FORMAL PARAMETERS
;	  3405	!
;	  3406	!	DATABASE	Dummy parameter; not used
;	  3407	!	CCB		Function CCB for the asynchronous event
;	  3408	!	  CCB[C_MOD]		Event class:
;	  3409	!				  DLL$K_STATE
;	  3410	!				  DLL$K_TRANSIENT_ERROR
;	  3411	!				  DLL$K_PERSISTENT_ERROR
;	  3412	!	  CCB[C_STS]		Specific event type:
;	  3413	!
;	  3414	!				  For DLL$K_STATE:
;	  3415	!					DLL$_STATE_OFF
;	  3416	!					DLL$_STATE_SYNCHRONIZING
;	  3417	!					DLL$_STATE_RUNNING
;	  3418	!					DLL$_STATE_MAINTENANCE
;	  3419	!
;	  3420	!				  For DLL$K_TRANSIENT_ERROR:
;	  3421	!					DLL$_START_RECEIVED
;	  3422	!					DLL$_TRANSMIT_THRESHOLD
;	  3423	!					DLL$_RECEIVE_THRESHOLD
;	  3424	!					DLL$_SELECTION_THRESHOLD
;	  3425	!
;	  3426	!				  For DLL$K_PERSISTENT_ERROR:
;	  3427	!					DLL$_DEVICE_RESPONSE_ERROR
;	  3428	!					DLL$_DEVICE_SERVICE_ERROR
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  87
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (29)

;	  3429	!					DLL$_DEVICE_OPERATION_ERROR
;	  3430	!
;	  3431	!	MODIFIER	Dummy parameter; not used
;	  3432	!
;	  3433	! IMPLICIT INPUTS
;	  3434	!
;	  3435	!	LINEstate
;	  3436	!
;	  3437	! ROUTINE VALUE:
;	  3438	! COMPLETION CODES:
;	  3439	!
;	  3440	!	NONE.
;	  3441	!
;	  3442	! SIDE EFFECTS:
;	  3443	!
;	  3444	!	NONE.
;	  3445	!--
;	  3446	
;	  3447	begin
;	  3448	
;	  3449	local LINEb;
;	  3450	require 'XPTSYM';
;	  3487	map CCB: ref block field (C_XPT_FIELDS);
;	  3488	local CB: ref block field (C_XPT_FIELDS);
;	  3489	local REASON;
;	  3490	literal
;	  3491	    REASONstop = 1^8,
;	  3492	    REASONlog = 1^9,
;	  3493	    REASONinit = 1^10;
;	  3494	
;	  3495	!
;	  3496	!  Address the circuit data base entry
;	  3497	!
;	  3498	
;	  3499	LINEb = $TLI_GET_LINE_DB(.CCB[C_LIN]);
;	  3500	REASON = 0;
;	  3501	
;	  3502	select .CCB[C_MOD] of
;	  3503	    set
;	  3504	    [DLL$K_STATE]:                      ! State change
;	  3505	        CIRCUIT_STATE(.LINEb,.CCB);
;	  3506	    [DLL$K_TRANSIENT_ERROR]:            ! Transient errors
;	  3507	        REASON = REASONinit + REASONlog + 0;	! Synch lost
;	  3508	    [DLL$K_PERSISTENT_ERROR]:           ! Persistent errors
;	  3509	        selectone .block [CCB[C_STS], STS$V_SEVERITY] of
;	  3510	            set
;	  3511	            [STS$K_WARNING]:
;	  3512	                REASON = REASONinit + REASONlog + 0;	! Synch lost
;	  3513	            [otherwise]:
;	  3514	                REASON = REASONstop + REASONlog + 1;    ! Data errors
;	  3515	            tes;
;	  3516	    tes;
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  88
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (29)

;	  3517	
;	  3518	
;	  3519	!
;	  3520	!  Log an event (except for MOP Mode Received)
;	  3521	!
;	  3522	
;	  3523	    if biton(.REASON,REASONlog) then begin
;	  3524		local VALUE;
;	  3525		$NM_LOG_BEGIN();
;	  3526		VALUE = .REASON<0,8>;			! Move in the
;	  3527		PARAMETER_C_1(5,VALUE);			!   reason code
;	  3528	
;	P 3529		$NM_LOG_END(4^6+
;	P 3530		(case .LINEstate from HA to RU of
;	P 3531		set
;	P 3532		[HA,DT,OFF,DS]:	begin
;	P 3533		    COUNTER_INCREMENT(LINEb,XPTini_fail);! Increment the
;	P 3534		    $XPT$E_ILF				!   appropriate counter
;	P 3535				end;			!   ("line down" or
;	P 3536		[inrange]:	begin			!   "initialization failure")
;	P 3537		    COUNTER_INCREMENT(LINEb,XPTlinedn); !   and declare the
;	P 3538		    $XPT$E_LLF				!   appropriate event
;	P 3539				end;
;	  3540		tes),.NMXid);
;	  3541		end;
;	  3542	
;	  3543	!
;	  3544	!  If the error is correctible, reinitialize the circuit.
;	  3545	!  If it is permanent, terminate the circuit.
;	  3546	!
;	  3547	
;	  3548	    if biton(.REASON,REASONinit)        ! Correctible error -
;	  3549	    then selectone .LINEstate of        !   if necessary,
;	  3550	             set
;	  3551	             [RU,TC]:                   !   declare the
;	  3552	                 NEW_STATE (.LINEb, LR);
;	  3553	             [otherwise]:               !   otherwise just
;	  3554	                 NEW_STATE (.LINEb, DS);
;	  3555	             tes;
;	  3556	
;	  3557	    if biton(.REASON,REASONstop)        ! Permanent error -
;	  3558	    then NEW_STATE (.LINEb, DT);        !  bring the circuit down for good
;	  3559	
;	  3560	!
;	  3561	!  Release the function CCB
;	  3562	!
;	  3563	
;	  3564	$MCB_RETURN_CCB(.CCB);
;	  3565	end;			!End of TLIAST


						.GLOBL	GTLINE
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  89
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (29)



						.SBTTL	TLIAST
006134						.PSECT	$CODE$,  RO 

000000	004167  000000G			TLIAST::
					U.27:	JSR	R1,$SAVE5			;					3377
000004	005000 					CLR	R0				;					3499
000006	156400  000010 				BISB	10(R4),R0			; *(CCB),*
000012	004767  000000G				JSR	PC,GTLINE
000016	010005 					MOV	R0,R5				; *,LINEB
000020	005003 					CLR	R3				; REASON				3500
000022	005001 					CLR	R1				;					3502
000024	156401  000013 				BISB	13(R4),R1			; *(CCB),*
000030	005701 					TST	R1
000032	001002 					BNE	1$
000034	004767  172502 				JSR	PC,U.6				;					3505
000040	020127  000002 			1$:	CMP	R1,#2				;					3502
000044	001002 					BNE	2$
000046	012703  003000 				MOV	#3000,R3			; *,REASON				3507
000052	020127  000004 			2$:	CMP	R1,#4				;					3502
000056	001012 					BNE	4$
000060	116400  000014 				MOVB	14(R4),R0			; *(CCB),*				3509
000064	042700  177770 				BIC	#177770,R0
000070	001003 					BNE	3$
000072	012703  003000 				MOV	#3000,R3			; *,REASON				3512
000076	000402 					BR	4$				;					3509
000100	012703  001401 			3$:	MOV	#1401,R3			; *,REASON				3514
000104	032703  001000 			4$:	BIT	#1000,R3			; *,REASON				3523
000110	001443 					BEQ	8$
000112	004767  000000G				JSR	PC,$NLBEG			;					3525
000116	005001 					CLR	R1				; VALUE					3526
000120	150301 					BISB	R3,R1				; REASON,VALUE
000122	012746  000005 				MOV	#5,-(SP)			;					3527
000126	110100 					MOVB	R1,R0				; VALUE,*
000130	004767  000000G				JSR	PC,$DPC1
000134	111500 					MOVB	(R5),R0				; LINEB,*				3540
000136	006300 					ASL	R0
000140	066007  000354'				ADD	P.AAO(R0),PC			; Case dispatch
000144	012700  000103 			5$:	MOV	#103,R0
000150	060500 					ADD	R5,R0				; LINEB,*
000152	004767  000000G				JSR	PC,$IC8
000156	012700  000013 				MOV	#13,R0
000162	000407 					BR	7$
000164	012700  000102 			6$:	MOV	#102,R0
000170	060500 					ADD	R5,R0				; LINEB,*
000172	004767  000000G				JSR	PC,$IC8
000176	012700  000007 				MOV	#7,R0
000202	062700  000400 			7$:	ADD	#400,R0
000206	016501  000034 				MOV	34(R5),R1			; *(LINEB),*
000212	004767  000000G				JSR	PC,$NLEND
000216	005726 					TST	(SP)+				;					3523
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  90
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (29)

000220	032703  002000 			8$:	BIT	#2000,R3			; *,REASON				3548
000224	001415 					BEQ	11$
000226	121527  000007 				CMPB	(R5),#7				; LINEB,*				3549
000232	002406 					BLT	9$
000234	121527  000010 				CMPB	(R5),#10			; LINEB,*
000240	003003 					BGT	9$
000242	012700  000003 				MOV	#3,R0				;					3552
000246	000402 					BR	10$
000250	012700  000004 			9$:	MOV	#4,R0				;					3554
000254	004767  174236 			10$:	JSR	PC,U.18
000260	032703  000400 			11$:	BIT	#400,R3				; *,REASON				3557
000264	001404 					BEQ	12$
000266	012700  000001 				MOV	#1,R0				;					3558
000272	004767  174220 				JSR	PC,U.18
000276	004767  000000G			12$:	JSR	PC,$CCBRT			;					3564
000302	000207 					RTS	PC				;					3377

; Routine Size:  98 words,	Routine Base:  $CODE$ + 6134
; Maximum stack depth per invocation:  8 words


000354						.PSECT	$PLIT$,  RO ,  D  

					P.AAO:						; CASE Table for TLIAST+0140		3540
000354	000000 					.WORD	0				; [5$]
000356	000000 					.WORD	0				; [5$]
000360	000000 					.WORD	0				; [5$]
000362	000020 					.WORD	20				; [6$]
000364	000000 					.WORD	0				; [5$]
000366	000020 					.WORD	20				; [6$]
000370	000020 					.WORD	20				; [6$]
000372	000020 					.WORD	20				; [6$]
000374	000020 					.WORD	20				; [6$]
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  91
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (30)

;	  3566	global routine XCPDAT (LINEb,CCB): MCB_DB_CCB novalue =
;	  3567	
;	  3568	!++
;	  3569	! FUNCTIONAL DESCRIPTION:
;	  3570	!
;	  3571	!  This will be a TI/TV/OTI/OTV message
;	  3572	!
;	  3573	! FORMAL PARAMETERS
;	  3574	!
;	  3575	!	CCB	Function CCB
;	  3576	!
;	  3577	! IMPLICIT INPUTS
;	  3578	!
;	  3579	!	LINEstate
;	  3580	!
;	  3581	! ROUTINE VALUE:
;	  3582	! COMPLETION CODES:
;	  3583	!
;	  3584	!	NONE.
;	  3585	!
;	  3586	! SIDE EFFECTS:
;	  3587	!
;	  3588	!--
;	  3589	
;	  3590	begin
;	  3591	map CCB:ref block field (C_XPT_FIELDS);
;	  3592	require 'XPTSYM';
;	  3629	
;	  3630	if .CCB[C_XPT_TYPE] eql FUNC_TI
;	  3631	then if .LINEstate eql TI
;	  3632	     then Listen_clock = .Init_timer;
;	  3633	
;	  3634	CCB[C_XPT_TYPE] = -.CCB[C_XPT_TYPE];
;	  3635	
;	  3636	if .LINEfunction eql .CCB[C_XPT_TYPE]   ! (These functions can be cancelled)
;	  3637	then LINEfunction = 0;
;	  3638	
;	  3639	$MCB_RETURN_CCB(.CCB);
;	  3640	
;	  3641	NEXT_ACTION (.LINEb);
;	  3642	end;                                    ! End of XCPDAT


						.SBTTL	XCPDAT
006440						.PSECT	$CODE$,  RO 

000000	012701  000032 			XCPDAT::
					U.28:	MOV	#32,R1				;					3630
000004	060401 					ADD	R4,R1				; CCB,*
000006	121127  000005 				CMPB	(R1),#5
000012	001010 					BNE	1$
000014	121527  000005 				CMPB	(R5),#5				; LINEB,*				3631
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  92
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (30)

000020	001005 					BNE	1$
000022	016700  000002G				MOV	.CRDAT+2,R0			;					3632
000026	016065  000070  000046 			MOV	70(R0),46(R5)			; *,*(LINEB)
000034	105411 				1$:	NEGB	(R1)				;					3634
000036	126511  000040 				CMPB	40(R5),(R1)			; *(LINEB),*				3636
000042	001002 					BNE	2$
000044	105065  000040 				CLRB	40(R5)				; *(LINEB)				3637
000050	004767  000000G			2$:	JSR	PC,$CCBRT			;					3639
000054	004767  174176 				JSR	PC,U.19				;					3641
000060	000207 					RTS	PC				;					3566

; Routine Size:  25 words,	Routine Base:  $CODE$ + 6440
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  93
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (31)

;	  3643	global routine XCPINI (LINEb,CCB): MCB_DB_CCB novalue =
;	  3644	
;	  3645	!++
;	  3646	! FUNCTIONAL DESCRIPTION:
;	  3647	!
;	  3648	!  This will be a TI/TV/OTI/OTV/HELLO message
;	  3649	!
;	  3650	! FORMAL PARAMETERS
;	  3651	!
;	  3652	!	CCB	Function CCB
;	  3653	!
;	  3654	! IMPLICIT INPUTS
;	  3655	!
;	  3656	!	LINEstate
;	  3657	!
;	  3658	! ROUTINE VALUE:
;	  3659	! COMPLETION CODES:
;	  3660	!
;	  3661	!	NONE.
;	  3662	!
;	  3663	! SIDE EFFECTS:
;	  3664	!
;	  3665	!--
;	  3666	
;	  3667	begin
;	  3668	map CCB:ref block field (C_XPT_FIELDS);
;	  3669	require 'XPTSYM';
;	  3706	
;	  3707	LINEfunction = 0;
;	  3708	$MCB_RETURN_CCB (.CCB);
;	  3709	NEXT_ACTION (.LINEb);
;	  3710	end;                                    ! End of XCPINI


						.SBTTL	XCPINI
000000	105065  000040 			XCPINI::
					U.29:	CLRB	40(R5)				; *(LINEB)				3707
000004	004767  000000G				JSR	PC,$CCBRT			;					3708
000010	004767  174160 				JSR	PC,U.19				;					3709
000014	000207 					RTS	PC				;					3643

; Routine Size:  7 words,	Routine Base:  $CODE$ + 6522
; Maximum stack depth per invocation:  1 word
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  94
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (32)

;	  3711	global routine XCPSTP (LINEb,CCB): MCB_DB_CCB novalue =
;	  3712	
;	  3713	!++
;	  3714	! FUNCTIONAL DESCRIPTION:
;	  3715	!
;	  3716	!  This will be a TI/TV/OTI/OTV/HELLO message
;	  3717	!
;	  3718	! FORMAL PARAMETERS
;	  3719	!
;	  3720	!	CCB	Function CCB
;	  3721	!
;	  3722	! IMPLICIT INPUTS
;	  3723	!
;	  3724	!	LINEstate
;	  3725	!
;	  3726	! ROUTINE VALUE:
;	  3727	! COMPLETION CODES:
;	  3728	!
;	  3729	!	NONE.
;	  3730	!
;	  3731	! SIDE EFFECTS:
;	  3732	!
;	  3733	!--
;	  3734	
;	  3735	begin
;	  3736	map CCB:ref block field (C_XPT_FIELDS);
;	  3737	require 'XPTSYM';
;	  3774	
;	  3775	LINEfunction = 0;
;	  3776	$MCB_RETURN_CCB (.CCB);
;	  3777	NEXT_ACTION (.LINEb);
;	  3778	end;                                    ! End of XCPSTP


						.SBTTL	XCPSTP
000000	105065  000040 			XCPSTP::
					U.30:	CLRB	40(R5)				; *(LINEB)				3775
000004	004767  000000G				JSR	PC,$CCBRT			;					3776
000010	004767  174142 				JSR	PC,U.19				;					3777
000014	000207 					RTS	PC				;					3711

; Routine Size:  7 words,	Routine Base:  $CODE$ + 6540
; Maximum stack depth per invocation:  1 word


;	  3779	end                                     ! End of module TLILIN
;	  3780	eludom



;					OTS external references
						.GLOBL	$SAVE5, $SAVE4, $SAVE3, $SAVE2
TLILIN								20-Nov-1984 12:47:55	TOPS-20 Bliss-16 2A(530)	    Page  95
X01650								30-Oct-1984 12:39:01	RATS:<BANKS.MCB.XPT>TLILIN.LITT-BRANNON. (32)

						.GLOBL	$CALL, BL$NEQ, BL$MOV


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $PLIT$				  127	    RO ,  D  ,  LCL,  REL,  CON
;	 $CODE$				 1719	    RO ,  I  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  RATS:<BANKS.MCB.MCB>XPORTX.L16.10	       599         3         0         0
;  RATS:<BANKS.MCB.MCB>MCBLIB.L16.6	       372        45        12         0
;  RATS:<BANKS.MCB.MCB>NMXLIB.L16.5	       200        13         6         0
;  RATS:<BANKS.MCB.XPT>XPTLIB.L16.3	       510       265        51         0





; Size:		1719 code + 127 data words
; Run Time:	00:43.0
; Elapsed Time:	02:34.1
; Memory Used:	78 pages
; Compilation Complete