Trailing-Edge
-
PDP-10 Archives
-
TOPS-20_V6.1_DECnetSrc_7-23-85
-
mcb/xpt/xptsel.lst
There is 1 other file named xptsel.lst in the archive. Click here to see a list.
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 1
23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0001 module XPTSEL (
; 0002 IDENT = 'X01730'
; 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 ! Transport Select module: Determines what line to send
; 0033 ! a forwarded message over. Builds routing headers for
; 0034 ! the messages. Calls Forwarding to transmit the messages.
; 0035 !
; 0036 ! ENVIRONMENT: MCB
; 0037 !
; 0038 ! AUTHOR: L. Webber , CREATION DATE: 2-Aug-79
; 0039 !
; 0040 ! MODIFIED BY:
; 0041 !
; 0042 ! L. Webber, 2-Aug-79 : VERSION 01
; 0043 !
; 0044 ! 1.01 L. Webber, 3-Oct-79
; 0045 ! Replaced routines SELECTOR and HDR_BUILD, added RCVECL, RCVPH2,
; 0046 ! BLDPH2, BLDPH3, and INTERCEPT
; 0047 !
; 0048 ! 1.02 L. Webber, 3-Apr-80
; 0049 ! Modified to support node and line sub-data-bases
; 0050 !
; 0051 ! 1.03 L. Webber, 30-Jun-80
; 0052 ! Modify to use MCBLIB macros
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 2
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0053 !
; 0054 ! 1.04 L. Webber, 3-Oct-80
; 0055 ! Modify to recognize own node name in routing header
; 0056 !
; 0057 ! 1.05 A. Peckham, 16-Oct-80
; 0058 ! Do not translate C_LIN in CCB from ECL in RCVECL.
; 0059 !
; 0060 ! 1.06 A. Peckham, 21-Oct-80
; 0061 ! Change all CE_ERR returns into SIGNAL_STOPs.
; 0062 !
; 0063 ! 1.07 A. Peckham, 22-Oct-80
; 0064 ! Set adjustment factor to zero in BLDPH3 for ECL CCBs.
; 0065 !
; 0066 ! 1.08 A. Peckham, 22-Oct-80
; 0067 ! Fix adjustment factor problems once and for all....
; 0068 !
; 0069 ! 1.09 A. Peckham, 24-Oct-80
; 0070 ! Change some CE_ERRs back from SIGNAL_STOPs.
; 0071 !
; 0072 ! 1.10 L. Webber, 31-Oct-80
; 0073 ! Check source & dest addrs for 0 in RCVECL
; 0074 !
; 0075 ! 1.11 L. Webber, 20-Nov-80
; 0076 ! Modify to intercept DI's
; 0077 !
; 0078 ! 1.12 L. Webber, 11-Dec-80
; 0079 ! Modify to support MCB 3.1
; 0080 !
; 0081 ! 1.13 L. Webber, 13-Jan-80
; 0082 ! Replace "no link" DC with "bad routing header" DC
; 0083 !
; 0084 ! 1.14 L. Webber, 23-Jan-81
; 0085 ! Add counter and event-logging code
; 0086 !
; 0087 ! 1.15 L. Webber, 9-Feb-81
; 0088 ! Change references to Forwarding routines (ECLFWD, FORWARDER, TERMINATE)
; 0089 ! to CALL$E
; 0090 !
; 0091 ! 1.16 L. Webber, 9-Feb-81
; 0092 ! Change references back (a interface module has been added)
; 0093 !
; 0094 ! 1.17 L. Webber, 10-Feb-81
; 0095 ! MAPBUF is now a macro
; 0096 !
; 0097 ! 1.18 L. Webber, 11-Feb-81
; 0098 ! Put the local node name in a Phase II routing header when the local
; 0099 ! node is the source, instead of the number.
; 0100 !
; 0101 ! 1.19 L. Webber, 20-Feb-81
; 0102 ! Fix linkage in RCVDAT (C_LIX already translated from LIX)
; 0103 !
; 0104 ! 1.20 L. Webber, 20-Feb-81
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 3
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0105 ! Don't flag a DC which can't be intercepted.
; 0106 !
; 0107 ! 1.21 L. Webber, 23-Feb-81
; 0108 ! Make the Event Buffer data an image field.
; 0109 !
; 0110 ! 1.22 L. Webber, 25-Feb-81
; 0111 ! Make calls to $CDBV and $CBDMG CALL$E's
; 0112 !
; 0113 ! 1.23 L. Webber, 3-Mar-81
; 0114 ! Change code for implementing local routing (ECL-ECL)
; 0115 !
; 0116 ! 1.24 L. Webber, 5-Mar-81
; 0117 ! If a Phase II packet is received with a numeric destination
; 0118 ! node name, the header is not useable and must be rebuilt if
; 0119 ! the adjacent node is Phase II.
; 0120 !
; 0121 ! 1.25 L. Webber, 5-Mar-81
; 0122 ! Split INTERCEPT into its own XPESEL module.
; 0123 !
; 0124 ! 1.26 L. Webber, 11-Mar-81
; 0125 ! Take out "return-to-sender" processing for packets from the
; 0126 ! ECL; NSP never uses the feature.
; 0127 !
; 0128 ! 1.27 L. Webber, 12-Mar-81
; 0129 ! Fix BLDPH2 so that if the source node is adjacent and Phase 2,
; 0130 ! the ASCII source name is put into the routing header.
; 0131 !
; 0132 ! 1.28 L. Webber, 16-Mar-81
; 0133 ! Fix a couple of "cleanup" places so that they UNSPAWN the
; 0134 ! spawned CCB, instead of just releasing it.
; 0135 !
; 0136 ! 1.29 L. Webber, 16-Mar-81
; 0137 ! Modify so that only links where at least one end is Phase II (not
; 0138 ! II+) are intercepted.
; 0139 !
; 0140 ! 1.30 L. Webber, 18-Mar-81
; 0141 ! Fix bug in RCVPH2 that was inspecting the wrong line as the
; 0142 ! output one.
; 0143 !
; 0144 ! 1.31 L. Webber, 19-Mar-81
; 0145 ! Fix the same bug in RCVDAT.
; 0146 !
; 0147 ! 1.32 L. Webber, 20-Mar-81
; 0148 ! Fix mistake in header-flag parameter in a call to BLDPH2.
; 0149 !
; 0150 ! 1.33 L. Webber, 3-Apr-81
; 0151 ! Put LIX for input line as entity into LOG_EVENT call (except
; 0152 ! for the Aged Packet Loss event, which takes no entity).
; 0153 !
; 0154 ! 1.34 L. Webber, 17-Apr-81
; 0155 ! Fix RCVPH2 to map to input line data base when processing
; 0156 ! a packet for self.
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 4
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0157 !
; 0158 ! 1.35 L. Webber, 1-May-81
; 0159 ! Make sure no more than 60 bytes goes in the Event Buffer in
; 0160 ! UNREACH in RCVPH2.
; 0161 !
; 0162 ! 1.36 L. Webber, 6-May-81 *** TEMPORARY ***
; 0163 ! Crash when an invalid format message is received from a Phase
; 0164 ! II node.
; 0165 !
; 0166 ! 1.37 L. Webber, 6-May-81
; 0167 ! Set C.LIX (the input channel) to 0 when sending a packet to the
; 0168 ! local node in RCVECL.
; 0169 !
; 0170 ! 1.38 L. Webber, 6-May-81 *** TEMPORARY ***
; 0171 ! Fix PH2HDR to call a mismatch between source name and adjacent
; 0172 ! node name "unreachable" instead of "format error", so that the
; 0173 ! event doesn't cause a crash while 1.36 is in.
; 0174 !
; 0175 ! 1.39 L. Webber, 8-May-81
; 0176 ! Fix local link code in RCVECL to do an LDBRT on resource failure.
; 0177 !
; 0178 ! 1.40 L. Webber, 11-May-81
; 0179 ! Take out 1.36 and 1.38.
; 0180 !
; 0181 ! 1.41 L. Webber, 1-Jun-81
; 0182 ! Modify all LOG_EVENT calls for a circuit entity to pass the NMXid.
; 0183 !
; 0184 ! 1.42 L. Webber, 3-Jun-81
; 0185 ! Allocate a specific buffer size instead of an SDB.
; 0186 !
; 0187 ! 1.43 L. Webber, 4-Jun-81
; 0188 ! Set C_LIN in Select, not Forwarding, when going to the ECL.
; 0189 !
; 0190 ! 1.44 L. Webber, 25-Jun-81
; 0191 ! Modify UNREACH subroutine of RCVPH2 to call SEND_DC (in XPESEL)
; 0192 ! instead of constructing and sending the DC itself.
; 0193 !
; 0194 ! 1.45 L. Webber, 7-Jul-81
; 0195 ! Fix RCVDAT to handle congestion by UNSPAWNing before TOSSing.
; 0196 !
; 0197 ! 1.46 L. Webber, 20-Jul-81
; 0198 ! Decrement INPUTcount when sending a DC back to the source of a
; 0199 ! buffer in RCVPH2, thus closing the books on the buffer.
; 0200 !
; 0201 ! 1.47 L. Webber, 22-Jul-81
; 0202 ! Enhance 1.46 to clear out a CCB's type code when it is allocated
; 0203 ! in RCVPH2 and RCVDAT. This assures that _TERMINATE (1.12) will do the
; 0204 ! right thing with INPUTcount even when the CCB isn't actually forwarded
; 0205 ! anywhere.
; 0206 !
; 0207 ! 1.48 L. Webber, 24-Jul-81
; 0208 ! Fix local link processing in RCVECL to get a CCB as well as a buffer.
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 5
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0209 !
; 0210 ! 1.49 L. Webber, 31-Jul-81
; 0211 ! Fix RCVPH2 so that a bogus "Phase II" packet will not cause a
; 0212 ! SIGNAL_STOP, but instead will cause a "packet format error" event
; 0213 ! to be logged and the packet to be discarded.
; 0214 !
; 0215 ! 1.50 L. Webber, 5-Aug-81
; 0216 ! Fix the first call to TOSS in RCVDAT to pass information which has
; 0217 ! not yet been determined, as 0.
; 0218 !
; 0219 ! 1.51 L. Webber, 6-Aug-81
; 0220 ! Zero out both adjustment factor and buffer type of a newly acquired
; 0221 ! CCB in RCVECL. (Cf. 1.47).
; 0222 !
; 0223 ! 1.52 L. Webber, 12-Aug-81
; 0224 ! Fix UNREACH in RCVPH2 to zero out the adjustment factor in the
; 0225 ! spawned CCB before sending a DC.
; 0226 !
; 0227 ! 1.53 L. Webber, 12-Aug-81
; 0228 ! Fix 1.49 to refer to the right CCB (CCB_P) throughout.
; 0229 !
; 0230 ! 1.54 L. Webber, 12-Aug-81
; 0231 ! Fix 1.52 to un-adjust the pass-through CCB before zeroing out
; 0232 ! the adjustment factor. Also, un-chain the pass-through (i.e.,
; 0233 ! zero out the spawned CCB's C_CHN).
; 0234 !
; 0235 ! 1.55 L. Webber, 16-Sep-81
; 0236 ! Fix all three main routines so that a line state for a selected
; 0237 ! output circuit other than "running" will make a node unreachable over
; 0238 ! that circuit. This is to handle the window during which TLI has
; 0239 ! brought the circuit down, but XPT hasn't processed the "line down"
; 0240 ! CCB.
; 0241 !
; 0242 ! 1.56 L. Webber, 16-Sep-81
; 0243 ! Modify BLDPH2 so that, if the source node is a Phase II node, it
; 0244 ! searches first the input circuit for the packet and then all circuits
; 0245 ! for an matching adjacent Phase II node. If it finds one, it converts
; 0246 ! the address into an ASCII node name. The change from the old way
; 0247 ! of doing things is that all circuits and not just the input circuit
; 0248 ! are checked.
; 0249 !
; 0250 ! 1.57 L. Webber, 20-Sep-81
; 0251 ! Fix 1.55 not to check the "output circuit" for a packet to the
; 0252 ! local node.
; 0253 !
; 0254 ! 1.58 A. Peckham, 23-Sep-81
; 0255 ! Fix dot bug in RCVPH2.
; 0256 !
; 0257 ! 1.59 L. Webber, 24-Sep-81
; 0258 ! Modify event logging calls to use new macros for storing parameters
; 0259 ! in the Event Buffer.
; 0260 !
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 6
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0261 ! 1.60 L. Webber, 16-Oct-81
; 0262 ! Change UNREACH in RCVPH2 not to DC an unreachable packet if the
; 0263 ! source node is 2+, but rather just to toss the packet.
; 0264 !
; 0265 ! 1.61 L. Webber, 16-Nov-81
; 0266 ! Fix RCVDAT when destination is unreachable, to address the input
; 0267 ! circuit data base before incrementing the "transit packets in"
; 0268 ! counter (currently the output data base for OL = -1 is being ad-
; 0269 ! dressed).
; 0270 !
; 0271 ! 1.62 L. Webber, 21-Dec-81
; 0272 ! Fix UNREACH in RCVPH2 so that it exchanges the source and destination
; 0273 ! node names, and recognizes a DC in a packet with a routing header.
; 0274 !
; 0275 ! 1.63 L. Webber, 17-Feb-82
; 0276 ! Fix UNREACH in RCVPH2 to log a packet header using a pointer to the
; 0277 ! beginning of the header, not the pointer used to scan it.
; 0278 !
; 0279 ! 1.64 L. Webber, 23-Feb-82
; 0280 ! Add maintenance of DLLquota.
; 0281 !
; 0282 ! 1.65 L. Webber, 24-Feb-82
; 0283 ! Fix bug in RCVECL that lost routing header buffers when a packet
; 0284 ! was discarded.
; 0285 !
; 0286 ! 1.66 L. Webber, 3-Mar-82
; 0287 ! Fix RCVPH2 to increment right circuit data base for Transit In's,
; 0288 ! when the output circuit is Phase III.
; 0289 !
; 0290 ! 1.67 L. Webber, 3-Mar-82
; 0291 ! Streamline the whole module somewhat. This mostly involves minor
; 0292 ! rearranging of code, but the following features have been deleted:
; 0293 !
; 0294 ! 1. Validating the source node address in RCVECL (it is assumed that
; 0295 ! NSP is a good guy).
; 0296 ! 2. Validating the output circuit in RCVECL (ditto).
; 0297 ! 3. Taking out the scan of the Node Translate Table in PH2HDR. This
; 0298 ! table is no longer generated anyway. Just in case, the code is
; 0299 ! only commented out.
; 0300 !
; 0301 ! 1.68 L. Webber, 19-Mar-82
; 0302 ! Fix a bug in UNREACH in RCVPH2 that misused the buffer pointer to
; 0303 ! packets received without routing headers, resulting in invalid DC's
; 0304 ! being sent.
; 0305 ! Change code in the same module that threw away a packet with an invalid
; 0306 ! routing header. The new code tries to DC the packet as best it can.
; 0307 ! (It also takes less space.)
; 0308 !
; 0309 ! 1.69 A. Peckham, 19-Apr-82
; 0310 ! Eliminate calls to LOG_EVENT, GETNODE, GETLINE, PKTB_HDR.
; 0311 ! PKTA_HDR has gone to XPE.
; 0312 ! Make calls to $CDBV and $CBDMG regular linkages again
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 7
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (1)
; 0313 ! and rename them to CDTB and CBTD respectively.
; 0314 !
; 0315 ! 1.70 A. Peckham, 14-Jun-82
; 0316 ! Fix UNREACH in RCVPH2 to log PACKET HEADER parameter
; 0317 ! for all errors except for $XPT$E_FMT.
; 0318 !
; 0319 ! 1.71 A. Peckham, 2-Jul-82
; 0320 ! Rename INTERCEPT to INTPH2.
; 0321 !
; 0322 ! 1.72 D.Brannon, 22-Sep-83
; 0323 ! Moved TERMINATE in the VISITS check in MAINLINE to
; 0324 ! after the references to the CCB to avoid a race.
; 0325 !
; 0326 ! 1.73 D.Brannon, 23-Sep-83
; 0327 ! Add a check in PH2HDR for a zero length destination name.
; 0328 !
; 0329 !--
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 8
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (2)
; 0330
; 0331 !
; 0332 ! TABLE OF CONTENTS
; 0333 !
; 0334
; 0335 forward routine
; 0336 RCVECL,
; 0337 RCVDAT: novalue,
; 0338 RCVPH2: novalue,
; 0339 BLDPH2,
; 0340 BLDPH3,
; 0341 PH2HDR;
; 0342
; 0343 !
; 0344 ! INCLUDE FILES:
; 0345 !
; 0346
; 0347 require 'XPTMAC';
; 0445
; 0446 !
; 0447 ! MACROS:
; 0448 !
; 0449
; M 0450 macro GETBUF(len,ccb) =
; M 0451 BEGIN
; M 0452 MAP CCB: REF BLOCK FIELD (C_XPT_FIELDS);
; M 0453 IF $MCB_GET_BUFFER (len,ccb[C_ADDR]) THEN BEGIN
; M 0454 SMAP$(ccb[C_BIAS]);
; M 0455 ccb[C_XPT_ALLOCATION] = len;
; M 0456 TRUE
; M 0457 END
; M 0458 ELSE FALSE
; 0459 end%;
; 0460
; 0461 !
; 0462 ! EQUATED SYMBOLS:
; 0463 !
; 0464
; 0465 !
; 0466 ! OWN STORAGE:
; 0467 !
; 0468
; 0469 !
; 0470 ! EXTERNAL REFERENCES:
; 0471 !
; 0472
; 0473 external routine
; 0474 FORWARDER,
; 0475 ECLFWD,
; 0476 CDTB,
; 0477 CBTD,
; 0478 RE_QUEUE: novalue,
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 9
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (2)
; 0479 TERMINATE: novalue,
; 0480 UNSPAWN: novalue;
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 10
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
; 0481
; 0482 global
; 0483 routine RCVECL (CCB_P) =
; 0484
; 0485 !++
; 0486 ! FUNCTIONAL DESCRIPTION:
; 0487 !
; 0488 ! This routine processes data packets received from a local Transport
; 0489 ! user. It determines the output line (or local Transport user) corresponding
; 0490 ! to the specified destination, and attempts to forward the packet to that
; 0491 ! destination. If the destination is unreachable, it will attempt to return
; 0492 ! the packet to the source Transport user. If the packet is returned to
; 0493 ! sender, or if a congestion or resource error occurs during processing of the
; 0494 ! packet, the function CCB is returned to the caller with an error.
; 0495 !
; 0496 ! FORMAL PARAMETERS
; 0497 !
; 0498 ! CCB_P - address of the function CCB, which points to the
; 0499 ! packet to be transmitted.
; 0500 !
; 0501 ! IMPLICIT INPUTS
; 0502 !
; 0503 ! CB[C_PRM1] - source address
; 0504 ! CB[C_PRM2] - destination node address
; 0505 ! CB[C_STS] - bit 0, if on, specifies that "return to sender" be
; 0506 ! set in the header
; 0507 ! CB[C_LIN] - channel to send the packet on, or 0 if Select is to
; 0508 ! determine the channel
; 0509 !
; 0510 ! ROUTINE VALUE: A "success" code, or one of several "failure" codes
; 0511 ! COMPLETION CODES:
; 0512 !
; 0513 ! CS_SUC - success
; 0514 ! CE_DIS - destination unreachable; packet will be separately returned
; 0515 ! to sender if so requested
; 0516 ! CE_RTE - packet rejected for because of congestion or resource failure
; 0517 ! CE_NTE - source Transport user has not issued an OPEN to Transport
; 0518 ! CE_ERR - invalid parameter specified
; 0519 !
; 0520 ! SIDE EFFECTS:
; 0521 !
; 0522 ! On a success return, Select has taken control of the
; 0523 ! CCB passed it; that CCB should not be used by the caller again.
; 0524 !
; 0525 !--
; 0526
; 0527 begin
; 0528
; 0529 local NODEb,LINEb;
; 0530 require 'XPTSYM';
; 0567 local CCB: ref block field (C_XPT_fields);
; 0568 map CCB_P: ref block field(C_fields);
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 11
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
; 0569 local OTYPE,OLINE,SOURCE,DEST,CALLER,RET;
; 0570
; 0571 !--------------------------------------------!
; 0572 ! !
; 0573 ! Routine to do "unreachability" processing !
; 0574 ! !
; 0575 !--------------------------------------------!
; 0576
; 0577 routine UNREACH (CB,CALLER,SOURCE,DEST) =
; 0578 begin
; 0579
; 0580 literal NO_NODEb = 0; ! Make sure NODEb isn't mapped
; 0581 literal NO_LINEb = 0; ! Ditto for LINEb
; 0582 require 'XPTSYM';
; 0619 map CB: ref block field(C_XPT_fields);
; 0620
; 0621 COUNTER_INCREMENT(XPTDB,XPTunreach_loss); ! Increment node counter
; 0622 $NM_LOG_BEGIN();
; 0623 PARAMETER_CM(0,4); ! Multiple fields, 4 of them
; 0624 PARAMETER_H_1(,uplit(2)); ! Hex field, 1 byte: (canned) routing flags
; 0625 PARAMETER_DU_2(,DEST); ! Decimal unsigned, 2 bytes: dest. address
; 0626 PARAMETER_DU_2(,SOURCE); ! Decimal unsigned, 2 bytes: source address
; 0627 PARAMETER_H_1(,uplit(0)); ! Hex field, 1 byte: (canned) forwarding flags
; 0628 $NM_LOG_END(4^6+$XPT$E_UNR,-1); ! "unreachability packet loss" event
; 0629 if .CB [C_XPT_ALLOCATION] neq 0 then ! Get rid of our CCB
; 0630 $MCB_RETURN_CCB_AND_BUFFER(.CB [C_XPT_ALLOCATION],.CB) ! (with or
; 0631 else $MCB_RETURN_CCB(.CB); ! without a buffer)
; 0632 return(CE_DIS) ! and return an error
; 0633
; 0634 end;
.TITLE XPTSEL
.IDENT /X01730/
000000 .PSECT $PLIT$, RO , D
000000 000002 P.AAA: .WORD 2
000002 000000 P.AAB: .WORD 0
.GLOBL FORWARDER, ECLFWD, CDTB, CBTD
.GLOBL RE.QUEUE, TERMINATE, UNSPAWN, .CRDAT
.GLOBL $NLBEG, $DPCM, $TPH1, $TPDU2, $NLEND
.GLOBL $CBBRT, $CCBRT
.SBTTL UNREACH
000000 .PSECT $CODE$, RO
000000 004167 000000G ; UNREACH
U.11: JSR R1,$SAVE4 ; 0577
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 12
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
000004 016700 000002G MOV U.9,R0 ; 0621
000010 062700 000136 ADD #136,R0
000014 005210 INC (R0)
000016 001001 BNE 1$
000020 005310 DEC (R0)
000022 004767 000000G 1$: JSR PC,$NLBEG ; 0622
000026 005046 CLR -(SP) ; 0623
000030 012700 000004 MOV #4,R0
000034 004767 000000G JSR PC,$DPCM
000040 116700 000000' MOVB P.AAA,R0 ; 0624
000044 004767 000000G JSR PC,$TPH1
000050 016600 000016 MOV 16(SP),R0 ; DEST,* 0625
000054 004767 000000G JSR PC,$TPDU2
000060 016600 000020 MOV 20(SP),R0 ; SOURCE,* 0626
000064 004767 000000G JSR PC,$TPDU2
000070 116700 000002' MOVB P.AAB,R0 ; 0627
000074 004767 000000G JSR PC,$TPH1
000100 012700 000401 MOV #401,R0 ; 0628
000104 012701 177777 MOV #-1,R1
000110 004767 000000G JSR PC,$NLEND
000114 016604 000024 MOV 24(SP),R4 ; CB,* 0629
000120 016401 000034 MOV 34(R4),R1
000124 001403 BEQ 2$
000126 004767 000000G JSR PC,$CBBRT ; 0630
000132 000402 BR 3$ ; 0629
000134 004767 000000G 2$: JSR PC,$CCBRT ; 0631
000140 005726 3$: TST (SP)+ ; 0577
000142 012700 177520 MOV #-260,R0 ; 0578
000146 000207 RTS PC ; 0577
; Routine Size: 52 words, Routine Base: $CODE$ + 0000
; Maximum stack depth per invocation: 7 words
; 0635
; 0636
; 0637 !****************** START OF ROUTINE MAINLINE **************************!
; 0638
; 0639
; 0640 !
; 0641 ! Pick up the parameters and validate them
; 0642 !
; 0643
; 0644 CCB = .CCB_P;
; 0645 DEST = .CCB[C_PRM2]; ! Pick up the destination address
; 0646 NODEb = $XPT_GET_NODE_DB(.DEST); ! and address its data base entry
; 0647 if .NODEb eql 0 then ! Invalid destination -
; 0648 return (CE_ERR); ! return "parameter error"
; 0649 SOURCE = .CCB[C_PRM1]; ! Pick up the source address
; 0650 OLINE = .CCB[C_LIN]; ! Pick up the output line
; 0651 CALLER = .CCB[C_PIX]; ! Pick up Transport user's PDV index
; 0652
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 13
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
; 0653 !
; 0654 ! Determine the output line
; 0655 !
; 0656
; 0657 if .OLINE eql 0 ! Line not specified - default
; 0658 then if not .Local_node
; 0659 then OLINE = .OL;
; 0660
; 0661 !
; 0662 ! Spawn a CCB
; 0663 !
; 0664
; 0665 if not $MCB_GET_CCB (CCB)
; 0666 then return (CE_RTE);
; 0667 CCB [C_XPT_ALLOCATION] = 0;
; 0668
; 0669 if .OLINE eql 0 then
; 0670 begin ! Local link:
; 0671 local TMPCCB: ref block field (C_FIELDS), BUFSIZE;
; 0672 TMPCCB = .CCB_P; ! Trace through the input CCB chain
; 0673 BUFSIZE = 0;
; 0674 do ! and accumulate message length
; 0675 BUFSIZE = .BUFSIZE + .TMPCCB[C_CNT]
; 0676 while (TMPCCB = .TMPCCB[C_CHN]) neqa 0;
; 0677 if not GETBUF(.BUFSIZE,CCB) ! Get a buffer that size
; 0678 then begin ! and if failure
; 0679 $MCB_RETURN_CCB(.CCB); ! then return CCB
; 0680 return (CE_RTE); ! and "resource error"
; 0681 end;
; 0682 end; ! Not local link - just get the CCB
; 0683
; 0684 if .OLINE neq 0 then !If the path isn't local,
; 0685 CCB[C_STK] = .CCB_P; ! chain in the pass-through CCB
; 0686 CCB[C_PRM4] = 0;
; 0687
; 0688 !
; 0689 ! Check destination for unreachability
; 0690 !
; 0691
; 0692 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 0693 if (not .Reach !Destination
; 0694 or ((.OLINE neq 0) and (.LINEstate neq RU))) then! unreachable:
; 0695 return (UNREACH(.CCB,.CALLER,.SOURCE, ! do "unreachability"
; 0696 .DEST)); ! processing
; 0697
; 0698 !
; 0699 ! Destination is local
; 0700 !
; 0701
; 0702 RET %(the return from Forwarding)% =
; 0703
; 0704 (if .OLINE eql 0 then
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 14
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
; 0705 if .Local_node then begin
; 0706 OTYPE = 0; !Set output type to "local"
; 0707 CCB[C_CNT] = !Copy the data
; P 0708 $MCB_COPY_CHAIN_TO_BUFFER(.CCB_P, ! into the single
; 0709 (.CCB[C_BIAS],.CCB[C_ADDR])); ! data buffer
; 0710 CCB[C_LIX] = 0; !Input channel is null
; 0711 if (ECLFWD(.CCB,.SOURCE,.DEST,0) !Try to forward the packet
; 0712 neq CS_SUC) then ! to the specified user
; P 0713 return ($MCB_RETURN_CCB_AND_BUFFER !Failed -
; 0714 (.CCB[C_PRM5],.CCB); CE_RTE) ! set error code
; 0715 else begin !Worked -
; 0716 TERMINATE(.CCB_P,CS_SUC); ! return the input
; 0717 INPUTquota = .INPUTquota - 1; ! buffer (but don't
; 0718 CS_SUC ! return the admission
; 0719 end ! permit)
; 0720 end
; 0721 else SIGNAL_STOP (CE_ERR) !Output line = 0, destination not Self
; 0722
; 0723 !
; 0724 ! Adjacent node is Phase II
; 0725 !
; 0726
; 0727 else begin
; 0728 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 0729 if ((.Nty eql PhTwo) or (.Nty eql TOPS20)) then begin
; 0730 if .Nty eql PhTwo then !Set output type to
; 0731 OTYPE = 1 ! "Phase II" or
; 0732 else OTYPE = 2; ! "Phase II+/Phase III"
; 0733 RET =
; 0734 (if (.Nid neq .DEST) then !Destination isn't adjacent -
; 0735 SIGNAL_STOP (CE_ERR) ! bomb
; 0736 else BLDPH2(.CCB,0,.DEST, !Otherwise, build a
; 0737 .SOURCE,.OLINE,0)); ! Phase II header
; 0738 end
; 0739
; 0740 !
; 0741 ! Adjacent node is Phase III - build a Phase III header
; 0742 !
; 0743
; 0744 else begin
; 0745 OTYPE = 2; !Set output type to "Phase II+/III"
; 0746 RET = BLDPH3 (.CCB,0,.DEST,.Tid,0);
; 0747 end;
; 0748
; 0749 !
; 0750 ! Error in building the header - return an error
; 0751 !
; 0752
; 0753 if .RET neq CS_SUC then return (CCBRT$(.CCB); .RET)
; 0754
; 0755 !
; 0756 ! Message is ready to be sent - give it to Forwarding
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 15
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
; 0757 !
; 0758
; 0759 else begin
; 0760 if ((RET = FORWARDER(.CCB,.OLINE))
; 0761 eql CS_SUC) then ! If Forwarding accepts packet,
; 0762 COUNTER_INCREMENT(LINEb,XPTend_xmt);! update packets counter
; 0763 .RET
; 0764 end
; 0765 end);
; 0766
; 0767 !
; 0768 ! Forwarding rejected packet as "unreachable"
; 0769 !
; 0770
; 0771 if .RET eql CE_DIS then
; 0772 UNREACH (.CCB,.CALLER,.SOURCE,.DEST)
; 0773
; 0774 !
; 0775 ! Forwarding rejected packet for congestion reasons
; 0776 !
; 0777
; 0778 else if .RET eql CE_RTE then begin
; 0779 if .CCB [C_XPT_ALLOCATION] neq 0 then
; 0780 $MCB_RETURN_CCB_AND_BUFFER(.CCB [C_XPT_ALLOCATION],.CCB)
; 0781 else $MCB_RETURN_CCB(.CCB);
; 0782 CE_RTE
; 0783 end
; 0784
; 0785 !
; 0786 ! Forwarding accepted packet - return "success"
; 0787 !
; 0788
; 0789 else begin
; 0790 if .OTYPE eql 1 then !Going to a Phase II node -
; P 0791 CALL$E(INTPH2,PD_XPE,.CCB_P,1, ! do intercept
; 0792 DEST,SOURCE); ! processing
; 0793 CS_SUC
; 0794 end
; 0795
; 0796 end; !End of RCVECL
.GLOBL GTNODE, $CCBGT, $CORGT, KISAR6
.GLOBL GTLINE, $CPTBF, $IC32, INTPH2
.GLOBL $CALLE
.SBTTL RCVECL
000000 004167 000000G RCVECL::
U.1: JSR R1,$SAVE5 ; 0483
000004 162706 000014 SUB #14,SP
000010 016646 000032 MOV 32(SP),-(SP) ; CCB.P,* 0644
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 16
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
000014 011646 MOV (SP),-(SP) ; *,CCB
000016 011600 MOV (SP),R0 ; CCB,* 0645
000020 016066 000026 000014 MOV 26(R0),14(SP) ; *(CCB),DEST
000026 016666 000014 000010 MOV 14(SP),10(SP) ; DEST,* 0646
000034 016600 000010 MOV 10(SP),R0
000040 004767 000000G JSR PC,GTNODE
000044 010002 MOV R0,R2 ; *,NODEB
000046 001003 BNE 1$ ; 0647
000050 012700 177760 MOV #-20,R0 ; 0648
000054 000534 BR 8$
000056 011600 1$: MOV (SP),R0 ; CCB,* 0649
000060 016066 000024 000016 MOV 24(R0),16(SP) ; *(CCB),SOURCE
000066 005003 CLR R3 ; OLINE 0650
000070 156003 000010 BISB 10(R0),R3 ; *(CCB),OLINE
000074 116066 000011 000012 MOVB 11(R0),12(SP) ; *(CCB),CALLER 0651
000102 105066 000013 CLRB 13(SP) ; CALLER
000106 005703 TST R3 ; OLINE 0657
000110 001004 BNE 2$
000112 032712 000400 BIT #400,(R2) ; *,NODEB 0658
000116 001001 BNE 2$
000120 111203 MOVB (R2),R3 ; NODEB,OLINE 0659
000122 004767 000000G 2$: JSR PC,$CCBGT ; 0665
000126 103563 BCS 10$
000130 010416 MOV R4,(SP) ; $MCB$R4,CCB
000132 012700 000034 MOV #34,R0 ; 0667
000136 060400 ADD R4,R0 ; CCB,*
000140 010066 000006 MOV R0,6(SP)
000144 005010 CLR (R0)
000146 005066 000004 CLR 4(SP) ; 0669
000152 005703 TST R3 ; OLINE
000154 001033 BNE 5$
000156 005266 000004 INC 4(SP)
000162 016600 000002 MOV 2(SP),R0 ; *,TMPCCB 0672
000166 005001 CLR R1 ; BUFSIZE 0673
000170 066001 000022 3$: ADD 22(R0),R1 ; *(TMPCCB),BUFSIZE 0675
000174 016000 000002 MOV 2(R0),R0 ; *(TMPCCB),TMPCCB 0676
000200 001373 BNE 3$
000202 004767 000000G JSR PC,$CORGT ; 0677
000206 103412 BCS 4$
000210 011604 MOV (SP),R4 ; CCB,*
000212 010064 000020 MOV R0,20(R4) ; $MCB$R0,*(CCB)
000216 010400 MOV R4,R0 ; CCB,*
000220 016760 000000G 000016 MOV KISAR6,16(R0) ; *,*(CCB)
000226 010176 000006 MOV R1,@6(SP) ; BUFSIZE,*
000232 000404 BR 5$
000234 011604 4$: MOV (SP),R4 ; CCB,* 0679
000236 004767 000000G JSR PC,$CCBRT
000242 000515 BR 10$ ; 0678
000244 005001 5$: CLR R1 ; 0684
000246 005703 TST R3 ; OLINE
000250 001405 BEQ 6$
000252 005201 INC R1
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 17
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
000254 011600 MOV (SP),R0 ; CCB,* 0685
000256 016660 000002 000004 MOV 2(SP),4(R0) ; *,*(CCB)
000264 011600 6$: MOV (SP),R0 ; CCB,* 0686
000266 005060 000032 CLR 32(R0) ; *(CCB)
000272 010300 MOV R3,R0 ; OLINE,* 0692
000274 004767 000000G JSR PC,GTLINE
000300 010005 MOV R0,R5 ; *,LINEB
000302 005712 TST (R2) ; NODEB 0693
000304 100005 BPL 7$
000306 006001 ROR R1 ; 0694
000310 103017 BCC 9$
000312 121527 000010 CMPB (R5),#10 ; LINEB,*
000316 001414 BEQ 9$
000320 011646 7$: MOV (SP),-(SP) ; CCB,* 0695
000322 016646 000014 MOV 14(SP),-(SP) ; CALLER,*
000326 016646 000022 MOV 22(SP),-(SP) ; SOURCE,*
000332 016646 000016 MOV 16(SP),-(SP)
000336 004767 177266 JSR PC,U.11
000342 062706 000010 ADD #10,SP
000346 000455 8$: BR 11$
000350 032766 000001 000004 9$: BIT #1,4(SP) ; 0704
000356 001500 BEQ 14$
000360 032712 000400 BIT #400,(R2) ; *,NODEB 0705
000364 001465 BEQ 13$
000366 005002 CLR R2 ; OTYPE 0706
000370 011600 MOV (SP),R0 ; CCB,* 0709
000372 016046 000016 MOV 16(R0),-(SP) ; *(CCB),*
000376 016046 000020 MOV 20(R0),-(SP) ; *(CCB),*
000402 016604 000006 MOV 6(SP),R4
000406 004767 000000G JSR PC,$CPTBF
000412 016601 000004 MOV 4(SP),R1 ; CCB,* 0707
000416 010061 000022 MOV R0,22(R1) ; *,*(CCB)
000422 010100 MOV R1,R0 ; CCB,* 0710
000424 105060 000010 CLRB 10(R0) ; *(CCB)
000430 010116 MOV R1,(SP) ; CCB,* 0711
000432 016646 000022 MOV 22(SP),-(SP) ; SOURCE,*
000436 016646 000016 MOV 16(SP),-(SP)
000442 005046 CLR -(SP)
000444 004767 000000G JSR PC,ECLFWD
000450 062706 000006 ADD #6,SP
000454 005300 DEC R0
000456 001412 BEQ 12$
000460 017601 000012 MOV @12(SP),R1 ; 0714
000464 016604 000004 MOV 4(SP),R4 ; CCB,*
000470 004767 000000G JSR PC,$CBBRT
000474 022626 CMP (SP)+,(SP)+ ; 0713
000476 012700 177730 10$: MOV #-50,R0
000502 000536 11$: BR 23$
000504 016616 000006 12$: MOV 6(SP),(SP) ; 0716
000510 012746 000001 MOV #1,-(SP)
000514 004767 000000G JSR PC,TERMINATE
000520 016700 000002G MOV .CRDAT+2,R0
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 18
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
000524 105360 000104 DECB 104(R0) ; 0717
000530 005726 TST (SP)+ ; 0715
000532 012701 000001 MOV #1,R1 ; *,RET 0711
000536 000537 BR 25$ ; 0705
000540 012746 177760 13$: MOV #-20,-(SP) ; 0721
000544 012746 000001 MOV #1,-(SP)
000550 004767 000000G JSR PC,$STOP
000554 010001 MOV R0,R1 ; *,RET 0705
000556 000527 BR 25$ ; 0704
000560 010300 14$: MOV R3,R0 ; OLINE,* 0728
000562 004767 000000G JSR PC,GTLINE
000566 010005 MOV R0,R5 ; *,LINEB
000570 005000 CLR R0 ; 0729
000572 126527 000002 000004 CMPB 2(R5),#4 ; *(LINEB),*
000600 001002 BNE 15$
000602 005200 INC R0
000604 000404 BR 16$
000606 126527 000002 000005 15$: CMPB 2(R5),#5 ; *(LINEB),*
000614 001040 BNE 21$
000616 006000 16$: ROR R0 ; 0730
000620 103003 BCC 17$
000622 012702 000001 MOV #1,R2 ; *,OTYPE 0731
000626 000402 BR 18$ ; 0730
000630 012702 000002 17$: MOV #2,R2 ; *,OTYPE 0732
000634 026566 000004 000010 18$: CMP 4(R5),10(SP) ; *(LINEB),* 0734
000642 001407 BEQ 19$
000644 012746 177760 MOV #-20,-(SP) ; 0735
000650 012746 000001 MOV #1,-(SP)
000654 004767 000000G JSR PC,$STOP
000660 000414 BR 20$ ; 0734
000662 011646 19$: MOV (SP),-(SP) ; CCB,* 0736
000664 005046 CLR -(SP)
000666 016646 000014 MOV 14(SP),-(SP)
000672 016646 000024 MOV 24(SP),-(SP) ; SOURCE,*
000676 010346 MOV R3,-(SP) ; OLINE,*
000700 005046 CLR -(SP)
000702 004767 000000V JSR PC,U.4
000706 062706 000010 ADD #10,SP
000712 010001 20$: MOV R0,R1 ; *,RET 0734
000714 000420 BR 22$ ; 0729
000716 012702 000002 21$: MOV #2,R2 ; *,OTYPE 0745
000722 011646 MOV (SP),-(SP) ; CCB,* 0746
000724 005046 CLR -(SP)
000726 016646 000014 MOV 14(SP),-(SP)
000732 016700 000002G MOV .CRDAT+2,R0
000736 016046 000056 MOV 56(R0),-(SP)
000742 005046 CLR -(SP)
000744 004767 000000V JSR PC,U.5
000750 010001 MOV R0,R1 ; *,RET
000752 062706 000006 ADD #6,SP ; 0744
000756 020127 000001 22$: CMP R1,#1 ; RET,* 0753
000762 001407 BEQ 24$
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 19
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
000764 016604 000004 MOV 4(SP),R4 ; CCB,*
000770 004767 000000G JSR PC,$CCBRT
000774 022626 CMP (SP)+,(SP)+
000776 010100 MOV R1,R0 ; RET,*
001000 000516 23$: BR 32$
001002 016616 000004 24$: MOV 4(SP),(SP) ; CCB,* 0760
001006 010346 MOV R3,-(SP) ; OLINE,*
001010 004767 000000G JSR PC,FORWARDER
001014 005726 TST (SP)+
001016 010001 MOV R0,R1 ; *,RET
001020 005300 DEC R0
001022 001005 BNE 25$
001024 010500 MOV R5,R0 ; LINEB,* 0762
001026 062700 000062 ADD #62,R0
001032 004767 000000G JSR PC,$IC32
001036 020127 177520 25$: CMP R1,#-260 ; RET,* 0771
001042 001015 BNE 26$
001044 016616 000004 MOV 4(SP),(SP) ; CCB,* 0772
001050 016646 000016 MOV 16(SP),-(SP) ; CALLER,*
001054 016646 000024 MOV 24(SP),-(SP) ; SOURCE,*
001060 016646 000020 MOV 20(SP),-(SP)
001064 004767 176540 JSR PC,U.11
001070 062706 000006 ADD #6,SP
001074 000457 BR 31$ ; 0771
001076 020127 177730 26$: CMP R1,#-50 ; RET,* 0778
001102 001021 BNE 29$
001104 005776 000012 TST @12(SP) ; 0779
001110 001407 BEQ 27$
001112 017601 000012 MOV @12(SP),R1 ; 0780
001116 016604 000004 MOV 4(SP),R4 ; CCB,*
001122 004767 000000G JSR PC,$CBBRT
001126 000404 BR 28$ ; 0779
001130 016604 000004 27$: MOV 4(SP),R4 ; CCB,* 0781
001134 004767 000000G JSR PC,$CCBRT
001140 012700 177730 28$: MOV #-50,R0 ; 0778
001144 000433 BR 31$
001146 005302 29$: DEC R2 ; OTYPE 0790
001150 001027 BNE 30$
001152 012716 000022 MOV #22,(SP) ; 0792
001156 060616 ADD SP,(SP) ; SOURCE,*
001160 012746 000022 MOV #22,-(SP)
001164 060616 ADD SP,(SP) ; DEST,*
001166 012746 000001 MOV #1,-(SP)
001172 016646 000012 MOV 12(SP),-(SP)
001176 012746 000004 MOV #4,-(SP)
001202 012746 000000G MOV #INTPH2,-(SP)
001206 016700 000002G MOV .CRDAT+2,R0
001212 005046 CLR -(SP)
001214 116016 000002 MOVB 2(R0),(SP)
001220 004767 000000G JSR PC,$CALLE
001224 062706 000014 ADD #14,SP
001230 012700 000001 30$: MOV #1,R0 ; 0778
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 20
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (3)
001234 022626 31$: CMP (SP)+,(SP)+ ; 0527
001236 062706 000020 32$: ADD #20,SP ; 0483
001242 000207 RTS PC
; Routine Size: 338 words, Routine Base: $CODE$ + 0150
; Maximum stack depth per invocation: 23 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 21
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 0797
; 0798 global
; 0799 routine RCVDAT (CCB_P): novalue =
; 0800
; 0801 !++
; 0802 ! FUNCTIONAL DESCRIPTION:
; 0803 !
; 0804 ! This routine processes data packets received from the Data Link
; 0805 ! Link Layer which have Phase III routing headers. It determines
; 0806 ! the output line (or local Transport user) corresponding to the
; 0807 ! specified destination, and attempts to forward the packet to that
; 0808 ! destination. If the destination is unreachable, the routine will
; 0809 ! try to return the packet to its source node. If the immediate
; 0810 ! destination (the adjacent node on the output line) is Phase II,
; 0811 ! BLDPH2 will be called to translate the routing header. If the
; 0812 ! destination is "standard" Phase II, the packet will not be thrown
; 0813 ! away on congestion or resource failure, but will be queued for
; 0814 ! eventual reprocessing.
; 0815 !
; 0816 ! FORMAL PARAMETERS
; 0817 !
; 0818 ! CCB_P - CCB for the received packet - the "pass-through" CCB
; 0819 !
; 0820 ! IMPLICIT INPUTS
; 0821 !
; 0822 ! Reach, OL, Nty, Nid, User
; 0823 !
; 0824 ! ROUTINE VALUE: NONE
; 0825 ! COMPLETION CODES:
; 0826 !
; 0827 ! NONE.
; 0828 !
; 0829 ! SIDE EFFECTS:
; 0830 !
; 0831 ! May modify the routing header in the pass-through buffer.
; 0832 !
; 0833 !--
; 0834
; 0835 begin
; 0836
; 0837 local NODEb,LINEb;
; 0838 require 'XPTSYM';
; 0875 local CCB: ref block field (C_XPT_fields);
; 0876 map CCB_P: ref block field(C_fields);
; 0877 local DEST,SOURCE,ILINE,OLINE,RET,RFLG,VISIT;
; 0878 pointer PTR;
; 0879 macro RTS = biton (.RFLG,RTSflg)%;
; 0880 macro RQR = biton (.RFLG,RQRflg)%;
; 0881
; 0882
; 0883 !-----------------------------------------------------!
; 0884 ! !
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 22
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 0885 ! Routine to either throw away a packet or queue it !
; 0886 ! for eventual reprocessing !
; 0887 ! !
; 0888 !-----------------------------------------------------!
; 0889
; 0890 routine TOSS (CCB,OLINE,ILINE,DEST): novalue =
; 0891 begin
; 0892
; 0893 local LINEb;
; 0894 literal NO_NODEb = 0; !This is to get around a BLISS glitch
; 0895 require 'XPTSYM';
; 0932
; 0933 LINEb = $XPT_GET_LINE_DB(.OLINE); ! Address line data base entry
; 0934 if ((.OLINE neq 0) ! If the destination isn't local,
; 0935 and (.Nty eql PhTwo) ! and it's standard Phase II
; 0936 and (.Nid eql .DEST)) ! and it's the adjacent node
; 0937 then RE_QUEUE(.CCB) ! then requeue CCB for later
; 0938 else begin !
; 0939 if .OLINE neq 0 then ! Transit congestion -
; 0940 COUNTER_INCREMENT(LINEb,XPTxit_cng)! log that
; 0941 else begin ! Path-end congestion -
; 0942 LINEb = $XPT_GET_LINE_DB(.ILINE); ! Log that (on
; 0943 COUNTER_INCREMENT(LINEb,XPTend_cng); ! the input line)
; 0944 end;
; 0945 TERMINATE(.CCB,CE_RTE); !Otherwise, throw buffer away
; 0946 end;
; 0947
; 0948 end;
.SBTTL TOSS
000000 010146 ; TOSS
U.19: MOV R1,-(SP) ; 0890
000002 016600 000010 MOV 10(SP),R0 ; OLINE,* 0933
000006 004767 000000G JSR PC,GTLINE
000012 010001 MOV R0,R1 ; *,LINEB
000014 005000 CLR R0 ; 0934
000016 005766 000010 TST 10(SP) ; OLINE
000022 001416 BEQ 1$
000024 005200 INC R0
000026 126127 000002 000004 CMPB 2(R1),#4 ; *(LINEB),* 0935
000034 001011 BNE 1$
000036 026166 000004 000004 CMP 4(R1),4(SP) ; *(LINEB),DEST 0936
000044 001005 BNE 1$
000046 016646 000012 MOV 12(SP),-(SP) ; CCB,* 0937
000052 004767 000000G JSR PC,RE.QUEUE
000056 000432 BR 5$ ; 0934
000060 006000 1$: ROR R0 ; 0939
000062 103006 BCC 2$
000064 012700 000100 MOV #100,R0 ; 0940
000070 060100 ADD R1,R0 ; LINEB,*
000072 005210 INC (R0)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 23
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
000074 001014 BNE 4$
000076 000412 BR 3$
000100 016600 000006 2$: MOV 6(SP),R0 ; ILINE,* 0942
000104 004767 000000G JSR PC,GTLINE
000110 010001 MOV R0,R1 ; *,LINEB
000112 012700 000066 MOV #66,R0 ; 0943
000116 060100 ADD R1,R0 ; LINEB,*
000120 005210 INC (R0)
000122 001001 BNE 4$
000124 005310 3$: DEC (R0)
000126 016646 000012 4$: MOV 12(SP),-(SP) ; CCB,* 0945
000132 012746 177730 MOV #-50,-(SP)
000136 004767 000000G JSR PC,TERMINATE
000142 005726 TST (SP)+ ; 0938
000144 005726 5$: TST (SP)+ ; 0891
000146 012601 MOV (SP)+,R1 ; 0890
000150 000207 RTS PC
; Routine Size: 53 words, Routine Base: $CODE$ + 1414
; Maximum stack depth per invocation: 4 words
; 0949
; 0950
; 0951
; 0952 !---------------------------------------------!
; 0953 ! !
; 0954 ! Routine to do "unreachability" processing !
; 0955 ! !
; 0956 !---------------------------------------------!
; 0957
; 0958 routine UNREACH (CCB,CCB_P,SOURCE,DEST,RFLG,CODE): novalue =
; 0959 begin
; 0960
; 0961 literal NO_NODEb = 0; ! To keep NODEb from being mapped
; 0962 local LINEb;
; 0963 require 'XPTSYM';
; 1000 map CCB: ref block field(C_FIELDS);
; 1001 map CCB_P: ref block field(C_FIELDS);
; 1002
; 1003 pointer PTR;
; 1004
; 1005 LINEb = $XPT_GET_LINE_DB(.CCB_P[C_LIX]); ! Address input line data base
; 1006 if .CODE eql $XPT$E_UNR then ! Increment
; 1007 COUNTER_INCREMENT(XPTDB,XPTunreach_loss) ! appropriate
; 1008 else COUNTER_INCREMENT(XPTDB,XPTrange_loss); ! node counter
; 1009 $NM_LOG_BEGIN();
; 1010 CALL$E(PKTA_HDR,(PD_XPE),.CCB_P[C_ADDR]); ! Log an "unreachable node" or
; 1011 $NM_LOG_END(4^6+.CODE,.NMXid); ! "node out of range" event
; 1012 if ((RQR) and (not (RTS))) then begin ! Valid "return to sender" -
; 1013 CCB[C_BIAS] = .CCB_P[C_BIAS]; ! Copy routing
; 1014 CCB[C_ADDR] = .CCB_P[C_ADDR]; ! header into
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 24
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 1015 CCB[C_CNT] = .CCB_P[C_CNT]; ! the spawned CCB
; 1016 PTR = .CCB[C_ADDR]; ! Address the routing header
; 1017 putb (.RFLG or RTSflg, PTR); ! Set the RTS flag
; 1018 putw (.SOURCE,PTR); ! Exchange the source
; 1019 putw (.DEST,PTR); ! and destination addresses
; 1020 if FORWARDER(.CCB,.CCB_P[C_LIN]) ! Send back over input line
; 1021 neq CS_SUC then ! Rejected -
; 1022 TERMINATE(.CCB,CE_DIS); ! throw away
; 1023 end
; 1024 else TERMINATE(.CCB,CE_DIS); ! No "return to sender" - throw away
; 1025 return;
; 1026 end;
.GLOBL $IC8, PKTA.HDR
.SBTTL UNREACH
000000 004167 000000G ; UNREACH
U.22: JSR R1,$SAVE4 ; 0958
000004 005746 TST -(SP)
000006 016603 000026 MOV 26(SP),R3 ; CCB.P,* 1005
000012 005000 CLR R0
000014 156300 000010 BISB 10(R3),R0
000020 004767 000000G JSR PC,GTLINE
000024 010002 MOV R0,R2 ; *,LINEB
000026 026627 000016 000001 CMP 16(SP),#1 ; CODE,* 1006
000034 001010 BNE 1$
000036 016700 000002G MOV .CRDAT+2,R0 ; 1007
000042 062700 000136 ADD #136,R0
000046 005210 INC (R0)
000050 001010 BNE 2$
000052 005310 DEC (R0)
000054 000406 BR 2$ ; 1006
000056 016700 000002G 1$: MOV .CRDAT+2,R0 ; 1008
000062 062700 000131 ADD #131,R0
000066 004767 000000G JSR PC,$IC8
000072 004767 000000G 2$: JSR PC,$NLBEG ; 1009
000076 016346 000020 MOV 20(R3),-(SP) ; 1010
000102 012746 000001 MOV #1,-(SP)
000106 012746 000000G MOV #PKTA.HDR,-(SP)
000112 016700 000002G MOV .CRDAT+2,R0
000116 005046 CLR -(SP)
000120 116016 000002 MOVB 2(R0),(SP)
000124 004767 000000G JSR PC,$CALLE
000130 016600 000026 MOV 26(SP),R0 ; CODE,* 1011
000134 062700 000400 ADD #400,R0
000140 016201 000034 MOV 34(R2),R1 ; *(LINEB),*
000144 004767 000000G JSR PC,$NLEND
000150 016602 000040 MOV 40(SP),R2 ; CCB,* 1013
000154 016601 000030 MOV 30(SP),R1 ; RFLG,* 1012
000160 032701 000010 BIT #10,R1
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 25
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
000164 001451 BEQ 3$
000166 032701 000020 BIT #20,R1
000172 001046 BNE 3$
000174 016362 000016 000016 MOV 16(R3),16(R2) ; 1013
000202 016362 000020 000020 MOV 20(R3),20(R2) ; 1014
000210 016362 000022 000022 MOV 22(R3),22(R2) ; 1015
000216 016200 000020 MOV 20(R2),R0 ; *,PTR 1016
000222 010104 MOV R1,R4 ; 1017
000224 052704 000020 BIS #20,R4
000230 110420 MOVB R4,(R0)+ ; *,PTR
000232 016666 000034 000010 MOV 34(SP),10(SP) ; SOURCE,X 1018
000240 116620 000010 MOVB 10(SP),(R0)+ ; X,PTR
000244 116620 000011 MOVB 11(SP),(R0)+ ; X,PTR
000250 016666 000032 000010 MOV 32(SP),10(SP) ; DEST,X 1019
000256 116620 000010 MOVB 10(SP),(R0)+ ; X,PTR
000262 116620 000011 MOVB 11(SP),(R0)+ ; X,PTR
000266 010216 MOV R2,(SP) ; 1020
000270 005046 CLR -(SP)
000272 116316 000010 MOVB 10(R3),(SP)
000276 004767 000000G JSR PC,FORWARDER
000302 005726 TST (SP)+
000304 005300 DEC R0 ; 1021
000306 001406 BEQ 4$
000310 010216 3$: MOV R2,(SP) ; 1024
000312 012746 177520 MOV #-260,-(SP)
000316 004767 000000G JSR PC,TERMINATE
000322 005726 TST (SP)+
000324 062706 000012 4$: ADD #12,SP ; 0958
000330 000207 RTS PC
; Routine Size: 109 words, Routine Base: $CODE$ + 1566
; Maximum stack depth per invocation: 12 words
; 1027
; 1028
; 1029 !******************** START OF ROUTINE MAINLINE *************************!
; 1030
; 1031 !
; 1032 ! Analyze the routing header
; 1033 !
; 1034
; 1035 MAPBUF (.CCB_P,PTR); !Map in the buffer
; 1036 RFLG = getb(PTR); !Pick up the routing flags
; 1037 DEST = getw(PTR); !Pick up the destination address
; 1038 SOURCE = getw(PTR); !Pick up the source address
; 1039 VISIT = ch$rchar(.PTR); !Pick up the visits count
; 1040 VISIT = .VISIT+1;
; 1041 ch$wchar_a(.VISIT,PTR);
; 1042
; 1043 !
; 1044 ! Calculate the input and output lines
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 26
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 1045 !
; 1046
; 1047 NODEb = $XPT_GET_NODE_DB(.DEST); ! Get destination data base address
; 1048 OLINE = 0;
; 1049 if not .Local_node then OLINE = .OL;
; 1050 ILINE = .CCB_P[C_LIN];
; 1051 LINEb = $XPT_GET_LINE_DB(.ILINE); ! Address input line data base entry
; 1052
; 1053 !
; 1054 ! Check the VISITS field in the routing header
; 1055 !
; 1056
; 1057 if ((.VISIT gtru .MAXV) !Too many
; 1058 or ((RTS) and (.VISIT gtru (2*.MAXV)))) then ! visits -
; 1059 begin ! throw the
; 1060 ! packet away,
; 1061 COUNTER_INCREMENT(XPTDB,XPTaged_loss); ! bump "aged loss" and
; 1062 COUNTER_INCREMENT(LINEb,XPTxit_rcv); ! "transit packet"
; 1063 $NM_LOG_BEGIN(); ! "aged packet loss"
; 1064 CALL$E(PKTA_HDR,(PD_XPE),.CCB_P[C_ADDR]); ! event
; 1065 $NM_LOG_END(4^6+$XPT$E_AGE,-1); !
; 1066 TERMINATE(.CCB_P,CE_ERR);
; 1067 return;
; 1068 end;
; 1069
; 1070 !
; 1071 ! Spawn a CCB for the packet
; 1072 !
; 1073
; 1074 if not CCBGT$(CCB) then begin !Couldn't get
; 1075 TOSS(.CCB_P,.OLINE,.ILINE,.DEST); ! a CCB - get
; 1076 return; ! rid of packet
; 1077 end;
; 1078 CCB[C_STK] = .CCB_P; !Chain pass-through to spawned CCB
; 1079 CCB[C_PRM4] = 0;
; 1080
; 1081 !
; 1082 ! Destination is unreachable
; 1083 !
; 1084
; 1085 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 1086 if not begin
; 1087 if .DEST gtru NN then (RET = $XPT$E_RNG; FALSE)
; 1088 else if (not .Reach
; 1089 or ((.OLINE neq 0) and (.LINEstate neq RU))) then
; 1090 (RET = $XPT$E_UNR; FALSE)
; 1091 else TRUE
; 1092 end
; 1093 then begin
; 1094 UNREACH(.CCB,.CCB_P,.SOURCE,.DEST,.RFLG,.RET);
; 1095 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1096 COUNTER_INCREMENT(LINEb,XPTxit_rcv);
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 27
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 1097 return
; 1098 end;
; 1099
; 1100 !
; 1101 ! Destination is Self
; 1102 !
; 1103
; 1104 if .OLINE eql 0 then
; 1105 if .Local_node then begin
; 1106 CCB[C_BIAS] = .CCB_P[C_BIAS]; !Copy buffer
; 1107 CCB[C_ADDR] = ch$plus(.CCB_P[C_ADDR],6); ! descriptor, incrementing
; 1108 CCB[C_CNT] = .CCB_P[C_CNT] - 6; ! past the routing header
; 1109 CCB[C_LIN] = .CCB_P[C_LIN]; !Set the line number
; 1110 LINEb = $XPT_GET_LINE_DB(.ILINE); ! Increment "arriving
; 1111 COUNTER_INCREMENT(LINEb,XPTend_rcv); ! packets" ctr
; 1112 if ECLFWD(.CCB,.SOURCE,.DEST,0) !Pass the buffer to Forwarding
; 1113 neq CS_SUC !Rejected -
; 1114 then TOSS(.CCB,.OLINE,.ILINE,.DEST); ! throw it away
; 1115 end
; 1116 else BPT(XPT$_DNS,.DEST) !Destination is not Self, but output line is 0
; 1117
; 1118 !
; 1119 ! Next node in path is Phase III
; 1120 !
; 1121
; 1122 else if ((.Nty eql Full)
; 1123 or (.Nty eql Small)) then begin
; 1124 CCB[C_BIAS] = .CCB_P[C_BIAS]; !Copy the
; 1125 CCB[C_ADDR] = .CCB_P[C_ADDR]; ! buffer descriptor
; 1126 CCB[C_CNT] = .CCB_P[C_CNT]; ! from the pass-through to the spawn
; 1127 LINEb = $XPT_GET_LINE_DB(.ILINE); !Increment "transit packet
; 1128 COUNTER_INCREMENT(LINEb,XPTxit_rcv);! received" counter
; 1129 LINEb = $XPT_GET_LINE_DB(.OLINE); !Address output line data base again
; 1130 RET = FORWARDER(.CCB,.OLINE); !Try to send the buffer out
; 1131 if .RET eql CE_DIS then !Rejected for unreachability -
; 1132 UNREACH(.CCB,.CCB_P,.SOURCE, ! do unreachablility
; 1133 .DEST,.RFLG,$XPT$E_UNR) ! processing
; 1134 else if .RET neq CS_SUC then !Rejected for congestion -
; 1135 TOSS(.CCB,.OLINE,.ILINE,.DEST) ! throw buffer away
; 1136 else COUNTER_INCREMENT(LINEb,XPTxit_xmt) ! Accepted - update packet counter
; 1137 end
; 1138
; 1139 !
; 1140 ! Destination is Phase II
; 1141 !
; 1142
; 1143 else if ((.Nty eql PhTwo)
; 1144 or (.Nty eql TOPS20)) then begin
; 1145 LINEb = $XPT_GET_LINE_DB(.ILINE); !Increment "transit packet
; 1146 COUNTER_INCREMENT(LINEb,XPTxit_rcv);! received" counter
; 1147 LINEb = $XPT_GET_LINE_DB(.OLINE); !Address output line data base
; 1148 if .Nid neq .DEST then begin !Destination is not adjacent -
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 28
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
; 1149 TERMINATE(.CCB,CE_DIS); ! throw buffer away
; 1150 return;
; 1151 end;
; 1152 RET = BLDPH2(.CCB,6,.DEST, !Translate routing header
; 1153 .SOURCE,.OLINE,.ILINE); ! to Phase II
; 1154 if .RET eql CE_RTE then begin !Resource failure -
; 1155 UNSPAWN(.CCB); ! get rid
; 1156 TOSS(.CCB_P,.OLINE,.ILINE,.DEST)! of buffer
; 1157 end
; 1158 else if .RET eql CE_DIS then !Unmappability -
; 1159 UNREACH(.CCB,.CCB_P,SOURCE, ! treat like
; 1160 .DEST,.RFLG,$XPT$E_UNR) ! unreachability
; 1161 else begin !Header built -
; 1162 RET = FORWARDER(.CCB,.OLINE); ! Try to forward the packet
; 1163 if .RET eql CE_DIS then ! Unreachable
; 1164 UNREACH(.CCB,.CCB_P,SOURCE,
; 1165 .DEST,.RFLG,$XPT$E_UNR)
; 1166 else if .RET neq CS_SUC then begin ! Congestion
; 1167 UNSPAWN(.CCB);
; 1168 TOSS(.CCB_P,.OLINE,.ILINE,.DEST);
; 1169 end
; 1170 else begin
; 1171 COUNTER_INCREMENT(LINEb,XPTxit_xmt);! Update packet counter
; 1172 if .Nty eql PhTwo then
; 1173 CALL$E(INTPH2,PD_XPE,.CCB_P,1,DEST,SOURCE)
; 1174 end
; 1175 end
; 1176 end
; 1177
; 1178 !
; 1179 ! Invalid adjacent node type
; 1180 !
; 1181
; 1182 else BPT(XPT$_IANT,.Nty);
; 1183 return;
; 1184 end; !End of RCVDAT
.SBTTL RCVDAT
000000 004167 000000G RCVDAT::
U.2: JSR R1,$SAVE5 ; 0799
000004 162706 000022 SUB #22,SP
000010 016666 000040 000010 MOV 40(SP),10(SP) ; CCB.P,* 1035
000016 012700 000016 MOV #16,R0
000022 066600 000010 ADD 10(SP),R0
000026 010066 000006 MOV R0,6(SP)
000032 011067 000000G MOV (R0),KISAR6
000036 012700 000020 MOV #20,R0
000042 066600 000010 ADD 10(SP),R0
000046 010066 000004 MOV R0,4(SP)
000052 011000 MOV (R0),R0 ; *,PTR
000054 112066 000002 MOVB (R0)+,2(SP) ; PTR,RFLG 1036
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 29
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
000060 105066 000003 CLRB 3(SP) ; RFLG
000064 112066 000020 MOVB (R0)+,20(SP) ; PTR,X 1037
000070 112066 000021 MOVB (R0)+,21(SP) ; PTR,X
000074 016666 000020 000014 MOV 20(SP),14(SP) ; X,DEST
000102 112066 000020 MOVB (R0)+,20(SP) ; PTR,X 1038
000106 112066 000021 MOVB (R0)+,21(SP) ; PTR,X
000112 016666 000020 000016 MOV 20(SP),16(SP) ; X,SOURCE
000120 005001 CLR R1 ; VISIT 1039
000122 151001 BISB (R0),R1 ; PTR,VISIT
000124 005201 INC R1 ; VISIT 1040
000126 110110 MOVB R1,(R0) ; VISIT,PTR 1041
000130 016602 000014 MOV 14(SP),R2 ; DEST,* 1047
000134 010200 MOV R2,R0
000136 004767 000000G JSR PC,GTNODE
000142 010016 MOV R0,(SP) ; *,NODEB
000144 005003 CLR R3 ; OLINE 1048
000146 032710 000400 BIT #400,(R0) ; *,NODEB 1049
000152 001001 BNE 1$
000154 111003 MOVB (R0),R3 ; NODEB,OLINE
000156 016600 000010 1$: MOV 10(SP),R0 ; 1050
000162 116066 000010 000012 MOVB 10(R0),12(SP) ; *,ILINE
000170 105066 000013 CLRB 13(SP) ; ILINE
000174 016600 000012 MOV 12(SP),R0 ; ILINE,* 1051
000200 004767 000000G JSR PC,GTLINE
000204 010005 MOV R0,R5 ; *,LINEB
000206 016700 000002G MOV .CRDAT+2,R0 ; 1057
000212 020160 000050 CMP R1,50(R0) ; VISIT,*
000216 101011 BHI 2$
000220 032766 000020 000002 BIT #20,2(SP) ; *,RFLG 1058
000226 001456 BEQ 3$
000230 016000 000050 MOV 50(R0),R0
000234 006300 ASL R0
000236 020100 CMP R1,R0 ; VISIT,*
000240 101451 BLOS 3$
000242 016700 000002G 2$: MOV .CRDAT+2,R0 ; 1061
000246 062700 000130 ADD #130,R0
000252 004767 000000G JSR PC,$IC8
000256 010500 MOV R5,R0 ; LINEB,* 1062
000260 062700 000070 ADD #70,R0
000264 004767 000000G JSR PC,$IC32
000270 004767 000000G JSR PC,$NLBEG ; 1063
000274 017646 000004 MOV @4(SP),-(SP) ; 1064
000300 012746 000001 MOV #1,-(SP)
000304 012746 000000G MOV #PKTA.HDR,-(SP)
000310 016700 000002G MOV .CRDAT+2,R0
000314 005046 CLR -(SP)
000316 116016 000002 MOVB 2(R0),(SP)
000322 004767 000000G JSR PC,$CALLE
000326 012700 000400 MOV #400,R0 ; 1065
000332 012701 177777 MOV #-1,R1
000336 004767 000000G JSR PC,$NLEND
000342 016616 000020 MOV 20(SP),(SP) ; 1066
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 30
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
000346 012746 177760 MOV #-20,-(SP)
000352 004767 000000G JSR PC,TERMINATE
000356 062706 000012 ADD #12,SP ; 1057
000362 000571 BR 12$ ; 1059
000364 004767 000000G 3$: JSR PC,$CCBGT ; 1074
000370 103003 BHIS 4$
000372 016646 000010 MOV 10(SP),-(SP) ; 1075
000376 000541 BR 10$
000400 016664 000010 000004 4$: MOV 10(SP),4(R4) ; *,*(CCB) 1078
000406 005064 000032 CLR 32(R4) ; *(CCB) 1079
000412 010300 MOV R3,R0 ; OLINE,* 1085
000414 004767 000000G JSR PC,GTLINE
000420 010005 MOV R0,R5 ; *,LINEB
000422 016700 000002G MOV .CRDAT+2,R0 ; 1087
000426 020260 000016 CMP R2,16(R0)
000432 101403 BLOS 5$
000434 012701 000002 MOV #2,R1 ; *,RET
000440 000412 BR 7$
000442 005776 000000 5$: TST @0(SP) ; NODEB 1088
000446 100005 BPL 6$
000450 005703 TST R3 ; OLINE 1089
000452 001436 BEQ 9$
000454 121527 000010 CMPB (R5),#10 ; LINEB,*
000460 001431 BEQ 8$
000462 012701 000001 6$: MOV #1,R1 ; *,RET 1090
000466 010446 7$: MOV R4,-(SP) ; CCB,* 1094
000470 016646 000012 MOV 12(SP),-(SP)
000474 016646 000022 MOV 22(SP),-(SP) ; SOURCE,*
000500 010246 MOV R2,-(SP)
000502 016646 000012 MOV 12(SP),-(SP) ; RFLG,*
000506 010146 MOV R1,-(SP) ; RET,*
000510 004767 176732 JSR PC,U.22
000514 016600 000026 MOV 26(SP),R0 ; ILINE,* 1095
000520 004767 000000G JSR PC,GTLINE
000524 010005 MOV R0,R5 ; *,LINEB
000526 062700 000070 ADD #70,R0 ; 1096
000532 004767 000000G JSR PC,$IC32
000536 062706 000014 ADD #14,SP ; 1086
000542 000501 BR 12$ ; 1093
000544 005703 8$: TST R3 ; OLINE 1104
000546 001101 BNE 13$
000550 032776 000400 000000 9$: BIT #400,@0(SP) ; *,NODEB 1105
000556 001462 BEQ 11$
000560 017664 000006 000016 MOV @6(SP),16(R4) ; *,*(CCB) 1106
000566 017664 000004 000020 MOV @4(SP),20(R4) ; *,*(CCB) 1107
000574 062764 000006 000020 ADD #6,20(R4) ; *,*(CCB)
000602 016600 000010 MOV 10(SP),R0 ; 1108
000606 016064 000022 000022 MOV 22(R0),22(R4) ; *,*(CCB)
000614 162764 000006 000022 SUB #6,22(R4) ; *,*(CCB)
000622 116064 000010 000010 MOVB 10(R0),10(R4) ; *,*(CCB) 1109
000630 016600 000012 MOV 12(SP),R0 ; ILINE,* 1110
000634 004767 000000G JSR PC,GTLINE
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 31
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
000640 010005 MOV R0,R5 ; *,LINEB
000642 062700 000056 ADD #56,R0 ; 1111
000646 004767 000000G JSR PC,$IC32
000652 010446 MOV R4,-(SP) ; CCB,* 1112
000654 016646 000020 MOV 20(SP),-(SP) ; SOURCE,*
000660 010246 MOV R2,-(SP)
000662 005046 CLR -(SP)
000664 004767 000000G JSR PC,ECLFWD
000670 062706 000010 ADD #10,SP
000674 005300 DEC R0 ; 1113
000676 001423 BEQ 12$
000700 010446 MOV R4,-(SP) ; CCB,* 1114
000702 010346 10$: MOV R3,-(SP) ; OLINE,*
000704 016646 000016 MOV 16(SP),-(SP) ; ILINE,*
000710 010246 MOV R2,-(SP)
000712 004767 176356 JSR PC,U.19
000716 062706 000010 ADD #10,SP
000722 000411 BR 12$ ; 1105
000724 010246 11$: MOV R2,-(SP) ; 1116
000726 012746 100032 MOV #-77746,-(SP)
000732 012746 000002 MOV #2,-(SP)
000736 004767 000000G JSR PC,$IGNAL
000742 062706 000006 ADD #6,SP
000746 000167 000730 12$: JMP 29$ ; 1104
000752 116500 000002 13$: MOVB 2(R5),R0 ; *(LINEB),* 1122
000756 020027 000002 CMP R0,#2
000762 001403 BEQ 14$
000764 020027 000003 CMP R0,#3 ; 1123
000770 001102 BNE 17$
000772 017664 000006 000016 14$: MOV @6(SP),16(R4) ; *,*(CCB) 1124
001000 017664 000004 000020 MOV @4(SP),20(R4) ; *,*(CCB) 1125
001006 016600 000010 MOV 10(SP),R0 ; 1126
001012 016064 000022 000022 MOV 22(R0),22(R4) ; *,*(CCB)
001020 016600 000012 MOV 12(SP),R0 ; ILINE,* 1127
001024 004767 000000G JSR PC,GTLINE
001030 010005 MOV R0,R5 ; *,LINEB
001032 062700 000070 ADD #70,R0 ; 1128
001036 004767 000000G JSR PC,$IC32
001042 010300 MOV R3,R0 ; OLINE,* 1129
001044 004767 000000G JSR PC,GTLINE
001050 010005 MOV R0,R5 ; *,LINEB
001052 010446 MOV R4,-(SP) ; CCB,* 1130
001054 010346 MOV R3,-(SP) ; OLINE,*
001056 004767 000000G JSR PC,FORWARDER
001062 010001 MOV R0,R1 ; *,RET
001064 020127 177520 CMP R1,#-260 ; RET,* 1131
001070 001017 BNE 15$
001072 010416 MOV R4,(SP) ; CCB,* 1132
001074 016646 000014 MOV 14(SP),-(SP)
001100 016646 000024 MOV 24(SP),-(SP) ; SOURCE,*
001104 010246 MOV R2,-(SP)
001106 016646 000014 MOV 14(SP),-(SP) ; RFLG,*
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 32
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
001112 012746 000001 MOV #1,-(SP)
001116 004767 176324 JSR PC,U.22
001122 062706 000012 ADD #12,SP
001126 000460 BR 19$ ; 1131
001130 020127 000001 15$: CMP R1,#1 ; RET,* 1134
001134 001412 BEQ 16$
001136 010416 MOV R4,(SP) ; CCB,* 1135
001140 010346 MOV R3,-(SP) ; OLINE,*
001142 016646 000020 MOV 20(SP),-(SP) ; ILINE,*
001146 010246 MOV R2,-(SP)
001150 004767 176120 JSR PC,U.19
001154 062706 000006 ADD #6,SP
001160 000443 BR 19$ ; 1134
001162 010500 16$: MOV R5,R0 ; LINEB,* 1136
001164 062700 000074 ADD #74,R0
001170 004767 000000G JSR PC,$IC32
001174 000435 BR 19$ ; 1122
001176 020027 000004 17$: CMP R0,#4 ; 1143
001202 001405 BEQ 18$
001204 020027 000005 CMP R0,#5 ; 1144
001210 001402 BEQ 18$
001212 000167 000442 JMP 26$
001216 016600 000012 18$: MOV 12(SP),R0 ; ILINE,* 1145
001222 004767 000000G JSR PC,GTLINE
001226 010005 MOV R0,R5 ; *,LINEB
001230 062700 000070 ADD #70,R0 ; 1146
001234 004767 000000G JSR PC,$IC32
001240 010300 MOV R3,R0 ; OLINE,* 1147
001242 004767 000000G JSR PC,GTLINE
001246 010005 MOV R0,R5 ; *,LINEB
001250 026502 000004 CMP 4(R5),R2 ; *(LINEB),* 1148
001254 001407 BEQ 20$
001256 010446 MOV R4,-(SP) ; CCB,* 1149
001260 012746 177520 MOV #-260,-(SP)
001264 004767 000000G JSR PC,TERMINATE
001270 000167 000404 19$: JMP 28$ ; 1148
001274 010446 20$: MOV R4,-(SP) ; CCB,* 1152
001276 012746 000006 MOV #6,-(SP)
001302 010246 MOV R2,-(SP)
001304 016646 000024 MOV 24(SP),-(SP) ; SOURCE,*
001310 010346 MOV R3,-(SP) ; OLINE,*
001312 016646 000024 MOV 24(SP),-(SP) ; ILINE,*
001316 004767 000000V JSR PC,U.4
001322 010001 MOV R0,R1 ; *,RET
001324 020127 177730 CMP R1,#-50 ; RET,* 1154
001330 001015 BNE 21$
001332 010416 MOV R4,(SP) ; CCB,* 1155
001334 004767 000000G JSR PC,UNSPAWN
001340 016616 000024 MOV 24(SP),(SP) ; 1156
001344 010346 MOV R3,-(SP) ; OLINE,*
001346 016646 000030 MOV 30(SP),-(SP) ; ILINE,*
001352 010246 MOV R2,-(SP)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 33
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
001354 004767 175714 JSR PC,U.19
001360 022626 CMP (SP)+,(SP)+ ; 1154
001362 000533 BR 25$
001364 020127 177520 21$: CMP R1,#-260 ; RET,* 1158
001370 001020 BNE 22$
001372 010416 MOV R4,(SP) ; CCB,* 1159
001374 016646 000024 MOV 24(SP),-(SP)
001400 012746 000036 MOV #36,-(SP)
001404 060616 ADD SP,(SP) ; SOURCE,*
001406 010246 MOV R2,-(SP)
001410 016646 000024 MOV 24(SP),-(SP) ; RFLG,*
001414 012746 000001 MOV #1,-(SP)
001420 004767 176022 JSR PC,U.22
001424 062706 000010 ADD #10,SP
001430 000510 BR 25$ ; 1158
001432 010416 22$: MOV R4,(SP) ; CCB,* 1162
001434 010346 MOV R3,-(SP) ; OLINE,*
001436 004767 000000G JSR PC,FORWARDER
001442 010001 MOV R0,R1 ; *,RET
001444 020127 177520 CMP R1,#-260 ; RET,* 1163
001450 001020 BNE 23$
001452 010416 MOV R4,(SP) ; CCB,* 1164
001454 016646 000026 MOV 26(SP),-(SP)
001460 012746 000040 MOV #40,-(SP)
001464 060616 ADD SP,(SP) ; SOURCE,*
001466 010246 MOV R2,-(SP)
001470 016646 000026 MOV 26(SP),-(SP) ; RFLG,*
001474 012746 000001 MOV #1,-(SP)
001500 004767 175742 JSR PC,U.22
001504 062706 000012 ADD #12,SP
001510 000460 BR 25$ ; 1163
001512 005301 23$: DEC R1 ; RET 1166
001514 001416 BEQ 24$
001516 010416 MOV R4,(SP) ; CCB,* 1167
001520 004767 000000G JSR PC,UNSPAWN
001524 016616 000026 MOV 26(SP),(SP) ; 1168
001530 010346 MOV R3,-(SP) ; OLINE,*
001532 016646 000032 MOV 32(SP),-(SP) ; ILINE,*
001536 010246 MOV R2,-(SP)
001540 004767 175530 JSR PC,U.19
001544 062706 000006 ADD #6,SP ; 1166
001550 000440 BR 25$
001552 010500 24$: MOV R5,R0 ; LINEB,* 1171
001554 062700 000074 ADD #74,R0
001560 004767 000000G JSR PC,$IC32
001564 126527 000002 000004 CMPB 2(R5),#4 ; *(LINEB),* 1172
001572 001027 BNE 25$
001574 012716 000034 MOV #34,(SP) ; 1173
001600 060616 ADD SP,(SP) ; SOURCE,*
001602 012746 000034 MOV #34,-(SP)
001606 060616 ADD SP,(SP) ; DEST,*
001610 012746 000001 MOV #1,-(SP)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 34
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (4)
001614 016646 000032 MOV 32(SP),-(SP)
001620 012746 000004 MOV #4,-(SP)
001624 012746 000000G MOV #INTPH2,-(SP)
001630 016700 000002G MOV .CRDAT+2,R0
001634 005046 CLR -(SP)
001636 116016 000002 MOVB 2(R0),(SP)
001642 004767 000000G JSR PC,$CALLE
001646 062706 000014 ADD #14,SP
001652 062706 000010 25$: ADD #10,SP ; 1144
001656 000407 BR 27$ ; 1143
001660 010046 26$: MOV R0,-(SP) ; 1182
001662 012746 100042 MOV #-77736,-(SP)
001666 012746 000002 MOV #2,-(SP)
001672 004767 000000G JSR PC,$IGNAL
001676 005726 27$: TST (SP)+ ; 1143
001700 022626 28$: CMP (SP)+,(SP)+ ; 1122
001702 062706 000022 29$: ADD #22,SP ; 0799
001706 000207 RTS PC
; Routine Size: 484 words, Routine Base: $CODE$ + 2120
; Maximum stack depth per invocation: 29 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 35
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1185
; 1186 global
; 1187 routine RCVPH2 (CCB_P): novalue =
; 1188
; 1189 !++
; 1190 ! FUNCTIONAL DESCRIPTION:
; 1191 !
; 1192 ! This routine processes data packets received from the Data
; 1193 ! Link Layer which have Phase II routing headers. It translates
; 1194 ! the routing header to determine the output line (or local
; 1195 ! Transport user) corresponding to the specified destination,
; 1196 ! and attempts to forward the packet to that destination. If
; 1197 ! the destination is unreachable, the routine will return a DC to
; 1198 ! the caller. If the packet is for Self (a local Transport user),
; 1199 ! the spawned CCB is set up to point past the routing header,
; 1200 ! and the packet is forwarded to the ECL. If the destination node
; 1201 ! is also a Phase II node, the packet will be sent to the
; 1202 ! destination unchanged. If the immediate next node over the
; 1203 ! output line is a Phase III node, routine BLDPH3 will be called
; 1204 ! to build a new routing header and point the spawned CCB to it.
; 1205 ! If the destination node address cannot be determined, the packet
; 1206 ! will always be discarded. If, for congestion or resource reasons,
; 1207 ! the packet cannot be forwarded at the time, it will be queued for
; 1208 ! eventual reprocessing if either the source or destination is a
; 1209 ! standard Phase II node; otherwise, it will be discarded.
; 1210 !
; 1211 ! FORMAL PARAMETERS
; 1212 !
; 1213 ! CCB_P - CCB for the received packet; the "pass-through" CCB
; 1214 !
; 1215 ! IMPLICIT INPUTS
; 1216 !
; 1217 ! Reach, OL, Nty, Nid, User
; 1218 !
; 1219 ! ROUTINE VALUE:
; 1220 ! COMPLETION CODES:
; 1221 !
; 1222 ! NONE.
; 1223 !
; 1224 ! SIDE EFFECTS:
; 1225 !
; 1226 ! May temporarily modify the buffer descriptor for the pass-through CCB.
; 1227 !
; 1228 !--
; 1229
; 1230 begin
; 1231
; 1232 forward routine TOSS: novalue;
; 1233
; 1234
; 1235 !***********************************************!
; 1236 ! !
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 36
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1237 ! Routine to handle "unreachability" case !
; 1238 ! !
; 1239 !***********************************************!
; 1240
; 1241 routine UNREACH (CCB,CCB_P,ILINE,CODE): novalue =
; 1242 begin
; 1243 map CCB: ref block field (C_XPT_fields);
; 1244 local LINEb;
; 1245 require 'XPTSYM';
; 1282 map CCB_P: ref block field(C_XPT_fields);
; 1283 local LENS,LEND,LINKS,LINKD,RET;
; 1284 local WORKD: vector[3], WORKS: vector[3];
; 1285 pointer PTR;
; 1286
; 1287 !
; 1288 ! Map in the pass-through buffer; address input line data base
; 1289 !
; 1290
; 1291 MAPBUF(.CCB_P,PTR);
; 1292 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1293
; 1294 !
; 1295 ! Update node counters and signal an event
; 1296 !
; 1297
; 1298 if .CODE eql $XPT$E_UNR then ! Update
; 1299 COUNTER_INCREMENT(XPTDB,XPTunreach_loss) ! "unreachability"
; 1300 else if .CODE eql $XPT$E_RNG then ! or "node out of
; 1301 COUNTER_INCREMENT(XPTDB,XPTrange_loss) ! range" or "header
; 1302 else COUNTER_INCREMENT(XPTDB,XPTfmt_loss); ! format error" counter
; 1303 RET = getb(PTR); ! Pick up "routing flags"
; 1304 if bitoff(.RET,2) then RET = 5 ! No routing header
; 1305 else begin ! Routing header -
; 1306 RET = getb(PTR); ! pick up the first node lgth
; 1307 PTR = ch$plus(.PTR,.RET); ! jump over the node name
; 1308 RET = .RET + getb(PTR) + 2 + 1 + 5; ! add in second node lgth
; 1309 end; ! and the rthdr & NSP hdr
; 1310 RET = MINU(.RET,55); ! (but don't overflow buffer)
; 1311 MAPBUF(.CCB_P,PTR);
; 1312 $NM_LOG_BEGIN();
; P 1313 PARAMETER_HI((if .CODE eql $XPT$E_FMT then 1 else 0),
; 1314 .RET,.PTR); ! Move "packet beginning" into
; 1315 $NM_LOG_END(4^6+.CODE,.NMXid); ! Log the event
; 1316
; 1317 !
; 1318 ! If the message came from a Phase II+ node, just toss it away
; 1319 !
; 1320
; 1321 if .Nty eql TOPS20 then begin
; 1322 TOSS(.CCB,0,0,.ILINE);
; 1323 return;
; 1324 end;
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 37
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1325
; 1326 !
; 1327 ! If the incoming message had a routing header, build the DC routing header
; 1328 ! by reversing the destination and source fields in the input routing header
; 1329 !
; 1330
; 1331 RET = getb(PTR); !Pick up routing or message flags
; 1332 if bitoff(.RET,2) then !No routing header -
; 1333 LEND = 0 ! set "no header" indication
; 1334 else begin ! NOTE: source/dest names switched
; 1335 ! ***
; 1336 LENS = getb(PTR); !Pick up destination node name length
; 1337 ch$move(MINU(.LENS,6),.PTR, !Save destination
; 1338 byt$ptr(WORKS,0)); ! name field
; 1339 PTR = ch$plus(.PTR,.LENS); !Advance over name
; 1340 LEND = getb(PTR); !Pick up source node name length
; 1341 ch$move(MINU(.LEND,6),.PTR, !Save source
; 1342 byt$ptr(WORKD,0)); ! name field
; 1343 PTR = ch$plus(.PTR,.LEND); !Advance over name
; 1344 RET = getb(PTR); !Pick up MSGFLGS
; 1345 end;
; 1346
; 1347 LINKS = getw(PTR); !Get destination and source link
; 1348 LINKD = getw(PTR); ! addresses, and switch them
; 1349
; 1350 !
; 1351 ! Build a DC message with the specified disconnect code
; 1352 !
; 1353
; 1354 if .RET eql DC_MSGflgs then begin !If the message was a DC,
; 1355 TERMINATE(.CCB,CE_DIS); ! ignore it
; 1356 return;
; 1357 end;
; 1358
; 1359 if .CCB [C_XPT_ADJUST] neq 0 then begin !Un-adjust the spawned CCB
; 1360 CCB_P[C_ADDR] = ch$plus(.CCB_P[C_ADDR],-.CCB[C_XPT_ADJUST]);
; 1361 CCB_P[C_CNT] = .CCB_P[C_CNT] + .CCB[C_XPT_ADJUST];
; 1362 end;
; 1363
; 1364 CCB[C_XPT_TYPE] = 0;
; 1365 CCB[C_XPT_ADJUST] = 0;
; 1366 CCB[C_BIAS] = .CCB_P[C_BIAS]; !Copy pass-through
; 1367 CCB[C_ADDR] = .CCB_P[C_ADDR]; ! buffer descriptor into spawn
; 1368 CCB[C_CHN] = 0;
; 1369
; 1370 INPUTcount = .INPUTcount - 1; !Finish up bookkeeping
; 1371 DLLquota = .DLLquota + 1; ! for the buffer
; 1372
; P 1373 CALL$E(SEND_DC,(PD_XPE),.CCB,.LINEb,
; P 1374 .LEND,byt$ptr(WORKD,0),.LENS,byt$ptr(WORKS,0),.LINKD,.LINKS,
; 1375 (if .CODE eql $XPT$E_FMT then MISC_ERROR else NO_PATH_ERROR));
; 1376
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 38
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1377 end;
.GLOBL $DPHI, SEND.DC
.SBTTL UNREACH
000000 004167 000000G ; UNREACH
U.28: JSR R1,$SAVE5 ; 1241
000004 162706 000026 SUB #26,SP
000010 016605 000050 MOV 50(SP),R5 ; CCB.P,* 1291
000014 016567 000016 000000G MOV 16(R5),KISAR6
000022 012766 000020 000002 MOV #20,2(SP)
000030 060566 000002 ADD R5,2(SP)
000034 017602 000002 MOV @2(SP),R2 ; *,PTR
000040 016600 000046 MOV 46(SP),R0 ; ILINE,* 1292
000044 004767 000000G JSR PC,GTLINE
000050 010016 MOV R0,(SP) ; *,LINEB
000052 016700 000002G MOV .CRDAT+2,R0 ; 1299
000056 016604 000044 MOV 44(SP),R4 ; CODE,* 1298
000062 020427 000001 CMP R4,#1
000066 001007 BNE 1$
000070 012701 000136 MOV #136,R1 ; 1299
000074 060001 ADD R0,R1
000076 005211 INC (R1)
000100 001014 BNE 4$
000102 005311 DEC (R1)
000104 000412 BR 4$ ; 1298
000106 020427 000002 1$: CMP R4,#2 ; 1300
000112 001003 BNE 2$
000114 062700 000131 ADD #131,R0 ; 1301
000120 000402 BR 3$
000122 062700 000133 2$: ADD #133,R0 ; 1302
000126 004767 000000G 3$: JSR PC,$IC8
000132 005003 4$: CLR R3 ; RET 1303
000134 152203 BISB (R2)+,R3 ; PTR,RET
000136 032703 000002 BIT #2,R3 ; *,RET 1304
000142 001003 BNE 5$
000144 012703 000005 MOV #5,R3 ; *,RET
000150 000411 BR 6$
000152 005003 5$: CLR R3 ; RET 1306
000154 152203 BISB (R2)+,R3 ; PTR,RET
000156 060302 ADD R3,R2 ; RET,PTR 1307
000160 005000 CLR R0 ; 1308
000162 152200 BISB (R2)+,R0 ; PTR,*
000164 060300 ADD R3,R0 ; RET,*
000166 010003 MOV R0,R3 ; *,RET
000170 062703 000010 ADD #10,R3 ; *,RET
000174 010300 6$: MOV R3,R0 ; RET,* 1310
000176 020027 000067 CMP R0,#67
000202 101402 BLOS 7$
000204 012700 000067 MOV #67,R0
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 39
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000210 010003 7$: MOV R0,R3 ; *,RET
000212 016567 000016 000000G MOV 16(R5),KISAR6 ; 1311
000220 017602 000002 MOV @2(SP),R2 ; *,PTR
000224 004767 000000G JSR PC,$NLBEG ; 1312
000230 005066 000004 CLR 4(SP) ; 1314
000234 020427 000004 CMP R4,#4
000240 001005 BNE 8$
000242 005266 000004 INC 4(SP)
000246 012746 000001 MOV #1,-(SP)
000252 000401 BR 9$
000254 005046 8$: CLR -(SP)
000256 010300 9$: MOV R3,R0 ; RET,*
000260 010201 MOV R2,R1 ; PTR,*
000262 004767 000000G JSR PC,$DPHI
000266 062704 000400 ADD #400,R4 ; 1315
000272 010400 MOV R4,R0
000274 016646 000002 MOV 2(SP),-(SP) ; LINEB,*
000300 062716 000034 ADD #34,(SP)
000304 013601 MOV @(SP)+,R1
000306 004767 000000G JSR PC,$NLEND
000312 016600 000002 MOV 2(SP),R0 ; LINEB,* 1321
000316 126027 000002 000005 CMPB 2(R0),#5 ; *(LINEB),*
000324 001013 BNE 10$
000326 016616 000054 MOV 54(SP),(SP) ; CCB,* 1322
000332 005046 CLR -(SP)
000334 005046 CLR -(SP)
000336 016646 000054 MOV 54(SP),-(SP) ; ILINE,*
000342 004767 000000V JSR PC,U.27
000346 062706 000010 ADD #10,SP ; 1321
000352 000500 BR 15$
000354 005003 10$: CLR R3 ; RET 1331
000356 152203 BISB (R2)+,R3 ; PTR,RET
000360 032703 000002 BIT #2,R3 ; *,RET 1332
000364 001002 BNE 11$
000366 005004 CLR R4 ; LEND 1333
000370 000442 BR 14$ ; 1332
000372 005001 11$: CLR R1 ; LENS 1336
000374 152201 BISB (R2)+,R1 ; PTR,LENS
000376 010116 MOV R1,(SP) ; LENS,* 1337
000400 020127 000006 CMP R1,#6
000404 101402 BLOS 12$
000406 012716 000006 MOV #6,(SP)
000412 010246 12$: MOV R2,-(SP) ; PTR,* 1338
000414 012746 000020 MOV #20,-(SP)
000420 060616 ADD SP,(SP) ; WORKS,*
000422 004767 000000G JSR PC,BL$MOV
000426 060102 ADD R1,R2 ; LENS,PTR 1339
000430 005004 CLR R4 ; LEND 1340
000432 152204 BISB (R2)+,R4 ; PTR,LEND
000434 010416 MOV R4,(SP) ; LEND,* 1341
000436 020427 000006 CMP R4,#6
000442 101402 BLOS 13$
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 40
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000444 012716 000006 MOV #6,(SP)
000450 010246 13$: MOV R2,-(SP) ; PTR,* 1342
000452 012746 000032 MOV #32,-(SP)
000456 060616 ADD SP,(SP) ; WORKD,*
000460 004767 000000G JSR PC,BL$MOV
000464 060402 ADD R4,R2 ; LEND,PTR 1343
000466 005003 CLR R3 ; RET 1344
000470 152203 BISB (R2)+,R3 ; PTR,RET
000472 062706 000010 ADD #10,SP ; 1334
000476 112266 000012 14$: MOVB (R2)+,12(SP) ; PTR,X 1347
000502 112266 000013 MOVB (R2)+,13(SP) ; PTR,X
000506 016666 000012 000010 MOV 12(SP),10(SP) ; X,LINKS
000514 112266 000012 MOVB (R2)+,12(SP) ; PTR,X 1348
000520 112266 000013 MOVB (R2)+,13(SP) ; PTR,X
000524 016602 000012 MOV 12(SP),R2 ; X,LINKD
000530 020327 000110 CMP R3,#110 ; RET,* 1354
000534 001010 BNE 16$
000536 016616 000054 MOV 54(SP),(SP) ; CCB,* 1355
000542 012746 177520 MOV #-260,-(SP)
000546 004767 000000G JSR PC,TERMINATE
000552 022626 CMP (SP)+,(SP)+ ; 1354
000554 000522 15$: BR 20$
000556 016603 000054 16$: MOV 54(SP),R3 ; CCB,* 1359
000562 012700 000032 MOV #32,R0
000566 060300 ADD R3,R0
000570 105760 000001 TSTB 1(R0)
000574 001423 BEQ 17$
000576 116046 000001 MOVB 1(R0),-(SP) ; 1360
000602 105716 TSTB (SP)
000604 006746 SXT -(SP)
000606 116616 000002 MOVB 2(SP),(SP)
000612 162676 000006 SUB (SP)+,@6(SP)
000616 116016 000001 MOVB 1(R0),(SP) ; 1361
000622 105716 TSTB (SP)
000624 006746 SXT -(SP)
000626 116616 000002 MOVB 2(SP),(SP)
000632 066516 000022 ADD 22(R5),(SP)
000636 012665 000022 MOV (SP)+,22(R5)
000642 005726 TST (SP)+
000644 105010 17$: CLRB (R0) ; 1364
000646 105060 000001 CLRB 1(R0) ; 1365
000652 016563 000016 000016 MOV 16(R5),16(R3) ; 1366
000660 017663 000004 000020 MOV @4(SP),20(R3) ; 1367
000666 005063 000002 CLR 2(R3) ; 1368
000672 016605 000002 MOV 2(SP),R5 ; LINEB,* 1370
000676 105365 000043 DECB 43(R5) ; *(LINEB)
000702 016705 000002G MOV .CRDAT+2,R5
000706 105265 000035 INCB 35(R5) ; 1371
000712 032766 000001 000006 BIT #1,6(SP) ; 1375
000720 001403 BEQ 18$
000722 012716 000007 MOV #7,(SP)
000726 000402 BR 19$
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 41
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000730 012716 000047 18$: MOV #47,(SP)
000734 016646 000010 19$: MOV 10(SP),-(SP) ; LINKS,*
000740 010246 MOV R2,-(SP) ; LINKD,*
000742 012746 000022 MOV #22,-(SP)
000746 060616 ADD SP,(SP) ; WORKS,*
000750 010146 MOV R1,-(SP) ; LENS,*
000752 012746 000034 MOV #34,-(SP)
000756 060616 ADD SP,(SP) ; WORKD,*
000760 010446 MOV R4,-(SP) ; LEND,*
000762 016646 000016 MOV 16(SP),-(SP) ; LINEB,*
000766 010346 MOV R3,-(SP)
000770 012746 000011 MOV #11,-(SP)
000774 012746 000000G MOV #SEND.DC,-(SP)
001000 016700 000002G MOV .CRDAT+2,R0
001004 005046 CLR -(SP)
001006 116016 000002 MOVB 2(R0),(SP)
001012 004767 000000G JSR PC,$CALLE
001016 062706 000030 ADD #30,SP ; 1242
001022 062706 000026 20$: ADD #26,SP ; 1241
001026 000207 RTS PC
; Routine Size: 268 words, Routine Base: $CODE$ + 4030
; Maximum stack depth per invocation: 30 words
; 1378
; 1379
; 1380
; 1381 !*******************************************************!
; 1382 ! !
; 1383 ! Routine to either throw away a packet or queue it !
; 1384 ! for eventual reprocessing !
; 1385 ! !
; 1386 !*******************************************************!
; 1387
; 1388 routine TOSS (CCB,OLINE,DEST,ILINE): novalue =
; 1389 begin
; 1390 map CCB: ref block field (C_XPT_fields);
; 1391
; 1392 local LINEb;
; 1393 require 'XPTSYM';
; 1430 local CCB_P;
; 1431
; 1432 CCB_P = .CCB[C_STK];
; 1433
; 1434 if
; 1435 (begin
; 1436 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 1437 (.OLINE neq 0)
; 1438 and (.Nty eql PhTwo)
; 1439 and (.Nid eql .DEST)
; 1440 end
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 42
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1441 or
; 1442 begin
; 1443 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1444 (.ILINE neq 0)
; 1445 and (.Nty eql PhTwo)
; 1446 end)
; 1447 then RE_QUEUE (if .CCB[C_OWN] eql PD_XPT then
; 1448 (UNSPAWN(.CCB); .CCB_P)
; 1449 else .CCB)
; 1450 else begin
; 1451 if .OLINE neq 0 then begin
; 1452 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 1453 COUNTER_INCREMENT(LINEb,XPTxit_cng);
; 1454 end
; 1455 else begin
; 1456 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1457 COUNTER_INCREMENT(LINEb,XPTend_cng);
; 1458 end;
; 1459 TERMINATE(.CCB,CE_RTE);
; 1460 end;
; 1461 end;
.SBTTL TOSS
000000 004167 000000G ; TOSS
U.27: JSR R1,$SAVE5 ; 1388
000004 016602 000024 MOV 24(SP),R2 ; CCB,* 1432
000010 016205 000004 MOV 4(R2),R5 ; *,CCB.P
000014 016604 000022 MOV 22(SP),R4 ; OLINE,* 1436
000020 010400 MOV R4,R0
000022 004767 000000G JSR PC,GTLINE
000026 010001 MOV R0,R1 ; *,LINEB
000030 005003 CLR R3 ; 1437
000032 005704 TST R4
000034 001411 BEQ 1$
000036 005203 INC R3
000040 126127 000002 000004 CMPB 2(R1),#4 ; *(LINEB),* 1438
000046 001004 BNE 1$
000050 026166 000004 000020 CMP 4(R1),20(SP) ; *(LINEB),DEST 1439
000056 001414 BEQ 2$
000060 016600 000016 1$: MOV 16(SP),R0 ; ILINE,* 1443
000064 004767 000000G JSR PC,GTLINE
000070 010001 MOV R0,R1 ; *,LINEB
000072 005766 000016 TST 16(SP) ; ILINE 1444
000076 001423 BEQ 5$
000100 126127 000002 000004 CMPB 2(R1),#4 ; *(LINEB),* 1445
000106 001017 BNE 5$
000110 016700 000002G 2$: MOV .CRDAT+2,R0 ; 1447
000114 126260 000006 000004 CMPB 6(R2),4(R0)
000122 001005 BNE 3$
000124 010246 MOV R2,-(SP) ; 1448
000126 004767 000000G JSR PC,UNSPAWN
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 43
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000132 010516 MOV R5,(SP) ; CCB.P,* 1447
000134 000401 BR 4$
000136 010246 3$: MOV R2,-(SP)
000140 004767 000000G 4$: JSR PC,RE.QUEUE
000144 000435 BR 9$ ; 1434
000146 006003 5$: ROR R3 ; 1451
000150 103012 BCC 6$
000152 010400 MOV R4,R0 ; 1452
000154 004767 000000G JSR PC,GTLINE
000160 010001 MOV R0,R1 ; *,LINEB
000162 012700 000100 MOV #100,R0 ; 1453
000166 060100 ADD R1,R0 ; LINEB,*
000170 005210 INC (R0)
000172 001014 BNE 8$
000174 000412 BR 7$
000176 016600 000016 6$: MOV 16(SP),R0 ; ILINE,* 1456
000202 004767 000000G JSR PC,GTLINE
000206 010001 MOV R0,R1 ; *,LINEB
000210 012700 000066 MOV #66,R0 ; 1457
000214 060100 ADD R1,R0 ; LINEB,*
000216 005210 INC (R0)
000220 001001 BNE 8$
000222 005310 7$: DEC (R0)
000224 010246 8$: MOV R2,-(SP) ; 1459
000226 012746 177730 MOV #-50,-(SP)
000232 004767 000000G JSR PC,TERMINATE
000236 005726 TST (SP)+ ; 1450
000240 005726 9$: TST (SP)+ ; 1389
000242 000207 RTS PC ; 1388
; Routine Size: 82 words, Routine Base: $CODE$ + 5060
; Maximum stack depth per invocation: 9 words
; 1462
; 1463 !*********************** START OF MAIN ROUTINE ************************!
; 1464
; 1465
; 1466 local NODEb,LINEb;
; 1467 require 'XPTSYM';
; 1504 local CCB: ref block field (C_XPT_fields);
; 1505 map CCB_P: ref block field(C_FIELDS);
; 1506 pointer PTR;
; 1507 local BUFLEN,DEST,SOURCE,OLINE,ILINE,RET,ISHDR,ICPTD;
; 1508 literal NO_PATH_ERROR = 39; !"No path" disconnect code
; 1509 literal BAD_ROUT_HDR = 7; !Disconnect code for invalid/no RTHDR
; 1510
; 1511 !
; 1512 ! Determine and validate the input line
; 1513 !
; 1514
; 1515 ILINE = .CCB_P[C_LIN];
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 44
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1516 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1517 if ((.Nty neq TOPS20) !Input line is
; 1518 and (.Nty neq PhTwo)) then begin ! not Phase II:
; 1519 local RET; !
; 1520 RET = MIN(19,.CCB_P[C_CNT]); !
; 1521 $NM_LOG_BEGIN(); !
; 1522 PARAMETER_HI(1,.RET,.CCB_P[C_ADDR]); ! log a "packet
; 1523 $NM_LOG_END(4^6+$XPT$E_FMT,.NMXid); ! format error" event
; 1524 TERMINATE(.CCB_P,CE_ERR); ! and toss
; 1525 return; ! the packet
; 1526 end;
; 1527
; 1528 ICPTD = 0;
; 1529 if .Nty eql PhTwo then ICPTD = .ICPTD + 1; ! Not Phase II+ - flag that
; 1530
; 1531 !
; 1532 ! Spawn a CCB
; 1533 !
; 1534
; 1535 if not CCBGT$(CCB) then !No CCB available - get rid of packet
; 1536 (TOSS(.CCB_P,0,0,.ILINE); return);
; 1537 CCB[C_STK] = .CCB_P; !Chain pass-through to spawned CCB
; 1538 CCB[C_XPT_TYPE] = 0; !Initialize type code
; 1539 CCB[C_XPT_ADJUST] = 0; ! and adjustment factor
; 1540
; 1541 !
; 1542 ! Parse the routing header
; 1543 !
; 1544
; 1545 MAPBUF(.CCB_P,PTR); ! Map in the packet buffer
; 1546 if biton (getb(PTR),2) then begin ! Routing header is present -
; 1547 RET = PH2HDR (ch$plus(.PTR,-1),.ILINE, ! map to source and
; 1548 SOURCE,DEST); ! destination addresses
; 1549 ISHDR = TRUE; ! and indicate header is present
; 1550 end
; 1551 else begin !No routing header -
; P 1552 RET = CALL$E(INTPH2,PD_XPE, ! "intercept"
; 1553 .CCB_P,0,DEST,SOURCE); ! the packet
; 1554 ISHDR = FALSE; ! and indicate no header
; 1555 ICPTD = 0; ! and that packet's already interceptd
; 1556 end;
; 1557 if .RET leq 0 then !Could not get destination -
; 1558 (UNREACH(.CCB,.CCB_P,.ILINE,-.RET); return); !throw away packet
; 1559
; 1560 NODEb = $XPT_GET_NODE_DB(.DEST); ! Address destination data base entry
; 1561
; 1562 !
; 1563 ! Determine the output line
; 1564 !
; 1565
; 1566 OLINE = 0;
; 1567 if not .Local_node then OLINE = .OL;
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 45
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1568 LINEb = $XPT_GET_LINE_DB(.OLINE);
; 1569
; 1570 !
; 1571 ! Destination is unreachable
; 1572 !
; 1573
; 1574 if (not .Reach
; 1575 or ((.OLINE neq 0) and (.LINEstate neq RU))) then begin
; 1576 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 1577 COUNTER_INCREMENT(LINEb,XPTxit_rcv);
; 1578 UNREACH(.CCB,.CCB_P,.ILINE,$XPT$E_UNR);
; 1579 return;
; 1580 end;
; 1581
; 1582 !
; 1583 ! Destination is Self
; 1584 !
; 1585
; 1586 if .OLINE eql 0 then
; 1587 if .Local_node then begin
; 1588 CCB[C_BIAS] = .CCB_P[C_BIAS]; !Copy buffer
; 1589 CCB[C_ADDR] = .CCB_P[C_ADDR]; ! descriptor into
; 1590 CCB[C_CNT] = .CCB_P[C_CNT]; ! spawned CCB
; 1591 CCB[C_LIN] = .CCB_P[C_LIN]; !Put in line number
; 1592 if .ISHDR then begin !If packet has a header,
; 1593 RET = getb(PTR); ! pick up the destination name length
; 1594 BUFLEN = 1 + 1 + .RET; ! add it into header length
; 1595 PTR = ch$plus(.PTR,.RET); ! bump pointer past node name field
; 1596 BUFLEN = .BUFLEN + 1+getb(PTR); ! add source name length
; 1597 CCB[C_ADDR] = ch$plus(.CCB[C_ADDR],.BUFLEN);
; 1598 CCB[C_CNT] = .CCB[C_CNT] - .BUFLEN;
; 1599 end;
; 1600 LINEb = $XPT_GET_LINE_DB(.ILINE); !Map to input line data base
; 1601 COUNTER_INCREMENT(LINEb,XPTend_rcv);! Increment packets counter
; 1602 if ECLFWD(.CCB, !Try to pass the buffer
; 1603 .SOURCE,.DEST,0) ! to the user process
; 1604 neq CS_SUC then !If Forwarding rejected the packet,
; 1605 TOSS(.CCB,0,0,.ILINE) ! get rid of it
; 1606 else if .ICPTD then !Otherwise, if there was
; P 1607 CALL$E(INTPH2,PD_XPE,.CCB_P, ! a header, intercept
; 1608 1,DEST,SOURCE) ! the packet
; 1609 end
; 1610
; 1611 else BPT(XPT$_DNS,.DEST) !Invalid "self" destination
; 1612
; 1613 !
; 1614 ! Next node in path is Phase III
; 1615 !
; 1616
; 1617 else if ((.Nty eql Full)
; 1618 or (.Nty eql Small)) then begin
; 1619 LINEb = $XPT_GET_LINE_DB(.ILINE); !Address input line DB entry
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 46
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1620 RET = BLDPH3(.CCB,.ISHDR,.DEST,.SOURCE,0); !Build a Phase III header
; 1621 COUNTER_INCREMENT(LINEb,XPTxit_rcv); ! Increment packets counter
; 1622 LINEb = $XPT_GET_LINE_DB(.OLINE); !Address output line DB entry
; 1623 RET = FORWARDER(.CCB,.OLINE); !Try to forward packet
; 1624 if .RET eql CE_DIS then !If destination is unreachable,
; 1625 UNREACH(.CCB,.CCB_P,.ILINE, ! perform unreachablilty code
; 1626 $XPT$E_UNR) !
; 1627 else if .RET neq CS_SUC then !Congestion problem -
; 1628 TOSS(.CCB,.OLINE,.DEST,.ILINE) ! get rid of packet
; 1629 else begin
; 1630 COUNTER_INCREMENT(LINEb,XPTxit_xmt); ! Success - increment pkts ctr
; 1631 if .ICPTD then ! Packet had Ph. 2 hdr:
; P 1632 CALL$E(INTPH2,PD_XPE,.CCB_P,1, ! intercept
; 1633 DEST,SOURCE) ! packet
; 1634 end
; 1635 end
; 1636
; 1637 !
; 1638 ! Next node in path is Phase II
; 1639 !
; 1640
; 1641 else if ((.Nty eql PhTwo)
; 1642 or (.Nty eql TOPS20)) then begin
; 1643 COUNTER_INCREMENT(LINEb,XPTxit_rcv); ! Increment packet counter
; 1644 if .RET eql 2 then begin !Header is not useable:
; 1645 RET = getb(PTR); ! Calculate
; 1646 BUFLEN = 1 + 1 + .RET; ! the length
; 1647 PTR = ch$plus(.PTR,.RET); ! of the
; 1648 BUFLEN = .BUFLEN + 1 + getb(PTR); ! old header
; 1649 RET = BLDPH2(.CCB,.BUFLEN,.DEST,.SOURCE,! Build a
; 1650 .OLINE,.ILINE); ! new one
; 1651 if .RET eql CE_RTE then begin ! Resource failure -
; 1652 TOSS(.CCB,.OLINE,.DEST,.ILINE); ! reschedule
; 1653 return; ! the CCB
; 1654 end
; 1655 else if .RET neq CS_SUC then begin ! Other failure -
; 1656 UNREACH(.CCB,.CCB_P,.ILINE, ! terminate
; 1657 $XPT$E_UNR); ! the packet
; 1658 return; ! as unreachable
; 1659 end
; 1660 end
; 1661 else begin !Header is useable:
; 1662 CCB[C_BIAS] = .CCB_P[C_BIAS]; ! Copy buffer
; 1663 CCB[C_ADDR] = .CCB_P[C_ADDR]; ! descriptor into
; 1664 CCB[C_CNT] = .CCB_P[C_CNT]; ! spawned CCB
; 1665 end;
; 1666 LINEb = $XPT_GET_LINE_DB(.OLINE); !Address output line DB entry
; 1667 if .Nid neq .DEST then !Destination not adjacent -
; 1668 TOSS(.CCB,.OLINE,.DEST,.ILINE) ! get rid of message
; 1669 else begin
; 1670 RET = FORWARDER(.CCB,.OLINE); !Try to send packet out
; 1671 if .RET eql CE_DIS then !Unreachable destination -
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 47
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
; 1672 UNREACH(.CCB,.CCB_P,.ILINE, ! perform unreachability code
; 1673 $XPT$E_UNR) !
; 1674 else if .RET neq CS_SUC then !Congestion problem -
; 1675 TOSS(.CCB,.OLINE,.DEST,.ILINE) ! get rid of packet
; 1676 else begin !Success -
; 1677 COUNTER_INCREMENT(LINEb,XPTxit_xmt);! Increment packets counter
; 1678 if (.ICPTD or (.Nty eql PhTwo)) ! Packet had Ph. 2 hdr:
; P 1679 then CALL$E(INTPH2,PD_XPE, ! intercept
; 1680 .CCB_P,1,DEST,SOURCE) ! packet
; 1681 end
; 1682 end
; 1683 end
; 1684
; 1685 !
; 1686 ! Invalid destination node type
; 1687 !
; 1688
; 1689 else BPT(XPT$_IANT,.Nty);
; 1690 return;
; 1691 end; !End of RCVPH2
.SBTTL RCVPH2
000000 004167 000000G RCVPH2::
U.3: JSR R1,$SAVE5 ; 1187
000004 162706 000024 SUB #24,SP
000010 016666 000042 000002 MOV 42(SP),2(SP) ; CCB.P,* 1515
000016 016600 000002 MOV 2(SP),R0
000022 116066 000010 000010 MOVB 10(R0),10(SP) ; *,ILINE
000030 105066 000011 CLRB 11(SP) ; ILINE
000034 016600 000010 MOV 10(SP),R0 ; ILINE,* 1516
000040 004767 000000G JSR PC,GTLINE
000044 010066 000006 MOV R0,6(SP) ; *,LINEB
000050 116002 000002 MOVB 2(R0),R2 ; *(LINEB),* 1517
000054 020227 000005 CMP R2,#5
000060 001451 BEQ 2$
000062 020227 000004 CMP R2,#4 ; 1518
000066 001446 BEQ 2$
000070 016601 000002 MOV 2(SP),R1 ; 1520
000074 016100 000022 MOV 22(R1),R0
000100 020027 000023 CMP R0,#23
000104 003402 BLE 1$
000106 012700 000023 MOV #23,R0
000112 010003 1$: MOV R0,R3 ; *,RET
000114 004767 000000G JSR PC,$NLBEG ; 1521
000120 012746 000001 MOV #1,-(SP) ; 1522
000124 010300 MOV R3,R0 ; RET,*
000126 016604 000004 MOV 4(SP),R4
000132 016401 000020 MOV 20(R4),R1
000136 004767 000000G JSR PC,$DPHI
000142 012700 000404 MOV #404,R0 ; 1523
000146 016603 000010 MOV 10(SP),R3 ; LINEB,*
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 48
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000152 016301 000034 MOV 34(R3),R1 ; *(LINEB),*
000156 004767 000000G JSR PC,$NLEND
000162 016616 000004 MOV 4(SP),(SP) ; 1524
000166 012746 177760 MOV #-20,-(SP)
000172 004767 000000G JSR PC,TERMINATE
000176 022626 CMP (SP)+,(SP)+ ; 1517
000200 000167 002146 JMP 40$ ; 1518
000204 005005 2$: CLR R5 ; ICPTD 1528
000206 020227 000004 CMP R2,#4 ; 1529
000212 001001 BNE 3$
000214 005205 INC R5 ; ICPTD
000216 004767 000000G 3$: JSR PC,$CCBGT ; 1535
000222 103403 BCS 4$
000224 010466 000004 MOV R4,4(SP) ; $MCB$R4,CCB
000230 000412 BR 5$
000232 016646 000002 4$: MOV 2(SP),-(SP) ; 1536
000236 005046 CLR -(SP)
000240 005046 CLR -(SP)
000242 016646 000016 MOV 16(SP),-(SP) ; ILINE,*
000246 004767 177262 JSR PC,U.27
000252 000167 002070 JMP 39$ ; 1535
000256 016600 000004 5$: MOV 4(SP),R0 ; CCB,* 1537
000262 016660 000002 000004 MOV 2(SP),4(R0) ; *,*(CCB)
000270 105060 000032 CLRB 32(R0) ; *(CCB) 1538
000274 105060 000033 CLRB 33(R0) ; *(CCB) 1539
000300 012700 000016 MOV #16,R0 ; 1545
000304 066600 000002 ADD 2(SP),R0
000310 010066 000016 MOV R0,16(SP)
000314 011067 000000G MOV (R0),KISAR6
000320 012700 000020 MOV #20,R0
000324 066600 000002 ADD 2(SP),R0
000330 010066 000014 MOV R0,14(SP)
000334 011001 MOV (R0),R1 ; *,PTR
000336 132721 000002 BITB #2,(R1)+ ; *,PTR 1546
000342 001421 BEQ 6$
000344 010146 MOV R1,-(SP) ; PTR,* 1547
000346 005316 DEC (SP)
000350 016646 000012 MOV 12(SP),-(SP) ; ILINE,*
000354 012746 000030 MOV #30,-(SP)
000360 060616 ADD SP,(SP) ; SOURCE,*
000362 012746 000030 MOV #30,-(SP)
000366 060616 ADD SP,(SP) ; DEST,*
000370 004767 000000V JSR PC,U.6
000374 010003 MOV R0,R3 ; *,RET
000376 012766 000001 000010 MOV #1,10(SP) ; *,ISHDR 1549
000404 000432 BR 7$ ; 1546
000406 012746 000024 6$: MOV #24,-(SP) ; 1553
000412 060616 ADD SP,(SP) ; SOURCE,*
000414 012746 000024 MOV #24,-(SP)
000420 060616 ADD SP,(SP) ; DEST,*
000422 005046 CLR -(SP)
000424 016646 000010 MOV 10(SP),-(SP)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 49
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000430 012746 000004 MOV #4,-(SP)
000434 012746 000000G MOV #INTPH2,-(SP)
000440 016700 000002G MOV .CRDAT+2,R0
000444 005046 CLR -(SP)
000446 116016 000002 MOVB 2(R0),(SP)
000452 004767 000000G JSR PC,$CALLE
000456 010003 MOV R0,R3 ; *,RET 1552
000460 005066 000016 CLR 16(SP) ; ISHDR 1554
000464 005005 CLR R5 ; ICPTD 1555
000466 062706 000006 ADD #6,SP ; 1551
000472 005703 7$: TST R3 ; RET 1557
000474 003011 BGT 8$
000476 016616 000014 MOV 14(SP),(SP) ; CCB,* 1558
000502 016646 000012 MOV 12(SP),-(SP)
000506 016646 000022 MOV 22(SP),-(SP) ; ILINE,*
000512 010346 MOV R3,-(SP) ; RET,*
000514 005416 NEG (SP)
000516 000453 BR 11$
000520 016666 000030 000022 8$: MOV 30(SP),22(SP) ; DEST,* 1560
000526 016600 000022 MOV 22(SP),R0
000532 004767 000000G JSR PC,GTNODE
000536 010002 MOV R0,R2 ; *,NODEB
000540 005004 CLR R4 ; OLINE 1566
000542 032712 000400 BIT #400,(R2) ; *,NODEB 1567
000546 001001 BNE 9$
000550 111204 MOVB (R2),R4 ; NODEB,OLINE
000552 010400 9$: MOV R4,R0 ; OLINE,* 1568
000554 004767 000000G JSR PC,GTLINE
000560 010066 000016 MOV R0,16(SP) ; *,LINEB
000564 005712 TST (R2) ; NODEB 1574
000566 100005 BPL 10$
000570 005704 TST R4 ; OLINE 1575
000572 001435 BEQ 13$
000574 121027 000010 CMPB (R0),#10 ; LINEB,*
000600 001430 BEQ 12$
000602 016600 000020 10$: MOV 20(SP),R0 ; ILINE,* 1576
000606 004767 000000G JSR PC,GTLINE
000612 010066 000016 MOV R0,16(SP) ; *,LINEB
000616 062700 000070 ADD #70,R0 ; 1577
000622 004767 000000G JSR PC,$IC32
000626 016616 000014 MOV 14(SP),(SP) ; CCB,* 1578
000632 016646 000012 MOV 12(SP),-(SP)
000636 016646 000022 MOV 22(SP),-(SP) ; ILINE,*
000642 012746 000001 MOV #1,-(SP)
000646 004767 175632 11$: JSR PC,U.28
000652 062706 000016 ADD #16,SP ; 1574
000656 000167 001470 JMP 40$ ; 1575
000662 005704 12$: TST R4 ; OLINE 1586
000664 001160 BNE 18$
000666 032712 000400 13$: BIT #400,(R2) ; *,NODEB 1587
000672 001542 BEQ 16$
000674 016600 000014 MOV 14(SP),R0 ; CCB,* 1588
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 50
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
000700 017660 000026 000016 MOV @26(SP),16(R0) ; *,*(CCB)
000706 017660 000024 000020 MOV @24(SP),20(R0) ; *,*(CCB) 1589
000714 016602 000012 MOV 12(SP),R2 ; 1590
000720 016260 000022 000022 MOV 22(R2),22(R0) ; *,*(CCB)
000726 116260 000010 000010 MOVB 10(R2),10(R0) ; *,*(CCB) 1591
000734 032766 000001 000010 BIT #1,10(SP) ; *,ISHDR 1592
000742 001421 BEQ 14$
000744 005003 CLR R3 ; RET 1593
000746 152103 BISB (R1)+,R3 ; PTR,RET
000750 010302 MOV R3,R2 ; RET,BUFLEN 1594
000752 062702 000002 ADD #2,R2 ; *,BUFLEN
000756 060301 ADD R3,R1 ; RET,PTR 1595
000760 005000 CLR R0 ; 1592
000762 152100 BISB (R1)+,R0 ; PTR,*
000764 060200 ADD R2,R0 ; BUFLEN,*
000766 010002 MOV R0,R2 ; *,BUFLEN 1596
000770 005202 INC R2 ; BUFLEN
000772 016600 000014 MOV 14(SP),R0 ; CCB,* 1597
000776 060260 000020 ADD R2,20(R0) ; BUFLEN,*(CCB)
001002 160260 000022 SUB R2,22(R0) ; BUFLEN,*(CCB) 1598
001006 016600 000020 14$: MOV 20(SP),R0 ; ILINE,* 1600
001012 004767 000000G JSR PC,GTLINE
001016 010066 000016 MOV R0,16(SP) ; *,LINEB
001022 062700 000056 ADD #56,R0 ; 1601
001026 004767 000000G JSR PC,$IC32
001032 016616 000014 MOV 14(SP),(SP) ; CCB,* 1602
001036 016646 000032 MOV 32(SP),-(SP) ; SOURCE,*
001042 016646 000024 MOV 24(SP),-(SP)
001046 005046 CLR -(SP)
001050 004767 000000G JSR PC,ECLFWD
001054 062706 000006 ADD #6,SP
001060 005300 DEC R0 ; 1604
001062 001413 BEQ 15$
001064 016616 000014 MOV 14(SP),(SP) ; CCB,* 1605
001070 005046 CLR -(SP)
001072 005046 CLR -(SP)
001074 016646 000024 MOV 24(SP),-(SP) ; ILINE,*
001100 004767 176430 JSR PC,U.27
001104 062706 000006 ADD #6,SP
001110 000444 BR 17$ ; 1602
001112 032705 000001 15$: BIT #1,R5 ; *,ICPTD 1606
001116 001441 BEQ 17$
001120 012716 000032 MOV #32,(SP) ; 1608
001124 060616 ADD SP,(SP) ; SOURCE,*
001126 012746 000032 MOV #32,-(SP)
001132 060616 ADD SP,(SP) ; DEST,*
001134 012746 000001 MOV #1,-(SP)
001140 016646 000016 MOV 16(SP),-(SP)
001144 012746 000004 MOV #4,-(SP)
001150 012746 000000G MOV #INTPH2,-(SP)
001154 016700 000002G MOV .CRDAT+2,R0
001160 005046 CLR -(SP)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 51
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
001162 116016 000002 MOVB 2(R0),(SP)
001166 004767 000000G JSR PC,$CALLE
001172 062706 000014 ADD #14,SP
001176 000411 BR 17$ ; 1587
001200 016616 000022 16$: MOV 22(SP),(SP) ; 1611
001204 012746 100032 MOV #-77746,-(SP)
001210 012746 000002 MOV #2,-(SP)
001214 004767 000000G JSR PC,$IGNAL
001220 022626 CMP (SP)+,(SP)+
001222 000167 001120 17$: JMP 39$ ; 1586
001226 016600 000016 18$: MOV 16(SP),R0 ; LINEB,* 1617
001232 116002 000002 MOVB 2(R0),R2 ; *(LINEB),*
001236 020227 000002 CMP R2,#2
001242 001403 BEQ 19$
001244 020227 000003 CMP R2,#3 ; 1618
001250 001143 BNE 24$
001252 016600 000020 19$: MOV 20(SP),R0 ; ILINE,* 1619
001256 004767 000000G JSR PC,GTLINE
001262 010066 000016 MOV R0,16(SP) ; *,LINEB
001266 016616 000014 MOV 14(SP),(SP) ; CCB,* 1620
001272 016646 000010 MOV 10(SP),-(SP) ; ISHDR,*
001276 016646 000024 MOV 24(SP),-(SP)
001302 016646 000036 MOV 36(SP),-(SP) ; SOURCE,*
001306 005046 CLR -(SP)
001310 004767 000000V JSR PC,U.5
001314 010003 MOV R0,R3 ; *,RET
001316 016600 000026 MOV 26(SP),R0 ; LINEB,* 1621
001322 062700 000070 ADD #70,R0
001326 004767 000000G JSR PC,$IC32
001332 010400 MOV R4,R0 ; OLINE,* 1622
001334 004767 000000G JSR PC,GTLINE
001340 010066 000026 MOV R0,26(SP) ; *,LINEB
001344 016616 000024 MOV 24(SP),(SP) ; CCB,* 1623
001350 010446 MOV R4,-(SP) ; OLINE,*
001352 004767 000000G JSR PC,FORWARDER
001356 010003 MOV R0,R3 ; *,RET
001360 020327 177520 CMP R3,#-260 ; RET,* 1624
001364 001013 BNE 20$
001366 016616 000026 MOV 26(SP),(SP) ; CCB,* 1625
001372 016646 000024 MOV 24(SP),-(SP)
001376 016646 000034 MOV 34(SP),-(SP) ; ILINE,*
001402 012746 000001 MOV #1,-(SP)
001406 004767 175072 JSR PC,U.28
001412 000414 BR 21$
001414 020327 000001 20$: CMP R3,#1 ; RET,* 1627
001420 001414 BEQ 22$
001422 016616 000026 MOV 26(SP),(SP) ; CCB,* 1628
001426 010446 MOV R4,-(SP) ; OLINE,*
001430 016646 000036 MOV 36(SP),-(SP)
001434 016646 000036 MOV 36(SP),-(SP) ; ILINE,*
001440 004767 176070 JSR PC,U.27
001444 062706 000006 21$: ADD #6,SP
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 52
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
001450 000440 BR 23$ ; 1627
001452 016600 000030 22$: MOV 30(SP),R0 ; LINEB,* 1630
001456 062700 000074 ADD #74,R0
001462 004767 000000G JSR PC,$IC32
001466 032705 000001 BIT #1,R5 ; *,ICPTD 1631
001472 001427 BEQ 23$
001474 012716 000044 MOV #44,(SP) ; 1633
001500 060616 ADD SP,(SP) ; SOURCE,*
001502 012746 000044 MOV #44,-(SP)
001506 060616 ADD SP,(SP) ; DEST,*
001510 012746 000001 MOV #1,-(SP)
001514 016646 000030 MOV 30(SP),-(SP)
001520 012746 000004 MOV #4,-(SP)
001524 012746 000000G MOV #INTPH2,-(SP)
001530 016700 000002G MOV .CRDAT+2,R0
001534 005046 CLR -(SP)
001536 116016 000002 MOVB 2(R0),(SP)
001542 004767 000000G JSR PC,$CALLE
001546 062706 000014 ADD #14,SP
001552 062706 000010 23$: ADD #10,SP ; 1618
001556 000551 BR 31$ ; 1617
001560 020227 000004 24$: CMP R2,#4 ; 1641
001564 001405 BEQ 25$
001566 020227 000005 CMP R2,#5 ; 1642
001572 001402 BEQ 25$
001574 000167 000524 JMP 37$
001600 016600 000016 25$: MOV 16(SP),R0 ; LINEB,* 1643
001604 062700 000070 ADD #70,R0
001610 004767 000000G JSR PC,$IC32
001614 020327 000002 CMP R3,#2 ; RET,* 1644
001620 001070 BNE 29$
001622 005003 CLR R3 ; RET 1645
001624 152103 BISB (R1)+,R3 ; PTR,RET
001626 010302 MOV R3,R2 ; RET,BUFLEN 1646
001630 062702 000002 ADD #2,R2 ; *,BUFLEN
001634 060301 ADD R3,R1 ; RET,PTR 1647
001636 005000 CLR R0 ; 1644
001640 152100 BISB (R1)+,R0 ; PTR,*
001642 060200 ADD R2,R0 ; BUFLEN,*
001644 010002 MOV R0,R2 ; *,BUFLEN 1648
001646 005202 INC R2 ; BUFLEN
001650 016616 000014 MOV 14(SP),(SP) ; CCB,* 1649
001654 010246 MOV R2,-(SP) ; BUFLEN,*
001656 016646 000024 MOV 24(SP),-(SP)
001662 016646 000036 MOV 36(SP),-(SP) ; SOURCE,*
001666 010446 MOV R4,-(SP) ; OLINE,*
001670 016646 000030 MOV 30(SP),-(SP) ; ILINE,*
001674 004767 000000V JSR PC,U.4
001700 010003 MOV R0,R3 ; *,RET
001702 020327 177730 CMP R3,#-50 ; RET,* 1651
001706 001012 BNE 26$
001710 016616 000026 MOV 26(SP),(SP) ; CCB,* 1652
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 53
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
001714 010446 MOV R4,-(SP) ; OLINE,*
001716 016646 000036 MOV 36(SP),-(SP)
001722 016646 000036 MOV 36(SP),-(SP) ; ILINE,*
001726 004767 175602 JSR PC,U.27
001732 000415 BR 27$ ; 1651
001734 020327 000001 26$: CMP R3,#1 ; RET,* 1655
001740 001415 BEQ 28$
001742 016616 000026 MOV 26(SP),(SP) ; CCB,* 1656
001746 016646 000024 MOV 24(SP),-(SP)
001752 016646 000034 MOV 34(SP),-(SP) ; ILINE,*
001756 012746 000001 MOV #1,-(SP)
001762 004767 174516 JSR PC,U.28
001766 062706 000030 27$: ADD #30,SP ; 1655
001772 000567 BR 40$
001774 062706 000012 28$: ADD #12,SP ; 1644
002000 000415 BR 30$
002002 016600 000014 29$: MOV 14(SP),R0 ; CCB,* 1662
002006 017660 000026 000016 MOV @26(SP),16(R0) ; *,*(CCB)
002014 017660 000024 000020 MOV @24(SP),20(R0) ; *,*(CCB) 1663
002022 016601 000012 MOV 12(SP),R1 ; 1664
002026 016160 000022 000022 MOV 22(R1),22(R0) ; *,*(CCB)
002034 010400 30$: MOV R4,R0 ; OLINE,* 1666
002036 004767 000000G JSR PC,GTLINE
002042 010066 000016 MOV R0,16(SP) ; *,LINEB
002046 026066 000004 000022 CMP 4(R0),22(SP) ; *(LINEB),* 1667
002054 001413 BEQ 32$
002056 016616 000014 MOV 14(SP),(SP) ; CCB,* 1668
002062 010446 MOV R4,-(SP) ; OLINE,*
002064 016646 000024 MOV 24(SP),-(SP)
002070 016646 000024 MOV 24(SP),-(SP) ; ILINE,*
002074 004767 175434 JSR PC,U.27
002100 022626 CMP (SP)+,(SP)+
002102 000520 31$: BR 38$ ; 1667
002104 016616 000014 32$: MOV 14(SP),(SP) ; CCB,* 1670
002110 010446 MOV R4,-(SP) ; OLINE,*
002112 004767 000000G JSR PC,FORWARDER
002116 010003 MOV R0,R3 ; *,RET
002120 020327 177520 CMP R3,#-260 ; RET,* 1671
002124 001013 BNE 33$
002126 016616 000016 MOV 16(SP),(SP) ; CCB,* 1672
002132 016646 000014 MOV 14(SP),-(SP)
002136 016646 000024 MOV 24(SP),-(SP) ; ILINE,*
002142 012746 000001 MOV #1,-(SP)
002146 004767 174332 JSR PC,U.28
002152 000413 BR 34$
002154 005303 33$: DEC R3 ; RET 1674
002156 001414 BEQ 35$
002160 016616 000016 MOV 16(SP),(SP) ; CCB,* 1675
002164 010446 MOV R4,-(SP) ; OLINE,*
002166 016646 000026 MOV 26(SP),-(SP)
002172 016646 000026 MOV 26(SP),-(SP) ; ILINE,*
002176 004767 175332 JSR PC,U.27
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 54
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (5)
002202 062706 000006 34$: ADD #6,SP
002206 000456 BR 38$ ; 1674
002210 016600 000020 35$: MOV 20(SP),R0 ; LINEB,* 1677
002214 062700 000074 ADD #74,R0
002220 004767 000000G JSR PC,$IC32
002224 006005 ROR R5 ; ICPTD 1678
002226 103406 BLO 36$
002230 016600 000020 MOV 20(SP),R0 ; LINEB,*
002234 126027 000002 000004 CMPB 2(R0),#4 ; *(LINEB),*
002242 001040 BNE 38$
002244 012716 000034 36$: MOV #34,(SP) ; 1680
002250 060616 ADD SP,(SP) ; SOURCE,*
002252 012746 000034 MOV #34,-(SP)
002256 060616 ADD SP,(SP) ; DEST,*
002260 012746 000001 MOV #1,-(SP)
002264 016646 000020 MOV 20(SP),-(SP)
002270 012746 000004 MOV #4,-(SP)
002274 012746 000000G MOV #INTPH2,-(SP)
002300 016700 000002G MOV .CRDAT+2,R0
002304 005046 CLR -(SP)
002306 116016 000002 MOVB 2(R0),(SP)
002312 004767 000000G JSR PC,$CALLE
002316 062706 000014 ADD #14,SP
002322 000410 BR 38$ ; 1641
002324 010216 37$: MOV R2,(SP) ; 1689
002326 012746 100042 MOV #-77736,-(SP)
002332 012746 000002 MOV #2,-(SP)
002336 004767 000000G JSR PC,$IGNAL
002342 005726 TST (SP)+
002344 005726 38$: TST (SP)+ ; 1617
002346 062706 000010 39$: ADD #10,SP ; 1187
002352 062706 000024 40$: ADD #24,SP
002356 000207 RTS PC
; Routine Size: 632 words, Routine Base: $CODE$ + 5324
; Maximum stack depth per invocation: 32 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 55
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
; 1692
; 1693 routine PH2HDR (BUFPTR,ILINE,SRCAD,DESTAD) =
; 1694
; 1695 !++
; 1696 ! FUNCTIONAL DESCRIPTION:
; 1697 !
; 1698 ! Analyzes a Phase II routing header and returns the source and
; 1699 ! destination node addresses. It also makes sure that the source
; 1700 ! node name is the same as the adjacent node over the input line.
; 1701 !
; 1702 ! FORMAL PARAMETERS
; 1703 !
; 1704 ! PTR - Character pointer to routing header to analyze
; 1705 ! ILINE - Channel number of input line
; 1706 ! SRCAD - Address of location to return source address
; 1707 ! DESTAD - Address of location to return destination address
; 1708 !
; 1709 ! IMPLICIT INPUTS
; 1710 !
; 1711 ! NONE.
; 1712 !
; 1713 ! ROUTINE VALUE: "Success" or "failure"
; 1714 ! COMPLETION CODES:
; 1715 !
; 1716 ! 1 Success; addresses returned. Header is useable.
; 1717 ! 2 Success; addresses returned. Header is not useable.
; 1718 ! - $XPT$E_UNR Failure; node is unreachable or unknown
; 1719 ! - $XPT$E_RNG Failure; numeric name is out of range
; 1720 ! - $XPT$E_FMT Failure; packet format error
; 1721 !
; 1722 ! SIDE EFFECTS:
; 1723 !
; 1724 ! If "failure" is returned, the source and destination address
; 1725 ! parameters will be set to 0.
; 1726 !
; 1727 !--
; 1728
; 1729 begin
; 1730
; 1731 local LINEb;
; 1732 require 'XPTSYM';
; 1769
; 1770 pointer PTR;
; 1771 local RET,LEN;
; 1772 !local NTT: ref block field(NTTfields); !Addresses Node Translation Table entry
; 1773
; 1774 !
; 1775 ! Try to directly translate destination name into binary
; 1776 !
; 1777
; 1778 .DESTAD = .SRCAD = 0; !Clear out address parameters
; 1779 PTR = ch$plus(.BUFPTR,1); !Address destination name in header
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 56
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
; 1780 LEN = getb(PTR); !Pick up destination name length
; 1781 if .LEN gtru 6 or .LEN eql 0 then !Invalid dest. name length -
; 1782 return (-$XPT$E_FMT); ! return an error
; 1783 RET = CDTB(.PTR,.LEN); ! Call conversion routine
; 1784 if .RET eql 0 or .RET gtr NN then !Invalid node number -
; 1785 return (-$XPT$E_RNG) ! return an error
; 1786 else if .RET gtr 0 then begin !Valid node number obtained -
; 1787 .DESTAD = .RET; ! save it
; 1788 RET = 2 ! and continue
; 1789 end
; 1790
; 1791 !
; 1792 ! If the conversion didn't go, check our own node name
; 1793 !
; 1794
; 1795 else if not begin
; 1796 RET = 1;
; 1797 .DESTAD = .Tid;
; 1798 ((.LEN eql .NODEname_length) and
; 1799 ch$eql(.LEN,.PTR,.NODEname_length,byt$ptr(NODEname,0)))
; 1800 end
; 1801
; 1802 !
; 1803 ! If that didn't work, scan node ID blocks for destination name
; 1804 !
; 1805
; 1806 then begin
; 1807 RET = 0; !Scan through
; 1808 (incr I from 1 to NLN do begin ! all the lines
; 1809 LINEb = $XPT_GET_LINE_DB(.I); ! which have
; 1810 if ((.Nty eql PhTwo) ! adjacent Phase
; 1811 or (.Nty eql TOPS20)) ! II nodes
; 1812 then begin
; 1813 if ((.LEN eql .Nnml) and ! Unequal name lengths disqualify
; 1814 ch$eql(.LEN,.PTR,.LEN, ! Compare node names
; 1815 byt$ptr(Nnm)))
; 1816 then begin ! Hit:
; 1817 .DESTAD = .Nid; ! map to node address
; 1818 exitloop(RET=1) ! and stop search
; 1819 end
; 1820 end
; 1821 end);
; 1822 end;
; 1823
; C 1824 %(!
; C 1825 ! If we didn't find anything, try the Node Translate Table
; C 1826 !
; C 1827
; C 1828 if .RET leq 0 then begin
; C 1829 NTT = VECTOR[NODExlate,1]; !Address first table entry
; C 1830 RET = !Scan through each
; C 1831 (incr I from 1 to .NODExlate do ! table entry
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 57
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
; C 1832 if ch$eql(.LEN,.PTR,.LEN,NTT[NTTname])
; C 1833 then begin ! Hit:
; C 1834 .DESTAD = .NTT[NTTaddr]; ! map to address
; C 1835 exitloop (1) ! stop looking
; C 1836 end
; C 1837 else NTT = NTT[NTTlen]) ! Otherwise, try next entry
; C 1838 end;
; 1839 )%
; 1840
; 1841 !
; 1842 ! Node name not found anywhere - give up
; 1843 !
; 1844
; 1845 if .RET leq 0 then return -$XPT$E_UNR
; 1846
; 1847 !
; 1848 ! Validate source name and pick up source address
; 1849 !
; 1850
; 1851 else begin
; 1852 LINEb = $XPT_GET_LINE_DB(.ILINE); !Address line data base entry
; 1853 PTR = ch$plus(.PTR,.LEN); !Skip past destination name
; 1854 LEN = getb(PTR); !Pick up source node name length
; 1855 if ((.LEN neq .Nnml) !Name lengths don't
; 1856 or ch$neq(.LEN,.PTR,.LEN, ! match or names
; 1857 byt$ptr(Nnm))) ! don't compare -
; 1858 then begin ! clear out
; 1859 .DESTAD = 0; ! destination address
; 1860 return (-$XPT$E_FMT) ! and return an error
; 1861 end
; 1862 else begin !Source name is OK -
; 1863 .SRCAD = .Nid; ! pick up source address
; 1864 return (.RET) ! and return "success"
; 1865 end
; 1866 end
; 1867
; 1868 end; !End of PH2HDR
.SBTTL PH2HDR
000000 004167 000000G ; PH2HDR
U.6: JSR R1,$SAVE5 ; 1693
000004 024646 CMP -(SP),-(SP)
000006 016666 000022 000002 MOV 22(SP),2(SP) ; DESTAD,* 1778
000014 005076 000024 CLR @24(SP) ; SRCAD
000020 005076 000002 CLR @2(SP)
000024 016601 000030 MOV 30(SP),R1 ; BUFPTR,PTR 1779
000030 005201 INC R1 ; PTR 1780
000032 005004 CLR R4 ; LEN
000034 152104 BISB (R1)+,R4 ; PTR,LEN
000036 020427 000006 CMP R4,#6 ; LEN,* 1781
000042 101002 BHI 1$
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 58
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
000044 005704 TST R4 ; LEN
000046 001003 BNE 2$
000050 012700 177774 1$: MOV #-4,R0 ; 1782
000054 000416 BR 4$
000056 010146 2$: MOV R1,-(SP) ; PTR,* 1783
000060 010446 MOV R4,-(SP) ; LEN,*
000062 004767 000000G JSR PC,CDTB
000066 010002 MOV R0,R2 ; *,RET
000070 001405 BEQ 3$ ; 1784
000072 016700 000002G MOV .CRDAT+2,R0
000076 020260 000016 CMP R2,16(R0) ; RET,*
000102 003405 BLE 5$
000104 022626 3$: CMP (SP)+,(SP)+ ; 1785
000106 012700 177776 MOV #-2,R0
000112 000167 000400 4$: JMP 17$
000116 005702 5$: TST R2 ; RET 1786
000120 003405 BLE 6$
000122 010276 000006 MOV R2,@6(SP) ; RET,* 1787
000126 012702 000002 MOV #2,R2 ; *,RET 1788
000132 000515 BR 12$ ; 1786
000134 012702 000001 6$: MOV #1,R2 ; *,RET 1796
000140 016700 000002G MOV .CRDAT+2,R0 ; 1797
000144 016076 000056 000006 MOV 56(R0),@6(SP)
000152 020460 000114 CMP R4,114(R0) ; LEN,* 1798
000156 001016 BNE 7$
000160 010416 MOV R4,(SP) ; LEN,* 1799
000162 010146 MOV R1,-(SP) ; PTR,*
000164 016046 000114 MOV 114(R0),-(SP)
000170 012746 000116 MOV #116,-(SP)
000174 060016 ADD R0,(SP)
000176 005046 CLR -(SP)
000200 004767 000000G JSR PC,BL$EQL
000204 062706 000010 ADD #10,SP
000210 006000 ROR R0
000212 103464 BLO 11$
000214 005002 7$: CLR R2 ; RET 1807
000216 016700 000002G MOV .CRDAT+2,R0 ; 1808
000222 016005 000022 MOV 22(R0),R5
000226 005003 CLR R3 ; I
000230 000452 BR 10$
000232 010300 8$: MOV R3,R0 ; I,* 1809
000234 004767 000000G JSR PC,GTLINE
000240 010066 000004 MOV R0,4(SP) ; *,LINEB
000244 126027 000002 000004 CMPB 2(R0),#4 ; *(LINEB),* 1810
000252 001404 BEQ 9$
000254 126027 000002 000005 CMPB 2(R0),#5 ; *(LINEB),* 1811
000262 001035 BNE 10$
000264 016646 000004 9$: MOV 4(SP),-(SP) ; LINEB,* 1813
000270 062716 000007 ADD #7,(SP)
000274 113600 MOVB @(SP)+,R0
000276 020400 CMP R4,R0 ; LEN,*
000300 001026 BNE 10$
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 59
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
000302 010416 MOV R4,(SP) ; LEN,* 1815
000304 010146 MOV R1,-(SP) ; PTR,*
000306 010446 MOV R4,-(SP) ; LEN,*
000310 016646 000010 MOV 10(SP),-(SP) ; LINEB,*
000314 062716 000010 ADD #10,(SP)
000320 005046 CLR -(SP)
000322 004767 000000G JSR PC,BL$EQL
000326 062706 000010 ADD #10,SP
000332 006000 ROR R0
000334 103010 BCC 10$
000336 016600 000004 MOV 4(SP),R0 ; LINEB,* 1817
000342 016076 000004 000006 MOV 4(R0),@6(SP) ; *(LINEB),*
000350 012702 000001 MOV #1,R2 ; *,RET 1818
000354 000404 BR 12$
000356 005203 10$: INC R3 ; I 1808
000360 020305 CMP R3,R5 ; I,*
000362 003723 BLE 8$
000364 005702 11$: TST R2 ; RET 1845
000366 003003 12$: BGT 13$
000370 012700 177777 MOV #-1,R0
000374 000447 BR 16$
000376 016600 000032 13$: MOV 32(SP),R0 ; ILINE,* 1852
000402 004767 000000G JSR PC,GTLINE
000406 010066 000004 MOV R0,4(SP) ; *,LINEB
000412 060401 ADD R4,R1 ; LEN,PTR 1853
000414 005004 CLR R4 ; LEN 1854
000416 152104 BISB (R1)+,R4 ; PTR,LEN
000420 010003 MOV R0,R3 ; LINEB,* 1855
000422 116300 000007 MOVB 7(R3),R0 ; *(LINEB),*
000426 020400 CMP R4,R0 ; LEN,*
000430 001016 BNE 14$
000432 010416 MOV R4,(SP) ; LEN,* 1857
000434 010146 MOV R1,-(SP) ; PTR,*
000436 010446 MOV R4,-(SP) ; LEN,*
000440 016646 000010 MOV 10(SP),-(SP) ; LINEB,*
000444 062716 000010 ADD #10,(SP)
000450 005046 CLR -(SP)
000452 004767 000000G JSR PC,BL$NEQ
000456 062706 000010 ADD #10,SP
000462 006000 ROR R0
000464 103005 BCC 15$
000466 005076 000006 14$: CLR @6(SP) ; 1859
000472 012700 177774 MOV #-4,R0 ; 1855
000476 000406 BR 16$
000500 016600 000004 15$: MOV 4(SP),R0 ; LINEB,* 1863
000504 016076 000004 000030 MOV 4(R0),@30(SP) ; *(LINEB),SRCAD
000512 010200 MOV R2,R0 ; RET,* 1855
000514 022626 16$: CMP (SP)+,(SP)+ ; 1693
000516 022626 17$: CMP (SP)+,(SP)+
000520 000207 RTS PC
; Routine Size: 169 words, Routine Base: $CODE$ + 7704
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 60
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (6)
; Maximum stack depth per invocation: 15 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 61
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (7)
; 1869
; 1870 routine BLDPH3 (CCB,HDRFLG,DEST,SOURCE,RQR) =
; 1871
; 1872 !++
; 1873 ! FUNCTIONAL DESCRIPTION:
; 1874 !
; 1875 ! This routine builds a Phase III routing header in the spawned CCB.
; 1876 ! All of the information for the header is passed as parameters. If
; 1877 ! HDRFLG is on, the buffer descriptor for the pass-through CCB will be
; 1878 ! adjusted to point past the Phase II routing header in the buffer.
; 1879 !
; 1880 ! FORMAL PARAMETERS
; 1881 !
; 1882 ! CCB - Spawned CCB for the packet for which a header is
; 1883 ! to be built.
; 1884 ! HDRFLG - If this flag is 1, the pass-through CCB will be
; 1885 ! adjusted to point past the Phase II routing header.
; 1886 ! DEST - The destination node address.
; 1887 ! SOURCE - The source node address.
; 1888 ! RQRFLG - The "Rqr" bit in the routing header flags will be set
; 1889 ! to this value.
; 1890 !
; 1891 ! IMPLICIT INPUTS
; 1892 !
; 1893 ! C_STK in the spawned CCB points to the pass-through CCB.
; 1894 !
; 1895 ! ROUTINE VALUE: "Success" only
; 1896 ! COMPLETION CODES:
; 1897 !
; 1898 ! CS_SUC - Success; routing header built.
; 1899 !
; 1900 ! SIDE EFFECTS:
; 1901 !
; 1902 ! The pass-through buffer descriptor may be adjusted. If
; 1903 ! it is, the high-order byte of C_PRM4 in the spawned CCB
; 1904 ! will contain the "adjustment factor" for the descriptor.
; 1905 !
; 1906 !--
; 1907
; 1908 begin
; 1909 map CCB: ref block field (C_XPT_fields);
; 1910 pointer PTR;
; 1911 local BUFPTR,CCB_P,HDRLEN,LEN;
; 1912 map CCB_P: ref block field(C_FIELDS);
; 1913
; 1914 !
; 1915 ! Set up the spawned CCB fields
; 1916 !
; 1917
; 1918 CCB_P = .CCB[C_STK]; !Address the pass-through CCB
; 1919 PTR = byt$ptr(CCB[C_PRM1],0); !Address data area in spawned CCB
; 1920 CCB[C_BIAS] = 0; !Set up the buffer
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 62
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (7)
; 1921 CCB[C_ADDR] = .PTR; ! descriptor to point
; 1922 CCB[C_CNT] = 6; ! to the data area
; 1923 CCB[C_CHN] = .CCB_P; !Chain pass-through off
; 1924
; 1925 !
; 1926 ! Build the routing header
; 1927 !
; 1928
; 1929 putb(if .RQR then 10 else 2,PTR); !Put in the routing flags
; 1930 putw(.DEST,PTR); ! and the destination address
; 1931 putw(.SOURCE,PTR); ! and the source address
; 1932 putb(1,PTR); ! and the Visits field
; 1933
; 1934 !
; 1935 ! If specified, adjust the pass-through descriptor to
; 1936 ! point past the old routing header
; 1937 !
; 1938
; 1939 if .HDRFLG then begin
; 1940 MAPBUF(.CCB_P,BUFPTR,LEN); !Map in pass-through buffer
; 1941 PTR = ch$plus(.BUFPTR,1); !Point to destination name field
; 1942 LEN = getb(PTR); !Pick up name length
; 1943 PTR = ch$plus(.PTR,.LEN); !Skip past field
; 1944 HDRLEN = 1 + 1 + .LEN;
; 1945 LEN = getb(PTR); !Pick up source name length
; 1946 PTR = ch$plus(.PTR,.LEN); !Skip past name field
; 1947 HDRLEN = .HDRLEN + 1 + .LEN;
; 1948 CCB[C_XPT_ADJUST] = .HDRLEN; !Save "adjustment factor"
; 1949 CCB_P[C_ADDR] = .PTR; !Adjust the buffer descriptor
; 1950 CCB_P[C_CNT] = .CCB_P[C_CNT] - .HDRLEN; !for the pass-through
; 1951 end;
; 1952
; 1953 !
; 1954 ! Return a "success" code
; 1955 !
; 1956
; 1957 return (CS_SUC)
; 1958 end; !End of BLDPH3
.SBTTL BLDPH3
000000 004167 000000G ; BLDPH3
U.5: JSR R1,$SAVE5 ; 1870
000004 005746 TST -(SP)
000006 016605 000030 MOV 30(SP),R5 ; CCB,* 1918
000012 016504 000004 MOV 4(R5),R4 ; *,CCB.P
000016 012700 000024 MOV #24,R0 ; *,PTR 1919
000022 060500 ADD R5,R0 ; *,PTR
000024 005065 000016 CLR 16(R5) ; 1920
000030 010065 000020 MOV R0,20(R5) ; PTR,* 1921
000034 012765 000006 000022 MOV #6,22(R5) ; 1922
000042 010465 000002 MOV R4,2(R5) ; CCB.P,* 1923
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 63
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (7)
000046 032766 000001 000020 BIT #1,20(SP) ; *,RQR 1929
000054 001403 BEQ 1$
000056 012701 000012 MOV #12,R1
000062 000402 BR 2$
000064 012701 000002 1$: MOV #2,R1
000070 110120 2$: MOVB R1,(R0)+ ; *,PTR
000072 016616 000024 MOV 24(SP),(SP) ; DEST,X 1930
000076 111620 MOVB (SP),(R0)+ ; X,PTR
000100 116620 000001 MOVB 1(SP),(R0)+ ; X,PTR
000104 016616 000022 MOV 22(SP),(SP) ; SOURCE,X 1931
000110 111620 MOVB (SP),(R0)+ ; X,PTR
000112 116620 000001 MOVB 1(SP),(R0)+ ; X,PTR
000116 112720 000001 MOVB #1,(R0)+ ; *,PTR 1932
000122 032766 000001 000026 BIT #1,26(SP) ; *,HDRFLG 1939
000130 001432 BEQ 3$
000132 016467 000016 000000G MOV 16(R4),KISAR6 ; *(CCB.P),* 1940
000140 016402 000020 MOV 20(R4),R2 ; *(CCB.P),BUFPTR
000144 010200 MOV R2,R0 ; BUFPTR,PTR 1941
000146 005200 INC R0 ; PTR 1942
000150 005001 CLR R1 ; LEN
000152 152001 BISB (R0)+,R1 ; PTR,LEN
000154 060100 ADD R1,R0 ; LEN,PTR 1943
000156 010102 MOV R1,R2 ; LEN,HDRLEN 1944
000160 062702 000002 ADD #2,R2 ; *,HDRLEN
000164 005001 CLR R1 ; LEN 1945
000166 152001 BISB (R0)+,R1 ; PTR,LEN
000170 060100 ADD R1,R0 ; LEN,PTR 1946
000172 010103 MOV R1,R3 ; LEN,* 1939
000174 060203 ADD R2,R3 ; HDRLEN,*
000176 010302 MOV R3,R2 ; *,HDRLEN 1947
000200 005202 INC R2 ; HDRLEN
000202 110265 000033 MOVB R2,33(R5) ; HDRLEN,* 1948
000206 010064 000020 MOV R0,20(R4) ; PTR,*(CCB.P) 1949
000212 160264 000022 SUB R2,22(R4) ; HDRLEN,*(CCB.P) 1950
000216 012700 000001 3$: MOV #1,R0 ; 1908
000222 005726 TST (SP)+ ; 1870
000224 000207 RTS PC
; Routine Size: 75 words, Routine Base: $CODE$ + 10426
; Maximum stack depth per invocation: 8 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 64
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
; 1959
; 1960 routine BLDPH2 (CCB,PT_HDR,DEST,SOURCE,OLINE,ILINE) =
; 1961
; 1962 !++
; 1963 ! FUNCTIONAL DESCRIPTION:
; 1964 !
; 1965 ! This routine builds a Phase II routing header for a data packet. The
; 1966 ! source node name will always be a decimal ASCII representation of the
; 1967 ! specified source node address. The destination node name will be the
; 1968 ! adjacent node over the output line.
; 1969 !
; 1970 ! FORMAL PARAMETERS
; 1971 !
; 1972 ! CCB Spawned CCB for the packet for which a header is to be
; 1973 ! built.
; 1974 ! PT_HDR Flag which, if non-zero, indicates that the pass-through
; 1975 ! buffer contains a routing header which the descriptor
; 1976 ! must be adjusted to point past. The value of PT_HDR is
; 1977 ! the number of bytes to skip over.
; 1978 ! DEST Destination node address
; 1979 ! SOURCE Source node address
; 1980 ! OLINE Channel number of output line
; 1981 ! ILINE Channel number of input line
; 1982 !
; 1983 ! IMPLICIT INPUTS
; 1984 !
; 1985 ! Nty, Nid
; 1986 !
; 1987 ! ROUTINE VALUE: "Success", "unreachable destination", or "resource failure"
; 1988 ! COMPLETION CODES:
; 1989 !
; 1990 ! CS_SUC Success: header built and pointed to by spawned CCB
; 1991 ! CE_DIS Destination is unreachable (it is not the adjacent node)
; 1992 ! CE_RTE Resource failure: could not get an SDB
; 1993 !
; 1994 ! SIDE EFFECTS:
; 1995 !
; 1996 ! The pass-through buffer descriptor may be adjusted. If it is,
; 1997 ! the high-order byte of C_PRM4 in the spawned CCB will contain
; 1998 ! the "adjustment factor" for the descriptor.
; 1999 !
; 2000 !--
; 2001
; 2002 begin
; 2003
; 2004 !-----------------------------------------------!
; 2005 ! !
; 2006 ! Routine to scan for a node as an !
; 2007 ! adjacent Phase II node and, if found, !
; 2008 ! convert it into a ASCII node name. !
; 2009 ! !
; 2010 !-----------------------------------------------!
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 65
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
; 2011
; 2012 linkage CONVERT_LINKAGE = JSR (REGISTER=4,REGISTER=5);
; 2013 routine CONVERT (NODE,LINE,PTRAD): CONVERT_LINKAGE =
; 2014 begin
; 2015
; 2016 local LINEb;
; 2017 require 'XPTSYM';
; 2054
; 2055 LINEb = $XPT_GET_LINE_DB(.LINE); ! Address circuit data base
; 2056
; 2057 if ((.Nty eql PhTwo) or (.Nty eql TOPS20)) ! If adjacent node is Phase
; 2058 then if .Nid eql .NODE then begin ! 2 and is the right one,
; 2059 putb(.Nnml,.PTRAD); ! adjacent node
; 2060 .PTRAD = ch$move(.Nnml, ! name into the
; 2061 byt$ptr(Nnm),..PTRAD); ! specified area,
; 2062 return TRUE ! and say we hit
; 2063 end;
; 2064
; 2065 FALSE ! No hit - say so
; 2066
; 2067 end;
.SBTTL CONVERT
000000 004167 000000G ; CONVERT
U.44: JSR R1,$SAVE5 ; 2013
000004 010500 MOV R5,R0 ; LINE,* 2055
000006 004767 000000G JSR PC,GTLINE
000012 126027 000002 000004 CMPB 2(R0),#4 ; *(LINEB),* 2057
000020 001404 BEQ 1$
000022 126027 000002 000005 CMPB 2(R0),#5 ; *(LINEB),*
000030 001030 BNE 2$
000032 026004 000004 1$: CMP 4(R0),R4 ; *(LINEB),NODE 2058
000036 001025 BNE 2$
000040 016604 000016 MOV 16(SP),R4 ; PTRAD,* 2059
000044 116074 000007 000000 MOVB 7(R0),@0(R4) ; *(LINEB),*
000052 005214 INC (R4)
000054 116005 000007 MOVB 7(R0),R5 ; *(LINEB),* 2061
000060 010546 MOV R5,-(SP)
000062 010046 MOV R0,-(SP) ; LINEB,*
000064 062716 000010 ADD #10,(SP)
000070 011446 MOV (R4),-(SP)
000072 004767 000000G JSR PC,BL$MOV
000076 010014 MOV R0,(R4) ; 2060
000100 062706 000006 ADD #6,SP ; 2058
000104 012700 000001 MOV #1,R0
000110 000207 RTS PC
000112 005000 2$: CLR R0 ; 2013
000114 000207 RTS PC
; Routine Size: 39 words, Routine Base: $CODE$ + 10654
; Maximum stack depth per invocation: 10 words
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 66
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
; 2068 map CCB: ref block field (C_XPT_fields);
; 2069 local NODEb,LINEb;
; 2070 require 'XPTSYM';
; 2107 local RET,SDB_ADDR,LEN,PTRA;
; 2108 local CCB_P: ref block field(C_XPT_fields);
; 2109 pointer PTR;
; 2110
; 2111 !
; 2112 ! Check destination address for validity
; 2113 !
; 2114
; 2115 LINEb = $XPT_GET_LINE_DB(.OLINE); !Address output line data base entry
; 2116 if (.Nid neq .DEST) then !Destination is not adjacent over
; 2117 return (CE_DIS); ! output line - return "unreachable"
; 2118
; 2119 !
; 2120 ! Get an SDB
; 2121 !
; 2122
; 2123 if not GETBUF(15,CCB) then !Couldn't get one -
; 2124 return (CE_RTE); ! return "resource failure"
; 2125 CCB[C_CHN] = CCB_P = .CCB[C_STK]; !Chain the CCBs
; 2126
; 2127 !
; 2128 ! Build the header
; 2129 !
; 2130
; 2131 MAPBUF(.CCB,SDB_ADDR,LEN); !Map in the SDB
; 2132 PTR = .SDB_ADDR;
; 2133 putb(PH2_RTflgs,PTR); !Put in the RTFLGS
; 2134 putb(.Nnml,PTR); !Move in the destination name length
; 2135 PTR = ch$move(.Nnml, !Move in the destination
; 2136 byt$ptr(Nnm),.PTR); ! node name from the ID block
; 2137 PTRA = ch$plus(.PTR,1); !Point to source name field
; 2138 LINEb = $XPT_GET_LINE_DB(.ILINE);
; 2139 NODEb = $XPT_GET_NODE_DB(.SOURCE); ! Address source node data base entry
; 2140 if .SOURCE eql .Tid ! Source is local node -
; 2141 then begin
; 2142 putb(.NODEname_length,PTR); ! move in
; 2143 PTRA = ch$move(.NODEname_length, ! the local
; 2144 byt$ptr(NODEname,0),.PTRA); ! node name
; 2145 end
; 2146 else if not (.Phase2_node and
; 2147 begin
; 2148 PTRA = .PTR;
; 2149 if CONVERT(.SOURCE,.ILINE,PTRA) then TRUE
; 2150 else if (decr J from NLN to 1 do
; 2151 (if CONVERT(.SOURCE,.J,PTRA) then exitloop(0))) eql 0
; 2152 then TRUE
; 2153 else FALSE
; 2154 end)
; 2155 then if ((.ILINE neq 0)
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 67
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
; 2156 and ((.Nty eql PhTwo) ! Source is
; 2157 or (.Nty eql TOPS20)) ! adjacent and
; 2158 and (.Nid eql .SOURCE)) ! Phase II:
; 2159 then begin !
; 2160 putb(.Nnml,PTR); ! adjacent
; 2161 PTRA = ch$move(.Nnml, ! node name
; 2162 byt$ptr(Nnm),.PTRA); ! into the header
; 2163 end
; 2164 else begin ! Otherwise -
; 2165 RET = CBTD(PTRA,.SOURCE);! translate the source address
; 2166 putb(.RET,PTR); ! to ASCII and move in the
; 2167 end; ! translated name length
; 2168 CCB[C_CNT] = ch$diff(.PTRA,.SDB_ADDR); !Calculate length of header
; 2169
; 2170
; 2171 !
; 2172 ! If requested to do so, adjust the buffer descriptor of the
; 2173 ! pass-through CCB to point past an old header
; 2174 !
; 2175
; 2176 if .PT_HDR neq 0 then begin
; 2177 CCB[C_XPT_ADJUST] = .PT_HDR; !Set up adjustment factor
; 2178 CCB_P[C_ADDR] = ch$plus !Bump buffer address
; 2179 (.CCB_P[C_ADDR],.PT_HDR); ! past Phase III header
; 2180 CCB_P[C_CNT] = .CCB_P[C_CNT] - .PT_HDR; !Also adjust count
; 2181 end;
; 2182
; 2183 !
; 2184 ! Return "success"
; 2185 !
; 2186
; 2187 return (CS_SUC)
; 2188 end; !End of BLDPH2
.SBTTL BLDPH2
000000 004167 000000G ; BLDPH2
U.4: JSR R1,$SAVE5 ; 1960
000004 162706 000010 SUB #10,SP
000010 016600 000030 MOV 30(SP),R0 ; OLINE,* 2115
000014 004767 000000G JSR PC,GTLINE
000020 010066 000004 MOV R0,4(SP) ; *,LINEB
000024 026066 000004 000034 CMP 4(R0),34(SP) ; *(LINEB),DEST 2116
000032 001403 BEQ 1$
000034 012700 177520 MOV #-260,R0 ; 2117
000040 000423 BR 3$
000042 012701 000017 1$: MOV #17,R1 ; 2123
000046 004767 000000G JSR PC,$CORGT
000052 103414 BCS 2$
000054 016601 000040 MOV 40(SP),R1 ; CCB,*
000060 010061 000020 MOV R0,20(R1) ; $MCB$R0,*
000064 010100 MOV R1,R0 ; CCB,*
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 68
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
000066 016760 000000G 000016 MOV KISAR6,16(R0)
000074 012760 000017 000034 MOV #17,34(R0)
000102 000404 BR 4$
000104 012700 177730 2$: MOV #-50,R0 ; 2124
000110 000167 000512 3$: JMP 16$
000114 016666 000040 000002 4$: MOV 40(SP),2(SP) ; CCB,* 2125
000122 016600 000002 MOV 2(SP),R0
000126 016003 000004 MOV 4(R0),R3 ; *,CCB.P
000132 010360 000002 MOV R3,2(R0) ; CCB.P,*
000136 016067 000016 000000G MOV 16(R0),KISAR6 ; 2131
000144 016016 000020 MOV 20(R0),(SP) ; *,SDB.ADDR
000150 011601 MOV (SP),R1 ; SDB.ADDR,PTR 2132
000152 112721 000106 MOVB #106,(R1)+ ; *,PTR 2133
000156 016600 000004 MOV 4(SP),R0 ; LINEB,* 2134
000162 116021 000007 MOVB 7(R0),(R1)+ ; *(LINEB),PTR
000166 010002 MOV R0,R2 ; LINEB,* 2136
000170 116200 000007 MOVB 7(R2),R0 ; *(LINEB),*
000174 010046 MOV R0,-(SP)
000176 016646 000006 MOV 6(SP),-(SP) ; LINEB,*
000202 062716 000010 ADD #10,(SP)
000206 010146 MOV R1,-(SP) ; PTR,*
000210 004767 000000G JSR PC,BL$MOV
000214 010001 MOV R0,R1 ; *,PTR 2135
000216 012766 000001 000014 MOV #1,14(SP) ; *,PTRA 2137
000224 060166 000014 ADD R1,14(SP) ; PTR,PTRA
000230 016602 000034 MOV 34(SP),R2 ; ILINE,* 2138
000234 010200 MOV R2,R0
000236 004767 000000G JSR PC,GTLINE
000242 010066 000012 MOV R0,12(SP) ; *,LINEB
000246 016604 000040 MOV 40(SP),R4 ; SOURCE,* 2139
000252 010400 MOV R4,R0
000254 004767 000000G JSR PC,GTNODE
000260 010005 MOV R0,R5 ; *,NODEB
000262 016700 000002G MOV .CRDAT+2,R0 ; 2140
000266 020460 000056 CMP R4,56(R0)
000272 001017 BNE 5$
000274 116021 000114 MOVB 114(R0),(R1)+ ; *,PTR 2142
000300 016016 000114 MOV 114(R0),(SP) ; 2144
000304 012746 000116 MOV #116,-(SP)
000310 060016 ADD R0,(SP)
000312 016646 000016 MOV 16(SP),-(SP) ; PTRA,*
000316 004767 000000G JSR PC,BL$MOV
000322 010066 000020 MOV R0,20(SP) ; *,PTRA 2143
000326 022626 CMP (SP)+,(SP)+ ; 2141
000330 000511 BR 14$ ; 2140
000332 032715 001000 5$: BIT #1000,(R5) ; *,NODEB 2146
000336 001434 BEQ 10$
000340 010166 000014 MOV R1,14(SP) ; PTR,PTRA 2148
000344 012716 000014 MOV #14,(SP) ; 2149
000350 060616 ADD SP,(SP) ; PTRA,*
000352 010205 MOV R2,R5
000354 004767 177302 JSR PC,U.44
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 69
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
000360 006000 ROR R0
000362 103474 BLO 14$
000364 016705 000002G MOV .CRDAT+2,R5 ; 2150
000370 016505 000022 MOV 22(R5),R5 ; *,J
000374 003412 BLE 8$
000376 012716 000014 6$: MOV #14,(SP) ; 2151
000402 060616 ADD SP,(SP) ; PTRA,*
000404 004767 177252 JSR PC,U.44
000410 006000 ROR R0
000412 103002 BCC 7$
000414 005000 CLR R0
000416 000403 BR 9$
000420 077512 7$: SOB R5,6$ ; J,* 0000
000422 012700 177777 8$: MOV #-1,R0 ; 2150
000426 001452 9$: BEQ 14$
000430 005702 10$: TST R2 ; 2155
000432 001440 BEQ 12$
000434 016600 000012 MOV 12(SP),R0 ; LINEB,* 2156
000440 126027 000002 000004 CMPB 2(R0),#4 ; *(LINEB),*
000446 001404 BEQ 11$
000450 126027 000002 000005 CMPB 2(R0),#5 ; *(LINEB),* 2157
000456 001026 BNE 12$
000460 016600 000012 11$: MOV 12(SP),R0 ; LINEB,* 2158
000464 026004 000004 CMP 4(R0),R4 ; *(LINEB),*
000470 001021 BNE 12$
000472 116011 000007 MOVB 7(R0),(R1) ; *(LINEB),PTR 2160
000476 010002 MOV R0,R2 ; LINEB,* 2162
000500 116200 000007 MOVB 7(R2),R0 ; *(LINEB),*
000504 010016 MOV R0,(SP)
000506 010246 MOV R2,-(SP) ; LINEB,*
000510 062716 000010 ADD #10,(SP)
000514 016646 000016 MOV 16(SP),-(SP) ; PTRA,*
000520 004767 000000G JSR PC,BL$MOV
000524 010066 000020 MOV R0,20(SP) ; *,PTRA 2161
000530 005726 TST (SP)+ ; 2159
000532 000407 BR 13$ ; 2155
000534 012716 000014 12$: MOV #14,(SP) ; 2165
000540 060616 ADD SP,(SP) ; PTRA,*
000542 010446 MOV R4,-(SP)
000544 004767 000000G JSR PC,CBTD
000550 110011 MOVB R0,(R1) ; RET,PTR 2166
000552 005726 13$: TST (SP)+ ; 2155
000554 016600 000014 14$: MOV 14(SP),R0 ; PTRA,* 2168
000560 166600 000006 SUB 6(SP),R0 ; SDB.ADDR,*
000564 016601 000010 MOV 10(SP),R1
000570 010061 000022 MOV R0,22(R1)
000574 016600 000044 MOV 44(SP),R0 ; PT.HDR,* 2176
000600 001406 BEQ 15$
000602 110061 000033 MOVB R0,33(R1) ; 2177
000606 060063 000020 ADD R0,20(R3) ; *,*(CCB.P) 2179
000612 160063 000022 SUB R0,22(R3) ; *,*(CCB.P) 2180
000616 062706 000006 15$: ADD #6,SP ; 1960
XPTSEL 15-Nov-1984 10:31:04 TOPS-20 Bliss-16 2A(530) Page 70
X01730 23-Sep-1983 09:35:45 RATS:<BANKS.MCB.XPT>XPTSEL.BLI.1 (8)
000622 012700 000001 MOV #1,R0 ; 2002
000626 062706 000010 16$: ADD #10,SP ; 1960
000632 000207 RTS PC
; Routine Size: 206 words, Routine Base: $CODE$ + 10772
; Maximum stack depth per invocation: 16 words
; 2189
; 2190 end !End of module XPTSEL
; 2191 eludom
; OTS external references
.GLOBL $SAVE5, $SAVE4, $STOP, $IGNAL
.GLOBL BL$NEQ, BL$EQL, BL$MOV
; PSECT SUMMARY
;
; Psect Name Words Attributes
; $PLIT$ 2 RO , D , LCL, REL, CON
; $CODE$ 2507 RO , I , LCL, REL, CON
; LIBRARY STATISTICS
;
; -------- Symbols -------- Blocks
; File Total Loaded Percent Read
;
; RATS:<BANKS.MCB.MCB>XPORTX.L16.10 599 2 0 0
; RATS:<BANKS.MCB.MCB>MCBLIB.L16.6 372 44 11 0
; RATS:<BANKS.MCB.MCB>NMXLIB.L16.5 200 11 5 0
; RATS:<BANKS.MCB.XPT>XPTLIB.L16.3 510 196 38 0
; Size: 2507 code + 2 data words
; Run Time: 00:46.4
; Elapsed Time: 03:58.5
; Memory Used: 94 pages
; Compilation Complete