Trailing-Edge
-
PDP-10 Archives
-
BB-R598A-RM_1983
-
swskit-v3/listings/vnp36/pchn.list
There are no other files named pchn.list in the archive.
! TABLE OF C 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 1
1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (1)
; 0001 !<REL4A.TKB-VNP>PCHN.BLI.3, 3-Dec-79 14:43:42, Edit by SROBINSON
; 0002 MODULE PCHN ( ! PROCESS CHAINED BLOCKS
; 0003 IDENT = 'X2.0'
; 0004 ) =
; 0005 BEGIN
; 0006 !
; 0007 !
; 0008 !
; 0009 ! COPYRIGHT (c) 1980, 1981, 1982
; 0010 ! DIGITAL EQUIPMENT CORPORATION
; 0011 ! Maynard, Massachusetts
; 0012 !
; 0013 ! This software is furnished under a license and may be used
; 0014 ! and copied only in accordance with the terms of such license
; 0015 ! and with the inclusion of the above copyright notice. This
; 0016 ! software or any other copies thereof may not be provided or
; 0017 ! otherwise made available to any other person. No title to
; 0018 ! and ownership of the software is hereby transferred.
; 0019 !
; 0020 ! The information in this software is subject to change
; 0021 ! without notice and should not be construed as a commitment
; 0022 ! by DIGITAL EQUIPMENT CORPORATION.
; 0023 !
; 0024 ! DIGITAL assumes no responsibility for the use or reliability
; 0025 ! of its software on equipment which is not supplied by
; 0026 ! DIGITAL.
; 0027 !
; 0028
; 0029 !++
; 0030 ! FACILITY: TKB-20 AND VNP-20
; 0031 !
; 0032 ! ABSTRACT:
; 0033 !
; 0034 !
; 0035 ! THIS MODULE DOES PROCESSING OF BLOCKS THAT HAVE BEEN
; 0036 ! CHAINED TOGETHER USING CHAIN BLOCKS.
; 0037 !
; 0038 !
; 0039 ! ENVIRONMENT: TOPS-20 USER MODE
; 0040 !
; 0041 ! AUTHOR: J. SAUTER, CREATION DATE: 14-DEC-77
; 0042 !
; 0043 ! MODIFIED BY:
; 0044 !
; 0045 ! Scott G. Robinson, 17-NOV-78 : VERSION X0.1-2A
; 0046 ! - Fix BLD_CHAIN (et al) to remove ROOT_BLOCK so
; 0047 ! macro expansion will not occur with library file
; 0048 !
; 0049 ! Scott G. Robinson, 16-DEC-78 : VERSION X0.1-3A
; 0050 ! - Add new routine DEL_PTRS which frees storage held by
; 0051 ! pointer blocks
; 0052 !-----------------------------------------------------------------------
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 2
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (1)
; 0053 !
; 0054 ! Scott G. Robinson, 3-DEC-79 : Version X2.0
; 0055 ! - Ensure DECnet-10 Compatibility
; 0056 !
; 0057 ! , : VERSION
; 0058 ! 01 -
; 0059 !--
; 0060
; 0061 !<BLF/PAGE>
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 3
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (2)
; 0062 !
; 0063 ! TABLE OF CONTENTS:
; 0064 !
; 0065
; 0066 FORWARD ROUTINE
; 0067 ADD_POINTER : NOVALUE, !PUT NEXT POINTER IN NON-FULL CHAIN BLOCK
; 0068 INIT_CHAIN : NOVALUE, !CREATE A NEW CHAIN BLOCK
; 0069 BLD_CHAIN, !ADD POINTER TO CHAIN (GLOBAL)
; 0070 FND_CHAIN, !FIND A CHAINED BLOCK
; 0071 DEL_PTRS : NOVALUE; !DELETE CHAIN BLOCKS
; 0072
; 0073 !
; 0074 ! INCLUDE FILES:
; 0075 !
; 0076
; 0077 LIBRARY 'VNPLIB';
; 0078
; 0079 !REQUIRE 'BLOCKH.REQ'; !PREPARE TO DEFINE STORAGE BLOCKS
; 0080 !REQUIRE 'CHAIN.REQ'; !DEFINE CHAIN BLOCK
; 0081 !REQUIRE 'ANYBLK.REQ'; !DEFINE GENERIC BLOCK
; 0082 !REQUIRE 'BLOCKT.REQ'; !END OF DEFINING BLOCKS
; 0083 !
; 0084 ! MACROS:
; 0085 !
; 0086 ! NONE
; 0087 !
; 0088 ! EQUATED SYMBOLS:
; 0089 !
; 0090 ! NONE
; 0091 !
; 0092 ! OWN STORAGE:
; 0093 !
; 0094 ! NONE
; 0095 !
; 0096 ! EXTERNAL REFERENCES:
; 0097 !
; 0098
; 0099 EXTERNAL ROUTINE
; 0100 ERRMSG, !PRINT AN ERROR MESSAGE
; 0101 GETBLK, !GET A BLOCK FROM FREE STORAGE
; 0102 FREBLK; !RETURN A BLOCK TO FREE STORAGE
; 0103
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 4
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (3)
; 0104 ROUTINE ADD_POINTER (POINTER, ADDRESS) : NOVALUE =
; 0105
; 0106 !++
; 0107 ! FUNCTIONAL DESCRIPTION:
; 0108 !
; 0109 !
; 0110 ! ADD AN ADDRESS TO A CHAIN BLOCK. THERE MUST BE ROOM.
; 0111 !
; 0112 !
; 0113 ! FORMAL PARAMETERS:
; 0114 !
; 0115 ! POINTER - POINTER TO THE CHAIN BLOCK
; 0116 ! ADDRESS - THE ADDRESS TO BE ADDED
; 0117 !
; 0118 ! IMPLICIT INPUTS:
; 0119 !
; 0120 ! NONE
; 0121 !
; 0122 ! IMPLICIT OUTPUTS:
; 0123 !
; 0124 ! NONE
; 0125 !
; 0126 ! ROUTINE VALUE:
; 0127 !
; 0128 ! NONE
; 0129 !
; 0130 ! SIDE EFFECTS
; 0131 !
; 0132 ! THE CONTENTS OF THE CHAIN BLOCK IS MODIFIED
; 0133 !
; 0134 !--
; 0135
; 0136 BEGIN
; 0137
; 0138 LOCAL
; 0139 PTRS,
; 0140 BITPOS;
; 0141
; 0142 MAP
; 0143 POINTER : REF CHAIN_BLOCK;
; 0144
; 0145 STRUCTURE
; 0146 POINTERS [LOCN] =
; 0147 (POINTERS + (LOCN/%BPVAL))<(LOCN MOD %BPVAL), %BPADDR>;
; 0148
; 0149 !
; 0150 PTRS = .POINTER [NUM_CHAIN_PTRS];
; 0151 BITPOS = ((%FIELDEXPAND (CHAIN_PTRS, 0)*%BPVAL) + %FIELDEXPAND (CHAIN_PTRS, 1)) + (.PTRS*%BPADDR);
; 0152 POINTERS [.POINTER, .BITPOS] = .ADDRESS;
; 0153 POINTER [NUM_CHAIN_PTRS] = .PTRS + 1;
; 0154 END;
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 5
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (3)
TITLE PCHN
TWOSEG
.REQUEST SYS:B362LB.REL
EXTERN ERRMSG, GETBLK, FREBLK
AC0= 0
AC1= 1
AC2= 2
AC3= 3
AC4= 4
AC5= 5
AC6= 6
AC7= 7
AC10= 10
AC11= 11
AC12= 12
AC13= 13
AC14= 14
FP= 15
AC16= 16
SP= 17
RELOC 400000 ; 400000'
ADD_POINTER:
PUSH SP,AC0 ; SP,AC0 400000' 261 17 0 00 000000 0104
MOVE AC4,-3(SP) ; AC4,POINTER 400001' 200 04 0 17 777775 0150
LDB AC0,C.1 ; PTRS,[POINT 4,1(AC4),35] <0,4> 400002' 135 00 0 00 400025'
MOVE AC1,AC0 ; AC1,PTRS 400003' 200 01 0 00 000000 0151
IMULI AC1,22 ; AC1,22 400004' 221 01 0 00 000022
MOVE AC5,AC1 ; BITPOS,AC1 400005' 200 05 0 00 000001
ADDI AC5,176 ; BITPOS,176 400006' 271 05 0 00 000176
MOVE AC1,AC5 ; AC1,BITPOS 400007' 200 01 0 00 000005 0152
IDIVI AC1,44 ; AC1,44 400010' 231 01 0 00 000044
MOVE AC3,AC4 ; AC3,AC4 400011' 200 03 0 00 000004
ADD AC3,AC1 ; AC3,AC1 400012' 270 03 0 00 000001
MOVE AC1,AC5 ; AC1,BITPOS 400013' 200 01 0 00 000005
IDIVI AC1,44 ; AC1,44 400014' 231 01 0 00 000044
MOVE AC1,C.2 ; AC1,[POINT 18,0(AC3),35] <0,18> 400015' 200 01 0 00 400026'
DPB AC2,C.3 ; AC2,[POINT 6,AC1,5] <30,6> 400016' 137 02 0 00 400027'
MOVE AC5,-2(SP) ; AC5,ADDRESS 400017' 200 05 0 17 777776
DPB AC5,AC1 ; AC5,AC1 400020' 137 05 0 00 000001
ADDI AC0,1 ; PTRS,1 400021' 271 00 0 00 000001 0153
DPB AC0,C.1 ; PTRS,[POINT 4,1(AC4),35] <0,4> 400022' 137 00 0 00 400025'
POP SP,AC0 ; SP,AC0 400023' 262 17 0 00 000000 0104
POPJ SP, ; SP, 400024' 263 17 0 00 000000
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 6
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (3)
C.1: POINT 4,1(AC4),35 ; 4,1(AC4),35 400025' 00 04 0 04 000001
C.2: POINT 18,0(AC3),35 ; 18,0(AC3),35 400026' 00 22 0 03 000000
C.3: POINT 6,AC1,5 ; 6,AC1,5 400027' 36 06 0 00 000001
; Routine Size: 24 words
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 7
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (4)
; 0155 ROUTINE INIT_CHAIN (POINTER, SUB_TYPE, UPPER_BLOCK) : NOVALUE =
; 0156
; 0157 !++
; 0158 ! FUNCTIONAL DESCRIPTION:
; 0159 !
; 0160 ! INITIALIZE A CHAIN BLOCK
; 0161 !
; 0162 ! FORMAL PARAMETERS:
; 0163 !
; 0164 ! POINTER - POINTER TO THE CHAIN BLOCK TO BE INITIALIZED
; 0165 ! SUB_TYPE - TYPE OF BLOCK THAT THIS CHAIN BLOCK POINTS TO
; 0166 ! UPPER_BLOCK - POINTER TO THE BLOCK THAT POINTS TO THIS CHAIN BLOCK
; 0167 !
; 0168 ! IMPLICIT INPUTS:
; 0169 !
; 0170 ! NONE
; 0171 !
; 0172 ! IMPLICIT OUTPUTS:
; 0173 !
; 0174 ! NONE
; 0175 !
; 0176 ! ROUTINE VALUE:
; 0177 !
; 0178 ! NONE
; 0179 !
; 0180 ! SIDE EFFECTS
; 0181 !
; 0182 ! NONE
; 0183 !
; 0184 !--
; 0185
; 0186 BEGIN
; 0187
; 0188 MAP
; 0189 POINTER : REF CHAIN_BLOCK;
; 0190
; 0191 !
; 0192 POINTER [NUM_CHAIN_PTRS] = 0;
; 0193 POINTER [CHAIN_STYPE] = .SUB_TYPE;
; 0194 POINTER [CHAIN_BACK] = .UPPER_BLOCK;
; 0195 END;
INIT_CHAIN:
MOVE AC1,-3(SP) ; AC1,POINTER 400030' 200 01 0 17 777775 0192
MOVEI AC2,17 ; AC2,17 400031' 201 02 0 00 000017
ANDCAM AC2,1(AC1) ; AC2,1(AC1) 400032' 412 02 0 01 000001
MOVE AC2,-2(SP) ; AC2,SUB_TYPE 400033' 200 02 0 17 777776 0193
DPB AC2,C.4 ; AC2,[POINT 5,1(AC1),17] <18,5> 400034' 137 02 0 00 400040'
MOVE AC2,-1(SP) ; AC2,UPPER_BLOCK 400035' 200 02 0 17 777777 0194
HRRM AC2,2(AC1) ; AC2,2(AC1) 400036' 542 02 0 01 000002
POPJ SP, ; SP, 400037' 263 17 0 00 000000 0155
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 8
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (4)
C.4: POINT 5,1(AC1),17 ; 5,1(AC1),17 400040' 22 05 0 01 000001
; Routine Size: 9 words
; 0196
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 9
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (5)
; 0197 GLOBAL ROUTINE BLD_CHAIN (ROOT_BLOCK_PTR, FIRST_CHAIN, NEW_BLOCK) = !BUILD A CHAIN
; 0198
; 0199 !++
; 0200 ! FUNCTIONAL DESCRIPTION:
; 0201 !
; 0202 ! BLD_CHAIN APPENDS A POINTER TO A (POSSIBLY EMPTY) LIST
; 0203 ! OF POINTERS. THIS PERMITS A FIELD IN A BLOCK TO POINT
; 0204 ! TO A LOT OF OTHER BLOCKS. BLD_CHAIN WILL OBTAIN SPACE
; 0205 ! FROM THE FREE LIST IF NECESSARY TO HOLD THE POINTERS.
; 0206 !
; 0207 ! FORMAL PARAMETERS:
; 0208 !
; 0209 ! ROOT_BLOCK_PTR - BLOCK THAT POINTS
; 0210 ! FIRST_CHAIN - OLD CONTENTS OF POINTER CELL
; 0211 ! NEW_BLOCK - POINTER TO BE ADDED TO THE LIST
; 0212 !
; 0213 ! IMPLICIT INPUTS:
; 0214 !
; 0215 ! NONE
; 0216 !
; 0217 ! IMPLICIT OUTPUTS:
; 0218 !
; 0219 ! NONE
; 0220 !
; 0221 ! ROUTINE VALUE:
; 0222 !
; 0223 ! NEW CONTENTS OF POINTER CELL, OR 0 IF OUT OF STORAGE.
; 0224 !
; 0225 ! SIDE EFFECTS
; 0226 !
; 0227 ! MAY OBTAIN STORAGE FROM FREE STORAGE LIST
; 0228 !
; 0229 !--
; 0230
; 0231 BEGIN
; 0232
; 0233 BIND
; 0234 ROUTINE_NAME = UPLIT (%ASCIZ'BUILD_CHAIN');
; 0235
; 0236 LOCAL
; 0237 LAST_PTR : REF CHAIN_BLOCK,
; 0238 NEXT_PTR : REF CHAIN_BLOCK;
; 0239
; 0240 MAP
; 0241 FIRST_CHAIN : REF CHAIN_BLOCK,
; 0242 ROOT_BLOCK_PTR : REF ANY_BLOCK,
; 0243 NEW_BLOCK : REF ANY_BLOCK;
; 0244
; 0245 IF (.FIRST_CHAIN EQL 0)
; 0246 THEN
; 0247
; 0248 IF ((NEXT_PTR = GETBLK (CHAIN_TYP, CHAIN_LEN)) EQL 0)
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 10
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (5)
; 0249 THEN
; 0250 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
; 0251 ELSE
; 0252 BEGIN !NO OLD CHAIN AND WE HAVE STORAGE
; 0253 INIT_CHAIN (.NEXT_PTR, .NEW_BLOCK [ANY_TYPE], .ROOT_BLOCK_PTR);
; 0254 ADD_POINTER (.NEXT_PTR, .NEW_BLOCK);
; 0255 NEXT_PTR [CHAIN_NEXT] = .NEXT_PTR;
; 0256 NEXT_PTR [CHAIN_PREV] = .NEXT_PTR;
; 0257 .NEXT_PTR
; 0258 END
; 0259
; 0260 ELSE
; 0261 BEGIN !THERE IS ALREADY A CHAIN BLOCK
; 0262 LAST_PTR = .FIRST_CHAIN [CHAIN_PREV]; !POINT TO LAST CHAIN BLOCK
; 0263
; 0264 IF (.LAST_PTR [NUM_CHAIN_PTRS] LSS MAX_CHAIN_PTRS)
; 0265 THEN
; 0266 ADD_POINTER (.LAST_PTR, .NEW_BLOCK) !SIMPLE CASE
; 0267 ELSE
; 0268 BEGIN !LAST CHAIN BLOCK FULL, GET NEW ONE.
; 0269
; 0270 IF ((NEXT_PTR = GETBLK (CHAIN_TYP, CHAIN_LEN)) EQL 0)
; 0271 THEN
; 0272 ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
; 0273 ELSE
; 0274 BEGIN ! WE HAVE STORAGE
; 0275 INIT_CHAIN (.NEXT_PTR, .NEW_BLOCK [ANY_TYPE], .ROOT_BLOCK_PTR);
; 0276 ADD_POINTER (.NEXT_PTR, .NEW_BLOCK);
; 0277 NEXT_PTR [CHAIN_PREV] = .LAST_PTR;
; 0278 FIRST_CHAIN [CHAIN_PREV] = .NEXT_PTR;
; 0279 NEXT_PTR [CHAIN_NEXT] = .FIRST_CHAIN;
; 0280 LAST_PTR [CHAIN_NEXT] = .NEXT_PTR;
; 0281 END; ! OF HAVING STORAGE
; 0282
; 0283 END; ! OF NEEDING A NEW CHAIN BLOCK
; 0284
; 0285 .FIRST_CHAIN
; 0286 END ! OF ALREADY HAVE A CHAIN
; 0287 END; ! OF ROUTINE BLD_CHAIN
P.AAA: BYTE (7)"B","U","I","L","D" ; BUILD 400041' 102 125 111 114 104
BYTE (7)"_","C","H","A","I" ; _CHAI 400042' 137 103 110 101 111
BYTE (7)"N",000,000,000,000 ; N 400043' 116 000 000 000 000
ROUTINE_NAME= P.AAA ; 000000 400041'
BLD_CHAIN::
PUSH SP,AC0 ; SP,AC0 400044' 261 17 0 00 000000 0197
PUSH SP,AC10 ; SP,AC10 400045' 261 17 0 00 000010
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 11
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (5)
PUSH SP,AC11 ; SP,AC11 400046' 261 17 0 00 000011
PUSH SP,AC12 ; SP,AC12 400047' 261 17 0 00 000012
MOVE AC10,-6(SP) ; AC10,FIRST_CHAIN 400050' 200 10 0 17 777772 0245
JUMPN AC10,L.3 ; AC10,L.3 400051' 326 10 0 00 400112'
PUSH SP,C.8 ; SP,[2] 400052' 261 17 0 00 400174' 0248
PUSH SP,C.9 ; SP,[13] 400053' 261 17 0 00 400175'
PUSHJ SP,GETBLK ; SP,GETBLK 400054' 260 17 0 00 000000*
MOVE AC0,AC1 ; NEXT_PTR,AC1 400055' 200 00 0 00 000001
ADJSP SP,-2 ; SP,-2 400056' 105 17 0 00 777776
JUMPN AC0,L.1 ; NEXT_PTR,L.1 400057' 326 00 0 00 400072'
PUSH SP,C.10 ; SP,[0] 400060' 261 17 0 00 400176' 0250
PUSH SP,C.11 ; SP,[1] 400061' 261 17 0 00 400177'
PUSH SP,C.12 ; SP,[0,,ROUTINE_NAME] 400062' 261 17 0 00 400200'
PUSH SP,C.10 ; SP,[0] 400063' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400064' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400065' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400066' 261 17 0 00 400176'
PUSHJ SP,ERRMSG ; SP,ERRMSG 400067' 260 17 0 00 000000*
ADJSP SP,-4 ; SP,-4 400070' 105 17 0 00 777774
JRST L.2 ; L.2 400071' 254 00 0 00 400110' 0248
L.1: PUSH SP,AC0 ; SP,NEXT_PTR 400072' 261 17 0 00 000000 0253
MOVE AC11,-6(SP) ; AC11,NEW_BLOCK 400073' 200 11 0 17 777772
LDB AC1,C.5 ; AC1,[POINT 5,0(AC11),35] <0,5> 400074' 135 01 0 00 400171'
PUSH SP,AC1 ; SP,AC1 400075' 261 17 0 00 000001
PUSH SP,-11(SP) ; SP,ROOT_BLOCK_PTR 400076' 261 17 0 17 777767
PUSHJ SP,INIT_CHAIN ; SP,INIT_CHAIN 400077' 260 17 0 00 400030'
MOVEM AC0,-1(SP) ; NEXT_PTR,-1(SP) 400100' 202 00 0 17 777777 0254
MOVEM AC11,0(SP) ; AC11,0(SP) 400101' 202 11 0 17 000000
PUSHJ SP,ADD_POINTER ; SP,ADD_POINTER 400102' 260 17 0 00 400000'
MOVE AC1,AC0 ; AC1,NEXT_PTR 400103' 200 01 0 00 000000 0255
HRLM AC0,2(AC1) ; NEXT_PTR,2(AC1) 400104' 506 00 0 01 000002
MOVE AC1,AC0 ; AC1,NEXT_PTR 400105' 200 01 0 00 000000 0256
HRRM AC0,3(AC1) ; NEXT_PTR,3(AC1) 400106' 542 00 0 01 000003
MOVE AC1,AC0 ; AC1,NEXT_PTR 400107' 200 01 0 00 000000 0248
L.2: ADJSP SP,-1 ; SP,-1 400110' 105 17 0 00 777777
JRST L.8 ; L.8 400111' 254 00 0 00 400163' 0245
L.3: HRRZ AC11,3(AC10) ; LAST_PTR,3(AC10) 400112' 550 11 0 10 000003 0262
LDB AC1,C.6 ; AC1,[POINT 4,1(LAST_PTR),35] <0,4> 400113' 135 01 0 00 400172' 0264
CAIL AC1,17 ; AC1,17 400114' 301 01 0 00 000017
JRST L.4 ; L.4 400115' 254 00 0 00 400122'
PUSH SP,AC11 ; SP,LAST_PTR 400116' 261 17 0 00 000011 0266
PUSH SP,-6(SP) ; SP,NEW_BLOCK 400117' 261 17 0 17 777772
PUSHJ SP,ADD_POINTER ; SP,ADD_POINTER 400120' 260 17 0 00 400000'
JRST L.7 ; L.7 400121' 254 00 0 00 400162' 0264
L.4: PUSH SP,C.8 ; SP,[2] 400122' 261 17 0 00 400174' 0270
PUSH SP,C.9 ; SP,[13] 400123' 261 17 0 00 400175'
PUSHJ SP,GETBLK ; SP,GETBLK 400124' 260 17 0 00 000000*
MOVE AC0,AC1 ; NEXT_PTR,AC1 400125' 200 00 0 00 000001
ADJSP SP,-2 ; SP,-2 400126' 105 17 0 00 777776
JUMPN AC0,L.5 ; NEXT_PTR,L.5 400127' 326 00 0 00 400142'
PUSH SP,C.10 ; SP,[0] 400130' 261 17 0 00 400176' 0272
PUSH SP,C.11 ; SP,[1] 400131' 261 17 0 00 400177'
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 12
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (5)
PUSH SP,C.12 ; SP,[0,,ROUTINE_NAME] 400132' 261 17 0 00 400200'
PUSH SP,C.10 ; SP,[0] 400133' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400134' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400135' 261 17 0 00 400176'
PUSH SP,C.10 ; SP,[0] 400136' 261 17 0 00 400176'
PUSHJ SP,ERRMSG ; SP,ERRMSG 400137' 260 17 0 00 000000*
ADJSP SP,-4 ; SP,-4 400140' 105 17 0 00 777774
JRST L.6 ; L.6 400141' 254 00 0 00 400161' 0270
L.5: PUSH SP,AC0 ; SP,NEXT_PTR 400142' 261 17 0 00 000000 0275
MOVE AC12,-6(SP) ; AC12,NEW_BLOCK 400143' 200 12 0 17 777772
LDB AC1,C.7 ; AC1,[POINT 5,0(AC12),35] <0,5> 400144' 135 01 0 00 400173'
PUSH SP,AC1 ; SP,AC1 400145' 261 17 0 00 000001
PUSH SP,-11(SP) ; SP,ROOT_BLOCK_PTR 400146' 261 17 0 17 777767
PUSHJ SP,INIT_CHAIN ; SP,INIT_CHAIN 400147' 260 17 0 00 400030'
MOVEM AC0,-1(SP) ; NEXT_PTR,-1(SP) 400150' 202 00 0 17 777777 0276
MOVEM AC12,0(SP) ; AC12,0(SP) 400151' 202 12 0 17 000000
PUSHJ SP,ADD_POINTER ; SP,ADD_POINTER 400152' 260 17 0 00 400000'
MOVE AC1,AC0 ; AC1,NEXT_PTR 400153' 200 01 0 00 000000 0277
HRRM AC11,3(AC1) ; LAST_PTR,3(AC1) 400154' 542 11 0 01 000003
HRRM AC0,3(AC10) ; NEXT_PTR,3(AC10) 400155' 542 00 0 10 000003 0278
MOVE AC1,AC0 ; AC1,NEXT_PTR 400156' 200 01 0 00 000000 0279
HRLM AC10,2(AC1) ; AC10,2(AC1) 400157' 506 10 0 01 000002
HRLM AC0,2(AC11) ; NEXT_PTR,2(LAST_PTR) 400160' 506 00 0 11 000002 0280
L.6: ADJSP SP,-1 ; SP,-1 400161' 105 17 0 00 777777 0268
L.7: MOVE AC1,AC10 ; AC1,AC10 400162' 200 01 0 00 000010 0245
L.8: ADJSP SP,-2 ; SP,-2 400163' 105 17 0 00 777776 0231
POP SP,AC12 ; SP,AC12 400164' 262 17 0 00 000012 0197
POP SP,AC11 ; SP,AC11 400165' 262 17 0 00 000011
POP SP,AC10 ; SP,AC10 400166' 262 17 0 00 000010
POP SP,AC0 ; SP,AC0 400167' 262 17 0 00 000000
POPJ SP, ; SP, 400170' 263 17 0 00 000000
C.5: POINT 5,0(AC11),35 ; 5,0(AC11),35 400171' 00 05 0 11 000000
C.6: POINT 4,1(AC11),35 ; 4,1(LAST_PTR),35 400172' 00 04 0 11 000001
C.7: POINT 5,0(AC12),35 ; 5,0(AC12),35 400173' 00 05 0 12 000000
C.8: EXP 2 ; 2 400174' 000000 000002
C.9: EXP 13 ; 13 400175' 000000 000013
C.10: EXP 0 ; 0 400176' 000000 000000
C.11: EXP 1 ; 1 400177' 000000 000001
C.12: XWD 0,ROUTINE_NAME ; 0,ROUTINE_NAME 400200' 000000 400041'
; Routine Size: 93 words
; 0288
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 13
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (6)
; 0289 GLOBAL ROUTINE FND_CHAIN (CHAIN_PTR, SELECTOR, SELARG) = !FIND A BLOCK IN A CHAIN
; 0290
; 0291 !++
; 0292 ! FUNCTIONAL DESCRIPTION:
; 0293 !
; 0294 ! FND_CHAIN SEARCHES THE BLOCKS OF A CHAIN FOR THE FIRST
; 0295 ! ONE ACCEPTABLE TO THE SELECTOR SUBROUTINE.
; 0296 !
; 0297 ! FORMAL PARAMETERS:
; 0298 !
; 0299 ! CHAIN_PTR - POINTER TO THE INITIAL CHAIN BLOCK, OR 0 IF NONE.
; 0300 ! SELECTOR - SUBROUTINE TO SELECT A SUITABLE BLOCK
; 0301 ! SELARG - ARGUMENT TO GIVE TO SELECTOR SUBROUTINE
; 0302 !
; 0303 ! IMPLICIT INPUTS:
; 0304 !
; 0305 ! NONE
; 0306 !
; 0307 ! IMPLICIT OUTPUTS:
; 0308 !
; 0309 ! NONE
; 0310 !
; 0311 ! ROUTINE VALUE:
; 0312 !
; 0313 ! 0 IF NO CHAIN BLOCKS OR NONE ARE ACCEPTABLE TO THE
; 0314 ! SELECTOR SUBROUTINE. OTHERWISE THE VALUE RETURNED
; 0315 ! IS THE NON-ZERO VALUE RETURNED BY THE SELECTOR
; 0316 ! SUBROUTINE WHEN FIRST PRESENTED WITH AN ACCEPTABLE
; 0317 ! BLOCK.
; 0318 !
; 0319 ! SIDE EFFECTS
; 0320 !
; 0321 ! THE SELECTOR SUBROUTINE MAY HAVE SIDE EFFECTS.
; 0322 !
; 0323 !--
; 0324
; 0325 BEGIN
; 0326
; 0327 STRUCTURE
; 0328 POINTERS [LOCN] =
; 0329 (POINTERS + (LOCN/%BPVAL))<(LOCN MOD %BPVAL), %BPADDR>;
; 0330
; 0331 LOCAL
; 0332 BIT_POSITION,
; 0333 SBRVAL,
; 0334 CHAINP : REF CHAIN_BLOCK,
; 0335 NCP,
; 0336 CPINX,
; 0337 BLOCKP : REF ANY_BLOCK;
; 0338
; 0339 !
; 0340
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 14
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (6)
; 0341 IF ((CHAINP = .CHAIN_PTR) EQL 0)
; 0342 THEN
; 0343 0
; 0344 ELSE
; 0345 BEGIN
; 0346 !
; 0347
; 0348 DO
; 0349 BEGIN
; 0350 NCP = .CHAINP [NUM_CHAIN_PTRS];
; 0351 CPINX = 0;
; 0352
; 0353 DO
; 0354 BEGIN
; 0355 BIT_POSITION = ((%FIELDEXPAND (CHAIN_PTRS, 0)*%BPVAL) + %FIELDEXPAND (CHAIN_PTRS, 1)) + (
; 0356 .CPINX*%BPADDR);
; 0357 BLOCKP = .POINTERS [.CHAINP, .BIT_POSITION];
; 0358 SBRVAL = (.SELECTOR) (.BLOCKP, .SELARG);
; 0359 CPINX = .CPINX + 1;
; 0360 END
; 0361 UNTIL ((.CPINX EQL .NCP) OR (.SBRVAL NEQ 0));
; 0362
; 0363 CHAINP = .CHAINP [CHAIN_NEXT];
; 0364 END
; 0365 UNTIL ((.CHAINP EQL .CHAIN_PTR) OR (.SBRVAL NEQ 0));
; 0366
; 0367 .SBRVAL
; 0368 END
; 0369
; 0370 END; ! OF ROUTINE FND_CHAIN
FND_CHAIN::
PUSH SP,AC0 ; SP,AC0 400201' 261 17 0 00 000000 0289
PUSH SP,AC10 ; SP,AC10 400202' 261 17 0 00 000010
PUSH SP,AC11 ; SP,AC11 400203' 261 17 0 00 000011
PUSH SP,AC12 ; SP,AC12 400204' 261 17 0 00 000012
PUSH SP,AC13 ; SP,AC13 400205' 261 17 0 00 000013
PUSH SP,AC14 ; SP,AC14 400206' 261 17 0 00 000014
MOVE AC10,-11(SP) ; CHAINP,CHAIN_PTR 400207' 200 10 0 17 777767 0341
JUMPN AC10,L.9 ; CHAINP,L.9 400210' 326 10 0 00 400213'
SETZ AC1, ; AC1, 400211' 400 01 0 00 000000
JRST L.11 ; L.11 400212' 254 00 0 00 400250'
L.9: LDB AC13,C.13 ; NCP,[POINT 4,1(CHAINP),35] <0,4> 400213' 135 13 0 00 400257' 0350
SETZ AC11, ; CPINX, 400214' 400 11 0 00 000000 0351
L.10: MOVE AC1,AC11 ; AC1,CPINX 400215' 200 01 0 00 000011 0355
IMULI AC1,22 ; AC1,22 400216' 221 01 0 00 000022
MOVE AC12,AC1 ; BIT_POSITION,AC1 400217' 200 12 0 00 000001
ADDI AC12,176 ; BIT_POSITION,176 400220' 271 12 0 00 000176
MOVE AC1,AC12 ; AC1,BIT_POSITION 400221' 200 01 0 00 000012 0357
IDIVI AC1,44 ; AC1,44 400222' 231 01 0 00 000044
MOVE AC3,AC10 ; AC3,CHAINP 400223' 200 03 0 00 000010
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 15
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (6)
ADD AC3,AC1 ; AC3,AC1 400224' 270 03 0 00 000001
MOVE AC1,AC12 ; AC1,BIT_POSITION 400225' 200 01 0 00 000012
IDIVI AC1,44 ; AC1,44 400226' 231 01 0 00 000044
MOVE AC1,C.2 ; AC1,[POINT 18,0(AC3),35] <0,18> 400227' 200 01 0 00 400026'
DPB AC2,C.3 ; AC2,[POINT 6,AC1,5] <30,6> 400230' 137 02 0 00 400027'
LDB AC14,AC1 ; BLOCKP,AC1 400231' 135 14 0 00 000001
MOVE AC0,-10(SP) ; AC0,SELECTOR 400232' 200 00 0 17 777770 0358
PUSH SP,AC14 ; SP,BLOCKP 400233' 261 17 0 00 000014
PUSH SP,-10(SP) ; SP,SELARG 400234' 261 17 0 17 777770
MOVE AC1,AC0 ; AC1,AC0 400235' 200 01 0 00 000000
PUSHJ SP,0(AC1) ; SP,0(AC1) 400236' 260 17 0 01 000000
MOVE AC4,AC1 ; SBRVAL,AC1 400237' 200 04 0 00 000001
ADDI AC11,1 ; CPINX,1 400240' 271 11 0 00 000001 0359
ADJSP SP,-2 ; SP,-2 400241' 105 17 0 00 777776 0354
CAME AC11,AC13 ; CPINX,NCP 400242' 312 11 0 00 000013 0361
JUMPE AC4,L.10 ; SBRVAL,L.10 400243' 322 04 0 00 400215'
HLRZ AC10,2(AC10) ; CHAINP,2(CHAINP) 400244' 554 10 0 10 000002 0363
CAME AC10,-11(SP) ; CHAINP,CHAIN_PTR 400245' 312 10 0 17 777767 0365
JUMPE AC4,L.9 ; SBRVAL,L.9 400246' 322 04 0 00 400213'
MOVE AC1,AC4 ; AC1,SBRVAL 400247' 200 01 0 00 000004 0341
L.11: POP SP,AC14 ; SP,AC14 400250' 262 17 0 00 000014 0289
POP SP,AC13 ; SP,AC13 400251' 262 17 0 00 000013
POP SP,AC12 ; SP,AC12 400252' 262 17 0 00 000012
POP SP,AC11 ; SP,AC11 400253' 262 17 0 00 000011
POP SP,AC10 ; SP,AC10 400254' 262 17 0 00 000010
POP SP,AC0 ; SP,AC0 400255' 262 17 0 00 000000
POPJ SP, ; SP, 400256' 263 17 0 00 000000
C.13: POINT 4,1(AC10),35 ; 4,1(CHAINP),35 400257' 00 04 0 10 000001
; Routine Size: 47 words
; 0371
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 16
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (7)
; 0372 GLOBAL ROUTINE DEL_PTRS (CHAIN_PTR) : NOVALUE = !DELETE CHAIN BLOCKS
; 0373
; 0374 !++
; 0375 ! FUNCTIONAL DESCRIPTION:
; 0376 !
; 0377 ! FREE MEMORY HELD FOR CHAIN BLOCKS.
; 0378 !
; 0379 ! FORMAL PARAMETERS:
; 0380 !
; 0381 ! CHAIN_PTR - ADDRESS OF FIRST CHAIN BLOCK
; 0382 !
; 0383 ! IMPLICIT INPUTS:
; 0384 !
; 0385 ! NONE
; 0386 !
; 0387 ! IMPLICIT OUTPUTS:
; 0388 !
; 0389 ! NONE
; 0390 !
; 0391 ! ROUTINE VALUE:
; 0392 !
; 0393 ! NONE
; 0394 !
; 0395 ! SIDE EFFECTS:
; 0396 !
; 0397 ! SOME MEMORY MAY BE RETURNED TO THE FREE POOL
; 0398 !
; 0399 !--
; 0400
; 0401 BEGIN
; 0402
; 0403 LOCAL
; 0404 CHAINP : REF CHAIN_BLOCK,
; 0405 NEXT_BLOCK;
; 0406
; 0407 IF ((CHAINP = .CHAIN_PTR) NEQ 0)
; 0408 THEN
; 0409 BEGIN
; 0410
; 0411 DO
; 0412 BEGIN
; 0413 NEXT_BLOCK = .CHAINP [CHAIN_NEXT];
; 0414 FREBLK (.CHAINP);
; 0415 CHAINP = .NEXT_BLOCK;
; 0416 END
; 0417 UNTIL (.CHAINP EQL .CHAIN_PTR)
; 0418
; 0419 END;
; 0420
; 0421 END; !OF DEL_PTRS
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 17
X2.0 1-Jan-1983 14:53:51 NETPKG:<VNP36>PCHN.BLI.7 (7)
DEL_PTRS::
PUSH SP,AC0 ; SP,AC0 400260' 261 17 0 00 000000 0372
PUSH SP,AC10 ; SP,AC10 400261' 261 17 0 00 000010
MOVE AC10,-3(SP) ; CHAINP,CHAIN_PTR 400262' 200 10 0 17 777775 0407
JUMPE AC10,L.13 ; CHAINP,L.13 400263' 322 10 0 00 400273'
L.12: HLRZ AC0,2(AC10) ; NEXT_BLOCK,2(CHAINP) 400264' 554 00 0 10 000002 0413
PUSH SP,AC10 ; SP,CHAINP 400265' 261 17 0 00 000010 0414
PUSHJ SP,FREBLK ; SP,FREBLK 400266' 260 17 0 00 000000*
MOVE AC10,AC0 ; CHAINP,NEXT_BLOCK 400267' 200 10 0 00 000000 0415
ADJSP SP,-1 ; SP,-1 400270' 105 17 0 00 777777 0412
CAME AC10,-3(SP) ; CHAINP,CHAIN_PTR 400271' 312 10 0 17 777775 0417
JRST L.12 ; L.12 400272' 254 00 0 00 400264' 0409
L.13: POP SP,AC10 ; SP,AC10 400273' 262 17 0 00 000010 0372
POP SP,AC0 ; SP,AC0 400274' 262 17 0 00 000000
POPJ SP, ; SP, 400275' 263 17 0 00 000000
; Routine Size: 14 words
; 0422
; 0423 END
; 0424
; 0425 ELUDOM
END
; Low segment length: 0 words
; High segment length: 190 words
; LIBRARY STATISTICS
;
; -------- Symbols -------- Blocks
; File Total Loaded Percent Read
;
; NETPKG:<VNP36>VNPLIB.L36.6 498 18 3 0
; 0426 ! Local Modes:
; 0427 ! Comment Start:!
; 0428 ! Comment Column:36
; 0429 ! Auto Save Mode:2
; 0430 ! Mode:Fundamental
; 0431 ! END:
; Size: 187 code + 3 data words
PCHN 25-Jan-1983 10:16:42 TOPS-20 Bliss-36 2A(142) Page 18
X2.0
; Run Time: 00:03.8
; Elapsed Time: 00:13.1
; Memory Used: 18 pages
; Compilation Complete
ADDRESS 104 152
ADD_POINTER 67 104* 254 266 276
ANY_BLOCK 242 243 337
ANY_TYPE 253 275
BITPOS 140 151# 152
BIT_POSITION 332 355# 357
BLD_CHAIN 69 197*
BLOCKP 337 357# 358
CHAINP 334 341# 350 357 363# 365 404 407# 413 414 415# 417
CHAIN_BACK 194
CHAIN_BLOCK 143 189 237 238 241 334 404
CHAIN_LEN 248 270
CHAIN_NEXT 255 279 280 363 413
CHAIN_PREV 256 262 277 278
CHAIN_PTR 289 341 365 372 407 417
CHAIN_PTRS 151 355
CHAIN_STYPE 193
CHAIN_TYP 248 270
CPINX 336 351# 356 359# 361
DEL_PTRS 71 372*
ERRMSG 100* 250 272
FIRST_CHAIN 197 241 245 262 278# 279 285
FND_CHAIN 70 289*
FREBLK 102 414
GETBLK 101 248 270
INIT_CHAIN 68 155* 253 275
LAST_PTR 237 262# 264 266 277 280#
LOCN 146 147 328 329
MAX_CHAIN_PTRS 264
NCP 335 350# 361
NEW_BLOCK 197 243 253 254 266 275 276
NEXT_BLOCK 405 413# 415
NEXT_PTR 238 248# 253 254 255# 256# 257 270# 275 276 277# 278
279# 280
NUM_CHAIN_PTRS 150 153 192 264 350
PCHN 2#
POINTER 104 143 150 152 153# 155 189 192# 193# 194#
POINTERS 146# 147 152# 328# 329 357
PTRS 139 150# 151 153
ROOT_BLOCK_PTR 197 242 253 275
ROUTINE_NAME 234# 250 272
SBRVAL 333 358# 361 365 367
SELARG 289 358
SELECTOR 289 358
SUB_TYPE 155 193
UPPER_BLOCK 155 194