K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20UNV MAC 20-Aug-24 22:37 Kermit program definitions 1 Universal K20UNV - Kermit-20 Universal Symbols and Macros 2 3 search monsym ; Wants things for NTINF% 4 search macsym ; Needs FLD, MASK, Etc. 5 search cmd ; Also cmd 6 remark Can't do the .nobin; confuses COMPIL (I.E., the EXEC) 7 ; .directive .nobin ; Doesn't need a .REL file 8 9 ; Moved symbols and macros here from main module as part of 194 10 11 subttl Kermit program definitions 12 13 000310 pdlsiz==^d200 ; Stack size, be generous. 14 000024 takel==^d20 ;[78] TAKE command JFN stack size. 15 16 ; N.B., Be careful about the aliases done here and Kermit's regular 17 ; register usage. Also, be VERY aware that p5 aliases ac15, 18 ; which macsym uses as the frame pointer for Bliss subroutine calls 19 ; asubr's and transient variables. Stack vars and block. context 20 ; are uneffected 21 22 define cmdacs < ;;Have to clean up cmd accumulator polution 23 if1 < ifdef p1, ;;CMD should be compiled seperately 24 ifdef p2, 25 ifdef p3, 26 ifdef p4, 27 ifdef p5, 28 >;;if1 29 p1==q5 ;;p1 aliases q5 and state 30 p2==p1+1 ;;p2 alias rchr 31 p3==p2+1 ;;p3 alias schr 32 p4==p3+1 ;;p4 alias debug 33 p5==p4+1 ;;p5 alias FP!!! 34 ifndef cx, ;;Occasional control linkage 35 >;;cmdacs 36 37 ; Don't let values confuse DDT (or me) 38 000000 f==0 ; AC definitions: flag AC (not used), 39 000004 t4==+1>+1>+1 ; temporary AC's, (Contiguous) 40 000010 q4==+1>+1>+1 ; and preserved AC's. (Contiguous) 41 000005 t5==q1 ;[186] Alias a temporary for double arithmatic 42 43 000011 state==q4+1 ; State of the automaton. 44 000011 q5==state ;[211] Can also CAREFULLY use 45 ;[211] q5 aliases state AND p1 46 cmdacs ^ ;;Clean up for our definitions 47 000012 rchr==state+1 ; Total file characters received. 48 000013 schr==rchr+1 ; Total file characters sent. 49 000014 debug==schr+1 ;[22] Debugging (0=none, 1=states, 2=packets) 50 51 000001 SOH==^o001 ; ASCII Start of header character. 52 000021 XON==^o021 ; XON is defined to be Control-Q (ASCII DC1). 53 024000 MAXBUF==^d10240 ; Packet buffer size [179] 54 000136 MAXPKT==^d94 ; Packet buffer size [179] 55 022000 IOBUF==^d9216 ; Communications i/o buffer [180] [216] (9K) K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-1 K20UNV MAC 20-Aug-24 22:37 Kermit program definitions 56 ;[216] Enough for 9,000 character packet 57 000140 maxpkt=="~"-" "+2 ; Maximum size of a packet. 58 000005 dmxtry==5 ; Default number of retries on a packet. 59 000020 dimxtr==20 ; Default number of retries send initiate. 60 000120 drpsiz==^d80 ; Default receive packet size. 61 000120 dspsiz==^d80 ; Default send packet size. 62 000012 spmin==^d10 ;[47] Minimum size packet we want to send. 63 021450 spmax==^d9000 ;[47] Maximum ... 64 017500 dstim==^d<8*1000> ;[212] ms ; Default send time out interval. 65 204400 000000 dstimf==8.0 ;[212] fl ; Same value as floating seconds 66 031310 drtim==^d<13*1000> ;[212] ms ;[128] Default receive time out interval. 67 204640 000000 drtimf==13.0 ;[212] fl ; Same value as floating seconds 68 072460 dsrvtm==^d<30*1000> ;[212] ms ;[20] Def timout when awaiting server commands. 69 205740 000000 dsrvtf==30.0 ;[212] fl ; Same value as floating seconds 70 000000 drpaus==0 ;[212] ms ;[36] Default pause before ACKing packets. 71 000000 drpauf==0.0 ;[212] fl ;[35] Default pause before ACKing packets. 72 000000 dspaus==0 ;[212] ms ;[36] Default pause before sending packets. 73 000000 dspauf==0.0 ;[212] fl ;[36] Default pause before sending packets. 74 000000 dspad==^o0 ; Default send padding char. 75 000000 drpad==^d0 ; Default receive padding char. 76 000000 drpadn==^d0 ; Default number of receive padding chars. 77 000000 dspadn==^d0 ; Default number of send padding chars. 78 002000 dpadmx==^d1024 ;[223] Maximum number of padding chars we'll do 79 000015 dseol==.chcrt ; Default send EOL char. 80 000015 dreol==.chcrt ; Default receive EOL char. 81 000043 dsquot=="#" ; Default outbound control prefix. 82 000043 drquot=="#" ; Default incoming control prefix. 83 000046 dqbin=="&" ; Default 8th-bit prefix. 84 000176 drept=="~" ; Default repeat count prefix. 85 011610 ddelay==^d5000 ;[212] ms ; Default delay before the first packet, msecs. 86 203500 000000 ddelaf==5.0 ;[212] fl ;[194] Same as floating seconds (must give character) 87 000000 dxfull==0 ;[18] Full duplex. 88 000001 dxhalf==1 ;[18] Half duplex. 89 000034 defesc==34 ; Default CONNECT escape character is ^\. 90 777777 777777 defits==-1 ;[75] Handle ITS binary files by default. 91 000000 defics==0 ;[160] Default case search for INPUT commands. 92 000000 defita==0 ;[160] Default timeout action for INPUTs. 93 011610 defito==^d<5*1000> ;[212] ms ;[160] Default timeout interval for INPUTs. 94 203500 000000 defitf==5.0 ;[212] fl ;[194] Same value as floating point (as character) 95 267460 maxtim=^d<94*1000> ;[212] ms ;[2] Maximum timeout interval to set, secs. 96 203400 000000 minlod=4.0 ;[2] Minimum ldav to consider for timeout. 97 206620 000000 maxlod=50.0 ;[2] Maximum ldav to consider for timeout. 98 COMMENT " ;[277] Variable sized Blips now 99 blip=^d5 ;[4] Every this many packets, print a blip. 100 101 " ;[277] 102 000005 dblip==^d5 ;[277] We do, however, have default blips 103 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20UNV MAC 20-Aug-24 22:37 Definitions for Macro table remediation 104 subttl Definitions for Macro table remediation 105 106 ; All part of 203. There are the beginnings of a macro editor, but 107 ; for this release, development was stopped after the storage issues 108 ; were fixed. 109 ; 110 ; The design of the macro editor is largely complete, but the 111 ; implementation of SET commands that have third (and fourth) level 112 ; selections is not. Briefly, everything parses, but to split things 113 ; up, you have to handle the guide words, which may not be 114 ; straightforward. 115 ; 116 ; The code is currently off. Define the symbol EDTMAC to cause it to 117 ; be part of the executable. And understand that you will have some 118 ; coding to do. 119 ; 120 ; EDTMAC==:1 ; Assemble (incomplete) macro editor 121 122 define emacro (stuff) < ;;If have macro editor code 123 ifdef EDTMAC, < 124 'stuff 125 >> 126 127 define nmacro (stuff) < ;;If DON'T have macro editor code 128 ifndef EDTMAC, < 129 'stuff 130 >> 131 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20UNV MAC 20-Aug-24 22:37 FATAL Assembly errors 132 subttl FATAL Assembly errors 133 134 ; Fatal assembly error macro. It would have been nice if MACRO had 135 ; something like an .ERROR statement. Like ...MASM... 136 137 define .fatal (message) < 138 pass2 139 printx ?'message 140 end 141 >;;define .fatal 142 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20UNV MAC 20-Aug-24 22:37 Handy macros for address conversion 143 SUBTTL Handy macros for address conversion 144 145 ; Lifted from Extended Mode FTP Server rewrite 146 147 148 REMARK Convert between 30 bit addresses and 21 bit page numbers 149 150 000011 pgshft==:^D9 ; Shift for page/address conversion 151 152 define pg2adr (r,a) < ;; 21 bit page number 153 ifb ,<.fatal No register specified> 154 ifnb ,<.fatal 'a can only cast values in registers> 155 ifg r-^o16,<.fatal register 'r is out of bounds> 156 lsh r,pgshft ;; Convert page to address 157 > 158 159 define adr2pg (r,a) < ;; 30 bit address 160 ifb ,<.fatal No register specified> 161 ifnb ,<.fatal 'addr can only convert values in registers> 162 ifg r-^o16,<.fatal Register 'r is out of bounds> 163 lsh r,-pgshft ;; Convert address to page 164 > 165 166 REMARK Convert between 21 bit page numbers and 12 bit section numbers 167 168 000011 secsft==:^D9 ; Shift for section/page conversion 169 170 define sec2pg (r,a) < ;; 12 bit section number 171 ifb ,<.fatal No register specified> 172 ifnb ,<.fatal 'a Can only cast values in registers> 173 ifg r-^o16,<.fatal Register 'r is out of bounds> 174 lsh r,secsft ;; Convert section to page 175 > 176 177 define pg2sec (r,a) < ;; 21 bit page number 178 ifb ,<.fatal No register specified> 179 ifnb ,<.fatal 'a Can only convert values in registers> 180 ifg r-^o16,<.fatal Register 'r is out of bounds> 181 lsh r,-secsft ;; Convert page to section 182 > 183 184 REMARK Convert between 30 bit addresses and 12 bit section numbers 185 186 define sc2adr (r,a) < ;; 12 bit sction number 187 ifb ,<.fatal No register specified> 188 ifnb ,<.fatal 'a Can only cast values in registers> 189 ifg r-^o16,<.fatal Register 'r is out of bounds> 190 hrlz r,r ;; Convert section number to address 191 > 192 193 define adr2sc (r,a) < ;; 30 bit address 194 ifb ,<.fatal No register specified> 195 ifnb ,<.fatal 'a Can only convert values in registers> 196 ifg r-^o16,<.fatal Register 'r is out of bounds> 197 hlrz r,r ;; Convert address to section number K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4-1 K20UNV MAC 20-Aug-24 22:37 Handy macros for address conversion 198 > K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20UNV MAC 20-Aug-24 22:37 Clean symbol artifacts up 199 subttl Clean symbol artifacts up 200 201 define cleans(s) < ;;Clean up symbols we won't need 202 irp s,< ;;Do all this for each and every symbol 203 ifdef s,< ;;Nothing to clean up if not defined 204 .xcref s ;;Don't want symbol in cross reference 205 .ifn s,macro,< ;;If not a macro, do some other clean up 206 .noddt s ;;Don't need symbol in DDT 207 suppress s ;;Don't want symbol in symbol table listing 208 >;;.ifn 209 if2 < purge s > ;;After second pass, don't need symbol 210 >;;ifdef 211 >;;irp 212 >;;cleans 213 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20UNV MAC 20-Aug-24 22:37 .PSECT switching 214 subttl .PSECT switching 215 216 ; Cuts down on typing because we aggressively use .PSECT's 217 ; 218 ; N.B., Does not nest like ifskp./else./endif. do. 219 220 define chgsec(f,t) < ;;From and To .PSECT's 221 .endps 'f ;;Get out of the From .PSECT 222 .psect 't ;;Get into To .PSECT 223 define retsec < ;;Define remote macro to put things back 224 .endps 't ;;Done with To .PSECT 225 .psect 'f ;;Get back into From .PSECT 226 >;;retsec 227 >;;chgsec 228 229 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20UNV MAC 20-Aug-24 22:37 Parity Types (actually table offsets) 230 subttl Parity Types (actually table offsets) 231 232 000000 .parno==0 ; None 233 000001 .parsp==1 ; Space, bit 8 is zero, always 234 000002 .parmk==2 ; Mark, bit 8 is one, always 235 000003 .parev==3 ; Even parity 236 000004 .parod==4 ; Odd parity 237 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20UNV MAC 20-Aug-24 22:37 Various MACRO sizings 238 subttl Various MACRO sizings 239 240 ; The total macro table size is driven off the number of macros we can 241 ; handle in the TBLUK% table and its associated string storage. We 242 ; make some assumptions here that may or may not actually be true. 243 ; These are, 244 ; 245 ; 1) A macro name (which is really 'only' a TBLUK% keyword) is 246 ; rarely going over 10 characters (or two PDP-10 words) *AND* 247 ; 248 ; 2) Its expansion is rarely over 90 characters (or 18 words). 249 ; 250 ; If the numbers turn out to be wrong, they are easily changed. 251 ; The MACROS .PSECT is then sized from the lengths calculated here. 252 ; 253 ; However, the number of macros was simply picked by what would fit 254 ; in seven pages of memory. 255 256 000252 macmax==^d170 ;[203] ;[77] Maximum number of macros. 257 000524 mnblen==^d2*macmax ;[203] ;[77] Macro name buffer length in words (10 chars) 258 005764 mtblen==^d18*macmax ;[203] ;[77] Macro text buffer length in words (90 chars) 259 260 000000 macslp==0 ;[203] ; Initially no slop 261 262 define adslop (n) < ;;[203] ; Add n to slop 263 macslp==macslp+n ;;[203] ; Accumulate the extra words of slop 264 .xcref macslp ;;[203] ; Still don't need this 265 >;;adslop 266 267 adslop(1)^ ;;[203] ; mactab TBLUK% header word 268 adslop(1)^ ;;[203] ; mactbx end of mactab 269 adslop(1)^ ;;[203] ; macbp 270 adslop(1)^ ;;[203] ; ibmkey 271 adslop(11)^ ;;[203] ; ibmmac (macro body) [octal] 272 adslop(1)^ ;;[203] ; macx 273 274 007000 mactmp==macslp+macmax+mnblen+mtblen ;[203] Minimum length in words 275 000007 macpgs== ;[203] Minimum number of pages 276 ifn , ;[203] Round up if not on a page boundar 277 000007 gcpgs==macpgs ;[203] Garbage collection is same size 278 emacro < edpgs==macpgs > ^;[203] As is the macro editing area 279 007000 maclen==macpgs*1000 ;[203] Now have length in words 280 281 cleans()^ ;[203] Don't need temporary after second pass 282 283 000003 defbrk==3 ; Default number of breaks. 284 000100 maxnul==100 ; Maximum number of nulls. 285 286 000050 maxnam==^d40 ; Maximum characters in a system name 287 000011 syslen==<+1> ; Number of words in name block 288 289 000031 MXPKTW==<+1> ; Maximum packet size in words 290 001000 strblw==1000 ;[209] String buffer length in words 291 005000 strblc==1000*5 ;[209] Same value in ASCII characters 292 004000 strbl8==1000*4 ;[263] Same value when doing eight bit bytes K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-1 K20UNV MAC 20-Aug-24 22:37 Various MACRO sizings 293 294 ifl ,<.fatal Maximum password will exceed packet length> 295 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20UNV MAC 20-Aug-24 22:37 Various MACRO sizings 296 remark Various maximums for files and directories 297 298 ; Assume following would only include the ;t attribute 299 ; device:name.type.generation;attributes 300 301 000210 mxfilc==^d<6+1+1+39+1+39+1+39+1+6+1+1> ; Maximum Tops-20 file path in characters 302 000034 mxfilw==+1 ; Same thing in words 303 304 000061 dirmxc==^d<6+1+1+39+1+1> ; Maximum Tops-20 directory characters (+ .chnul) 305 000012 dirmxw==<+1> ; Same constant in words 306 307 000047 mxpwlc==^d39 ; Maximum size password Tops-20 will allow 308 000010 mxpwlw==^d<+1> ; Maximum storage required 309 310 ; These MUST match CMDSTG, which does not declare the symbols 311 ; so that MACRO can use them to allocate static storage, sigh... 312 313 000740 fdrmxc==<^d80*6> ; Foreign Directory Maximum size in characters 314 000141 fdrmxw==+1 ; Same size in words, plus slop 315 316 000740 fpwmxc==fdrmxc ; Foreign maximum password size in characters 317 000141 fpwmxw==fdrmxw ; Size size in words, plus slop 318 319 ; Some characters that would be nice in MACSYM ... 320 321 000042 .chdbq==42 ; Double quote 322 000047 .chsnq==47 ; Single quote (or apostrophe) 323 000050 .chlpa==50 ; Left parenthesis 324 000051 .chrpa==51 ; Right parenthesis 325 000074 .chlpt==74 ; Left pointy bracket 326 000076 .chrpt==76 ; Right pointy bracket 327 000136 .chupa==136 ; Up arrow 328 K20UNV - Kermit-20 Universal Symbols and Macros MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20UNV MAC 20-Aug-24 22:37 Tops-20 Monitor Definitions and extensions 329 subttl Tops-20 Monitor Definitions and extensions 330 331 ;[129] ARPA definitions (may not be in MONSYM) 332 333 ifndef STAT%, ; So this will assemble 334 ifndef TCP%NT, ; without symbols from BBN TCP monitor. 335 336 ;TELNET negotiation options if not running a PANDA monitor 337 338 000377 iac==377 ; arpanet telnet IAC 339 000373 will==373 ; telnet will ,hsfdb2 9298 000350'02 000000000000# 9299 000351'02 44 07 0 00 002237' 9300 000352'02 44 07 0 00 002242' 9301 000353'02 000006 000000 hsfdb2: flddb. .cmkey,,sethlp,, 9302 000354'02 000000000000# 9303 000355'02 44 07 0 00 002244' 9304 000356'02 44 07 0 00 002242' 9305 9306 cleans() 9307 9308 ;[214] Begin table and linkage definitions 9309 9310 ; Commands which require additional sub-commands or more granular help 9311 ; can be dealt with by: 9312 ; 9313 ; 1) Creating an additional entry in the sub-help (subhlp) table 9314 ; with the hclip macro. 9315 ; 2) Creating function descriptor block with pointers to the 9316 ; default help and to individual help text keyword (or switch) 9317 ; tables. 9318 ; 3) The parse tables for individual help are then created in 9319 ; k20hlp. 9320 ; 4) Wonderfully informative help text is written. 9321 ; [That's the goal, anyway] 9322 ; 9323 ; The block. statement with the nested do. functions conceptually as a 9324 ; kind of a cross between a switch statement and a skip chain yet 9325 ; effectively executes as a skip chain. The efficiency of this linear 9326 ; approach may need to be revisited if we create a lot of multi-level 9327 ; help (Tops-10 Kermit does this) 9328 9329 000357'02 010004 000362' $hdefi: flddb. .cmcfm,,,,,$hdef1 9330 000360'02 000000 000000 9331 000361'02 44 07 0 00 002247' 9332 000362'02 003004 000000 $hdef1: flddb. .cmswi,,defhlp##,,, 9333 000363'02 000000000000# 9334 000364'02 44 07 0 00 002255' 9335 9336 000365'02 010004 000370' $hclea: flddb. .cmcfm,,,,,$hcle1 9337 000366'02 000000 000000 9338 000367'02 44 07 0 00 002261' 9339 000370'02 003004 000000 $hcle1: flddb. .cmswi,,clrhlp##,,, 9340 000371'02 000000000000# 9341 000372'02 44 07 0 00 002267' 9342 9343 000373'02 010004 000376' $hloca: flddb. .cmcfm,,,,,$hloc1 9344 000374'02 000000 000000 9345 000375'02 44 07 0 00 002273' 9346 000376'02 000004 000000 $hloc1: flddb. .cmkey,,lclhlp##,,, k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20PAR MAC 20-Aug-24 23:12 HELP command parsing 9347 000377'02 000000000000# 9348 000400'02 44 07 0 00 002301' 9349 9350 000401'02 010004 000404' $hremo: flddb. .cmcfm,,,,,$hrem1 9351 000402'02 000000 000000 9352 000403'02 44 07 0 00 002305' 9353 000404'02 000004 000000 $hrem1: flddb. .cmkey,,remhlp##,,, 9354 000405'02 000000000000# 9355 000406'02 44 07 0 00 002313' 9356 9357 000407'02 010004 000412' $htime: flddb. .cmcfm,,,,,$htim1 9358 000410'02 000000 000000 9359 000411'02 44 07 0 00 002317' 9360 000412'02 003004 000000 $htim1: flddb. .cmswi,,timhlp##,,, 9361 000413'02 000000000000# 9362 000414'02 44 07 0 00 002325' 9363 9364 cleans(<$hdef1,$hcle1,$hloc1,$hrem1,$htim1>) 9365 9366 ; N.B., Although most help text resides in section one, the TBLUK% 9367 ; table only stores 18 bit addresses. Therefore, we must clip the 9368 ; section number or LINK will remind us that it is doing it for us. 9369 ; 9370 ; Such action may or may not be desired. In our case, it is 9371 ; exactly what we want, so we clip the address here to keep from 9372 ; constantly seeing LINK's advisory messages. 9373 9374 define hclip (hbase,%hb,%fb) < ;;All 214, used to add secondary help 9375 extern hbase ;;All should be found in k20hlp, section 1 9376 %hb==<<'hbase>&.rhalf> ;;Clip down to 18 bits (we know the section) 9377 %fb==<<$'hbase>&.rhalf> ;;Clip down to 18 bits (we know the section) 9378 xwd %hb,%fb ;;Make a table entry 9379 cleans(<%hb,%fb>) ;;Clean up generated symbols 9380 > 9381 000415'02 000000# 000000# subhlp: hclip (hdefin) ;;Sub-help for DEFINE command 9382 000416'02 000000# 000000# hclip (hclear) ;;Sub-help for CLEAR command 9383 000417'02 000000# 000000# hclip (hlocal) ;;Sub-help for LOCAL command 9384 000420'02 000000# 000000# hclip (hremot) ;;Sub-help for REMOTE command 9385 000421'02 000000# 000000# hclip (htime) ;;Sub-help for TIME command 9386 000005 subcnt==.-subhlp ; Number of items in sub-help table 9387 9388 000422'02 000002 000000 hlpfdb: flddb. .cmkey,,hlptab,, 9389 000423'02 000000000000# 9390 000424'02 000000 000000 9391 000425'02 44 07 0 00 002330' 9392 retsec ;;Back in code 9393 9394 ;[214] End table and linkage definitions 9395 9396 001543'01 200 16 0 00 000000# .help: guide ;[18] HELP 9397 001544'01 260 17 0 00 001477* 9398 000426'02 000000000000# 9399 000536'04 141 142 157 165 164 9400 001545'01 201 01 0 00 000000# movei t1, hlpfdb 9401 001546'01 260 17 0 00 001463* call rfield ;[67] k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-2 K20PAR MAC 20-Aug-24 23:12 HELP command parsing 9402 001547'01 200 02 0 02 000000 move t2, (t2) ; Get help text address. 9403 001550'01 202 02 0 00 001540* movem t2, pars3 9404 001551'01 402 00 0 00 001100* setzm pars4 ;[214] Let's assume it isn't a macro 9405 001552'01 553 00 0 00 000002 hrrzs t2 ;[67] 9406 001553'01 201 04 0 00 000004 movx t4, subcnt-1 ;[214] Load count of sub-help tables 9407 ;[214] Used as an index, actually 9408 remark ;[214] Note, SET must be last because of macros 9409 001554'01 415 16 0 00 001613' block. ;[214] Enter block context for better control 9410 001555'01 261 17 0 00 000016 9411 001556'01 do. ;[214] Enter loop context 9412 001556'01 554 03 0 04 000000# hlrz t3, subhlp(t4) ;[214] Load sub-help table in section offset 9413 001557'01 312 02 0 00 000003 came t2, t3 ;[214] Secondary help we know about? 9414 001560'01 254 00 0 00 001574' ifskp. ;[214] Yes, handle that 9415 001561'01 200 16 0 00 000000# guide ;[214] Tell them they can ask about sub-commands 9416 001562'01 260 17 0 00 001544* 9417 000427'02 000000000000# 9418 000540'04 151 164 145 155 000 9419 001563'01 550 01 0 04 000000# hrrz t1, subhlp(t4) ;[214] Load secondary help fdb 9420 001564'01 260 17 0 00 001546* call rfield ;[214] Maybe get item they want help for 9421 001565'01 135 01 0 00 006256' ldb t1, [pointr (.cmfnp(t3),cm%fnc)] ;[214] Get function code. 9422 001566'01 302 01 0 00 000010 caie t1, .cmcfm ;[214] Wanted general help? 9423 001567'01 254 00 0 00 001572' ifskp. ;[214] They did 9424 001570'01 554 02 0 04 000000# hlrz t2, subhlp(t4) ;[214] So load the general help again 9425 001571'01 254 00 0 00 000034* retskp ;[214] Signal completely done with parse 9426 001572'01 endif. ;[214] End case general REMOTE help 9427 001572'01 550 02 0 02 000000 hrrz t2, (t2) ;[214] Get switch help text address. 9428 001573'01 263 17 0 00 000000 ret ;[214] Break out of the block, non-skip 9429 001574'01 endif. ;[214] End case REMOTE picked 9430 001574'01 365 04 0 00 001556' sojge t4, top. ;[214] Try next sub-help 9431 001575'01 enddo. ;[214] End loop logical context 9432 9433 remark ;[214] If none of the above, do SET last 9434 001575'01 302 02 0 00 000000* caie t2, hset ;[214] Do they want help for SET? 9435 001576'01 254 00 0 00 001612' ifskp. ;[214] They did 9436 001577'01 200 16 0 00 000000# guide ;[67] Yes, give guide word. 9437 001600'01 260 17 0 00 001562* 9438 000430'02 000000000000# 9439 000541'04 160 141 162 141 155 9440 001601'01 201 01 0 00 000000# movei t1, hsfdb1 ;[77] Parse from macro or SET keyword table. 9441 001602'01 260 17 0 00 001564* call rfield ;[67] Get SET option they want help for. 9442 001603'01 553 00 0 00 000003 hrrzs t3 ;[77] Which function descriptor block was used? 9443 001604'01 302 03 0 00 000000# caie t3, hsfdb1 ;[77] The macro table? 9444 001605'01 254 00 0 00 001610' ifskp. ;[214] Yes, let semantic action know 9445 001606'01 476 00 0 00 001551* setom pars4 ;[214] More of a flag than a parse product 9446 001607'01 254 00 0 00 001611' else. ;[214] Otherwise, it was a SET option 9447 001610'01 200 02 0 02 000000 move t2, (t2) ;[67] Yes, don't do indirection 9448 001611'01 endif. ;[214] End case macro name or keywork 9449 001611'01 263 17 0 00 000000 ret ;[214] Break out of the block. 9450 001612'01 endif. ;[214] End case of set 9451 001612'01 263 17 0 00 000000 endbk. ;[214] End of block frame 9452 001613'01 254 00 0 00 001615' ifskp. ;[214] +2 means completely done 9453 remark ;[214] so DON'T confirm 9454 001614'01 254 00 0 00 001616' else. ;[214] Otherwise it must be confirmed first 9455 001615'01 260 17 0 00 001501* confrm ;[67] 9456 001616'01 endif. k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-3 K20PAR MAC 20-Aug-24 23:12 HELP command parsing 9457 9458 001616'01 202 02 0 00 001550* movem t2, pars3 ;[67] SET... 9459 001617'01 263 17 0 00 000000 ret 9460 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20PAR MAC 20-Aug-24 23:12 HELP command semantic action 9461 subttl HELP command semantic action 9462 9463 remark The below is out of date, see [214], above 9464 9465 ; N.B., DEPENDs on help text not having the same in-section address 9466 ; as the macro table. In a single section program, this is, of course, 9467 ; impossble. However, the help text is now in section one, so it can't 9468 ; occupy the same set of in-section (18 bit) addresses. This is a form 9469 ; aliasing and is addressed by judicious .PSECT layout. 9470 9471 remark Display a macro, if that is what they want help on 9472 9473 ;[214] extern mactbx ;[203] Moved to K20MAC 9474 9475 001620'01 550 03 0 00 001616* $help: hrrz t3, pars3 ;[77] Special case for help about macro. 9476 001621'01 336 00 0 00 001606* skipn pars4 ;[214] Is it macro keyword? 9477 001622'01 254 00 0 00 001641' jrst $help2 ;[214] Nope, just type the text 9478 repeat 0,< ;[214] Remove address decisioning 9479 cail t3, mactab+1 9480 caile t3, mactbx 9481 jrst $help2 9482 >;;repeat 0 ;[214] End address decisioning removal 9483 txmsg < 9484 001623'01 200 01 0 00 000000# "> 9485 001624'01 104 00 0 00 000076 9486 001625'01 320 12 0 00 001626' 9487 000431'02 000000000000# 9488 000543'04 015 012 042 000 000 9489 001626'01 564 01 0 03 000000 hlro t1, (t3) 9490 001627'01 104 00 0 00 000076 PSOUT 9491 txmsg <" is a SET macro defined to be: 9492 001630'01 200 01 0 00 000000# > 9493 001631'01 104 00 0 00 000076 9494 001632'01 320 12 0 00 001633' 9495 000432'02 000000000000# 9496 000544'04 042 040 151 163 040 9497 9498 001633'01 560 01 0 03 000000 hrro t1, (t3) 9499 001634'01 104 00 0 00 000076 PSOUT 9500 txmsg < 9501 001635'01 200 01 0 00 000000# > 9502 001636'01 104 00 0 00 000076 9503 001637'01 320 12 0 00 001640' 9504 000433'02 000000000000# 9505 000554'04 015 012 000 000 000 9506 001640'01 263 17 0 00 000000 ret 9507 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20PAR MAC 20-Aug-24 23:12 HELP command semantic action 9508 remark Otherwise, display the help text 9509 9510 ; N.B., The comparison code is actually a kind of a kludge because it 9511 ; uses 18 bit addresses. Since hset is in section 0 in the TEXT 9512 ; .PSECT, whereas ALL other help text is in section one, how can we 9513 ; handle possible inter-section address clash? 9514 ; 9515 ; The answer is to keep the data in completely different parts of 9516 ; the respective sections so that there is no possibility of clash. 9517 ; 9518 ; 1) hset is VERY high in section zero's address space, past what 9519 ; would be called the "high segment" in Tops-10; something after 9520 ; page 500. 9521 ; 9522 ; 2) The HELP .PSECT starts in section one, page 1, which gives us 9523 ; some 510 pages for help text which may be enough to help Frank 9524 ; write another book. 9525 9526 ; Define 30 bit address section portion of ASCII pointer (also used in k20mit) 9527 610001 000000 hlpntr==:<.P07!>> ;;Forces LINK polish fix-up 9528 9529 001641'01 550 01 0 00 001620* $help2: hrrz t1, pars3 ;[194] Load in-section portion of address 9530 001642'01 302 01 0 00 001575* caie t1, hset## ;[194] They want help for SET? 9531 001643'01 254 00 0 00 001646' ifskp. ;[194] Yes, this is here we use in section 0 9532 001644'01 661 01 0 00 777777 tlo t1, -1 ;[194] So let Tops-20 handle it 9533 001645'01 254 00 0 00 001647' else. ;[194] Otherwise, it's an inter-section reference 9534 001646'01 661 01 0 00 610001 txo t1, hlpntr ;[194] Turn into a one word global pointer 9535 001647'01 endif. ;[194] PSOUT% should be happy with either 9536 9537 001647'01 104 00 0 00 000076 PSOUT 9538 001650'01 561 01 0 00 001013* hrroi t1, crlf 9539 001651'01 104 00 0 00 000076 PSOUT 9540 001652'01 263 17 0 00 000000 ret 9541 9542 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20PAR MAC 20-Aug-24 23:12 LOG command tables 9543 subttl LOG command tables 9544 9545 000434'02 000000 000000 %table(logtab) 9546 000435'02 000000# 000002 %key2 ,2 ;[143] 9547 000471'03 144 145 142 165 147 9548 000436'02 000000# 000001 %key2 ,1 9549 000473'03 163 145 163 163 151 9550 000437'02 000000# 000000 %key2 ,0 9551 000475'03 164 162 141 156 163 9552 000434'02 000003 000003 %tbend 9553 9554 000440'02 000000 000000 %table(dbstab) ;[41] (this table) 9555 000441'02 000000# 000007 %key2 <7>,7 9556 000500'03 067 000 000 000 000 9557 000442'02 000000# 000010 %key2 <8>,8 9558 000501'03 070 000 000 000 000 9559 000440'02 000002 000002 %tbend 9560 9561 ;[222] Default command filespec fields for .CMFIL: 9562 9563 chgsec(code,const) ;;Table is not in code, it's in const 9564 000443'02 600020 777777 logbk: gj%fou!gj%new!gj%flg!fld(-1,.rhalf) ;[222] Must NOT be an existing file!! 9565 000444'02 000000 000000 0 ;[222] ; .gjsrc: Leave JFN's alone 9566 000445'02 000000 000000 0 ;[222] ; .gjdev: Use default for device 9567 000446'02 000000 000000 0 ;[222] ; .gjdir: Use default for directory 9568 000447'02 000000 000000 0 ;[222] ; .gjnam: Will be filled in 9569 000450'02 000000000000# cascii () ;[222] ; .gjext: Default extension is .LOG 9570 000555'04 114 117 107 000 000 9571 000451'02 000000000000# 0 ;[222] ; .gjpro: Use system or directory default protection 9572 000452'02 000000 000000 0 ;[222] ; .gjact: Use job default account 9573 000010 logbkl==<.-logbk> ;[222] ; Length of this GTJFN argument block. 9574 9575 000453'02 000000000000# lognam: cascii () ;[222] Default transaction log 9576 000556'04 124 122 101 116 123 9577 000454'02 000000000000# cascii () ;[222] Default session log 9578 000561'04 123 105 123 123 111 9579 000455'02 000000000000# cascii () ;[222] & default debugging log 9580 000563'04 104 105 102 125 107 9581 retsec ;;Back to where-ever we started from 9582 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20PAR MAC 20-Aug-24 23:12 LOG command parsing 9583 subttl LOG command parsing 9584 9585 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 9586 000456'02 000002 000000 logfdb: flddb. .cmkey,,logtab,, ; Parse what kind of log. 9587 000457'02 000000 000434' 9588 000460'02 000000 000000 9589 000461'02 44 07 0 00 002332' 9590 000462'02 006000 000000 lgfidb: flddb. .cmfil 9591 000463'02 000000 000000 9592 000464'02 000006 000000 lgbzfd: flddb. .cmkey,,dbstab,,7 ;[41] 9593 000465'02 000000 000440' 9594 000466'02 44 07 0 00 002334' 9595 000467'02 44 07 0 00 002341' 9596 retsec ;;Back to where-ever we started from 9597 9598 001653'01 200 16 0 00 000000# .log: guide ; Give guide word 9599 001654'01 260 17 0 00 001600* 9600 000470'02 000000000000# 9601 000565'04 167 150 141 164 000 9602 001655'01 201 01 0 00 000000# movei t1, logfdb 9603 001656'01 260 17 0 00 001602* call rfield 9604 001657'01 550 02 0 02 000000 hrrz t2, (t2) 9605 001660'01 202 02 0 00 001513* movem t2, pars2 9606 9607 001661'01 332 01 0 00 001641* skipe t1, pars3 ; Release any piled up JFNs from reparsing 9608 001662'01 104 00 0 00 000023 RLJFN 9609 001663'01 320 12 0 00 001664' erjmpr .+1 ; Catch and ignore any error 9610 001664'01 402 00 0 00 001661* setzm pars3 ;[194] Either way, no JFN parsed 9611 9612 001665'01 200 16 0 00 000000# guide ; Guide 9613 001666'01 260 17 0 00 001654* 9614 000471'02 000000000000# 9615 000566'04 164 157 040 146 151 9616 001667'01 201 01 0 00 000010 movx t1, logbkl ;[222] Space for GTJFN% block 9617 dmove t2, [ logbk ;[222] Source is our default GTJFN% block 9618 001670'01 120 02 0 00 006406' cjfnbk ] ;[222] Destination is COMND% GTJFN block 9619 001671'01 123 01 0 00 006402' xblt. t1 ;[222] Pop it into place 9620 9621 001672'01 200 02 0 00 001660* move t2, pars2 ;[222] Load the log table type 9622 001673'01 200 01 0 02 000000# move t1, lognam(t2) ;[222] Pick up the pointer for that 9623 001674'01 202 01 0 00 000000# movem t1, cjfnbk+.gjnam ;[222] Store as the default filename 9624 001675'01 201 01 0 00 000000# movei t1, lgfidb ;[222] Parse general file properly defaulted 9625 001676'01 260 17 0 00 001656* call rfield ; Parse log filespec. 9626 9627 001677'01 550 01 0 00 000002 hrrz t1, t2 ;[222] Load the JFN we got 9628 001700'01 260 17 0 00 001536* call isnulj ;[222] Is it NUL:? 9629 001701'01 600 00 0 00 000000 nop ;[222] No, but that's fine 9630 001702'01 552 01 0 00 001664* hrrzm t1, pars3 ;[222] Stash JFN here 9631 001703'01 200 02 0 00 001672* move t2, pars2 ;[143] Debugging log? 9632 001704'01 306 02 0 00 000002 cain t2, 2 ;[194] If not debugging 9633 001705'01 254 00 0 00 001710' ifskp. ;[194] Then nothing further to parse 9634 001706'01 260 17 0 00 001615* confrm ;[143] No, get confirmation 9635 001707'01 263 17 0 00 000000 ret ;[143] and return. 9636 001710'01 endif. ;[194] 9637 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-1 K20PAR MAC 20-Aug-24 23:12 LOG command parsing 9638 001710'01 200 16 0 00 000000# guide ;[41] Yes, parse the file byte size. 9639 001711'01 260 17 0 00 001666* 9640 000472'02 000000000000# 9641 000570'04 167 151 164 150 040 9642 001712'01 201 01 0 00 000000# movei t1, lgbzfd 9643 001713'01 260 17 0 00 001676* call rfield ;[41] Parse it. Defaults to 7. 9644 001714'01 550 02 0 02 000000 hrrz t2, (t2) ;[41] Get result. 9645 001715'01 202 02 0 00 001621* movem t2, pars4 ;[41] Save it. 9646 001716'01 200 16 0 00 000000# guide ;[41] Comforting guide... 9647 001717'01 260 17 0 00 001711* 9648 000473'02 000000000000# 9649 000574'04 142 151 164 163 000 9650 001720'01 260 17 0 00 001706* confrm 9651 001721'01 263 17 0 00 000000 ret 9652 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20PAR MAC 20-Aug-24 23:12 Open the desired log. 9653 subttl Open the desired log. 9654 9655 extern logbsz ;[194] Log file byte size 9656 extern frclos ;[194] Force close 9657 9658 001722'01 logdsp: remark ;[194] Log open dispatch table 9659 001722'01 000000 001741' $logt ;[194] Open transaction log 9660 001723'01 000000 002020' $logs ;[194] Open Session log 9661 001724'01 000000 002071' $logd ;[194] Open debugging log 9662 000003 logmax==.-logdsp ;[194] Maximum log file type 9663 9664 001725'01 331 01 0 00 001703* $log: skipl t1, pars2 ; What kind of log? 9665 001726'01 254 00 0 00 001732' ifskp. ;[194] The bad kind ... 9666 001727'01 200 01 0 00 000000# emsg ;[194] 9667 001730'01 104 00 0 00 000313 9668 000474'02 000000000000# 9669 000575'04 116 145 147 141 164 9670 001731'01 263 17 0 00 000000 ret ;[194] Go no further 9671 001732'01 endif. ;[194] 9672 001732'01 305 01 0 00 000003 caige t1, logmax ;[194] Out of range? 9673 001733'01 254 00 0 00 001737' ifskp. ;[194] Yeah, probably out of date 9674 001734'01 200 01 0 00 000000# emsg ;[194] 9675 001735'01 104 00 0 00 000313 9676 000475'02 000000000000# 9677 000607'04 114 157 147 147 151 9678 001736'01 263 17 0 00 000000 ret ;[194] Go no further 9679 001737'01 endif. ;[194] 9680 9681 remark ;[194] Otherwise, safe to dispatch 9682 001737'01 265 16 0 00 006273' saveac ;[198] Save q1 for everybody to play with 9683 001740'01 254 00 1 01 001722' jrst @logdsp(t1) ; Dispatch 9684 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20PAR MAC 20-Aug-24 23:12 Open transaction log semantic action 9685 subttl Open transaction log semantic action 9686 9687 ;[126] Begin code addition 9688 9689 001741'01 265 16 0 00 006273' $logt: saveac ;[221] Stores final JFN we're going to try 9690 001742'01 337 01 0 00 001411* skipg t1, tlgjfn ;[195] Already had a transaction log open? 9691 001743'01 254 00 0 00 001753' ifskp. ;[195] We did 9692 001744'01 402 00 0 00 001742* setzm tlgjfn ; In case of failure. 9693 001745'01 260 17 0 00 000755* call frclos ;[194] Force close 9694 001746'01 334 01 0 00 000000# ermsg% (, r) 9695 001747'01 254 00 0 00 001753' 9696 001750'01 202 01 0 00 000000* 9697 001751'01 104 00 0 00 000313 9698 001752'01 254 00 0 00 001523* 9699 000476'02 000000000000# 9700 000616'04 113 105 122 115 111 9701 9702 001753'01 endif. ;[195] 9703 9704 001753'01 260 17 0 00 002263' call nulogj ;[198] Go figure out the logging JFN 9705 001754'01 263 17 0 00 000000 ret ;[198] Failed; we've already whined about it 9706 001755'01 200 05 0 00 000001 move q1, t1 ;[221] Store whatever we're going to use 9707 001756'01 321 03 0 00 002004' ifxe. t3, gs%opn ;[198] Not open? 9708 001757'01 306 01 0 00 377777 cain t1, .nulio ;[221] Special JFN? 9709 001760'01 254 00 0 00 002004' anskp. ;[221] Doesn't need to be opened 9710 001761'01 200 03 0 00 000002 move t3, t2 ;[222] Otherwise, store the OPENF% bits 9711 001762'01 104 00 0 00 000021 OPENF ;[198] and try to open it 9712 001763'01 320 12 0 00 001765' ifje. r ;[198] Failed?? 9713 001764'01 254 00 0 00 002004' 9714 001765'01 302 01 0 00 600120 caie t1, opnx1 ; Already open? 9715 001766'01 254 00 0 00 001771' ifskp. ;[195] Yes, that's odd, but OK... 9716 001767'01 200 01 0 00 000005 move t1, q1 ;[194] Restore the JFN and carry on 9717 001770'01 254 00 0 00 002004' else. ;[194] Otherwise, a worse error 9718 001771'01 302 01 0 00 600130 caie t1, opnx9 ;[222] Invalid simulaneous access??? 9719 001772'01 254 00 0 00 001776' ifskp. ;[222] Yep, gj%new!gj%new didn't work 9720 001773'01 260 17 0 00 002145' call nxthgh ;[222] Get and open the next highest JFN 9721 001774'01 254 00 0 00 001776' anskp. ;[222] But couldn't 9722 remark ;[222] Otherwise, falls out to movem 9723 001775'01 254 00 0 00 002004' else. ;[222] Otherwise, so other kind of error 9724 001776'01 200 04 0 00 000001 move t4, t1 ;[194] Save error for a debugger 9725 001777'01 334 00 0 00 000000 %ermsg (,$loge) ;[221] 9726 002000'01 254 00 0 00 002004' 9727 002001'01 265 01 0 00 001521* 9728 002002'01 000000000000# 9729 002003'01 254 00 0 00 002256' 9730 000631'04 125 156 141 142 154 9731 002004'01 endif. ;[222] End attempted opnx9 recovery 9732 002004'01 endif. ;[194] End OPENF% error recovery 9733 002004'01 endif. ;[194] End OPENF% error analysis 9734 002004'01 endif. ;[194] End case opening the transaction log 9735 9736 002004'01 202 01 0 00 001744* movem t1, tlgjfn ; Save the jfn. 9737 002005'01 120 02 0 00 000000# smsg () 9738 002006'01 260 17 0 00 001220* 9739 000477'02 000000000000# k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-1 K20PAR MAC 20-Aug-24 23:12 Open transaction log semantic action 9740 000500'02 777777 777740 9741 000640'04 113 105 122 115 111 9742 dmove t2, [ -1 ; Write header in log file. 9743 002007'01 120 02 0 00 006410' ot%ntm!ot%day!ot%fdy!ot%fmn!ot%4yr] 9744 002010'01 104 00 0 00 000220 ODTIM 9745 002011'01 120 02 0 00 006412' dmove t2, [exp <-1,,crlflf>, -^d4 ] 9746 002012'01 104 00 0 00 000053 SOUT ;[194] Counted tie off 9747 002013'01 265 01 0 00 001405* wtlog (, tlgjfn) 9748 002014'01 000000000000# 9749 002015'01 777777 777764 9750 002016'01 000000000000# 9751 000647'04 117 160 145 156 145 9752 002017'01 263 17 0 00 000000 ret 9753 9754 ;[126] End of addition. 9755 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20PAR MAC 20-Aug-24 23:12 Open session log semantic action 9756 subttl Open session log semantic action 9757 9758 ;[194] If log is opened again without being closed beforehand, then 9759 ; JFN's can wind up being lost. 9760 9761 002020'01 265 16 0 00 006273' $logs: saveac ;[221] Needs an accumulator 9762 002021'01 337 01 0 00 001442* skipg t1, sesjfn ;[195] Already had a session log open? 9763 002022'01 254 00 0 00 002034' ifskp. ;[195] We did 9764 002023'01 402 00 0 00 002021* setzm sesjfn ; In case of failure. 9765 002024'01 402 00 0 00 001443* setzm sesflg ;[198] Stomp session flag, too 9766 002025'01 260 17 0 00 001745* call frclos ;[194] Force close 9767 002026'01 334 01 0 00 000000# ermsg% (, r) 9768 002027'01 254 00 0 00 002033' 9769 002030'01 202 01 0 00 001750* 9770 002031'01 104 00 0 00 000313 9771 002032'01 254 00 0 00 001752* 9772 000501'02 000000000000# 9773 000652'04 113 105 122 115 111 9774 9775 002033'01 254 00 0 00 002035' else. ;[198] Otherwise, decondition further logic 9776 002034'01 402 00 0 00 002024* setzm sesflg ;[198] Stomp session flag 9777 002035'01 endif. ;[195] 9778 9779 002035'01 260 17 0 00 002263' call nulogj ;[198] Go figure out the logging JFN 9780 002036'01 263 17 0 00 000000 ret ;[198] Failed; we've already whined about it 9781 002037'01 200 05 0 00 000001 move q1, t1 ;[221] Save whatever we're going to use 9782 002040'01 321 03 0 00 002066' ifxe. t3, gs%opn ;[198] Not open? 9783 002041'01 306 01 0 00 377777 cain t1, .nulio ;[221] Special JFN? 9784 002042'01 254 00 0 00 002066' anskp. ;[221] Doesn't need to be opened 9785 002043'01 200 03 0 00 000002 move t3, t2 ;[222] Otherwise, store the OPENF% bits 9786 002044'01 104 00 0 00 000021 OPENF ; Open now, avoid being stomped by CLZFFs. 9787 002045'01 320 12 0 00 002047' ifje. r ;[198] Failed?? 9788 002046'01 254 00 0 00 002066' 9789 002047'01 302 01 0 00 600120 caie t1, opnx1 ; Already open? 9790 002050'01 254 00 0 00 002053' ifskp. ;[195] Yes, that's odd, but OK... 9791 002051'01 200 01 0 00 000005 move t1, q1 ;[194] Restore the JFN and carry on 9792 002052'01 254 00 0 00 002066' else. ;[194] Otherwise, a worse error 9793 002053'01 302 01 0 00 600130 caie t1, opnx9 ;[222] Invalid simulaneous access??? 9794 002054'01 254 00 0 00 002060' ifskp. ;[222] Yep, gj%new!gj%new didn't work 9795 002055'01 260 17 0 00 002145' call nxthgh ;[222] Get and open the next highest JFN 9796 002056'01 254 00 0 00 002060' anskp. ;[222] But couldn't 9797 remark ;[222] Otherwise, falls out to movem 9798 002057'01 254 00 0 00 002066' else. ;[222] Otherwise, so other kind of error 9799 002060'01 200 04 0 00 000001 move t4, t1 ;[194] Save error for a debugger 9800 002061'01 334 00 0 00 000000 %ermsg (,$loge) ;[221] 9801 002062'01 254 00 0 00 002066' 9802 002063'01 265 01 0 00 002001* 9803 002064'01 000000000000# 9804 002065'01 254 00 0 00 002256' 9805 000664'04 125 156 141 142 154 9806 002066'01 endif. ;[222] End opnx9 recovery 9807 002066'01 endif. ;[194] End OPENF% error recovery 9808 002066'01 endif. ;[194] End OPENF% error analysis 9809 002066'01 endif. ;[198] End case opening the session log 9810 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35-1 K20PAR MAC 20-Aug-24 23:12 Open session log semantic action 9811 remark ;[195] Otherwise, everything is dandy 9812 002066'01 552 01 0 00 002023* hrrzm t1, sesjfn ;[195] Save the open JFN. 9813 002067'01 476 00 0 00 002034* setom sesflg ;[195] Flag session logging is active 9814 002070'01 263 17 0 00 000000 ret 9815 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20PAR MAC 20-Aug-24 23:12 Open debugging log semantic action 9816 subttl Open debugging log semantic action 9817 9818 002071'01 265 16 0 00 006273' $logd: saveac ;[221] Accumulator for JFN 9819 002072'01 337 01 0 00 001362* skipg t1, logjfn ;[195] Already had a debugging log open? 9820 002073'01 254 00 0 00 002103' ifskp. ;[195] We did 9821 002074'01 402 00 0 00 002072* setzm logjfn ; In case of failure. 9822 002075'01 260 17 0 00 002025* call frclos ;[194] Force close 9823 002076'01 334 01 0 00 000000# ermsg% (, r) 9824 002077'01 254 00 0 00 002103' 9825 002100'01 202 01 0 00 002030* 9826 002101'01 104 00 0 00 000313 9827 002102'01 254 00 0 00 002032* 9828 000502'02 000000000000# 9829 000672'04 113 105 122 115 111 9830 9831 002103'01 endif. ;[195] 9832 9833 002103'01 260 17 0 00 002263' call nulogj ;[198] Go figure out the logging JFN 9834 002104'01 263 17 0 00 000000 ret ;[198] Failed; we've already whined about it 9835 002105'01 200 05 0 00 000001 move q1, t1 ;[221] Save the accumulator 9836 002106'01 200 04 0 00 001715* move t4, pars4 ;[198] ;[41] Load the bytesize we wanted. 9837 002107'01 202 04 0 00 000000* movem t4, logbsz ;[41] Save bytesize for SHOW command. 9838 002110'01 321 03 0 00 002141' ifxe. t3, gs%opn ;[198] Not open? 9839 002111'01 302 04 0 00 000010 caie t4, ^d8 ;[41] 8-bit requested? 9840 002112'01 254 00 0 00 002114' ifskp. ;[198] Whoops, better fix the mode word 9841 002113'01 137 04 0 00 006414' dpb t4,[pointr (t2,of%bsz)];[198] Overwrite the 7... 9842 002114'01 endif. ;[198] End case byte size fix up 9843 002114'01 306 01 0 00 377777 cain t1, .nulio ;[221] Special JFN? 9844 002115'01 254 00 0 00 002141' anskp. ;[221] Doesn't need to be opened 9845 002116'01 200 03 0 00 000002 move t3, t2 ;[222] Otherwise, store the OPENF% bits 9846 002117'01 104 00 0 00 000021 OPENF% ;[38] 9847 002120'01 320 12 0 00 002122' ifje. r ;[198] Failed?? 9848 002121'01 254 00 0 00 002141' 9849 002122'01 302 01 0 00 600120 caie t1, opnx1 ; Already open? 9850 002123'01 254 00 0 00 002126' ifskp. ;[195] Yes, that's odd, but OK... 9851 002124'01 200 01 0 00 000005 move t1, q1 ;[194] Restore the JFN and carry on 9852 002125'01 254 00 0 00 002141' else. ;[194] Otherwise, a worse error 9853 002126'01 302 01 0 00 600130 caie t1, opnx9 ;[222] Invalid simulaneous access??? 9854 002127'01 254 00 0 00 002133' ifskp. ;[222] Yep, gj%new!gj%new didn't work 9855 002130'01 260 17 0 00 002145' call nxthgh ;[222] Get and open the next highest JFN 9856 002131'01 254 00 0 00 002133' anskp. ;[222] But couldn't 9857 remark ;[222] Otherwise, falls out to movem 9858 002132'01 254 00 0 00 002141' else. ;[222] Otherwise, so other kind of error 9859 002133'01 200 04 0 00 000001 move t4, t1 ;[194] Save error for a debugger 9860 002134'01 334 00 0 00 000000 %ermsg (,$loge) ;[221] 9861 002135'01 254 00 0 00 002141' 9862 002136'01 265 01 0 00 002063* 9863 002137'01 000000000000# 9864 002140'01 254 00 0 00 002256' 9865 000705'04 125 156 141 142 154 9866 002141'01 endif. ;[222] End opnx9 error recovery 9867 002141'01 endif. ;[194] End OPENF% error recovery 9868 002141'01 endif. ;[194] End OPENF% error analysis 9869 002141'01 endif. ;[198] End case opening the session log 9870 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36-1 K20PAR MAC 20-Aug-24 23:12 Open debugging log semantic action 9871 remark ;[195] Otherwise, everything is dandy 9872 002141'01 202 01 0 00 002074* movem t1, logjfn ;[38] Opened OK, save it. 9873 002142'01 336 00 0 00 000014 skipn debug ;[41] Was debugging asked for? 9874 002143'01 201 14 0 00 000001 movei debug, 1 ;[41] Not yet, so set default debugging. 9875 002144'01 263 17 0 00 000000 ret 9876 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20PAR MAC 20-Aug-24 23:12 Get next higher generation 9877 subttl Get next higher generation 9878 9879 ; gj%new!gj%fou will only work for a file which has been saved at 9880 ; least once. Otherwise, the file does not exist on disk yet and 9881 ; GTJFN% can return the JFN of a file that is actually already open 9882 ; (in another job). 9883 9884 ; Call: 9885 ; 9886 ; q1/ JFN that failed open with opnx9 9887 ; t3/ Failing OPENF%'s bits 9888 ; 9889 ; Return: 9890 ; 9891 ; +1/ Failed, q1 unchanged 9892 ; +2/ Worked, q1 has an OPEN JFN 9893 9894 ; Fields for file with no generation number 9895 9896 100000 000000 fnogen==fld(.jsaof, js%dev) ;[222] Always want device 9897 110000 000000 fnogen==fnogen!fld(.jsaof, js%dir) ;[222] Full directory 9898 111000 000000 fnogen==fnogen!fld(.jsaof, js%nam) ;[222] File Name 9899 111100 000000 fnogen==fnogen!fld(.jsaof, js%typ) ;[222] File Type (or Extension) 9900 111100 000001 fnogen==fnogen!js%paf ;[222] Punctuate all fields 9901 9902 002145'01 265 16 0 00 006315' nxthgh: saveac ;[222] Needs some control variables 9903 002146'01 200 06 0 00 000003 move q2, t3 ;[222] Save the OPENF% bits 9904 002147'01 561 01 0 00 001043* hrroi t1, atmbuf ;[222] Get a place to do JFNS% 9905 002150'01 550 02 0 00 000005 hrrz t2, q1 ;[222] Load the JFN 9906 dmove t3, [ fld(.jsaof, js%gen) ;[222] Just want the (bad) generation number 9907 002151'01 120 03 0 00 006415' 0 ] ;[222] No goofy prefix, whatever that is 9908 002152'01 104 00 0 00 000030 JFNS% ;[222] Get just that 9909 002153'01 320 12 0 00 002155' %jsErr (,r) 9910 002154'01 254 00 0 00 002160' 9911 002155'01 265 01 0 00 002136* 9912 002156'01 000000000000# 9913 002157'01 254 00 0 00 002102* 9914 000713'04 112 106 116 123 045 9915 002160'01 561 01 0 00 002147* hrroi t1, atmbuf ;[222] Point at the atom buffer again 9916 002161'01 201 03 0 00 000012 movei t3, ^d10 ;[222] Generations are in base 10 9917 002162'01 104 00 0 00 000225 NIN% ;[222] Convert to internal binary format 9918 002163'01 320 12 0 00 002165' %jsErr (,r) 9919 002164'01 254 00 0 00 002170' 9920 002165'01 265 01 0 00 002155* 9921 002166'01 000000000000# 9922 002167'01 254 00 0 00 002157* 9923 000730'04 116 111 116 045 040 9924 002170'01 350 07 0 00 000002 aos q3, t2 ;[222] Calculate and save the next highest 9925 002171'01 561 01 0 00 002160* hrroi t1, atmbuf ;[222] Get a place to do another JFNS% 9926 002172'01 550 02 0 00 000005 hrrz t2, q1 ;[222] Load the JFN again 9927 dmove t3, [ fnogen ;[222] Do everything EXCEPT the generation 9928 002173'01 120 03 0 00 006417' 0 ] ;[222] No goofy prefix, whatever that is 9929 002174'01 104 00 0 00 000030 JFNS% ;[222] Get just that 9930 002175'01 320 12 0 00 002177' %jsErr (<2nd JFNS% failure recovering from invalid simultaneous access>,r) 9931 002176'01 254 00 0 00 002202' k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-1 K20PAR MAC 20-Aug-24 23:12 Get next higher generation 9932 002177'01 265 01 0 00 002165* 9933 002200'01 000000000000# 9934 002201'01 254 00 0 00 002167* 9935 000745'04 062 156 144 040 112 9936 002202'01 201 03 0 00 000056 movei t3, "." ;[222] Punctuation for generation number to come 9937 002203'01 136 03 0 00 000001 idpb t3, t1 ;[222] Append it 9938 002204'01 200 10 0 00 000001 move q4, t1 ;[222] Save where to append the generation 9939 002205'01 201 04 0 00 000036 movei t4, ^d30 ;[222] Only try 30 generations 9940 9941 002206'01 do. ;[222] Enter loop context 9942 002206'01 200 01 0 00 000010 move t1, q4 ;[222] Where to append the current generation 9943 002207'01 200 02 0 00 000007 move t2, q3 ;[222] Load current highest generation 9944 002210'01 201 03 0 00 000012 movei t3, ^d10 ;[222] Output in base 10 9945 002211'01 104 00 0 00 000224 NOUT% ;[222] Convert to internal binary format 9946 002212'01 320 12 0 00 002214' %jsErr (,r) 9947 002213'01 254 00 0 00 002217' 9948 002214'01 265 01 0 00 002177* 9949 002215'01 000000000000# 9950 002216'01 254 00 0 00 002201* 9951 000762'04 116 117 125 124 045 9952 dmove t1, [ ;[222] May no catch existing files, but... 9953 gj%new!gj%flg ;[222] New file, return flags 9954 002217'01 120 01 0 00 006421' -1,,atmbuf ] ;[222] Point to what we just built 9955 002220'01 104 00 0 00 000020 GTJFN% ;[222] Get a JFN on the next highest generation 9956 002221'01 320 12 0 00 002223' %jsErr (,r) 9957 002222'01 254 00 0 00 002226' 9958 002223'01 265 01 0 00 002214* 9959 002224'01 000000000000# 9960 002225'01 254 00 0 00 002216* 9961 000777'04 107 124 112 106 116 9962 002226'01 510 03 0 00 000001 hllz t3, t1 ;[222] Grab the flags 9963 002227'01 621 01 0 00 777777 tlz t1, -1 ;[222] Stomp them 9964 002230'01 250 01 0 00 000005 exch t1, q1 ;[222] Use as current JFN 9965 002231'01 104 00 0 00 000023 RLJFN% ;[222] Toss the one that didn't work 9966 002232'01 320 12 0 00 002234' %jsErr (,r) 9967 002233'01 254 00 0 00 002237' 9968 002234'01 265 01 0 00 002223* 9969 002235'01 000000000000# 9970 002236'01 254 00 0 00 002225* 9971 001014'04 122 114 112 106 116 9972 002237'01 550 01 0 00 000005 hrrz t1, q1 ;[222] Load the new JFN 9973 002240'01 200 02 0 00 000006 move t2, q2 ;[222] Load original OPENF% bits 9974 002241'01 104 00 0 00 000021 OPENF% ;[222] And try it again 9975 002242'01 320 12 0 00 002244' ifje. r ;[222] But failed 9976 002243'01 254 00 0 00 002255' 9977 002244'01 302 01 0 00 600130 caie t1, opnx9 ;[222] Bumped into another one? 9978 002245'01 334 00 0 00 000000 %ermsg (,r) 9979 002246'01 254 00 0 00 002252' 9980 002247'01 265 01 0 00 002234* 9981 002250'01 000000000000# 9982 002251'01 254 00 0 00 002236* 9983 001031'04 117 120 105 116 106 9984 002252'01 363 04 0 00 002251* sojle t4, r ;[222] Only do this so many times 9985 002253'01 344 07 0 00 002206' aoja q3, top. ;[222] Otherwise, try another generation 9986 002254'01 254 00 0 00 002256' else. ;[222] Otherwise, worked k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-2 K20PAR MAC 20-Aug-24 23:12 Get next higher generation 9987 002255'01 254 00 0 00 001571* retskp ;[222] Return success 9988 002256'01 endif. ;[222] End OPENF% analysis 9989 002256'01 enddo. ;[222] End loop context 9990 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20PAR MAC 20-Aug-24 23:12 Handle log file open errors 9991 subttl Handle log file open errors 9992 9993 ; Assumes Q1 has a JFN 9994 9995 002256'01 550 01 0 00 000005 $loge: hrrz t1, q1 ;[221] Load the JFN 9996 002257'01 322 01 0 00 002252* jumpe t1, R ;[222] Don't try to release gubbish 9997 002260'01 260 17 0 00 002075* call frclos ;[221] Force it closed or release it 9998 002261'01 600 00 0 00 000000 nop ;[221] Ignore error return when trying to recover 9999 002262'01 263 17 0 00 000000 ret ;[221] Done 10000 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20PAR MAC 20-Aug-24 23:12 Set up a log file JFN, special casing NUL: 10001 subttl Set up a log file JFN, special casing NUL: 10002 10003 ; Call: 10004 ; 10005 ; pars3/ Some kind of JFN, which is very carefully checked 10006 ; 10007 ; +1 Failed 10008 ; +2 t1/ JFN ready to be opened or .nulio 10009 ; t2/ OPENF% bits, basically of%wr and maybe of%app 10010 ; Assumes 7 bit mode, which would need to be overriden 10011 ; t3/ Results of GTSTS% (which are simulated for .nulio) 10012 ; pars3/ Updated in case of .nulio 10013 10014 002263'01 265 16 0 00 006341' nulogj: saveac ;[198] Saves a copy of the JFN 10015 10016 002264'01 415 16 0 00 002274' block. ;[194] Enter block context for better control flow 10017 002265'01 261 17 0 00 000016 10018 002266'01 337 05 0 00 001702* skipg q1, pars3 ;[194] Load and check the parsed JFN 10019 002267'01 263 17 0 00 000000 ret ;[194] It was junk... 10020 002270'01 621 05 0 00 777777 tlz q1, -1 ;[194] Shut off any flags 10021 002271'01 322 05 0 00 002257* jumpe q1, r ;[194] Zero is junk, too 10022 002272'01 254 00 0 00 002255* retskp ;[194] Otherwise, passes lexical checks 10023 002273'01 263 17 0 00 000000 endbk. ;[194] Exit block. context 10024 002274'01 254 00 0 00 002277' ifskp. ;[194] Passed? 10025 002275'01 200 01 0 00 000005 move t1, q1 ;[194] Yes, do some further checking 10026 002276'01 254 00 0 00 002304' else. ;[194] Otherwise, something wasn't right 10027 002277'01 334 01 0 00 000000# ermsg% (, r) 10028 002300'01 254 00 0 00 002304' 10029 002301'01 202 01 0 00 002100* 10030 002302'01 104 00 0 00 000313 10031 002303'01 254 00 0 00 002271* 10032 000503'02 000000000000# 10033 001045'04 113 105 122 115 111 10034 10035 002304'01 endif. ;[194] End sanity check 10036 10037 remark t1, q1 ;[194] t1 is loaded at this point 10038 002304'01 260 17 0 00 001700* call isnulj ;[194] Allow them to log to NUL: quickly 10039 002305'01 254 00 0 00 002312' ifskp. ;[194] It's NUL: 10040 002306'01 553 05 0 00 000001 hrrzs q1, t1 ;[194] Clear 'flags' and cache JFN 10041 002307'01 202 01 0 00 002266* movem t1, pars3 ;[194] Store .nulio as parse item 10042 002310'01 205 06 0 00 501200 movx q2, ;[198] Pretend some likley bits 10043 002311'01 254 00 0 00 002370' else. ;[194] Otherwise, a real file 10044 002312'01 104 00 0 00 000024 GTSTS% ;[198] Let's have a look at the file 10045 002313'01 320 12 0 00 002315' %jserr (,r) ;[198] 10046 002314'01 254 00 0 00 002320' 10047 002315'01 265 01 0 00 002247* 10048 002316'01 000000000000# 10049 002317'01 254 00 0 00 002303* 10050 001056'04 125 156 141 142 154 10051 002320'01 200 06 0 00 000002 move q2, t2 ;[198] Save the status 10052 002321'01 603 02 0 00 000200 ifxe. t2, gs%nam ;[198] Some kind of gubbish? 10053 002322'01 254 00 0 00 002330' 10054 002323'01 334 01 0 00 000000# ermsg% (, r) ;[198] 10055 002324'01 254 00 0 00 002330' k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20PAR MAC 20-Aug-24 23:12 Set up a log file JFN, special casing NUL: 10056 002325'01 202 01 0 00 002301* 10057 002326'01 104 00 0 00 000313 10058 002327'01 254 00 0 00 002317* 10059 000504'02 000000000000# 10060 001065'04 113 105 122 115 111 10061 10062 002330'01 endif. ;[198] 10063 002330'01 607 02 0 00 000400 ifxn. t2, gs%err ;[198] Some kind of error? 10064 002331'01 254 00 0 00 002337' 10065 002332'01 334 01 0 00 000000# ermsg% (, r) ;[198] 10066 002333'01 254 00 0 00 002337' 10067 002334'01 202 01 0 00 002325* 10068 002335'01 104 00 0 00 000313 10069 002336'01 254 00 0 00 002327* 10070 000505'02 000000000000# 10071 001076'04 113 105 122 115 111 10072 10073 002337'01 endif. ;[198] 10074 002337'01 603 02 0 00 400000 txne t2, gs%opn ;[198] Is it already open? 10075 002340'01 254 00 0 00 002370' anskp. ;[198] It is, so we're done 10076 002341'01 104 00 0 00 000117 DVCHR% ;[198] Let's find out about the device 10077 002342'01 320 12 0 00 002344' %jserr (,r) ;[198] 10078 002343'01 254 00 0 00 002347' 10079 002344'01 265 01 0 00 002315* 10080 002345'01 000000000000# 10081 002346'01 254 00 0 00 002336* 10082 001112'04 117 160 145 156 040 10083 002347'01 135 03 0 00 006423' ldb t3,[pointr t2, dv%typ] ;[198] Pick up the device type 10084 002350'01 302 03 0 00 000000 caie t3, .dvdsk ;[198] Is this a disk? 10085 002351'01 254 00 0 00 002366' ifskp. ;[198] Yes, safe to query the fdb (I hope) 10086 002352'01 200 01 0 00 000005 move t1, q1 ;[198] Load the JFN 10087 dmove t2, [1,,.fbctl ;[198] Get the file descriptor control word 10088 002353'01 120 02 0 00 006424' t4 ] ;[198] Put it in t4 10089 002354'01 104 00 0 00 000063 GTFDB% ;[198] Pull it from the file descriptor block. 10090 002355'01 320 12 0 00 002357' ifje. r ;[198] Sigh... 10091 002356'01 254 00 0 00 002362' 10092 002357'01 200 03 0 00 000001 move t3, t1 ;[198] Save the error for debuggers 10093 002360'01 474 02 0 00 000000 seto t2, ;[198] Assume not appending 10094 002361'01 200 01 0 00 000005 move t1, q1 ;[198] Reload the JFN 10095 002362'01 endif. ;[198] 10096 002362'01 603 02 0 00 100000 txne t2, fb%nex ;[198] Doesn't exist yet? 10097 002363'01 254 00 0 00 002366' anskp. ;[198] Then it is silly to try to append 10098 remark fb%nxf!fb%wnc ;[198] Not closed in some way; try not to overwrite 10099 remark t1, q1 ;[198] t1 is still loaded (or reloaded) at this point 10100 002364'01 200 02 0 00 006426' movx t2, of%wr!of%app!fld(7,of%bsz) ;[198] Write/append access, 7-bit bytes. 10101 002365'01 254 00 0 00 002370' else. ;[198] Otherwise, assume not appending 10102 002366'01 200 01 0 00 000005 move t1, q1 ;[198] Reload load the JFN 10103 002367'01 200 02 0 00 006427' movx t2, of%wr!fld(7,of%bsz) ;[198] Write access, 7-bit bytes. 10104 002370'01 endif. ;[198] 10105 002370'01 endif. ;[198] End .nulio special casing 10106 002370'01 200 03 0 00 000006 move t3, q2 ;[198] Return GTSTS% 10107 10108 002371'01 254 00 0 00 002272* retskp ;[198] Succeeded at something, anyway... 10109 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20PAR MAC 20-Aug-24 23:12 PAUSE command 10110 subttl PAUSE command 10111 10112 ;[194] Enhanced to parse a floating point number so that we can specify 10113 ; milliseconds, which are used for greater granularity when testing. 10114 ; Also carefully checks for overflow when converting from floating 10115 ; point seconds to integer milliseconds. 10116 10117 chgsec(code,const) ;;FDB's are not in code, they're in const 10118 000506'02 015006 000000 paufdb: flddb. .cmflt,,^d10,,<1> 10119 000507'02 000000 000012 10120 000510'02 44 07 0 00 002342' 10121 000511'02 44 07 0 00 002116' 10122 retsec ;;Back to where-ever we started from 10123 10124 002372'01 200 16 0 00 000000# .pause: guide (seconds) 10125 002373'01 260 17 0 00 001717* 10126 000512'02 000000000000# 10127 001123'04 163 145 143 157 156 10128 002374'01 201 01 0 00 000000# movei t1, paufdb 10129 002375'01 260 17 0 00 001713* call rfield ;[194] Parse for the floating number 10130 10131 002376'01 325 02 0 00 002402' ifl. t2 ;[194] Is the number in the right range? 10132 002377'01 200 01 0 00 000000# emsg ;[187] 10133 002400'01 104 00 0 00 000313 10134 000513'02 000000000000# 10135 001125'04 116 145 147 141 164 10136 002401'01 254 00 0 00 000230* jrst cmder1 ;[194] Allow reparse 10137 002402'01 endif. ;[194] 10138 10139 remark ;[212] When chksec works, it works completely 10140 002402'01 260 17 0 00 000000' call chksec ;[196] Ensure number is in correct range 10141 002403'01 254 00 0 00 002410' ifskp. ;[196] Check and convert OK? 10142 002404'01 336 00 0 00 000000* skipn definf ;[212] Yes; in a DEFINE command? 10143 002405'01 260 17 0 00 001720* confrm ;[212] No, confirm the line 10144 002406'01 263 17 0 00 000000 ret ;[212] And done 10145 002407'01 254 00 0 00 002413' else. ;[196] Otherwise, couldn't swallow something 10146 002410'01 200 01 0 00 000000# emsg ;[196] 10147 002411'01 104 00 0 00 000313 10148 000514'02 000000000000# 10149 001134'04 120 141 165 163 145 10150 002412'01 254 00 0 00 002401* jrst cmder1 ;[196] Allow reparse 10151 002413'01 endif. ;[196] End case checking and conversion 10152 10153 remark Pause semantic action 10154 10155 002413'01 337 01 0 00 002106* $pause: skipg t1, pars4 ;[196] Load the milliseconds 10156 002414'01 263 17 0 00 000000 ret ;[196] Unless there weren't any 10157 002415'01 104 00 0 00 000167 DISMS ; Sleep. 10158 002416'01 320 12 0 00 002417' erjmpr .+1 ;[194] Catch and ignore error 10159 002417'01 263 17 0 00 000000 ret 10160 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20PAR MAC 20-Aug-24 23:12 PROMPT command 10161 subttl PROMPT command 10162 10163 ; Parse the rest of the PROMPT command. 10164 10165 002420'01 260 17 0 00 002405* .promp: confrm ; Confirm. 10166 002421'01 263 17 0 00 000000 ret 10167 10168 remark PROMPT command execution. 10169 10170 002422'01 402 00 0 00 001353* $promp: setzm f$exit ; Reset exit flag. 10171 002423'01 263 17 0 00 000000 ret 10172 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20PAR MAC 20-Aug-24 23:12 PUSH command 10173 subttl PUSH command 10174 10175 002424'01 260 17 0 00 002420* .push: confrm 10176 002425'01 263 17 0 00 000000 ret 10177 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20PAR MAC 20-Aug-24 23:12 RECEIVE command 10178 subttl RECEIVE command 10179 10180 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 10181 000515'02 005005 000520' recfdb: flddb. .cmofi,cm%sdh,,,,recfd1 ;[231] 10182 000516'02 000000 000000 10183 000517'02 44 07 0 00 002350' 10184 000520'02 010005 000000 recfd1: flddb. .cmcfm,cm%sdh,, 10185 000521'02 000000 000000 10186 000522'02 44 07 0 00 002357' 10187 000523'02 010000 000000 reccfm: flddb. .cmcfm 10188 000524'02 000000 000000 10189 retsec ;;Back to where-ever we started from 10190 cleans() 10191 10192 ; Parse a filespec or just confirmation. 10193 10194 002426'01 200 16 0 00 000000# .recv: guide ; First, issue guide word. 10195 002427'01 260 17 0 00 002373* 10196 000525'02 000000000000# 10197 001141'04 151 156 164 157 040 10198 002430'01 201 01 0 00 000000# movei t1, recfdb 10199 002431'01 260 17 0 00 002375* call rfield ; Parse a file spec or a confirm. 10200 002432'01 135 03 0 00 006256' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 10201 002433'01 302 03 0 00 000005 caie t3, .cmofi ; Is it an input file spec? 10202 002434'01 263 17 0 00 000000 ret ; If not it must be a confirm, so done. 10203 10204 002435'01 202 02 0 00 001504* movem t2, filjfn ; Filespec, so save the JFN, 10205 002436'01 201 01 0 00 000000# movei t1, reccfm ; and parse the confirmation. 10206 002437'01 260 17 0 00 000000* call rflde 10207 002440'01 254 00 0 00 002447' ifskp. ;[193] Confirmed! 10208 002441'01 550 01 0 00 002435* hrrz t1, filjfn ;[193] Load output file JFN 10209 002442'01 260 17 0 00 002304* call isnulj ;[193] Is it NUL:? 10210 002443'01 263 17 0 00 000000 ret ;[193] No, we're done 10211 002444'01 202 01 0 00 002441* movem t1, filjfn ;[193] Stomp in as JFN 10212 002445'01 200 02 0 00 000001 move t2, t1 ;[193] And also for anyone who wants it, downstream 10213 002446'01 263 17 0 00 000000 ret ;[193] Finally get out of here 10214 002447'01 endif. ;[193] End case .CMCFM 10215 10216 ; Parse error handler. 10217 10218 002447'01 337 01 0 00 002444* skipg t1, filjfn ; Release any JFN. 10219 002450'01 254 00 0 00 002455' ifskp. ;[193] Have...something 10220 002451'01 306 01 0 00 377777 cain t1, .nulio ;[193] Special NUL:? 10221 002452'01 254 00 0 00 002455' anskp. ;[193] Yes, that does not need releasing 10222 002453'01 104 00 0 00 000023 RLJFN% 10223 002454'01 320 12 0 00 002455' erjmpr .+1 ;[193] Retrieve and ignore any errors. 10224 002455'01 endif. ;[193] End case releasing a JFN 10225 002455'01 402 00 0 00 002447* setzm filjfn ; Zero the JFN to indicate we don't have one. 10226 002456'01 200 01 0 00 000000# emsg ;[187] Issue our own parse message 10227 002457'01 104 00 0 00 000313 10228 000526'02 000000000000# 10229 001143'04 116 157 164 040 143 10230 002460'01 254 00 0 00 002412* jrst cmder1 ; and get back inside CMD to clean up. 10231 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20PAR MAC 20-Aug-24 23:12 SHOW command parser 10232 subttl SHOW command parser 10233 10234 remark SHOW keyword table 10235 10236 ; All display routines moved to k20dsp 10237 10238 000527'02 000000 000000 %table(shotab) ;[39] (this whole keyword table) 10239 000530'02 000000# 000000 %key2 ,0 10240 000502'03 141 154 154 000 000 10241 000531'02 000000# 000000* %key2 ,$shday## ;[194] 10242 000503'03 144 141 171 164 151 10243 000532'02 000000# 000000* %key2 ,$shdeb## ;[194] 10244 000505'03 144 145 142 165 147 10245 000533'02 000000# 000000* %key2 ,$shfil## ;[194] 10246 000507'03 146 151 154 145 055 10247 000534'02 000000# 000000* %key2 ,$shinp## ;[160] ;[194] 10248 000511'03 151 156 160 165 164 10249 000535'02 000000# 000000* %key2 ,$shlin## ;[194] 10250 000514'03 154 151 156 145 000 10251 000536'02 000000# 000000* %key2 ,$shmac## ;[77] ;[194] 10252 000515'03 155 141 143 162 157 10253 000537'02 000000# 000000* %key2 ,$shpkt## ;[194] 10254 000517'03 160 141 143 153 145 10255 000540'02 000000# 000000* %keyf3 ,$stat##, cm%inv ;[186] Tom gets sleepy... 10256 000522'03 002000 000001 10257 000523'03 163 164 141 164 151 10258 000541'02 000000# 000000* %key2 ,$shtim## ;[194] 10259 000526'03 164 151 155 151 156 10260 000542'02 000000# 000000* %key2 ,$shtrc## ;[266] 10261 000531'03 164 162 141 156 163 10262 000543'02 000000# 000000* %key2 ,$shver## ;[194] 10263 000535'03 166 145 162 163 151 10264 000527'02 000014 000014 %tbend 10265 10266 remark SHOW command parser 10267 10268 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 10269 000544'02 000004 000547' shomac: flddb. .cmkey,,mactab,,,shofdb 10270 000545'02 000000000000# 10271 000546'02 44 07 0 00 002366' 10272 000547'02 000006 000553' shofdb: flddb. .cmkey,,shotab,,,shcnfm 10273 000550'02 000000 000527' 10274 000551'02 44 07 0 00 002370' 10275 000552'02 44 07 0 00 002373' 10276 000553'02 010004 000000 shcnfm: flddb. .cmcfm,,, ;[201] Macros and allow confirm 10277 000554'02 000000 000000 10278 000555'02 44 07 0 00 002374' 10279 retsec ;;Back to where-ever we started from 10280 cleans() 10281 10282 002461'01 554 04 0 00 000000* .show: hlrz t4, mactab ;[201] Load count of items (macros) in table 10283 002462'01 326 04 0 00 002467' ife. t4 ;[201] No macros defined? 10284 002463'01 200 16 0 00 000000# guide ; SHOW command 10285 002464'01 260 17 0 00 002427* 10286 000556'02 000000000000# k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44-1 K20PAR MAC 20-Aug-24 23:12 SHOW command parser 10287 001146'04 160 141 162 141 155 10288 002465'01 201 01 0 00 000000# movei t1, shofdb ;[201] Just show parameter table 10289 002466'01 254 00 0 00 002472' else. ;[201] Otherwise, could select a macro 10290 002467'01 200 16 0 00 000000# guide ;[201] 10291 002470'01 260 17 0 00 002464* 10292 000557'02 000000000000# 10293 001151'04 160 141 162 141 155 10294 002471'01 201 01 0 00 000000# movei t1, shomac ;[201] Either macro or parameter 10295 002472'01 endif. ;[201] 10296 002472'01 260 17 0 00 002431* call rfield ;[201] Try to parse something 10297 002473'01 135 04 0 00 006256' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ;[201] Get function code. 10298 002474'01 302 04 0 00 000010 caie t4, .cmcfm ;[201] Was this a confirm? 10299 002475'01 254 00 0 00 002502' ifskp. ;[201] It was, so 10300 002476'01 400 02 0 00 000000 setz t2, ;[201] Load talisman for all 10301 002477'01 124 02 0 00 001725* dmovem t2, pars2 ;[201] Save tweaked parse results 10302 002500'01 202 04 0 00 002413* movem t4, pars4 ;[201] Also the function code 10303 002501'01 254 00 0 00 002505' else. ;[201] No, so tie off the line 10304 002502'01 124 02 0 00 002477* dmovem t2, pars2 ;[201] Save raw parse results 10305 002503'01 202 04 0 00 002500* movem t4, pars4 ;[201] Also the function code 10306 002504'01 260 17 0 00 002424* confrm ;[201] Does not modify t1, t2, t3, t4 10307 002505'01 endif. ;[201] End case line not confirmed 10308 10309 002505'01 263 17 0 00 000000 ret 10310 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20PAR MAC 20-Aug-24 23:12 SHOW command semantic action driver 10311 subttl SHOW command semantic action driver 10312 10313 002506'01 474 01 0 00 000000 $show: seto t1, ;[201] Assume showing macros 10314 002507'01 120 02 0 00 002502* dmove t2, pars2 ;[201] Load raw (or tweaked) results 10315 002510'01 200 04 0 00 002503* move t4, pars4 ;[201] and the function code 10316 10317 002511'01 302 04 0 00 000010 caie t4, .cmcfm ;[201] Just a confirm? 10318 002512'01 254 00 0 00 002515' ifskp. ;[201] Yes, phony that up 10319 002513'01 403 01 0 00 000002 setzb t1, t2 ;[201] Say a keyword from parameter table 10320 002514'01 254 00 0 00 002522' else. ;[201] No, let's look a little further 10321 002515'01 621 03 0 00 777777 tlz t3, -1 ;[201] Stomp given address 10322 002516'01 302 03 0 00 000000# caie t3, shofdb ;[201] Wanted to show a parameter? 10323 002517'01 254 00 0 00 002522' anskp. ;[201] No, a macro 10324 002520'01 550 02 0 02 000000 hrrz t2, (t2) ;[201] Pick up the key table entry data 10325 002521'01 400 01 0 00 000000 setz t1, ;[201] Flag that it is a parameter 10326 002522'01 endif. ;[201] End case keyword table decode 10327 10328 002522'01 326 01 0 00 002532' ife. t1 ;[201] Was this a parameter? 10329 002523'01 326 02 0 00 002526' ife. t2 ;[201] All (or confirm)? 10330 002524'01 515 05 0 00 600000 hrlzi q1,() ;[201] Never return from each one 10331 002525'01 254 00 0 00 000000* callret $shtop## ;[201] Start from the top and do all 10332 002526'01 endif. ;[201] End case All or Confirm 10333 002526'01 200 05 0 00 006270' move q1, [ret] ;[201] A single item, so return after it 10334 002527'01 561 01 0 00 001650* hrroi t1, crlf ;[39] Single SHOW item. 10335 002530'01 104 00 0 00 000076 PSOUT% ;[201] Emit blank line, 10336 002531'01 254 00 0 02 000000 jrst (t2) ;[39] then go show the requested stuff. 10337 002532'01 endif. ;[201] 10338 10339 002532'01 200 01 0 00 000000# txmsg < > ;[201] Space over twice 10340 002533'01 104 00 0 00 000076 10341 002534'01 320 12 0 00 002535' 10342 000560'02 000000000000# 10343 001155'04 040 040 000 000 000 10344 002535'01 564 01 0 02 000000 hlro t1, (t2) ;[201] Point to macro name. 10345 002536'01 104 00 0 00 000076 PSOUT% ;[201] Print it. 10346 002537'01 200 01 0 00 000000# txmsg < = > ;[201] Show equivalence 10347 002540'01 104 00 0 00 000076 10348 002541'01 320 12 0 00 002542' 10349 000561'02 000000000000# 10350 001156'04 040 075 040 000 000 10351 002542'01 560 01 0 02 000000 hrro t1, (t2) ;[201] Point to body of macro 10352 002543'01 104 00 0 00 000076 PSOUT% ;[201] Print that 10353 002544'01 260 17 0 00 000000* call ifcrlf ;[201] Maybe do a CRLF 10354 10355 002545'01 263 17 0 00 000000 ret ;[201] Finally done 10356 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20PAR MAC 20-Aug-24 23:12 TAKE command parsing 10357 subttl TAKE command parsing 10358 10359 ; Default command filespec fields for .CMFIL: 10360 10361 chgsec(code,const) ;;FDB's are not in code, they're in const 10362 000562'02 100000 000000 defbk: gj%old ; Must be existing file. 10363 repeat 4,<0> ; Normal defaults for dev:name. 10364 000563'02 000000 000000 10365 000564'02 000000 000000 10366 000565'02 000000 000000 10367 000566'02 000000 000000 10368 000567'02 000000000000# cascii () ; Default extension is .CMD. 10369 001157'04 103 115 104 000 000 10370 000570'02 000000000000# 0 ; Default protection, 10371 000571'02 000000 000000 0 ; and account. 10372 000010 defbkl==<.-defbk> ; Length of this GTJFN argument block. 10373 10374 000572'02 006000 000000 takfdb: flddb. .cmfil 10375 000573'02 000000 000000 10376 retsec ;;Back to where-ever we started from 10377 10378 002546'01 200 01 0 00 006430' .take: movx t1, cz%ncl!.fhslf ; Release non-open jfn's. 10379 002547'01 104 00 0 00 000034 CLZFF 10380 002550'01 200 16 0 00 000000# guide 10381 002551'01 260 17 0 00 002470* 10382 000574'02 000000000000# 10383 001160'04 143 157 155 155 141 10384 002552'01 200 01 0 00 006431' move t1, [defbk,,cjfnbk] ; Insert our file parsing defaults. 10385 002553'01 251 01 0 00 000000# blt t1, cjfnbk+defbkl 10386 002554'01 201 01 0 00 000000# movei t1, takfdb 10387 002555'01 260 17 0 00 001533* call cfield 10388 002556'01 202 02 0 00 002507* movem t2, pars2 ; Here's the JFN just parsed. 10389 002557'01 263 17 0 00 000000 ret 10390 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20PAR MAC 20-Aug-24 23:12 TAKE command semantic action 10391 subttl TAKE command semantic action 10392 10393 ; added as edit 78. 10394 10395 002560'01 200 01 0 00 000075* $take: move t1, takdep ; How deep are we? 10396 002561'01 307 01 0 00 000024 caig t1, takel ;[194] Too deep? 10397 002562'01 254 00 0 00 002566' ifskp. ;[194] Indeed 10398 002563'01 200 01 0 00 000000# emsg ;[187] 10399 002564'01 104 00 0 00 000313 10400 000575'02 000000000000# 10401 001164'04 124 101 113 105 040 10402 002565'01 263 17 0 00 000000 ret ;[194] don't do it. 10403 002566'01 endif. ;[194] 10404 002566'01 200 01 0 00 000103* move t1, takjfn ; There's room, get current TAKE file jfn. 10405 002567'01 200 02 0 00 000000* move t2, takep ; Push it on the stack 10406 002570'01 261 02 0 00 000001 push t2, t1 ; ... 10407 002571'01 202 02 0 00 002567* movem t2, takep ; ... 10408 002572'01 350 00 0 00 002560* aos takdep ; Remember what level we're on. 10409 10410 002573'01 200 01 0 00 002556* move t1, pars2 ; Get JFN that was parsed 10411 002574'01 202 01 0 00 002566* movem t1, takjfn ; ... 10412 002575'01 200 02 0 00 006432' movx t2, fld(7,of%bsz)!of%rd ; 7-bit i/o, read access. 10413 002576'01 104 00 0 00 000021 OPENF 10414 002577'01 320 12 0 00 002601' %jserr (,$takex) 10415 002600'01 254 00 0 00 002604' 10416 002601'01 265 01 0 00 002344* 10417 002602'01 000000 000000 10418 002603'01 254 00 0 00 002605' 10419 002604'01 254 00 0 00 000000* callret setcsb ; Opened OK, go set up command state block. 10420 10421 ; Error opening command file. 10422 10423 002605'01 260 17 0 00 002617' $takex: call popjfn ; Remove offending JFN from TAKE stack. 10424 002606'01 604 00 0 00 000000 ifnsk. ;[194] 10425 002607'01 254 00 0 00 002613' 10426 002610'01 200 01 0 00 000000# emsg ;[187] 10427 002611'01 104 00 0 00 000313 10428 000576'02 000000000000# 10429 001173'04 124 101 113 105 040 10430 002612'01 263 17 0 00 000000 ret 10431 002613'01 endif. ;[194] 10432 10433 002613'01 200 01 0 00 006430' movx t1, cz%ncl!.fhslf ; Release extraneous JFNs. 10434 002614'01 104 00 0 00 000034 CLZFF 10435 002615'01 320 16 0 00 002616' erjmp .+1 10436 002616'01 263 17 0 00 000000 ret 10437 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20PAR MAC 20-Aug-24 23:12 POPJFN 10438 subttl POPJFN 10439 10440 ; Routine to pop a command file JFN off the JFN stack. 10441 ; 10442 ; Enter with current command file jfn in TAKJFN. 10443 ; 10444 ; Returns: 10445 ; +1 if stack empty, 10446 ; +2 otherwise, with popped jfn in TAKJFN. 10447 10448 002617'01 popjfn: entry popjfn ; Also found in K20IOC 10449 002617'01 337 00 0 00 002572* skipg takdep ; Back at top level? 10450 002620'01 263 17 0 00 000000 ret ; Yes, return silently. 10451 10452 ; Close current command file. 10453 10454 002621'01 337 01 0 00 002574* skipg t1, takjfn ;[209] Load the JFN (if there is one) 10455 002622'01 254 00 0 00 002635' ifskp. ;[209] There is, so let's get on with it 10456 002623'01 402 00 0 00 002621* setzm takjfn ;[209] Stomp it, no matter what 10457 002624'01 621 01 0 00 777777 tlz t1, -1 ;[209] Whack any flags 10458 002625'01 306 01 0 00 377777 cain t1, .nulio ;[209] This kind of confusion?? 10459 002626'01 254 00 0 00 002635' anskp. ;[209] Actually, yes, so don't bother 10460 002627'01 104 00 0 00 000022 CLOSF ;[209] Real enough; close it 10461 002630'01 320 12 0 00 002632' %jserr (,) ; Just print message on error. 10462 002631'01 254 00 0 00 002635' 10463 002632'01 265 01 0 00 002601* 10464 002633'01 000000 000000 10465 002634'01 254 00 0 00 002635' 10466 002635'01 endif. ;[209] Either way, carry on 10467 10468 ; Return to previous one. 10469 10470 002635'01 200 02 0 00 002571* move t2, takep ; Get the TAKE stack pointer 10471 002636'01 262 02 0 00 000001 pop t2, t1 ; and the previous TAKE file JFN, 10472 002637'01 202 02 0 00 002635* movem t2, takep ; restore them, 10473 002640'01 202 01 0 00 002623* movem t1, takjfn ; ... 10474 002641'01 260 17 0 00 002604* call setcsb ; and also restore the command state block. 10475 002642'01 370 00 0 00 002617* sos takdep ; Decrement the depth indicator 10476 002643'01 254 00 0 00 002371* retskp ; Return successfully. 10477 10478 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20PAR MAC 20-Aug-24 23:12 Process initialization file. 10479 subttl Process initialization file. 10480 10481 ;[79] INIFIL added 10482 ; 10483 ;[85] Returns +1 if there was no init file, +2 if there was. 10484 ; 10485 ;[220] Rewritten to not assume PS: is the login structure 10486 ; Also unrolled the loop (prior to maybe redoing with movslj) 10487 10488 remark 1 2 3 4 5 10489 002644'01 456132 246622 kerini: byte (7) "K","E","R","M","I" 10490 002645'01 521351 147222 byte (7) "T",".","I","N","I" 10491 10492 002646'01 inifil: entry inifil ;[220] Invoked by k20mit 10493 002646'01 265 16 0 00 006273' saveac ;[220] Needs an index variable 10494 002647'01 265 16 0 00 000000* anstkv (q1,dirmxw) ;[220] Allocate space for login directory 10495 002650'01 000000 000012 10496 002651'01 415 05 0 17 777765 10497 10498 002652'01 560 01 0 00 000005 hrro t1, q1 ;[220] Build Tops-20 pointer to stack 10499 002653'01 200 02 0 00 000000# move t2, .jilno+jobtab ;[220] Job's logged in directory number 10500 002654'01 104 00 0 00 000041 DIRST% ;[220] Build the entire directory 10501 002655'01 320 12 0 00 002657' %jserr (,r) ;[220] Punt 10502 002656'01 254 00 0 00 002662' 10503 002657'01 265 01 0 00 002632* 10504 002660'01 000000000000# 10505 002661'01 254 00 0 00 002346* 10506 001201'04 125 156 141 142 154 10507 10508 002662'01 120 03 0 00 002644' dmove t3, kerini ;[220] Load file name 10509 repeat ^d5,< ;;[220] Do the first word 10510 lshc t2, ^d7 ;;[220] Load a character in t2 10511 idpb t2, t1 ;;[220] Append to directory specification 10512 > ;;[220] End of first word 10513 002663'01 246 02 0 00 000007 10514 002664'01 136 02 0 00 000001 10515 002665'01 246 02 0 00 000007 10516 002666'01 136 02 0 00 000001 10517 002667'01 246 02 0 00 000007 10518 002670'01 136 02 0 00 000001 10519 002671'01 246 02 0 00 000007 10520 002672'01 136 02 0 00 000001 10521 002673'01 246 02 0 00 000007 10522 002674'01 136 02 0 00 000001 10523 10524 repeat ^d5,< ;;[220] Do the second word 10525 lshc t3, ^d7 ;;[220] Load a character in t3 10526 idpb t3, t1 ;;[220] Append to directory specification 10527 > ;;[220] End of first word 10528 002675'01 246 03 0 00 000007 10529 002676'01 136 03 0 00 000001 10530 002677'01 246 03 0 00 000007 10531 002700'01 136 03 0 00 000001 10532 002701'01 246 03 0 00 000007 10533 002702'01 136 03 0 00 000001 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49-1 K20PAR MAC 20-Aug-24 23:12 Process initialization file. 10534 002703'01 246 03 0 00 000007 10535 002704'01 136 03 0 00 000001 10536 002705'01 246 03 0 00 000007 10537 002706'01 136 03 0 00 000001 10538 10539 002707'01 400 03 0 00 000000 setz t3, ;[220] Cons up a zero 10540 002710'01 136 03 0 00 000001 idpb t3, t1 ;[220] Tie off the file specification 10541 10542 002711'01 205 01 0 00 100001 movx t1, gj%old!gj%sht ;[220] Existing file, only 10543 002712'01 560 02 0 00 000005 hrro t2, q1 ;[220] Build Tops-20 pointer to completed specification 10544 002713'01 104 00 0 00 000020 GTJFN% ;[220] Get JFN on it. 10545 002714'01 320 12 0 00 002661* erjmpr r ;[220] If we can't, return silently. 10546 002715'01 552 01 0 00 002573* hrrzm t1, pars2 ; Got one, pretend we parsed it. 10547 002716'01 476 00 0 00 000000* setom iniflg ;[83] Flag that we're doing init file. 10548 002717'01 260 17 0 00 002560' call $take ; Go TAKE the file. 10549 002720'01 254 00 0 00 002643* retskp ;[85] 10550 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20PAR MAC 20-Aug-24 23:12 SEND command 10551 subttl SEND command 10552 10553 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 10554 000577'02 006004 000000 sndfdb: flddb. .cmfil,,,,, 10555 000600'02 000000 000000 10556 000601'02 44 07 0 00 002401' 10557 000602'02 010004 000605' sasfdb: flddb. .cmcfm,,,,,sasfd1 10558 000603'02 000000 000000 10559 000604'02 44 07 0 00 002410' 10560 000605'02 021004 000610' sasfd1: flddb. .cmqst,,,,,sasfd2 10561 000606'02 000000 000000 10562 000607'02 44 07 0 00 002415' 10563 000610'02 017004 000000 sasfd2: flddb. .cmtxt,,, 10564 000611'02 000000 000000 10565 000612'02 44 07 0 00 002415' 10566 000613'02 010004 000616' saifdb: flddb. .cmcfm,,,,,saifd1 10567 000614'02 000000 000000 10568 000615'02 44 07 0 00 002427' 10569 000616'02 006004 000000 saifd1: flddb. .cmfil,,, 10570 000617'02 000000 000000 10571 000620'02 44 07 0 00 002433' 10572 000621'02 010000 000000 sndcfm: flddb. .cmcfm 10573 000622'02 000000 000000 10574 retsec ;;Back to where-ever we started from 10575 cleans() 10576 10577 002721'01 200 16 0 00 000000# .send: guide ; Issue guide words. 10578 002722'01 260 17 0 00 002551* 10579 000623'02 000000000000# 10580 001211'04 146 162 157 155 040 10581 002723'01 200 02 0 00 000000# move t2, cjfnbk+.gjgen ; Get the JFN flag bits. 10582 002724'01 661 02 0 00 100100 txo t2, gj%ifg!gj%old ; Old file(s), allow wild cards. 10583 002725'01 620 02 0 00 777777 trz t2, -1 ;[172] Default to most recent generation only. 10584 002726'01 202 02 0 00 000000# movem t2, cjfnbk+.gjgen ; Return the JFN flag bits. 10585 002727'01 402 00 0 00 000000# setzm cjfnbk+.gjext ;[172] No default extension. 10586 10587 002730'01 201 01 0 00 000000# movei t1, sndfdb 10588 002731'01 260 17 0 00 002472* call rfield ; Parse a file spec or a confirm. 10589 002732'01 200 01 0 00 000002 move t1, t2 ;[193] Position the JFN 10590 002733'01 260 17 0 00 002442* call isnulj ;[193] Find out if it's NUL: 10591 002734'01 600 00 0 00 000000 nop ;[193] No, it isn't, but we don't care 10592 002735'01 202 01 0 00 002715* movem t1, pars2 ;[193] 10593 10594 002736'01 603 01 0 00 770000 ifxe. t1, gj%wld ;[193] Any wildcards in it? 10595 002737'01 254 00 0 00 002744' 10596 002740'01 200 16 0 00 000000# guide ;[96] No, then let them choose a new name. 10597 002741'01 260 17 0 00 002722* 10598 000624'02 000000000000# 10599 001214'04 141 163 000 000 000 10600 002742'01 201 01 0 00 000000# movei t1, sasfdb 10601 002743'01 254 00 0 00 002747' else. ;[194] Otherwise, something was wildcarded 10602 002744'01 200 16 0 00 000000# guide ; prompt for initial. 10603 002745'01 260 17 0 00 002741* 10604 000625'02 000000000000# 10605 001215'04 151 156 151 164 151 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50-1 K20PAR MAC 20-Aug-24 23:12 SEND command 10606 002746'01 201 01 0 00 000000# movei t1, saifdb 10607 002747'01 endif. ;[194] 10608 10609 002747'01 260 17 0 00 002437* call rflde ; Parse the field. 10610 002750'01 254 00 0 00 003004' jrst .sende ;[63] Handle errors explicitly. 10611 002751'01 135 03 0 00 006256' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 10612 002752'01 306 03 0 00 000021 cain t3, .cmqst ;[208] Quoted string? 10613 002753'01 201 03 0 00 000017 movei t3, .cmtxt ;[208] Pretend it's text (because it is) 10614 002754'01 202 03 0 00 002307* movem t3, pars3 ;[96] Save it for execution. 10615 10616 002755'01 306 03 0 00 000010 cain t3, .cmcfm ; Confirmation? 10617 002756'01 263 17 0 00 000000 ret ; Yes, just return. 10618 10619 002757'01 302 03 0 00 000006 caie t3, .cmfil ;[96] File? 10620 002760'01 254 00 0 00 002772' ifskp. ;[194] Yes 10621 002761'01 200 01 0 00 000002 move t1, t2 ;[193] Position the JFN 10622 002762'01 260 17 0 00 002733* call isnulj ;[193] Find out if it's NUL: 10623 002763'01 334 00 0 00 000000 skipa ;[193] No, it isn't, but we don't care 10624 002764'01 200 02 0 00 000001 move t2, t1 ;[193] Reposition so stored properly 10625 002765'01 542 02 0 00 002735* hrrm t2, pars2 ;[117] Initial filespec - substitute it. 10626 002766'01 201 01 0 00 000000# movei t1, sndcfm ; Get command confirmation. 10627 002767'01 260 17 0 00 002747* call rflde 10628 002770'01 254 00 0 00 003004' jrst .sende ;[194] Didn't confirm, parse error 10629 002771'01 263 17 0 00 000000 ret 10630 002772'01 endif. ;[194] 10631 10632 ;[96] If they gave an alternate name, copy it out of the atom buffer. 10633 10634 002772'01 302 03 0 00 000017 caie t3, .cmtxt ; Text? 10635 002773'01 254 00 0 00 003004' jrst .sende ; No, error. 10636 ; Copy the string out of the atom buffer. 10637 dmove t1, [point 7, atmbuf 10638 002774'01 120 01 0 00 006433' point 7, buffer] 10639 002775'01 402 00 0 00 001526* setzm buffer 10640 002776'01 260 17 0 00 000000* call movstu 10641 002777'01 326 03 0 00 003002' ife. t3 ;[194] If nothing, act like we parsed a confirm. 10642 003000'01 201 03 0 00 000010 movei t3, .cmcfm 10643 003001'01 202 03 0 00 002754* movem t3, pars3 10644 003002'01 endif. ;[194] 10645 003002'01 260 17 0 00 002504* confrm ;[208] And tie off the line 10646 003003'01 263 17 0 00 000000 ret 10647 10648 003004'01 333 01 0 00 002455* .sende: skiple t1, filjfn ;[194] Error - get the JFN. 10649 003005'01 104 00 0 00 000023 RLJFN% ; Release it. 10650 003006'01 320 12 0 00 003007' erjmpr .+1 ;[194] Catch and ignore any errors. 10651 003007'01 402 00 0 00 003004* setzm filjfn ; Nullify the JFN. 10652 003010'01 200 01 0 00 000000# emsg 10653 003011'01 104 00 0 00 000313 10654 000626'02 000000000000# 10655 001217'04 116 157 164 040 143 10656 003012'01 254 00 0 00 002460* jrst cmder1 10657 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20PAR MAC 20-Aug-24 23:12 SERVER command 10658 subttl SERVER command 10659 10660 003013'01 260 17 0 00 003002* .serve: confrm ; Confirm. 10661 003014'01 263 17 0 00 000000 ret 10662 10663 remark Execute the SERVER command. 10664 10665 ;[144] Remove test for remote mode operation. KERMIT-20 works fine as 10666 ; a server over an assigned line, although the messages may look a bit 10667 ; strange. 10668 10669 003015'01 $serve: extern getcom 10670 003015'01 260 17 0 00 000000* call getcom ; Go serve. 10671 ;[137] setzm f$exit ;[110] Return to command mode if they ^C out. 10672 003016'01 263 17 0 00 000000 ret 10673 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20PAR MAC 20-Aug-24 23:12 CONNECT command, kind of like SET LINE 10674 subttl CONNECT command, kind of like SET LINE 10675 10676 remark CONNECT Parsing tables and function descriptor blocks 10677 10678 ;N.B., Remove abbreviation if we ever do pipes 10679 10680 000627'02 000000 000000 %table(pseutb) ;[186] 10681 000630'02 000000# 000631' %keyf3

, %pseud, 10682 000537'03 002000 000005 10683 000540'03 160 000 000 000 000 10684 ; %key2 , .dvpip ;[186] Loopback to same job (subfork) 10685 000631'02 000000# 000013 %pseud: %key2 , .dvpty ;[186] Loopback to another job 10686 000541'03 160 163 145 165 144 10687 000632'02 000000# 000013 %keyf3 , .dvpty, cm%inv ;[186] another way of saying pseudo 10688 000545'03 002000 000001 10689 000546'03 160 164 171 000 000 10690 000627'02 000003 000003 %tbend ;[186] 10691 10692 cleans(<%pseud>) ;;Clean up working symbol 10693 10694 000633'02 000000 000000 %table(mantab) ;[205] 10695 000634'02 000000# 000015 %key2 ,.dvnul ;[205] Close open connection (if open) 10696 000547'03 143 154 157 163 145 10697 000635'02 000000# 777774 %key2 ,.fhinf ;[205] Clobber terminal fork 10698 000551'03 153 151 154 154 000 10699 000633'02 000002 000002 %tbend ;[205] 10700 10701 000636'02 000000 000000 %table(conswi) ;[205] 10702 000637'02 000000# 000000# %key2 ,swifrk ;[236] Wants Tops-20 to handle NRT 10703 000552'03 146 157 162 153 154 10704 000640'02 000000# 000000# %key2 ,swista ;[205] Don't create (or resume) transfer fork 10705 000554'03 163 164 141 171 000 10706 000641'02 000000# 000644' %keyf3 , %tim, ;[218] 10707 000555'03 002000 000005 10708 000556'03 164 000 000 000 000 10709 000642'02 000000# 000644' %keyf3 , %tim, ;[218] 10710 000557'03 002000 000005 10711 000560'03 164 151 000 000 000 10712 000643'02 000000# 000644' %keyf3 , %tim, ;[218] 10713 000561'03 002000 000005 10714 000562'03 164 151 155 000 000 10715 000644'02 000000# 000000# %tim: %key2 ,switim ;[218] Override default timeout 10716 000563'03 164 151 155 145 157 10717 000645'02 000000# 000000# %keyf3 ,switim, cm%inv ;[218] Another way I mistype this 10718 000565'03 002000 000001 10719 000566'03 164 151 155 157 165 10720 000636'02 000007 000007 %tbend ;[205] 10721 10722 cleans(<%tim>) ;;Clean up working symbol 10723 10724 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 10725 000646'02 001004 000651' confdb: flddb. .cmnum,,^d8,,,confd1 10726 000647'02 000000 000010 10727 000650'02 44 07 0 00 002442' 10728 000651'02 000004 000654' confd1: flddb. .cmkey,,pseutb,,,confd2 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-1 K20PAR MAC 20-Aug-24 23:12 CONNECT command, kind of like SET LINE 10729 000652'02 000000 000627' 10730 000653'02 44 07 0 00 002452' 10731 000654'02 000004 000657' confd2: flddb. .cmkey,,mantab,,,confd3 10732 000655'02 000000 000633' 10733 000656'02 44 07 0 00 002461' 10734 000657'02 026044 000662' confd3: flddb. .cmnod,cm%nsf,,,,confd4 10735 000660'02 000000 000000 10736 000661'02 44 07 0 00 002467' 10737 000662'02 010004 000000 confd4: flddb. .cmcfm,,, 10738 000663'02 000000 000000 10739 000664'02 44 07 0 00 002474' 10740 10741 000665'02 003000 000667' cswfdb: flddb. .cmswi,,conswi,,,cswfd1 10742 000666'02 000000 000636' 10743 000667'02 010004 000000 cswfd1: flddb. .cmcfm,,, ;[218] 10744 000670'02 000000 000000 10745 000671'02 44 07 0 00 002504' 10746 000672'02 013005 000675' scmfdb: flddb. .cmcma,cm%sdh,,,,scmfd1 10747 000673'02 000000 000000 10748 000674'02 44 07 0 00 002512' 10749 000675'02 010000 000000 scmfd1: flddb. .cmcfm 10750 000676'02 000000 000000 10751 retsec ;;Back to where-ever we started from 10752 cleans() 10753 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20PAR MAC 20-Aug-24 23:12 CONNECT command parsing Switch 10754 SUBTTL CONNECT command parsing Switch 10755 10756 003017'01 swista: REMARK ;[205] Parse for /STAY 10757 003017'01 476 00 0 00 001211* setom pars5 ;[205] Flag connection to stay at Kermit command level 10758 003020'01 263 17 0 00 000000 ret ;[205] That's easy enough 10759 10760 10761 003021'01 swifrk: REMARK ;[236] Parse for /FORKLESS 10762 003021'01 476 00 0 00 001311* setom pars7 ;[236] Flag that we're doing .MOSNH 10763 003022'01 263 17 0 00 000000 ret ;[236] Go parse something else worthwhile 10764 10765 10766 003023'01 switim: REMARK ;[218] Parse for /TIMEOUT 10767 003023'01 265 16 0 00 006435' saveac ;[218] Needs some registers 10768 003024'01 120 05 0 00 002510* dmove q1, pars4 ;[218] Save whatever might already be parsed 10769 003025'01 200 07 0 00 002404* move q3, definf ;[218] Save the define context 10770 003026'01 476 00 0 00 003025* setom definf ;[218] Stomp, so it doesn't parse a confirm 10771 003027'01 260 17 0 00 006004' call .setim ;[218] Parse a floating point time 10772 003030'01 200 01 0 00 003024* move t1, pars4 ;[218] Load computed milliseconds 10773 003031'01 202 01 0 00 001254* movem t1, pars6 ;[218] Hand it off to waitcn 10774 003032'01 124 05 0 00 003030* dmovem q1, pars4 ;[218] Store what might allready be parsed 10775 003033'01 202 07 0 00 003026* movem q3, definf ;[218] Restore whatever the define context was 10776 003034'01 263 17 0 00 000000 ret ;[218] Return, restoring parsing context 10777 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20PAR MAC 20-Aug-24 23:12 CONNECT command parsing Switch 10778 REMARK CONNECT command main parsing 10779 10780 003035'01 476 00 0 00 003001* .conne: setom pars3 ;[186] Let's assume parsing fails 10781 003036'01 476 00 0 00 003032* setom pars4 ;[186] Fails completely, actually 10782 003037'01 402 00 0 00 003017* setzm pars5 ;[205] Assume will connect immediately 10783 003040'01 402 00 0 00 003031* setzm pars6 ;[218] Assume not overriding timeout 10784 003041'01 402 00 0 00 003021* setzm pars7 ;[236] Assume not using MTOPR%'s .MOSNH 10785 10786 003042'01 200 16 0 00 000000# guide 10787 003043'01 260 17 0 00 002745* 10788 000677'02 000000000000# 10789 001222'04 164 157 040 164 164 10790 remark ;[205] Don't reorder the flddb.'s! 10791 003044'01 201 01 0 00 000000# movei t1, confdb 10792 003045'01 260 17 0 00 002731* call rfield ;[205] Parse a tty number (or something...) 10793 003046'01 135 04 0 00 006256' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 10794 10795 003047'01 265 16 0 00 006341' .conn1: saveac ;[205] Needs another temporary 10796 003050'01 265 16 0 00 002647* anstkv (q2,^d4) ;[205] Copy of node name, if parsed 10797 003051'01 000000 000004 10798 003052'01 415 06 0 17 777773 10799 10800 003053'01 306 04 0 00 000000 cain t4, .cmkey ;[186] Any kind of keyword has a device type 10801 003054'01 550 05 0 02 000000 hrrz t5, (t2) ;[186] Get the requested device type 10802 003055'01 306 04 0 00 000026 cain t4, .cmnod ;[186] Parsed a node? 10803 003056'01 201 05 0 00 000022 movei t5, .dvdcn ;[186] Force DECnet client 10804 003057'01 306 04 0 00 000001 cain t4, .cmnum ;[186] Is it a number? 10805 003060'01 200 05 0 00 000002 move t5, t2 ;[186] Put in the terminal line number 10806 10807 003061'01 302 04 0 00 000010 caie t4, .cmcfm ;[186] Just gave us a confirm? 10808 003062'01 254 00 0 00 003065' ifskp. ;[186] That's fine, means reconnect 10809 003063'01 124 04 0 00 003035* dmovem t4, pars3 ;[186] Store parse type and device type or unit 10810 003064'01 263 17 0 00 000000 ret ;[186] Done with parse 10811 003065'01 endif. 10812 003065'01 332 00 0 00 003033* skipe definf ;[205] Not in a DEFINE? 10813 003066'01 254 00 0 00 003112' jrst .conn2 ;[205] No, we are; so go get cute with that 10814 ;[205] Store 20 characters of atom buffer 10815 003067'01 120 01 0 00 002171* dmove t1, atmbuf ;[205] Load first ten characters of the atom buffer 10816 003070'01 124 01 0 06 000000 dmovem t1, 0(q2) ;[205] Tuck them away 10817 003071'01 120 01 0 00 000000# dmove t1, atmbuf+2 ;[205] Next ten characters of the atom buffer 10818 003072'01 124 01 0 06 000002 dmovem t1, 2(q2) ;[205] Tuck those away 10819 10820 003073'01 do. ;[218] Enter loop context to parse switches 10821 003073'01 201 01 0 00 000000# movei t1, cswfdb 10822 003074'01 260 17 0 00 003045* call rfield ;[218] Parse something 10823 003075'01 135 03 0 00 006256' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 10824 003076'01 306 03 0 00 000010 cain t3, .cmcfm ;[218] Finally confirmed? 10825 003077'01 254 00 0 00 003103' exit. ;[218] Yes, break out of the loop 10826 003100'01 550 01 0 02 000000 hrrz t1, (t2) ;[236] Pick up the switch parsing routine 10827 003101'01 260 17 0 01 000000 call (t1) ;[236] Go parse some more 10828 003102'01 254 00 0 00 003073' loop. ;[218] And go around for more switchs 10829 003103'01 enddo. ;[218] End of loop lexical context 10830 10831 003103'01 120 01 0 06 000000 dmove t1, 0(q2) ;[205] Load ten characters of the saved atom buffer 10832 003104'01 124 01 0 00 003067* dmovem t1, atmbuf ;[205] And put them back k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54-1 K20PAR MAC 20-Aug-24 23:12 CONNECT command parsing Switch 10833 003105'01 120 01 0 06 000002 dmove t1, 2(q2) ;[205] Next ten characters of the saved atom buffer 10834 003106'01 124 01 0 00 000000# dmovem t1, atmbuf+2 ;[205] And put those back 10835 003107'01 402 00 0 00 000000# setzm atmbuf+5 ;[205] Make sure string is tied off 10836 10837 003110'01 124 04 0 00 003063* dmovem t4, pars3 ;[186] Store parse type and device type or unit 10838 003111'01 263 17 0 00 000000 ret 10839 10840 003112'01 .conn2: remark ;[205] Handle /stay in a define 10841 003112'01 124 04 0 00 003110* dmovem t4, pars3 ;[186] Store parse type and device type or unit 10842 003113'01 263 17 0 00 000000 ret 10843 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20PAR MAC 20-Aug-24 23:12 SET keyword table 10844 subttl SET keyword table 10845 10846 000700'02 000000 000000 %table(settab,G) ;[203] Also used by K20MAC 10847 000701'02 000000# 000000# %key3 , .setbl,$setbl ;[277] 10848 000570'03 142 154 151 160 000 10849 000571'03 000000# 000000# 10850 000702'02 000000# 000000# %key3 , .setbc, $setbc ;[98] 10851 000572'03 142 154 157 143 153 10852 000575'03 000000# 000000# 10853 000703'02 000000# 000000# %key3 , .setbr, $setbr 10854 000576'03 142 162 145 141 153 10855 000600'03 000000# 000000# 10856 ;;;; %key3 , .setcp, $setcp ;;[266] (currently uses TRANSMIT?) 10857 000704'02 000000# 000000# %key3 , .setdb, $setdb 10858 000601'03 144 145 142 165 147 10859 000603'03 000000# 000000# 10860 000705'02 000000# 000000# %key3 , .setdl, $setdl ;[194] 10861 000604'03 144 145 154 141 171 10862 000606'03 000000# 000000# 10863 000706'02 000000# 000000# %key3 , .setdu, $setdu ;[194] 10864 000607'03 144 165 160 154 145 10865 000611'03 000000# 000000# 10866 000707'02 000000# 000000# %key3 , .setes, $setes ;[194] 10867 000612'03 145 163 143 141 160 10868 000614'03 000000# 000000# 10869 000710'02 000000# 000000# %key3 , .setex, $setex ;[143] ;[194] 10870 000615'03 145 170 160 165 156 10871 000617'03 000000# 000000# 10872 000711'02 000000# 000000# %key3 , .setfi, $setfi ;[194] 10873 000620'03 146 151 154 145 000 10874 000621'03 000000# 000000# 10875 000712'02 000000# 000000# %key3 , .setfl, $setfl ;[143] ;[194] 10876 000622'03 146 154 157 167 055 10877 000625'03 000000# 000000# 10878 000713'02 000000# 000000# %key3 , .setha, $setha ;[76] 10879 000626'03 150 141 156 144 163 10880 000630'03 000000# 000000# 10881 000714'02 000000# 000000# %key3 , .seths, $setln## ;[194] 10882 000631'03 150 157 163 164 000 10883 000632'03 000000# 000000* 10884 000715'02 000000# 000000# %key3 , .setab, $setab ;[194] 10885 000633'03 151 156 143 157 155 10886 000636'03 000000# 000000# 10887 000716'02 000000# 000000# %key3 , .setin##, $setrs ;[160] ;[194] 10888 000637'03 151 156 160 165 164 10889 000641'03 000000* 000000# 10890 000717'02 000000# 000000# %key3 , .setit, $setit ;[194] 10891 000642'03 111 124 123 055 142 10892 000645'03 000000# 000000# 10893 000720'02 000000# 000000# %key3 , .setln, $setln## ;[186] ;[194] 10894 000646'03 154 151 156 145 000 10895 000647'03 000000# 000632* 10896 000721'02 000000# 000000# %key3 , .setpa##, $setpa## ;[194] 10897 000650'03 160 141 162 151 164 10898 000652'03 000000* 000000* k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55-1 K20PAR MAC 20-Aug-24 23:12 SET keyword table 10899 000722'02 000000# 000000# %key3 , .setpr, $setpr ;[194] 10900 000653'03 160 162 157 155 160 10901 000655'03 000000# 000000# 10902 000723'02 000000# 000000# %key3 , .setrc, $setrs ;[194] 10903 000656'03 162 145 143 145 151 10904 000660'03 000000# 000000# 10905 000724'02 000000# 000000# %key3 , .setre, $setre ;[194] 10906 000661'03 162 145 164 162 171 10907 000663'03 000000# 000000# 10908 000725'02 000000# 000726' %keyf3 , %snd3, 10909 000664'03 002000 000005 10910 000665'03 163 145 000 000 000 10911 000726'02 000000# 000000# %snd3: %key3 , .setsn, $setrs ;[194] 10912 000666'03 163 145 156 144 000 10913 000667'03 000000# 000000# 10914 000727'02 000000# 000000# %keyf4 , .setim, $setst, cm%inv ;[212] Tops-10 has it here 10915 000670'03 002000 000001 10916 000671'03 163 145 162 166 145 10917 000674'03 000000# 000000# 10918 000730'02 000000# 000000# %key3 , .setxp, $setsp ;[194] 10919 000675'03 163 160 145 145 144 10920 000677'03 000000# 000000# 10921 000731'02 000000# 000000# %keyf4 , .setim, $setst, cm%inv ;[212] keep typing this.. 10922 000700'03 002000 000001 10923 000701'03 163 162 166 055 164 10924 000704'03 000000# 000000# 10925 000732'02 000000# 000000# %key3 , .setra, $setrs ;;[266] 10926 000705'03 164 162 141 156 163 10927 000707'03 000000# 000000# 10928 000733'02 000000# 000000# %key3 , .setta, $setta ;[129] ;[194] 10929 000710'03 124 126 124 055 102 10930 000713'03 000000# 000000# 10931 000700'02 000033 000033 %tbend 10932 10933 cleans(<%snd3>) ;;Clean up generated symbol 10934 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56 K20PAR MAC 20-Aug-24 23:12 SET command 10935 subttl SET command 10936 10937 ;[77] Parse SET command. (This routine rewritten for edit 77.) 10938 10939 extern mactab ;[203] Macro table is in K20MAC 10940 10941 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 10942 000734'02 000004 000737' sfdb1: flddb. .cmkey,,mactab,,,sfdb2 10943 000735'02 000000000000# 10944 000736'02 44 07 0 00 002237' 10945 000737'02 000000 000000 sfdb2: flddb. .cmkey,,settab 10946 000740'02 000000 000700' 10947 retsec ;;Back to where-ever we started from 10948 10949 003114'01 554 02 0 00 002461* .set: hlrz t2, mactab ; Anything in macro table? 10950 003115'01 322 02 0 00 003124' ifn. t2 ;[194] If so, include them too. 10951 003116'01 332 00 0 00 003065* skipe definf ; Unless we're defining a macro. 10952 003117'01 254 00 0 00 003124' anskp. ;[194] Don't allow recursive definitions! 10953 003120'01 332 00 0 00 000000# skipe mdone ;[203] Not expanding the macro? 10954 003121'01 254 00 0 00 003124' anskp. ;[203] No, we are; so only do keywords 10955 003122'01 201 01 0 00 000000# movei t1, sfdb1 ; Macro table is searched first. 10956 003123'01 254 00 0 00 003125' else. ;[194] No macros or defining one 10957 003124'01 201 01 0 00 000000# movei t1, sfdb2 ; Normal SET command table. 10958 003125'01 endif. ;[194] 10959 003125'01 260 17 0 00 003074* call rfield ; Parse a keyword. 10960 10961 003126'01 .set2: entry .set2 ;[203] Linkage from K20MAC 10962 003126'01 553 00 0 00 000003 hrrzs t3 ; See which function descriptor block was used. 10963 003127'01 302 03 0 00 000000# caie t3, sfdb1 ;[194] The macro table? 10964 003130'01 254 00 0 00 003140' ifskp. ;[194] Indeed 10965 003131'01 550 01 0 02 000000 hrrz t1, (t2) ;[194] Yes, get the data. 10966 003132'01 505 01 0 00 440700 hrli t1, (point 7,) ; This will be a pointer to the macro text. 10967 003133'01 202 01 0 00 002765* movem t1, pars2 ; Save it. 10968 003134'01 260 17 0 00 003013* confrm ; Get confirmation. 10969 003135'01 476 00 0 00 000000# setom macrof ; Set the macro flag. 10970 003136'01 263 17 0 00 000000 ret ; No more to do. 10971 003137'01 254 00 0 00 003141' else. ;[194] Not from macro table 10972 003140'01 402 00 0 00 000000# setzm macrof ; Assume regular SET keyword was parsed. 10973 003141'01 endif. ;[194] End case parsing a macro name 10974 10975 003141'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the command routine addresses. 10976 003142'01 202 02 0 00 003133* movem t2, pars2 ; Save into pars2. 10977 003143'01 554 01 0 02 000000 hlrz t1, (t2) ; Get the next level routine. 10978 003144'01 260 17 0 01 000000 call (t1) ; Call it. 10979 10980 ; If doing a DEFINE, loop through SET commands until CR typed. 10981 10982 003145'01 336 00 0 00 003116* skipn definf ; Doing DEFINE? If so, allow comma here. 10983 003146'01 263 17 0 00 000000 ret 10984 003147'01 201 01 0 00 000000# movei t1, scmfdb 10985 003150'01 260 17 0 00 003125* call rfield 10986 003151'01 135 03 0 00 006256' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 10987 003152'01 306 03 0 00 000013 cain t3, .cmcma ; Comma? 10988 003153'01 254 00 0 00 003114' jrst .set ; Yes, go back & get another SET parameter. 10989 003154'01 263 17 0 00 000000 ret ; Confirmation, done. k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-1 K20PAR MAC 20-Aug-24 23:12 SET command 10990 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20PAR MAC 20-Aug-24 23:12 SET command action routines. 10991 subttl SET command action routines. 10992 10993 ; SET ... command dispatcher. 10994 10995 003155'01 $set: entry $set ;[194] Maybe move this? 10996 003155'01 332 00 0 00 000000# ifme. macrof ;[203] If no macro used, just do the set 10997 003156'01 254 00 0 00 003163' 10998 003157'01 200 02 0 00 003142* move t2, pars2 ; Get back data value. 10999 003160'01 550 01 0 02 000000 hrrz t1, (t2) ; Get evaluation routine. 11000 003161'01 260 17 0 01 000000 call (t1) ; Call it. 11001 003162'01 263 17 0 00 000000 ret 11002 003163'01 endif. ;[203] 11003 11004 003163'01 200 01 0 00 003157* $set2: move t1, pars2 ; Pointer to macro text (SET operands) 11005 003164'01 202 01 0 00 000000# movem t1, macxp 11006 ;* PSOUT ; echo it for debugging... 11007 003165'01 476 00 0 00 000000# setom mdone ; Say macro not done yet. 11008 11009 ; Loop to copy one set command into the command buffer. 11010 11011 003166'01 201 01 0 00 000745 $set3: movei t1,cmdbln*5 ;[192] Max characters in command buffer 11012 003167'01 202 01 0 00 000000# movem t1,sbk+.cmcnt ;[192] Say it's completely empty 11013 003170'01 402 00 0 00 000000# setzm sbk+.cminc ;[192] No unparsed characters yet 11014 003171'01 200 01 0 00 006447' move t1, [ascii/set /] ; Fake a SET command (don't nul terminate) 11015 003172'01 202 01 0 00 000000* movem t1, cmdbuf 11016 003173'01 201 02 0 00 000004 movei t2, ^d4 ;[192] Characters in "SET " 11017 003174'01 272 02 0 00 000000# addm t2, sbk+.cminc ;[192] Bump count of UNparsed characters 11018 003175'01 211 02 0 00 000004 movni t2, ^d4 ;[192] Characters in "SET " 11019 003176'01 272 02 0 00 000000# addm t2, sbk+.cmcnt ;[192] Reduce remaining space 11020 003177'01 200 02 0 00 006450' move t2, [point 7, cmdbuf, 27] ; Copy them to after "set " 11021 003200'01 202 02 0 00 000000# movem t2, sbk+.cmptr 11022 11023 ; Loop for each character. 11024 11025 ; To do: why are we putting a line feed back into the buffer? 11026 11027 003201'01 $set4: do. ;[203] Enter loop context 11028 003201'01 134 01 0 00 000000# ildb t1, macxp ; Get a character from the macro text 11029 003202'01 306 01 0 00 000015 cain t1, .chcrt ;[192] A carriage return? 11030 003203'01 201 01 0 00 000054 movei t1, "," ;[192] Hi! Guess what, now you're a comma! 11031 003204'01 306 01 0 00 000012 cain t1, .chlfd ;[192] A line feed? 11032 003205'01 254 00 0 00 003201' loop. ;[192] Silently swallow it 11033 003206'01 322 01 0 00 003230' jumpe t1, endlp. ;[192] If null, done. 11034 003207'01 302 01 0 00 000054 caie t1, "," ;[194] A comma? 11035 003210'01 254 00 0 00 003224' ifskp. ;[194] It is 11036 003211'01 201 01 0 00 000015 movei t1, .chcrt ;[194] Substitute a carriage return. 11037 003212'01 136 01 0 00 000002 idpb t1, t2 ;[203] Drop into command buffer 11038 003213'01 350 00 0 00 000000# aos sbk+.cminc ;[203] Account for character in there 11039 003214'01 370 00 0 00 000000# sos sbk+.cmcnt ;[203] Subtract from remaining 11040 003215'01 201 01 0 00 000012 movei t1, .chlfd ; And a linefeed... 11041 003216'01 136 01 0 00 000002 idpb t1, t2 ;[203] Drop that into command buffer, too 11042 003217'01 350 00 0 00 000000# aos sbk+.cminc ;[203] Account for character in there 11043 003220'01 370 00 0 00 000000# sos sbk+.cmcnt ;[203] Subtract from remaining 11044 003221'01 400 01 0 00 000000 setz t1, ; And a null... 11045 003222'01 136 01 0 00 000002 idpb t1, t2 ;[203] Tie off the line k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57-1 K20PAR MAC 20-Aug-24 23:12 SET command action routines. 11046 003223'01 254 00 0 00 003242' jrst $set6 ; Go execute this part of the macro 11047 003224'01 endif. ;[194] 11048 003224'01 136 01 0 00 000002 idpb t1, t2 ; Not a comma, copy the character. 11049 003225'01 350 00 0 00 000000# aos sbk+.cminc ;[192] Account for it in the CSB 11050 003226'01 370 00 0 00 000000# sos sbk+.cmcnt ;[192] and decrement remaining count 11051 003227'01 254 00 0 00 003201' loop. ;[203] And copy some more, wee!! 11052 003230'01 enddo. ;[203] Exit loop lexical context 11053 11054 ; Get here at end of null-terminated macro body. 11055 11056 003230'01 $set5: remark ;[192] Fix the CSB back up 11057 003230'01 200 01 0 00 006451' move t1, [point 7, cmdbuf] ;[192] Point to beginning of command buffer 11058 003231'01 202 01 0 00 000000# movem t1, sbk+.cmptr ;[192] Stomp that in; nothing to parse 11059 003232'01 201 01 0 00 000745 movei t1,cmdbln*5 ;[192] Max characters in command buffer 11060 003233'01 202 01 0 00 000000# movem t1,sbk+.cmcnt ;[192] Say it's completely empty 11061 003234'01 402 00 0 00 000000# setzm sbk+.cminc ;[192] No unparsed characters yet 11062 003235'01 403 01 0 00 000002 setzb t1, t2 ;[192] Cons up ten .CHNUL's 11063 003236'01 124 01 0 00 003172* dmovem t1, cmdbuf ;[192] Scrub the atom buffer an itty bit 11064 003237'01 502 01 0 00 000000* hllm t1, sbk ;[192] Zero the CSB flags. 11065 003240'01 402 00 0 00 000000# setzm mdone ;[192] Flag that we're done interpreting the macro. 11066 003241'01 263 17 0 00 000000 ret ;[192] Get out of here 11067 11068 003242'01 402 00 0 00 000000* $set6: setzm pars1 ;[203] Expanding a macro doesn't hit parse: in 11069 003243'01 200 01 0 00 006452' move t1, [pars1,,pars2] ;[203] the main parsing loop, so we must clean 11070 003244'01 251 01 0 00 000000* blt t1, parsx ;[203] out the previous parse values here 11071 11072 ;* hrroi t1, cmdbuf ; Echo the command. 11073 ;* PSOUT ; ... 11074 11075 003245'01 553 00 0 00 003237* hrrzs sbk ;[203] Zero the CSB flags. 11076 003246'01 260 17 0 00 003114' call .set ; Go parse the string. 11077 003247'01 260 17 0 00 003155' call $set ; Go execute what was parsed. 11078 003250'01 332 00 0 00 000000# skipe mdone ;[203] No more? 11079 003251'01 254 00 0 00 003166' jrst $set3 ;[203] Nope, go do the rest of them. 11080 003252'01 263 17 0 00 000000 ret ; Otherwise, all done 11081 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20PAR MAC 20-Aug-24 23:12 SET BLIP command 11082 subttl SET BLIP command 11083 11084 ;[277] Begin code insertion 11085 11086 chgsec(code,const) ;;FDB's are not in code, they're in const 11087 000741'02 010004 000744' sblfdb: flddb. .cmcfm,,,,,sblfd1 11088 000742'02 000000 000000 11089 000743'02 44 07 0 00 002521' 11090 000744'02 001004 000000 sblfd1: flddb. .cmnum,,^d10, 11091 000745'02 000000 000012 11092 000746'02 44 07 0 00 002531' 11093 retsec ;;Back to where-ever we started from 11094 11095 003253'01 200 16 0 00 000000# .setbl: guide (packet count) ; Prompt for our necessaries 11096 003254'01 260 17 0 00 003043* 11097 000747'02 000000000000# 11098 001227'04 160 141 143 153 145 11099 003255'01 201 01 0 00 000000# movei t1, sblfdb ; Allows a confirm to reset to default 11100 003256'01 332 00 0 00 003145* skipe definf ; But!! In DEFINE? 11101 003257'01 201 01 0 00 000000# movei t1, sblfd1 ; Then don't allow a confirm 11102 003260'01 260 17 0 00 003150* call rfield ; Try to get some input 11103 ; Worked!! 11104 003261'01 135 01 0 00 006256' ldb t1, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 11105 003262'01 302 01 0 00 000010 caie t1, .cmcfm ; Just confirmed? 11106 003263'01 254 00 0 00 003266' ifskp. ; We did, so use default value 11107 003264'01 201 02 0 00 000005 movx t2, dblip ; Load default blip count 11108 003265'01 263 17 0 00 000000 ret ; Done with parse, no need to confirm 11109 003266'01 endif. ; as it is de-facto confirmed 11110 11111 003266'01 325 02 0 00 003273' ifl. t2 ; Negative blips are silly 11112 003267'01 200 01 0 00 000000# emsg 11113 003270'01 104 00 0 00 000313 11114 000750'02 000000000000# 11115 001232'04 101 040 156 145 147 11116 003271'01 254 00 0 00 003012* jrst cmder1 11117 003272'01 254 00 0 00 003274' else. ; Otherwise, use it, including zero 11118 003273'01 202 02 0 00 003112* movem t2, pars3 ; Store for semantic action to find 11119 003274'01 endif. 11120 11121 003274'01 336 00 0 00 003256* skipn definf ; In DEFINE? 11122 003275'01 260 17 0 00 003134* confrm ; No, get confirmation. 11123 003276'01 263 17 0 00 000000 ret ; Done with parse 11124 11125 remark SET BLIP command execution. 11126 11127 003277'01 $setbl: extern blip ; Defined in K20MIT 11128 003277'01 200 02 0 00 003273* move t2, pars3 ; Execute SET BLIP 11129 003300'01 202 02 0 00 000000* movem t2, blip ; Update global variable 11130 003301'01 263 17 0 00 000000 ret ; Done with semantic action 11131 11132 ;[277] End code insertion 11133 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20PAR MAC 20-Aug-24 23:12 SET BLOCK-CHECK command 11134 subttl SET BLOCK-CHECK command 11135 11136 ;[98] (This command added as part of edit 98) 11137 11138 000751'02 000000 000000 %table(bctab) 11139 000752'02 000000# 000061 %key2 <1-character-checksum>, "1" 11140 000714'03 061 055 143 150 141 11141 000753'02 000000# 000062 %key2 <2-character-checksum>, "2" 11142 000721'03 062 055 143 150 141 11143 000754'02 000000# 000063 %key2 <3-character-crc>, "3" 11144 000726'03 063 055 143 150 141 11145 000751'02 000003 000003 %tbend 11146 11147 chgsec(code,const) ;;FDB's are not in code, they're in const 11148 000755'02 000002 000000 sbcfdb: flddb. .cmkey,,bctab,,<1> 11149 000756'02 000000 000751' 11150 000757'02 000000 000000 11151 000760'02 44 07 0 00 002116' 11152 retsec ;;Back to where-ever we started from 11153 11154 003302'01 200 16 0 00 000000# .setbc: guide ; Issue guide words 11155 003303'01 260 17 0 00 003254* 11156 000761'02 000000000000# 11157 001241'04 164 171 160 145 040 11158 003304'01 201 01 0 00 000000# movei t1, sbcfdb 11159 003305'01 260 17 0 00 003260* call rfield ; Parse keyword, default is "1". 11160 003306'01 550 02 0 02 000000 hrrz t2, (t2) ; Save the value we parsed. 11161 003307'01 202 02 0 00 003277* movem t2, pars3 11162 003310'01 336 00 0 00 003274* skipn definf ; In a DEFINE command? 11163 003311'01 260 17 0 00 003275* confrm ; No, make them type a carriage return. 11164 003312'01 263 17 0 00 000000 ret 11165 11166 remark SET BLOCK-CHECK command execution. 11167 11168 003313'01 $setbc: extern bctr ; Our necessary 11169 003313'01 200 01 0 00 003307* move t1, pars3 ; Get what was parsed. 11170 003314'01 202 01 0 00 000000* movem t1, bctr ; Save it as "block check type requested". 11171 003315'01 263 17 0 00 000000 ret 11172 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 60 K20PAR MAC 20-Aug-24 23:12 SET BREAK command 11173 subttl SET BREAK command 11174 11175 chgsec(code,const) ;;FDB's are not in code, they're in const 11176 000762'02 001004 000000 sbrfdb: flddb. .cmnum,,^d10, 11177 000763'02 000000 000012 11178 000764'02 44 07 0 00 002537' 11179 retsec ;;Back to where-ever we started from 11180 11181 003316'01 200 16 0 00 000000# .setbr: guide (nulls) 11182 003317'01 260 17 0 00 003303* 11183 000765'02 000000000000# 11184 001243'04 156 165 154 154 163 11185 003320'01 201 01 0 00 000000# movei t1, sbrfdb 11186 003321'01 260 17 0 00 003305* call rfield 11187 11188 003322'01 325 02 0 00 003326' ifl. t2 ;[194] Negative nulls are silly 11189 003323'01 200 01 0 00 000000# emsg ;[194] 11190 003324'01 104 00 0 00 000313 11191 000766'02 000000000000# 11192 001245'04 101 040 156 145 147 11193 003325'01 254 00 0 00 003271* jrst cmder1 ;[194] 11194 003326'01 endif. ;[194] 11195 11196 003326'01 307 02 0 00 000100 caig t2, maxnul ;[194] 11197 003327'01 254 00 0 00 003340' ifskp. ;[194] Exceeded maximum 11198 003330'01 200 01 0 00 000000# emsg ;[194] 11199 003331'01 104 00 0 00 000313 11200 000767'02 000000000000# 11201 001255'04 124 157 157 040 155 11202 003332'01 201 01 0 00 000101 numout [maxnul] ;[194] 11203 003333'01 200 02 0 00 006453' 11204 003334'01 201 03 0 00 000012 11205 003335'01 104 00 0 00 000224 11206 003336'01 320 14 0 00 003337' 11207 003337'01 254 00 0 00 003325* jrst cmder1 ;[194] 11208 003340'01 endif. ;[194] 11209 11210 003340'01 202 02 0 00 003313* movem t2, pars3 11211 003341'01 336 00 0 00 003310* skipn definf ;[77] In DEFINE? 11212 003342'01 260 17 0 00 003311* confrm ;[77] No, get confirmation. 11213 003343'01 263 17 0 00 000000 ret 11214 11215 remark SET BREAK command execution. 11216 11217 003344'01 $setbr: extern brk ; Our necessary 11218 003344'01 200 02 0 00 003340* move t2, pars3 ; Execute SET BREAK. 11219 003345'01 202 02 0 00 000000* movem t2, brk 11220 003346'01 263 17 0 00 000000 ret 11221 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61 K20PAR MAC 20-Aug-24 23:12 SET DEBUG command 11222 subttl SET DEBUG command 11223 11224 000770'02 000000 000000 %table(dbgswi) ;[221] 11225 000771'02 000000# 000000 %key2 , 0 ;[221] If setting decode flag 11226 000732'03 144 145 143 157 144 11227 000770'02 000001 000001 %tbend ;[221] 11228 11229 000772'02 000000 000000 %table(dbgtab) 11230 000773'02 000000# 000000 %key2 , 0 11231 000734'03 157 146 146 000 000 11232 000774'02 000000# 000002 %key2 , 2 ;[22] 11233 000735'03 160 141 143 153 145 11234 000775'02 000000# 000001 %key2 , 1 ;[22] 11235 000737'03 163 164 141 164 145 11236 000772'02 000003 000003 %tbend 11237 11238 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 11239 000776'02 000002 000000 sdbfdb: flddb. .cmkey,,dbgtab,,states 11240 000777'02 000000 000772' 11241 001000'02 000000 000000 11242 001001'02 44 07 0 00 002551' 11243 001002'02 003004 001005' sdbswi: flddb. .cmswi,,dbgswi,,,sdbsw1 11244 001003'02 000000 000770' 11245 001004'02 44 07 0 00 002553' 11246 001005'02 010000 000000 sdbsw1: flddb. .cmcfm ;[221] Parse either the switch or a confirm 11247 001006'02 000000 000000 11248 sdbswo: flddb. .cmswi,,dbgswi,,, ;;[221] 11251 001010'02 000000 000770' 11252 001011'02 44 07 0 00 002561' 11253 retsec ;;Back to where-ever we started from 11254 cleans() 11255 11256 003347'01 200 16 0 00 000000# .setdb: guide ;[217] 11588 003611'01 104 00 0 00 000313 11589 001132'02 000000000000# 11590 001320'04 101 040 156 145 147 11591 003612'01 263 17 0 00 000000 ret ;[217] Failure return 11592 003613'01 endif. ;[217] 11593 11594 003613'01 305 06 0 00 000200 caige q2, 200 ;[217] Absurdly large? 11595 003614'01 254 00 0 00 003620' ifskp. ;[217] Give that a special squawk 11596 003615'01 200 01 0 00 000000# emsg ;[217] 11597 003616'01 104 00 0 00 000313 11598 001133'02 000000000000# 11599 001333'04 101 040 156 165 155 11600 003617'01 263 17 0 00 000000 ret ;[217] Failure return 11601 003620'01 endif. ;[217] 11602 11603 003620'01 306 06 0 00 000177 cain q2, 177 ;[194] But! Maybe a rubout? 11604 003621'01 254 00 0 00 003413* retskp ;[217] It is, this is fine 11605 11606 003622'01 302 06 0 00 000003 caie q2, .chcnc ;[217] ^C? 11607 003623'01 254 00 0 00 003627' ifskp. ;[217] That is never a good idea 11608 003624'01 200 01 0 00 000000# emsg ;[217] 11609 003625'01 104 00 0 00 000313 11610 001134'02 000000000000# 11611 001347'04 115 141 171 040 156 11612 003626'01 263 17 0 00 000000 ret ;[217] Failure return 11613 003627'01 endif. ;[217] 11614 11615 003627'01 336 04 0 00 000000* skipn t4, handsh ;[217] Are we doing handshaking? 11616 003630'01 254 00 0 00 003644' ifskp. ;[217] We are, so check if this conflicts 11617 003631'01 312 06 0 00 000004 came q2, t4 ;[217] Same thing? 11618 003632'01 254 00 0 00 003644' anskp. ;[217] Nope, but still need to check further 11619 003633'01 200 01 0 00 000000# emsg ;[217] k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65-2 K20PAR MAC 20-Aug-24 23:12 SET ESCAPE command 11620 003634'01 104 00 0 00 000313 11621 001135'02 000000000000# 11622 001361'04 115 141 171 040 156 11623 003635'01 200 01 0 00 000006 move t1, q2 ;[217] Load the control character 11624 003636'01 271 01 0 00 000100 addi t1, "@" ;[217] Bring into printable range 11625 003637'01 104 00 0 00 000074 PBOUT% ;[217] and type it 11626 003640'01 200 01 0 00 000000# txmsg < as an escape character because this is the handshake character> 11627 003641'01 104 00 0 00 000076 11628 003642'01 320 12 0 00 003643' 11629 001136'02 000000000000# 11630 001366'04 040 141 163 040 141 11631 003643'01 263 17 0 00 000000 ret ;[217] Failure return 11632 003644'01 endif. ;[217] 11633 11634 003644'01 302 06 0 00 000007 caie q2, .chbel ;[217] ^G? 11635 003645'01 254 00 0 00 003661' ifskp. ;[217] That is never a good idea 11636 003646'01 200 01 0 00 000000* move t1, capas ;[217] Pick up our capabilities 11637 003647'01 603 01 0 00 400000 txne t1, sc%ctc ;[217] Do we have ^C? 11638 003650'01 254 00 0 00 003621* retskp ;[217] Yes, this is fine 11639 003651'01 336 00 0 00 000000# ifmn. ;[217] Are we a batch frob? 11640 003652'01 254 00 0 00 003656' 11641 003653'01 200 01 0 00 000000# emsg ;[217] 11642 003654'01 104 00 0 00 000313 11643 001137'02 000000000000# 11644 001403'04 115 141 171 040 156 11645 003655'01 254 00 0 00 003660' else. ;[217] Otherwise, slightly different message 11646 emsg 11648 003657'01 104 00 0 00 000313 11649 001140'02 000000000000# 11650 001417'04 115 141 171 040 156 11651 003660'01 endif. ;[217] Either way, it's bad... 11652 003660'01 263 17 0 00 000000 ret ;[217] Failure return 11653 003661'01 endif. ;[217] 11654 11655 003661'01 302 06 0 00 000023 caie q2, .chcns ;[217] ^S? 11656 003662'01 254 00 0 00 003670' ifskp. ;[217] Not not be available 11657 003663'01 336 00 0 00 000000* skipn flow ;[217] Are we running XON-XOFF? 11658 003664'01 254 00 0 00 003650* retskp ;[217] Nope, so that's fine 11659 emsg 11661 003666'01 104 00 0 00 000313 11662 001141'02 000000000000# 11663 001436'04 115 141 171 040 156 11664 003667'01 263 17 0 00 000000 ret ;[217] Failure return 11665 003670'01 endif. ;[217] 11666 11667 003670'01 302 06 0 00 000021 caie q2, .chcnq ;[217] ^Q? 11668 003671'01 254 00 0 00 003677' ifskp. ;[217] Not not be available 11669 003672'01 336 00 0 00 003663* skipn flow ;[217] Are we running XON-XOFF? 11670 003673'01 254 00 0 00 003664* retskp ;[217] Nope, so that's fine 11671 emsg 11673 003675'01 104 00 0 00 000313 11674 001142'02 000000000000# k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65-3 K20PAR MAC 20-Aug-24 23:12 SET ESCAPE command 11675 001456'04 115 141 171 040 156 11676 003676'01 263 17 0 00 000000 ret ;[217] Failure return 11677 003677'01 endif. ;[217] 11678 11679 003677'01 307 06 0 00 000037 caig q2, .chcun ;[217] Past Control-_ (underscore)? 11680 003700'01 254 00 0 00 003673* retskp ;[217] No, so it's passed all the checks 11681 11682 003701'01 200 01 0 00 000000# emsg <"> ;[217] Begin the blat 11683 003702'01 104 00 0 00 000313 11684 001143'02 000000000000# 11685 001476'04 042 000 000 000 000 11686 003703'01 200 01 0 00 000006 move t1, q2 ;[217] Load the proposed control 11687 003704'01 104 00 0 00 000074 PBOUT% ;[217] character and type it 11688 003705'01 200 01 0 00 000000# txmsg <" is not in ASCII control range, 0-37 or 177> 11689 003706'01 104 00 0 00 000076 11690 003707'01 320 12 0 00 003710' 11691 001144'02 000000000000# 11692 001477'04 042 040 151 163 040 11693 003710'01 263 17 0 00 000000 ret ;[217] Failure return 11694 003711'01 263 17 0 00 000000 endbk. ;[217] End block context 11695 003712'01 254 00 0 00 003717' ifskp. ;[217] Passed +2 means passed muster 11696 003713'01 202 06 0 00 003517* movem q2, pars3 ;[217] So let's use it 11697 003714'01 306 10 0 00 000010 cain q4, .cmcfm ;[217] Original intent was to default everything? 11698 003715'01 263 17 0 00 000000 ret ;[217] It was, so don't confirm the confirm. 11699 003716'01 254 00 0 00 003720' else. ;[217] Otherwise, we've complained 11700 003717'01 254 00 0 00 003477* jrst cmder1 ;[217] Allow ^H 11701 003720'01 endif. ;[217] Otherwise, fall through 11702 11703 003720'01 336 00 0 00 003536* skipn definf ;[77] In DEFINE? 11704 003721'01 260 17 0 00 003515* confrm ;[77] No, get confirmation. 11705 003722'01 263 17 0 00 000000 ret 11706 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66 K20PAR MAC 20-Aug-24 23:12 SET ESCAPE command 11707 remark SET ESCAPE comand semantic action 11708 11709 003723'01 $setes: extern escape ; Our necessary 11710 003723'01 200 01 0 00 003713* move t1, pars3 ;[16] ESCAPE. Get what we parsed. 11711 003724'01 202 01 0 00 000000* movem t1, escape 11712 003725'01 263 17 0 00 000000 ret 11713 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67 K20PAR MAC 20-Aug-24 23:12 SET EXPUNGE command 11714 subttl SET EXPUNGE command 11715 11716 001145'02 000000 000000 %table(offon) ; Table for parsing ON or OFF. 11717 001146'02 000000# 000000 %key2 , 0 11718 000775'03 157 146 146 000 000 11719 001147'02 000000# 000001 %key2 , 1 11720 000776'03 157 156 000 000 000 11721 001145'02 000002 000002 %tbend 11722 11723 chgsec(code,const) ;;FDB's are not in code, they're in const 11724 001150'02 000002 000000 stxfdb: flddb. .cmkey,,offon,,on 11725 001151'02 000000 001145' 11726 001152'02 000000 000000 11727 001153'02 44 07 0 00 002333' 11728 retsec ;;Back to where-ever we started from 11729 11730 intern stxfdb ;[273] Used by /SILENCE in K20PAR 11731 11732 003726'01 200 16 0 00 000000# .setex: guide 11733 003727'01 260 17 0 00 003524* 11734 001154'02 000000000000# 11735 001510'04 144 145 154 145 164 11736 003730'01 201 01 0 00 000000# movei t1, stxfdb ; Yet consistent naming, sigh... 11737 003731'01 260 17 0 00 003511* call rfield ; Parse a keyword. 11738 003732'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 11739 003733'01 202 02 0 00 003723* movem t2, pars3 ; Save into pars3. 11740 003734'01 336 00 0 00 003720* skipn definf ;[77] In DEFINE? 11741 003735'01 260 17 0 00 003721* confrm ;[77] No, get confirmation. 11742 003736'01 263 17 0 00 000000 ret 11743 11744 remark SET EXPUNGE semantic action 11745 11746 003737'01 $setex: extern expung ; Our necessary 11747 003737'01 200 01 0 00 003733* move t1, pars3 ;[143] SET EXPUNGE 11748 003740'01 202 01 0 00 000000* movem t1, expung 11749 003741'01 263 17 0 00 000000 ret 11750 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68 K20PAR MAC 20-Aug-24 23:12 SET FILE parse tables 11751 subttl SET FILE parse tables 11752 11753 001155'02 000000 000000 %table(sfitab) ; Table of file parameters to SET. 11754 001156'02 000000# 000000 %key2 ,0 11755 000777'03 142 171 164 145 163 11756 001157'02 000000# 000001 %key2 ,1 11757 001001'03 156 141 155 151 156 11758 001155'02 000002 000002 %tbend 11759 11760 001160'02 000000 000000 %table(sfbtab) ; file bytesize keyword table. 11761 001161'02 000000# 000002 %key2 <36-bit>, 2 ;[232] 11762 001003'03 063 066 055 142 151 11763 001162'02 000000# 000000 %key2 <7-bit>, 0 11764 001005'03 067 055 142 151 164 11765 001163'02 000000# 000001 %key2 <8-bit>, 1 11766 001007'03 070 055 142 151 164 11767 001164'02 000000# 000003 %key2 , 3 ;[232] 11768 001011'03 141 165 164 157 000 11769 001165'02 000000# 000001 %key2 , 1 11770 001012'03 145 151 147 150 164 11771 001166'02 000000# 000000 %key2 , 0 11772 001014'03 163 145 166 145 156 11773 001167'02 000000# 000002 %key2 , 2 ;[232] 11774 001016'03 164 150 151 162 164 11775 001160'02 000007 000007 %tbend 11776 11777 001170'02 000000 000000 %table(fntab) ;[194] ; file name translation keywords. 11778 001171'02 000000# 000001 %key2 ,1 ;[194] 11779 001021'03 156 157 162 155 141 11780 001172'02 000000# 000000 %key2 ,0 ;[194] 11781 001024'03 165 156 164 162 141 11782 001170'02 000002 000002 %tbend ;[194] 11783 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69 K20PAR MAC 20-Aug-24 23:12 SET FILE command 11784 subttl SET FILE command 11785 11786 ; The following ruse using chained FDB's allows the old-style command to 11787 ; be parsed most of the time, like "SET FILE 8". 11788 11789 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 11790 001173'02 000002 001177' sfifd1: flddb. .cmkey,,sfitab,,,sfifd2 11791 001174'02 000000 001155' 11792 001175'02 000000 000000 11793 001176'02 44 07 0 00 002774' 11794 001177'02 000006 000000 sfifd2: flddb. .cmkey,,sfbtab,, 11795 001200'02 000000 001160' 11796 001201'02 44 07 0 00 002776' 11797 001202'02 44 07 0 00 003003' 11798 001203'02 000002 000000 sftfd3: flddb. .cmkey,,fntab,, ;[84] 11799 001204'02 000000 001170' 11800 001205'02 000000 000000 11801 001206'02 44 07 0 00 003004' 11802 retsec ;;Back to where-ever we started from 11803 11804 003742'01 200 16 0 00 000000# .setfi: guide ;[84] SET FILE 11805 003743'01 260 17 0 00 003727* 11806 001207'02 000000000000# 11807 001516'04 160 141 162 141 155 11808 003744'01 201 01 0 00 000000# movei t1, sfifd1 11809 003745'01 260 17 0 00 003731* call rfield 11810 003746'01 550 02 0 02 000000 hrrz t2, (t2) 11811 003747'01 553 00 0 00 000003 hrrzs t3 ;[84] Which function descriptor block was used? 11812 003750'01 402 00 0 00 003737* setzm pars3 ;[84] Assume they specified a bytesize. 11813 003751'01 306 03 0 00 000000# cain t3, sfifd2 ;[84] They specified a bytesize? 11814 003752'01 254 00 0 00 003763' ifskp. ;[194] Nope, parse for it 11815 003753'01 202 02 0 00 003750* movem t2, pars3 11816 003754'01 200 16 0 00 000000# guide 11817 003755'01 260 17 0 00 003743* 11818 001210'02 000000000000# 11819 001520'04 164 157 000 000 000 11820 003756'01 201 01 0 00 000000# movei t1, sfifd2 ;[194] Let's assume didn't specify the bytesize, yet 11821 003757'01 332 00 0 00 003753* skipe pars3 ;[84] But!! Did they? 11822 003760'01 201 01 0 00 000000# movei t1,sftfd3 ;[194] They did, so parse the filename translation 11823 003761'01 260 17 0 00 003745* call rfield ; Parse a keyword. 11824 003762'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 11825 003763'01 endif. ;[196] Otherwise, so don't parse it again. 11826 11827 003763'01 202 02 0 00 003500* movem t2, pars4 ;[84] Save here. 11828 003764'01 336 00 0 00 003734* skipn definf ;[77] In DEFINE? 11829 003765'01 260 17 0 00 003735* confrm ;[77] No, get confirmation. 11830 003766'01 263 17 0 00 000000 ret 11831 11832 remark SET FILE semantic action 11833 11834 003767'01 336 01 0 00 003757* $setfi: skipn t1, pars3 ;[84] Which file parameter are we setting? 11835 003770'01 254 00 0 00 004001' jrst $setf8 ;[84] Bytesize, go do that. 11836 remark $setfn ;[194] Beware! Falls through to $setfn 11837 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70 K20PAR MAC 20-Aug-24 23:12 FILE NAMING semantic action 11838 subttl FILE NAMING semantic action 11839 11840 003771'01 $setfn: remark $setfn ; Called by... NOBODY!! (see above) 11841 extern xfnflg ; and of our necessary 11842 003771'01 376 00 0 00 000001 sosn t1 ;[194] Do we have to get a little fancier? 11843 003772'01 254 00 0 00 003776' ifskp. ;[194] Yep, looks like it 11844 003773'01 200 01 0 00 000000# emsg ;[187] if more file parameters 11845 003774'01 104 00 0 00 000313 11846 001211'02 000000000000# 11847 001521'04 111 155 160 157 163 11848 003775'01 263 17 0 00 000000 ret ;[84] are added... 11849 003776'01 endif. ;[194] 11850 003776'01 200 01 0 00 003763* move t1, pars4 ;[84] OK, get the value. 11851 003777'01 202 01 0 00 000000* movem t1, xfnflg ;[84] Save it. 11852 004000'01 263 17 0 00 000000 ret ;[84] Done. 11853 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71 K20PAR MAC 20-Aug-24 23:12 FILE BYTESIZE semantic action 11854 subttl FILE BYTESIZE semantic action 11855 11856 004001'01 $setf8: remark $setf8 ; Jumped to by $setfi 11857 extern autbyt, ebtflg, tbtflg ; Our necessaries 11858 004001'01 200 01 0 00 003776* move t1, pars4 ; BYTESIZE... Get the value of the flag. 11859 004002'01 254 00 1 01 004003' jrst @fbytet(t1) ;[232] Go set the variables appropriately 11860 11861 004003'01 000000 004007' fbytet: fbyte7 ;[232] Seven bit files 11862 004004'01 000000 004013' fbyte8 ;[232] Eight bit files 11863 004005'01 000000 004017' fbyt36 ;[232] Thirty-six bit files 11864 004006'01 000000 004024' fbytea ;[232] Auto-byte (only 7 or 8 for now) 11865 11866 004007'01 fbyte7: remark ;[232] Here to force 7 bit 11867 004007'01 402 00 0 00 000000* setzm autbyt ;[232] Never autobyting 11868 004010'01 402 00 0 00 000000* setzm ebtflg ;[232] Clear eight bit flag 11869 004011'01 402 00 0 00 000000* setzm tbtflg ;[232] Clear 36 bit flag 11870 004012'01 263 17 0 00 000000 ret ;[232] Done 11871 11872 004013'01 fbyte8: remark ;[232] Here to force 8 bit files 11873 004013'01 402 00 0 00 004007* setzm autbyt ;[232] Never autobyting 11874 004014'01 476 00 0 00 004010* setom ebtflg ;[232] Set eight bit flag 11875 004015'01 402 00 0 00 004011* setzm tbtflg ;[232] Clear 36 bit flag 11876 004016'01 263 17 0 00 000000 ret ;[232] Done 11877 11878 004017'01 fbyt36: remark ;[232] Here if forceing thirty-six bit files 11879 004017'01 402 00 0 00 000000* setzm itsflg ;[232] Clear ITS Binary 11880 004020'01 402 00 0 00 004013* setzm autbyt ;[232] Never autobyting 11881 004021'01 402 00 0 00 004014* setzm ebtflg ;[232] Clear eight bit flag 11882 004022'01 476 00 0 00 004015* setom tbtflg ;[232] Set 36 bit flag 11883 004023'01 263 17 0 00 000000 ret ;[232] Done 11884 11885 004024'01 fbytea: remark ;[232] Here for 7/8 bit auto-byte 11886 004024'01 476 00 0 00 004020* setom autbyt ;[194] If so, say so, 11887 004025'01 402 00 0 00 004021* setzm ebtflg ; and say this not so. 11888 004026'01 402 00 0 00 004022* setzm tbtflg ;[232] If autobyte, then never 36 bit 11889 004027'01 263 17 0 00 000000 ret ;[232] Done 11890 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72 K20PAR MAC 20-Aug-24 23:12 SET FLOW-CONTROL command 11891 subttl SET FLOW-CONTROL command 11892 11893 001212'02 000000 000000 %table(flotab) ; Flow-Control keywords 11894 001213'02 000000# 000000 %key2 , 0 11895 001027'03 156 157 156 145 000 11896 001214'02 000000# 000000 %keyf3 , 0, cm%inv 11897 001030'03 002000 000001 11898 001031'03 157 146 146 000 000 11899 001215'02 000000# 000001 %keyf3 , 1, cm%inv 11900 001032'03 002000 000001 11901 001033'03 157 156 000 000 000 11902 001216'02 000000# 000001 %key2 , 1 11903 001034'03 130 117 116 055 130 11904 001212'02 000004 000004 %tbend 11905 11906 chgsec(code,const) ;;FDB's are not in code, they're in const 11907 001217'02 000002 000000 sflfdb: flddb. .cmkey,,flotab,,XON-XOFF 11908 001220'02 000000 001212' 11909 001221'02 000000 000000 11910 001222'02 44 07 0 00 003007' 11911 retsec ;;Back to where-ever we started from 11912 11913 004030'01 201 01 0 00 000000# .setfl: movei t1, sflfdb 11914 004031'01 260 17 0 00 003761* call rfield ; Parse a keyword. 11915 004032'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 11916 004033'01 202 02 0 00 003767* movem t2, pars3 ; Save into pars3. 11917 004034'01 336 00 0 00 003764* skipn definf ; In DEFINE? 11918 004035'01 260 17 0 00 003765* confrm ; No, get confirmation. 11919 004036'01 263 17 0 00 000000 ret 11920 11921 remark SET FLOW-CONTROL semantic action 11922 11923 004037'01 $setfl: extern handsh, flow ; And of our necessaries 11924 004037'01 332 01 0 00 004033* skipe t1, pars3 ; Get flow control option. 11925 004040'01 402 00 0 00 003627* setzm handsh ; If nonzero, turn off handshake. 11926 004041'01 202 01 0 00 003672* movem t1, flow 11927 004042'01 263 17 0 00 000000 ret 11928 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73 K20PAR MAC 20-Aug-24 23:12 SET HANDSHAKE command 11929 subttl SET HANDSHAKE command 11930 11931 ;[217] Although little used and probably rarely necessary, make entering 11932 ; a character here as 'easy' as it is for changing the escape character. 11933 11934 001223'02 000000 000000 %table(hshtab) ; Handshake keywords (recommended) 11935 001224'02 000000# 000007 %key2 , .chbel ;[217] ^G 11936 001036'03 142 145 154 154 000 11937 001225'02 000000# 000015 %key2 , .chcrt ;[217] ^M or carriage return 11938 001037'03 103 122 000 000 000 11939 001226'02 000000# 000033 %key2 , .chesc ;[217] Escape or "altmode" 11940 001040'03 105 123 103 000 000 11941 001227'02 000000# 000012 %key2 , .chlfd ;[217] ^J or line-feed 11942 001041'03 114 106 000 000 000 11943 001230'02 000000# 000000 %key2 , .chnul ;[217] Special cased 11944 001042'03 156 157 156 145 000 11945 001231'02 000000# 000023 %key2 , .chcns ;[217] ^S 11946 001043'03 130 117 106 106 000 11947 001232'02 000000# 000021 %key2 , .chcnq ;[217] ^Q 11948 001044'03 130 117 116 000 000 11949 001223'02 000007 000007 %tbend 11950 11951 chgsec(code,const) ;;FDB's are not in code, they're in const 11952 001233'02 013001 001235' hndfdm: flddb. .cmcma,cm%sdh,,,,hndfdb ;[217] Used when unwinding a macro 11953 001234'02 000000 000000 11954 001235'02 010004 001240' hndfdb: flddb. .cmcfm,,,,,hndfd1 11955 001236'02 000000 000000 11956 001237'02 44 07 0 00 003011' 11957 001240'02 000004 001243' hndfd1: flddb. .cmkey,,hshtab,,,hndfd2 11958 001241'02 000000 001223' 11959 001242'02 44 07 0 00 003020' 11960 001243'02 001004 001246' hndfd2: flddb. .cmnum,,^d8,,,hndfd3 11961 001244'02 000000 000010 11962 001245'02 44 07 0 00 002620' 11963 001246'02 023004 000000 hndfd3: flddb. .cmtok,,token(<^>),,, 11964 001247'02 440700 002633' 11965 001250'02 44 07 0 00 002634' 11966 retsec ;;Back to where-ever we started from 11967 11968 cleans() 11969 11970 004043'01 265 16 0 00 006257' .setha: saveac ;[217] Needs registers 11971 004044'01 200 16 0 00 000000# guide ;[217] 11972 004045'01 260 17 0 00 003755* 11973 001251'02 000000000000# 11974 001526'04 143 150 141 162 141 11975 11976 004046'01 201 01 0 00 000000# movei t1, hndfdb ;[217] Parse a couple of alternatives 11977 004047'01 332 00 0 00 000000# skipe mdone ;[217] Unwinding a macro? 11978 004050'01 201 01 0 00 000000# movei t1, hndfdm ;[217] Yes, allow a comma to squeak through 11979 11980 004051'01 260 17 0 00 003556* call rflde ;[217] Try to get one of them 11981 004052'01 254 00 0 00 004057' ifskp. ;[217] Worked!! 11982 004053'01 120 06 0 00 000002 dmove q2, t2 ;[217] Save partial parse results 11983 004054'01 135 05 0 00 006454' ldb q1, [pointr (.cmfnp(q3),cm%fnc)] ;[217] Get function code. k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-1 K20PAR MAC 20-Aug-24 23:12 SET HANDSHAKE command 11984 004055'01 200 10 0 00 000005 move q4, q1 ;[217] Save for downstream 11985 004056'01 254 00 0 00 004062' else. ;[217] Otherwise, failed the parse 11986 004057'01 336 00 0 00 004034* skipn definf ;[217] In DEFINE? 11987 004060'01 254 00 0 00 003567* jrst cmderr ;[217] No, then a definite parse error; allow retry 11988 004061'01 263 17 0 00 000000 ret ;[217] Return into DEFINE and see if that chokes 11989 004062'01 endif. ;[217] End handling COMND% returns 11990 11991 004062'01 302 05 0 00 000013 caie q1, .cmcma ;[217] Parsed a comma? 11992 004063'01 254 00 0 00 004066' ifskp. ;[217] We did, so must be unwinding a macro 11993 004064'01 201 05 0 00 000010 movei q1, .cmcfm ;[217] Turn it into a confirm and carry on 11994 004065'01 200 10 0 00 000005 move q4, q1 ;[217] Stomp into downstream, too 11995 004066'01 endif. 11996 11997 004066'01 302 05 0 00 000010 caie q1, .cmcfm ;[217] A confirm is very special cased 11998 004067'01 254 00 0 00 004073' ifskp. ;[217] It was, so default it 11999 004070'01 201 02 0 00 000023 movei t2, .chcns ;[217] Replace parse value with ^S 12000 004071'01 202 02 0 00 004037* movem t2, pars3 ;[217] Save where $setha wants to find it 12001 004072'01 263 17 0 00 000000 ret ;[217] Done, nothing left to parse 12002 004073'01 endif. ;[217] 12003 12004 004073'01 302 05 0 00 000000 caie q1, .cmkey ;[217] Common mnemonic? 12005 004074'01 254 00 0 00 004077' ifskp. ;[217] It was, so translate it by getting 12006 004075'01 550 02 0 06 000000 hrrz t2, (q2) ;[217] the keyword's associated value. 12007 004076'01 254 00 0 00 004127' jrst .seth1 ;[217] Make sure nothing bad leaked through 12008 004077'01 endif. ;[217] 12009 12010 004077'01 306 05 0 00 000001 cain q1, .cmnum ;[217] Number? 12011 004100'01 254 00 0 00 004127' jrst .seth1 ;[217] Must range check user specified value 12012 12013 remark q1, .cmtok ;[217] Otherwise, must have been a token 12014 dmove t1, [ esctkn ;[217] Possible mnemonics 12015 004101'01 120 01 0 00 006460' cm%xif ] ;[217] Load the no indirection flag 12016 004102'01 436 02 0 00 000000# orm t2, sbk+.cmflg ;[217] And dink the COMND% state block 12017 004103'01 260 17 0 00 004051* call rflde ;[217] Try to get one of them 12018 004104'01 254 00 0 00 004112' ifskp. ;[217] Worked!! 12019 004105'01 135 05 0 00 006256' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[217] Get function code. 12020 004106'01 120 06 0 00 000002 dmove q2, t2 ;[217] Save parse data and fdb selection 12021 remark q4, ;[217] But don't touch original parse 12022 004107'01 205 04 0 00 002000 movx t4, cm%xif ;[217] Load indirection flag again 12023 004110'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ;[217] And restore the COMND% state block 12024 004111'01 254 00 0 00 004115' else. ;[217] Otherwise, failed the parse 12025 004112'01 205 04 0 00 002000 movx t4, cm%xif ;[217] Load indirection flag again 12026 004113'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ;[217] restore the COMND% state block 12027 004114'01 254 00 0 00 004060* jrst cmderr ;[217] And handle the parse error, allowing reparse 12028 004115'01 endif. ;[217] End handling COMND% returns 12029 12030 004115'01 302 05 0 00 000000 caie q1, .cmkey ;[217] Was this relatively easy? 12031 004116'01 254 00 0 00 004121' ifskp. ;[217] Yep, let's grab and convert the character 12032 004117'01 550 02 0 06 000000 hrrz t2, (q2) ;[217] Pick up what would be the jump address 12033 004120'01 254 00 0 00 004127' jrst .seth1 ;[217] Make sure nothing bad leaked through 12034 004121'01 endif. 12035 12036 remark q1, .cmtok ;[217] A token is somewhat more difficult 12037 004121'01 621 07 0 00 777777 tlz q3, -1 ;[217] Isolate fdb we actually used 12038 004122'01 200 06 0 07 000001 move q2, .cmdat(q3) ;[217] Pick up the byte pointer to the character k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-2 K20PAR MAC 20-Aug-24 23:12 SET HANDSHAKE command 12039 004123'01 134 02 0 00 000006 ildb t2, q2 ;[217] Load the token character (only one) 12040 004124'01 275 02 0 00 000100 subi t2, "@" ;[217] Bring down to control character range 12041 004125'01 316 02 0 00 006457' camn t2, [-21] ;[217] Was this our rubout hack? 12042 004126'01 201 02 0 00 000177 movei t2, 177 ;[217] Stomp in the correct value 12043 remark .seth1 ;[217] Make sure nothing bad leaked through 12044 12045 004127'01 .seth1: remark ;[217] Expects character to check in t2 12046 004127'01 325 02 0 00 004133' ifl. t2 ;[217] True gubbish? 12047 004130'01 200 01 0 00 000000# emsg ;[217] 12048 004131'01 104 00 0 00 000313 12049 001252'02 000000000000# 12050 001534'04 101 040 156 145 147 12051 004132'01 254 00 0 00 003717* jrst cmder1 ;[217] Failure, but allow reparse 12052 004133'01 endif. ;[217] 12053 12054 004133'01 305 02 0 00 000200 caige t2, 200 ;[217] Absurdly large? 12055 004134'01 254 00 0 00 004140' ifskp. ;[217] Give that a special squawk 12056 004135'01 200 01 0 00 000000# emsg <7 bit ASCII is not defined for values of octal 200 or above> ;[217] 12057 004136'01 104 00 0 00 000313 12058 001253'02 000000000000# 12059 001551'04 067 040 142 151 164 12060 004137'01 254 00 0 00 004132* jrst cmder1 ;[217] Failure, but allow reparse 12061 004140'01 endif. ;[217] 12062 12063 004140'01 307 02 0 00 000037 caig t2, 37 ; Control character? 12064 004141'01 254 00 0 00 004155' ifskp. ; Isn't 12065 004142'01 306 02 0 00 000177 cain t2, 177 ; Rubout? 12066 004143'01 254 00 0 00 004155' anskp. ; It is, so that's fine 12067 004144'01 200 04 0 00 000002 move t4, t2 ;[217] Isn't so let's start complaining 12068 004145'01 200 01 0 00 000000# emsg <"> ;" ;[217] Begin with a double quote 12069 004146'01 104 00 0 00 000313 12070 001254'02 000000000000# 12071 001565'04 042 000 000 000 000 12072 004147'01 200 01 0 00 000004 move t1, t4 ;[217] Load the poor character 12073 004150'01 104 00 0 00 000074 PBOUT% ;[217] Display what is wrong 12074 004151'01 200 01 0 00 000000# txmsg <" is not in ASCII control range, 0-37 or 177> ;[187] " Font crock 12075 004152'01 104 00 0 00 000076 12076 004153'01 320 12 0 00 004154' 12077 001255'02 000000000000# 12078 001566'04 042 040 151 163 040 12079 004154'01 254 00 0 00 004137* jrst cmder1 ;[194] 12080 004155'01 endif. ;[194] 12081 12082 004155'01 202 02 0 00 004071* .seth2: movem t2, pars3 ; Save into pars3. 12083 004156'01 306 10 0 00 000010 cain q4, .cmcfm ;[217] Original intent was to default everything? 12084 004157'01 263 17 0 00 000000 ret ;[217] Yes, do not confirm the confirmation 12085 004160'01 336 00 0 00 004057* skipn definf ;[77] In DEFINE? 12086 004161'01 260 17 0 00 004035* confrm ;[77] No, get confirmation. 12087 004162'01 263 17 0 00 000000 ret 12088 12089 12090 remark SET HANDSHAKE semantic action 12091 12092 004163'01 $setha: remark flow, handsh ; Necessaries defined above 12093 004163'01 332 01 0 00 004155* skipe t1, pars3 ;[143] Get the handshake option. k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-3 K20PAR MAC 20-Aug-24 23:12 SET HANDSHAKE command 12094 004164'01 402 00 0 00 004041* setzm flow ;[143] If nonzero, turn off flow control. 12095 004165'01 260 17 1 00 001160* call @parity ;[223] Compute any parity 12096 004166'01 202 01 0 00 004040* movem t1, handsh ; Save it. 12097 004167'01 263 17 0 00 000000 ret ; Done. 12098 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74 K20PAR MAC 20-Aug-24 23:12 SET HOST command initial parsing 12099 subttl SET HOST command initial parsing 12100 12101 ;[186] SET HOST is basically a restricted form of SET LINE with no .CMNUM 12102 12103 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 12104 001256'02 000004 001261' shsfdb: flddb. .cmkey,,pseutb,,,shsfd1 12105 001257'02 000000 000627' 12106 001260'02 44 07 0 00 003030' 12107 001261'02 026044 001264' shsfd1: flddb. .cmnod,cm%nsf,,,,shsfd2 12108 001262'02 000000 000000 12109 001263'02 44 07 0 00 003033' 12110 001264'02 010005 000000 shsfd2: flddb. .cmcfm,cm%sdh,,,, ;[186] 12111 001265'02 000000 000000 12112 001266'02 44 07 0 00 003045' 12113 retsec ;;Back to where-ever we started from 12114 cleans() 12115 12116 004170'01 200 16 0 00 000000# .seths: guide ;[186] 12117 004171'01 260 17 0 00 004045* 12118 001267'02 000000000000# 12119 001577'04 154 157 143 141 154 12120 004172'01 403 01 0 00 000002 setzb t1,t2 ;[186] Cons up 10 .CHNUL's 12121 004173'01 124 01 0 00 003104* dmovem t1,atmbuf ;[186] Scrub a bit of the atom buffer 12122 004174'01 201 01 0 00 000000# movei t1, shsfdb ;[186] Allow NRT and pseudo-terminal 12123 004175'01 260 17 0 00 004031* call rfield ; Parse a keyword or node (NO CONFIRM!) ;[186] 12124 004176'01 135 04 0 00 006256' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ;[186] Get function code. 12125 004177'01 254 00 0 00 004207' callret .setl1 ;[186] Same parsing semantics 12126 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 75 K20PAR MAC 20-Aug-24 23:12 SET LINE command parsing 12127 subttl SET LINE command parsing 12128 12129 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 12130 001270'02 001004 001273' slnfdb: flddb. .cmnum,,^d8,,,slnfd1 12131 001271'02 000000 000010 12132 001272'02 44 07 0 00 003053' 12133 001273'02 000004 001276' slnfd1: flddb. .cmkey,,pseutb,,,slnfd2 12134 001274'02 000000 000627' 12135 001275'02 44 07 0 00 003030' 12136 001276'02 026044 001301' slnfd2: flddb. .cmnod,cm%nsf,,,,slnfd3 12137 001277'02 000000 000000 12138 001300'02 44 07 0 00 003033' 12139 001301'02 010005 000000 slnfd3: flddb. .cmcfm,cm%sdh,,,, 12140 001302'02 000000 000000 12141 001303'02 44 07 0 00 003061' 12142 retsec ;;Back to where-ever we started from 12143 cleans() 12144 12145 004200'01 200 16 0 00 000000# .setln: guide 12146 004201'01 260 17 0 00 004171* 12147 001304'02 000000000000# 12148 001606'04 164 157 040 160 150 12149 004202'01 403 01 0 00 000002 setzb t1,t2 ;[186] Cons up 10 .CHNUL's 12150 004203'01 124 01 0 00 004173* dmovem t1,atmbuf ;[186] Scrub a bit of the atom buffer 12151 004204'01 201 01 0 00 000000# movei t1, slnfdb ;[186] Allow NRT and pseudo-terminal 12152 004205'01 260 17 0 00 004175* call rfield ; Parse a tty number. 12153 004206'01 135 04 0 00 006256' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 12154 12155 004207'01 306 04 0 00 000000 .setl1: cain t4, .cmkey ;[186] Parsed a keyword 12156 004210'01 254 00 0 00 003047' callret .conn1 ;[186] Handle as in CONNECT 12157 004211'01 306 04 0 00 000026 cain t4, .cmnod ;[186] Is it a DECnet node? 12158 004212'01 254 00 0 00 003047' callret .conn1 ;[186] Handle as in CONNECT 12159 004213'01 306 04 0 00 000001 cain t4, .cmnum ; Is it a TTY number? 12160 004214'01 254 00 0 00 003047' callret .conn1 ;[186] Handle as in CONNECT 12161 004215'01 302 04 0 00 000010 caie t4, .cmcfm ;[186] Confirmed? 12162 004216'01 254 00 0 00 004222' ifskp. ;[186] Break the connection 12163 dmove t1, [ .cmcfm ;[186] Pass that special situation back 12164 004217'01 120 01 0 00 006462' .dvnul ] ;[186] And that the keyword was "close" 12165 004220'01 124 01 0 00 004163* dmovem t1, pars3 ;[186] Side effect the parse variables 12166 004221'01 263 17 0 00 000000 ret ;[186] Done 12167 004222'01 endif. ;[186] 12168 12169 004222'01 334 01 0 00 000000# ermsg% (,r) ;[186] 12170 004223'01 254 00 0 00 004227' 12171 004224'01 202 01 0 00 002334* 12172 004225'01 104 00 0 00 000313 12173 004226'01 254 00 0 00 002714* 12174 001305'02 000000000000# 12175 001620'04 113 105 122 115 111 12176 12177 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76 K20PAR MAC 20-Aug-24 23:12 SET INCOMPLETE command 12178 subttl SET INCOMPLETE command 12179 12180 001306'02 000000 000000 %table(inctab) ;[194] 12181 001307'02 000000# 000000 %key2 , 0 ;[194] 12182 001045'03 144 151 163 143 141 12183 001310'02 000000# 000001 %key2 , 1 ;[194] 12184 001047'03 153 145 145 160 000 12185 001306'02 000002 000002 %tbend ;[194] 12186 12187 chgsec(code,const) ;;FDB's are not in code, they're in const 12188 001311'02 000002 000000 stbfdb: flddb. .cmkey,,inctab,,,, ;[194] 12189 001312'02 000000 001306' 12190 001313'02 000000 000000 12191 001314'02 44 07 0 00 003065' 12192 retsec ;;Back to where-ever we started from 12193 12194 004227'01 200 16 0 00 000000# .setab: guide ;[42] SET INCOMPLETE (file disposition) 12195 004230'01 260 17 0 00 004201* 12196 001315'02 000000000000# 12197 001631'04 146 151 154 145 040 12198 004231'01 201 01 0 00 000000# movei t1, stbfdb ;[194] 12199 004232'01 260 17 0 00 004205* call rfield ; Parse & confirm. 12200 004233'01 550 02 0 02 000000 hrrz t2, (t2) 12201 004234'01 202 02 0 00 004220* movem t2, pars3 12202 004235'01 336 00 0 00 004160* skipn definf ;[77] In DEFINE? 12203 004236'01 260 17 0 00 004161* confrm ;[77] No, get confirmation. 12204 004237'01 263 17 0 00 000000 ret 12205 12206 remark SET INCOMPLETE semantic action 12207 12208 004240'01 $setab: extern abtfil ; Our necessary 12209 004240'01 200 01 0 00 004234* move t1, pars3 ; Just save what we parsed. 12210 004241'01 202 01 0 00 000000* movem t1, abtfil 12211 004242'01 263 17 0 00 000000 ret 12212 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 77 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE command dispatcher. 12213 subttl SET SEND/RECEIVE command dispatcher. 12214 12215 004243'01 550 01 1 00 004240* $setrs: hrrz t1, @pars3 ;[223] ; SEND/RECEIVE. Address of variable to set. 12216 004244'01 200 02 0 00 004001* move t2, pars4 ; The value that was parsed. 12217 004245'01 336 03 0 00 003037* skipn t3, pars5 ;[196] Do we have a tertiary (double) value? 12218 004246'01 254 00 0 00 004253' ifskp. ;[196] Yes 12219 004247'01 316 03 0 00 006253' camn t3, [ .infin ] ;[212] Our talsiman for zero? 12220 004250'01 400 03 0 00 000000 setz t3, ;[212] Stomp appropriately 12221 004251'01 124 02 0 01 000000 dmovem t2, (t1) ;[196] Save a double value 12222 004252'01 254 00 0 00 004254' else. ;[196] No, it's a single value 12223 004253'01 202 02 0 01 000000 movem t2, (t1) ; Save the value. 12224 004254'01 endif. ;[196] 12225 004254'01 263 17 0 00 000000 ret 12226 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 78 K20PAR MAC 20-Aug-24 23:12 SET ITS-BINARY command 12227 subttl SET ITS-BINARY command 12228 12229 chgsec(code,const) ;;FDB's are not in code, they're in const 12230 001316'02 000002 000000 sitfdb: flddb. .cmkey,,offon,,on 12231 001317'02 000000 001145' 12232 001320'02 000000 000000 12233 001321'02 44 07 0 00 002333' 12234 retsec ;;Back to where-ever we started from 12235 12236 004255'01 200 16 0 00 000000# .setit: guide ; Issue guide word. 12237 004256'01 260 17 0 00 004230* 12238 001322'02 000000000000# 12239 001635'04 146 157 162 155 141 12240 004257'01 201 01 0 00 000000# movei t1, sitfdb 12241 004260'01 260 17 0 00 004232* call rfield ; Parse a keyword. 12242 004261'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 12243 004262'01 202 02 0 00 004243* movem t2, pars3 ; Save into pars3. 12244 004263'01 336 00 0 00 004235* skipn definf ;[77] In DEFINE? 12245 004264'01 260 17 0 00 004236* confrm ;[77] No, get confirmation. 12246 004265'01 263 17 0 00 000000 ret 12247 12248 remark SET ITS-BINARY semantic action 12249 12250 004266'01 $setit: extern itsflg ; and of our necessary 12251 004266'01 200 01 0 00 004262* move t1, pars3 ; Just save the value in the ITS flag. 12252 004267'01 202 01 0 00 004017* movem t1, itsflg 12253 004270'01 476 00 0 00 004024* setom autbyt ;[232] Force auto-byte 12254 004271'01 402 00 0 00 004026* setzm tbtflg ;[232] Clear 36 bit byte size 12255 004272'01 402 00 0 00 004025* setzm ebtflg ;[232] Clear 8 bit byte size 12256 004273'01 263 17 0 00 000000 ret 12257 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 79 K20PAR MAC 20-Aug-24 23:12 Storage for SET PROMPT prompt processing 12258 subttl Storage for SET PROMPT prompt processing 12259 12260 chgsec(code,data) ;[248] Writable storage is in DATA .PSECT 12261 12262 000003'05 prompx: intern prompx ;[248] Only used by K20MIT, actually 12263 000003'05 block atmbln ;[248] Allow a foolishly long prompt 12264 000144'05 block 1 ;[248] And space for the right pointy bracket 12265 000145' %eoprm==. ;[248] Save end or prompt location 12266 000003'05 reloc prompx ;[248] Get back to the beginning 12267 ;[248] to overwrite with default 12268 000003'05 113 145 162 155 151 asciz/Kermit-20>/ ; Program prompt text (replacable) 12269 000145'05 reloc %eoprm ;[248] Back to allocating regular storage 12270 000142 %prmln==%eoprm-prompx ;[248] Save length of area in words 12271 12272 000145'05 tpromp: block %prmln ;[248] Temporary staging area for parsed prompt 12273 retsec ;[248] Back to code 12274 12275 cleans(<%eoprm,%prmln>) ;[248] Clean up working symbols 12276 12277 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 80 K20PAR MAC 20-Aug-24 23:12 SET prompt command parsing tables 12278 subttl SET prompt command parsing tables 12279 12280 ; Originally [137], but greatly rewritten here. Also allows prompt 12281 ; to be part of DEFINE. The advantage is that you can have the macro 12282 ; set the prompt to be the name of the macro, which can help you recall 12283 ; what parameters you have in effect. 12284 ; 12285 ; Added C-escape-sequence expansion to actually count the string in 12286 ; the atom buffer. Added character counting and limits to eliminate 12287 ; the dreaded Charlie C. Kim effect, an early indication of the necessity 12288 ; of the Kermit protocol. 12289 12290 ; N.B., Note how argument is passed in .CMDEF, this is a MACRO limitation 12291 12292 chgsec(code,const) ;;FDB's are not in code, they're in const 12293 001323'02 021006 001327' kprmpt: fld(.cmqst,cm%fnc)!cm%hpp!cm%dpp!kprmp1 ;[190] .cmfnp 12294 001324'02 000000 000000 0 ;[190] .cmdat (none) 12295 001325'02 000000000000# cascii () ;[190] .cmhlp 12296 001637'04 113 105 122 115 111 12297 001326'02 000000000000# cascii ("Kermit-20>") ;[190] .cmdef 12298 001645'04 042 113 145 162 155 12299 001327'02 017004 000000 kprmp1: fld(.cmtxt,cm%fnc)!cm%hpp ;[190] .cmfnp 12300 001330'02 000000 000000 0 ;[190] .cmdat (none) 12301 001331'02 000000000000# cascii () ;[190] .cmhlp 12302 001650'04 113 105 122 115 111 12303 retsec ;;Restore psects 12304 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81 K20PAR MAC 20-Aug-24 23:12 SET prompt command dynamic prompt builder 12305 subttl SET prompt command dynamic prompt builder 12306 12307 remark ;[270] ; Below are set in K20NET 12308 extern myprom ;[270] ; Prompt prefix built off system name, if DECnet 12309 extern ttynam ;[270] ; Prompt prefix built off terminal, if serial 12310 extern ptynam ;[270] ; Prompt prefix built off pseudo-terminal, if PTY 12311 12312 extern ttyflg ;[270] ; Flag for doing a real terminal 12313 extern ptyflg ;[270] ; Flag for doing a pseudo-terminal 12314 extern nrtflg ;[270] ; Flag for doing DECnet Network Remote Terminal!! 12315 12316 chgsec(code,data) ;[270] Storage for the constructed prompt 12317 000307'05 newprm: block 6 ;[270] 29 characters, maximum 12318 retsec ;[270] Back to code 12319 12320 004274'01 265 16 0 00 006464' dyprom: saveac ;[270] Will need a few extra registers 12321 004275'01 403 07 0 00 000011 setzb q3, q5 ;[270] Let's assume we can't figure anything out 12322 004276'01 336 10 0 00 000001 skipn q4, t1 ;[270] Load and check kprmpt+.cmdef (default prompt) 12323 004277'01 263 17 0 00 000000 ret ;[270] Wasn't any, leave 12324 004300'01 336 00 0 00 000063* skipn local ;[270] Ah, we're supposed to be here, right? 12325 004301'01 263 17 0 00 000000 ret ;[270] No, leave 12326 12327 004302'01 415 16 0 00 004324' block. ;[270] Enter block mode for better control flow 12328 004303'01 261 17 0 00 000016 12329 004304'01 332 00 0 00 000432* ifme. vtermf ;[270] Not on a virtual terminal? 12330 004305'01 254 00 0 00 004312' 12331 004306'01 336 00 0 00 000000* skipn ttyflg ;[270] Then it better be a real terminal 12332 004307'01 263 17 0 00 000000 ret ;[270] It's not, so let's forget about this 12333 004310'01 201 07 0 00 000000* movei q3, ttynam ;[270] Use the terminal line 12334 004311'01 254 00 0 00 003700* retskp ;[270] Return success 12335 004312'01 endif. ;[270] End case serial line 12336 004312'01 336 00 0 00 000000* ifmn. ptyflg ;[270] Pseudo-terminal? 12337 004313'01 254 00 0 00 004317' 12338 004314'01 201 07 0 00 000000* movei q3, ptynam ;[270] Use the PTY device name and 12339 004315'01 201 11 0 00 004310* movei q5, ttynam ;[273] its associated terminal line 12340 004316'01 254 00 0 00 004311* retskp ;[270] Return success 12341 004317'01 endif. ;[270] End case serial line 12342 004317'01 336 00 0 00 000000* ifmn. nrtflg ;[270] Network remote terminal 12343 004320'01 254 00 0 00 004323' 12344 004321'01 201 07 0 00 000000* movei q3, myprom ;[270] Use the local system name 12345 004322'01 254 00 0 00 004316* retskp ;[270] Return success 12346 004323'01 endif. ;[270] End case serial line 12347 remark ;[270] If get here, we don't know... bug!! 12348 004323'01 263 17 0 00 000000 endbk. ;[270] End decision block for prefix 12349 004324'01 254 00 0 00 004330' ifskp. ;[270] Determined the prefix? 12350 004325'01 505 07 0 00 440700 hrli q3,(point 7,0) ;[270] Yes! Turn it into a hardware pointer 12351 004326'01 200 02 0 00 000007 move t2, q3 ;[270] Load as the 'prefix' 12352 004327'01 254 00 0 00 004331' else. ;[270] Otherwise, couldn't figure it out 12353 004330'01 263 17 0 00 000000 ret ;[270] So signal to just use the default 12354 004331'01 endif. ;[270] End determination result handling 12355 ;[270] Otherwise, start building the prompt 12356 004331'01 200 01 0 00 006476' move t1,[point 7,newprm] 12357 004332'01 200 04 0 00 000001 move t4, t1 ;[270] Save a copy of destination 12358 004333'01 201 03 0 00 000042 movei t3, .chdbq ;[270] Start begining of default with a double quote 12359 004334'01 136 03 0 00 000001 idpb t3, t1 ;[270] Deposit it in k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81-1 K20PAR MAC 20-Aug-24 23:12 SET prompt command dynamic prompt builder 12360 ;[270] N.B., some pointers are OWGP's to section 12361 004335'01 do. ;[270] one, which EXTEND chokes on in section zero 12362 004335'01 134 03 0 00 000002 ildb t3, t2 ;[270] Pick up a byte 12363 004336'01 322 03 0 00 004341' jumpe t3, endlp. ;[270] If NUL, done 12364 004337'01 136 03 0 00 000001 idpb t3, t1 ;[270] Deposit 12365 004340'01 254 00 0 00 004335' loop. ;[270] Get some more, wee!! 12366 004341'01 enddo. ;[270] End loop lexical context 12367 004341'01 336 02 0 00 000011 skipn t2, q5 ;[270] Two part device prefix? 12368 004342'01 254 00 0 00 004361' ifskp. ;[270] Yes, append that, too 12369 004343'01 201 03 0 00 000050 movei t3, .chlpa ;[270] Load left parenthesis 12370 004344'01 137 03 0 00 000001 dpb t3, t1 ;[270] Overwrite the trailing colen 12371 004345'01 505 02 0 00 440700 hrli t2,(point 7,0) ;[270] Turn address into a hardware pointer 12372 004346'01 133 00 0 00 000002 ibp t2 ;[270] Skip the first T of TTY 12373 004347'01 133 00 0 00 000002 ibp t2 ;[270] Skip the second T of TTY 12374 004350'01 133 00 0 00 000002 ibp t2 ;[270] Skip the first Y of TTY 12375 004351'01 do. ;[270] one, which EXTEND chokes on in section zero 12376 004351'01 134 03 0 00 000002 ildb t3, t2 ;[270] Pick up a byte 12377 004352'01 322 03 0 00 004355' jumpe t3, endlp. ;[270] If NUL, done 12378 004353'01 136 03 0 00 000001 idpb t3, t1 ;[270] Deposit 12379 004354'01 254 00 0 00 004351' loop. ;[270] Get some more, wee!! 12380 004355'01 enddo. ;[270] End loop lexical context 12381 004355'01 201 03 0 00 000051 movei t3, .chrpa ;[270] Load the right parenthesis 12382 004356'01 137 03 0 00 000001 dpb t3, t1 ;[270] Overwrite the trailing colen 12383 004357'01 201 03 0 00 000072 movei t3, ":" ;[270] Load the device punctuation 12384 004360'01 136 03 0 00 000001 idpb t3, t1 ;[270] Append it to the end 12385 004361'01 endif. ;[270] End possible secondary prefix 12386 004361'01 200 02 0 00 000010 move t2, q4 ;[270] Now point to the 'suffix' 12387 004362'01 133 00 0 00 000002 ibp t2 ;[270] Skip the initial double quote, we already did it 12388 004363'01 do. ;[270] one, which EXTEND chokes on in section zero 12389 004363'01 134 03 0 00 000002 ildb t3, t2 ;[270] Pick up a byte 12390 004364'01 322 03 0 00 004367' jumpe t3, endlp. ;[270] If NUL, done 12391 004365'01 136 03 0 00 000001 idpb t3, t1 ;[270] Deposit 12392 004366'01 254 00 0 00 004363' loop. ;[270] Get some more, wee!! 12393 004367'01 enddo. ;[270] End loop lexical context 12394 12395 004367'01 400 03 0 00 000000 setz t3, ;[270] Cons up a NUL 12396 004370'01 136 03 0 00 000001 idpb t3, t1 ;[270] Tie off the string 12397 004371'01 200 02 0 00 000004 move t2, t4 ;[270] Return pointer to cuspy new default prompt 12398 004372'01 254 00 0 00 004322* retskp ;[270] Won! 12399 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 82 K20PAR MAC 20-Aug-24 23:12 SET prompt command parsing 12400 subttl SET prompt command parsing 12401 12402 004373'01 200 16 0 00 000000# .setpr: guide ; Parse the rest of the SET PROMPT command. 12403 004374'01 260 17 0 00 004256* 12404 001332'02 000000000000# 12405 001656'04 164 157 000 000 000 12406 004375'01 403 01 0 00 000002 setzb t1, t2 ;[190] Cons up some .chnul 12407 004376'01 124 01 0 00 004203* dmovem t1, atmbuf ;[190] Give the atom buffer a scrub a dub 12408 004377'01 336 00 0 00 004300* ifmn. local ;[270] Is it local? 12409 004400'01 254 00 0 00 004416' 12410 004401'01 265 16 0 00 006341' saveac ;[248] Dynamic FDB needs an extra AC 12411 004402'01 265 16 0 00 003050* anstkv (q1,^d4) ;[190] Build the fdb on the fly 12412 004403'01 000000 000004 12413 004404'01 415 05 0 17 777773 12414 004405'01 120 01 0 00 000000# dmove t1, kprmpt ;[190] Load fdb and default (none) 12415 004406'01 124 01 0 05 000000 dmovem t1, .cmfnp(q1) ;[190] Store both in dynamic block 12416 004407'01 200 01 0 00 000000# move t1,kprmpt+.cmdef ;[270] Will always be the suffix 12417 004410'01 260 17 0 00 004274' call dyprom ;[270] Build a dynamic prompt 12418 004411'01 254 00 0 00 004416' anskp. ;[270] If didn't work, just go with old reliable 12419 004412'01 200 01 0 00 000000# move t1,kprmpt+.cmhlp ;[190] Load the help text pointer 12420 remark t2, dyprom ;[270] Returned result in t2 12421 004413'01 124 01 0 05 000002 dmovem t1, .cmhlp(q1) ;[190] Store both in dynamic block 12422 004414'01 200 01 0 00 000005 move t1, q1 ;[190] Load pointer to new fdb 12423 004415'01 254 00 0 00 004420' else. ;[190] Otherwise use vanilla default 12424 004416'01 265 16 0 00 006477' saveac ;[248] And will only need one register 12425 004417'01 201 01 0 00 000000# movei t1, kprmpt ;[190] Original prompt 12426 004420'01 endif. ;[190] End dynamic fdb build 12427 12428 move q2, [ ;[248] Load temporary prompt working area 12429 004420'01 200 06 0 00 006505' point 7, tpromp ] ;[248] For later work by semantic action 12430 12431 004421'01 260 17 0 00 004260* call rfield ;[190] Parse for some kind of string 12432 move t1, [ ;[248] Copy and count the parsed string 12433 004422'01 200 01 0 00 006360' point 7, atmbuf ] ;[248] From the atom buffer 12434 004423'01 200 02 0 00 000006 move t2, q2 ;[248] into temporary prompt 12435 004424'01 260 17 0 00 001057* call asczcp ;[248] Move the string on top of itself, returning count 12436 004425'01 373 00 0 00 000003 sosle t3 ;[248] Don't count the NUL at the end!! 12437 004426'01 254 00 0 00 004431' ifskp. ;[248] Didn't get anything, so fix that up 12438 004427'01 402 00 0 00 000000# setzm tpromp ;[248] No temporary prompt 12439 004430'01 400 03 0 00 000000 setz t3, ;[248] Clamp to zero length 12440 004431'01 endif. ;[248] End case post count fix up 12441 12442 004431'01 200 04 0 00 000006 move t4, q2 ;[248] Load pointer to string to expand 12443 004432'01 124 03 0 00 004266* dmovem t3, pars3 ;[248] Pass into semantic action 12444 004433'01 336 00 0 00 004263* skipn definf ;[77] In DEFINE? 12445 004434'01 260 17 0 00 004264* confrm ;[77] No, get confirmation. 12446 12447 004435'01 263 17 0 00 000000 ret 12448 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 83 K20PAR MAC 20-Aug-24 23:12 Execute the SET PROMPT command. 12449 subttl Execute the SET PROMPT command. 12450 12451 ; Rewritten for [194], [203] and [248] 12452 12453 chgsec(code,const) ;[248] String constants go in CONST .PSECT 12454 001333'02 000000 000003 defkpr: ^d3 ;[248] Two words of text plus trailing NUL 12455 001334'02 000000 001335' defkpt ;[248] Address of prompt text 12456 001335'02 113 145 162 155 151 defkpt: asciz "Kermit-20>" ;[248] Default Kermit prompt text 12457 12458 ; Quickly copies the length checked string that .setpr built in the 12459 ; temporary prompt holding area, expanding as appropriate. 12460 12461 001340'02 016 00 0 00 000000 movprm: movslj 0,0 ;[203] Move string left justified (fastest) 12462 001341'02 000000 000000 .chnul ;[203] No fill, actually 12463 retsec ;[248] Back into code 12464 12465 extern chrtab, cescxp ;[203] C-escape-sequence expansion 12466 12467 004436'01 265 16 0 00 006257' $setpr: saveac ;[248] Don't let piggy movslj trash these 12468 004437'01 120 07 0 00 004432* dmove q3, pars3 ;[248] Load parsed string 12469 12470 004440'01 333 03 0 00 000007 skiple t3, q3 ;[248] Load and test length 12471 004441'01 254 00 0 00 004446' ifskp. ;[248] Zero length or gubbish? 12472 004442'01 120 01 0 00 000000# dmove t1, defkpr ;[248] Fine, ignore it 12473 004443'01 201 03 0 00 000000# movei t3, prompx ;[248] Putting default into prompt 12474 004444'01 123 01 0 00 006402' xblt. t1 ;[248] Drop it in 12475 004445'01 263 17 0 00 000000 ret ;[248] We're done 12476 004446'01 endif. ;[248] End case of no prompt or gubbish 12477 12478 004446'01 200 01 0 00 000010 move t1, q4 ;[248] Source string 12479 004447'01 200 02 0 00 000010 move t2, q4 ;[248] Will be expanding (I.E., shrinking) in place 12480 remark t3, q3 ;[248] Loaded and checked by skiple, above 12481 004450'01 201 04 0 00 001115* movei t4, chrtab ;[248] Not doing upper casing 12482 12483 004451'01 260 17 0 00 001116* call cescxp ;[203] Expand any C-escape-sequences 12484 004452'01 334 00 0 00 000000 %ermsg (,r) ;[248] Failed?? 12485 004453'01 254 00 0 00 004457' 12486 004454'01 265 01 0 00 002657* 12487 004455'01 000000000000# 12488 004456'01 254 00 0 00 004226* 12489 001657'04 123 145 164 040 120 12490 004457'01 337 01 0 00 000003 skipg t1, t3 ;[248] Load and check updated length 12491 004460'01 334 00 0 00 000000 %ermsg (,r) ;[248] Failed?? 12492 004461'01 254 00 0 00 004465' 12493 004462'01 265 01 0 00 004454* 12494 004463'01 000000000000# 12495 004464'01 254 00 0 00 004456* 12496 001666'04 123 145 164 040 120 12497 12498 004465'01 200 02 0 00 000010 move t2, q4 ;[248] Load source 12499 004466'01 403 03 0 00 000006 setzb t3, q2 ;[203] Section local pointers 12500 004467'01 200 04 0 00 000001 move t4, t1 ;[203] Equal lengths; no filling 12501 004470'01 200 05 0 00 006506' move q1,[point 7, prompx] ;[203] What dpromp will use 12502 004471'01 123 01 0 00 000000# extend t1, movprm ;[203] Copy the string over, wee!! 12503 004472'01 600 00 0 00 000000 nop ;[203] Ignore +1 which should never happen k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 83-1 K20PAR MAC 20-Aug-24 23:12 Execute the SET PROMPT command. 12504 004473'01 136 03 0 00 000005 idpb t3, q1 ;[248] Tie off the prompt 12505 004474'01 263 17 0 00 000000 ret ;[203] That's it, really 12506 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 84 K20PAR MAC 20-Aug-24 23:12 SET RETRY command 12507 subttl SET RETRY command 12508 12509 001342'02 000000 000000 %table(retrtb) ;[194] 12510 001343'02 000000# 000000 %key2 ,0 ;[194] 12511 001050'03 151 156 151 164 151 12512 001344'02 000000# 000001 %key2 ,1 ;[194] 12513 001054'03 160 141 143 153 145 12514 001342'02 000002 000002 %tbend ;[194] 12515 12516 chgsec(code,const) ;;FDB's are not in code, they're in const 12517 001345'02 000002 000000 srefdb: flddb. .cmkey,,retrtb,,,, ;[194] 12518 001346'02 000000 001342' 12519 001347'02 000000 000000 12520 001350'02 44 07 0 00 003067' 12521 001351'02 001006 000000 srifdb: flddb. .cmnum,,^d10,,5,, 12522 001352'02 000000 000012 12523 001353'02 44 07 0 00 003071' 12524 001354'02 44 07 0 00 002066' 12525 001355'02 001006 000000 srpfdb: flddb. .cmnum,,^d10,,16 12526 001356'02 000000 000012 12527 001357'02 44 07 0 00 003104' 12528 001360'02 44 07 0 00 003116' 12529 retsec ;;Back to where-ever we started from 12530 12531 004475'01 200 16 0 00 000000# .setre: guide ;[37] SET RETRY 12532 004476'01 260 17 0 00 004374* 12533 001361'02 000000000000# 12534 001675'04 155 141 170 151 155 12535 004477'01 201 01 0 00 000000# movei t1, srefdb ;[194] 12536 004500'01 260 17 0 00 004421* call rfield 12537 004501'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the keyword index 12538 004502'01 202 02 0 00 004437* movem t2, pars3 12539 004503'01 200 16 0 00 000000# guide ; Prompt for the value 12540 004504'01 260 17 0 00 004476* 12541 001362'02 000000000000# 12542 001700'04 164 157 000 000 000 12543 004505'01 201 01 0 00 000000# movei t1, srifdb ;[194] Let's assume it was initial-connection 12544 004506'01 332 00 0 00 004502* skipe pars3 ;[194] But!! Was it? 12545 004507'01 201 01 0 00 000000# movei t1, srpfdb ;[194] No, doing it for packets 12546 004510'01 260 17 0 00 004500* call rfield 12547 004511'01 202 02 0 00 004244* movem t2, pars4 12548 12549 004512'01 325 02 0 00 004532' ifl. t2 ;[194] Negative counts are silly 12550 004513'01 200 01 0 00 000000# emsg ;[187] 12551 004514'01 104 00 0 00 000313 12552 001363'02 000000000000# 12553 001701'04 101 040 156 145 147 12554 004515'01 336 00 0 00 004506* ifmn. pars3 ;[194] Set if packets 12555 004516'01 254 00 0 00 004523' 12556 004517'01 200 01 0 00 000000# txmsg ;[194] 12557 004520'01 104 00 0 00 000076 12558 004521'01 320 12 0 00 004522' 12559 001364'02 000000000000# 12560 001707'04 160 141 143 153 145 12561 004522'01 254 00 0 00 004526' else. ;[187] k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 84-1 K20PAR MAC 20-Aug-24 23:12 SET RETRY command 12562 004523'01 200 01 0 00 000000# txmsg ;[194] 12563 004524'01 104 00 0 00 000076 12564 004525'01 320 12 0 00 004526' 12565 001365'02 000000000000# 12566 001712'04 151 156 151 164 151 12567 004526'01 endif. ;[187] 12568 004526'01 200 01 0 00 000000# txmsg < is illogical> ;[194] Go tell 'em, Spock-o 12569 004527'01 104 00 0 00 000076 12570 004530'01 320 12 0 00 004531' 12571 001366'02 000000000000# 12572 001720'04 040 151 163 040 151 12573 004531'01 254 00 0 00 004154* jrst cmder1 ;[194] 12574 004532'01 endif. ;[194] 12575 12576 004532'01 336 00 0 00 004433* skipn definf ;[77] In DEFINE? 12577 004533'01 260 17 0 00 004434* confrm ;[77] No, get confirmation. 12578 004534'01 263 17 0 00 000000 ret 12579 12580 remark SET RETRY semantic action 12581 12582 004535'01 $setre: extern imxtry, maxtry ; Our necessaries 12583 004535'01 120 01 0 00 004515* dmove t1, pars3 ;[37] SET RETRY 12584 remark t2, pars4 ;[194] 12585 004536'01 202 02 1 01 006507' movem t2, @[exp imxtry, maxtry](t1) 12586 004537'01 263 17 0 00 000000 ret 12587 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 85 K20PAR MAC 20-Aug-24 23:12 SET SPEED (BAUD RATE) 12588 subttl SET SPEED (BAUD RATE) 12589 12590 001367'02 000000 000000 %table(baudtb) ;Table of DH11 supported speeds 12591 001370'02 000000# 000156 %key2 <110>,^d110 12592 001056'03 061 061 060 000 000 12593 001371'02 000000# 002260 %key2 <1200>,^d1200 12594 001057'03 061 062 060 060 000 12595 001372'02 000000# 000226 %key2 <150>,^d150 12596 001060'03 061 065 060 000 000 12597 001373'02 000000# 003410 %key2 <1800>,^d1800 12598 001061'03 061 070 060 060 000 12599 001374'02 000000# 003720 %key2 <2000>,^d2000 12600 001062'03 062 060 060 060 000 12601 001375'02 000000# 004540 %key2 <2400>,^d2400 12602 001063'03 062 064 060 060 000 12603 001376'02 000000# 000454 %key2 <300>,^d300 12604 001064'03 063 060 060 000 000 12605 001377'02 000000# 007020 %key2 <3600>,^d3600 12606 001065'03 063 066 060 060 000 12607 001400'02 000000# 011300 %key2 <4800>,^d4800 12608 001066'03 064 070 060 060 000 12609 001401'02 000000# 001130 %key2 <600>,^d600 12610 001067'03 066 060 060 000 000 12611 001402'02 000000# 016040 %key2 <7200>,^d7200 12612 001070'03 067 062 060 060 000 12613 001403'02 000000# 022600 %key2 <9600>,^d9600 12614 001071'03 071 066 060 060 000 12615 001367'02 000014 000014 %tbend 12616 12617 chgsec(code,const) ;;FDB's are not in code, they're in const 12618 001404'02 000000 000000 sxpfdb: flddb. .cmkey,,baudtb 12619 001405'02 000000 001367' 12620 retsec ;;Back to where-ever we started from 12621 12622 004540'01 200 16 0 00 000000# .setxp: guide 12623 004541'01 260 17 0 00 004504* 12624 001406'02 000000000000# 12625 001723'04 164 157 000 000 000 12626 004542'01 201 01 0 00 000000# movei t1, sxpfdb 12627 004543'01 260 17 0 00 004510* call rfield 12628 004544'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 12629 004545'01 202 02 0 00 004535* movem t2, pars3 ; Save into pars3. 12630 004546'01 336 00 0 00 004532* skipn definf ;[77] In DEFINE? 12631 004547'01 260 17 0 00 004533* confrm ;[77] No, get confirmation. 12632 004550'01 263 17 0 00 000000 ret 12633 12634 remark SET SPEED semantic action 12635 12636 004551'01 $setsp: extern netjfn, vtermf ;[194] Our necessaries 12637 extern speed, setspd ;[194] These, too 12638 extern ttyjfn ;[186] 12639 12640 004551'01 336 00 0 00 004304* ifmn. vtermf ;[186] SET SPEED is senseless if virtual 12641 004552'01 254 00 0 00 004562' 12642 004553'01 476 00 0 00 000000* setom speed ;[186] These have no speed k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 85-1 K20PAR MAC 20-Aug-24 23:12 SET SPEED (BAUD RATE) 12643 004554'01 476 00 0 00 000000* setom setspd ;[186] Kind of set the speed... 12644 004555'01 334 00 0 00 000000 %ermsg (,r) 12645 004556'01 254 00 0 00 004562' 12646 004557'01 265 01 0 00 004462* 12647 004560'01 000000000000# 12648 004561'01 254 00 0 00 004464* 12649 001724'04 103 141 156 040 156 12650 004562'01 endif. ;[186] End case non-physical terminal 12651 12652 004562'01 200 03 0 00 004545* move t3, pars3 ; Get the speed that was parsed. 12653 004563'01 202 03 0 00 004553* movem t3, speed ; Record it. 12654 004564'01 337 01 0 00 000000* skipg t1, netjfn ;[186] Get the output terminal JFN. 12655 004565'01 200 01 0 00 001176* move t1, ttyjfn ;[186] Unless using local terminal 12656 004566'01 201 02 0 00 000026 movx t2, .mospd ; Speed to set. 12657 004567'01 504 03 0 00 004563* hrl t3, speed ; Input and output speeds the same. 12658 004570'01 104 00 0 00 000077 MTOPR ; Attempt to set it. 12659 004571'01 320 12 0 00 004573' %jserr (,r) 12660 004572'01 254 00 0 00 004576' 12661 004573'01 265 01 0 00 004557* 12662 004574'01 000000 000000 12663 004575'01 254 00 0 00 004561* 12664 004576'01 476 00 0 00 004554* setom setspd ;[161] Flag that speed was explicitly set. 12665 004577'01 263 17 0 00 000000 ret 12666 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 86 K20PAR MAC 20-Aug-24 23:12 SET SERVER-TIMEOUT semantic action 12667 subttl SET SERVER-TIMEOUT semantic action 12668 12669 ; Command is at a higher level because this is where Kermit-10 puts it 12670 ; and I keep mixing the two up. 12671 ; 12672 ; Further, it seems counter-intuitive to put server-timeout in as a 12673 ; receive option when what is actually happening is that the server is 12674 ; *sending* and not recieving. 12675 ; 12676 ; None the less, this way to do it is invisible and the other is 12677 ; visible because that's the way it's always been. 12678 ; 12679 ; Parse is handled by common .setim. 12680 12681 004600'01 120 01 0 00 004511* $setst: dmove t1, pars4 ;[217] Load milliseconds and floating seconds 12682 004601'01 124 01 0 00 000000* dmovem t1, srvtim## ;[217] Store them 12683 004602'01 263 17 0 00 000000 ret ;[217] That's it, really 12684 12685 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 87 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT parameter parsing, all [266] 12686 subttl SET TRANSMIT parameter parsing, all [266] 12687 12688 ;[266] By rights, this really should have gone in K20IOC, but that 12689 ; module is getting large, so it went in here. 12690 12691 ;[266] Do NOT order these data entries! 12692 12693 chgsec(code,data) ;[266] Storage for variables we sety 12694 000315'05 000 00 0 00 000000 teofch:: Z ;** DO NOT ;[266] Transmit EOF character (defaults to none) 12695 000316'05 000 00 0 00 000000 tsilen:: Z ; REORDER ** ;[266] Whether to allow blat from parsing 12696 000317'05 000000 004000 tmaxln:: strbl8 ;[266] Maximum line we'll try to force 12697 000320'05 000000 000000 timeou:: exp Z,Z ;[266] If timing out the SIN(R)%/SOUT(R)% 12698 000322'05 000000 000000 tpause:: exp Z,Z ;[266] Amount to pause, assume nothing 12699 000324'05 000 00 0 00 000000 tobser:: Z ;[273] Whether observing case in searches 12700 000325'05 000 00 0 00 000000 tsetsd:: Z ;[275] Settings defaults come from SET INPUT 12701 000326'05 000 00 0 00 000000 tdefpl:: Z ;[272] Length of remote prompt, if using one 12702 000327'05 000 00 0 00 000000 tdefpp:: Z ;[272] Pointer to remote prompt, if using one 12703 000330'05 tdefps:: block strblw ;[272] Block for remote string string 12704 retsec 12705 12706 001407'02 000000 000000 %table(tratbl) ;[266] Transmit parameter table 12707 001410'02 000000# 000000# %key3 , .setca, tobser ;[273] 12708 001072'03 143 141 163 145 000 12709 001073'03 000000# 000000# 12710 001411'02 000000# 000000# %key3 , .setdf, tdefpl ;[272] 12711 001074'03 144 145 146 141 165 12712 001101'03 000000# 000000# 12713 001412'02 000000# 000000# %key3 , .setef, teofch ;[266] 12714 001102'03 105 117 106 000 000 12715 001103'03 000000# 000000# 12716 001413'02 000000# 000000# %key3 , .setmx, tmaxln ;[266] 12717 001104'03 155 141 170 151 155 12718 001107'03 000000# 000000# 12719 001414'02 000000# 000000# %key3 , .setpu, tpause ;[266] 12720 001110'03 160 141 165 163 145 12721 001112'03 000000# 000000# 12722 001415'02 000000# 000000# %key3 , .setsd, tsetsd ;[275] 12723 001113'03 163 145 164 164 151 12724 001117'03 000000# 000000# 12725 001416'02 000000# 000000# %key3 , .setsi, tsilen ;[266] 12726 001120'03 163 151 154 145 156 12727 001122'03 000000# 000000# 12728 001417'02 000000# 000000# %key3 , .setmo, timeou ;[266] 12729 001123'03 164 151 155 145 157 12730 001125'03 000000# 000000# 12731 001407'02 000010 000010 %tbend 12732 12733 chgsec(code,const) ;;FDB's are not in code, they're in const 12734 001420'02 000000 000000 trafdb: flddb. .cmkey,,tratbl,,, 12735 001421'02 000000 001407' 12736 retsec ;;Back to where-ever we started from 12737 12738 004603'01 200 16 0 00 000000# .setra: guide ;[266] Inform them we're changing a setting 12739 004604'01 260 17 0 00 004541* 12740 001422'02 000000000000# k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 87-1 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT parameter parsing, all [266] 12741 001736'04 160 141 162 141 155 12742 004605'01 201 01 0 00 000000# movei t1, trafdb ;[266] Settings we can change for transmit 12743 004606'01 260 17 0 00 004543* call rfield ;[266] Go parse something 12744 004607'01 550 02 0 02 000000 hrrz t2, (t2) ;[266] Get the secondary routine addresses 12745 004610'01 202 02 0 00 004562* movem t2, pars3 ;[266] Save both for later parsing and semantic action 12746 004611'01 554 01 0 02 000000 hlrz t1, (t2) ;[266] Load the secondary parsing routine address 12747 004612'01 254 00 0 01 000000 callret (t1) ;[266] Go do something wonderful 12748 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 88 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT CASE [ observe | ignore ] 12749 subttl SET TRANSMIT CASE [ observe | ignore ] 12750 12751 extern castab ;[273] SET INPUT CASE in K20IOC 12752 12753 chgsec(code,const) ;;FDB's go in const .psect 12754 001423'02 010004 001426' casfdb: flddb. .cmcfm,,,,,cadfdb 12755 001424'02 000000 000000 12756 001425'02 44 07 0 00 003117' 12757 001426'02 000000 000000 cadfdb: flddb. .cmkey,,castab,,, 12758 001427'02 000000000000# 12759 retsec ;;Get back into code .psect 12760 12761 004613'01 200 16 0 00 000000# .setca: guide 12762 004614'01 260 17 0 00 004604* 12763 001430'02 000000000000# 12764 001740'04 146 157 162 040 155 12765 004615'01 265 16 0 00 006273' saveac ;[273] Need to remember function code 12766 12767 004616'01 201 01 0 00 000000# movei t1, casfdb ;[273] Looks just like 12768 004617'01 332 00 0 00 004546* skipe definf ;[273] Not in a DEFINE? 12769 004620'01 201 01 0 00 000000# movei t1, cadfdb ;[273] No, we are, so don't parse for a confirm 12770 004621'01 260 17 0 00 004606* call rfield ;[273] Parse a keyword or default 12771 ;[273] Got something, so pick up function code 12772 004622'01 .setc1: remark ;[275] Linkage from SETTINGS-DEFAULTS 12773 004622'01 135 05 0 00 006256' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] 12774 004623'01 302 05 0 00 000010 caie q1, .cmcfm ;[273] Wants the default? 12775 004624'01 254 00 0 00 004627' ifskp. ;[273] That's easy, give him the default (ignore) 12776 004625'01 400 02 0 00 000000 setz t2, ;[273] This is the parse value for "ignore" 12777 004626'01 254 00 0 00 004630' else. ;[273] Otherwise, handle the keyword 12778 004627'01 550 02 0 02 000000 hrrz t2, (t2) ;[273] Get the value for the keyword (0 or 1). 12779 004630'01 endif. ;[273] End parse determination and handling 12780 12781 004630'01 202 02 0 00 004600* movem t2, pars4 ;[273] Save as the integer value 12782 004631'01 402 00 0 00 004245* setzm pars5 ;[273] It's a single value, not a float 12783 12784 004632'01 306 05 0 00 000010 cain q1, .cmcfm ;[273] Was default requested? 12785 004633'01 263 17 0 00 000000 ret ;[273] It was, so don't reconfirm a confirmation 12786 004634'01 336 00 0 00 004617* skipn definf ;[273] In DEFINE? 12787 004635'01 260 17 0 00 004547* confrm ;[273] No, get confirmation. 12788 004636'01 263 17 0 00 000000 ret ;[273] Done 12789 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 89 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT settings-defaults 12790 subttl SET TRANSMIT settings-defaults 12791 12792 001431'02 000000 000000 %table(tsdtbl) ;[275] Transmit settings before table 12793 001432'02 000000# 000000 %key2 , 0 ;[275] Settings come from SET INPUT 12794 001126'03 151 156 160 165 164 12795 001433'02 000000# 777777 %key2 , -1 ;[275] Settings come from SET TRANSMIT 12796 001130'03 164 162 141 156 163 12797 001431'02 000002 000002 %tbend ;[275] 12798 12799 chgsec(code,const) ;;FDB's go in const .psect 12800 001434'02 010006 001440' tsdfdb: flddb. .cmcfm,,,,,tsdfd1 12801 001435'02 000000 000000 12802 001436'02 44 07 0 00 003126' 12803 001437'02 44 07 0 00 003140' 12804 001440'02 000000 000000 tsdfd1: flddb. .cmkey,,tsdtbl,,, 12805 001441'02 000000 001431' 12806 retsec ;;Get back into code .psect 12807 12808 004637'01 200 16 0 00 000000# .setsd: guide 12809 004640'01 260 17 0 00 004614* 12810 001442'02 000000000000# 12811 001750'04 164 157 040 164 162 12812 004641'01 265 16 0 00 006273' saveac ;[275] Will need to preserve for downstream function code 12813 12814 004642'01 201 01 0 00 000000# movei t1, tsdfdb ;[275] Looks a lot like SET CASE 12815 004643'01 332 00 0 00 004634* skipe definf ;[275] Not in a DEFINE? 12816 004644'01 201 01 0 00 000000# movei t1, tsdfd1 ;[275] No, we are, so don't parse for a confirm 12817 004645'01 260 17 0 00 004621* call rfield ;[275] Parse a keyword or default 12818 004646'01 254 00 0 00 004622' callret .setc1 ;[275] Join .setc1 to analyze parse 12819 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 90 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT DEFAULT-REMOTE-PROMPT secondary parsing tables and constants 12820 subttl SET TRANSMIT DEFAULT-REMOTE-PROMPT secondary parsing tables and constants 12821 12822 ; Gets a string, counts it and stashes it in a temporary area. Then 12823 ; tries to expand any C-escape characters and gives parse error if it 12824 ; can't, which allows the user to type a ^H and edit. 12825 ; 12826 ; It then hijacks the rest of the parse to get our own semantic action 12827 ; routine called instead of using the default to set a single or 12828 ; double value, which won't work for strings. 12829 ; 12830 ; Because of the design of the main parser to allow macro definitions 12831 ; and to be compliant with that paradigm, this involves an extra level 12832 ; of indirection, as seen below. 12833 ; 12834 ; We pull these same kind of shenanigans for SET INPUT SEARCH-DEFAULT 12835 ; in K20IOC (see .sinse:) 12836 12837 chgsec(code,const) ;;FDB's are not in code, they're in const 12838 001443'02 010004 001446' dfpfdb: flddb. .cmcfm,,,,,dfpfdt ;;[272] 12839 001444'02 000000 000000 12840 001445'02 44 07 0 00 003142' 12841 001446'02 021004 001451' dfpfdt: flddb. .cmqst,,,,,dfpfd1 ;;[272] 12842 001447'02 000000 000000 12843 001450'02 44 07 0 00 003153' 12844 001451'02 017004 000000 dfpfd1: flddb. .cmtxt,,,,, 12845 001452'02 000000 000000 12846 001453'02 44 07 0 00 003165' 12847 cleans() ;;[272] 12848 12849 001454'02 000000000000# $setdi: $setdf ;;[272] Indirect call for semantic action 12850 retsec ;;Back to where-ever we started from 12851 12852 004775 mxdpln==strblc-3 ;[272] Maximum length, minus 2 .chdql & .chnul 12853 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 91 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT DEFAULT-PROMPT secondary parsing 12854 subttl SET TRANSMIT DEFAULT-PROMPT secondary parsing 12855 12856 extern incase ;[273] Defined in K20IOC, INPUT case matching 12857 extern chrtup ;[273] Defined in K20IOC, UPPER casing translation 12858 12859 004647'01 200 16 0 00 000000# .setdf: guide ;[272] Prompt for a limited character 12860 004650'01 260 17 0 00 004640* 12861 001455'02 000000000000# 12862 001757'04 164 157 000 000 000 12863 004651'01 265 16 0 00 006257' saveac ;[272] Will need to save some parse results 12864 004652'01 201 01 0 00 000000# movei t1, dfpfdb ;[272] Parse for something to do 12865 004653'01 332 00 0 00 004643* skipe definf ;[272] We're not doing a DEFINE, are we? 12866 004654'01 201 01 0 00 000000# movei t1, dfpfdt ;[272] It doesn't work to use confirm, then 12867 004655'01 260 17 0 00 004645* call rfield ;[272] Go try to get something 12868 12869 004656'01 200 07 0 00 000003 move q3, t3 ;[272] Save original parse result 12870 004657'01 135 06 0 00 006454' ldb q2, [pointr (.cmfnp(q3),cm%fnc)] ;[264] Get what it parsed 12871 004660'01 200 10 0 00 000006 move q4, q2 ;[272] Save a copy, too 12872 004661'01 135 05 0 00 006511' ldb q1, [point 7,atmbuf,6] ;[272] Load first byte of atom buffer 12873 12874 004662'01 332 00 0 00 004653* skipe definf ;[272] Not in a DEFINE? 12875 004663'01 254 00 0 00 004666' ifskp. ;[272] No, let's look at the atom buffer 12876 004664'01 326 05 0 00 004666' ande. q1 ;[272] Nothing in there?? 12877 004665'01 201 06 0 00 000010 movei q2, .cmcfm ;[272] Turn it into a confirm, then 12878 004666'01 endif. ;[272] End case an empty string 12879 12880 004666'01 302 06 0 00 000010 caie q2, .cmcfm ;[272] Confirmation? 12881 004667'01 254 00 0 00 004673' ifskp. ;[272] Yes, we're done 12882 004670'01 403 02 0 00 000003 setzb t2, t3 ;[272] No count and no pointer 12883 004671'01 124 02 0 00 004610* dmovem t2, pars3 ;[272] Store for semantic action 12884 004672'01 254 00 0 00 004741' else. ;[272] Otherwise, count the string 12885 dmove t1, [ ;[272] Overwritting the atom buffer in place 12886 point 7, atmbuf ;[272] So the source is the atom buffer and 12887 004673'01 120 01 0 00 006360' point 7, atmbuf ] ;[272] the destination is the atom buffer 12888 004674'01 260 17 0 00 004424* call asczcp ;[272] Move the string on top of itself, returning count 12889 004675'01 373 00 0 00 000003 sosle t3 ;[272] Don't count the NUL at the end!! 12890 004676'01 254 00 0 00 004702' ifskp. ;[272] If went negative, then clear the default 12891 004677'01 403 02 0 00 000003 setzb t2, t3 ;[272] No count and no pointer 12892 004700'01 124 02 0 00 004671* dmovem t2, pars3 ;[272] Store for semantic action 12893 004701'01 254 00 0 00 004741' else. ;[272] Otherwise, try to expand 12894 dmove t1, [ ;[272] Now get it out of the atom buffer 12895 point 7, strbuf ;[272] So the destination is the string buffer 12896 004702'01 120 01 0 00 006512' point 7, atmbuf ] ;[272] and the source is the atom buffer 12897 004703'01 303 03 0 00 004775 caile t3, mxdpln ;[272] Typed his brains out? 12898 004704'01 201 03 0 00 004775 movx t3, mxdpln ;[272] Fine, but don't overwrite our storage 12899 004705'01 415 16 0 00 004717' block. ;[273] Set up block context for better control flow 12900 004706'01 261 17 0 00 000016 12901 004707'01 332 00 0 00 000000# ifme. tsetsd ;[273] Where are our defaults coming from? 12902 004710'01 254 00 0 00 004713' 12903 004711'01 200 04 0 00 000000* move t4, incase ;[273] Case sensitivity comes from SET INPUT CASE 12904 004712'01 254 00 0 00 004714' else. ;[273] Otherwise, comes from SET TRANSMIT CASE 12905 004713'01 200 04 0 00 000000# move t4, tobser ;[273] So that's a different variable 12906 004714'01 endif. ;[273] Now have somebody's case observance setting 12907 004714'01 326 04 0 00 004372* jumpn t4, RSKP ;[273] Set means observing case, skip return 12908 004715'01 263 17 0 00 000000 ret ;[273] Otherwise, case INsensitive, non-skip return k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 91-1 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT DEFAULT-PROMPT secondary parsing 12909 004716'01 263 17 0 00 000000 endbk. ;[273] End of block context 12910 004717'01 254 00 0 00 004722' ifskp. ;[273] Skip return is Case Sensitive compare 12911 004720'01 201 04 0 00 004450* movei t4, chrtab ;[273] Translate table does not UPPER case 12912 004721'01 254 00 0 00 004723' else. ;[273] Otherwise CASE INSENSITIVE 12913 004722'01 201 04 0 00 000000* movei t4, chrtup ;[273] Upper case everything and match against it 12914 004723'01 endif. ;[273] End translation table determination 12915 004723'01 260 17 0 00 004451* call cescxp ;[272] Expand any C-escape-sequences 12916 004724'01 334 00 0 00 000000 %ermsg (,cmder1) 12917 004725'01 254 00 0 00 004731' 12918 004726'01 265 01 0 00 004573* 12919 004727'01 000000000000# 12920 004730'01 254 00 0 00 004531* 12921 001760'04 123 105 124 040 124 12922 004731'01 326 03 0 00 004737' ife. t3 ;[272] Let's just double check the result 12923 004732'01 334 00 0 00 000000 %ermsg (,cmder1) 12924 004733'01 254 00 0 00 004737' 12925 004734'01 265 01 0 00 004726* 12926 004735'01 000000000000# 12927 004736'01 254 00 0 00 004730* 12928 001773'04 123 105 124 040 124 12929 004737'01 endif. ;[272] Otherwise, good count 12930 004737'01 200 04 0 00 006512' move t4, [point 7, strbuf] ;[272] Pointer to expanded string 12931 004740'01 124 03 0 00 004700* dmovem t3, pars3 ;[272] Store for semantic action 12932 004741'01 endif. ;[272] End case non-zero counted string 12933 004741'01 endif. ;[272] End case .cmqst or .cmtxt 12934 12935 remark ;[272] Now set up for some magic semantic action! 12936 004741'01 510 01 1 00 003163* hllz t1, @pars2 ;[272] Load invoking keyword (SET INPUT) 12937 004742'01 541 01 0 00 000000# hrri t1, $setdi ;[272] Load indirected address of our semantic action 12938 004743'01 202 01 0 00 004741* movem t1, pars2 ;[272] and take over the rest of the parse 12939 12940 remark ;[272] Now finish up the moby parse 12941 004744'01 306 10 0 00 000010 cain q4, .cmcfm ;[272] Original wasn't a confirm? 12942 004745'01 254 00 0 00 004751' ifskp. ;[272] Nope, we might have to confirm 12943 004746'01 332 00 0 00 004662* skipe definf ;[272] Not in a DEFINE command? 12944 004747'01 254 00 0 00 004751' anskp. ;[272] No, we are, so confirm will break macro 12945 004750'01 260 17 0 00 004635* confrm ;[266] Not in a DEFINE, so must confirm the command 12946 004751'01 endif. ;[272] End case potentially confirming string 12947 004751'01 263 17 0 00 000000 ret ;[272] Return ...somewhere... 12948 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 92 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT DEFAULT-PROMPT semantic action 12949 subttl SET TRANSMIT DEFAULT-PROMPT semantic action 12950 12951 ;[272] The code surrounds the string with double quotes so that an escape 12952 ; will fill in the search string for us when parsing TRANSMIT. 12953 12954 004752'01 265 16 0 00 006257' $setdf: saveac ;[272] movslj needs plenty registers! 12955 004753'01 120 07 0 00 004740* dmove q3, pars3 ;[272] Load the parse results, length and 12956 remark q4 ;[272] pointer ... 12957 12958 004754'01 323 07 0 00 005015' ifg. q3 ;[272] Got anything? 12959 004755'01 200 06 0 00 000010 move q2, q4 ;[272] Yes, let's have a quick peek 12960 004756'01 134 03 0 00 000006 ildb t3, q2 ;[272] Grab the first character 12961 004757'01 322 03 0 00 005015' andn. t3 ;[272] Treat a NUL as clearing the default 12962 004760'01 303 07 0 00 004775 caile q3, mxdpln ;[272] Got some crazy length? 12963 004761'01 201 07 0 00 004775 movx q3, mxdpln ;[272] Yes, clip it down; don't overwrite our storage 12964 004762'01 200 04 0 00 000007 move t4, q3 ;[272] Will only transfer the string 12965 004763'01 200 01 0 00 000004 move t1, t4 ;[272] So they'll be the same length 12966 004764'01 200 02 0 00 000010 move t2, q4 ;[272] Load the source 12967 004765'01 200 05 0 00 006514' move q1, [point 7, tdefps] ;[272] and the destination 12968 004766'01 306 03 0 00 000042 cain t3, .chdbq ;[272] First character NOT a double quote? 12969 004767'01 254 00 0 00 004773' ifskp. ;[272] No, so let's put one in 12970 004770'01 201 03 0 00 000042 movei t3, .chdbq ;[272] Load a double quote 12971 004771'01 136 03 0 00 000005 idpb t3, q1 ;[272] Store it 12972 004772'01 271 07 0 00 000001 addi q3, ^d1 ;[272] Increase final total length 12973 004773'01 endif. ;[272] End case quoting the string 12974 004773'01 403 03 0 00 000006 setzb t3, q2 ;[272] Section local pointers!!! 12975 004774'01 123 01 0 00 000000# extend t1, movprm ;[272] Copy the string over, wee!! 12976 004775'01 320 12 0 00 004777' %jsErr (,r) ;;[272] ?? 12977 004776'01 254 00 0 00 005002' 12978 004777'01 265 01 0 00 004734* 12979 005000'01 000000000000# 12980 005001'01 254 00 0 00 004575* 12981 002005'04 123 105 124 040 124 12982 005002'01 135 03 0 00 000005 ldb t3, q1 ;[272] Grab the final character 12983 005003'01 306 03 0 00 000042 cain t3, .chdbq ;[272] Final character NOT a double quote? 12984 005004'01 254 00 0 00 005010' ifskp. ;[272] No, so let's put one in 12985 005005'01 201 03 0 00 000042 movei t3, .chdbq ;[272] Load a double quote 12986 005006'01 136 03 0 00 000005 idpb t3, q1 ;[272] Store it 12987 005007'01 271 07 0 00 000001 addi q3, ^d1 ;[272] Increase final total length 12988 005010'01 endif. ;[272] End case quoting the string 12989 005010'01 200 10 0 00 006515' move q4, [point 7, tdefps] ;[272] Load pointer to default string 12990 005011'01 124 07 0 00 000000# dmovem q3, tdefpl ;[272] Store length and pointer 12991 005012'01 134 01 0 00 000005 ildb t1, q1 ;[272] Tie off the string, just in case 12992 005013'01 263 17 0 00 000000 ret ;[272] Done setting up the default! 12993 005014'01 254 00 0 00 005021' else. ;[272] Otherwise, empty string 12994 005015'01 403 01 0 00 000002 setzb t1, t2 ;[272] Cons up ten handy NUL's 12995 005016'01 124 01 0 00 000000# dmovem t1, tdefpl ;[272] Yes, so clear the length and pointer 12996 005017'01 124 01 0 00 000000# dmovem t1, tdefps ;[272] Stomp a bit of the buffer, too, just in case 12997 005020'01 263 17 0 00 000000 ret ;[272] Done with this easy case 12998 005021'01 endif. ;[272] End case clearing the default 12999 13000 005021'01 263 17 0 00 000000 ret ;[272] Should never get here, but just in case... 13001 13002 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 93 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT EOF secondary parsing 13003 subttl SET TRANSMIT EOF secondary parsing 13004 13005 005022'01 .setef: extern tranft ;[266] Transmit EOF token FDB is in K20IOC 13006 005022'01 200 16 0 00 000000# guide ;[266] Prompt for a limited character 13007 005023'01 260 17 0 00 004650* 13008 001456'02 000000000000# 13009 002017'04 143 150 141 162 141 13010 005024'01 201 01 0 00 000000* movei t1, tranft ;[265] Look for an EOF token 13011 005025'01 260 17 0 00 004655* call rfield ;[265] Ask them to type one of them 13012 005026'01 621 03 0 00 777777 tlz t3, -1 ;[265] Isolate fdb we actually used 13013 005027'01 200 02 0 03 000001 move t2, .cmdat(t3) ;[265] Pick up the byte pointer to the character 13014 005030'01 134 01 0 00 000002 ildb t1, t2 ;[265] Load the token character (only one) 13015 005031'01 306 01 0 00 000044 cain t1, "$" ;[266] Our goofy escape synonym? 13016 005032'01 201 01 0 00 000033 movei t1, .chesc ;[266] Yes, transmogrify it 13017 005033'01 260 17 1 00 004165* call @parity ;[266] And put parity on it (if doing parity) 13018 005034'01 202 01 0 00 004630* movem t1, pars4 ;[266] Save EOF character 13019 005035'01 402 00 0 00 004631* setzm pars5 ;[266] It's a single value 13020 005036'01 336 00 0 00 004746* skipn definf ;[266] In a DEFINE command? 13021 005037'01 260 17 0 00 004750* confrm ;[266] No, must confirm the command 13022 005040'01 263 17 0 00 000000 ret ;[266] Return to hit semantic action 13023 13024 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 94 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT maximum-length secondary parsing 13025 subttl SET TRANSMIT maximum-length secondary parsing 13026 13027 005041'01 .setmx: extern maxfdb ;[266] Transmit maximum length FDB is in K20IOC 13028 005041'01 200 16 0 00 000000# guide ;[266] 13029 005042'01 260 17 0 00 005023* 13030 001457'02 000000000000# 13031 002022'04 157 146 040 143 150 13032 005043'01 201 01 0 00 000000* movei t1, maxfdb ;[265] Look for an integer count of characters 13033 005044'01 260 17 0 00 005025* call rfield ;[265] Ask them to type one it 13034 13035 005045'01 325 02 0 00 005051' ifl. t2 ;[265] Is the number delusional? 13036 005046'01 200 01 0 00 000000# emsg ;[265] Silly... 13037 005047'01 104 00 0 00 000313 13038 001460'02 000000000000# 13039 002030'04 101 040 156 145 147 13040 005050'01 254 00 0 00 004736* jrst cmder1 ;[265] Yet allow reparse 13041 005051'01 endif. ;[265] End initial sanity checking 13042 13043 005051'01 301 02 0 00 004000 cail t2, strbl8 ;[265] Larger than largest we can spew? 13044 005052'01 254 00 0 00 005062' ifskp. ;[265] Nope, let's use it 13045 005053'01 326 02 0 00 005055' ife. t2 ;[265] Typed a zero? 13046 005054'01 201 02 0 00 004000 movei t2, strbl8 ;[265] Load maximum buffer can hold 13047 005055'01 endif. ;[265] Make life easier... 13048 005055'01 202 02 0 00 005034* movem t2, pars4 ;[265] Return parsed value, imagined or not 13049 005056'01 402 00 0 00 005035* setzm pars5 ;[266] It's a single value 13050 005057'01 336 00 0 00 005036* skipn definf ;[266] In a DEFINE command? 13051 005060'01 260 17 0 00 005037* confrm ;[266] No, must confirm the command 13052 005061'01 263 17 0 00 000000 ret ;[266] Return to hit semantic action 13053 005062'01 endif. ;[266] Done checking 13054 13055 005062'01 200 01 0 00 000000# emsg ;[265] 13056 005063'01 104 00 0 00 000313 13057 001461'02 000000000000# 13058 002042'04 123 160 145 143 151 13059 005064'01 254 00 0 00 005050* jrst cmder1 ;[265] Yet allow reparse 13060 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 95 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT pause secondary parsing 13061 subttl SET TRANSMIT pause secondary parsing 13062 13063 chgsec(code,const) ;;FDB's are not in code, they're in const 13064 001462'02 015006 000000 trapau::flddb. .cmflt,,,,<0> 13065 001463'02 000000 000000 13066 001464'02 44 07 0 00 003201' 13067 001465'02 44 07 0 00 003213' 13068 retsec ;;Back to where-ever we started from 13069 13070 005065'01 200 16 0 00 000000# .setpu: guide ;[266] 13071 005066'01 260 17 0 00 005042* 13072 001466'02 000000000000# 13073 002056'04 142 145 164 167 145 13074 005067'01 201 01 0 00 000000# movei t1, trapau ;[266] Load address of pause fdb 13075 005070'01 260 17 0 00 005044* call rfield ;[266] pause parsing common code. 13076 005071'01 200 16 0 00 000000# guide ;[266] Remind them what they typed 13077 005072'01 260 17 0 00 005066* 13078 001467'02 000000000000# 13079 002062'04 163 145 143 157 156 13080 13081 005073'01 325 02 0 00 005077' ifl. t2 ;[266] Is the number in the right range? 13082 005074'01 200 01 0 00 000000# emsg ;[266] In fact, they're down silly 13083 005075'01 104 00 0 00 000313 13084 001470'02 000000000000# 13085 002064'04 116 145 147 141 164 13086 005076'01 254 00 0 00 005064* jrst cmder1 ;[266] Allow reparse in case we did an oopsie 13087 005077'01 endif. ;[266] 13088 ;[266] Convert to integer and range check 13089 remark ;[266] When chksec works, it works completely 13090 005077'01 260 17 0 00 000000' call chksec ;[266] Ensure number is in correct range 13091 005100'01 254 00 0 00 005102' ifskp. ;[266] Does it check and did it convert OK? 13092 remark ;[266] Yes, must confirm later, maybe 13093 005101'01 254 00 0 00 005105' else. ;[266] Otherwise, couldn't swallow something 13094 005102'01 200 01 0 00 000000# emsg ;[266] 13095 005103'01 104 00 0 00 000313 13096 001471'02 000000000000# 13097 002073'04 111 156 164 145 162 13098 005104'01 254 00 0 00 005076* jrst cmder1 ;[266] Allow reparse 13099 005105'01 endif. ;[266] End range check 13100 13101 005105'01 337 01 0 00 005055* skipg t1, pars4 ;[266] Load non-zero milliseconds 13102 005106'01 254 00 0 00 005114' ifskp. ;[266] Let's range check that 13103 005107'01 307 01 0 00 267460 caig t1, maxtim ;[266] Over 94 seconds? 13104 005110'01 254 00 0 00 005114' anskp. ;[266] Nope, safe to use 13105 005111'01 200 01 0 00 000000# emsg ;[266] 13106 005112'01 104 00 0 00 000313 13107 001472'02 000000000000# 13108 002104'04 120 141 165 163 145 13109 005113'01 254 00 0 00 005104* jrst cmder1 ;[266] Allow reparse 13110 005114'01 endif. 13111 13112 005114'01 336 00 0 00 005057* skipn definf ;[266] In a DEFINE command? 13113 005115'01 260 17 0 00 005060* confrm ;[266] No, must confirm the command 13114 005116'01 263 17 0 00 000000 ret ;[266] Return to hit semantic action 13115 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 95-1 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT pause secondary parsing 13116 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 96 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT silent secondary parsing 13117 subttl SET TRANSMIT silent secondary parsing 13118 13119 chgsec(code,const) ;;FDB's are not in code, they're in const 13120 001473'02 000002 000000 silfdb: flddb. .cmkey,,offon,,on 13121 001474'02 000000 001145' 13122 001475'02 000000 000000 13123 001476'02 44 07 0 00 002333' 13124 retsec ;;Back to where-ever we started from 13125 13126 005117'01 200 16 0 00 000000# .setsi: guide ;[266] 13127 005120'01 260 17 0 00 005072* 13128 001477'02 000000000000# 13129 002113'04 164 157 040 163 165 13130 005121'01 201 01 0 00 000000# movei t1, silfdb ;[266] Point to the FDB for On/Off 13131 005122'01 260 17 0 00 005070* call rfield ;[266] Parse one of them 13132 005123'01 550 02 0 02 000000 hrrz t2, (t2) ;[266] Get the value for the keyword (0 or 1) 13133 005124'01 202 02 0 00 005105* movem t2, pars4 ;[265] Return parsed value of keyword 13134 005125'01 402 00 0 00 005056* setzm pars5 ;[266] It's a single value 13135 005126'01 336 00 0 00 005114* skipn definf ;[266] In a DEFINE command? 13136 005127'01 260 17 0 00 005115* confrm ;[266] No, must confirm the command 13137 005130'01 263 17 0 00 000000 ret ;[266] Return to hit semantic action 13138 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 97 K20PAR MAC 20-Aug-24 23:12 SET TRANSMIT timeout secondary parsing 13139 subttl SET TRANSMIT timeout secondary parsing 13140 13141 chgsec(code,const) ;;FDB's are not in code, they're in const 13142 001500'02 015006 000000 traout: flddb. .cmflt,,,,<0> 13143 001501'02 000000 000000 13144 001502'02 44 07 0 00 003214' 13145 001503'02 44 07 0 00 003213' 13146 retsec ;;Back to where-ever we started from 13147 13148 005131'01 200 16 0 00 000000# .setmo: guide ;[266] 13149 005132'01 260 17 0 00 005120* 13150 001504'02 000000000000# 13151 002123'04 145 170 160 151 162 13152 005133'01 201 01 0 00 000000# movei t1, traout ;[266] Load address of timeout fdb 13153 005134'01 260 17 0 00 005122* call rfield ;[266] pause parsing common code. 13154 005135'01 200 16 0 00 000000# guide ;[266] Remind them what they typed 13155 005136'01 260 17 0 00 005132* 13156 001505'02 000000000000# 13157 002133'04 163 145 143 157 156 13158 13159 005137'01 325 02 0 00 005143' ifl. t2 ;[266] Is the number in the right range? 13160 005140'01 200 01 0 00 000000# emsg ;[266] They're downright silly 13161 005141'01 104 00 0 00 000313 13162 001506'02 000000000000# 13163 002135'04 116 145 147 141 164 13164 005142'01 254 00 0 00 005113* jrst cmder1 ;[266] Allow reparse in case we did an oopsie 13165 005143'01 endif. ;[266] 13166 ;[266] Convert to integer and range check 13167 remark ;[266] When chksec works, it works completely 13168 005143'01 260 17 0 00 000000' call chksec ;[266] Ensure number is in correct range 13169 005144'01 254 00 0 00 005146' ifskp. ;[266] Does it check and did it convert OK? 13170 remark ;[266] Yes, must confirm later, maybe 13171 005145'01 254 00 0 00 005151' else. ;[266] Otherwise, couldn't swallow something 13172 005146'01 200 01 0 00 000000# emsg ;[194] 13808 005623'01 104 00 0 00 000313 13809 001645'02 000000000000# 13810 002355'04 101 040 156 145 147 13811 005624'01 254 00 0 00 005614* jrst cmder1 ;[194] 13812 005625'01 endif. ;[194] 13813 005625'01 307 02 0 00 002000 caig t2, dpadmx ;[194] Rediculously large? 13814 005626'01 254 00 0 00 005632' ifskp. ;[194] Yep, we could go days before sending 13815 005627'01 200 01 0 00 000000# emsg 13816 005630'01 104 00 0 00 000313 13817 001646'02 000000000000# 13818 002365'04 115 141 170 151 155 13819 005631'01 254 00 0 00 005624* jrst cmder1 ;[194] Allow reparse 13820 005632'01 endif. ;[194] 13821 005632'01 202 02 0 00 005576* movem t2, pars4 ; Save the number. 13822 005633'01 336 00 0 00 005601* skipn definf ;[77] In DEFINE? 13823 005634'01 260 17 0 00 005602* confrm ;[77] No, get confirmation. 13824 005635'01 263 17 0 00 000000 ret 13825 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 108 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE pause secondary parsing 13826 subttl SET SEND/RECEIVE pause secondary parsing 13827 13828 ;[196] Do the calculation from floating (fractional) seconds to 13829 ; integer milliseconds ONCE, here. Doing it every single packet is a 13830 ; pretty gauche use of the processor as it does have other things to 13831 ; do... 13832 13833 chgsec(code,const) ;;FDB's are not in code, they're in const 13834 001647'02 015006 000000 fsrpau: flddb. .cmflt,,,,<0> 13835 001650'02 000000 000000 13836 001651'02 44 07 0 00 003317' 13837 001652'02 44 07 0 00 003213' 13838 001653'02 015006 000000 fsspau: flddb. .cmflt,,,,<0> 13839 001654'02 000000 000000 13840 001655'02 44 07 0 00 003330' 13841 001656'02 44 07 0 00 003213' 13842 retsec ;;Back to where-ever we started from 13843 13844 005636'01 334 01 0 00 006522' .srpau: skipa t1, [fsrpau] ;[196] Address of receive pause fdb 13845 005637'01 201 01 0 00 000000# .sspau: movei t1, fsspau ;[196] Address of send pause fdb 13846 005640'01 200 16 0 00 000000# guide ;[194] 13847 005641'01 260 17 0 00 005616* 13848 001657'02 000000000000# 13849 002374'04 142 145 164 167 145 13850 13851 005642'01 260 17 0 00 005620* call rfield ;[266] pause parsing common code. 13852 005643'01 200 16 0 00 000000# guide 13853 005644'01 260 17 0 00 005641* 13854 001660'02 000000000000# 13855 002400'04 163 145 143 157 156 13856 13857 005645'01 325 02 0 00 005651' ifl. t2 ;[194] Is the number in the right range? 13858 005646'01 200 01 0 00 000000# emsg ;[187] 13859 005647'01 104 00 0 00 000313 13860 001661'02 000000000000# 13861 002402'04 116 145 147 141 164 13862 005650'01 254 00 0 00 005631* jrst cmder1 ;[194] Allow reparse 13863 005651'01 endif. ;[194] 13864 13865 remark ;[212] When chksec works, it works completely 13866 005651'01 260 17 0 00 000000' call chksec ;[196] Ensure number is in correct range 13867 005652'01 254 00 0 00 005654' ifskp. ;[196] Check and convert OK? 13868 remark ;[196] Yes, must confirm later, maybe 13869 005653'01 254 00 0 00 005657' else. ;[196] Otherwise, couldn't swallow something 13870 005654'01 200 01 0 00 000000# emsg ;[187] 13871 005655'01 104 00 0 00 000313 13872 001662'02 000000000000# 13873 002411'04 111 156 164 145 162 13874 005656'01 254 00 0 00 005650* jrst cmder1 ;[194] Allow reparse 13875 005657'01 endif. ;[212] End range check 13876 13877 005657'01 337 01 0 00 005632* skipg t1, pars4 ;[212] Load non-zero milliseconds 13878 005660'01 254 00 0 00 005666' ifskp. ;[212] Let's range check that 13879 005661'01 307 01 0 00 267460 caig t1, maxtim ;[212] Over 94 seconds? 13880 005662'01 254 00 0 00 005666' anskp. ;[212] Nope, safe to use k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 108-1 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE pause secondary parsing 13881 005663'01 200 01 0 00 000000# emsg ;[212] 13882 005664'01 104 00 0 00 000313 13883 001663'02 000000000000# 13884 002422'04 120 141 165 163 145 13885 005665'01 254 00 0 00 005656* jrst cmder1 ;[212] Out 13886 005666'01 endif. 13887 13888 005666'01 336 00 0 00 005633* skipn definf ;[77] In DEFINE? 13889 005667'01 260 17 0 00 005634* confrm ;[77] No, get confirmation. 13890 005670'01 263 17 0 00 000000 ret 13891 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 109 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE QUOTE character tables and token definitions 13892 subttl SET SEND/RECEIVE QUOTE character tables and token definitions 13893 13894 define qchrs (c) < ;;[217] Define macro to populate the table 13895 xlist ;;[217] Don't need to see this in the listing 13896 irpc c,< ;;[217] Go through all the characters 13897 %key2 <'c>,<"'c"> ;;[217] Emit character and its ASCII code 13898 >;;irpc ;;[217] End of argument expansion 13899 list ;;[217] Turn the listing back on 13900 >;;qchrs ;;[217] End of macro definition 13901 13902 001664'02 000000 000000 %table(qchtb) ;;[217] Printable character table 13903 qchrs (0123456789) ;;[217] 'Easy' printable numerals 13904 qchrs (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;;[217] 'Easy' printable characters 13905 001664'02 000044 000044 %tbend ;[217] End of 'easy' table 13906 13907 ;N.B., a number of characters simply do NOT work as tokens 13908 13909 001731'02 000000 000000 %table() ;;[217] Token mnemonics 13910 001732'02 000000# 777700 %key2 ,<-"@"> ;[217] Kind of chokes on this sometimes 13911 001310'03 141 164 055 163 151 13912 001733'02 000000# 777724 %key2 ,<-","> ;[217] Clashes with define 13913 001312'03 143 157 155 155 141 13914 001734'02 000000# 777723 %key2 ,<-"-"> ;[217] Parsed as line continuation, always 13915 001314'03 144 141 163 150 000 13916 001735'02 000000# 777737 %key2 ,<-"!"> ;[217] Parsed as comment, always... 13917 001315'03 145 170 143 154 141 13918 001736'02 000000# 777723 %keyf3 ,<-"-">,cm%inv ;[217] Parsed as line continuation, always 13919 001321'03 002000 000001 13920 001322'03 155 151 156 165 163 13921 001737'02 000000# 777701 %key2 ,<-"?"> ;[217] Parsed as choices display, always... 13922 001325'03 161 165 145 163 164 13923 001740'02 000000# 777705 %key2 ,<-";"> ;[217] Parsed as comment, always... 13924 001330'03 163 145 155 151 143 13925 001731'02 000007 000007 %tbend ;[217] End of mnemonic table 13926 13927 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 13928 13929 extern gtkT ;;[258] Grammar Token Table in K20IOC 13930 13931 001741'02 013001 001743' qoufdm: flddb. .cmcma,cm%sdh,,,,qoufdb ;[217] Used when unwinding a macro 13932 001742'02 000000 000000 13933 001743'02 qoufdb: remark ;[217] First parse the 'easy' stuff... 13934 001743'02 010004 001746' flddb. .cmcfm,,,,,qf1 13935 001744'02 000000 000000 13936 001745'02 44 07 0 00 003341' 13937 001746'02 001004 001751' qf1: flddb. .cmnum,,^d8,,,qf2 13938 001747'02 000000 000010 13939 001750'02 44 07 0 00 003353' 13940 001751'02 000004 001754' qf2: flddb. .cmkey,,qchtb,,,qf3 13941 001752'02 000000 001664' 13942 001753'02 44 07 0 00 003366' 13943 001754'02 000000000000# qf3: flddb. .cmkey,,toktab,,,gtkT 13944 001755'02 000000 001731' 13945 001756'02 44 07 0 00 003373' 13946 cleans() k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 109-1 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE QUOTE character tables and token definitions 13947 13948 001757'02 35 07 0 00 000000* qchrpt: point 7, atmbuf, 6 ;[217] Character in atom buffer 13949 retsec ;[217] Finally back in code 13950 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 110 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE QUOTE secondary parsing 13951 subttl SET SEND/RECEIVE QUOTE secondary parsing 13952 13953 005671'01 265 16 0 00 006257' .setqu: saveac ;[217] Wants some registers 13954 005672'01 200 16 0 00 000000# guide 13955 005673'01 260 17 0 00 005644* 13956 001760'02 000000000000# 13957 002431'04 164 157 000 000 000 13958 dmove t1, [ qoufdb ;[217] Point to our parsing extravaganza 13959 005674'01 120 01 0 00 006523' cm%xif ] ;[217] Load the no indirection flag 13960 005675'01 436 02 0 00 000000# orm t2, sbk+.cmflg ;[217] And dink the COMND% state block 13961 005676'01 332 00 0 00 000000# skipe mdone ;[217] Unwinding a macro? 13962 005677'01 201 01 0 00 000000# movei t1, qoufdm ;[217] If unwinding a macro, allow a comma 13963 13964 005700'01 260 17 0 00 005532* call rflde ;[217] Try to get one of them 13965 005701'01 254 00 0 00 005710' ifskp. ;[217] Worked!! 13966 005702'01 120 06 0 00 000002 dmove q2, t2 ;[217] Save some of the parse results 13967 005703'01 135 05 0 00 006454' ldb q1, [pointr (.cmfnp(q3),cm%fnc)] ;[217] Pick up the function code 13968 005704'01 200 10 0 00 000005 move q4, q1 ;[217] Save a copy for downstream 13969 005705'01 205 04 0 00 002000 movx t4, cm%xif ;[217] Load indirection flag again 13970 005706'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ;[217] And restore the COMND% state block 13971 005707'01 254 00 0 00 005713' else. ;[217] Otherwise, failed the parse 13972 005710'01 205 04 0 00 002000 movx t4, cm%xif ;[217] Load indirection flag again 13973 005711'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ;[217] restore the COMND% state block 13974 005712'01 254 00 0 00 005543* jrst cmderr ;[217] And handle the parse error, allowing reparse 13975 005713'01 endif. ;[217] End handling COMND% returns 13976 13977 005713'01 302 05 0 00 000013 caie q1, .cmcma ;[217] A comma? (must be unwinding) 13978 005714'01 254 00 0 00 005717' ifskp. ;[217] Yes, so handle it like a default 13979 005715'01 201 05 0 00 000010 movei q1, .cmcfm ;[217] Just turn it into a confirm 13980 005716'01 200 10 0 00 000005 move q4, q1 ;[217] Update downstream's copy 13981 005717'01 endif. ;[217] and let the confirm code handle it 13982 13983 005717'01 302 05 0 00 000010 caie q1, .cmcfm ;[217] Wants the default? 13984 005720'01 254 00 0 00 005724' ifskp. ;[217] Yes, that's easy 13985 005721'01 201 02 0 00 000043 movei t2, "#" ;[217] Default quote character 13986 005722'01 202 02 0 00 005657* movem t2, pars4 ;[217] Pass to semantic action 13987 005723'01 263 17 0 00 000000 ret ;[217] Done, no need to parse further 13988 005724'01 endif. ;[217] End case .cmcfm 13989 13990 005724'01 302 05 0 00 000000 caie q1, .cmkey ;[217] A keyword? 13991 005725'01 254 00 0 00 005734' ifskp. ;[217] It is, let's investigate 13992 005726'01 570 04 0 06 000000 hrre t4,(q2) ;[217] Pick up the dispatch address 13993 005727'01 325 04 0 00 005732' ifl. t4 ;[217] Negative? 13994 005730'01 210 02 0 00 000004 movn t2, t4 ;[217] It's one of our mnemonics 13995 005731'01 254 00 0 00 005733' else. ;[217] Otherwise, go grab the 13996 005732'01 135 02 0 00 000000# ldb t2, qchrpt ;[217] character from the atom buffer 13997 005733'01 endif. ;[217] Either way, have something 13998 005733'01 254 00 0 00 005750' jrst .setq1 ;[217] so go check it 13999 005734'01 endif. ;[217] End case .cmkey 14000 14001 005734'01 302 05 0 00 000023 caie q1, .cmtok ;[217] Something from the long list of tokens? 14002 005735'01 254 00 0 00 005742' ifskp. ;[217] Yes, hairy, but doable 14003 005736'01 621 07 0 00 777777 tlz q3, -1 ;[217] Isolate fdb we actually used 14004 005737'01 200 04 0 07 000001 move t4, .cmdat(q3) ;[217] Pick up the byte pointer to the character 14005 005740'01 134 02 0 00 000004 ildb t2, t4 ;[217] Load the token character (only one) k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 110-1 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE QUOTE secondary parsing 14006 005741'01 254 00 0 00 005750' jrst .setq1 ;[217] Go check it 14007 005742'01 endif. ;[217] End case .cmtok 14008 14009 005742'01 302 05 0 00 000001 caie q1, .cmnum ;[217] Specified it as an octal number? 14010 005743'01 254 00 0 00 005745' ifskp. ;[217] He did 14011 005744'01 254 00 0 00 005750' jrst .setq1 ;[217] So let's check it 14012 005745'01 endif. ;[217] End case .cmnum 14013 14014 005745'01 200 01 0 00 000000# emsg ;[217] OK, we're confused... 14015 005746'01 104 00 0 00 000313 14016 001761'02 000000000000# 14017 002432'04 123 105 124 040 121 14018 005747'01 254 00 0 00 005665* jrst cmder1 ;[217] Allow a reparse 14019 14020 005750'01 307 02 0 00 000040 .setq1: caig t2, .chspc ;[21] Printable? 14021 005751'01 254 00 0 00 005762' jrst setque ;[194] No (N.B., does not allow space) 14022 005752'01 303 02 0 00 000176 caile t2, "~" ;[21] Past squiggle? 14023 005753'01 254 00 0 00 005762' jrst setque ;[194] Yes, then can't use it 14024 005754'01 202 02 0 00 005722* movem t2, pars4 ;[21] OK, stash it. 14025 005755'01 306 10 0 00 000010 cain q4, .cmcfm ;[217] Defaulted everything? 14026 005756'01 263 17 0 00 000000 ret ;[217] Yes, don't reconfirm the confirm 14027 005757'01 336 00 0 00 005666* skipn definf ;[77] In DEFINE? 14028 005760'01 260 17 0 00 005667* confrm ;[77] No, get confirmation. 14029 005761'01 263 17 0 00 000000 ret 14030 14031 005762'01 200 04 0 00 000002 setque: move t4, t2 ;[217] Get the poor character out of the way 14032 005763'01 325 04 0 00 005767' ifl. t4 ;[194] A negative ASCII character value is silly 14033 005764'01 200 01 0 00 000000# emsg ;[217] So whine about it 14034 005765'01 104 00 0 00 000313 14035 001762'02 000000000000# 14036 002441'04 116 145 147 141 164 14037 005766'01 254 00 0 00 005747* jrst cmder1 ;[217] Allow retry (^H) 14038 005767'01 endif. ;[217] 14039 14040 005767'01 305 04 0 00 000200 caige t4, 200 ;[217] Out of ASCII range? 14041 005770'01 254 00 0 00 005774' ifskp. ;[217] Yep, can't handle that, either 14042 005771'01 200 01 0 00 000000# emsg ;[217] Complain 14043 005772'01 104 00 0 00 000313 14044 001763'02 000000000000# 14045 002447'04 101 116 123 111 040 14046 005773'01 254 00 0 00 005766* jrst cmder1 ;[217] Allow retry (^H) 14047 005774'01 endif. ;[217] 14048 14049 remark ;[217] Otherwise, handle general case 14050 005774'01 200 01 0 00 000000# emsg ;" 14051 005775'01 104 00 0 00 000313 14052 001764'02 000000000000# 14053 002462'04 101 040 161 165 157 14054 005776'01 200 01 0 00 000004 move t1, t4 ;[217] Load the poor character 14055 005777'01 260 17 0 00 005610* call putc ;[217] Print it 14056 006000'01 200 01 0 00 000000# txmsg <" is not.> ;[217] " Font crock mode 14057 006001'01 104 00 0 00 000076 14058 006002'01 320 12 0 00 006003' 14059 001765'02 000000000000# 14060 002500'04 042 040 151 163 040 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 110-2 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE QUOTE secondary parsing 14061 006003'01 254 00 0 00 005773* jrst cmder1 ;[194] and allow command retry. 14062 k20par - Kermit-20 Parsing and Semantic Action Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 111 K20PAR MAC 20-Aug-24 23:12 SET SEND/RECEIVE TIMEOUT secondary parsing 14063 subttl SET SEND/RECEIVE TIMEOUT secondary parsing 14064 14065 chgsec(code,const) ;;FDB's are not in code, they're in const 14066 001766'02 015004 000000 stifdb: flddb. .cmflt,,^d10, 14067 001767'02 000000 000012 14068 001770'02 44 07 0 00 003405' 14069 retsec ;;Back to where-ever we started from 14070 14071 006004'01 200 16 0 00 000000# .setim: guide 14072 006005'01 260 17 0 00 005673* 14073 001771'02 000000000000# 14074 002502'04 164 157 000 000 000 14075 006006'01 201 01 0 00 000000# movei t1, stifdb ;[212] 14076 006007'01 260 17 0 00 005642* call rfield ; Parse the number. 14077 006010'01 200 16 0 00 000000# guide 14078 006011'01 260 17 0 00 006005* 14079 001772'02 000000000000# 14080 002503'04 163 145 143 157 156 14081 14082 006012'01 325 02 0 00 006016' ifl. t2 ;[212] Is the number in the right range? 14083 006013'01 200 01 0 00 000000# emsg ;[212] 14084 006014'01 104 00 0 00 000313 14085 001773'02 000000000000# 14086 002505'04 116 145 147 141 164 14087 006015'01 254 00 0 00 006003* jrst cmder1 ;[212] allow reparse 14088 006016'01 endif. ;[212] 14089 14090 remark ;[212] When chksec works, it works completely 14091 006016'01 260 17 0 00 000000' call chksec ;[212] Ensure number is in correct range 14092 006017'01 254 00 0 00 006021' ifskp. ;[196] Check and convert OK? 14093 remark ;[196] Yes, must confirm later, maybe 14094 006020'01 254 00 0 00 006024' else. ;[196] Otherwise, couldn't swallow something 14095 006021'01 200 01 0 00 000000# emsg ; Macro definition 14482 000003'01 260 17 0 00 000000* 14483 000007'02 000000000000# 14484 000000'04 141 040 123 105 124 14485 movei t1, [ 14486 flddb. .cmswi,,tabswi,,,[ 14487 flddb. .cmkey,,mactab,,,[ 14488 flddb. .cmqst,,,,,[ 14489 flddb. .cmfld,,,,, 14490 000004'01 201 01 0 00 002435' ]]]] 14491 14492 000005'01 260 17 0 00 000000* call rfield ; Get the macro name 14493 000006'01 135 05 0 00 002440' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 14494 000007'01 306 05 0 00 000003 cain q1, .cmswi ; Table function? 14495 000010'01 254 00 0 00 000555' callret tablem ; Hand off to table maintenance 14496 14497 ; If this is an existing macro, there is no need to reinsert it 14498 14499 000011'01 302 05 0 00 000000 caie q1, .cmkey ; A keyword (I.E., existing macro?) 14500 000012'01 254 00 0 00 000020' ifskp. ; It is, so just use it 14501 000013'01 202 02 0 00 000000# movem t2, tbent ; Save the table entry 14502 000014'01 554 01 0 02 000000 hlrz t1, (t2) ; Pull the address of the keyword 14503 000015'01 505 01 0 00 440700 hrli t1, (point 7,0) ; Turn into a local pointer 14504 000016'01 202 01 0 00 000000# movem t1, onamp ; This is the beginning of the string 14505 000017'01 254 00 0 00 000044' jrst .defi5 ; Skip accumulating the cruft 14506 000020'01 endif. 14507 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-1 K20MAC MAC 30-Jun-23 17:21 DEFINE command parsing 14508 ; Doesn't appear to be existing, so let's take a snapshot of the atom buffer 14509 14510 dmove t1, [ point 7,atmbuf ; Source is the atom buffer 14511 000020'01 120 01 0 00 002441' point 7,namatm ] ; Destination is a snapshot of it 14512 000021'01 202 02 0 00 000000# movem t2, onamp ; Beginning of candidate name stirng 14513 000022'01 260 17 0 00 000000* call asczcp ; Copy the ASCIZ string over 14514 000023'01 202 03 0 00 000000* movem t3, namlen ; Save the length of what we copied 14515 14516 ; BUT!! They might have put the keyword in double quotes, so check 14517 14518 000024'01 201 01 0 00 000000# movei t1, mactab ; Load the address of the keyword table 14519 000025'01 200 02 0 00 000000# move t2, onamp ; Pointer to proposed macro name 14520 000026'01 104 00 0 00 000537 TBLUK% ; Go have a look 14521 000027'01 320 12 0 00 000031' %jserr (,cmder1) ; Flame out, allow reparse 14522 000030'01 254 00 0 00 000034' 14523 000031'01 265 01 0 00 000000* 14524 000032'01 000000 000000 14525 000033'01 254 00 0 00 000000* 14526 14527 000034'01 607 02 0 00 040000 ifxn. t2, tl%exm ; So does it make anything EXACTLY? 14528 000035'01 254 00 0 00 000044' 14529 000036'01 202 01 0 00 000000# movem t1, tbent ; Save the table entry 14530 000037'01 554 04 0 01 000000 hlrz t4, (t1) ; Pick up the keyword address 14531 000040'01 505 04 0 00 440700 hrli t4, (point 7,0) ; Turn into a local pointer 14532 000041'01 202 04 0 00 000000# movem t4, onamp ; This is the beginning of the string 14533 000042'01 201 05 0 00 000000 movei q1, .cmkey ; Say we matched a keyword 14534 000043'01 254 00 0 00 000044' jrst .defi5 ; and skip accumulating cruft 14535 000044'01 endif. 14536 14537 ; Let them type CR here to undefine the macro, or else jump into the SET 14538 ; command parser to let them define a new macro, or redefine an old one. 14539 14540 000044'01 302 05 0 00 000000 .defi5: caie q1, .cmkey ; Exists? 14541 000045'01 254 00 0 00 000051' ifskp. ; Yes, so different guidance 14542 000046'01 200 16 0 00 000000# guide ; 14543 000047'01 260 17 0 00 000003* 14544 000010'02 000000000000# 14545 000004'04 164 157 040 165 156 14546 000050'01 254 00 0 00 000053' else. ; Otherwise, doing it from scratch 14547 000051'01 200 16 0 00 000000# guide ; Prompt with guide words. 14548 000052'01 260 17 0 00 000047* 14549 000011'02 000000000000# 14550 000011'04 164 157 040 123 105 14551 000053'01 endif. ; 14552 14553 000053'01 200 01 0 00 000000# move t1, sbk+.cmptr ; Get current pointer from comnd state block. 14554 000054'01 202 01 0 00 000000# movem t1, macptr ; Save it as pointer to macro body. 14555 14556 000055'01 476 00 0 00 000000# .defi6: setom definf ; Flag that we're doing a DEFINE. 14557 000056'01 201 01 0 00 002443' movei t1, [flddb. .cmkey,,settab,,,] ; Assume defining 14558 000057'01 306 05 0 00 000000 cain q1, .cmkey 14559 movei t1, [flddb. .cmcfm,,,,,[ 14560 flddb. .cmswi,,defswi,,,[ 14561 000060'01 201 01 0 00 002463' flddb. .cmkey,,settab,,,]]] ; 14562 000061'01 260 17 0 00 000005* call rfield ; Parse a keyword or a CR. k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-2 K20MAC MAC 30-Jun-23 17:21 DEFINE command parsing 14563 000062'01 135 03 0 00 002440' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 14564 000063'01 476 00 0 00 000000# setom undeff ; Assume we're undefining? 14565 000064'01 302 03 0 00 000003 caie t3, .cmswi ; Only uses switches to undefine 14566 000065'01 254 00 0 00 000070' ifskp. ; But must confirm the switch 14567 000066'01 550 01 0 02 000000 hrrz t1, (t2) ; Pick up secondary parse 14568 000067'01 254 00 0 01 000000 jrst (t1) ; And go there 14569 000070'01 endif. 14570 14571 000070'01 306 03 0 00 000010 cain t3, .cmcfm ; Parsed a CR? (if so, then undefing) 14572 000071'01 263 17 0 00 000000 ret ; Yes, so done. 14573 14574 000072'01 402 00 0 00 000000# setzm undeff ; No, we're defining after all. 14575 000073'01 254 00 0 00 000000* callret .set2 ; Go parse SET commands. 14576 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20MAC MAC 30-Jun-23 17:21 DEFINE command execution 14577 subttl DEFINE command execution 14578 14579 000074'01 $defin: entry $defin ; Invoked by K20PAR 14580 000074'01 265 16 0 00 002466' saveac ; Needs some extra registers 14581 000075'01 402 00 0 00 000000# setzm definf ; Clear define flag 14582 000076'01 332 00 0 00 000000# skipe undeff ; Define or Undefine? 14583 000077'01 254 00 0 00 000241' jrst $defi7 ; Undefine, go do that. 14584 14585 ;[82] remark Uncomment to Echo back what was typed... 14586 ;[82] move t1, onamp ; Name 14587 ;[82] PSOUT 14588 ;[82] txmsg < = > 14589 ;[82] move t1, macptr ; Text 14590 ;[82] PSOUT 14591 14592 000100'01 200 01 0 00 000000# move t1, macptr ; Load pointer to accumulated text 14593 000101'01 200 02 0 00 002500' move t2, [point 7,expatm] ; And a pointer to the macro text expansion buffer 14594 000102'01 260 17 0 00 000022* call asczcp ; Copy the ASCIZ string over 14595 000103'01 202 03 0 00 000000* movem t3, explen ; Save the length of what we copied 14596 14597 ; Here to figure out if we have enough room before we try the insert. 14598 ; Assumes all initial pointers started out on word boundaries 14599 14600 ; First, we'll do the name, checking to ensure that we are reusing an 14601 ; existing keyword, if it exists 14602 14603 000104'01 550 05 0 00 000000# hrrz q1, onamp ; Load the macro name pointer 14604 000105'01 305 05 0 00 000000# caige q1, mactab ; Could be in the macro table? 14605 000106'01 254 00 0 00 000113' ifskp. ; Yes, let's check a little further 14606 000107'01 301 05 0 00 000000# cail q1, macx ; But not off the end? 14607 000110'01 254 00 0 00 000113' anskp. ; Was outside, so must insert 14608 000111'01 400 05 0 00 000000 setz q1, ; So no words here because reusing 14609 000112'01 254 00 0 00 000123' else. ; Not an existing keyword 14610 000113'01 200 05 0 00 000023* move q1, namlen ; Load length of macro name candidate 14611 000114'01 200 02 0 00 002442' move t2, [point 7,namatm] ; Load pointer to same 14612 000115'01 133 05 0 00 000002 adjbp q1, t2 ; Calculate the ending pointer 14613 000116'01 302 05 0 00 440700 caie q1, 440700 ; On a word boundary? 14614 000117'01 271 05 0 00 000001 addi q1, ^d1 ; No, round up a word 14615 000120'01 621 05 0 00 777777 tlz q1, -1 ; Shut off the pointer part 14616 000121'01 621 02 0 00 777777 tlz t2, -1 ; in both pointers 14617 000122'01 274 05 0 00 000002 sub q1, t2 ; Now have required words 14618 000123'01 endif. ; Either way, something useful in t1 14619 14620 ; Now the body or expansion, which is somewhat more straightforward 14621 14622 000123'01 200 06 0 00 000103* move q2, explen ; Load length of macro expansion text 14623 000124'01 200 02 0 00 002500' move t2, [point 7,expatm] ; Load pointer to same 14624 000125'01 133 06 0 00 000002 adjbp q2, t2 ; Calculate the ending pointer 14625 000126'01 302 06 0 00 440700 caie q2, 440700 ; On a word boundary? 14626 000127'01 271 06 0 00 000001 addi q2, ^d1 ; No, round up a word 14627 000130'01 621 06 0 00 777777 tlz q2, -1 ; Shut off the pointer part 14628 000131'01 621 02 0 00 777777 tlz t2, -1 ; in both pointers 14629 000132'01 274 06 0 00 000002 sub q2, t2 ; Now have required words 14630 14631 ; Now see if we would go off the end k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20MAC MAC 30-Jun-23 17:21 DEFINE command execution 14632 14633 000133'01 200 01 0 00 000000# $defad: move t1, macbp ; Load the current top of macro text 14634 000134'01 621 01 0 00 777777 tlz t1, -1 ; Shut off pointer (assumes always a word boundary) 14635 000135'01 270 01 0 00 000005 add t1, q1 ; Add in name length in words (if any) 14636 000136'01 270 01 0 00 000006 add t1, q2 ; Add in macro body length in words 14637 000137'01 301 01 0 00 000000# cail t1, macx ; But not off the end? 14638 000140'01 334 00 0 00 000000 %ermsg (,r) 14639 000141'01 254 00 0 00 000145' 14640 000142'01 265 01 0 00 000031* 14641 000143'01 000000000000# 14642 000144'01 254 00 0 00 000000* 14643 000013'04 115 141 143 162 157 14644 14645 ; What about the TBLUK% table? Is that full? 14646 14647 000145'01 550 01 0 00 000000# hrrz t1, mactab ; Load maximum possible entries 14648 000146'01 554 02 0 00 000000# hlrz t2, mactab ; Load current entry count 14649 000147'01 274 01 0 00 000002 sub t1, t2 ; See if any room 14650 000150'01 327 01 0 00 000157' ifle. t1 ; Nothing left or phonkey? 14651 000151'01 323 05 0 00 000157' andg. q1 ; And we're adding a keyword? 14652 000152'01 334 00 0 00 000000 %ermsg (,r) 14653 000153'01 254 00 0 00 000157' 14654 000154'01 265 01 0 00 000142* 14655 000155'01 000000000000# 14656 000156'01 254 00 0 00 000144* 14657 000024'04 115 141 170 151 155 14658 000157'01 endif. 14659 14660 ; OK, let's copy everything over (maybe) 14661 14662 000157'01 326 05 0 00 000163' ife. q1 ; Reusing a keyword? 14663 000160'01 550 07 0 00 000000# hrrz q3, onamp ; Yes, get its address 14664 000161'01 550 03 0 00 000000# hrrz t3, macbp ; Macro text goes directly in 14665 000162'01 254 00 0 00 000170' else. ; Otherwise, copy it in and use that 14666 000163'01 550 07 0 00 000000# hrrz q3, macbp ; Use word address of keyword location 14667 000164'01 200 01 0 00 000005 move t1, q1 ; Number of words to copy 14668 000165'01 201 02 0 00 000000* movei t2, namatm ; Source is the name that was in the atom buff 14669 000166'01 200 03 0 00 000007 move t3, q3 ; Destination in macro storage 14670 000167'01 123 01 0 00 002501' xblt. t1 ; And transfer it over 14671 000170'01 endif. 14672 14673 000170'01 200 01 0 00 000006 move t1, q2 ; Load length of expansion 14674 000171'01 201 02 0 00 000000* movei t2, expatm ; Source is expansion or body text we got 14675 000172'01 200 10 0 00 000003 move q4, t3 ; Begin storing where we left off 14676 000173'01 123 01 0 00 002501' xblt. t1 ; And pop that over 14677 000174'01 505 03 0 00 440700 hrli t3, (point 7,0) ; Turn into a pointer on a WORD boundaru 14678 000175'01 202 03 0 00 000000# movem t3, macbp ; And store as new top of storage 14679 14680 ; Finally either tweak the table or add the entry 14681 14682 000176'01 326 05 0 00 000227' ife. q1 ; Existing keyword? 14683 000177'01 332 01 0 00 000000# skipe t1, tbent ; Do we already have it? 14684 000200'01 254 00 0 00 000225' ifskp. ; No, go get find it 14685 000201'01 201 01 0 00 000000# movei t1, mactab ; Yes, let's find the entry 14686 000202'01 561 02 0 07 000000 hrroi t2, (q3) ; Pointer to keyword that was matched k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-2 K20MAC MAC 30-Jun-23 17:21 DEFINE command execution 14687 000203'01 104 00 0 00 000537 TBLUK% ; See if it's in there (better be!) 14688 000204'01 320 12 0 00 000206' %jserr (,r) 14689 000205'01 254 00 0 00 000211' 14690 000206'01 265 01 0 00 000154* 14691 000207'01 000000000000# 14692 000210'01 254 00 0 00 000156* 14693 000035'04 123 145 141 162 143 14694 000211'01 603 02 0 00 040000 ifxe. t2, tl%exm ; Not there? 14695 000212'01 254 00 0 00 000225' 14696 000213'01 200 01 0 00 000000# emsg ;" font crock mode 14697 000214'01 104 00 0 00 000313 14698 000012'02 000000000000# 14699 000044'04 103 157 165 154 144 14700 000215'01 561 01 0 00 000000* hrroi t1, atmbuf ; Point at what we were looking for 14701 000216'01 104 00 0 00 000076 PSOUT% ; Type what we got told was in there 14702 000217'01 200 01 0 00 000000# txmsg <"> ;" font crock mode 14703 000220'01 104 00 0 00 000076 14704 000221'01 320 12 0 00 000222' 14705 000013'02 000000000000# 14706 000054'04 042 000 000 000 000 14707 000222'01 561 01 0 00 000000* hrroi t1, crlf ; Tie off the line 14708 000223'01 104 00 0 00 000076 PSOUT% 14709 000224'01 263 17 0 00 000000 ret ; Nothing further we can do, so leave 14710 000225'01 endif. ; End case looking for the macro name 14711 000225'01 endif. ; End case already have the table offset 14712 000225'01 542 10 0 01 000000 hrrm q4, (t1) ; Stomp in address of new body 14713 000226'01 263 17 0 00 000000 ret ; That's it, really 14714 000227'01 endif. ; End case replacing macro body 14715 14716 ; Otherwise, add

to macro keyword table. 14717 14718 000227'01 201 01 0 00 000000# movei t1, mactab ; Stick it in the macro table. 14719 000230'01 514 02 0 00 000007 hrlz t2, q3 ; Address of keyword,, 14720 000231'01 540 02 0 00 000010 hrr t2, q4 ; argument (address of body) 14721 000232'01 104 00 0 00 000536 TBADD% ; Inserting it should always work 14722 000233'01 320 12 0 00 000235' %jserr (,r) ; Must have missed a case, above 14723 000234'01 254 00 0 00 000240' 14724 000235'01 265 01 0 00 000206* 14725 000236'01 000000000000# 14726 000237'01 254 00 0 00 000210* 14727 000055'04 105 162 162 157 162 14728 000240'01 263 17 0 00 000000 ret 14729 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20MAC MAC 30-Jun-23 17:21 /UNDEFINE processing 14730 subttl /UNDEFINE processing 14731 14732 ; Come here directly to undefine an existing macro. 14733 ; First look it up. We should ALWAYS find it because we don't come 14734 ; here unless we had a keyword match in the first place. 14735 14736 000241'01 332 02 0 00 000000# $defi7: skipe t2, tbent ; Do we already have the keyword? 14737 000242'01 254 00 0 00 000267' ifskp. ; No, go get it 14738 000243'01 201 01 0 00 000000# movei t1, mactab ; Yes, look up its address in the kwd table. 14739 000244'01 200 02 0 00 000000# move t2, onamp ; Pointer to macro name. 14740 000245'01 104 00 0 00 000537 TBLUK% ; See if it's in there (should be) 14741 000246'01 320 12 0 00 000250' %jserr (,r) 14742 000247'01 254 00 0 00 000253' 14743 000250'01 265 01 0 00 000235* 14744 000251'01 000000000000# 14745 000252'01 254 00 0 00 000237* 14746 000062'04 103 157 165 154 144 14747 000253'01 603 02 0 00 040000 ifxe. t2, tl%exm ;[194] Found an exact match? 14748 000254'01 254 00 0 00 000266' 14749 000255'01 200 01 0 00 000000# txmsg <% "> ;[194] ;" No, warn. 14750 000256'01 104 00 0 00 000076 14751 000257'01 320 12 0 00 000260' 14752 000014'02 000000000000# 14753 000074'04 045 040 042 000 000 14754 000260'01 200 01 0 00 000000# move t1, onamp 14755 000261'01 104 00 0 00 000076 PSOUT 14756 000262'01 200 01 0 00 000000# txmsg < " not found in SET macro table> ;[194] ;" Font crock 14757 000263'01 104 00 0 00 000076 14758 000264'01 320 12 0 00 000265' 14759 000015'02 000000000000# 14760 000075'04 040 042 040 156 157 14761 000265'01 263 17 0 00 000000 ret 14762 000266'01 endif. ;[194] 14763 000266'01 200 02 0 00 000001 move t2, t1 ; The address we just got. 14764 000267'01 endif. ; End case didn't already have entry 14765 14766 ; Using the table index just obtained, delete the entry. 14767 14768 000267'01 201 01 0 00 000000# movei t1, mactab 14769 remark t2, ; Either already had it or found it 14770 000270'01 104 00 0 00 000535 TBDEL% ; Delete the old entry. 14771 000271'01 320 12 0 00 000273' %jserr (,r) 14772 000272'01 254 00 0 00 000276' 14773 000273'01 265 01 0 00 000250* 14774 000274'01 000000000000# 14775 000275'01 254 00 0 00 000252* 14776 000104'04 103 157 165 154 144 14777 000276'01 263 17 0 00 000000 ret 14778 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20MAC MAC 30-Jun-23 17:21 /UNDEFINE parsing 14779 subttl /UNDEFINE parsing 14780 14781 000277'01 260 17 0 00 000000* .undef: confrm ; Confirm the line 14782 000300'01 263 17 0 00 000000 ret ; Done 14783 14784 remark The reason there is no $UNDEF 14785 14786 ; Since the macro has no body, the default action is to remove it. Thus, 14787 ; /UNDEFINE doesn't really do anything other than function as a kind of 14788 ; 'syntactic sugar'. 14789 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20MAC MAC 30-Jun-23 17:21 /DUPLICATE parsing 14790 subttl /DUPLICATE parsing 14791 14792 000301'01 200 16 0 00 000000# .dupli: guide ; Macro definition 14793 000302'01 260 17 0 00 000052* 14794 000016'02 000000000000# 14795 000116'04 164 157 040 141 040 14796 movei t1, [ 14797 flddb. .cmqst,,,,,[ 14798 flddb. .cmfld,,,,, 14799 000303'01 201 01 0 00 002526' ]] 14800 14801 000304'01 260 17 0 00 000061* call rfield ; Get the macro name 14802 dmove t1, [ mactab ; Load the address of the keyword table 14803 000305'01 120 01 0 00 002531' point 7, atmbuf ] ; And a pointer to the atom buffer 14804 000306'01 104 00 0 00 000537 TBLUK% ; See if it's in there (shouldn't be) 14805 000307'01 320 12 0 00 000311' %jserr (,cmder1) ; Fail, allow a ^H 14806 000310'01 254 00 0 00 000314' 14807 000311'01 265 01 0 00 000273* 14808 000312'01 000000 000000 14809 000313'01 254 00 0 00 000033* 14810 14811 000314'01 607 02 0 00 040000 ifxn. t2, tl%exm ; Found an exact match? 14812 000315'01 254 00 0 00 000326' 14813 000316'01 200 01 0 00 000000# emsg ;" font crock mode 14814 000317'01 104 00 0 00 000313 14815 000017'02 000000000000# 14816 000123'04 124 150 145 040 162 14817 000320'01 561 01 0 00 000215* hrroi t1, atmbuf ; Point to the atom buffer 14818 000321'01 104 00 0 00 000076 PSOUT% ; Type the new name which won't work 14819 000322'01 200 01 0 00 000000# txmsg <" already exists> ;" font crock mode 14820 000323'01 104 00 0 00 000076 14821 000324'01 320 12 0 00 000325' 14822 000020'02 000000000000# 14823 000132'04 042 040 141 154 162 14824 000325'01 254 00 0 00 000313* jrst cmder1 ; Allow ^H 14825 000326'01 endif. 14826 14827 dmove t1, [point 7, atmbuf ; Load pointer to new keyword 14828 000326'01 120 01 0 00 002441' point 7, namatm] ; And a pointer to the macro name buffer 14829 000327'01 260 17 0 00 000102* call asczcp ; Copy the ASCIZ string over 14830 000330'01 202 03 0 00 000113* movem t3, namlen ; Save the length of what we copied 14831 14832 000331'01 260 17 0 00 000277* confrm ; Tie off the line 14833 14834 000332'01 201 01 0 00 002533' movei t1, [.dupli,,$dupli] ;Load our own semantic action 14835 000333'01 202 01 0 00 000000* movem t1, pars1 ; Stomp top-level parse, we're taking it from here 14836 000334'01 263 17 0 00 000000 ret ; Return into /DUPLICATE semantic action 14837 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20MAC MAC 30-Jun-23 17:21 /DUPLICATE semantic action 14838 subttl /DUPLICATE semantic action 14839 14840 000335'01 265 16 0 00 002466' $dupli: saveac ; MUST have same register usage as $defin!! 14841 000336'01 332 10 0 00 000000# skipe q4, tbent ; Already have the table address? 14842 000337'01 254 00 0 00 000366' ifskp. ; No, go find it 14843 000340'01 201 01 0 00 000000# movei t1, mactab ; Load the address of the keyword table 14844 000341'01 200 02 0 00 000000# move t2, onamp ; And the keyword text pointer 14845 000342'01 104 00 0 00 000537 TBLUK% ; See if it's in there (should be) 14846 000343'01 320 12 0 00 000345' %jserr (,r) 14847 000344'01 254 00 0 00 000350' 14848 000345'01 265 01 0 00 000311* 14849 000346'01 000000000000# 14850 000347'01 254 00 0 00 000275* 14851 000136'04 105 162 162 157 162 14852 000350'01 603 02 0 00 040000 ifxe. t2, tl%exm ; Found an exact match? 14853 000351'01 254 00 0 00 000365' 14854 000352'01 200 01 0 00 000000# emsg ;" No, bomb 14855 000353'01 104 00 0 00 000313 14856 000021'02 000000000000# 14857 000147'04 103 157 165 154 144 14858 000354'01 561 01 0 00 000165* hrroi t1, namatm ; Point at what we should have found 14859 000355'01 104 00 0 00 000076 PSOUT% ; Type it 14860 000356'01 200 01 0 00 000000# txmsg <" macro in order to duplicate it> 14861 000357'01 104 00 0 00 000076 14862 000360'01 320 12 0 00 000361' 14863 000022'02 000000000000# 14864 000154'04 042 040 155 141 143 14865 000361'01 561 01 0 00 000222* hrroi t1, crlf ; Tie off the line 14866 000362'01 104 00 0 00 000076 PSOUT% 14867 000363'01 263 17 0 00 000000 ret ; Get out of here 14868 000364'01 254 00 0 00 000366' else. ; Otherwise, found something 14869 000365'01 200 10 0 00 000001 move q4, t1 ; Save the table entry 14870 000366'01 endif. ; End case looking for the keyword 14871 000366'01 endif. ; End case already had it 14872 14873 ; Now the calculate the size in words of the new keyword 14874 14875 000366'01 200 05 0 00 000330* move q1, namlen ; Load length of macro expansion text 14876 000367'01 200 02 0 00 002442' move t2, [point 7,namatm] ; Load pointer to same 14877 000370'01 133 05 0 00 000002 adjbp q1, t2 ; Calculate the ending pointer 14878 000371'01 302 05 0 00 440700 caie q1, 440700 ; On a word boundary? 14879 000372'01 271 05 0 00 000001 addi q1, ^d1 ; No, round up a word 14880 000373'01 621 05 0 00 777777 tlz q1, -1 ; Shut off the pointer part 14881 000374'01 621 02 0 00 777777 tlz t2, -1 ; in both pointers 14882 000375'01 274 05 0 00 000002 sub q1, t2 ; Now have required words 14883 14884 ; Take a copy of the expansion text for the macro 14885 14886 000376'01 550 01 0 10 000000 hrrz t1, (q4) ; Get address of text 14887 000377'01 505 01 0 00 440700 hrli t1, (point 7,0) ; Now have our source 14888 000400'01 200 02 0 00 002500' move t2, [ point 7, expatm ] ; Put it in as new expansion 14889 000401'01 260 17 0 00 000327* call asczcp ; Copy the ASCIZ string over 14890 000402'01 202 03 0 00 000123* movem t3, explen ; And store the length 14891 14892 ; And figure out how long that was in words k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7-1 K20MAC MAC 30-Jun-23 17:21 /DUPLICATE semantic action 14893 14894 000403'01 200 06 0 00 000003 move q2, t3 ; Put the length where $defad wants it 14895 000404'01 200 02 0 00 002500' move t2, [ point 7, expatm ] ; Point to base of expansion 14896 000405'01 133 06 0 00 000002 adjbp q2, t2 ; Calculate the ending pointer 14897 000406'01 302 06 0 00 440700 caie q2, 440700 ; On a word boundary? 14898 000407'01 271 06 0 00 000001 addi q2, ^d1 ; No, round up a word 14899 000410'01 621 06 0 00 777777 tlz q2, -1 ; Shut off the pointer part 14900 000411'01 621 02 0 00 777777 tlz t2, -1 ; in both pointers 14901 000412'01 274 06 0 00 000002 sub q2, t2 ; Now have required words 14902 14903 ; Join $defad at the point of adding something 14904 14905 000413'01 254 00 0 00 000133' callret $defad ; And just add every 14906 000414'01 263 17 0 00 000000 ret 14907 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20MAC MAC 30-Jun-23 17:21 /REMOVE parsing 14908 subttl /REMOVE parsing 14909 14910 emacro < 14911 14912 .mremo: remark need to parse for the set parameter here 14913 confrm ; Tie off the line 14914 14915 movei t1, [.mremo,,$mremo] ;Load our own semantic action 14916 movem t1, pars1 ; Stomp top-level parse, we're taking it from here 14917 ret ; Return into /RENAME semantic action 14918 14919 >;;emacro 14920 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20MAC MAC 30-Jun-23 17:21 /REMOVE semantic action 14921 subttl /REMOVE semantic action 14922 14923 emacro < 14924 14925 $mremo: saveac ; Needs a lot of registers 14926 14927 skipe q4, tbent ; Already have the table address? 14928 ifskp. ; No, go find it 14929 movei t1, mactab ; Load the address of the keyword table 14930 move t2, onamp ; And the keyword text pointer 14931 TBLUK% ; See if it's in there (should be) 14932 %jserr (,r) 14933 ifxe. t2, tl%exm ; Found an exact match? 14934 emsg ;" No, bomb 14935 hrroi t1, namatm ; Point at what we should have found 14936 PSOUT% ; Type it 14937 txmsg <" macro in order to remove from it> 14938 hrroi t1, crlf ; Tie off the line 14939 PSOUT% 14940 ret ; Get out of here 14941 else. ; Otherwise, found something 14942 move q4, t1 ; Save the table entry 14943 endif. ; End case looking for the keyword 14944 endif. ; End case already had it 14945 14946 remark ; Toss anything in the macro editor 14947 seto t1, ; Case IV, deleting process memory 14948 dmove t2, [ .fhslf,,medpg ; This process, page number of medit psect 14949 pm%cnt!fld(edpgs,pm%rpt) ] ; Number of pages to toss 14950 PMAP% ; Trim our working set 14951 %jserr (,) ; Odd... but continue 14952 14953 remark ; Set up editing table prototype 14954 xmovei t3, medorg ; Load base of .psect 14955 dmove t1, [ 0,,MACMAX ; TBLUK% table has no entries now 14956 0 ] ; Stomp the 2nd location, just in case 14957 dmovem t1, (t3) ; Now have an empty table 14958 xmovei q3, MACMAX+1(t3) ; Now have top of macro text editing area 14959 dmove t1, q3 ; Load information for splitter 14960 call csplit ; Split the text into keyword names and data 14961 >;;emacro 14962 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20MAC MAC 30-Jun-23 17:21 Takes a pointer to macro text and splits it up with COMND% 14963 subttl Takes a pointer to macro text and splits it up with COMND% 14964 14965 ; t1/ Top of editing area to stash things 14966 ; t2/ TBLUK% entry of existing macro 14967 14968 ;N.B., assumes editing area is zeroed!! 14969 14970 emacro < 14971 14972 csplit: saveac 14973 move q3, t1 ; Save top of macro insertion 14974 hrli q4, (point 7,0) ; Build a section local pointer 14975 hrr q4, (t2) ; Get address of macro text 14976 14977 do. ; Enter loop context 14978 call splini ; Initialize for parsing from string 14979 move q2, t2 ; Put the CMDBUF pointer in a safe place 14980 call prepar ; Prepare to parse 14981 jumpe t1,endlp. ; Done at end of string 14982 move q1, t1 ; Save it 14983 call dopair ; Do a set pair 14984 cain q1, .chlfd ; Line Feed? 14985 exit. ; Yes, last command in text 14986 loop. ; Next pair 14987 enddo. ; Exit loop lexical context 14988 14989 call splfix ; Fix the CSB up 14990 ret ; Done 14991 14992 >;;emacro 14993 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20MAC MAC 30-Jun-23 17:21 Do a SET paramater-value pair 14994 subttl Do a SET paramater-value pair 14995 14996 ; N.B., might not just be a pair, could be secondary parsing 14997 ; 14998 ; Maybe put the .sigio stuff in when debugging? Gives real nasty 14999 ; error because we can't trap it. 15000 15001 emacro < 15002 15003 ccrlf: point 7, crlf 15004 -^d2 15005 15006 dopair: saveac ; Needs to save a few things 15007 15008 move q1, sbk+.cmioj ; Load current input and output JFN pair 15009 hrli t1, .sigio ; Set to blow up on a read 15010 hrr t1, q1 ; Let it blat if it wants to 15011 movem t1, sbk+.cmioj ; Set up our trick wire 15012 15013 movei t1, [ flddb. .cmkey,,settab ] 15014 call rflde ; Parse just the SET keyword 15015 %ermsg (,r) ; Leave 15016 ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 15017 move q2, t2 ; Keep selected item safe 15018 15019 hlro t1,(q2) ; Show parameter name (keyword 15020 psout% 15021 call csbinf ; Maybe type out interesting CSB stuff 15022 hrrz t4, (q2) ; Get parser and action for parameter valud 15023 hlrz t1, (t4) ; This is the parser portion 15024 15025 setom definf ; Fake we're defining 15026 call (t1) ; Parse the rest of something 15027 setzm definf ; Out of phoney define 15028 15029 move t1, q1 ; Load saved in and out JFN pair 15030 movem t1, sbk+.cmioj ; Restore to the SBK 15031 15032 hrroi t1, atmbuf ; Point to what we parsed 15033 PSOUT% 15034 call csbinf 15035 15036 hrroi t1, crlf 15037 psout 15038 ret 15039 15040 >;;emacro 15041 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20MAC MAC 30-Jun-23 17:21 Display Useful CSB Information 15042 subttl Display Useful CSB Information 15043 15044 emacro < 15045 15046 csbinf: skipg t4, sbk+.cminc ; Anything left to parse? 15047 ifskp. ; It appears so 15048 cain t4, ^d1 ; One dinky character? 15049 anskp. ; Yep; don't let's bother with that 15050 movei t1, .priou ; Going to terminal 15051 movei t2, .chtab ; Space over 15052 BOUT% ; Do it 15053 erjmps .+1 ; Catch and suppress error 15054 move t2, t4 15055 movei t3, ^d10 15056 NOUT% 15057 erjmps .+1 ; Catch and suppress error 15058 movei t2, "," ; Quote it to be sure 15059 BOUT% ; Do it 15060 movei t2, "'" ; Quote it to be sure 15061 BOUT% ; Do it 15062 erjmps .+1 ; Catch and suppress error 15063 move t2, sbk+.cmptr ; Point to rest of text 15064 movn t3, t4 ; Counted SOUT% 15065 SOUT% ; See what's left 15066 erjmpr .+1 ; Catch and ignore error 15067 movei t2, "'" ; Quote it to be sure 15068 BOUT% ; Do it 15069 erjmps .+1 ; Catch and suppress error 15070 movei t2, .chtab ; Space over 15071 BOUT% ; Do it 15072 erjmps .+1 ; Catch and suppress error 15073 else. ; Otherwise, just tab over 15074 movei t1, .chtab ; Space over 15075 PBOUT% 15076 PBOUT% 15077 endif. 15078 ret 15079 >;;emacro 15080 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20MAC MAC 30-Jun-23 17:21 .SIGIO Input handler 15081 subttl .SIGIO Input handler 15082 15083 emacro < 15084 ; N.B., This code doesn't work. It will *NEVER* work unless a 15085 ; significant change is made to Tops-20. 15086 ; 15087 ; .SIGIO is unfortunately hard wired to be multiplexed on channel 15088 ; 19 (along with address break), which is Inferior Fork Termination 15089 ; (.ICIFT). Tops-20 very reasonably does not allow a fork to catch 15090 ; its own termination. 15091 ; 15092 ; I would have thought a more obvious approach would have been to 15093 ; implement .SIGIO in a similar fashion to the .TICTI/.TICTO 15094 ; terminal codes (interrupt on type-in/output detected), the 15095 ; difference being that if you didn't handle .SIGIO, it's goes 15096 ; 'upstairs' like other panic channels. 15097 ; 15098 ; For debugging, using .SIGIO still helps because if you mess up 15099 ; the pointers in the CSB, then the fork will terminate and you can 15100 ; investigate with DDT instead of going into a terminal wait. 15101 15102 repeat 0,< ; See above, can't use this, ever 15103 extern pc3 ; Globalized in K20SUB 15104 15105 sitrap: intern sitrap ; K20SUB needs the address in CHNTAB 15106 15107 aos sintn ; Count a signal just because ... 15108 push p, t1 ; Save an accumulator 15109 push p, t2 ; And another one 15110 push p, t3 ; One more!!! 15111 15112 move t1, pc3 ; Pick up our interrupted location 15113 ifxe. t1, pc%usr ; We are only breaking out of a JSYS 15114 hrrz t2, t1 ; PC is where the JSYS will return 15115 subi t2, ^d1 ; So fix it to look at the JSYS 15116 hllz t3, (t2) ; Isolate the left half word 15117 txz t3, 777 ; Want just the opcode 15118 came t3, [ COMND% ] ; Trying to parse something? 15119 anskp. ; Nope, we're done 15120 txo t1, pc%usr ; Force user mode 15121 movem t1, pc3 ; Change DEBRK% action 15122 movx t1, cm%nop ; Force a parse failure 15123 else. ; Otherwise, leave everything alone 15124 setz t1, ; And no flag fix up 15125 endif. 15126 15127 sitepi: pop p, t3 ; Signal trap epilogue 15128 pop p, t2 ; Restores ac2 and ac3 immediately 15129 orm t1, (p) ; Or in any flags before restore 15130 pop p, t1 ; Restore modified or unmodified 15131 15132 DEBRK% ; Done 15133 >;;End Repeat 0 15134 >;;emacro 15135 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20MAC MAC 30-Jun-23 17:21 Turn .sigio interrupts on and off 15136 subttl Turn .sigio interrupts on and off 15137 15138 emacro < 15139 repeat 0,< ; See above, will never work 15140 extern sigchb ; Defined in K20SUB 15141 15142 dosigh: .fhslf ; This process 15143 sigchb ; .SIGIO channel bit 15144 15145 tsigon: dmove t1, dosigh ; Turn on the signal I/O handler 15146 AIC% ; Enable to catch it 15147 %jserr (,) ; Odd, but carry on 15148 ret 15149 15150 sigoff: dmove t1, dosigh ; Turn off the signal I/O handler 15151 DIC% ; Enable to catch it 15152 %jserr (,) ; Odd, but carry on 15153 ret 15154 >;;End Repeat 0 15155 >;;emacro 15156 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20MAC MAC 30-Jun-23 17:21 COMND% Command State Block Initialization/Fix Up 15157 subttl COMND% Command State Block Initialization/Fix Up 15158 15159 emacro < 15160 splini: remark ; Split initialization 15161 remark ; Tweak the csb to parse from string 15162 dmove t2,[point 7,cmdbuf ;Point to beginning of command buffer 15163 cmdbln*5 ] ; Max characters in command buffer 15164 dmovem t2, sbk+.cmptr ; Stomp both in; beginning of parse 15165 setzm sbk+.cminc ; No unparsed characters, yet... 15166 ret 15167 15168 splfix: remark ; Done parsing, fix the CSB back up 15169 dmove t1,[point 7,cmdbuf ;Point to beginning of command buffer 15170 cmdbln*5 ] ; Max characters in command buffer 15171 dmovem t1, sbk+.cmptr ; Stomp both in; nothing left to parse 15172 setzm sbk+.cminc ; No unparsed characters anymore 15173 setzb t1, t2 ; Cons up ten .CHNUL's 15174 dmovem t1, cmdbuf ; Scrub the command buffer an itty bit 15175 hllm t1, sbk ; Zero the CSB flags. 15176 ret 15177 15178 >;;emacro 15179 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20MAC MAC 30-Jun-23 17:21 Prepare CSB and CMDBUF to parse from string 15180 subttl Prepare CSB and CMDBUF to parse from string 15181 15182 ; Expects 15183 ; 15184 ; q4/ Pointer to macro text 15185 ; q2/ Pointer to command buffer 15186 ; 15187 ; Returns: 15188 ; 15189 ; t1/ Terminating character 15190 ; 15191 ; CMDBUF filled 15192 ; CSB conditioned 15193 15194 emacro < 15195 15196 prepar: do. ; Enter loop context 15197 ildb t1, q4 ; Get a character from the macro text 15198 jumpe t1, endlp. ; Exit routine on end of string 15199 cain t1, .chcrt ; A carriage return? 15200 movei t1, .chlfd ; Turn into what COMND% wants ... 15201 idpb t1, q2 ; Copy the character into the command buffer 15202 aos sbk+.cminc ; Account for character to be parsed 15203 sos sbk+.cmcnt ; Account for character storage used 15204 cain t1, .chlfd ; A line feed? 15205 exit. ; Last command on line 15206 cain t1, "," ; Hit a comma? 15207 exit. ; Yes, SET pair seperator 15208 loop. ; Process next character 15209 enddo. ; End loop lexical context 15210 15211 ret ; And done 15212 >;;emacro 15213 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20MAC MAC 30-Jun-23 17:21 msplit - Takes a macro text and splits it up 15214 subttl msplit - Takes a macro text and splits it up 15215 15216 ; t1/ Top of editing area to stash things 15217 ; t2/ TBLUK% entry of existing macro 15218 ; 15219 ; First attempt, abandoned for using COMND% based approach 15220 ; 15221 ;N.B., assumes editing area is zeroed!! 15222 15223 emacro < 15224 repeat 0,< 15225 msplit: saveac 15226 move q3, t1 ; Save top of macro insertion 15227 hrli q4, (point 7,0) ; Build a section local pointer 15228 hrr q4, (t2) ; Get address of macro text 15229 15230 do. ; Enter main loop context 15231 move q1, q3 ; This will be a SET keyword 15232 hrrz t2, q1 ; Pointer starts there 15233 hrli t2, (point 7,0) ; Build a section local pointer 15234 setz t3, ; No beginning of keyword, yet 15235 do. ; Enter keyword identification loop 15236 ildb t1, q4 ; Pick up a byte of keyword 15237 block. ; Enter block context for easier control flow 15238 jumpe t1, rskp ; End of string? That's odd 15239 cain t1, .chspc ; Space? 15240 retskp ; End of keyword 15241 cain t1, .chtab ; Tab? 15242 retskp ; End of keyword 15243 cain t1, .chlpa ; Left parenthesis? 15244 retskp ; COMND% will break on that 15245 ret ; None of the above 15246 endbk. ; Exit block context 15247 ifskp. ; Hit a break character 15248 jumpn t3, endlp. ; If started significance, this a break, so leave 15249 loop. ; Nope, swallow it and get another 15250 else. ; Otherwise, signicant 15251 idpb t1, t2 ; Deposit in keyword area 15252 aoja t3, top. ; Flag start of significance 15253 endif. 15254 enddo. ; End keyword indentification loop 15255 ife. t1 ; Should not hit end of string after keyword 15256 move t1, q3 ; Load updated top of text area 15257 ret ; And stop 15258 endif. 15259 caie t2, 440700 ; On a word boundary? 15260 addi t2, ^d1 ; No, round up a word 15261 hrrz q2, t2 ; This will be the SET parameter 15262 move q3, q2 ; Also new top of storage 15263 setzb t3, t4 ; Haven't seen any characters, yet 15264 do. ; Enter value identification loop 15265 ildb t1, q4 ; Pick up a byte of keyword 15266 block. ; Enter block context for easier control flow 15267 cain t1, .chspc ; Space? 15268 retskp ; Reset value length counter k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-1 K20MAC MAC 30-Jun-23 17:21 msplit - Takes a macro text and splits it up 15269 cain t1, .chtab ; Tab? 15270 retskp ; Reset value length counter 15271 cain t1, .chrpa ; Right parenthesis? 15272 retskp ; Reset value length counter 15273 ife. t1 ; .chnul?? 15274 seto t4, ; Flag end of keyword value 15275 ret ; But count it 15276 endif. 15277 caie t1, "," ; Value terminator? 15278 ifskp. ; Yes, we have the value for this keyword 15279 seto t4, ; Flag end of keyword value 15280 ret ; But count it 15281 endif. 15282 ret ; Some other character, count it 15283 endbk. ; End block context 15284 ifskp. ; +2 means hit a seperator character 15285 setz t3, ; Reset the counter 15286 loop. ; And get another character 15287 else. ; Otherwise, count towards a keyword 15288 jumpn t4, endlp. ; Break loop on end of keyword value 15289 aoja t3, top. ; Count the character and loop 15290 endif. ; End of block exit handling 15291 enddo. ; End search loop 15292 ife. t3 ; Never found a value? 15293 addi q3, ^d1 ; Leave a word of .chnul's 15294 else. ; Otherwise have to play with pointers 15295 move t1, q2 ; Destination is top of storage 15296 hrli t1,(point 7,0) ; Turn into a word based pointer 15297 movn t2, t3 ; Load negatve keyword length 15298 subi t2, ^d1 ; Don't copy the comma or .chnul 15299 adjbp t2, q4 ; Back up to beginning of keyword 15300 do. ; And copy the keyword over 15301 ildb t4, t2 ; Pick up a byte from macro text 15302 idpb t4, t1 ; And put into edit area 15303 sojg t3, top. ; Do all of them 15304 enddo. 15305 caie t1, 440700 ; Ended on a word boundary? 15306 addi t1, ^d1 ; No, round up a word 15307 hrrz q3, t1 ; Set new top of storage 15308 endif. 15309 15310 movei t1, medorg ; Address of keyword table 15311 hrlz t2, q1 ; Load address of keyword text 15312 hrr t2, q2 ; Identified value 15313 TBADD% ; Cross our fingers and insert 15314 %jserr (,) ;Carry on 15315 ldb t1, q4 ; Load stopping character 15316 jumpe t1, endlp. ; End of macro text, done 15317 loop. ; Look for next keyword value pair 15318 enddo. ; End of split loop 15319 15320 move t1, q3 ; Load updated top of text area 15321 ret 15322 >;;repeat 0 15323 >;;emacro k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-2 K20MAC MAC 30-Jun-23 17:21 msplit - Takes a macro text and splits it up 15324 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20MAC MAC 30-Jun-23 17:21 /RENAME parsing 15325 subttl /RENAME parsing 15326 15327 000415'01 200 16 0 00 000000# .renam: guide ; Macro definition 15328 000416'01 260 17 0 00 000302* 15329 000023'02 000000000000# 15330 000163'04 164 157 040 141 040 15331 movei t1, [ 15332 flddb. .cmqst,,,,,[ 15333 flddb. .cmfld,,,,, 15334 000417'01 201 01 0 00 002526' ]] 15335 15336 000420'01 260 17 0 00 000304* call rfield ; Get the new name for the macro 15337 15338 dmove t1, [ mactab ; Load the address of the keyword table 15339 000421'01 120 01 0 00 002534' point 7, atmbuf ] ; And a pointer to the atom buffer 15340 000422'01 104 00 0 00 000537 TBLUK% ; See if it's in there (shouldn't be) 15341 000423'01 320 12 0 00 000425' %jserr (,cmder1) ; Fail, allow a ^H 15342 000424'01 254 00 0 00 000430' 15343 000425'01 265 01 0 00 000345* 15344 000426'01 000000 000000 15345 000427'01 254 00 0 00 000325* 15346 15347 000430'01 607 02 0 00 040000 ifxn. t2, tl%exm ; Found an exact match? 15348 000431'01 254 00 0 00 000442' 15349 000432'01 200 01 0 00 000000# emsg ;" font crock mode 15350 000433'01 104 00 0 00 000313 15351 000024'02 000000000000# 15352 000170'04 124 150 145 040 162 15353 000434'01 561 01 0 00 000320* hrroi t1, atmbuf ; Point to the atom buffer 15354 000435'01 104 00 0 00 000076 PSOUT% ; Type the new name which won't work 15355 000436'01 200 01 0 00 000000# txmsg <" already exists> ;" font crock mode 15356 000437'01 104 00 0 00 000076 15357 000440'01 320 12 0 00 000441' 15358 000025'02 000000000000# 15359 000177'04 042 040 141 154 162 15360 000441'01 254 00 0 00 000427* jrst cmder1 ; Allow ^H 15361 000442'01 endif. 15362 15363 dmove t1, [point 7, atmbuf ; Load pointer to new keyword 15364 000442'01 120 01 0 00 002441' point 7, namatm] ; And a pointer to the macro name buffer 15365 000443'01 260 17 0 00 000401* call asczcp ; Copy the ASCIZ string over 15366 000444'01 202 03 0 00 000366* movem t3, namlen ; Save the length of what we copied 15367 15368 000445'01 260 17 0 00 000331* confrm ; Tie off the line 15369 15370 000446'01 201 01 0 00 002536' movei t1, [.renam,,$renam] ;Load our own semantic action 15371 000447'01 202 01 0 00 000333* movem t1, pars1 ; Stomp top-level parse, we're taking it from here 15372 000450'01 263 17 0 00 000000 ret ; Return into /RENAME semantic action 15373 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20MAC MAC 30-Jun-23 17:21 /RENAME semantic action 15374 subttl /RENAME semantic action 15375 15376 000451'01 265 16 0 00 002466' $renam: saveac ; Doesn't link with $define 15377 000452'01 332 10 0 00 000000# skipe q4, tbent ; Do we already have the keyword address? 15378 000453'01 254 00 0 00 000502' ifskp. ; Nope, go get it 15379 000454'01 201 01 0 00 000000# movei t1, mactab ; Load the address of the keyword table 15380 000455'01 200 02 0 00 000000# move t2, onamp ; And the keyword text pointer we started with 15381 000456'01 104 00 0 00 000537 TBLUK% ; See if it's in there (it betterbe) 15382 000457'01 320 12 0 00 000461' %jserr (,r) 15383 000460'01 254 00 0 00 000464' 15384 000461'01 265 01 0 00 000425* 15385 000462'01 000000000000# 15386 000463'01 254 00 0 00 000347* 15387 000203'04 105 162 162 157 162 15388 000464'01 603 02 0 00 040000 ifxe. t2, tl%exm ; Found an exact match? 15389 000465'01 254 00 0 00 000501' 15390 000466'01 200 01 0 00 000000# emsg ;" No, bomb 15391 000467'01 104 00 0 00 000313 15392 000026'02 000000000000# 15393 000213'04 103 157 165 154 144 15394 000470'01 561 01 0 00 000354* hrroi t1, namatm ; Point at what we should have found 15395 000471'01 104 00 0 00 000076 PSOUT% ; Type it 15396 000472'01 200 01 0 00 000000# txmsg <" macro in order to duplicate it> 15397 000473'01 104 00 0 00 000076 15398 000474'01 320 12 0 00 000475' 15399 000027'02 000000000000# 15400 000220'04 042 040 155 141 143 15401 000475'01 561 01 0 00 000361* hrroi t1, crlf ; Tie off the line 15402 000476'01 104 00 0 00 000076 PSOUT% 15403 000477'01 263 17 0 00 000000 ret ; Get out of here 15404 000500'01 254 00 0 00 000502' else. ; Otherwise, have something 15405 000501'01 200 10 0 00 000001 move q4, t1 ; Save the table entry 15406 000502'01 endif. ; End case looking for macro name 15407 000502'01 endif. ; End case already had the keyword address 15408 15409 ; Calculate the size of the new macro name in words 15410 15411 000502'01 200 05 0 00 000444* move q1, namlen ; Load length of macro name in characters 15412 000503'01 200 02 0 00 002442' move t2, [point 7,namatm] ; Load pointer to same 15413 000504'01 133 05 0 00 000002 adjbp q1, t2 ; Calculate the ending pointer 15414 000505'01 302 05 0 00 440700 caie q1, 440700 ; On a word boundary? 15415 000506'01 271 05 0 00 000001 addi q1, ^d1 ; No, round up a word 15416 000507'01 621 05 0 00 777777 tlz q1, -1 ; Shut off the pointer part 15417 000510'01 621 02 0 00 777777 tlz t2, -1 ; in both pointers 15418 000511'01 274 05 0 00 000002 sub q1, t2 ; Now have required words to transfer new name 15419 15420 ; But!! Would putting it in the table take us over the end? 15421 15422 000512'01 200 01 0 00 000000# move t1, macbp ; Load the current top of macro text 15423 000513'01 621 01 0 00 777777 tlz t1, -1 ; Shut off pointer (its always a word boundary) 15424 000514'01 270 01 0 00 000005 add t1, q1 ; Add in the new name's length in words 15425 000515'01 301 01 0 00 000000# cail t1, macx ; Not off the end, I hope? 15426 000516'01 334 00 0 00 000000 %ermsg (,r) 15427 000517'01 254 00 0 00 000523' 15428 000520'01 265 01 0 00 000461* k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-1 K20MAC MAC 30-Jun-23 17:21 /RENAME semantic action 15429 000521'01 000000000000# 15430 000522'01 254 00 0 00 000463* 15431 000227'04 115 141 143 162 157 15432 15433 ; Ok, so safe to pop the name into the macro table 15434 15435 000523'01 550 07 0 00 000000# hrrz q3, macbp ; Use word address of keyword location 15436 000524'01 200 01 0 00 000005 move t1, q1 ; Number of words to copy 15437 000525'01 201 02 0 00 000470* movei t2, namatm ; Source is the name that was in the atom buffer 15438 000526'01 200 03 0 00 000007 move t3, q3 ; Destination is in macro storage 15439 000527'01 123 01 0 00 002501' xblt. t1 ; And transfer it over 15440 000530'01 505 03 0 00 440700 hrli t3, (point 7,0) ; Turn final address into a word aligned pointer 15441 000531'01 202 03 0 00 000000# movem t3, macbp ; Set new top of macro storage 15442 15443 ; Now build the TBLUK% table entry to insert 15444 15445 000532'01 514 06 0 00 000007 hrlz q2, q3 ; Keyword is what we just copied in 15446 000533'01 540 06 0 10 000000 hrr q2, (q4) ; But the macro text remains the same 15447 15448 ; First, remove the old keyword so we don't have to check the table entry count 15449 15450 000534'01 201 01 0 00 000000# movei t1, mactab ; Load the address of the macro table 15451 000535'01 200 02 0 00 000010 move t2, q4 ; And the address of the keyword entry 15452 000536'01 104 00 0 00 000535 TBDEL% ; Remove (should always work since just found it) 15453 000537'01 320 12 0 00 000541' %jserr (,r) ;?? 15454 000540'01 254 00 0 00 000544' 15455 000541'01 265 01 0 00 000520* 15456 000542'01 000000000000# 15457 000543'01 254 00 0 00 000522* 15458 000240'04 122 145 156 141 155 15459 15460 ; Finally insert ours; should work because previously checked 15461 15462 000544'01 201 01 0 00 000000# movei t1, mactab ; Load the address of the macro table 15463 000545'01 200 02 0 00 000006 move t2, q2 ; And our new keyword entry 15464 000546'01 104 00 0 00 000536 TBADD% ; Enter it in the TBLUK% table 15465 000547'01 320 12 0 00 000551' %jserr (,r) 15466 000550'01 254 00 0 00 000554' 15467 000551'01 265 01 0 00 000541* 15468 000552'01 000000000000# 15469 000553'01 254 00 0 00 000543* 15470 000251'04 122 145 156 141 155 15471 15472 000554'01 263 17 0 00 000000 ret 15473 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20MAC MAC 30-Jun-23 17:21 DEFINE macro table maintenance functions 15474 subttl DEFINE macro table maintenance functions 15475 15476 ; Begin code insertion 15477 15478 000030'02 000000 000000 %table(tabswi) ; Table maintenance switches 15479 000031'02 000000# 000000# %key3 , .mcomp, $mcomp ; Garbage collect 15480 000015'03 143 157 155 160 141 15481 000017'03 000000# 000000# 15482 000032'02 000000# 000000# %key3 , .mdump, $mdump ; Write a macros in binary format 15483 000020'03 144 165 155 160 000 15484 000021'03 000000# 000000# 15485 000033'02 000000# 000000# %keyf4 , .mrese, $mrese, cm%inv ; (sleepy Tom...) 15486 000022'03 002000 000001 15487 000023'03 151 156 164 151 141 15488 000025'03 000000# 000000# 15489 000034'02 000000# 000000# %key3 , .mmap, $mmap ; Directly use macros from binary file 15490 000026'03 155 141 160 000 000 15491 000027'03 000000# 000000# 15492 000035'02 000000# 000000# %key3 , .mrese, $mrese ; Whack everything 15493 000030'03 162 145 163 145 164 15494 000032'03 000000# 000000# 15495 000036'02 000000# 000000# %key3 , .msave, $msave ; Save macros in ASCII format 15496 000033'03 163 141 166 145 000 15497 000034'03 000000# 000000# 15498 000037'02 000000# 000000# %key3 , .msumm, $msumm ; Summary of table usage 15499 000035'03 163 165 155 155 141 15500 000037'03 000000# 000000# 15501 000030'02 000007 000007 %tbend 15502 15503 000555'01 550 04 0 02 000000 tablem: hrrz t4, (t2) ; Get the command routine addresses. 15504 000556'01 202 04 0 00 000447* movem t4, pars1 ; Stomp top-level parse, we're taking it from here 15505 000557'01 554 01 0 04 000000 hlrz t1, (t4) ; Get the syntax routine 15506 000560'01 254 00 0 01 000000 callret (t1) ; Call it and carry on 15507 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20MAC MAC 30-Jun-23 17:21 Parse the /DUMP switch 15508 subttl Parse the /DUMP switch 15509 15510 ; Tries for a device first as this is more efficient for NUL: and 15511 ; catches more errors earlier and more easily. 15512 15513 ; Default command filespec fields for .CMFIL: 15514 15515 000561'01 600020 777777 dmpbk: gj%flg!gj%fou!gj%new!fld(.gjnhg,.rhalf) ; .GJGEN 15516 000562'01 000100 000101 .priin,,.priou ; .GJSRC (ignored if COMND%) 15517 000563'01 000000 000000 0 ; .GJDEV (do not default the device) 15518 000564'01 000000 000000 0 ; .GJDIR (do not default the directory) 15519 000565'01 000000 000000 0 ; .GJNAM (do not default the name) 15520 000566'01 000000000000# eascii () ; .GJEXT (default extension is .BIN) 15521 000261'04 102 111 116 000 000 15522 000567'01 000000000000# 0 ; .GJPRO (use system default protection) 15523 000570'01 000000 000000 0 ; .GJACT (use job's current account) 15524 000010 dmpbkl==<.-dmpbk> ; Length of this GTJFN argument block. 15525 15526 000571'01 265 16 0 00 002466' .mdump: saveac ; Protect some registers 15527 000572'01 200 01 0 00 002537' movx t1, cz%ncl!.fhslf ; Release non-open JFN's on reparse 15528 000573'01 104 00 0 00 000034 CLZFF% 15529 000574'01 320 12 0 00 000575' erjmpr .+1 ; Catch and ignore errors 15530 000575'01 200 16 0 00 000000# guide 15531 000576'01 260 17 0 00 000416* 15532 000040'02 000000000000# 15533 000262'04 155 141 143 162 157 15534 000577'01 200 01 0 00 002540' move t1, [dmpbk,,cjfnbk] ; Insert our file parsing defaults. 15535 000600'01 251 01 0 00 000000# blt t1, cjfnbk+dmpbkl 15536 15537 movei t1, [ ; Catch bare device 15538 flddb. .cmfil,,,,,[ 15539 000601'01 201 01 0 00 002551' flddb. .cmdev,cm%sdh,,,,]] 15540 000602'01 260 17 0 00 000420* call rfield ; Ask them to supply the file 15541 000603'01 135 05 0 00 002440' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 15542 000604'01 200 06 0 00 000002 move q2, t2 ; Save parsed data (device or JFN) 15543 15544 000605'01 200 01 0 00 000006 move t1, q2 ; Load parse item for DVCHR% 15545 000606'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 15546 000607'01 621 01 0 00 777777 tlz t1, -1 ; Shut off flags so DVCHR% doesn't choke 15547 000610'01 104 00 0 00 000117 DVCHR% ; and find out about it 15548 000611'01 320 12 0 00 000613' %jserr (,r) 15549 000612'01 254 00 0 00 000616' 15550 000613'01 265 01 0 00 000551* 15551 000614'01 000000000000# 15552 000615'01 254 00 0 00 000553* 15553 000267'04 125 156 141 142 154 15554 000616'01 135 07 0 00 002554' ldb q3, [pointr t2, dv%typ] ; Pick up the device type 15555 15556 000617'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 15557 000620'01 254 00 0 00 000647' ifskp. ; Yes, see what it is 15558 000621'01 302 07 0 00 000015 caie q3, .dvnul ; NUL:? 15559 000622'01 254 00 0 00 000627' ifskp. ; Yes, we can simulate that 15560 000623'01 260 17 0 00 000445* confrm ; Confirm the selection 15561 000624'01 200 01 0 00 002555' movx t1, ;Use special designator and flags 15562 000625'01 202 01 0 00 000000* movem t1, pars2 ; Store the JFN and (phoney) flags k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-1 K20MAC MAC 30-Jun-23 17:21 Parse the /DUMP switch 15563 000626'01 263 17 0 00 000000 ret ; Done with this special case 15564 000627'01 endif. ; Any other device is NOT VALID 15565 15566 000627'01 302 07 0 00 000000 caie q3, .dvdsk ; Bare device? 15567 000630'01 254 00 0 00 000646' ifskp. ; Yes, but needs a file name 15568 000631'01 200 01 0 00 000000# emsg ; First part of blat 15569 000632'01 104 00 0 00 000313 15570 000041'02 000000000000# 15571 000302'04 124 150 145 040 000 15572 000633'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 15573 000634'01 201 01 0 00 000101 movei t1, .priou ; Output to the terminal 15574 000635'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 15575 000636'01 320 12 0 00 000640' %jserr (,cmder1) 15576 000637'01 254 00 0 00 000643' 15577 000640'01 265 01 0 00 000613* 15578 000641'01 000000000000# 15579 000642'01 254 00 0 00 000441* 15580 000303'04 125 156 141 142 154 15581 000643'01 200 01 0 00 000000# sxtext (t1,<: structure needs a file specification>) 15582 000042'02 000000000000# 15583 000314'04 072 040 163 164 162 15584 000644'01 104 00 0 00 000076 PSOUT% ; Finish the informative blat 15585 000645'01 254 00 0 00 000642* jrst cmder1 ; Allow reparse 15586 000646'01 endif. ; Any other device is NOT VALID 15587 15588 000646'01 254 00 0 00 000670' jrst .mdmpe ; Otherwise, handle as a general parse error 15589 000647'01 endif. ; End case .cmdev 15590 15591 remark .cmfil ; Everything else is a file 15592 15593 000647'01 302 07 0 00 000015 caie q3, .dvnul ; A JFN on NUL:?? 15594 000650'01 254 00 0 00 000663' ifskp. ; Yes, we can simulate that 15595 000651'01 260 17 0 00 000623* confrm ; Confirm the selection 15596 000652'01 200 01 0 00 000006 move t1, q2 ; Load parsed JFN 15597 000653'01 260 17 0 00 000000* call isnulj ; Convert it to a special JFN, releasing original 15598 000654'01 334 01 0 00 000000# ermsg% (,cmder1) ; Allow ^H 15599 000655'01 254 00 0 00 000661' 15600 000656'01 202 01 0 00 000000* 15601 000657'01 104 00 0 00 000313 15602 000660'01 254 00 0 00 000645* 15603 000043'02 000000000000# 15604 000324'04 113 105 122 115 111 15605 15606 000661'01 202 01 0 00 000625* movem t1, pars2 ; Store the JFN and original parse flags 15607 000662'01 263 17 0 00 000000 ret ; Done with this second special NUL: case 15608 000663'01 endif. 15609 15610 000663'01 302 07 0 00 000000 caie q3, .dvdsk ; Was this a structure? 15611 000664'01 254 00 0 00 000670' jrst .mdmpe ; No, any other device is NOT VALID 15612 15613 000665'01 260 17 0 00 000651* confrm ; Otherwise, fine; confirm selection 15614 000666'01 202 06 0 00 000661* movem q2, pars2 ; Store the JFN and flags 15615 000667'01 263 17 0 00 000000 ret ; Done with the parse 15616 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20MAC MAC 30-Jun-23 17:21 Parse the /DUMP switch 15617 remark Here for common parse errors 15618 15619 000670'01 200 01 0 00 000000# .mdmpe: emsg ; Begin whining 15620 000671'01 104 00 0 00 000313 15621 000044'02 000000000000# 15622 000336'04 124 150 145 040 000 15623 000672'01 201 01 0 00 000101 movei t1, .priou ; Output to terminal, always 15624 000673'01 302 05 0 00 000016 caie q1, .cmdev ; Device? 15625 000674'01 254 00 0 00 000705' ifskp. ; Yes, use DEVST% 15626 000675'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 15627 000676'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 15628 000677'01 320 12 0 00 000701' %jserr (,cmder1) 15629 000700'01 254 00 0 00 000704' 15630 000701'01 265 01 0 00 000640* 15631 000702'01 000000000000# 15632 000703'01 254 00 0 00 000660* 15633 000337'04 125 156 141 142 154 15634 000704'01 254 00 0 00 000715' else. ; Otherwise, DEVST% will choke on the JFN 15635 000705'01 550 02 0 00 000006 hrrz t2, q2 ; Load just the JFN 15636 dmove t3, [ ; Just want the device name, no punctuation 15637 fld(.jsaof,js%dev) 15638 000706'01 120 03 0 00 002556' 0 ] ; No odd prefix, whatever that is 15639 000707'01 104 00 0 00 000030 JFNS% ; Convert to something readable 15640 000710'01 320 12 0 00 000712' %jserr (,cmder1) 15641 000711'01 254 00 0 00 000715' 15642 000712'01 265 01 0 00 000701* 15643 000713'01 000000000000# 15644 000714'01 254 00 0 00 000703* 15645 000347'04 125 156 141 142 154 15646 000715'01 endif. ; Either way, error should be more informative 15647 15648 000715'01 200 01 0 00 000000# txmsg <: device does not have binary dumping capabilities> 15649 000716'01 104 00 0 00 000076 15650 000717'01 320 12 0 00 000720' 15651 000045'02 000000000000# 15652 000361'04 072 040 144 145 166 15653 000720'01 561 01 0 00 000475* hrroi t1, crlf ; Newline 15654 000721'01 104 00 0 00 000076 PSOUT% ; Tie off the blat 15655 000722'01 320 12 0 00 000723' erjmpr .+1 ; Catch and ignore that error, too 15656 15657 000723'01 302 05 0 00 000006 caie q1, .cmfil ; Had we parsed a file, actually? 15658 000724'01 254 00 0 00 000730' ifskp. ; Yes, then have a little clean up to do 15659 000725'01 550 01 0 00 000006 hrrz t1, q2 ; Load our poor JFN, sans flags 15660 000726'01 104 00 0 00 000023 RLJFN% ; Toss it; can't use it 15661 000727'01 320 12 0 00 000714* erjmpr cmder1 ; Ignore error and beat it 15662 000730'01 endif. 15663 15664 000730'01 254 00 0 00 000727* jrst cmder1 ; Allow ^H 15665 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20MAC MAC 30-Jun-23 17:21 Execute the /DUMP switch 15666 subttl Execute the /DUMP switch 15667 15668 000731'01 265 16 0 00 002466' $mdump: saveac ; Wants a few accumulators 15669 15670 000732'01 200 05 0 00 000666* move q1, pars2 ; Load the JFN and flags 15671 000733'01 550 01 0 00 000005 hrrz t1, q1 ; Look at just the JFN 15672 000734'01 306 01 0 00 377777 cain t1, .nulio ; Special cased? 15673 000735'01 254 00 0 00 000745' ifskp. ; No, have to really open the file 15674 000736'01 200 02 0 00 002560' movx t2, 15675 000737'01 104 00 0 00 000021 OPENF% ; Try to create the file 15676 000740'01 320 12 0 00 000742' %jserr (,$mdmpe) 15677 000741'01 254 00 0 00 000745' 15678 000742'01 265 01 0 00 000712* 15679 000743'01 000000000000# 15680 000744'01 254 00 0 00 001060' 15681 000374'04 125 156 141 142 154 15682 000745'01 endif. ; End case file not on NUL: 15683 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20MAC MAC 30-Jun-23 17:21 Set up to dump the macros into binary file 15684 subttl Set up to dump the macros into binary file 15685 15686 ; N.B., Although the mapping direction seems non-intuitive here, 15687 ; what's actually happening is that we are reserving space in the 15688 ; output file to populate as we will. If we don't touch a page, it 15689 ; won't exist in the file, effectively showing up as a 'hole'. 15690 15691 remark PMAP% Case IV: deleting process memory 15692 000745'01 474 01 0 00 000000 seto t1, ; Don't want anything in gc .psect 15693 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 15694 000746'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to toss 15695 000747'01 104 00 0 00 000056 PMAP% ; Kick them all into oblivion 15696 000750'01 320 12 0 00 000752' %jserr (,$mdmpe) 15697 000751'01 254 00 0 00 000755' 15698 000752'01 265 01 0 00 000742* 15699 000753'01 000000000000# 15700 000754'01 254 00 0 00 001060' 15701 000404'04 125 156 141 142 154 15702 15703 remark PMAP% Case I: Mapping File Pages to a Process 15704 000755'01 514 01 0 00 000005 hrlz t1, q1 ; 'Input' file, page zero 15705 000756'01 316 01 0 00 002563' camn t1, [.nulio,,0] ; NUL:? 15706 000757'01 254 00 0 00 000767' ifskp. ; No, do the page map for real 15707 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 15708 000760'01 120 02 0 00 002564' pm%wr!pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to reserve 15709 000761'01 104 00 0 00 000056 PMAP% ; And get ready to drop data into them 15710 000762'01 320 12 0 00 000764' %jserr (,$mdmpe) 15711 000763'01 254 00 0 00 000767' 15712 000764'01 265 01 0 00 000752* 15713 000765'01 000000000000# 15714 000766'01 254 00 0 00 001060' 15715 000416'04 125 156 141 142 154 15716 000767'01 endif. ; End setting up a real file 15717 15718 remark ; Set up loop context 15719 remark q1, ; Has JFN and flags 15720 000767'01 201 06 0 00 000007 movx q2, gcpgs ; Load pages in table psect 15721 15722 dmove q3, [ macorg ; Source is the macros .psect 15723 000770'01 120 07 0 00 002566' gcorg ] ; Destination is garbage collection .psect 15724 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20MAC MAC 30-Jun-23 17:21 Loop to map out pages appropriately 15725 subttl Loop to map out pages appropriately 15726 15727 000771'01 do. ; Enter loop context 15728 000771'01 200 01 0 00 000007 move t1, q3 ; Load current macros address 15729 000772'01 242 01 0 00 777767 lsh t1, -^d9 ; Turn into a page number 15730 000773'01 505 01 0 00 400000 hrli t1, .fhslf ; This process 15731 000774'01 104 00 0 00 000057 RPACS% ; Find out what's in there 15732 000775'01 320 12 0 00 000777' ifje. r ; Catch and ignore error 15733 000776'01 254 00 0 00 001000' 15734 000777'01 400 02 0 00 000000 setz t2, ; Assume the page doesn't exist 15735 001000'01 endif. 15736 001000'01 607 02 0 00 010000 ifxn. t2, pa%pex ; Does the page exist? 15737 001001'01 254 00 0 00 001007' 15738 001002'01 607 02 0 00 100000 andxn. t2, pa%rd ; *AND* ... Can we read it? 15739 001003'01 254 00 0 00 001007' 15740 001004'01 201 01 0 00 001000 movei t1, ^d512 ; Yep, load the eternal page size 15741 001005'01 120 02 0 00 000007 dmove t2, q3 ; Load source and destination address 15742 001006'01 123 01 0 00 002501' xblt. t1 ; And put into the macros psect 15743 001007'01 endif. 15744 001007'01 363 06 0 00 001012' sojle q2, endlp. ; Exit when nothing left to do 15745 001010'01 114 07 0 00 002570' dadd q3, [exp ^d512,^d512 ] ; Step to next set of addresses 15746 001011'01 254 00 0 00 000771' loop. 15747 001012'01 enddo. ; Exit loop lexical context 15748 15749 remark ; Loop exit post processing 15750 15751 remark PMAP% Case IV: deleting process memory (but not really) 15752 001012'01 474 01 0 00 000000 seto t1, ; Don't want anything in gc .psect 15753 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 15754 001013'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to remove 15755 001014'01 104 00 0 00 000056 PMAP% ; Kick them all over to DDMP 15756 001015'01 320 12 0 00 001017' %jserr (,$mdmpe) 15757 001016'01 254 00 0 00 001022' 15758 001017'01 265 01 0 00 000764* 15759 001020'01 000000000000# 15760 001021'01 254 00 0 00 001060' 15761 000427'04 125 156 141 142 154 15762 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20MAC MAC 30-Jun-23 17:21 Loop to map out pages appropriately 15763 remark Binary file Epilogue 15764 15765 001022'01 550 01 0 00 000005 hrrz t1, q1 ; Load the file JFN 15766 001023'01 306 01 0 00 377777 cain t1, .nulio ; NUL:? 15767 001024'01 254 00 0 00 001054' ifskp. ; No, a real file 15768 001025'01 661 01 0 00 400000 txo t1, co%nrj ; Keep the JFN 15769 001026'01 104 00 0 00 000022 CLOSF% ; Close the file, mostly 15770 001027'01 320 12 0 00 001031' %jsErr (, $mdmpe) 15771 001030'01 254 00 0 00 001034' 15772 001031'01 265 01 0 00 001017* 15773 001032'01 000000000000# 15774 001033'01 254 00 0 00 001060' 15775 000437'04 125 156 141 142 154 15776 001034'01 505 01 0 00 000012 hrli t1, .fbsiz ; Set the number of macros as bytes 15777 001035'01 474 02 0 00 000000 seto t2, ; Changing all the bits in the word 15778 001036'01 554 03 0 00 000000# hlrz t3, mactab ; Load current macro count 15779 001037'01 104 00 0 00 000064 CHFDB% ; Set that for the curious 15780 001040'01 320 12 0 00 001042' %jsErr (,) 15781 001041'01 254 00 0 00 001045' 15782 001042'01 265 01 0 00 001031* 15783 001043'01 000000000000# 15784 001044'01 254 00 0 00 001045' 15785 000446'04 125 156 141 142 154 15786 001045'01 550 01 0 00 000005 hrrz t1, q1 ; Load the JFN one last time 15787 001046'01 104 00 0 00 000023 RLJFN% ; And toss it 15788 001047'01 320 12 0 00 001051' %jsErr (,) 15789 001050'01 254 00 0 00 001054' 15790 001051'01 265 01 0 00 001042* 15791 001052'01 000000000000# 15792 001053'01 254 00 0 00 001054' 15793 000460'04 125 156 141 142 154 15794 001054'01 endif. ; End case not NUL: 15795 15796 001054'01 200 01 0 00 000000# txmsg 15797 001055'01 104 00 0 00 000076 15798 001056'01 320 12 0 00 001057' 15799 000046'02 000000000000# 15800 000471'04 127 162 157 164 145 15801 001057'01 254 00 0 00 002070' callret $msumm ; Give us some summary information 15802 remark ret ; $msumm returns for us 15803 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20MAC MAC 30-Jun-23 17:21 Error handling 15804 subttl Error handling 15805 15806 001060'01 $mdmpe: remark ; Here to handle errors 15807 001060'01 474 01 0 00 000000 seto t1, ; Case IV, deleting process memory 15808 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 15809 001061'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to toss 15810 001062'01 104 00 0 00 000056 PMAP% ; Trim our working set 15811 001063'01 320 12 0 00 001065' %jserr (,) 15812 001064'01 254 00 0 00 001070' 15813 001065'01 265 01 0 00 001051* 15814 001066'01 000000000000# 15815 001067'01 254 00 0 00 001070' 15816 000473'04 102 151 156 141 162 15817 15818 001070'01 332 01 0 00 000005 skipe t1, q1 ; Didn't have a JFN? 15819 001071'01 260 17 0 00 000000* call frclos ; We did, go get rid of it 15820 001072'01 600 00 0 00 000000 nop ; Ignore any goofy error 15821 001073'01 263 17 0 00 000000 ret ; Done 15822 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20MAC MAC 30-Jun-23 17:21 Parse the /MAP switch 15823 subttl Parse the /MAP switch 15824 15825 ; Tries for a device first as this is more efficient for NUL: and 15826 ; catches more errors earlier and more easily. 15827 15828 ; Default command filespec fields for .CMFIL: 15829 15830 001074'01 100020 000000 mapbk: gj%flg!gj%old ; Must be existing file. 15831 repeat 4,<0> ; Normal defaults for dev:name. 15832 001075'01 000000 000000 15833 001076'01 000000 000000 15834 001077'01 000000 000000 15835 001100'01 000000 000000 15836 001101'01 000000000000# eascii () ; Default extension is .BIN. 15837 000505'04 102 111 116 000 000 15838 001102'01 000000000000# 0 ; Default protection, 15839 001103'01 000000 000000 0 ; and account. 15840 000010 mapbkl==<.-mapbk> ; Length of this GTJFN argument block. 15841 15842 001104'01 265 16 0 00 002466' .mmap: saveac ; Protect some registers 15843 001105'01 200 01 0 00 002537' movx t1, cz%ncl!.fhslf ; Release non-open JFN's on reparse 15844 001106'01 104 00 0 00 000034 CLZFF% 15845 001107'01 320 12 0 00 001110' erjmpr .+1 ; Catch and ignore errors 15846 001110'01 200 16 0 00 000000# guide 15847 001111'01 260 17 0 00 000576* 15848 000047'02 000000000000# 15849 000506'04 142 151 156 141 162 15850 001112'01 200 01 0 00 002572' move t1, [mapbk,,cjfnbk] ; Insert our file parsing defaults. 15851 001113'01 251 01 0 00 000000# blt t1, cjfnbk+mapbkl 15852 15853 movei t1, [ ; Catch bare device 15854 flddb. .cmfil,,,,,[ 15855 001114'01 201 01 0 00 002602' flddb. .cmdev,cm%sdh,,,,]] 15856 001115'01 260 17 0 00 000602* call rfield ; Ask them to supply the file 15857 001116'01 135 05 0 00 002440' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 15858 001117'01 200 06 0 00 000002 move q2, t2 ; Save parsed data (device or JFN) 15859 15860 001120'01 200 01 0 00 000006 move t1, q2 ; Load parse item for DVCHR% 15861 001121'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 15862 001122'01 621 01 0 00 777777 tlz t1, -1 ; Shut off flags so DVCHR% doesn't choke 15863 001123'01 104 00 0 00 000117 DVCHR% ; and find out about it 15864 001124'01 320 12 0 00 001126' %jserr (,r) 15865 001125'01 254 00 0 00 001131' 15866 001126'01 265 01 0 00 001065* 15867 001127'01 000000000000# 15868 001130'01 254 00 0 00 000615* 15869 000512'04 125 156 141 142 154 15870 001131'01 135 07 0 00 002554' ldb q3, [pointr t2, dv%typ] ; Pick up the device type 15871 15872 001132'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 15873 001133'01 254 00 0 00 001162' ifskp. ; Yes, see what it is 15874 001134'01 302 07 0 00 000015 caie q3, .dvnul ; NUL:? 15875 001135'01 254 00 0 00 001142' ifskp. ; Yes, we can simulate that 15876 001136'01 260 17 0 00 000665* confrm ; Confirm the selection 15877 001137'01 200 01 0 00 002555' movx t1, ;Use special designator and flags k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20MAC MAC 30-Jun-23 17:21 Parse the /MAP switch 15878 001140'01 202 01 0 00 000732* movem t1, pars2 ; Store the JFN and (phoney) flags 15879 001141'01 263 17 0 00 000000 ret ; Done with this special case 15880 001142'01 endif. ; Any other device is NOT VALID 15881 15882 001142'01 302 07 0 00 000000 caie q3, .dvdsk ; Bare device? 15883 001143'01 254 00 0 00 001161' ifskp. ; Yes, but needs a file name 15884 001144'01 200 01 0 00 000000# emsg ; First part of blat 15885 001145'01 104 00 0 00 000313 15886 000050'02 000000000000# 15887 000525'04 124 150 145 040 000 15888 001146'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 15889 001147'01 201 01 0 00 000101 movei t1, .priou ; Output to terminal 15890 001150'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 15891 001151'01 320 12 0 00 001153' %jserr (,cmder1) 15892 001152'01 254 00 0 00 001156' 15893 001153'01 265 01 0 00 001126* 15894 001154'01 000000000000# 15895 001155'01 254 00 0 00 000730* 15896 000526'04 125 156 141 142 154 15897 001156'01 200 01 0 00 000000# emsg <: structure needs a file specification> 15898 001157'01 104 00 0 00 000313 15899 000051'02 000000000000# 15900 000537'04 072 040 163 164 162 15901 001160'01 254 00 0 00 001155* jrst cmder1 ; Allow reparse 15902 001161'01 endif. ; Any other device is NOT VALID 15903 15904 001161'01 254 00 0 00 001203' jrst .mmape ; Handle as a general parse error 15905 001162'01 endif. ; End case .cmdev 15906 15907 remark .cmfil ; Everything else is a file 15908 15909 001162'01 302 07 0 00 000015 caie q3, .dvnul ; A JFN on NUL:?? 15910 001163'01 254 00 0 00 001176' ifskp. ; Yes, we can simulate that 15911 001164'01 260 17 0 00 001136* confrm ; Confirm the selection 15912 001165'01 200 01 0 00 000006 move t1, q2 ; Load parsed JFN 15913 001166'01 260 17 0 00 000653* call isnulj ; Convert it to a special JFN, releasing original 15914 001167'01 334 01 0 00 000000# ermsg% (,cmder1) ; Allow ^H 15915 001170'01 254 00 0 00 001174' 15916 001171'01 202 01 0 00 000656* 15917 001172'01 104 00 0 00 000313 15918 001173'01 254 00 0 00 001160* 15919 000052'02 000000000000# 15920 000547'04 113 105 122 115 111 15921 15922 001174'01 202 01 0 00 001140* movem t1, pars2 ; Store the JFN and original parse flags 15923 001175'01 263 17 0 00 000000 ret ; Done with this second special NUL: case 15924 001176'01 endif. 15925 15926 001176'01 302 07 0 00 000000 caie q3, .dvdsk ; Was this a structure? 15927 001177'01 254 00 0 00 001203' jrst .mmape ; No, any other device is NOT VALID 15928 15929 001200'01 260 17 0 00 001164* confrm ; Otherwise, fine; confirm selection 15930 001201'01 202 06 0 00 001174* movem q2, pars2 ; Store the JFN and flags 15931 001202'01 263 17 0 00 000000 ret ; Done with the parse 15932 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20MAC MAC 30-Jun-23 17:21 Parse the /MAP switch 15933 remark Here for common parse errors 15934 15935 001203'01 200 01 0 00 000000# .mmape: emsg ; Begin whining 15936 001204'01 104 00 0 00 000313 15937 000053'02 000000000000# 15938 000561'04 124 150 145 040 000 15939 15940 001205'01 201 01 0 00 000101 movei t1, .priou ; Output to terminal, always 15941 001206'01 302 05 0 00 000016 caie q1, .cmdev ; Device? 15942 001207'01 254 00 0 00 001220' ifskp. ; Yes, use DEVST% 15943 001210'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 15944 001211'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 15945 001212'01 320 12 0 00 001214' %jserr (,cmder1) 15946 001213'01 254 00 0 00 001217' 15947 001214'01 265 01 0 00 001153* 15948 001215'01 000000000000# 15949 001216'01 254 00 0 00 001173* 15950 000562'04 125 156 141 142 154 15951 001217'01 254 00 0 00 001230' else. ; Otherwise, DEVST% will choke on the JFN 15952 001220'01 550 02 0 00 000006 hrrz t2, q2 ; Load just the JFN 15953 dmove t3, [ ; Just want the device name, no punctuation 15954 fld(.jsaof,js%dev) 15955 001221'01 120 03 0 00 002556' 0 ] ; No odd prefix, whatever that is 15956 001222'01 104 00 0 00 000030 JFNS% ; Convert to something readable 15957 001223'01 320 12 0 00 001225' %jserr (,cmder1) 15958 001224'01 254 00 0 00 001230' 15959 001225'01 265 01 0 00 001214* 15960 001226'01 000000000000# 15961 001227'01 254 00 0 00 001216* 15962 000572'04 125 156 141 142 154 15963 001230'01 endif. ; Either way, error should be more informative 15964 15965 001230'01 200 01 0 00 000000# txmsg <: device does not have binary mapping capabilities> 15966 001231'01 104 00 0 00 000076 15967 001232'01 320 12 0 00 001233' 15968 000054'02 000000000000# 15969 000604'04 072 040 144 145 166 15970 001233'01 561 01 0 00 000720* hrroi t1, crlf ; Newline 15971 001234'01 104 00 0 00 000076 PSOUT% ; Tie off the blat 15972 001235'01 320 12 0 00 001236' erjmpr .+1 ; Catch and ignore that error, too 15973 15974 001236'01 302 05 0 00 000006 caie q1, .cmfil ; Had we parsed a file, actually? 15975 001237'01 254 00 0 00 001243' ifskp. ; Yes, then have a little clean up to do 15976 001240'01 550 01 0 00 000006 hrrz t1, q2 ; Load our poor JFN, sans flags 15977 001241'01 104 00 0 00 000023 RLJFN% ; Toss it; can't use it 15978 001242'01 320 12 0 00 001227* erjmpr cmder1 ; Ignore error and beat it 15979 001243'01 endif. 15980 15981 001243'01 254 00 0 00 001242* jrst cmder1 ; Allow ^H 15982 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20MAC MAC 30-Jun-23 17:21 Execute the /MAP switch 15983 subttl Execute the /MAP switch 15984 15985 001244'01 265 16 0 00 002466' $mmap: saveac ; Wants a few accumulators 15986 001245'01 403 05 0 00 000006 setzb q1, q2 ; Zero local JFN and input file size (pages) 15987 15988 001246'01 200 05 0 00 001201* move q1, pars2 ; Load the JFN and flags 15989 001247'01 550 01 0 00 000005 hrrz t1, q1 ; Look at just the JFN 15990 001250'01 306 01 0 00 377777 cain t1, .nulio ; Special cased? 15991 001251'01 254 00 0 00 001405' jrst $mmapn ; Yes, go do it 15992 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20MAC MAC 30-Jun-23 17:21 Set up and check to map a real binary file 15993 subttl Set up and check to map a real binary file 15994 15995 001252'01 104 00 0 00 000036 SIZEF% ; Find out about the file 15996 001253'01 320 12 0 00 001255' %jserr (,r) ; Go no further 15997 001254'01 254 00 0 00 001260' 15998 001255'01 265 01 0 00 001225* 15999 001256'01 000000000000# 16000 001257'01 254 00 0 00 001130* 16001 000617'04 102 151 156 141 162 16002 001260'01 322 02 0 00 001405' jumpe t2, $mmapn ; No macros written? Assume empty, then 16003 001261'01 322 03 0 00 001405' jumpe t3, $mmapn ; Empty file? Treat as NUL: case 16004 16005 001262'01 303 02 0 00 000252 caile t2, macmax ; Too many macros? 16006 001263'01 334 00 0 00 000000 %ermsg (,$mmape) 16007 001264'01 254 00 0 00 001270' 16008 001265'01 265 01 0 00 001255* 16009 001266'01 000000000000# 16010 001267'01 254 00 0 00 001401' 16011 000630'04 124 157 157 040 155 16012 001270'01 303 03 0 00 000007 caile t3, macpgs ; Too large? 16013 001271'01 334 00 0 00 000000 %ermsg (,$mmape) 16014 001272'01 254 00 0 00 001276' 16015 001273'01 265 01 0 00 001265* 16016 001274'01 000000000000# 16017 001275'01 254 00 0 00 001401' 16018 000641'04 102 151 156 141 162 16019 001276'01 200 06 0 00 000003 move q2, t3 ; Save binary file size (in pages) 16020 ; Read-Only, force open even if PMAP%'ed 16021 001277'01 200 02 0 00 002605' movx t2, 16022 001300'01 104 00 0 00 000021 OPENF% ; Try to open the file 16023 001301'01 320 12 0 00 001303' %jserr (,$mmape) 16024 001302'01 254 00 0 00 001306' 16025 001303'01 265 01 0 00 001273* 16026 001304'01 000000000000# 16027 001305'01 254 00 0 00 001401' 16028 000650'04 125 156 141 142 154 16029 16030 remark PMAP% Case IV, deleting process memory 16031 001306'01 474 01 0 00 000000 seto t1, ; Don't want anything in gc .psect 16032 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 16033 001307'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to toss 16034 001310'01 104 00 0 00 000056 PMAP% ; Kick them all into oblivion 16035 001311'01 320 12 0 00 001313' %jserr (,$mmape) 16036 001312'01 254 00 0 00 001316' 16037 001313'01 265 01 0 00 001303* 16038 001314'01 000000000000# 16039 001315'01 254 00 0 00 001401' 16040 000660'04 125 156 141 142 154 16041 16042 remark PMAP% Case IV, deleting process memory 16043 001316'01 474 01 0 00 000000 seto t1, ; Don't want anything in macros .psect 16044 dmove t2, [ .fhslf,,macpag ; This process, page number of macros psect 16045 001317'01 120 02 0 00 002606' pm%cnt!fld(macpgs,pm%rpt) ] ; Number of pages to toss 16046 001320'01 104 00 0 00 000056 PMAP% ; Kick them all into oblivion 16047 001321'01 320 12 0 00 001323' %jserr (,$mmapi) k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-1 K20MAC MAC 30-Jun-23 17:21 Set up and check to map a real binary file 16048 001322'01 254 00 0 00 001326' 16049 001323'01 265 01 0 00 001313* 16050 001324'01 000000000000# 16051 001325'01 254 00 0 00 001410' 16052 000671'04 125 156 141 142 154 16053 16054 remark PMAP% Case I: Mapping File Pages to a Process 16055 001326'01 514 01 0 00 000005 hrlz t1, q1 ; File JFN, starting from page zero 16056 001327'01 200 02 0 00 002561' movx t2, <.fhslf,, gcpag> ; Put them into the *garbage collection* area 16057 001330'01 200 03 0 00 000006 move t3, q2 ; Get page count 16058 001331'01 302 03 0 00 000001 caie t3, ^d1 ; Only a single page? 16059 001332'01 661 03 0 00 400000 txo t3, pm%cnt ; No, turn on repeat (slower, even for 1 page) 16060 001333'01 661 03 0 00 110000 txo t3, pm%rd!pm%pld ; Get them all in fast 16061 001334'01 104 00 0 00 000056 PMAP% ; And do the I/O 16062 001335'01 320 12 0 00 001337' %jserr (,$mmapi) 16063 001336'01 254 00 0 00 001342' 16064 001337'01 265 01 0 00 001323* 16065 001340'01 000000000000# 16066 001341'01 254 00 0 00 001410' 16067 000704'04 125 156 141 142 154 16068 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20MAC MAC 30-Jun-23 17:21 Loop to copy pages appropriately 16069 subttl Loop to copy pages appropriately 16070 16071 ; Do we have to check the file page if there's nothing there or the memory? 16072 16073 001342'01 200 04 0 00 000006 move t4, q2 ; Load size as a count 16074 dmove q3, [ gcorg ; Source is garbage collection .psect 16075 001343'01 120 07 0 00 002610' macorg ] ; Destination is the macros .psect 16076 16077 001344'01 do. ; Enter loop context 16078 001344'01 200 01 0 00 000007 move t1, q3 ; Load current gc address 16079 001345'01 242 01 0 00 777767 lsh t1, -^d9 ; Turn into a page number 16080 001346'01 505 01 0 00 400000 hrli t1, .fhslf ; This process 16081 001347'01 104 00 0 00 000057 RPACS% ; Find out what's in there 16082 001350'01 320 12 0 00 001352' ifje. r ; Catch and ignore error 16083 001351'01 254 00 0 00 001353' 16084 001352'01 400 02 0 00 000000 setz t2, ; Assume the page doesn't exist 16085 001353'01 endif. 16086 001353'01 607 02 0 00 010000 ifxn. t2, pa%pex ; Does the page exist? 16087 001354'01 254 00 0 00 001362' 16088 001355'01 607 02 0 00 100000 andxn. t2, pa%rd ; *AND* ... Can we read it? 16089 001356'01 254 00 0 00 001362' 16090 001357'01 201 01 0 00 001000 movei t1, ^d512 ; Yep, load the eternal page size 16091 001360'01 120 02 0 00 000007 dmove t2, q3 ; Load source and destination address 16092 001361'01 123 01 0 00 002501' xblt. t1 ; And put into the macros psect 16093 001362'01 endif. 16094 001362'01 363 04 0 00 001365' sojle t4, endlp. ; Exit when nothing left to do 16095 001363'01 114 07 0 00 002570' dadd q3, [exp ^d512,^d512 ] ; Step to next set of addresses 16096 001364'01 254 00 0 00 001344' loop. ; And go around again 16097 001365'01 enddo. ; Exit loop lexical context 16098 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20MAC MAC 30-Jun-23 17:21 Loop to copy pages appropriately 16099 remark Binary input file Epilogue 16100 16101 remark Toss the file pages we mapped into the garbage collector 16102 dmove t1, [ -1 ; Case IV, deleting process memory 16103 001365'01 120 01 0 00 002612' .fhslf,,gcpag ] ; This process, page number of gc psect 16104 001366'01 200 03 0 00 000006 move t3, q2 ; Get page count 16105 001367'01 302 03 0 00 000001 caie t3, ^d1 ; Only a single page? 16106 001370'01 661 03 0 00 400000 txo t3, pm%cnt ; No, turn on repeat (slower, even for 1 page) 16107 001371'01 104 00 0 00 000056 PMAP% ; Get rid of them so we can close the file 16108 001372'01 320 12 0 00 001374' %jserr (,) ; Odd... but carry on 16109 001373'01 254 00 0 00 001377' 16110 001374'01 265 01 0 00 001337* 16111 001375'01 000000000000# 16112 001376'01 254 00 0 00 001377' 16113 000716'04 102 151 156 141 162 16114 001377'01 336 00 0 00 000000* skipn iniflg## ;[237] Don't blat if starting up 16115 001400'01 260 17 0 00 002070' call $msumm ; Give us some summary information 16116 16117 remark $mmape ; Falls through to close the JFN 16118 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20MAC MAC 30-Jun-23 17:21 Error handling, NUL: mapping special case and Initialization 16119 subttl Error handling, NUL: mapping special case and Initialization 16120 16121 001401'01 $mmape: remark ; Here if some other error 16122 001401'01 332 01 0 00 000005 skipe t1, q1 ; Didn't have a JFN? 16123 001402'01 260 17 0 00 001071* call frclos ; We did, go get rid of it 16124 001403'01 600 00 0 00 000000 nop ; Ignore any goofy error 16125 001404'01 263 17 0 00 000000 ret ; But leave the current macro table alone 16126 16127 001405'01 260 17 0 00 001410' $mmapn: call $mmapi ; Whack everything (types summary) 16128 001406'01 260 17 0 00 001401' call $mmape ; Toss any JFN's 16129 001407'01 263 17 0 00 000000 ret ; That was easy enough 16130 16131 001410'01 $mmapi: remark ; Here to initialize for mapping 16132 001410'01 260 17 0 00 001424' call $mrese ; Whack the macros .psect 16133 remark ; Toss anything in garbage collector 16134 001411'01 474 01 0 00 000000 seto t1, ; Case IV, deleting process memory 16135 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 16136 001412'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to toss 16137 001413'01 104 00 0 00 000056 PMAP% ; Trim our working set 16138 001414'01 320 12 0 00 001416' %jserr (,) ; Odd... but continue 16139 001415'01 254 00 0 00 001421' 16140 001416'01 265 01 0 00 001374* 16141 001417'01 000000000000# 16142 001420'01 254 00 0 00 001421' 16143 000725'04 102 151 156 141 162 16144 001421'01 263 17 0 00 000000 ret ; Done 16145 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20MAC MAC 30-Jun-23 17:21 Here to whack all the macros 16146 subttl Here to whack all the macros 16147 16148 remark parse the rest of /RESET 16149 16150 001422'01 260 17 0 00 001200* .mrese: confrm ; Just confirm 16151 001423'01 263 17 0 00 000000 ret ; Then return so we can get on with it 16152 16153 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20MAC MAC 30-Jun-23 17:21 Execute the /RESET 16154 subttl Execute the /RESET 16155 16156 001424'01 474 01 0 00 000000 $mrese: seto t1, ; Case IV, deleting process memory 16157 dmove t2, [ .fhslf,,macpag ; This process, page number of macros psect 16158 001425'01 120 02 0 00 002606' pm%cnt!fld(macpgs,pm%rpt) ] ; Number of pages to toss 16159 001426'01 104 00 0 00 000056 PMAP% ; Kick them all into oblivion 16160 001427'01 320 12 0 00 001431' ifje. r ; Failed?? 16161 001430'01 254 00 0 00 001444' 16162 001431'01 200 04 0 00 000001 move t4, t1 ; Save the error code 16163 001432'01 201 01 0 00 006777 movx t1, maclen-1 ; Whack the buffer the old fashioned way 16164 001433'01 402 00 0 00 011000 setzm macorg ; Stomp the first location to zero 16165 dmove t2, [ macorg ; Then transfering the first word 16166 001434'01 120 02 0 00 002614' macorg+1 ] ;To the second 16167 001435'01 123 01 0 00 002501' xblt. t1 ; It's turtles all the way down! 16168 001436'01 600 00 0 00 000000 nop ; Ignore the error, we're trying hard enough 16169 001437'01 334 00 0 00 000000 %ermsg (,) 16170 001440'01 254 00 0 00 001444' 16171 001441'01 265 01 0 00 001416* 16172 001442'01 000000000000# 16173 001443'01 254 00 0 00 001444' 16174 000737'04 103 157 165 154 144 16175 001444'01 endif. ; Not promising, but carry on 16176 16177 001444'01 402 00 0 00 000000# setzm onamp ; No previous pointer 16178 dmove t1, [ 0,,MACMAX ; TBLUK% table has no entries now 16179 001445'01 120 01 0 00 002616' 0 ] ; Stomp the 2nd location, just in case 16180 001446'01 124 01 0 00 000000# dmovem t1, mactab ; Now have an empty table 16181 001447'01 200 01 0 00 002620' move t1,[point 7, macbuf] ; Point to beginning of macro storage 16182 001450'01 202 01 0 00 000000# movem t1, macbp ; Stomp into the new table 16183 emacro < 16184 remark ; Toss anything in the macro editor 16185 seto t1, ; Case IV, deleting process memory 16186 dmove t2, [ .fhslf,,medpg ; This process, page number of medit psect 16187 pm%cnt!fld(edpgs,pm%rpt) ] ; Number of pages to toss 16188 PMAP% ; Trim our working set 16189 %jserr (,) ; Odd... but continue 16190 >;; emacro 16191 remark $msumm ; They can do a /summary 16192 ; if they want to know 16193 001451'01 263 17 0 00 000000 ret 16194 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20MAC MAC 30-Jun-23 17:21 Parse the /SAVE switch 16195 subttl Parse the /SAVE switch 16196 16197 ; Tries for a device first as this is more efficient for NUL: and 16198 ; catches more errors earlier and more easily. 16199 16200 ; Default command filespec fields for .CMFIL: 16201 16202 001452'01 600020 777777 savbk: gj%flg!gj%fou!gj%new!fld(.gjnhg,.rhalf) ; .GJGEN 16203 001453'01 000100 000101 .priin,,.priou ; .GJSRC (ignored if COMND%) 16204 001454'01 000000 000000 0 ; .GJDEV (do not default the device) 16205 001455'01 000000 000000 0 ; .GJDIR (do not default the directory) 16206 001456'01 000000 000000 0 ; .GJNAM (do not default the name) 16207 001457'01 000000000000# eascii () ; .GJEXT (default extension is .CMD) 16208 000750'04 103 115 104 000 000 16209 001460'01 000000000000# 0 ; .GJPRO (use system default protection) 16210 001461'01 000000 000000 0 ; .GJACT (use job's current account) 16211 000010 savbkl==<.-savbk> ; Length of this GTJFN argument block. 16212 16213 001462'01 265 16 0 00 002466' .msave: saveac ; Protect some registers 16214 001463'01 200 01 0 00 002537' movx t1, cz%ncl!.fhslf ; Release non-open JFN's on reparse 16215 001464'01 104 00 0 00 000034 CLZFF% 16216 001465'01 320 12 0 00 001466' erjmpr .+1 ; Catch and ignore errors 16217 001466'01 200 16 0 00 000000# guide 16218 001467'01 260 17 0 00 001111* 16219 000055'02 000000000000# 16220 000751'04 155 141 143 162 157 16221 001470'01 200 01 0 00 002621' move t1, [savbk,,cjfnbk] ; Insert our file parsing defaults. 16222 001471'01 251 01 0 00 000000# blt t1, cjfnbk+savbkl 16223 16224 movei t1, [ ; Catch bare device 16225 flddb. .cmfil,,,,,[ 16226 001472'01 201 01 0 00 002627' flddb. .cmdev,cm%sdh,,,,]] 16227 001473'01 260 17 0 00 001115* call rfield ; Ask them to supply the file 16228 001474'01 135 05 0 00 002440' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 16229 001475'01 200 06 0 00 000002 move q2, t2 ; Save parsed data (device or JFN) 16230 16231 001476'01 200 01 0 00 000006 move t1, q2 ; Load parse item for DVCHR% 16232 001477'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 16233 001500'01 621 01 0 00 777777 tlz t1, -1 ; Shut off flags so DVCHR% doesn't choke 16234 001501'01 104 00 0 00 000117 DVCHR% ; and find out about it 16235 001502'01 320 12 0 00 001504' %jserr (,r) 16236 001503'01 254 00 0 00 001507' 16237 001504'01 265 01 0 00 001441* 16238 001505'01 000000000000# 16239 001506'01 254 00 0 00 001257* 16240 000756'04 125 156 141 142 154 16241 001507'01 200 10 0 00 000001 move q4, t1 ; Store the device designator 16242 001510'01 135 07 0 00 002554' ldb q3, [pointr t2, dv%typ] ; Pick up the device type 16243 16244 001511'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 16245 001512'01 254 00 0 00 001567' ifskp. ; Yes, see what it is 16246 001513'01 302 07 0 00 000012 caie q3, .dvtty ; A terminal? 16247 001514'01 254 00 0 00 001542' ifskp. ; Yes, maybe show the user what we'd write 16248 001515'01 550 01 0 00 000010 hrrz t1, q4 ; Load the terminal number 16249 001516'01 316 01 0 00 000000* camn t1, mytty ; Not mine? k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-1 K20MAC MAC 30-Jun-23 17:21 Parse the /SAVE switch 16250 001517'01 254 00 0 00 001536' ifskp. ; Nope, disallow it 16251 001520'01 200 01 0 00 000000# emsg 16252 001521'01 104 00 0 00 000313 16253 000056'02 000000000000# 16254 000771'04 131 157 165 040 141 16255 001522'01 201 01 0 00 000101 movei t1, .priou ; Text is coming out on the terminal 16256 001523'01 200 02 0 00 000006 move t2, q2 ; Load the device designator 16257 001524'01 104 00 0 00 000121 DEVST% ; Convert device to string 16258 001525'01 320 12 0 00 001527' %jserr (,r) 16259 001526'01 254 00 0 00 001532' 16260 001527'01 265 01 0 00 001504* 16261 001530'01 000000000000# 16262 001531'01 254 00 0 00 001506* 16263 000776'04 125 156 141 142 154 16264 001532'01 200 01 0 00 000000# txmsg <:> 16265 001533'01 104 00 0 00 000076 16266 001534'01 320 12 0 00 001535' 16267 000057'02 000000000000# 16268 001007'04 072 000 000 000 000 16269 001535'01 254 00 0 00 001243* jrst cmder1 ; Allow ^H 16270 001536'01 endif. 16271 001536'01 260 17 0 00 001422* confrm ; Confirm the selection 16272 001537'01 200 01 0 00 002632' movx t1, ;Use special designator and flags 16273 001540'01 202 01 0 00 001246* movem t1, pars2 ; Store the JFN and (phoney) flags 16274 001541'01 263 17 0 00 000000 ret ; Done with this special case 16275 001542'01 endif. ; Any other device is NOT VALID 16276 16277 001542'01 302 07 0 00 000015 caie q3, .dvnul ; NUL:? 16278 001543'01 254 00 0 00 001550' ifskp. ; Yes, we can simulate that 16279 001544'01 260 17 0 00 001536* confrm ; Confirm the selection 16280 001545'01 200 01 0 00 002555' movx t1, ;Use special designator and flags 16281 001546'01 202 01 0 00 001540* movem t1, pars2 ; Store the JFN and (phoney) flags 16282 001547'01 263 17 0 00 000000 ret ; Done with this special case 16283 001550'01 endif. ; Any other device is NOT VALID 16284 16285 001550'01 302 07 0 00 000000 caie q3, .dvdsk ; Bare device? 16286 001551'01 254 00 0 00 001566' ifskp. ; Yes, but needs a file name 16287 001552'01 200 01 0 00 000000# emsg ; First part of blat 16288 001553'01 104 00 0 00 000313 16289 000060'02 000000000000# 16290 001010'04 124 150 145 040 000 16291 001554'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 16292 001555'01 201 01 0 00 000101 movei t1, .priou ; Output to the terminal 16293 001556'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 16294 001557'01 320 12 0 00 001561' %jserr (,cmder1) 16295 001560'01 254 00 0 00 001564' 16296 001561'01 265 01 0 00 001527* 16297 001562'01 000000000000# 16298 001563'01 254 00 0 00 001535* 16299 001011'04 125 156 141 142 154 16300 001564'01 200 01 0 00 000000# sxtext (t1,<: structure needs a file specification>) 16301 000061'02 000000000000# 16302 001022'04 072 040 163 164 162 16303 001565'01 254 00 0 00 001563* jrst cmder1 ; Allow reparse 16304 001566'01 endif. ; Any other device is NOT VALID k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-2 K20MAC MAC 30-Jun-23 17:21 Parse the /SAVE switch 16305 16306 001566'01 254 00 0 00 001647' jrst .msve ; Otherwise, handle as a general parse error 16307 001567'01 endif. ; End case .cmdev 16308 16309 remark .cmfil ; Everything else is a file 16310 16311 001567'01 302 07 0 00 000012 caie q3, .dvtty ; A JFN on a terminal? 16312 001570'01 254 00 0 00 001626' ifskp. ; Yes, maybe show the user what we'd write 16313 001571'01 550 01 0 00 000010 hrrz t1, q4 ; Load the terminal number 16314 001572'01 312 01 0 00 001516* came t1, mytty ; Mine? 16315 001573'01 254 00 0 00 001600' ifskp. ; Yep 16316 001574'01 550 01 0 00 000006 hrrz t1, q2 ; Load the JFN 16317 001575'01 104 00 0 00 000023 RLJFN% ; Punt it, we won't be using it 16318 001576'01 320 12 0 00 001577' erjmpr .+1 ; Just strange... 16319 001577'01 254 00 0 00 001622' else. ; Nope, disallow it 16320 001600'01 200 01 0 00 000000# emsg 16321 001601'01 104 00 0 00 000313 16322 000062'02 000000000000# 16323 001032'04 131 157 165 040 141 16324 001602'01 201 01 0 00 000101 movei t1, .priou ; Text is coming out on the terminal 16325 001603'01 550 02 0 00 000006 hrrz t2, q2 ; Load just the JFN 16326 dmove t3, [ ; DEVST% will choke on a JFN... 16327 fld(.jsaof,js%dev) ;Just want the device name, no punctuation 16328 001604'01 120 03 0 00 002556' 0 ] ; No odd prefix, whatever that is 16329 001605'01 104 00 0 00 000030 JFNS% ; Convert to something readable 16330 001606'01 320 12 0 00 001610' %jserr (,cmder1) 16331 001607'01 254 00 0 00 001613' 16332 001610'01 265 01 0 00 001561* 16333 001611'01 000000000000# 16334 001612'01 254 00 0 00 001565* 16335 001037'04 125 156 141 142 154 16336 001613'01 200 01 0 00 000000# txmsg <:> 16337 001614'01 104 00 0 00 000076 16338 001615'01 320 12 0 00 001616' 16339 000063'02 000000000000# 16340 001051'04 072 000 000 000 000 16341 001616'01 550 01 0 00 000006 hrrz t1, q2 ; Load the JFN 16342 001617'01 104 00 0 00 000023 RLJFN% ; Chuck it, we can't use it 16343 001620'01 320 12 0 00 001621' erjmpr .+1 ; Just strange... 16344 001621'01 254 00 0 00 001612* jrst cmder1 ; Allow ^H 16345 001622'01 endif. 16346 16347 001622'01 260 17 0 00 001544* confrm ; Confirm the selection 16348 001623'01 200 01 0 00 002632' movx t1, ;Use special designator and flags 16349 001624'01 202 01 0 00 001546* movem t1, pars2 ; Store the JFN and (phoney) flags 16350 001625'01 263 17 0 00 000000 ret ; Done with this special case 16351 001626'01 endif. ; Any other terminal is NOT valid 16352 16353 001626'01 302 07 0 00 000015 caie q3, .dvnul ; A JFN on NUL:?? 16354 001627'01 254 00 0 00 001642' ifskp. ; Yes, we can simulate that 16355 001630'01 260 17 0 00 001622* confrm ; Confirm the selection 16356 001631'01 200 01 0 00 000006 move t1, q2 ; Load parsed JFN 16357 001632'01 260 17 0 00 001166* call isnulj ; Convert it to a special JFN, releasing original 16358 001633'01 334 01 0 00 000000# ermsg% (,cmder1) ; Allow ^H 16359 001634'01 254 00 0 00 001640' k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-3 K20MAC MAC 30-Jun-23 17:21 Parse the /SAVE switch 16360 001635'01 202 01 0 00 001171* 16361 001636'01 104 00 0 00 000313 16362 001637'01 254 00 0 00 001621* 16363 000064'02 000000000000# 16364 001052'04 113 105 122 115 111 16365 16366 001640'01 202 01 0 00 001624* movem t1, pars2 ; Store the JFN and original parse flags 16367 001641'01 263 17 0 00 000000 ret ; Done with this second special NUL: case 16368 001642'01 endif. 16369 16370 001642'01 302 07 0 00 000000 caie q3, .dvdsk ; Was this a structure? 16371 001643'01 254 00 0 00 001647' jrst .msve ; No, any other device is NOT VALID 16372 16373 001644'01 260 17 0 00 001630* confrm ; Otherwise, fine; confirm selection 16374 001645'01 202 06 0 00 001640* movem q2, pars2 ; Store the JFN and flags 16375 001646'01 263 17 0 00 000000 ret ; Done with the parse 16376 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20MAC MAC 30-Jun-23 17:21 Parse the /SAVE switch 16377 remark Here for common parse errors 16378 16379 001647'01 200 01 0 00 000000# .msve: emsg ; Begin whining 16380 001650'01 104 00 0 00 000313 16381 000065'02 000000000000# 16382 001064'04 124 150 145 040 000 16383 16384 001651'01 201 01 0 00 000101 movei t1, .priou ; Output to terminal, always 16385 001652'01 302 05 0 00 000016 caie q1, .cmdev ; Device? 16386 001653'01 254 00 0 00 001664' ifskp. ; Yes, use DEVST% 16387 001654'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 16388 001655'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 16389 001656'01 320 12 0 00 001660' %jserr (,cmder1) 16390 001657'01 254 00 0 00 001663' 16391 001660'01 265 01 0 00 001610* 16392 001661'01 000000000000# 16393 001662'01 254 00 0 00 001637* 16394 001065'04 125 156 141 142 154 16395 001663'01 254 00 0 00 001674' else. ; Otherwise, DEVST% will choke on the JFN 16396 001664'01 550 02 0 00 000006 hrrz t2, q2 ; Load just the JFN 16397 dmove t3, [ ; Just want the device name, no punctuation 16398 fld(.jsaof,js%dev) 16399 001665'01 120 03 0 00 002556' 0 ] ; No odd prefix, whatever that is 16400 001666'01 104 00 0 00 000030 JFNS% ; Convert to something readable 16401 001667'01 320 12 0 00 001671' %jserr (,cmder1) 16402 001670'01 254 00 0 00 001674' 16403 001671'01 265 01 0 00 001660* 16404 001672'01 000000000000# 16405 001673'01 254 00 0 00 001662* 16406 001075'04 125 156 141 142 154 16407 001674'01 endif. ; Either way, error should be more informative 16408 16409 001674'01 200 01 0 00 000000# txmsg <: device is not valid for saving macros> 16410 001675'01 104 00 0 00 000076 16411 001676'01 320 12 0 00 001677' 16412 000066'02 000000000000# 16413 001107'04 072 040 144 145 166 16414 001677'01 561 01 0 00 001233* hrroi t1, crlf ; Newline 16415 001700'01 104 00 0 00 000076 PSOUT% ; Tie off the blat 16416 001701'01 320 12 0 00 001702' erjmpr .+1 ; Catch and ignore that error, too 16417 16418 001702'01 302 05 0 00 000006 caie q1, .cmfil ; Had we parsed a file, actually? 16419 001703'01 254 00 0 00 001707' ifskp. ; Yes, then have a little clean up to do 16420 001704'01 550 01 0 00 000006 hrrz t1, q2 ; Load our poor JFN, sans flags 16421 001705'01 104 00 0 00 000023 RLJFN% ; Toss it; can't use it 16422 001706'01 320 12 0 00 001673* erjmpr cmder1 ; Ignore error and beat it 16423 001707'01 endif. 16424 16425 001707'01 254 00 0 00 001706* jrst cmder1 ; Allow ^H 16426 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20MAC MAC 30-Jun-23 17:21 Execute the /SAVE switch 16427 subttl Execute the /SAVE switch 16428 16429 ; Not that fast. If you want fast, use /DUMP 16430 16431 001710'01 265 16 0 00 002466' $msave: saveac ; Wants a few accumulators 16432 16433 001711'01 554 06 0 00 000000# hlrz q2, mactab ; Load the macro count 16434 001712'01 326 06 0 00 001717' ife. q2 ; BUT!! Anything to save, really? 16435 txmsg <% No macros to save 16436 001713'01 200 01 0 00 000000# > ; Give a mild scolding 16437 001714'01 104 00 0 00 000076 16438 001715'01 320 12 0 00 001716' 16439 000067'02 000000000000# 16440 001117'04 045 040 116 157 040 16441 16442 001716'01 254 00 0 00 002062' jrst $msve ; And go flush the JFN 16443 001717'01 endif. 16444 16445 001717'01 200 05 0 00 001645* move q1, pars2 ; Load the JFN and flags 16446 001720'01 550 01 0 00 000005 hrrz t1, q1 ; Look at just the JFN 16447 001721'01 306 01 0 00 377777 cain t1, .nulio ; Special cased? 16448 001722'01 254 00 0 00 001734' ifskp. ; No, we're going to have to open it 16449 001723'01 306 01 0 00 000101 cain t1, .priou ; Unless it is primary output 16450 001724'01 254 00 0 00 001734' anskp. ; It is, don't bother 16451 001725'01 200 02 0 00 002633' movx t2, 16452 001726'01 104 00 0 00 000021 OPENF% ; Try to create the file 16453 001727'01 320 12 0 00 001731' %jserr (,$msve) 16454 001730'01 254 00 0 00 001734' 16455 001731'01 265 01 0 00 001671* 16456 001732'01 000000000000# 16457 001733'01 254 00 0 00 002062' 16458 001124'04 125 156 141 142 154 16459 001734'01 endif. 16460 16461 remark t1, ; Either way, t1 has something SOUT% can use 16462 001734'01 400 04 0 00 000000 setz t4, ; For uncounted SOUT%, always stop on a NUL 16463 001735'01 201 07 0 00 000000# movei q3, mactab+1 ; Start at the beginning of the table 16464 16465 001736'01 do. ; Enter loop context 16466 001736'01 120 02 0 00 000000# dxtext (t2,) ; Issue the command (NOTE TRAILING SPACE!!) 16467 000070'02 000000000000# 16468 000071'02 777777 777771 16469 001132'04 144 145 146 151 156 16470 001737'01 104 00 0 00 000053 SOUT% ; Start out with that 16471 001740'01 320 12 0 00 001742' %jserr (,$msve) 16472 001741'01 254 00 0 00 001745' 16473 001742'01 265 01 0 00 001731* 16474 001743'01 000000000000# 16475 001744'01 254 00 0 00 002062' 16476 001134'04 125 156 141 142 154 16477 001745'01 554 02 0 07 000000 hlrz t2, (q3) ; Address of macro name 16478 001746'01 505 02 0 00 440700 hrli t2, (point 7,0) ; Turn into a section local pointer 16479 001747'01 400 03 0 00 000000 setz t3, ; Uncounted, stop on a NUL 16480 001750'01 104 00 0 00 000053 SOUT% ; Write that 16481 001751'01 320 12 0 00 001753' %jserr (,$msve) k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20MAC MAC 30-Jun-23 17:21 Execute the /SAVE switch 16482 001752'01 254 00 0 00 001756' 16483 001753'01 265 01 0 00 001742* 16484 001754'01 000000000000# 16485 001755'01 254 00 0 00 002062' 16486 001143'04 125 156 141 142 154 16487 001756'01 201 02 0 00 000040 movei t2, .chspc ; Seperate macro name and body 16488 001757'01 104 00 0 00 000051 BOUT% ; Emit the space 16489 001760'01 550 02 0 07 000000 hrrz t2, (q3) ; Address of macro body 16490 001761'01 505 02 0 00 440700 hrli t2, (point 7,0) ; Turn into a section local pointer 16491 001762'01 400 03 0 00 000000 setz t3, ; Uncounted, stop on a NUL 16492 001763'01 104 00 0 00 000053 SOUT% ; Write that 16493 001764'01 320 12 0 00 001766' %jserr (,$msve) 16494 001765'01 254 00 0 00 001771' 16495 001766'01 265 01 0 00 001753* 16496 001767'01 000000000000# 16497 001770'01 254 00 0 00 002062' 16498 001151'04 125 156 141 142 154 16499 remark ; All have CRLF 16500 001771'01 363 06 0 00 001773' sojle q2, endlp. ; At end? Then stop 16501 001772'01 344 07 0 00 001736' aoja q3, top. ; Otherwise, do next table entry 16502 001773'01 enddo. ; End loop lexical context 16503 16504 001773'01 306 01 0 00 377777 cain t1, .nulio ; Not writing to NUL:? 16505 001774'01 254 00 0 00 002015' ifskp. ; Nope, then we should have a byte count 16506 001775'01 306 01 0 00 000101 cain t1, .priou ; Unless it's primary output 16507 001776'01 254 00 0 00 002015' anskp. ; That won't have one, either 16508 001777'01 104 00 0 00 000043 RFPTR% ; See how much we've written 16509 002000'01 320 12 0 00 002002' %jsErr (, $msve) 16510 002001'01 254 00 0 00 002005' 16511 002002'01 265 01 0 00 001766* 16512 002003'01 000000000000# 16513 002004'01 254 00 0 00 002062' 16514 001157'04 125 156 141 142 154 16515 002005'01 200 07 0 00 000002 move q3, t2 ; Save the (non-negative) byte count 16516 002006'01 104 00 0 00 000022 CLOSF% ; Completely close the (disk) file 16517 002007'01 320 12 0 00 002011' %jsErr (, $msve) 16518 002010'01 254 00 0 00 002014' 16519 002011'01 265 01 0 00 002002* 16520 002012'01 000000000000# 16521 002013'01 254 00 0 00 002062' 16522 001166'04 125 156 141 142 154 16523 002014'01 254 00 0 00 002016' else. ; Neither NUL: nor TTY: will have byte counts 16524 002015'01 474 07 0 00 000000 seto q3, ; Flag that 16525 002016'01 endif. 16526 16527 002016'01 200 01 0 00 000000# txmsg 16528 002017'01 104 00 0 00 000076 16529 002020'01 320 12 0 00 002021' 16530 000072'02 000000000000# 16531 001174'04 127 162 157 164 145 16532 002021'01 201 01 0 00 000101 movei t1, .priou ; Typing to terminal 16533 002022'01 554 02 0 00 000000# hlrz t2, mactab ; Number of macros 16534 002023'01 201 03 0 00 000012 movei t3, ^d10 ; All numbers are in base ten 16535 002024'01 200 04 0 00 000002 move t4, t2 ; Save the count 16536 002025'01 104 00 0 00 000224 NOUT% k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-2 K20MAC MAC 30-Jun-23 17:21 Execute the /SAVE switch 16537 002026'01 320 14 0 00 000001 erjmps +1 ; Catch and suppress error 16538 002027'01 200 01 0 00 000000# txmsg < macro> ; Assume singular 16539 002030'01 104 00 0 00 000076 16540 002031'01 320 12 0 00 002032' 16541 000073'02 000000000000# 16542 001176'04 040 155 141 143 162 16543 002032'01 306 04 0 00 000001 cain t4, ^d1 ; BUT! Non-plural or zero? 16544 002033'01 254 00 0 00 002037' ifskp. ; Nope, have to inflect because we're grammatical 16545 002034'01 201 01 0 00 000163 movei t1, "s" ; Pluralizer 16546 002035'01 104 00 0 00 000074 PBOUT% ; Properly inflect 16547 002036'01 320 14 0 00 000001 erjmps +1 ; Catch and suppress error 16548 002037'01 endif. 16549 16550 002037'01 321 07 0 00 002057' ifge. q3 ; Could we count the data? 16551 002040'01 200 01 0 00 000000# txmsg <, > ; Yes, so type it 16552 002041'01 104 00 0 00 000076 16553 002042'01 320 12 0 00 002043' 16554 000074'02 000000000000# 16555 001200'04 054 040 000 000 000 16556 002043'01 201 01 0 00 000101 movei t1, .priou ; Typing to terminal 16557 002044'01 200 02 0 00 000007 move t2, q3 ; Number of characters written 16558 002045'01 104 00 0 00 000224 NOUT% 16559 002046'01 320 14 0 00 000001 erjmps +1 ; Catch and suppress error 16560 002047'01 200 01 0 00 000000# txmsg < character> ; Assume singular 16561 002050'01 104 00 0 00 000076 16562 002051'01 320 12 0 00 002052' 16563 000075'02 000000000000# 16564 001201'04 040 143 150 141 162 16565 002052'01 306 04 0 00 000001 cain t4, ^d1 ; BUT! Non-plural or zero? 16566 002053'01 254 00 0 00 002057' ifskp. ; Nope, have to inflect because we're grammatical 16567 002054'01 201 01 0 00 000163 movei t1, "s" ; Pluralizer 16568 002055'01 104 00 0 00 000074 PBOUT% ; Properly inflect 16569 002056'01 320 14 0 00 000001 erjmps +1 ; Catch and suppress error 16570 002057'01 endif. 16571 002057'01 endif. 16572 16573 002057'01 561 01 0 00 001677* hrroi t1, crlf ; Tie off the line 16574 002060'01 104 00 0 00 000076 PSOUT% 16575 16576 002061'01 263 17 0 00 000000 ret ; Finally done 16577 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20MAC MAC 30-Jun-23 17:21 Error handling 16578 subttl Error handling 16579 16580 002062'01 $msve: remark ; Here to handle errors 16581 002062'01 332 01 0 00 000005 skipe t1, q1 ; Didn't have a JFN? 16582 002063'01 260 17 0 00 001402* call frclos ; We did, go get rid of it 16583 002064'01 600 00 0 00 000000 nop ; Ignore any goofy error 16584 002065'01 263 17 0 00 000000 ret ; Done 16585 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20MAC MAC 30-Jun-23 17:21 Provide summary information 16586 subttl Provide summary information 16587 16588 002066'01 260 17 0 00 001644* .msumm: confrm ; Tie off the line 16589 002067'01 263 17 0 00 000000 ret 16590 16591 002070'01 200 01 0 00 000000# $msumm: txmsg 16592 002071'01 104 00 0 00 000076 16593 002072'01 320 12 0 00 002073' 16594 000076'02 000000000000# 16595 001204'04 115 141 143 162 157 16596 002073'01 201 01 0 00 000101 movei t1, .priou ; This terminal 16597 002074'01 554 02 0 00 000000# hlrz t2, mactab ; Load macro keyword table entries 16598 002075'01 200 04 0 00 000002 move t4, t2 ; Tuck that away for later 16599 002076'01 201 03 0 00 000012 movei t3, ^d10 ; It's in base ten 16600 002077'01 104 00 0 00 000224 NOUT% ; Type it 16601 002100'01 320 12 0 00 002102' %jserr (,) ; Dubious, but carry on 16602 002101'01 254 00 0 00 002105' 16603 002102'01 265 01 0 00 002011* 16604 002103'01 000000 000000 16605 002104'01 254 00 0 00 002105' 16606 002105'01 200 01 0 00 000000# txmsg < used, > 16607 002106'01 104 00 0 00 000076 16608 002107'01 320 12 0 00 002110' 16609 000077'02 000000000000# 16610 001206'04 040 165 163 145 144 16611 002110'01 201 01 0 00 000101 movei t1, .priou ; This terminal 16612 002111'01 550 02 0 00 000000# hrrz t2, mactab ; Load maximum macro keyword table entries 16613 002112'01 274 02 0 00 000004 sub t2, t4 ; Yields remaining 16614 002113'01 104 00 0 00 000224 NOUT% ; Type that 16615 002114'01 320 12 0 00 002116' %jserr (,) ; Sigh... Carry on 16616 002115'01 254 00 0 00 002121' 16617 002116'01 265 01 0 00 002102* 16618 002117'01 000000 000000 16619 002120'01 254 00 0 00 002121' 16620 txmsg < remaining. 16621 002121'01 200 01 0 00 000000# Available storage: > 16622 002122'01 104 00 0 00 000076 16623 002123'01 320 12 0 00 002124' 16624 000100'02 000000000000# 16625 001210'04 040 162 145 155 141 16626 16627 002124'01 260 17 0 00 002144' call $mchrs ; Get us some other table numbers 16628 002125'01 200 02 0 00 000001 move t2, t1 ; Load total storage 16629 002126'01 200 04 0 00 000001 move t4, t1 ; Save a copy 16630 002127'01 201 01 0 00 000101 movei t1, .priou ; This terminal 16631 002130'01 201 03 0 00 000012 movei t3, ^d10 ; Base ten 16632 002131'01 104 00 0 00 000224 NOUT% ; Convert to external and display 16633 002132'01 320 12 0 00 002133' erjmpr .+1 ; Catch and ignore error 16634 002133'01 200 01 0 00 000000# txmsg < character> ; Assume (rare) singular case) 16635 002134'01 104 00 0 00 000076 16636 002135'01 320 12 0 00 002136' 16637 000101'02 000000000000# 16638 001217'04 040 143 150 141 162 16639 002136'01 201 01 0 00 000163 movei t1,"s" ;[203] Load inflection 16640 002137'01 302 04 0 00 000001 caie t4,^d1 ;[203] Singular case? k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41-1 K20MAC MAC 30-Jun-23 17:21 Provide summary information 16641 002140'01 104 00 0 00 000074 PBOUT% ;[203] No, must inflect it 16642 16643 002141'01 561 01 0 00 002057* hrroi t1, crlf 16644 002142'01 104 00 0 00 000076 PSOUT% 16645 002143'01 263 17 0 00 000000 ret 16646 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20MAC MAC 30-Jun-23 17:21 Provide some table information to caller 16647 subttl Provide some table information to caller 16648 16649 ; Returns: 16650 ; 16651 ; t1/ characters available in macro table 16652 16653 002144'01 $mchrs: entry $mchrs ; Called by k20dsp 16654 002144'01 265 16 0 00 002634' saveac ; Be extra tidy 16655 16656 002145'01 201 01 0 00 000000# movei t1, macx ; Load end of macro table 16657 002146'01 200 02 0 00 000000# move t2, macbp ; Load end of macro expansions 16658 002147'01 554 03 0 00 000002 hlrz t3, t2 ; Load the byte pointer 16659 002150'01 302 03 0 00 440700 caie t3, 440700 ; On a word boundary? 16660 002151'01 271 02 0 00 000001 addi t2,^d1 ; No, round up a word 16661 002152'01 621 02 0 00 777777 tlz t2, -1 ; Shut off the byte pointer 16662 002153'01 274 01 0 00 000002 sub t1, t2 ; Calculate remaining words 16663 002154'01 221 01 0 00 000005 imuli t1, ^d5 ; Have total characters 16664 002155'01 263 17 0 00 000000 ret 16665 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20MAC MAC 30-Jun-23 17:21 Garbage collection 16666 subttl Garbage collection 16667 16668 remark Parsing 16669 16670 002156'01 260 17 0 00 002066* .mcomp: confrm ; Tie off the line 16671 002157'01 263 17 0 00 000000 ret ; Then get going on processing 16672 16673 remark Semantic action 16674 16675 extern ehptim ; Display elapsed processor ticks 16676 16677 002160'01 $mcomp: remark ; Garbage collection prologue 16678 002160'01 265 16 0 00 002466' saveac ; Will need some registers for control 16679 002161'01 200 01 0 00 000000# txmsg ; Set up for some blat 16680 002162'01 104 00 0 00 000076 16681 002163'01 320 12 0 00 002164' 16682 000102'02 000000000000# 16683 001222'04 102 145 146 157 162 16684 002164'01 260 17 0 00 002070' call $msumm ; Display macro table usage 16685 16686 002165'01 260 17 0 00 000000* call statim ; Record start time garbage collection run 16687 002166'01 201 01 0 00 000001 movx t1, .hprnt ; Request current CPU time used 16688 002167'01 104 00 0 00 000501 HPTIM% ; by this process 16689 002170'01 320 12 0 00 002172' %jserr (,r) ; Fail and don't do anything more 16690 002171'01 254 00 0 00 002175' 16691 002172'01 265 01 0 00 002116* 16692 002173'01 000000 000000 16693 002174'01 254 00 0 00 001531* 16694 002175'01 200 10 0 00 000001 move q4, t1 ; Store that 16695 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20MAC MAC 30-Jun-23 17:21 Garbage collection 16696 remark Set up loop context 16697 16698 remark ; First copy current macro .psect to the GC 16699 002176'01 554 05 0 00 000000# hlrz q1, mactab ; Save count of current entries 16700 002177'01 326 05 0 00 002204' ife. q1 ; Wait a second, is there anything to do? 16701 txmsg <% No macros, nothing to compact 16702 002200'01 200 01 0 00 000000# > ; Some minor scolding blat 16703 002201'01 104 00 0 00 000076 16704 002202'01 320 12 0 00 002203' 16705 000103'02 000000000000# 16706 001224'04 045 040 116 157 040 16707 16708 002203'01 263 17 0 00 000000 ret ; That all, we're done 16709 002204'01 endif. 16710 16711 002204'01 201 01 0 00 007000 movx t1, maclen ; Length of both .psect's 16712 dmove t2, [ macorg ; Source is first word of macro psect 16713 002205'01 120 02 0 00 002566' gcorg ] ; Destination is first word of gc psect 16714 002206'01 123 01 0 00 002501' xblt. t1 ; Copy entire macros psect to gc psect 16715 002207'01 600 00 0 00 000000 nop ; Ignore any skip nonsense 16716 002210'01 260 17 0 00 001424' call $mrese ; Now completely destroy the macros psect 16717 16718 002211'01 201 01 0 00 000001 movei t1, ^d1 ; Account for the header word 16719 002212'01 270 01 0 00 000005 add t1, q1 ; Only put back the TBLUK% entries 16720 dmove t2, [ gcorg ; Source is first word of gc psect (previous mactab 16721 002213'01 120 02 0 00 002610' macorg ] ; Destination is first word of macro psect 16722 002214'01 123 01 0 00 002501' xblt. t1 ; Only copy the in use part of the table 16723 002215'01 600 00 0 00 000000 nop ; Ignore any skip nonsense 16724 16725 002216'01 201 06 0 00 011001 movei q2, macorg+1 ; First slot in macro table 16726 dmove t1, [ gcorg ; Load first address of garbage collection 16727 002217'01 120 01 0 00 002610' macorg ] ; End first slot of macro table 16728 002220'01 317 01 0 00 000002 camg t1, t2 ; macros should be before garbage collection 16729 002221'01 250 01 0 00 000002 exch 1, t2 ; But they're not (??) 16730 002222'01 274 01 0 00 000002 sub t1, t2 ; Calculate address offset between tables 16731 002223'01 200 07 0 00 000001 move q3, t1 ; Store that 16732 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20MAC MAC 30-Jun-23 17:21 Garbage collection 16733 remark Get down to some serious byte banging 16734 16735 ; The garbage collection algorythm is trivial. We've copyed the entire 16736 ; macros psect to the gc psect, stomped the macros psect and then only 16737 ; copied the used entries in the keyword table back. 16738 ; 16739 ; Here, using the keyword table as a basis, we copy over each keyword 16740 ; and text that is pointed to by an entry and fix the pointers 16741 ; accordingly. Anything that doesn't get copied is orphaned data and 16742 ; is no longer necessary. Once this is done, we toss the gc psect. 16743 16744 002224'01 do. ; Enter loop 16745 002224'01 260 17 0 00 002321' call mkeycp ; Copy the keyword (macro name) 16746 002225'01 260 17 0 00 002336' call mtxtcp ; Copy the text of the macro over 16747 002226'01 271 06 0 00 000001 addi q2, ^d1 ; Step to next slot in macro table 16748 002227'01 367 05 0 00 002224' sojg q1, top. ; And do the remaining 16749 002230'01 enddo. ; End loop lexical context 16750 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20MAC MAC 30-Jun-23 17:21 Garbage collection 16751 remark Compact epilogue, displays more data 16752 16753 002230'01 201 01 0 00 000001 movx t1, .hprnt ; Request current CPU time 16754 002231'01 104 00 0 00 000501 HPTIM% ; now that we're done 16755 002232'01 320 12 0 00 002234' %jserr (,r) ; Fail and don't do anything more 16756 002233'01 254 00 0 00 002237' 16757 002234'01 265 01 0 00 002172* 16758 002235'01 000000 000000 16759 002236'01 254 00 0 00 002174* 16760 002237'01 315 01 0 00 000010 camge t1, q4 ; Did it wrap around 16761 002240'01 250 01 0 00 000010 exch t1, q4 ; It did, fix that 16762 002241'01 276 01 0 00 000010 subm t1, q4 ; Get and store the difference in HP ticks 16763 16764 002242'01 260 17 0 00 000000* call endtim ; Take a snapshot from right now 16765 002243'01 260 17 0 00 000000* call elptim ; Calculates elapsed time 16766 16767 002244'01 200 01 0 00 000000# txmsg ; Give interesting post blat 16768 002245'01 104 00 0 00 000076 16769 002246'01 320 12 0 00 002247' 16770 000104'02 000000000000# 16771 001233'04 101 146 164 145 162 16772 002247'01 260 17 0 00 002070' call $msumm ; Display macro table usage 16773 16774 002250'01 201 02 0 00 000000* movei t2, ewallt ; Load pointer to elapsed wall time 16775 002251'01 120 03 0 02 000017 dmove t3, .datus(t2) ; Load elapsed HPTIM% double word 16776 002252'01 434 03 0 00 000004 or t3, t4 ; Will print if either high or low order 16777 002253'01 322 03 0 00 002264' ifn. t3 ; Did this take any time, actually? 16778 002254'01 200 07 0 00 000003 move q3, t3 ; It did, so save as a talisman 16779 002255'01 200 01 0 00 000000# txmsg ; Seperate from characters cleared 16780 002256'01 104 00 0 00 000076 16781 002257'01 320 12 0 00 002260' 16782 000105'02 000000000000# 16783 001235'04 105 154 141 160 163 16784 002260'01 201 01 0 00 000101 movei t1, .priou ; Going to terminal 16785 002261'01 260 17 0 00 000000* call durtim ; Nicely print the duration 16786 002262'01 600 00 0 00 000000 nop ; Ignore any goofy return 16787 002263'01 254 00 0 00 002265' else. ; Else did nothing 16788 002264'01 400 07 0 00 000000 setz q3, ; So flag this 16789 002265'01 endif. ; End case positive elapsed time 16790 16791 ; Note a small hack for ehptim: it now takes a pointer to a signed 16792 ; double word instead a signed single word. It happens that we have 16793 ; the value in q4, that q3 is free, that there will never be any high 16794 ; order and that ehptim does not modify either one. Thus, we pass 16795 ; it a pointer to that double word accumulator pair and everything 16796 ; works fine. For the moment... Until something changes... 16797 16798 002265'01 323 10 0 00 002306' ifg. q4 ; Any CPU time taken? 16799 002266'01 322 07 0 00 002272' ifn. q3 ; Displayed any elapsed time? 16800 002267'01 200 01 0 00 000000# txmsg <, > ; Yes, space over 16801 002270'01 104 00 0 00 000076 16802 002271'01 320 12 0 00 002272' 16803 000106'02 000000000000# 16804 001237'04 054 040 000 000 000 16805 002272'01 endif. k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46-1 K20MAC MAC 30-Jun-23 17:21 Garbage collection 16806 002272'01 200 01 0 00 000000# txmsg ; Introduce processor blat 16807 002273'01 104 00 0 00 000076 16808 002274'01 320 12 0 00 002275' 16809 000107'02 000000000000# 16810 001240'04 103 120 125 072 040 16811 002275'01 201 01 0 00 000101 movei t1, .priou ; Going to terminal 16812 002276'01 201 02 0 00 000000# movei t2, mecpu ; Load pointer to macro elapsed CPU 16813 remark .datet ;[221] Don't touch!! This should ALWAYS be zero 16814 002277'01 400 07 0 00 000000 setz q3, ;[221] Clear double word of HP ticks (q3 untouched) 16815 002300'01 124 07 0 02 000017 dmovem q3, .datus(t2) ;[221] Store elapsed DK10 16816 002301'01 201 10 0 02 000017 movei q4, .datus(t2) ;[221] Now point to it 16817 002302'01 250 02 0 00 000010 exch t2, q4 ;[221] Pass in pointer to DK10 ticks, actually 16818 002303'01 400 03 0 00 000000 setz t3, ;[221] Don't suppress leading seconds 16819 002304'01 260 17 0 00 000000* call ehptim ; Display elapsed HP ticks 16820 002305'01 600 00 0 00 000000 nop ;[221] Ignore non-fatal +1 16821 002306'01 endif. ; End CPU display 16822 16823 002306'01 561 01 0 00 002141* hrroi t1, crlf ; Tie off the line 16824 002307'01 104 00 0 00 000076 PSOUT% 16825 16826 remark ; Now that we're done, don't need the gc psect 16827 002310'01 474 01 0 00 000000 seto t1, ; Case IV, deleting process memory 16828 dmove t2, [ .fhslf,,gcpag ; This process, page number of gc psect 16829 002311'01 120 02 0 00 002561' pm%cnt!fld(gcpgs,pm%rpt) ] ; Number of pages to toss 16830 002312'01 104 00 0 00 000056 PMAP% ; Trim our working set 16831 002313'01 320 12 0 00 002315' %jserr (,) ; Odd... but continue 16832 002314'01 254 00 0 00 002320' 16833 002315'01 265 01 0 00 002234* 16834 002316'01 000000000000# 16835 002317'01 254 00 0 00 002320' 16836 001242'04 120 157 163 164 040 16837 16838 002320'01 263 17 0 00 000000 ret ; Don't forget to finally return 16839 16840 chgsec(code,data) ;;Some temporary storage 16841 000000'05 mecpu: XList ; Save a few trees 16842 List ; Turn the listing back on 16843 16844 retsec ;;Restore .PSECT assumptions 16845 16846 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20MAC MAC 30-Jun-23 17:21 String copy measurement, 9:10pm Thursday, 21 July 1920 16847 subttl String copy measurement, 9:10pm Thursday, 21 July 1920 16848 16849 ; A question had sometimes come up for debate as to whether the string 16850 ; instructions gave any real speed up, the concern being whether the 16851 ; set up cost of conditioning the register file and restoring it was 16852 ; worth using them. 16853 ; 16854 ; Three cases were set up, the first being a typical ildb/idpb loop 16855 ; with the second being a use of movst to move the string until a nul 16856 ; was detected. The third was a mixture; the keywords being moved 16857 ; with a loop and the macro expansions being moved with the movst. 16858 ; This was expected to be have the best performance as macro names 16859 ; (I.E., keywords) are typically not very long. 16860 ; 16861 ; 11 macros were defined, using a total of 80 characters of macro name 16862 ; space and 1365 characters of macro text space. The results are 16863 ; suprising: 16864 ; 16865 ; Case Elapsed CPU All 16866 ; 1 1.360 1.320 times 16867 ; *2 .340 .320 are in 16868 ; 3 1.020 .980 milliseconds 16869 ; 16870 ; By a considerable margin, using solely the movst won. This is why 16871 ; it is used exclusively, below. Going forward, other cases may be 16872 ; identified in Kermit where it can be used. 16873 16874 extern asczcp ; Extended instruction to move ASCIZ 16875 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20MAC MAC 30-Jun-23 17:21 Routine to copy keyword (macro name) data 16876 subttl Routine to copy keyword (macro name) data 16877 16878 ; Expects: 16879 ; 16880 ; q2/ Address of current keyword entry 16881 ; q3/ Word offset between tables 16882 ; 16883 ; Returns: 16884 ; 16885 ; +1, always 16886 16887 002321'01 mkeycp: remark ; Copy the keyword (macro name) 16888 002321'01 554 01 0 06 000000 hlrz t1, (q2) ; Pick up keyword address 16889 002322'01 270 01 0 00 000007 add t1, q3 ; add in offset 16890 002323'01 505 01 0 00 440700 hrli t1, (point 7,0) ; Now have a source pointer 16891 002324'01 200 02 0 00 000000# move t2, macbp ; Point to our (scrubbed) macro table 16892 002325'01 506 02 0 06 000000 hrlm t2, (q2) ; Stomp in as the new keyword address 16893 002326'01 260 17 0 00 000443* call asczcp ; Copy the ASCIZ string 16894 002327'01 554 04 0 00 000002 hlrz t4, t2 ; Load the destination pointer portion 16895 002330'01 306 04 0 00 440700 cain t4, 440700 ; On a word boundary? (1 in 5 chance) 16896 002331'01 254 00 0 00 002334' ifskp. ; Nope, fix 16897 002332'01 271 02 0 00 000001 addi t2, ^d1 ; Round up a word 16898 002333'01 505 02 0 00 440700 hrli t2, 440700 ; Stomp in the right magic 16899 002334'01 endif. ; Ready for any future usage 16900 002334'01 202 02 0 00 000000# movem t2, macbp ; Point to our (scrubbed) macro table 16901 002335'01 263 17 0 00 000000 ret ; All is well, return 16902 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20MAC MAC 30-Jun-23 17:21 Routine to copy macro text (macro expansion) data 16903 subttl Routine to copy macro text (macro expansion) data 16904 16905 ; Expects: 16906 ; 16907 ; q2/ Address of current keyword entry 16908 ; q3/ Word offset between tables 16909 ; 16910 ; Returns: 16911 ; 16912 ; +1, Always 16913 16914 extern asczcp ; Extended instruction to move ASCIZ 16915 16916 002336'01 mtxtcp: remark ; Copy the text of the macro over 16917 002336'01 550 01 0 06 000000 hrrz t1, (q2) ; Pick up expansion address 16918 002337'01 270 01 0 00 000007 add t1, q3 ; add in offset 16919 002340'01 505 01 0 00 440700 hrli t1, (point 7,0) ; Now have a source pointer 16920 002341'01 200 02 0 00 000000# move t2, macbp ; Point to our (scrubbed) macro text table 16921 002342'01 542 02 0 06 000000 hrrm t2, (q2) ; Stomp in as the new text address 16922 002343'01 260 17 0 00 002326* call asczcp ; Maybe will even save some cpu time 16923 002344'01 554 04 0 00 000002 hlrz t4, t2 ; Load the destination pointer portion 16924 002345'01 306 04 0 00 440700 cain t4, 440700 ; On a word boundary? (1 in 5 chance) 16925 002346'01 254 00 0 00 002351' ifskp. ; Nope, fix 16926 002347'01 271 02 0 00 000001 addi t2, ^d1 ; Round up a word 16927 002350'01 505 02 0 00 440700 hrli t2, 440700 ; Stomp in the right magic 16928 002351'01 endif. ; Ready for any future usage 16929 002351'01 202 02 0 00 000000# movem t2, macbp ; And update global storage 16930 002352'01 263 17 0 00 000000 ret ; All is well, return 16931 16932 .endps code 16933 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20MAC MAC 30-Jun-23 17:21 Additional writable storage areas 16934 subttl Additional writable storage areas 16935 16936 .psect data 16937 000021'05 000000 000000 onamp: 0 ;[77] Previous NAMP. 16938 000022'05 000000 000000 tbent: 0 ; TBLUK% entry of existing keyword 16939 000023'05 000000 000000 sintn: 0 ; Number of signal I/O traps we've seen 16940 16941 extern namlen,namatm,explen,expatm 16942 16943 remark definf,undeff ; Must be whacked on every parse 16944 000024'05 000000 000000 definf:: 0 ;[77] DEFINE flag nonzero if parsing DEFINE. 16945 000025'05 000000 000000 undeff:: 0 ;[77] UNDEFF flag nonzero if DEFINE x . 16946 000026'05 000000 000000 macptr:: 0 ;[77] Pointer to start of macro text in CSB. 16947 16948 .endps data 16949 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20MAC MAC 30-Jun-23 17:21 Macros storage areas 16950 subttl Macros storage areas 16951 16952 ;N.B, Do NOT put anything into this .PSECT without updating the 16953 ; calculations for maclen in k20unv!!! 16954 16955 .psect macros,macorg ; Storage for macros 16956 16957 ; The TBLUK% table, with one predefined macro for Columbia's IBM 16958 ; system. Users can remove this definition by typing "define ibm", or 16959 ; they can replace it. KERMIT-20 maintainers can remove it for their 16960 ; site by replacing the contents of MACTAB (first word) with 16961 ; 0,,MACMAX, or can change it to be anything they like. 16962 ; 16963 ; Kept for historical reasons and for any take files that depend on it. 16964 ; 16965 ; Be aware that the calculations for .psect size account for the IBM 16966 ; keyword and the cooresponding macro body. If you do change this to 16967 ; be something else, then take a look at calculations in k20unv that are 16968 ; driven off of macmax. 16969 ; 16970 ; You need only change the slop calculations that are done with adslop. 16971 ; 16972 ; mactab MUST be the first location in the .psect!! Garbage collection 16973 ; depends on this. 16974 16975 000000'06 mactab: intern mactab ;[194] 16976 000000'06 000001 000252 1,,macmax ;[77] Macro keyword TBLUK format table. 16977 000001'06 000255' 000256' ibmkey,,ibmmac ; Where is my 3276?? 16978 000002'06 block macmax-1 ;[77] Macro keyword table. 16979 000253'06 mactbx: block 1 ;[214] ; Tiny bit of slop 16980 16981 ; This pointer has to be in here so that /MAP restores them. No 16982 ; TBADD% should ever overwrite it because the maximum count (in the 16983 ; right halfword of TBLUK% table) can not be exceeded. 16984 16985 000254'06 44 07 0 00 000267' macbp: point 7, m1stf ; First free location in macro (expansion) table 16986 16987 ; Both macro names and bodies are allocated out of the same block of 16988 ; storage, which allows for more flexible management, Note that the 16989 ; macro buffer MUST be the last item in the .PSECT in order to get the 16990 ; benefit of guard page two, which follows. 16991 16992 000255'06 macbuf: remark ; Here are the macros 16993 000255'06 111 102 115 000 000 ibmkey:! asciz /IBM/ ; Macro name 16994 000256'06 160 141 162 151 164 ibmmac:! asciz/parity mark, duplex half, handshake xon 16995 / ; Yummy half duplex!! 16996 000267'06 m1stf:! .xcref m1stf ; Don't need this in the cross reference 16997 suppress m1stf ; Nor in the symbol table listing 16998 000267'06 block mnblen ; Space for the names 16999 001013'06 block mtblen ; Space for the expansions 17000 006777'06 macx: block 1 ;[77] End of macro text buffer, with padding. 17001 17002 if2 < purge m1stf > ; Not needed after second pass 17003 .endps macros 17004 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51-1 K20MAC MAC 30-Jun-23 17:21 Macros storage areas 17005 .psect gc,gcorg ; psect for garbage collections 17006 000000'07 block maclen ; same size as for macros 17007 .endps gc 17008 17009 emacro < 17010 .psect medit,medorg ; psect for macro editing 17011 block maclen ; same size as for macros 17012 .endps medit ; Probably far too large 17013 >;;emacro 17014 k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20MAC MAC 30-Jun-23 17:21 History and Motivation 17015 subttl History and Motivation 17016 17017 ; The is all part of edit 203 17018 17019 ;PS:KERMIT.MAC.288, 27-Oct-83 18:55:44, Frank 17020 ;[77] Add DEFINE command for SET macros. Remove hardwired SET IBM. 17021 17022 ; The DEFINE command for SET macros is quite old, having been added by 17023 ; Frank da Cruz as part of edit 77 on 27-Oct-83. It predates the 17024 ; availability of extended sections and read-only .psects (perhaps 17025 ; even .psects themselves) 17026 ; 17027 ; It's fine for what it does, meaning loading up a bunch of macros 17028 ; from a KERMIT.INI file, and clearly functioned fine for years, if 17029 ; not decades. 17030 ; 17031 ; However, during the DECnet NRT work, it became increasingly 17032 ; aggressively used, which revealed some limitations: 17033 ; 17034 ; DEFINE assumed that you are always creating a macro and thus copies 17035 ; whatever is in the atom buffer into the name table. This means 17036 ; that, in addition to not freeing up any name or macro space, 17037 ; undefining a macro would actually use *more* name space. 17038 ; 17039 ; Because this copy happened during the parse and not after the 17040 ; command had been confirmed, if the user started defining a macro, 17041 ; changed his mind and typed a ^U, space in the name table would still 17042 ; be usurped for each and every reparse. 17043 ; 17044 ; Thus, during the process of either learning the DEFINE command or 17045 ; trying different parameters, the user could run out of space without 17046 ; actually having accomplished anything. There was no remedy to this 17047 ; except to exit and run a fresh copy of Kermit. 17048 ; 17049 ; The out of space check was not reliable. First, it checked to see 17050 ; if the macro name and text space was already full at the beginning 17051 ; of the parse. These checks simply looked to see if the macro name 17052 ; and table space had started to go past the marked end of tables. 17053 ; Overwrites were prevented by having a certain amount of slop for the 17054 ; definition to expand into. 17055 ; 17056 ; However, once the check was passed, Kermit did no further checking, 17057 ; meaning the user could blithly continue typing, overwriting whatever 17058 ; happened to be after the tables. This, coupled with the reparse 17059 ; phenomena previously described could produce some pretty quirky 17060 ; behavior, if not downright crashes. 17061 ; 17062 ; Another non-critical limitation was that there was was no way to 17063 ; make modifications to a macro once it was defined. Any change meant 17064 ; that you had to basically type the whole macro in again. 17065 ; 17066 ; As a practical matter, while SET macros could be read in via the 17067 ; execution of a TAKE file, there was no way to write them out. 17068 ; 17069 ; Fixing the problems above and adding the extra functionality proved k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-1 K20MAC MAC 30-Jun-23 17:21 History and Motivation 17070 ; so massive an addition that all the code got moved into this 17071 ; seperate module. 17072 ; 17073 ; That being said, the original logic is largely kept, the bulk of the 17074 ; code being extra functionality. k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20MAC MAC 30-Jun-23 17:21 History and Motivation 17075 17076 subttl Random Notes 17077 17078 ; Using a quoted strings allows an easy define of a name that is 17079 ; similar to an existing name by not selecting from the keyword table. 17080 ; 17081 ; Better, it allows for consistent use of escape recognition when 17082 ; specifying the SET commands. 17083 17084 .xcmsy ;[194] Ditch MACSYM junk 17085 17086 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 002664 FOR CODE PSECT 2 BREAK IS 000110 FOR CONST PSECT 3 BREAK IS 000040 FOR TEXT PSECT 4 BREAK IS 001252 FOR ETEXT PSECT 5 BREAK IS 000027 FOR DATA PSECT 6 BREAK IS 007000 FOR MACROS PSECT 7 BREAK IS 007000 FOR GC CPU TIME USED 00:00.891 107P CORE USED k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20MAC MAC 30-Jun-23 17:21 SYMBOL TABLE ATMBUF 000000 ext MACORG 011000 spd T2 000002 spd BOUT% 104000 000051 int MACPAG 000011 spd T3 000003 spd CALL 260740 000000 MACPGS 000007 spd T4 000004 spd CALLRE 254000 000000 spd MACROS 000000 ext TBADD% 104000 000536 int CFMRTN 000000 ext MNBLEN 000524 spd TBDEL% 104000 000535 int CHFDB% 104000 000064 int MTBLEN 005764 spd TBLUK% 104000 000537 int CJFNBK 000000 ext MYTTY 000000 ext TEXT 000000 ext CLOSF% 104000 000022 int NOIRTN 000000 ext TL%EXM 040000 000000 sin CLZFF% 104000 000034 int NOP 600000 000000 sin %%JSER 000000 ext CM%ABR 000004 sin NOUT% 104000 000224 int ..MSK 777777 777777 spd CM%FNC 777000 000000 sin OF%BSZ 770000 000000 sin .CHSPC 000040 sin CM%FW 002000 000000 sin OF%MOD 007400 000000 sin .CMCFM 000010 sin CM%HPP 000004 000000 sin OF%RD 200000 sin .CMDEV 000016 sin CM%INV 000001 sin OF%RDU 010000 sin .CMFIL 000006 sin CM%SDH 000001 000000 sin OF%WR 100000 sin .CMFLD 000007 sin CMDBLN 000000 ext OPENF% 104000 000021 int .CMFNP 000000 sin CMDBUF 000000 ext P 000017 .CMKEY 000000 sin CMDER1 000000 ext P1 000011 spd .CMPTR 000004 sin CO%NRJ 400000 000000 sin P2 000012 spd .CMQST 000021 sin CODE 000000 ext P3 000013 spd .CMSWI 000003 sin CONST 000000 ext P4 000014 spd .DATUS 000017 spd CRLF 000000 ext P5 000015 spd .DVDSK 000000 sin CX 000016 PA%PEX 010000 000000 sin .DVNUL 000015 sin CZ%NCL 040000 000000 sin PA%RD 100000 000000 sin .DVTTY 000012 sin DATA 000000 ext PARS1 000000 ext .FBSIZ 000012 sin DEVST% 104000 000121 int PARS2 000000 ext .FHSLF 400000 sin DTILEN 000021 spd PARS3 000000 ext .FP 000015 spd DURTIM 000000 ext PARS4 000000 ext .FPAC 000005 spd DV%TYP 000777 000000 sin PARS5 000000 ext .GJNHG 777777 sin DVCHR% 104000 000117 int PBOUT% 104000 000074 int .GSNRM 000000 sin ELPTIM 000000 ext PM%CNT 400000 000000 sin .HPRNT 000001 sin ENDTIM 000000 ext PM%PLD 010000 000000 sin .JSAOF 000001 sin ERJMPR 320500 000000 int PM%RD 100000 000000 sin .NULIO 377777 sin ERJMPS 320600 000000 int PM%RPT 777777 sin .PRIIN 000100 sin ERRPTR 000000 ext PM%WR 040000 000000 sin .PRIOU 000101 sin ESOUT% 104000 000313 int PMAP% 104000 000056 int .PX7 610001 000000 spd ETEXT 000000 ext PSOUT 104000 000076 int .RHALF 777777 sin EWALLT 000000 ext PSOUT% 104000 000076 int .SAC 000016 FRCLOS 000000 ext Q1 000005 spd .SAV1 000000 ext GC 000000 ext Q2 000006 spd .SAV2 000000 ext GCORG 021000 spd Q3 000007 spd .SAV3 000000 ext GCPAG 000021 spd Q4 000010 spd .SET2 000000 ext GCPGS 000007 spd Q5 000011 spd GJ%FLG 000020 000000 sin R 000000 ext GJ%FOU 400000 000000 sin RET 263740 000000 GJ%GIV 000001 000000 sin RFIELD 000000 ext GJ%GND 000040 000000 sin RFPTR% 104000 000043 int GJ%NEW 200000 000000 sin RLJFN% 104000 000023 int GJ%OLD 100000 000000 sin RPACS% 104000 000057 int HPTIM% 104000 000501 int SBK 000000 ext ISNULJ 000000 ext SETTAB 000000 ext JFNS% 104000 000030 int SIZEF% 104000 000036 int JS%DEV 700000 000000 sin SOUT% 104000 000053 int MACLEN 007000 spd STATIM 000000 ext MACMAX 000252 spd T1 000001 spd k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20MAC MAC 30-Jun-23 17:21 SYMBOL TABLE FOR PSECT CODE ASCZCP 002343' ext ..0020 000020' spd ..0776 001600' spd ATMBUF 002535' ext ..0025 000044' spd ..0777 001622' spd CFMRTN 002156' ext ..0037 000051' spd ..1013 001642' spd CJFNBK 002621' ext ..0040 000053' spd ..1026 001664' spd CMDER1 001707' ext ..0051 000070' spd ..1027 001674' spd CRLF 002306' ext ..0057 000113' spd ..1044 001707' spd DMPBK 000561' ..0060 000123' spd ..1046 001717' spd DMPBKL 000010 spd ..0063 000157' spd ..1062 001734' spd DURTIM 002261' ext ..0073 000163' spd ..1074 001736' spd EHPTIM 002304' ext ..0100 000170' spd ..1075 001773' spd ELPTIM 002243' ext ..0101 000227' spd ..1116 002015' spd ENDTIM 002242' ext ..0113 000225' spd ..1117 002016' spd ERRPTR 001635' ext ..0120 000225' spd ..1136 002037' spd EWALLT 002250' ext ..0141 000267' spd ..1140 002057' spd EXPATM 002500' ext ..0146 000266' spd ..1156 002057' spd EXPLEN 000402' ext ..0170 000326' spd ..1203 002204' spd FRCLOS 002063' ext ..0206 000366' spd ..1220 002224' spd INIFLG 001377' ext ..0213 000365' spd ..1221 002230' spd ISNULJ 001632' ext ..0220 000366' spd ..1227 002264' spd MAPBK 001074' ..0232 000442' spd ..1234 002265' spd MAPBKL 000010 spd ..0250 000502' spd ..1237 002306' spd MKEYCP 002321' ..0255 000501' spd ..1245 002272' spd MTXTCP 002336' ..0262 000502' spd ..1266 002334' spd MYTTY 001572' ext ..0332 000647' spd ..1274 002351' spd NAMATM 002442' ext ..0340 000627' spd ..IFT 100000 000001 spd NAMLEN 000502' ext ..0346 000646' spd ..JX1 100000 000000 spd NOIRTN 001467' ext ..0363 000663' spd ..MX1 000001 spd PARS1 000556' ext ..0376 000705' spd ..MX2 000001 spd PARS2 001717' ext ..0377 000715' spd ..TX1 400000 000000 spd R 002236' ext ..0414 000730' spd ..TX2 000001 spd RFIELD 001473' ext ..0422 000745' spd ..XX 006004 002541' spd SAVBK 001452' ..0436 000767' spd .DEFI5 000044' SAVBKL 000010 spd ..0450 000771' spd .DEFI6 000055' SBK 000000 ext ..0451 001012' spd .DEFIN 000000' ent SETTAB 000000 ext ..0457 001000' spd .DUPLI 000301' STATIM 002165' ext ..0461 001007' spd .MCOMP 002156' TABLEM 000555' ..0476 001054' spd .MDMPE 000670' $DEFAD 000133' ..0530 001162' spd .MDUMP 000571' $DEFI7 000241' ..0536 001142' spd .MMAP 001104' $DEFIN 000074' ent ..0544 001161' spd .MMAPE 001203' $DUPLI 000335' ..0561 001176' spd .MRESE 001422' $MCHRS 002144' ent ..0574 001220' spd .MSAVE 001462' $MCOMP 002160' ..0575 001230' spd .MSUMM 002066' $MDMPE 001060' ..0612 001243' spd .MSVE 001647' $MDUMP 000731' ..0644 001344' spd .RENAM 000415' $MMAP 001244' ..0645 001365' spd .SET2 000073' ext $MMAPE 001401' ..0653 001353' spd .UNDEF 000277' $MMAPI 001410' ..0655 001362' spd $MMAPN 001405' ..0676 001444' spd $MRESE 001424' ..0714 001567' spd $MSAVE 001710' ..0722 001542' spd $MSUMM 002070' ..0730 001536' spd $MSVE 002062' ..0745 001550' spd $RENAM 000451' ..0753 001566' spd %%JSER 002315' ext ..0770 001626' spd k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20MAC MAC 30-Jun-23 17:21 SYMBOL TABLE FOR PSECT CONST DEFSWI 000000' TABSWI 000030' %DUPL 000004' spd k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20MAC MAC 30-Jun-23 17:21 SYMBOL TABLE FOR PSECT DATA DEFINF 000024' int EXPATM 000000 ext EXPLEN 000000 ext MACPTR 000026' int MECPU 000000' NAMATM 000000 ext NAMLEN 000000 ext ONAMP 000021' SINTN 000023' TBENT 000022' UNDEFF 000025' int k20mac - Kermit-20 DEFINE macro Implementation MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20MAC MAC 30-Jun-23 17:21 SYMBOL TABLE FOR PSECT MACROS IBMKEY 000255' spd IBMMAC 000256' spd MACBP 000254' MACBUF 000255' MACTAB 000000' int MACTBX 000253' MACX 006777' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20IOC MAC 12-May-24 20:27 17087 Title K20IOC Kermit Input/Output statement Control 17088 17089 search monsym,macsym,cmd,k20unv ;[194] 17090 cmdacs ^ ; Clean up p1-p4 definitions 17091 cmdunv ^ ;[248] ; Externalize storage and constants 17092 17093 sall ; tidy listing, please 17094 .directive flblst ; We don't need to see all the ASCIZ bytes... 17095 17096 ;N.B., although this module is new with a large amount of rewrites, 17097 ; some attempt has been made to keep old edit numbers for cross- 17098 ; reference purposes. 17099 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20IOC MAC 12-May-24 20:27 External routines and storage 17100 subttl External routines and storage 17101 17102 remark common parsing external data 17103 17104 extern pars1 ; Data from first parse. 17105 extern pars2 ; Data from second parse. 17106 extern pars3 ; Data from third parse. 17107 extern pars4 ; Data from fourth parse. 17108 extern pars5 ;[41] ... 17109 extern pars6 ;[209] ; If $INPUT is not getting driven by .INPUT 17110 extern pars7 ;[229] ; If TRANSMIT is sending some kind of EOF 17111 extern pars8 ;[229] ; If $INPUT matching should not type anything 17112 extern pars9 ;[265] ; If TRANSMIT is clipping maximum length line 17113 extern pars10 ;[266] ; If TRANSMIT is pausing between lines 17114 remark pars11 ;[273] ; Not defined as pars10 is a double 17115 extern pars12 ;[273] ; Whether matching case 17116 extern buffer ; Used for foreign file names and string conversion 17117 17118 remark Linkages with the main and other parsers 17119 17120 extern chksec ; k20par: See if we got a silly floating point value 17121 extern definf ; k20mac: Set if we are defining a macro 17122 17123 remark Various JFN's and related control storage 17124 17125 extern netjfn ; Network JFN, if not a remote Kermit 17126 extern ttyjfn ; User's terminal JFN, if remote Kermit 17127 extern takjfn ; JFN of current TAKE file 17128 extern popjfn ; Routine to switch between takjfn's 17129 extern sesjfn ; JFN for session logging file 17130 extern sesflg ; Control flag for active usage of same 17131 extern filjfn ; Current open file 17132 extern cjfnbk ; COMND%'s GTJFN% block 17133 extern isnulj ; Determine if this JFN is on NUL: 17134 extern frclos ; Force a JFN to close (or release it) 17135 17136 remark Handshke, Parity and Duplex Handling 17137 17138 extern handsh ; Handshake character (if any) 17139 extern parity ; Points to whatever parity (routine) we're using 17140 extern ttipar ;[258] ; Count of parity errors 17141 extern duplex ; Who is doing the echoing remote host or us 17142 17143 remark User and Network terminal handling 17144 17145 extern chklin ; Check line (or NRT or PTY) status 17146 extern carier ; Line carrier (or good NRT or PTY JFN) 17147 extern doarpa ; Set up for network binary (if on a TVT) 17148 extern unarpa ; Turn network binary off (if on a TVT) 17149 extern vtermf ; Virtual terminal flag (NRT, PTY, PIP eventually) 17150 extern ptytty ;[265] ; This PTY's associated terminal line 17151 extern ttyob ; Put local terminal in binary mode 17152 extern ttyou ; Put local terminal back in user mode 17153 extern dobits ; Set terminal line for transparent I/O 17154 extern unbits ; Undo effects of dobits K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-1 K20IOC MAC 12-May-24 20:27 External routines and storage 17155 17156 extern tvtflg ;[271] ; Whether on a Telnet Virtual Terminal 17157 extern iaciac ;[247] ; Handle IAC doubling on a TVT in binary mode 17158 extern tvtbuf ;[247] ; Buffer where IAC doubling is done 17159 17160 remark Various performance counters for the interested 17161 17162 extern nbict ; Network BIN% count 17163 extern nsici ; Network SIN%'s count (total issued) 17164 extern nsimx ; Network SIN% maximum length 17165 extern nsitc ; Network SIN%'s total characters read 17166 17167 extern vsoct ; Virtual Terminal SOUTR%'s Issued 17168 extern vsotc ; Virtual Terminal SOUTR% Total Characters 17169 extern vsomx ; Virtual Terminal SOUTR% Maximum length 17170 17171 remark Timing Routines ;[267] These are in a completely new module, k20tim 17172 extern statim ;[267] Start timing transfer 17173 extern endtim ;[267] End timing transfer 17174 extern elptim ;[267] Compute elapsed time 17175 extern gmkcps ;[267] Calculate Giga, Mega, Kilo character rate 17176 17177 remark Terminal and TIMER% interrupt handling 17178 17179 extern ccon ; Turn ^C handling on 17180 extern ccoff2 ; FORCE ^C handling off 17181 extern cmpon ; Turn ^M and ^P handling on 17182 extern cmpoff ; Turn ^M and ^P handling off 17183 extern cmseen ; ^M seen 17184 extern cmloc ; Location transfer execution to on ^M 17185 extern cpseen ; ^P seen 17186 extern cploc ; Location transfer execution to on ^P 17187 repeat 0,< 17188 extern intpc ; PC to restore on timer interrupt. 17189 extern intstk ; Stack pointer to restore on timer interrupt. 17190 extern timchb ; TIMER% interrupt chanel bit 17191 > 17192 extern timeon ;[209] Set up a TIMER% 17193 extern timdel ;[209] Delete any pending TIMER%'s 17194 17195 remark Buffer and Strings 17196 17197 extern strc ; Counter for, and... 17198 extern strptr ; pointer into the... 17199 extern strbuf ; Gigantic string buffer (1,000 words!!) 17200 extern strbf2 ; Another one 17201 extern datbuf ;[257] ; Gigantic buffer for 8 bit read 17202 extern asczcp ;[248] ; Move a NUL terminated string and return its length 17203 17204 remark Networking Linkages and variables 17205 17206 extern clrest ;[209] Return estimate of available data 17207 extern clrbuf ;[209] Clear monitor buffers 17208 extern local ;[209] Non-zero if a local Kermit 17209 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-2 K20IOC MAC 12-May-24 20:27 External routines and storage 17210 remark Other random useful things 17211 17212 extern %%jser ; JSYS error handler (for %jserr macro) 17213 extern errptr ; Pointer to error text (for ermsg% macro) 17214 extern crlf ; byte (7) .chcrt, .chlfd, .chnul 17215 extern jobtab ; Result of GETJI%; used to determine batchness 17216 extern nul4 ; Negative counted pointer to "NUL:" 17217 extern grdmap ;[263] Handle of guard page 17218 extern spsiz ;[265] Maximum we will force down the pipe 17219 17220 .psect code/ronly ; Pure code, pure heaven 17221 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20IOC MAC 12-May-24 20:27 SET INPUT command initial parsing 17222 subttl SET INPUT command initial parsing 17223 17224 000000'02 000000 000000 %table(sintab) 17225 000001'02 000000# 000000# %key3 , .sinca, incase 17226 000000'03 143 141 163 145 000 17227 000001'03 000000# 000000# 17228 000002'02 000000# 000000# %key3 , .sindt, indeft 17229 000002'03 144 145 146 141 165 17230 000006'03 000000# 000000# 17231 000003'02 000000# 000000# %key3 , .sinse, indefs ;[209] 17232 000007'03 163 145 141 162 143 17233 000012'03 000000# 000000# 17234 000004'02 000000# 000000# %key3 , .sinta, intima 17235 000013'03 164 151 155 145 157 17236 000016'03 000000# 000000# 17237 000000'02 000004 000004 %tbend 17238 17239 ; SET INPUT parsing, like SET SEND/RECEIVE -- an extra level of parsing. 17240 17241 chgsec(code,const) ;;FDB's go in const .psect 17242 000005'02 000000 000000 tinfdb: flddb. .cmkey,,sintab 17243 000006'02 000000 000000' 17244 retsec ;;Return to code .psect 17245 17246 000000'01 .setin: entry .setin ;[209] Invoked from k20par 17247 000000'01 201 01 0 00 000000# movei t1, tinfdb ;[209] 17248 000001'01 260 17 0 00 000000* call rfield ; Parse a keyword. 17249 000002'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the command routine addresses. 17250 000003'01 202 02 0 00 000000* movem t2, pars3 ; Save into pars3. 17251 000004'01 554 01 0 02 000000 hlrz t1, (t2) ; Get the next level routine. 17252 000005'01 260 17 0 01 000000 call (t1) ; Call it. 17253 000006'01 263 17 0 00 000000 ret 17254 17255 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20IOC MAC 12-May-24 20:27 SET INPUT CASE parsing 17256 subttl SET INPUT CASE parsing 17257 17258 000007'02 000000 000000 %table(castab) ; Case table. 17259 000010'02 000000# 000000 %key2 , 0 17260 000017'03 151 147 156 157 162 17261 000011'02 000000# 000001 %key2 , 1 17262 000021'03 157 142 163 145 162 17263 000012'02 000000# 000001 %keyf3 , 1, cm%inv ;[212] Tom gets sleepy... 17264 000023'03 002000 000001 17265 000024'03 162 145 163 160 145 17266 000007'02 000003 000003 %tbend 17267 17268 intern castab ;[273] Used in .setca in K20PAR 17269 17270 chgsec(code,const) ;;FDB's go in const .psect 17271 000013'02 010004 000016' incfdb: flddb. .cmcfm,,,,,incfd1 17272 000014'02 000000 000000 17273 000015'02 44 07 0 00 004124' 17274 000016'02 000000 000000 incfd1: flddb. .cmkey,,castab,,, 17275 000017'02 000000 000007' 17276 retsec ;;Get back into code .psect 17277 17278 000007'01 265 16 0 00 004460' .sinca: saveac ;[209] Need to remember function code 17279 000010'01 200 16 0 00 000000# guide ; SET INPUT CASE 17280 000011'01 260 17 0 00 000000* 17281 000020'02 000000000000# 17282 000000'04 146 157 162 040 155 17283 17284 000012'01 201 01 0 00 000000# movei t1, incfdb ;[274] Assume a normal parse 17285 000013'01 332 00 0 00 000000* skipe definf ;[274] Not in a define, are we? 17286 000014'01 201 01 0 00 000000# movei t1, incfd1 ;[274] We are, so don't parse a confirm 17287 000015'01 260 17 0 00 000001* call rfield ;[209] Parse a keyword or default 17288 17289 000016'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[209] Pick up function code 17290 000017'01 302 05 0 00 000010 caie q1, .cmcfm ;[209] Want's default? 17291 000020'01 254 00 0 00 000023' ifskp. ;[209] That's easy, give him the default 17292 000021'01 400 02 0 00 000000 setz t2, ;[209] This is the parse value for "ignore" 17293 000022'01 254 00 0 00 000024' else. ;[209] Otherwise, handle the keyword 17294 000023'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 17295 000024'01 endif. ;[209] 17296 000024'01 202 02 0 00 000000* movem t2, pars4 ; Save into pars4. 17297 17298 000025'01 306 05 0 00 000010 cain q1, .cmcfm ;[209] Was default requested? 17299 000026'01 263 17 0 00 000000 ret ;[209] It was, so don't reconfirm a confirmation 17300 000027'01 336 00 0 00 000013* skipn definf ; In DEFINE? 17301 000030'01 260 17 0 00 000000* confrm ; No, get confirmation. 17302 000031'01 263 17 0 00 000000 ret 17303 17304 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20IOC MAC 12-May-24 20:27 SET INPUT DEFAULT-TIMEOUT parsing 17305 subttl SET INPUT DEFAULT-TIMEOUT parsing 17306 17307 ; N.B., When chksec succeeds, it succeeds completely, putting the 17308 ; calculated millisecond value in pars4 and the floating point 17309 ; seconds in pars5. Both are displayed by SHOW INPUT because the 17310 ; floating point is easier to read, the milliseconds perhaps being 17311 ; of interest to debuggers, mathematicians and the curious. 17312 17313 chgsec(code,const) ;;Chained FDB's go in const .psect 17314 000021'02 010004 000024' indfdb: flddb. .cmcfm,,,,,indfd1 17315 000022'02 000000 000000 17316 000023'02 44 07 0 00 004133' 17317 000024'02 015004 000000 indfd1: flddb. .cmflt,,,,, 17318 000025'02 000000 000000 17319 000026'02 44 07 0 00 004143' 17320 retsec ;;Get back into code .psect 17321 17322 000032'01 265 16 0 00 004460' .sindt: saveac ;[209] Need to remember function code 17323 000033'01 200 16 0 00 000000# guide 17324 000034'01 260 17 0 00 000011* 17325 000027'02 000000000000# 17326 000003'04 146 157 162 040 111 17327 17328 000035'01 201 01 0 00 000000# movei t1, indfdb ; Various alteratives 17329 000036'01 332 00 0 00 000027* skipe definf ;[274] Not in a define, are we? 17330 000037'01 201 01 0 00 000000# movei t1, indfd1 ;[274] We are, so don't parse for a confirm 17331 000040'01 260 17 0 00 000015* call rfield ; Try to get one of them 17332 17333 000041'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[209] Pick up function code 17334 000042'01 302 05 0 00 000010 caie q1, .cmcfm ;[209] Want's default? 17335 000043'01 254 00 0 00 000046' ifskp. ;[209] That's easy, give him the default 17336 000044'01 205 02 0 00 204500 movx t2, <10.> ;[209] Ten seconds in floating point 17337 000045'01 254 00 0 00 000052' else. ;[209] Otherwise, better sanity check it 17338 000046'01 325 02 0 00 000052' ifl. t2 ;[209] Is the number deeply silly?? 17339 000047'01 200 01 0 00 000000# emsg ;[209] 17340 000050'01 104 00 0 00 000313 17341 000030'02 000000000000# 17342 000007'04 101 040 156 145 147 17343 000051'01 254 00 0 00 000000* jrst cmder1 ;[209] However, allow reparse 17344 000052'01 endif. ;[209] End non-default initial check 17345 000052'01 endif. ;[209] Either way, t2 has a floating point value 17346 17347 remark ;[212] When chksec works, it works completely 17348 000052'01 260 17 0 00 000000* call chksec ;[196] Ensure number is in correct range 17349 000053'01 254 00 0 00 000062' ifskp. ;[196] Check and convert OK? 17350 000054'01 306 05 0 00 000010 cain q1, .cmcfm ;[209] It did. Was default requested? 17351 000055'01 263 17 0 00 000000 ret ;[209] It was, so don't reconfirm a confirmation 17352 000056'01 336 00 0 00 000036* skipn definf ; In DEFINE? 17353 000057'01 260 17 0 00 000030* confrm ; No, get confirmation. 17354 000060'01 263 17 0 00 000000 ret ;[212] Either way, we're done 17355 000061'01 254 00 0 00 000065' else. ;[196] Otherwise, couldn't swallow something 17356 000062'01 200 01 0 00 000000# emsg ;[196] 17357 000063'01 104 00 0 00 000313 17358 000031'02 000000000000# 17359 000020'04 111 156 160 165 164 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-1 K20IOC MAC 12-May-24 20:27 SET INPUT DEFAULT-TIMEOUT parsing 17360 000064'01 254 00 0 00 000051* jrst cmder1 ;[196] Allow reparse 17361 000065'01 endif. ;[196] End case checking and conversion 17362 17363 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20IOC MAC 12-May-24 20:27 SET INPUT SEARCH-DEFAULT parsing 17364 subttl SET INPUT SEARCH-DEFAULT parsing 17365 17366 ;[209] Begin code insertion 17367 17368 ; Calls the string parsing portion (.INPU1) to get the string and 17369 ; build the appropriate storage. Then hijacks the rest of the parse 17370 ; to get our semantic action routine called instead of having a value 17371 ; be set. 17372 ; 17373 ; Because of the design of the main parser to allow macro definitions 17374 ; and to be compliant with that paradigm, this involves an extra level 17375 ; of indirection, as seen below 17376 17377 000065'01 000000 000076' $sinsi: $sinse ; Indirect call 17378 17379 000066'01 265 16 0 00 004467' .sinse: saveac ;[273] Needs these saved 17380 000067'01 200 10 0 00 000000# move q4, incase ;[273] Load case matching 17381 000070'01 202 10 0 00 000000* movem q4, pars12 ;[273] Pretend we parsed it 17382 000071'01 260 17 0 00 000226' call .inpu1 ; Parse just as if it were typed to INPUT 17383 000072'01 510 01 1 00 000000* hllz t1, @pars2 ; Load invoking keyword (SET INPUT) 17384 000073'01 541 01 0 00 000065' hrri t1, $sinsi ; Load indirected address of our semantic action 17385 000074'01 202 01 0 00 000072* movem t1, pars2 ; and take over the rest of the parse 17386 000075'01 263 17 0 00 000000 ret ; Return below 17387 17388 000076'01 265 16 0 00 004501' $sinse: saveac ; Needs some registers 17389 000077'01 333 05 0 00 000000* skiple q1, strc ; Did it get any characters? 17390 000100'01 254 00 0 00 000103' ifskp. ; No, so go with old reliable 17391 000101'01 402 00 0 00 000000# setzm indefw ; Flag no default (nothing for xblt.) 17392 000102'01 263 17 0 00 000000 ret ; Done 17393 000103'01 endif. 17394 17395 000103'01 200 02 0 00 000005 move t2, q1 ; Load character count 17396 000104'01 400 01 0 00 000000 setz t1, ; Cast positive word to signed long 17397 000105'01 235 01 0 00 000005 divi t1, ^d5 ; Convert to word count, five characters per word 17398 000106'01 322 02 0 00 000111' ifn. t2 ; Any remainder? 17399 000107'01 350 06 0 00 000001 aos q2, t1 ; Round up a word and store 17400 000110'01 254 00 0 00 000112' else. ; Otherwise, it fit exactly 17401 000111'01 200 06 0 00 000001 move q2, t1 ; So no need to round 17402 000112'01 endif. 17403 17404 remark t1, ; Still has word count 17405 000112'01 550 02 0 00 000000* hrrz t2, strptr ; Load whatever address the string pointer points to 17406 000113'01 201 03 0 00 000000# movei t3, indefs ; And storing it in our defaulting buffer 17407 000114'01 123 01 0 00 004511' xblt. t1 ; Tuck away for when needed 17408 17409 000115'01 124 05 0 00 000000# dmovem q1, indefc ; Store character and word count 17410 000116'01 263 17 0 00 000000 ret ; Finally done 17411 17412 ;[209] End code insertion 17413 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20IOC MAC 12-May-24 20:27 SET INPUT TIMEOUT-ACTION parsing 17414 subttl SET INPUT TIMEOUT-ACTION parsing 17415 17416 000032'02 000000 000000 %table(itatab) ; INPUT timeout action table 17417 000033'02 000000# 000000 %keyf3 , 0, cm%inv ;[186] Tom gets sleepy... 17418 000026'03 002000 000001 17419 000027'03 143 157 156 164 151 17420 000034'02 000000# 000000 %key2 , 0 17421 000031'03 160 162 157 143 145 17422 000035'02 000000# 000001 %key2 , 1 17423 000033'03 161 165 151 164 000 17424 000036'02 000000# 000001 %keyf3 , 1, cm%inv ;[186] Tom gets sleepy... 17425 000034'03 002000 000001 17426 000035'03 163 164 157 160 000 17427 000032'02 000004 000004 %tbend 17428 17429 chgsec(code,const) ;;FDB's go in const psect 17430 000037'02 010004 000042' intfdb: flddb. .cmcfm,,,,,intfd1 17431 000040'02 000000 000000 17432 000041'02 44 07 0 00 004152' 17433 000042'02 000000 000000 intfd1: flddb. .cmkey,,itatab,,, 17434 000043'02 000000 000032' 17435 retsec 17436 17437 17438 000117'01 265 16 0 00 004460' .sinta: saveac ;[209] Need to remember function code 17439 000120'01 200 16 0 00 000000# guide 17440 000121'01 260 17 0 00 000034* 17441 000044'02 000000000000# 17442 000027'04 146 157 162 040 143 17443 000122'01 201 01 0 00 000000# movei t1, intfdb ;[209] Load parse fdb address 17444 000123'01 332 00 0 00 000056* skipe definf ;[274] Not in a DEFINE, are we? 17445 000124'01 201 01 0 00 000000# movei t1, intfd1 ;[274] We are, so don't parse for a confirm 17446 000125'01 260 17 0 00 000040* call rfield ;[209] And see what he wants 17447 17448 000126'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[209] Pick up function code 17449 000127'01 302 05 0 00 000010 caie q1, .cmcfm ;[209] Want's default? 17450 000130'01 254 00 0 00 000133' ifskp. ;[209] That's easy, give him the default 17451 000131'01 400 02 0 00 000000 setz t2, ;[209] This is the parse value for "proceed" 17452 000132'01 254 00 0 00 000134' else. ;[209] Otherwise, handle the keyword 17453 000133'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword (0 or 1). 17454 000134'01 endif. ;[209] Either way, have something in t2 17455 17456 000134'01 202 02 0 00 000024* movem t2, pars4 ; Save into pars4. 17457 17458 000135'01 306 05 0 00 000010 cain q1, .cmcfm ;[209] Was default requested? 17459 000136'01 263 17 0 00 000000 ret ;[209] It was, so don't reconfirm a confirmation 17460 000137'01 336 00 0 00 000123* skipn definf ; In DEFINE? 17461 000140'01 260 17 0 00 000057* confrm ; No, get confirmation. 17462 000141'01 263 17 0 00 000000 ret 17463 17464 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20IOC MAC 12-May-24 20:27 INPUT command parsing 17465 subttl INPUT command parsing 17466 17467 ; The previous approach relied on defaulting a value to skip a field 17468 ; which limited the operation of question mark and escape recognition. 17469 ; The parsing logic now offers to directly go to textual input so that 17470 ; this option shows up in the question mark menu. 17471 ; 17472 ; It makes either learning the command or being reminded about it a 17473 ; more pleasing if not easier experience. It also cuts COMND% 17474 ; overhead down by a JSYS, which is probably not detectable in all but 17475 ; the most extreme of circumstances. 17476 ; 17477 ; This all works because we don't need to default the parse to know 17478 ; what the default values are. 17479 ; 17480 ; INPUT and OUTPUT were all revisited because making Kermit Batch 17481 ; compliant forced far greater usage for testing purposes. 17482 17483 remark Switch values for INPUT and TRANSMIT 17484 17485 000000 %eofsw==0 ;[229] We parsed the EOF switch 17486 000001 %silsw==1 ;[229] We parsed the 'silent' switch 17487 000002 %timsw==2 ;[229] We parsed the 'timeout' switch 17488 000003 %maxsw==3 ;[265] We parsed the 'maximum' (length) switch 17489 000004 %tpasw==4 ;[266] We parsed the 'pause' switch 17490 000005 %tcasw==5 ;[273] We parsed the 'case' switch 17491 17492 17493 ;[229] %table puts stuff in the correct .psect 17494 17495 000045'02 000000 000000 %table (inpswi) ;[229] The INPUT switch table 17496 000046'02 000000# 000001 %key2 , %silsw ;[229] Tells $input to shut up about matches 17497 000036'03 163 151 154 145 156 17498 000045'02 000001 000001 %tbend ;[229] End of table 17499 17500 chgsec(code,const) ;;Chained FDB's go in const 17501 000047'02 003000 000053' inpswf: flddb. .cmswi,,inpswi,,,inpfdb 17502 000050'02 000000 000045' 17503 000051'02 003000 000053' inpsw1: flddb. .cmswi,,inpswi,,,inpfdb ;[274] 17504 000052'02 000000 000045' 17505 17506 000053'02 015004 000061' inpfdb: flddb. .cmflt,,^d10,,,txtfdb 17507 000054'02 000000 000012 17508 000055'02 44 07 0 00 004162' 17509 000056'02 015004 000064' inpfd1: flddb. .cmflt,,^d10,,,txtfd1 ;[274] 17510 000057'02 000000 000012 17511 000060'02 44 07 0 00 004162' 17512 17513 000061'02 010004 000064' txtfdb: flddb. .cmcfm,,,,,txtfd1 17514 000062'02 000000 000000 17515 000063'02 44 07 0 00 004172' 17516 000064'02 021004 000067' txtfd1: flddb. .cmqst,,,,,txtfd2 17517 000065'02 000000 000000 17518 000066'02 44 07 0 00 004200' 17519 000067'02 017004 000000 txtfd2: flddb. .cmtxt,,,,, K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-1 K20IOC MAC 12-May-24 20:27 INPUT command parsing 17520 000070'02 000000 000000 17521 000071'02 44 07 0 00 004210' 17522 retsec ;;Return to code .psect 17523 17524 17525 000142'01 .input: entry .input ; Invoked from K20PAR 17526 000142'01 265 16 0 00 004467' saveac ;[273] Used for control flow and linkages 17527 remark buffer ;[209] Preserve buffer across calls!!! 17528 17529 000143'01 200 10 0 00 000000# move q4, incase ;[273] Load INPUT case matching 17530 000144'01 202 10 0 00 000070* movem q4, pars12 ;[273] Pretend we parsed it 17531 000145'01 200 16 0 00 000000# guide ;[273] Only prompt once 17532 000146'01 260 17 0 00 000121* 17533 000072'02 000000000000# 17534 000033'04 164 151 155 145 157 17535 17536 000147'01 403 01 0 00 000002 .inpu0: setzb t1, t2 ;[209] Cons up some .chnuls 17537 000150'01 124 01 0 00 000000* dmovem t1, atmbuf ;[209] Give the atom buffer a good scrub a dub 17538 17539 000151'01 201 01 0 00 000000# movei t1, inpswf ;[212] Pointer to full menu 17540 000152'01 332 00 0 00 000137* skipe definf ;[274] BUT! Not in a DEFINE? 17541 000153'01 201 01 0 00 000000# movei t1, inpsw1 ;[274] No, we are, so don't parse for the confirm!! 17542 000154'01 260 17 0 00 000125* call rfield ;[190] Finally parse something 17543 000155'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[212] Get function code. 17544 17545 000156'01 302 05 0 00 000003 caie q1, .cmswi ;[229] Did we get a switch? 17546 000157'01 254 00 0 00 000177' ifskp. ;[229] We did, handle it 17547 000160'01 415 16 0 00 000171' block. ;[229] Enter block for better control flow 17548 000161'01 261 17 0 00 000016 17549 000162'01 550 07 0 02 000000 hrrz q3, (t2) ;[229] Pick up the switch value 17550 000163'01 302 07 0 00 000001 caie q3, %silsw ;[229] Parsed the 'silent' switch? 17551 000164'01 254 00 0 00 000167' ifskp. ;[229] We did, so that should be easy enough 17552 000165'01 476 00 0 00 000000* setom pars8 ;[229] Just flag it in the parse block 17553 000166'01 254 00 0 00 000000* retskp ;[229] Return for next switch 17554 000167'01 endif. ;[229] End 'silent' switch case 17555 000167'01 263 17 0 00 000000 ret ;[229] Otherwise, some kind of bogus switch 17556 000170'01 263 17 0 00 000000 endbk. ;[229] End Block context 17557 000171'01 254 00 0 00 000174' ifskp. ;[229] Successful switch parse 17558 000172'01 254 00 0 00 000147' jrst .inpu0 ;[229] Go see if more switches (or device or file) 17559 000173'01 254 00 0 00 000177' else. ;[229] Otherwise, some kind of error 17560 000174'01 200 01 0 00 000000# emsg ;[229] This is an internal programming error 17561 000175'01 104 00 0 00 000313 17562 000073'02 000000000000# 17563 000035'04 125 156 153 156 157 17564 000176'01 254 00 0 00 000064* jrst cmder1 ;[229] However, allow reparse 17565 000177'01 endif. ;[229] End of switch block processing 17566 000177'01 endif. ;[229] End of .cmswi case 17567 17568 000177'01 302 05 0 00 000010 caie q1, .cmcfm ;[209] Confirmation? 17569 000200'01 254 00 0 00 000204' ifskp. ;[209] Yes, let's default everything 17570 000201'01 120 01 0 00 000000# dmove t1, indeft ;[209] Load default millisecond and floating values 17571 000202'01 124 01 0 00 000134* dmovem t1, pars4 ;[209] Store them as if they were parsed 17572 000203'01 254 00 0 00 000237' jrst .inpu2 ;[209] Go handle it as if we parsed this as a string 17573 000204'01 endif. ;[209] Either way, must 'recompile' the search 17574 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-2 K20IOC MAC 12-May-24 20:27 INPUT command parsing 17575 000204'01 302 05 0 00 000015 caie q1, .cmflt ;[212] Parsed a floating number? 17576 000205'01 254 00 0 00 000223' ifskp. ;[212] Yes, check it 17577 000206'01 325 02 0 00 000213' ifl. t2 ;[212] Is the number in the right range? 17578 000207'01 200 01 0 00 000000# emsg ;[212] Yah silly!! 17579 000210'01 104 00 0 00 000313 17580 000074'02 000000000000# 17581 000042'04 101 040 156 145 147 17582 000211'01 254 00 0 00 000176* jrst cmder1 ;[212] Allow reparse 17583 000212'01 254 00 0 00 000222' else. 17584 000213'01 260 17 0 00 000052* call chksec ;[212] Ensure number is in correct range 17585 000214'01 254 00 0 00 000217' ifskp. ;[212] Check and convert OK? Then side-effect variables 17586 000215'01 254 00 0 00 000226' jrst .inpu1 ;[212] Yes, then carry on to parse a string to find 17587 000216'01 254 00 0 00 000222' else. ;[212] Otherwise, couldn't swallow something 17588 000217'01 200 01 0 00 000000# emsg ;[212] 17589 000220'01 104 00 0 00 000313 17590 000075'02 000000000000# 17591 000052'04 111 156 160 165 164 17592 000221'01 254 00 0 00 000211* jrst cmder1 ;[212] Allow reparse 17593 000222'01 endif. ;[212] End case checking and conversion 17594 000222'01 endif. ;[212] End case special messaging check 17595 remark ;[212] Falls out to parse txtfdb 17596 000222'01 254 00 0 00 000226' else. ;[212] Else never got a number 17597 000223'01 120 01 0 00 000000# dmove t1, indeft ;[212] Load default millisecond and floating values 17598 000224'01 124 01 0 00 000202* dmovem t1, pars4 ;[212] Store them as if they were parsed 17599 000225'01 254 00 0 00 000237' jrst .inpu2 ;[212] Go handle the string we parsed 17600 000226'01 endif. ;[212] End case parsed a floating nuber (or not) 17601 17602 ;[208] Originally shut off indirection, but since quoted strings allow us 17603 ; to put in an at-sign (@) as well as escape sequences, this was 17604 ; removed to allow backward compatibility with any take files which 17605 ; rely on this. 17606 17607 000226'01 200 16 0 00 000000# .inpu1: guide ;[190] Guide us to type the next thing 17608 000227'01 260 17 0 00 000146* 17609 000076'02 000000000000# 17610 000061'04 163 164 162 151 156 17611 000230'01 403 01 0 00 000002 setzb t1, t2 ;[209] Cons up some .chnuls 17612 000231'01 124 01 0 00 000150* dmovem t1, atmbuf ;[209] Give the atom buffer a good scrub a dub 17613 000232'01 201 01 0 00 000000# movei t1, txtfdb ;[209] Parse some kind of input text 17614 000233'01 332 00 0 00 000152* skipe definf ;[274] BUT! Not in a DEFINE? 17615 000234'01 201 01 0 00 000000# movei t1, txtfd1 ;[274] No, we are, so don't parse for the confirm!! 17616 000235'01 260 17 0 00 000154* call rfield ;[209] Get an input string 17617 000236'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[212] Get function code again 17618 17619 000237'01 .inpu2: remark ;[209] Here if .cmcfm was only thing typed 17620 000237'01 302 05 0 00 000010 caie q1, .cmcfm ;[209] Confirmation? 17621 000240'01 254 00 0 00 000251' ifskp. ;[209] Yes, let's default the search 17622 000241'01 333 01 0 00 000000# skiple t1, indefw ;[209] But!! Do we have a default string? 17623 000242'01 254 00 0 00 000246' ifskp. ;[209] No, so use wired default 17624 000243'01 205 01 0 00 064240 movx t1, < byte (7) .chcrt, .chlfd > ;[209] Which fits in 18 bits 17625 000244'01 202 01 0 00 000231* movem t1, atmbuf ;[209] Store NUL terminated bare CR-LF sequence 17626 000245'01 254 00 0 00 000250' else. ;[209] Otherwise, have a default, so drop that in 17627 dmove t2, [ indefs ;[209] Load address of default expanded string 17628 000246'01 120 02 0 00 004512' atmbuf] ;[209] Load address of match string buffer 17629 000247'01 123 01 0 00 004511' xblt. t1 ;[209] Stomp into place K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-3 K20IOC MAC 12-May-24 20:27 INPUT command parsing 17630 000250'01 endif. ;[209] End case hardwired default 17631 000250'01 202 05 0 00 000003* movem q1, pars3 ;[209] Let any caller know what we're doing 17632 000251'01 endif. ;[209] Continue with atom buffer properly conditioned 17633 17634 000251'01 403 01 0 00 000002 setzb t1, t2 ;[209] Cons up some NUL's 17635 000252'01 124 01 0 00 000000* dmovem t1, strbuf ;[209] Get string match buffer into a known state 17636 000253'01 200 02 0 00 004514' move t2,[point 7,atmbuf] ;[209] Let's see what's in the atom buffer 17637 000254'01 134 01 0 00 000002 ildb t1, t2 ;[209] Get the first byte 17638 000255'01 322 01 0 00 000264' ifn. t1 ;[209] Only if not .CHNUL 17639 000256'01 200 01 0 00 000010 move t1, q4 ;[273] Pass in case observance 17640 000257'01 260 17 0 00 001335' call bsrchs ;[209] Build a search string from it 17641 000260'01 254 00 0 00 000221* jrst cmder1 ;[209] Failed, allow reparse 17642 000261'01 336 00 0 00 000252* skipn strbuf ;[209] Did anything go in there?? 17643 000262'01 254 00 0 00 000264' anskp. ;[209] Nope, maybe was a "\0" or some such 17644 000263'01 254 00 0 00 000265' else. ;[209] Otherwise, some bad thing 17645 000264'01 402 00 0 00 000077* setzm strc ;[209] We surely have no characters to match 17646 000265'01 endif. ;[209] Otherwise, not searching (sigh) 17647 000265'01 402 00 0 00 000000* setzm pars6 ;[209] Say we're handling the control-C 17648 000266'01 306 05 0 00 000010 cain q1, .cmcfm ;[209] Have we confirmed our selection? 17649 000267'01 254 00 0 00 000273' ifskp. ;[209] Don't reconfirm, that's confusing 17650 000270'01 332 00 0 00 000233* skipe definf ;[209] BUT!! Are we defining a macro? 17651 000271'01 254 00 0 00 000273' anskp. ;[209] We are, let .define confirm for us 17652 000272'01 260 17 0 00 000140* confrm ;[209] Tie off the line 17653 000273'01 endif. ;[209] 17654 000273'01 263 17 0 00 000000 ret 17655 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20IOC MAC 12-May-24 20:27 INPUT command semantic action 17656 subttl INPUT command semantic action 17657 17658 ;N.B., Note the reordering of the timing JSYi in the routine. The 17659 ; purpose is to prevent us from getting caught with some stray 17660 ; TIMER% interrupt. So we clear timers BEFORE activating the timer 17661 ; channel and disable the channel BEFORE clearing any timers. 17662 17663 000274'01 $input: entry $input ;[194] 17664 17665 000274'01 337 02 0 00 000224* skipg t2, pars4 ;[212] Integer milliseconds 17666 000275'01 254 00 0 00 000302' ifskp. ;[212] Wants time outs, so set them 17667 000276'01 332 00 0 00 000265* skipe pars6 ;[229] Did we already do this? 17668 000277'01 254 00 0 00 000302' anskp. ;[229] Yes, so don't stomp TRANSMIT 17669 000300'01 201 01 0 00 000626' movei t1, looptm ;[209] Go to loop time out exit 17670 000301'01 260 17 0 00 000000* call timeon ;[209] Set the timer for it 17671 000302'01 endif. ;[212] 17672 17673 ; Condition line, set up Control-C trap 17674 17675 000302'01 332 00 0 00 000276* $inp4a: ifme. pars6 ;[209] Are we handling the ^C? 17676 000303'01 254 00 0 00 000306' 17677 000304'01 260 17 0 00 000000* call ccon ; Turn on ^C trap. 17678 000305'01 254 00 0 00 000362' jrst $inpuy ; If ^C typed, go to this place. 17679 000306'01 endif. ;[209] End case possible ^C override 17680 17681 000306'01 332 00 0 00 000000* ifme. vtermf ;[194] Calls only make sense for terminals 17682 000307'01 254 00 0 00 000316' 17683 000310'01 332 00 0 00 000302* skipe pars6 ;[209] Is somebody else doing this? 17684 000311'01 254 00 0 00 000316' anskp. ;[262] Yes, so leave the terminal alone 17685 000312'01 260 17 0 00 000000* call dobits ; Condition the line for i/o. 17686 000313'01 263 17 0 00 000000 ret ; Pass along any failure. 17687 000314'01 260 17 0 00 000000* call ttyob ; Put TTY in binary mode for output only. 17688 000315'01 260 17 0 00 000000* call doarpa ;[262] Also tweak TVT's binary mode if TVT 17689 000316'01 endif. ;[262] Otherwise, MTOPR%'s will blow up 17690 17691 000316'01 254 00 0 00 000405' callret netins ;[262] Dispatch to Network Input Matcher 17692 17693 repeat 0,< ;[262] 17694 17695 $inpu5: move t4, [point 7, strbuf] ; Point to the search string. 17696 17697 $inpu6: skipn strc ; Is there a search string? 17698 jrst $inpu7 ; No, just go forever. 17699 ildb t3, t4 ; Get a character from search string. 17700 jumpe t3, $inpux ; If no more, then success. 17701 ;... K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20IOC MAC 12-May-24 20:27 INPUT command semantic action 17702 17703 ;...$INPUT, cont'd 17704 17705 ; Get & echo a character, compare with current position in search string. 17706 17707 ;[204] Maybe rethink this BIN% loop, it's got a high JSYS overhead 17708 ; In other words, when should we call netins? Changed to ALWAYS 17709 ; call netins, so this is not vestigial and probably will no longer 17710 ; work. 17711 17712 $inpu7: skipg t1, netjfn ;[186] Now get a character from the line. 17713 move t1, ttyjfn ;[186] Not network, using local 17714 setz t2, 17715 BIN 17716 ifje. r ;[186] Failed?? 17717 caie t1, IOX4 ;[186] Unexpected end of file? 17718 %ermsg (,$inpux) ;[186] Something else, so just drop dead 17719 jrst $inpu9 ;[186] Handle like a time out 17720 endif. ;[186] 17721 block. ;[257] Enter block context for better control flow 17722 move t1, parity ;[257] Load the parity 17723 cain t1, none ;[257] Doing anything? 17724 retskp ;[257] No, so let's say good parity 17725 skipn parrck ;[257] Are we checking on receive? 17726 retskp ;[257] Nope, so nothing to and everything is fine 17727 move t1, t2 ;[257] Load the character up for parity routines 17728 call @parity ;[257] and generate parity for it 17729 came t1, t2 ;[257] Are they the same?? 17730 ret ;[257] No, bad parity 17731 retskp ;[257] Yes, GOOD parity 17732 endbk. ;[257] End of block context 17733 ifskp. ;[257] Good parity 17734 ifme. pars8 ;[229] Only if not /SILENT 17735 move t1, t2 ;[257] Load the character for echoing 17736 andi t1, ^o177 ;[257] Strip any parity; Tops-20 will generate 17737 PBOUT 17738 endif. ; pars8 ;[229] 17739 else. ;[257] Otherwise, bad parity 17740 aos ttipar ;[257] Count a bad character 17741 ifme. paract ;[258] Is the parity action to abort? 17742 %ermsg (,$inpux) ;[257] Complain, 17743 else. ;[258] Otherwise, action is proceed, so carry on 17744 move t2,parsub ;[258] Load substitution character and use that, instead 17745 andi t1, ^o177 ;[257] Stomp any parity for comparisons 17746 endif. ;[257] End case maybe doing parity 17747 endif. ;[258] End case bad parity action decision 17748 17749 skipg t1, sesjfn ;[195] Session logging? 17750 ifskp. ;[195] Some kind of JFN 17751 skipn sesflg ;[195] Is logging active? 17752 anskp. ;[195] No, so don't log it 17753 cain t1, .nulio ;[264] Just dumping it? 17754 anskp. ;[264] Yes, so bum the itty bitty BOUT% 17755 BOUT ; Yes, record the character in the log. 17756 erjmpr .+1 ;[195] Catch and ignore error K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-1 K20IOC MAC 12-May-24 20:27 INPUT command semantic action 17757 endif. ;[195] 17758 17759 ifme. pars12 ;[273] ;[194] Case-INsensitive compare? 17760 cail t2, "a" ; No, is this a lower case letter? 17761 caile t2, "z" 17762 anskp. ;[194] Not lower case 17763 txz t2, 40 ; Yes, convert to upper. 17764 endif. ;[194] 17765 17766 camn t2, t3 ; Compare OK? 17767 jrst $inpu6 ; Yes, get next from string and comm line. 17768 jrst $inpu5 ; No, rewind search string, get next from line. 17769 17770 >;REPEAT 0 ;[262] 17771 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20IOC MAC 12-May-24 20:27 Come here upon input timeout. 17772 subttl Come here upon input timeout. 17773 17774 000317'01 332 00 0 00 000000# $inpu9: ifme. intima ;[187] Proceeding? 17775 000320'01 254 00 0 00 000325' 17776 txmsg < 17777 000321'01 200 01 0 00 000000# %KERMIT-20: INPUT timed out looking for "> ;[187] 17778 000322'01 104 00 0 00 000076 17779 000323'01 320 12 0 00 000324' 17780 000077'02 000000000000# 17781 000065'04 015 012 045 113 105 17782 000324'01 254 00 0 00 000327' else. ;[187] Otherwise an error, so not proceeding 17783 000325'01 200 01 0 00 000000# emsg ;[187] ;" 17784 000326'01 104 00 0 00 000313 17785 000100'02 000000000000# 17786 000076'04 113 105 122 115 111 17787 000327'01 endif. ;[187] Error message if quitting (for batch) 17788 17789 000327'01 561 01 0 00 000261* hrroi t1, strbuf ; Tell what string we couldn't find. 17790 000330'01 104 00 0 00 000076 PSOUT 17791 17792 000331'01 332 00 0 00 000000# ifme. intima ;[187] Proceeding? 17793 000332'01 254 00 0 00 000337' 17794 txmsg <", proceeding... 17795 000333'01 200 01 0 00 000000# > ;" ;[187] Say what we're doing, proceeding 17796 000334'01 104 00 0 00 000076 17797 000335'01 320 12 0 00 000336' 17798 000101'02 000000000000# 17799 000107'04 042 054 040 160 162 17800 17801 000336'01 254 00 0 00 000363' jrst $inpux ; Proceeding, just exit from the INPUT command. 17802 000337'01 endif. ;[187] 17803 17804 remark ;[187] Otherwise, not going any further 17805 000337'01 200 01 0 00 000000# txmsg <", quitting > ;" ;[187] ... quitting. 17806 000340'01 104 00 0 00 000076 17807 000341'01 320 12 0 00 000342' 17808 000102'02 000000000000# 17809 000113'04 042 054 040 161 165 17810 17811 000342'01 337 02 0 00 000000* skipg t2, takjfn ;[209] Quitting, are we in a file? 17812 000343'01 254 00 0 00 000360' ifskp. ;[209] We are, so blat and close it 17813 000344'01 201 01 0 00 000101 movei t1, .priou ;[209] No matter what, all output to terminal 17814 000345'01 621 02 0 00 777777 tlz t2, -1 ;[209] Shut off any GTJFN% flags 17815 000346'01 302 02 0 00 377777 caie t2, .nulio ;[209] Just testing? 17816 000347'01 254 00 0 00 000355' ifskp. ;[209] Yes, so special case that 17817 000350'01 120 02 0 00 000000* dmove t2, nul4 ;[209] Load counted special string 17818 000351'01 400 04 0 00 000000 setz t4, ;[209] Just in case 17819 000352'01 104 00 0 00 000053 SOUT% ;[209] Write the NUL: device name 17820 000353'01 320 12 0 00 000354' erjmpr .+1 ;[209] Catch and quietly ignore error 17821 000354'01 254 00 0 00 000360' else. ;[209] Otherwise, a bona fide JFN 17822 000355'01 403 03 0 00 000004 setzb t3, t4 ;[209] No flags and no prefix (whatever that is) 17823 000356'01 104 00 0 00 000030 JFNS% ;[209] Type the actual file name 17824 000357'01 320 12 0 00 000360' erjmpr .+1 ;[209] Catch and quietly ignore error 17825 000360'01 endif. ;[209] End typing some kind of file name 17826 000360'01 endif. K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11-1 K20IOC MAC 12-May-24 20:27 Come here upon input timeout. 17827 17828 000360'01 561 01 0 00 000000* hrroi t1,crlf ;[209] Tie off the line 17829 000361'01 104 00 0 00 000076 PSOUT% 17830 17831 000362'01 260 17 0 00 000000* $inpuy: call popjfn ; Pop the TAKE file JFN from the TAKE stack. 17832 17833 ; Exit thru here, turning off timer, restore line to previous condition. 17834 17835 000363'01 332 00 0 00 000310* $inpux: ifme. pars6 ;[209] Am I handling the ^C? 17836 000364'01 254 00 0 00 000373' 17837 000365'01 260 17 0 00 000000* call ccoff2 ; Turn off ^C trap. 17838 000366'01 332 00 0 00 000306* ifme. vtermf ;[186] Calls only make sense if not virtual 17839 000367'01 254 00 0 00 000373' 17840 000370'01 260 17 0 00 000000* call unbits ; Restore the line 17841 000371'01 260 17 0 00 000000* call ttyou ; Restore controlling tty output. 17842 000372'01 260 17 0 00 000000* call unarpa ;[209] 17843 000373'01 endif. ;[186] Otherwise, MTOPR%'s will break 17844 000373'01 endif. ;[209] End case possible ^C override 17845 17846 000373'01 337 00 0 00 000274* skipg pars4 ;[212] Integer millisecond sleep? 17847 000374'01 254 00 0 00 000376' ifskp. ;[212] Yes, shut off the timers, etc 17848 000375'01 260 17 0 00 000000* call timdel ;[209] Whack any future timers 17849 000376'01 endif. ;[212] End case positive intervale 17850 17851 000376'01 332 00 0 00 000363* skipe pars6 ;[209] Repeated internal call from $TRANS? 17852 000377'01 263 17 0 00 000000 ret ;[209] We're done 17853 17854 000400'01 $inpcl: remark ;[209] Have to clean up post $input 17855 000400'01 403 01 0 00 000002 setzb t1, t2 ;[209] Cons up a double word of zeros 17856 000401'01 124 01 0 00 000264* dmovem t1, strc ;[209] No string, so no length 17857 remark strptr ;[209] Not pointing anywhere 17858 000402'01 124 01 0 00 000327* dmovem t1, strbuf ;[209] Stomp a bit of the search buffer and 17859 000403'01 124 01 0 00 000000* dmovem t1, strbf2 ;[209] also a bit of the translation buffer 17860 remark buffer ;[209] Preserve buffer across calls 17861 17862 000404'01 263 17 0 00 000000 ret 17863 17864 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20IOC MAC 12-May-24 20:27 Network Input Searcher 17865 subttl Network Input Searcher 17866 17867 ;[209] Begin Code Addition 17868 17869 ; Expects bsrchs to have been called for a search structure 17870 ; inpcnt and inpptr to have been kept up to date from last call 17871 17872 000405'01 265 16 0 00 004467' netins: saveac 17873 17874 000406'01 120 05 0 00 000000# dmove q1, inpcnt ; Load current place in input buffer 17875 000407'01 337 07 0 00 000000* skipg q3, netjfn ; Assume network (which can be a physical line) 17876 000410'01 200 07 0 00 000000* move q3, ttyjfn ; Not network, so using login terminal 17877 000411'01 621 07 0 00 777777 tlz q3, -1 ; Either way, no flags 17878 17879 000412'01 do. ; Enter loop context 17880 000412'01 305 05 0 00 005000 caige q1, strblc ; First of all, can we swallow anything else? 17881 000413'01 254 00 0 00 000424' ifskp. ; Nope, try to drain a little off 17882 000414'01 307 05 0 00 000000 caig q1,0 ; BUT!! Nothing read? 17883 000415'01 254 00 0 00 000424' anskp. ; Then go read something 17884 000416'01 200 10 0 00 000005 move q4, q1 ; Save current length 17885 000417'01 260 17 0 00 000646' call matchs ; See if we can match anything 17886 000420'01 334 00 0 00 000000 skipa ; Didn't... 17887 000421'01 254 00 0 00 000622' exit. ; Did!!!!! 17888 000422'01 301 05 0 00 000010 cail q1, q4 ; Was this helpful in any way? 17889 000423'01 254 00 0 00 000630' jrst loopov ; No, we're wedged and can't go any futher.. 17890 000424'01 endif. 17891 000424'01 415 16 0 00 000435' block. ; Kind of clunky, but needed for control flow 17892 000425'01 261 17 0 00 000016 17893 000426'01 do. ; Enter inner loop 17894 000426'01 322 05 0 00 000000* jumpe q1, R ; If nothing read, break out 17895 000427'01 315 05 0 00 000401* camge q1, strc ; Do we have enough to match? 17896 000430'01 263 17 0 00 000000 ret ; No, then get out of loop and block context 17897 000431'01 260 17 0 00 000646' call matchs ; See if we can match anything 17898 000432'01 254 00 0 00 000426' loop. ; Nope, see if we can try again 17899 000433'01 254 00 0 00 000166* retskp ; We did, so pass that on 17900 000434'01 enddo. ; Exit loop lexical context 17901 000434'01 263 17 0 00 000000 endbk. ; Exit Block Context 17902 000435'01 254 00 0 00 000437' ifskp. ; Handle +2 from inner loop 17903 000436'01 254 00 0 00 000622' exit. ; Exit out main loop success!! 17904 000437'01 endif. 17905 000437'01 200 01 0 00 000007 move t1, q3 ; Load JFN to read from 17906 000440'01 104 00 0 00 000050 BIN% ; Wait for something from somebody 17907 000441'01 320 12 0 00 000443' %jserr (,loopio) ;[186] No, die. 17908 000442'01 254 00 0 00 000446' 17909 000443'01 265 01 0 00 000000* 17910 000444'01 000000000000# 17911 000445'01 254 00 0 00 000624' 17912 000116'04 103 157 165 154 144 17913 000446'01 350 00 0 00 000000* aos nbict ;[204] Count a network BIN% 17914 000447'01 415 16 0 00 000465' block. ;[257] Enter block context for better control flow 17915 000450'01 261 17 0 00 000016 17916 000451'01 265 16 0 00 004515' saveac ;[257] Save the JFN while we check context 17917 000452'01 200 01 0 00 000000* move t1, parity ;[257] Load the parity 17918 000453'01 306 01 0 00 003731' cain t1, none ;[257] Doing anything? 17919 000454'01 254 00 0 00 000433* retskp ;[257] No, so let's say good parity K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-1 K20IOC MAC 12-May-24 20:27 Network Input Searcher 17920 000455'01 336 00 0 00 000000# skipn parrck ;[257] Are we checking on receive? 17921 000456'01 254 00 0 00 000454* retskp ;[257] Nope, so nothing to and everything is fine 17922 000457'01 200 01 0 00 000002 move t1, t2 ;[257] Load the character up for parity routines 17923 000460'01 260 17 1 00 000452* call @parity ;[257] and generate parity for it 17924 000461'01 312 01 0 00 000002 came t1, t2 ;[257] Are they the same?? 17925 000462'01 263 17 0 00 000000 ret ;[257] No, bad parity 17926 000463'01 254 00 0 00 000456* retskp ;[257] Yes, GOOD parity 17927 000464'01 263 17 0 00 000000 endbk. ;[257] End of block context 17928 000465'01 254 00 0 00 000471' ifskp. ;[257] Good parity 17929 000466'01 271 05 0 00 000001 addi q1, ^d1 ; Count a character to do 17930 000467'01 136 02 0 00 000006 idpb t2, q2 ; Drop into the (7 bit) output buffer 17931 000470'01 254 00 0 00 000505' else. ;[257] Otherwise, bad parity 17932 000471'01 350 00 0 00 000000* aos ttipar ;[257] Count a bad character 17933 000472'01 332 00 0 00 000000# ifme. paract ;[258] Is parity action abort? 17934 000473'01 254 00 0 00 000502' 17935 000474'01 334 00 0 00 000000 %ermsg (,loopio) ;[257] Complain, 17936 000475'01 254 00 0 00 000501' 17937 000476'01 265 01 0 00 000443* 17938 000477'01 000000000000# 17939 000500'01 254 00 0 00 000624' 17940 000125'04 102 141 144 040 160 17941 000501'01 254 00 0 00 000505' else. ;[258] Otherwise, action is proceed, so carry on 17942 000502'01 271 05 0 00 000001 addi q1, ^d1 ;[258] Count a character to do 17943 000503'01 200 02 0 00 000000# move t2,parsub ;[258] Load substitution character 17944 000504'01 136 02 0 00 000006 idpb t2, q2 ;[258] Drop into the (7 bit) output buffer 17945 000505'01 endif. ;[258] End case bad parity action decision 17946 000505'01 endif. ;[257] End case maybe doing parity 17947 000505'01 260 17 0 00 000000* call clrest ; Find out how much, if anything, remains 17948 000506'01 254 00 0 00 000624' jrst loopio ; Already complained, so break loop context 17949 000507'01 201 03 0 00 005000 movei t3, strblc ; Load maximum buffer length 17950 000510'01 274 03 0 00 000005 sub t3, q1 ; Subtract off what is already in there 17951 000511'01 274 03 0 00 000001 sub t3, t1 ; Next, subtract how much we could use 17952 000512'01 305 03 0 00 000000 caige t3, 0 ; Not enough buffer space? 17953 000513'01 270 01 0 00 000003 add t1, t3 ; 'Subtract' off the excess (add negative) 17954 000514'01 323 01 0 00 000615' ifg. t1 ; OK, is there anything for us to read? 17955 000515'01 270 05 0 00 000001 add q1, t1 ; Accumulate in total 17956 000516'01 313 01 0 00 000000* camle t1, nsimx ; Smaller than biggest? 17957 000517'01 202 01 0 00 000516* movem t1, nsimx ; Nope, we have a new winner 17958 000520'01 272 01 0 00 000000* addm t1, nsitc ; Update Network SIN% total characters read 17959 000521'01 350 00 0 00 000000* aos nsici ; Update Network SIN%'s Issued 17960 000522'01 210 03 0 00 000001 movn t3, t1 ; Load exact amount to read 17961 000523'01 415 16 0 00 000534' block. ;[257] Enter block context for better control flow 17962 000524'01 261 17 0 00 000016 17963 000525'01 200 01 0 00 000460* move t1, parity ;[257] Load the parity 17964 000526'01 306 01 0 00 003731' cain t1, none ;[257] Doing anything? 17965 000527'01 263 17 0 00 000000 ret ;[257] No, so that's fine 17966 000530'01 336 00 0 00 000000# skipn parrck ;[257] Are we checking on receive? 17967 000531'01 263 17 0 00 000000 ret ;[257] Nope, so nothing to do and everything is fine 17968 000532'01 254 00 0 00 000463* retskp ;[257] Otherwise, doing parity 17969 000533'01 263 17 0 00 000000 endbk. ;[257] End control block 17970 000534'01 254 00 0 00 000537' ifskp. ;[257] If doing parity, must do an eight bit read 17971 000535'01 200 02 0 00 004523' move t2,[point 8,datbuf] ;[257] So load a pointer to a different area 17972 000536'01 254 00 0 00 000540' else. ;[257] No parity, so a seven bit read will suffice 17973 000537'01 200 02 0 00 000006 move t2, q2 ; Keep reading into the buffer 17974 000540'01 endif. ;[257] End control block return handling K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-2 K20IOC MAC 12-May-24 20:27 Network Input Searcher 17975 000540'01 200 01 0 00 000007 move t1, q3 ; Reload the JFN 17976 000541'01 200 04 0 00 000003 move t4, t3 ;[257] Save a copy of negative length in ignored t4 17977 000542'01 104 00 0 00 000052 SIN% ; Get that data! 17978 000543'01 320 12 0 00 000545' ifje. r ; Failed?? 17979 000544'01 254 00 0 00 000555' 17980 000545'01 200 06 0 00 000002 move q2, t2 ; Update what we did read 17981 000546'01 270 05 0 00 000003 add q1, t3 ; 'Subtract' from used (t3 is negative) 17982 000547'01 272 03 0 00 000520* addm t3, nsitc ; Correct Network SIN% total characters NOT read 17983 000550'01 334 00 0 00 000000 %ermsg (,loopio) ; No, go drop dead 17984 000551'01 254 00 0 00 000555' 17985 000552'01 265 01 0 00 000476* 17986 000553'01 000000000000# 17987 000554'01 254 00 0 00 000624' 17988 000135'04 103 157 165 154 144 17989 000555'01 endif. 17990 000555'01 415 16 0 00 000600' block. ;[257] Enter block context for better control flow 17991 000556'01 261 17 0 00 000016 17992 000557'01 265 16 0 00 004524' saveac ;[257] Save registers for movslj 17993 000560'01 200 01 0 00 000525* move t1, parity ;[257] Load the parity 17994 000561'01 306 01 0 00 003731' cain t1, none ;[257] Doing anything? 17995 000562'01 254 00 0 00 000532* retskp ;[257] No, so let's say good parity 17996 000563'01 336 00 0 00 000000# skipn parrck ;[257] Are we checking on receive? 17997 000564'01 254 00 0 00 000562* retskp ;[257] Nope, so nothing to and everything is fine 17998 000565'01 200 02 0 00 004523' move t2,[point 8,datbuf] ;[257] Reload pointer to 8 bit input area 17999 000566'01 200 03 0 00 000004 move t3, t4 ;[257] Load original length 18000 000567'01 260 17 0 00 004375' call chkpaa ;[257] Check the parity (always) 18001 000570'01 263 17 0 00 000000 ret ;[257] Bad, propagate non-skip return 18002 000571'01 213 01 0 00 000004 movns t1, t4 ;[257] Using positive equal lengths 18003 000572'01 200 05 0 00 000006 move q1, q2 ;[257] Destination (seven bit) pointer 18004 000573'01 403 03 0 00 000006 setzb t3, q2 ;[257] Section local pointers 18005 000574'01 123 01 0 00 000640' extend t1, movsup ;[257] Convert from 7 to 8 bit 18006 000575'01 600 00 0 00 000000 nop ;[257] It will never not skip 18007 000576'01 254 00 0 00 000564* retskp ;[257] Give good return 18008 000577'01 263 17 0 00 000000 endbk. ;[257] End of block context 18009 000600'01 254 00 0 00 000605' ifskp. ;[257] Good parity 18010 000601'01 210 02 0 00 000004 movn t2,t4 ;[257] Turn into a positive 18011 000602'01 133 02 0 00 000006 adjbp t2, q2 ;[257] Fix up the correct location 18012 000603'01 200 06 0 00 000002 move q2, t2 ; Keep track of where we are in the buffer 18013 000604'01 254 00 0 00 000615' else. ;[257] Otherwise, bad parity 18014 000605'01 350 00 0 00 000471* aos ttipar ;[257] Count a bad parity detected 18015 000606'01 260 17 0 00 001203' call inpclr ;[258] Flush the buffer 18016 000607'01 120 05 0 00 000000# dmove q1, inpcnt ;[258] Reseed the loop registers 18017 000610'01 334 00 0 00 000000 %ermsg (,loopio) ;[257] Complain, 18018 000611'01 254 00 0 00 000615' 18019 000612'01 265 01 0 00 000552* 18020 000613'01 000000000000# 18021 000614'01 254 00 0 00 000624' 18022 000143'04 102 141 144 040 160 18023 000615'01 endif. ;[257] End case maybe doing parity 18024 000615'01 endif. ;ifg. t1 ; End SIN% data read 18025 000615'01 315 05 0 00 000427* camge q1, strc ; Do we have enough to match? 18026 000616'01 254 00 0 00 000412' loop. ; No, get some more goodies 18027 000617'01 260 17 0 00 000646' call matchs ; See if we can match the search string 18028 000620'01 254 00 0 00 000412' loop. ; Didn't match 18029 000621'01 254 00 0 00 000622' exit. ; We did, so we're done K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-3 K20IOC MAC 12-May-24 20:27 Network Input Searcher 18030 000622'01 enddo. ; Exit loop context 18031 18032 000622'01 124 05 0 00 000000# dmovem q1, inpcnt ; Store updated buffer count and position 18033 000623'01 254 00 0 00 000363' jrst $inpux ; Success!!! 18034 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20IOC MAC 12-May-24 20:27 Various loop error handlers 18035 subttl Various loop error handlers 18036 18037 000624'01 loopio: remark ; Here for an I/O error 18038 000624'01 124 05 0 00 000000# dmovem q1, inpcnt ; Store updated buffer count and position 18039 000625'01 254 00 0 00 000362' jrst $inpuy ; Pop any take JFN's, disable ^C, timers, Etc. 18040 18041 000626'01 looptm: remark ; Here for assumed timer errors 18042 000626'01 124 05 0 00 000000# dmovem q1, inpcnt ; Store updated buffer count and position 18043 000627'01 254 00 0 00 000317' jrst $inpu9 18044 18045 18046 remark Common Buffer overflow handler 18047 18048 000630'01 loopov: remark ;[209] Here for buffer buffer full 18049 000630'01 124 05 0 00 000000# dmovem q1, inpcnt ; Store updated buffer count and position 18050 000631'01 334 01 0 00 000000# ermsg%(,$inpux) ;[209] Gronk on buffer overflow 18051 000632'01 254 00 0 00 000636' 18052 000633'01 202 01 0 00 000000* 18053 000634'01 104 00 0 00 000313 18054 000635'01 254 00 0 00 000363' 18055 000103'02 000000000000# 18056 000153'04 113 105 122 115 111 18057 18058 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20IOC MAC 12-May-24 20:27 Match String Overview and String Instructions 18059 subttl Match String Overview and String Instructions 18060 18061 ; The purpose of the routine below is to change the former search 18062 ; search paradigm from a byte at a time comparison to support a 18063 ; buffered approach while also benefiting from the use of string 18064 ; instructions. 18065 ; 18066 ; It is not the overhead of a ildb/idpb loop that is being saved so 18067 ; much as the JSYS overhead. For every character, both a BIN% and a 18068 ; BOUT% were needed, which involves the maximum context switching 18069 ; overhead with all that implies. 18070 ; 18071 ; Here, the maximum JSYi that will be executed for any read and print 18072 ; will be 4 of them: BIN%, SIBE%, SIN% and SOUT% (both counted for 18073 ; speed). This means that if you read more than two characters, you 18074 ; are going to win. 18075 ; 18076 ; This code is driven by the main loop in netins, which reads as much 18077 ; input as it can get until the threshold of the length of the search 18078 ; string is hit. At that point, this routine is invoked to see if 18079 ; there is a match. 18080 ; 18081 ; Simply put, the code uses a MOVST to trigger on the first character 18082 ; of the string. If the character is never hit, then the search 18083 ; criteria are not met and we return +1. In this case, we have 18084 ; effectedly searched through the entire contents of the buffer and 18085 ; need merely print and reset it via the ntriger exit. If the 18086 ; character is hit, then a CMPSE instruction is used to determine if 18087 ; the rest of the string matches. 18088 ; 18089 ; Whatever does not match is printed and removed from the network 18090 ; buffer. This operation is known here as a 'pull up' and is done 18091 ; with a MOVSLJ. 18092 ; 18093 ; Some of the extra code here is to handle caseless compares. Because 18094 ; the string compare instructions are case sensitive, we have to 18095 ; uppercase everythingt we compare first. 18096 ; 18097 ; However, the bulk of the code is to handle buffer management and, in 18098 ; particular, all the edge cases: single character search strings, a 18099 ; single character the buffer, matching on the last character, but 18100 ; still having remaining characters to compare, Etc. 18101 18102 remark ; Various Extended Instructions 18103 18104 000636'01 015 00 0 00 000000# m1stch: movst 0, sertab ; Use constructed trigger table 18105 000637'01 000000 000000 .chnul ; No fill, acually 18106 18107 000640'01 016 00 0 00 000000 movsup: movslj 0,0 ; Move string left justified (fastest) 18108 000641'01 000000 000000 .chnul ; Fill character (never used in this case) 18109 18110 000642'01 cmprmn: intern cmprmn ; Also used in k20tim to double check parity 18111 000642'01 002 00 0 00 000000 cmpse 0,0 ; Compare and skip if equal 18112 000643'01 000000 000000 .chnul ; Fill character 1 18113 000644'01 000000 000000 .chnul ; Fill character 2 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14-1 K20IOC MAC 12-May-24 20:27 Match String Overview and String Instructions 18114 18115 000645'01 44 07 0 00 000403* str2bp: point 7, strbf2 ; Handy place to dump translated data 18116 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20IOC MAC 12-May-24 20:27 Match String Routine 18117 subttl Match String Routine 18118 18119 ; Entry 18120 ; 18121 ; q1/ Count of characters in network buffer 18122 ; q2/ Pointer into network buffer 18123 ; 18124 ; Exit: 18125 ; 18126 ; +1/ Didn't find the search string 18127 ; +2/ Successfully found the first instance of it (there may be others) 18128 ; 18129 ; In both cases, return with: 18130 ; 18131 ; q1/ Updated count of characters in network buffer 18132 ; q2/ Updated pointer to the end network buffer 18133 ; 18134 ; These are are either directly returned by matchs or indirectly by 18135 ; ntrigr. 18136 ; 18137 ; Note, we always have to back the source pointer up before the match 18138 ; character so that we can match the entire string. If we've skipped 18139 ; the match character and just compare the suffix string (like we used 18140 ; to do...) and it is the last thing in the buffer, then we will do 18141 ; the wrong thing after we come back from refilling the buffer (like 18142 ; we did in an earlier version...) 18143 ; 18144 ; To do: Possibly some of the exit code is really replicated. Maybe 18145 ; see what could be reasonably combined. On the other hand, it 18146 ; finally works... 18147 ; 18148 ; If doing an exact match, could bum the second MOVST which is just 18149 ; then a MOVSLJ. Would need to fix up the linkages. And it 18150 ; finally works... 18151 18152 000646'01 327 05 0 00 000655' matchs: ifle. q1 ; First of all, is there anything to do? 18153 000647'01 334 01 0 00 000000# ermsg% (,r) ; Program logic error 18154 000650'01 254 00 0 00 000654' 18155 000651'01 202 01 0 00 000633* 18156 000652'01 104 00 0 00 000313 18157 000653'01 254 00 0 00 000426* 18158 000104'02 000000000000# 18159 000162'04 113 105 122 115 111 18160 18161 000654'01 254 00 0 00 000663' else. ; Otherwise, do we have enough to chew on? 18162 000655'01 315 05 0 00 000615* camge q1, strc ; Enough to match our search string? 18163 000656'01 334 01 0 00 000000# ermsg% (,r) ; Another bogon 18164 000657'01 254 00 0 00 000663' 18165 000660'01 202 01 0 00 000651* 18166 000661'01 104 00 0 00 000313 18167 000662'01 254 00 0 00 000653* 18168 000105'02 000000000000# 18169 000175'04 113 105 122 115 111 18170 18171 000663'01 endif. ; OK, so let's try to do something useful K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-1 K20IOC MAC 12-May-24 20:27 Match String Routine 18172 18173 000663'01 265 16 0 00 004540' saveac 18174 000664'01 120 07 0 00 000005 dmove q3, q1 ; Save current network buffer length and position 18175 18176 000665'01 210 02 0 00 000007 movn t2, q3 ; Load negative count of buffer contents 18177 000666'01 133 02 0 00 000010 adjbp t2, q4 ; Back source up to beginning of network data 18178 000667'01 200 11 0 00 000002 move q5, t2 ; Save beginning of network data for later 18179 000670'01 332 00 0 00 000655* ifme. strc ; But!! Anything to search for?? 18180 000671'01 254 00 0 00 000675' 18181 000672'01 400 01 0 00 000000 setz t1, ; Fine, say we looked through all of it 18182 000673'01 260 17 0 00 001121' call ntrigr ; Go ditch all of it 18183 000674'01 254 00 0 00 000576* retskp ; Return success; matching everying ... 18184 000675'01 endif. 18185 18186 000675'01 200 01 0 00 000007 move t1, q3 ; Length we'll look at; total contents 18187 000676'01 200 04 0 00 000001 move t4, t1 ; Force equal lengths so no filling occurs 18188 000677'01 200 14 0 00 000001 move p4, t1 ; Save this length for later 18189 000700'01 200 05 0 00 000645' move q1, str2bp ; Destination is the translation buffer 18190 000701'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 18191 000702'01 621 01 0 00 700000 txz t1, S!N!M ; No need to translate until we hit the match 18192 000703'01 123 01 0 00 000636' extend t1, m1stch ; Trigger on MOVST termination code 18193 000704'01 600 00 0 00 000000 nop ; Ignore any skip (which should never happen) 18194 000705'01 120 12 0 00 000001 dmove p2, t1 ; Save remaining characters and position 18195 000706'01 607 01 0 00 200000 txnn t1, N ; Did we find anything? 18196 000707'01 254 00 0 00 001121' callret ntrigr ; No, go blat, reset the network buffer and return 18197 18198 remark ; Hit trigger, was this the only thing we needed to find? 18199 000710'01 621 01 0 00 700000 txz t1, S!N!M ; Stomp any flags 18200 000711'01 621 12 0 00 700000 txz p2, S!N!M ; in the copy, too 18201 000712'01 200 04 0 00 000670* move t4, strc ; Load match length 18202 000713'01 302 04 0 00 000001 caie t4, ^d1 ; Search string was only one dinky character? 18203 000714'01 254 00 0 00 000750' ifskp. ; Yep, we're done 18204 000715'01 200 14 0 00 000007 move p4, q3 ; Load original length 18205 000716'01 274 14 0 00 000012 sub p4, p2 ; Compute consumed characters 18206 000717'01 332 00 0 00 000165* ifme. pars8 ;[229] Only if not /SILENT 18207 000720'01 254 00 0 00 000733' 18208 000721'01 201 01 0 00 000101 movei t1, .priou ; Typing on the terminal 18209 000722'01 200 02 0 00 000011 move t2, q5 ; Source is where we started 18210 000723'01 210 03 0 00 000014 movn t3, p4 ; How much we'll type 18211 000724'01 325 03 0 00 000733' ifl. t3 ; Don't print if we computed gubbish 18212 000725'01 104 00 0 00 000053 SOUT% ; Counted SOUT% to terminal 18213 000726'01 320 12 0 00 000730' %jserr (,) 18214 000727'01 254 00 0 00 000733' 18215 000730'01 265 01 0 00 000612* 18216 000731'01 000000000000# 18217 000732'01 254 00 0 00 000733' 18218 000212'04 120 162 151 156 164 18219 000733'01 endif. 18220 000733'01 endif. ;[229] 18221 000733'01 120 01 0 00 000012 dmove t1, p2 ; Source is where MOVST stopped 18222 000734'01 326 01 0 00 000740' ife. t1 ; Was this at the END of the buffer? 18223 000735'01 400 05 0 00 000000 setz q1, ; Yes, so just zero out the count 18224 000736'01 200 06 0 00 000011 move q2, q5 ; and reset to the beginning of the buffer 18225 000737'01 254 00 0 00 000674* retskp ; About as easy as it gets 18226 000740'01 endif. ; Otherwise, pull the string up K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-2 K20IOC MAC 12-May-24 20:27 Match String Routine 18227 000740'01 200 04 0 00 000001 move t4, t1 ; Force no filling to occur 18228 000741'01 200 05 0 00 000011 move q1, q5 ; Goes to top of buffer 18229 000742'01 403 03 0 00 000006 setzb t3, q2 ; Just in case 18230 000743'01 123 01 0 00 000640' extend t1, movsup ; Move the string up 18231 000744'01 600 00 0 00 000000 nop ; Ignore +1 (which should never happen) 18232 000745'01 200 06 0 00 000005 move q2, q1 ; Ending destination is where we can now append 18233 000746'01 200 05 0 00 000012 move q1, p2 ; And load characters remaining in buffer 18234 000747'01 254 00 0 00 000737* retskp ; Return success 18235 000750'01 endif. ; Otherwise, do the non-single character case 18236 18237 remark ; First, fix up the pointers to match the string 18238 000750'01 474 13 0 00 000000 seto p3, ; Back up before the skip character 18239 000751'01 133 13 0 00 000002 adjbp p3, t2 ; So we can match the entire string 18240 000752'01 350 12 0 00 000001 aos p2, t1 ; Account for an inconsumed character (preserves flags) 18241 remark p4, ; Still has original length from above 18242 000753'01 200 15 0 00 000645' move p5, str2bp ; Always reset the destination pointer 18243 18244 remark ; Calculate match position 18245 000754'01 200 04 0 00 000007 move t4, q3 ; Load original length 18246 000755'01 274 04 0 00 000001 sub t4, t1 ; Calculate total done 18247 18248 000756'01 323 04 0 00 000760' ifg. t4 ; Anything to print? 18249 000757'01 260 17 0 00 001153' call netprn ; Print what we've seen and what will get tossed 18250 000760'01 endif. ; End case of match being first character 18251 18252 remark ; What we've printed is no longer relevant, chuck it 18253 000760'01 316 07 0 00 000012 camn q3, p2 ; But!! Did we not match at the first character?? 18254 000761'01 254 00 0 00 000773' ifskp. ; We did not, so do the pull up 18255 000762'01 120 01 0 00 000012 dmove t1, p2 ; Source is the last thing we've looked at 18256 000763'01 200 04 0 00 000001 move t4, t1 ; Force no use of fill characters 18257 000764'01 200 05 0 00 000011 move q1, q5 ; Destination is top of buffer 18258 000765'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 18259 000766'01 123 01 0 00 000640' extend t1, movsup ; Move the string up 18260 000767'01 600 00 0 00 000000 nop ; Ignore +1 (which should never happen) 18261 000770'01 200 07 0 00 000012 move q3, p2 ; Update reduced number of characters in network buffer 18262 000771'01 200 10 0 00 000005 move q4, q1 ; New append is ending destination of MOVSLJ 18263 remark p2, ; Unchanged, same number of characters 18264 000772'01 200 13 0 00 000011 move p3, q5 ; But we can start looking at the top of the buffer 18265 000773'01 endif. ; End case of non-1st character in buffer 18266 18267 000773'01 200 01 0 00 000712* move t1, strc ; Load length of match string 18268 000774'01 317 01 0 00 000007 camg t1, q3 ; Is there enough space to do the compare? 18269 000775'01 254 00 0 00 001000' ifskp. ; Nope, so must get some more network data 18270 000776'01 120 05 0 00 000007 dmove q1, q3 ; Return updated pointers 18271 000777'01 263 17 0 00 000000 ret ; Return +1, no match 18272 001000'01 endif. 18273 18274 remark t1, ; Already has source comparsion base length 18275 001000'01 200 11 0 00 000001 move q5, t1 ; No more pull up, so q5 is free 18276 001001'01 200 02 0 00 000013 move t2, p3 ; Where to start translating from 18277 001002'01 200 04 0 00 000001 move t4, t1 ; Transferring or translating equal lengths 18278 001003'01 200 05 0 00 000015 move q1, p5 ; Where to translate to (in translation buffer) 18279 001004'01 403 03 0 00 000006 setzb t3, q2 ; Force local pointers 18280 18281 remark ; A small optmization K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-3 K20IOC MAC 12-May-24 20:27 Match String Routine 18282 001005'01 332 00 0 00 000144* ifme. pars12 ;[273] ; Case insensitive? 18283 001006'01 254 00 0 00 001013' 18284 001007'01 661 01 0 00 400000 txo t1, S ; Immediately start translating 18285 001010'01 123 01 0 00 000000# extend t1, trnbas ; Move the remaining characters 18286 001011'01 600 00 0 00 000000 nop ; Ignore non-skip 18287 001012'01 254 00 0 00 001015' else. ; Otherwise, case sensitive 18288 001013'01 123 01 0 00 000640' extend t1, movsup ; So just copy them and do nothing further 18289 001014'01 600 00 0 00 000000 nop ; Ignore non-skip (which should never happen) 18290 001015'01 endif. 18291 18292 remark ; Set up for the string compare 18293 001015'01 200 01 0 00 000011 move t1, q5 ; Load source length 18294 001016'01 200 02 0 00 000112* move t2, strptr ; Load pointer to search string 18295 001017'01 200 04 0 00 000001 move t4, t1 ; substrings are same length 18296 001020'01 200 05 0 00 000015 move q1, p5 ; Where we wrote the (translated) network data 18297 remark t3, q2 ; These are still zero, forcing local pointers 18298 001021'01 474 00 0 00 000000 seto f, ; Let's assume a match 18299 001022'01 123 01 0 00 000642' extend t1, cmprmn ; Finally, let's compare something!! 18300 001023'01 400 00 0 00 000000 setz f, ; Not the same... 18301 18302 001024'01 326 00 0 00 001054' ife. f ; Didn't match? 18303 001025'01 200 01 0 00 000000# move t1, trgchr ; Load the original trigger character and 18304 001026'01 332 00 0 00 000717* ifme. pars8 ;[229] Not if /SILENT 18305 001027'01 254 00 0 00 001031' 18306 001030'01 104 00 0 00 000074 PBOUT% ; print only that because we're skipping it 18307 001031'01 endif. ;[229] 18308 001031'01 337 01 0 00 000000* skipg t1, sesjfn ; Session logging? 18309 001032'01 254 00 0 00 001042' ifskp. ; Yes, so let's put it in there, too 18310 001033'01 336 00 0 00 000000* skipn sesflg ;[264] Is logging active? 18311 001034'01 254 00 0 00 001042' anskp. ;[264] No, so don't log it 18312 001035'01 306 01 0 00 377777 cain t1, .nulio ;[264] Just dumping it? 18313 001036'01 254 00 0 00 001042' anskp. ;[264] Yes, so bum the itty bitty BOUT% 18314 001037'01 200 02 0 00 000000# move t2, trgchr ; Load the original trigger character again 18315 001040'01 104 00 0 00 000051 BOUT% ; And put it into the log 18316 001041'01 320 12 0 00 001042' erjmpr .+1 ; Catch and ignore error 18317 001042'01 endif. ; End case session logging 18318 001042'01 370 01 0 00 000012 sos t1, p2 ; Account for consumed match character 18319 001043'01 200 04 0 00 000001 move t4, t1 ; Prevent any filling 18320 001044'01 200 05 0 00 000013 move q1, p3 ; Destination is where we started translating from 18321 001045'01 201 02 0 00 000001 movei t2, ^d1 ; Source is one character after that so we 18322 001046'01 133 02 0 00 000005 adjbp t2, q1 ; Overwrite the match character 18323 remark t3, q2 ; These are still zero, forcing local pointers 18324 001047'01 123 01 0 00 000640' extend t1, movsup ; Shift them all up a byte 18325 001050'01 600 00 0 00 000000 nop ; Ignore non-skip (which should never happen) 18326 001051'01 200 06 0 00 000005 move q2, q1 ; Last destination address is where we can append 18327 001052'01 200 05 0 00 000012 move q1, p2 ; New total 18328 001053'01 263 17 0 00 000000 ret ; Return non-match, boo... 18329 001054'01 endif. 18330 ; Otherwise, matched!!! 18331 remark ; Must print the rest of the compared string 18332 001054'01 332 00 0 00 001026* ifme. pars8 ;[229] Only if not /SILENT 18333 001055'01 254 00 0 00 001067' 18334 001056'01 201 01 0 00 000101 movei t1, .priou ; User's terminal 18335 001057'01 200 02 0 00 000013 move t2, p3 ; Where the match started 18336 001060'01 210 03 0 00 000011 movn t3, q5 ; Rest of search string length K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-4 K20IOC MAC 12-May-24 20:27 Match String Routine 18337 001061'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 18338 001062'01 320 12 0 00 001064' %jserr (,) ; Odd but carry on 18339 001063'01 254 00 0 00 001067' 18340 001064'01 265 01 0 00 000730* 18341 001065'01 000000000000# 18342 001066'01 254 00 0 00 001067' 18343 000225'04 125 156 141 142 154 18344 001067'01 endif. ;[229] 18345 18346 001067'01 337 01 0 00 001031* skipg t1, sesjfn ; Session logging? 18347 001070'01 254 00 0 00 001101' ifskp. ; Yes, so let's put it in there, too 18348 001071'01 336 00 0 00 001033* skipn sesflg ;[264] Is logging active? 18349 001072'01 254 00 0 00 001101' anskp. ;[264] No, so don't log it 18350 001073'01 306 01 0 00 377777 cain t1, .nulio ;[264] Just dumping it? 18351 001074'01 254 00 0 00 001101' anskp. ;[264] Yes, so don't bother 18352 001075'01 200 02 0 00 000013 move t2, p3 ; Where the match started 18353 001076'01 210 03 0 00 000011 movn t3, q5 ; Rest of search string length 18354 001077'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 18355 001100'01 320 12 0 00 001101' erjmpr .+1 ; Catch and ignore error 18356 001101'01 endif. ; End case session logging 18357 18358 remark ; Is this really correct? 18359 001101'01 274 12 0 00 000011 sub p2, q5 ; Account for characters consumed 18360 001102'01 327 12 0 00 001106' ifle. p2 ; Nothing left? 18361 001103'01 400 05 0 00 000000 setz q1, ; No characters in buffer 18362 001104'01 200 06 0 00 000013 move q2, p3 ; Start from where compared because that's gone now 18363 001105'01 254 00 0 00 000747* retskp ; Return success!!!!! 18364 001106'01 endif. 18365 18366 remark ; What we've done is no longer relevant for pull up 18367 001106'01 200 01 0 00 000012 move t1, p2 ; New length includes consumed characters 18368 001107'01 200 02 0 00 000011 move t2, q5 ; What we've consumed 18369 001110'01 133 02 0 00 000013 adjbp t2, p3 ; Source is post transfer 18370 001111'01 200 04 0 00 000001 move t4, t1 ; Same length 18371 001112'01 200 05 0 00 000013 move q1, p3 ; Destination is pretransfer 18372 001113'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 18373 001114'01 123 01 0 00 000640' extend t1, movsup ; Move the string up 18374 001115'01 600 00 0 00 000000 nop ; Ignore +1 (which should never happen) 18375 001116'01 200 06 0 00 000005 move q2, q1 ; Return new append position 18376 001117'01 200 05 0 00 000012 move q1, p2 ; Return existing characters 18377 18378 001120'01 254 00 0 00 001105* retskp ; Return success!!!!! 18379 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20IOC MAC 12-May-24 20:27 No trigger character seen 18380 subttl No trigger character seen 18381 18382 ; Entry: matchs register context 18383 ; 18384 ; AC block from movst 18385 ; 18386 ; t1/ Remaining characters in network input buffer 18387 ; t2/ Pointer to where the first character match happened in the input buffer 18388 ; *** OR *** where we ended (for a .CHNUL, for example) 18389 ; t3/ Zero, section local pointers 18390 ; t4/ Remaing characters in translation buffer 18391 ; q1/ Pointer to where we stopped in the translation buffer 18392 ; q2/ Zero, section local pointers 18393 ; 18394 ; N.B. Since we never hit the trigger character, t1 and t4 WILL be equal 18395 ; on entry because we stopped consuming source and storing in the 18396 ; destination translation area. 18397 ; 18398 ; Set by matchs at the time of calling 18399 ; 18400 ; q3/ Original buffer length of network data 18401 ; q4/ Original pointer to end of network data buffer 18402 ; q5/ Pointer to beginning of network data buffer 18403 ; p1/ Aliased from q5, don't use! 18404 ; p2/ Remaining source length 18405 ; p3/ Updated pointer, which was based on q5 18406 ; p4/ [Not in use, yet] 18407 ; p5/ [Not in use, yet] 18408 ; 18409 ; Exit: 18410 ; 18411 ; q1/ Updated count of characters in buffer 18412 ; q2/ Updated pointer into buffer 18413 18414 001121'01 ntrigr: remark ; Here if extend never hit the trigger character 18415 remark ; Assumes saved by matchs 18416 remark ; also saved by matchs 18417 18418 001121'01 621 01 0 00 700000 txz t1, S!N!M ; Shut off any flags from MOVST 18419 001122'01 200 04 0 00 000007 move t4, q3 ; Load original length 18420 001123'01 274 04 0 00 000001 sub t4, t1 ; Calculate total data done 18421 001124'01 327 04 0 00 001133' ifle. t4 ; Did we actually do anything or get anything odd? 18422 001125'01 120 05 0 00 000007 dmove q1, q3 ; Restore original buffer position 18423 001126'01 334 01 0 00 000000# ermsg% (<1st character MOVST doesn't appear to have done anything>,r) 18424 001127'01 254 00 0 00 001133' 18425 001130'01 202 01 0 00 000660* 18426 001131'01 104 00 0 00 000313 18427 001132'01 254 00 0 00 000662* 18428 000106'02 000000000000# 18429 000235'04 113 105 122 115 111 18430 18431 001133'01 endif. ; End sanity check 18432 18433 001133'01 260 17 0 00 001153' call netprn ; Print outstanding network data 18434 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16-1 K20IOC MAC 12-May-24 20:27 No trigger character seen 18435 001134'01 312 04 0 00 000007 came t4, q3 ; Looked though everything? 18436 001135'01 254 00 0 00 001141' ifskp. ; We did, so reset count and pointer 18437 001136'01 400 05 0 00 000000 setz q1, ; Nothing left to look at 18438 001137'01 200 06 0 00 000011 move q2, q5 ; Load reset pointer 18439 001140'01 263 17 0 00 000000 ret ; And done, +1 18440 001141'01 endif. 18441 ; Otherwise, have to 'pull up' the data 18442 001141'01 621 12 0 00 700000 txz p2, S!N!M ; Don't want any flags from now on 18443 001142'01 120 01 0 00 000012 dmove t1, p2 ; Source is where we stopped in the buffer 18444 001143'01 200 04 0 00 000001 move t4, t1 ; Destination length is the same as source length 18445 001144'01 200 05 0 00 000011 move q1, q5 ; It's going to the top of the buffer 18446 001145'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 18447 001146'01 123 01 0 00 000640' extend t1, movsup ; Pull the rest of the string up 18448 001147'01 600 00 0 00 000000 nop ; Ignore non-skip return (should never happen) 18449 001150'01 200 06 0 00 000005 move q2, q1 ; Append position is wherever MOVSLJ left it 18450 001151'01 200 05 0 00 000012 move q1, p2 ; New length is whatever we didn't look at 18451 001152'01 263 17 0 00 000000 ret ; Returns +1 18452 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20IOC MAC 12-May-24 20:27 Network Print 18453 subttl Network Print 18454 18455 ; Entry: 18456 ; 18457 ; q5/ Pointer to start printing from 18458 ; t4/ Count of characters to print 18459 ; 18460 ; Returns: 18461 ; 18462 ; +1, always, no registers modified 18463 18464 001153'01 323 04 0 00 001132* netprn: jumple t4, r ; If nothing to do, don't do anything 18465 001154'01 265 16 0 00 004556' saveac ; Don't step on a single thing 18466 001155'01 332 00 0 00 001054* ifme. pars8 ;[229] Only if not /SILENT 18467 001156'01 254 00 0 00 001170' 18468 001157'01 210 03 0 00 000004 movn t3, t4 ; Load negative count of data 18469 001160'01 200 02 0 00 000011 move t2, q5 ; And the beginning of it 18470 001161'01 201 01 0 00 000101 movei t1, .priou ; Our happy terminal 18471 001162'01 104 00 0 00 000053 SOUT% ; Blat how much we've done so far 18472 001163'01 320 12 0 00 001165' %jserr (,) ; Odd but carry on 18473 001164'01 254 00 0 00 001170' 18474 001165'01 265 01 0 00 001064* 18475 001166'01 000000000000# 18476 001167'01 254 00 0 00 001170' 18477 000253'04 125 156 141 142 154 18478 001170'01 endif. ;[229] 18479 18480 001170'01 337 01 0 00 001067* skipg t1, sesjfn ; Session logging? 18481 001171'01 263 17 0 00 000000 ret ; No, we're done 18482 001172'01 336 00 0 00 001071* skipn sesflg ;[264] Is logging active? 18483 001173'01 263 17 0 00 000000 ret ;[264] No, so don't log it 18484 001174'01 306 01 0 00 377777 cain t1, .nulio ;[264] Just dumping it? 18485 001175'01 263 17 0 00 000000 ret ;[264] Yes, so don't bother 18486 18487 remark ; Yes, so let's put it in there, too 18488 001176'01 200 02 0 00 000011 move t2, q5 ; And the beginning of it 18489 001177'01 210 03 0 00 000004 movn t3, t4 ; Load negative count of data 18490 001200'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 18491 001201'01 320 12 0 00 001202' erjmpr .+1 ; Catch and ignore error 18492 18493 001202'01 263 17 0 00 000000 ret 18494 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20IOC MAC 12-May-24 20:27 Clear Buffered Network Data 18495 subttl Clear Buffered Network Data 18496 18497 ; Returns number cleared 18498 18499 001203'01 inpclr: entry inpclr ; Used by k20net 18500 001203'01 265 16 0 00 004501' saveac ; Used by inpbfc 18501 18502 001204'01 120 05 0 00 000000# dmove q1, inpcnt ; Set calling context 18503 001205'01 260 17 0 00 001215' call inpbfc ; Check buffer constency 18504 001206'01 263 17 0 00 000000 ret ; Bad, don't touch 18505 001207'01 272 05 0 00 000000# addm q1, inpcbf ; Otherwise, count is good, add to tally 18506 001210'01 120 01 0 00 000000# dmove t1, inpini ; Load INPUT initialization data 18507 001211'01 124 01 0 00 000000# dmovem t1, inpcnt ; Whack the buffer 18508 001212'01 200 01 0 00 000005 move t1, q1 ; Return what we cleared 18509 001213'01 263 17 0 00 000000 ret 18510 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20IOC MAC 12-May-24 20:27 INPUT buffer checking and error handling 18511 subttl INPUT buffer checking and error handling 18512 18513 remark ; Input buffer check 18514 18515 ; Call 18516 ; 18517 ; q1/ Current inpcnt, count of characters in buffer 18518 ; q2 Current inpptr, append pointer 18519 ; 18520 ; +1, Something bad 18521 ; +2, Good 18522 ; t1/ Start of text 18523 ; 18524 ; Register usage 18525 ; 18526 ; q3/ Earliest possible byte pointer 18527 ; q4/ Last possible byte pointer 18528 ; q5/ Beginning of current text in buffer 18529 18530 001214'01 44 07 0 00 000000# bufbeg: point 7, inpbuf ; Assembled beginning of buffer 18531 18532 001215'01 inpbfc: entry inpbfc ; Called from k20par 18533 001215'01 265 16 0 00 004570' saveac ; Some internal storage 18534 remark ; Leave these alone!! 18535 001216'01 200 01 0 00 001214' move t1, bufbeg ; Load assembler beginning 18536 001217'01 200 02 0 00 000001 move t2,t1 ; Save a copy 18537 18538 001220'01 133 00 0 00 000001 ibp t1 ; Bump into the first word 18539 001221'01 474 07 0 00 000000 seto q3, ; Back up by one 18540 001222'01 133 07 0 00 000001 adjbp q3, t1 ; Puts it into previous word 18541 001223'01 201 10 0 00 005000 movx q4, strblc ; Load maximum count 18542 001224'01 133 10 0 00 000002 adjbp q4, t2 ; Puts past last word 18543 18544 remark ; First, check the length 18545 001225'01 305 05 0 00 000000 caige q1, 0 ; Bogus count?? 18546 001226'01 334 01 0 00 000000# ermsg% (,inpbfa) 18547 001227'01 254 00 0 00 001233' 18548 001230'01 202 01 0 00 001130* 18549 001231'01 104 00 0 00 000313 18550 001232'01 254 00 0 00 001332' 18551 000107'02 000000000000# 18552 000263'04 113 105 122 115 111 18553 18554 001233'01 303 05 0 00 005000 caile q1, strblc ; Absurdly large? 18555 001234'01 334 01 0 00 000000# ermsg% (,inpbfa) 18556 001235'01 254 00 0 00 001241' 18557 001236'01 202 01 0 00 001230* 18558 001237'01 104 00 0 00 000313 18559 001240'01 254 00 0 00 001332' 18560 000110'02 000000000000# 18561 000273'04 113 105 122 115 111 18562 18563 18564 remark ; Check append pointer 18565 001241'01 550 03 0 00 000006 hrrz t3, q2 ; Load current buffer append address K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-1 K20IOC MAC 12-May-24 20:27 INPUT buffer checking and error handling 18566 001242'01 550 04 0 00 000007 hrrz t4, q3 ; And the earliest possible address 18567 001243'01 313 03 0 00 000004 camle t3, t4 ; Before or at last? 18568 001244'01 254 00 0 00 001254' ifskp. ; Yes, could be bad 18569 001245'01 316 06 0 00 000007 camn q2, q3 ; Unless on exact address 18570 001246'01 254 00 0 00 001254' anskp. ; That's fine 18571 001247'01 334 01 0 00 000000# ermsg% (,inpbtc) 18572 001250'01 254 00 0 00 001254' 18573 001251'01 202 01 0 00 001236* 18574 001252'01 104 00 0 00 000313 18575 001253'01 254 00 0 00 001331' 18576 000111'02 000000000000# 18577 000303'04 113 105 122 115 111 18578 18579 001254'01 endif. 18580 18581 001254'01 550 04 0 00 000010 hrrz t4, q4 ; Load last possible address 18582 001255'01 315 03 0 00 000004 camge t3, t4 ; After or at last? 18583 001256'01 254 00 0 00 001266' ifskp. ; Yes, could be bad 18584 001257'01 316 06 0 00 000010 camn q2, q4 ; Unless on exact address 18585 001260'01 254 00 0 00 001266' anskp. ; That's fine 18586 001261'01 334 01 0 00 000000# ermsg% (,inpbtc) 18587 001262'01 254 00 0 00 001266' 18588 001263'01 202 01 0 00 001251* 18589 001264'01 104 00 0 00 000313 18590 001265'01 254 00 0 00 001331' 18591 000112'02 000000000000# 18592 000320'04 113 105 122 115 111 18593 18594 001266'01 endif. 18595 18596 001266'01 323 05 0 00 001317' ifg. q1 ; But!! Is there anything to do? 18597 remark ; Calculate and check start of text 18598 001267'01 210 11 0 00 000005 movn q5, q1 ; Load negative current buffer length 18599 001270'01 133 11 0 00 000006 adjbp q5, q2 ; Calculates beginning of input area 18600 18601 001271'01 550 03 0 00 000011 hrrz t3, q5 ; Load address of start of text 18602 001272'01 550 04 0 00 000007 hrrz t4, q3 ; And the earliest possible address 18603 001273'01 313 03 0 00 000004 camle t3, t4 ; Before or at last? 18604 001274'01 254 00 0 00 001304' ifskp. ; Yes, could be bad 18605 001275'01 316 11 0 00 000007 camn q5, q3 ; Unless on exact address 18606 001276'01 254 00 0 00 001304' anskp. ; That's fine 18607 001277'01 334 01 0 00 000000# ermsg% (,inpbtc) 18608 001300'01 254 00 0 00 001304' 18609 001301'01 202 01 0 00 001263* 18610 001302'01 104 00 0 00 000313 18611 001303'01 254 00 0 00 001331' 18612 000113'02 000000000000# 18613 000333'04 113 105 122 115 111 18614 18615 001304'01 endif. 18616 18617 001304'01 550 04 0 00 000010 hrrz t4, q4 ; Load last possible address 18618 001305'01 315 03 0 00 000004 camge t3, t4 ; After or at last? 18619 001306'01 254 00 0 00 001316' ifskp. ; Yes, could be bad 18620 001307'01 316 06 0 00 000010 camn q2, q4 ; Unless on exact address K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-2 K20IOC MAC 12-May-24 20:27 INPUT buffer checking and error handling 18621 001310'01 254 00 0 00 001316' anskp. ; That's fine 18622 001311'01 334 01 0 00 000000# ermsg% (,inpbtc) 18623 001312'01 254 00 0 00 001316' 18624 001313'01 202 01 0 00 001301* 18625 001314'01 104 00 0 00 000313 18626 001315'01 254 00 0 00 001331' 18627 000114'02 000000000000# 18628 000350'04 113 105 122 115 111 18629 18630 001316'01 endif. 18631 001316'01 254 00 0 00 001320' else. ; Otherwise, nothing to compute or check 18632 001317'01 200 11 0 00 000007 move q5, q3 ; Current append IS the start of text 18633 001320'01 endif. 18634 18635 remark ; Everything looks, good but can we get anything? 18636 001320'01 200 02 0 00 000011 move t2, q5 ; Load the start of buffer pointer 18637 001321'01 134 04 0 00 000002 ildb t4, t2 ; Pick up the first character 18638 001322'01 320 12 0 00 001324' %jserr (,inpbtc) 18639 001323'01 254 00 0 00 001327' 18640 001324'01 265 01 0 00 001165* 18641 001325'01 000000000000# 18642 001326'01 254 00 0 00 001331' 18643 000363'04 102 165 146 146 145 18644 18645 001327'01 200 01 0 00 000011 move t1, q5 ; Return current input position 18646 001330'01 254 00 0 00 001120* retskp ; Finally return success 18647 18648 18649 remark Error handler 18650 18651 001331'01 272 05 0 00 000000# inpbtc: addm q1, inpcbf ; Otherwise, count is good, add to tally 18652 001332'01 400 05 0 00 000000 inpbfa: setz q1, ; Whack the buffer; nothing in there 18653 001333'01 200 06 0 00 001214' move q2, bufbeg ; and point to the beginning 18654 001334'01 263 17 0 00 000000 ret ; Return the bad news 18655 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20IOC MAC 12-May-24 20:27 Debug Print, call with a JSP CX 18656 subttl Debug Print, call with a JSP CX 18657 18658 ; Was used to catch all the edge cases when doing buffered reads 18659 18660 repeat 0,< ; But it's debugged now. I hope... 18661 18662 debprn: push p, t1 18663 push p, t2 18664 push p, t3 18665 txmsg < 18666 Entry: > 18667 call prnbuf 18668 pop p, t3 18669 pop p, t2 18670 pop p, t1 18671 call (cx) ;;No arguments to skip 18672 ifskp. 18673 push p, t1 18674 push p, t2 18675 push p, t3 18676 txmsg < 18677 retskp: > 18678 call prnbuf 18679 pop p, t3 18680 pop p, t2 18681 pop p, t1 18682 aos (p) 18683 else. 18684 push p, t1 18685 push p, t2 18686 push p, t3 18687 txmsg < 18688 ret: > 18689 call prnbuf 18690 pop p, t3 18691 pop p, t2 18692 pop p, t1 18693 endif. 18694 ret 18695 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20IOC MAC 12-May-24 20:27 Debug Print, call with a JSP CX 18696 remark The symbol being displayed is what the buffer pointer is 18697 18698 prnbuf: movei t1, .priou 18699 move t2, q1 18700 movei t3, ^d10 18701 NOUT% 18702 erjmpr .+1 18703 txmsg <, > 18704 hrrz t1, q2 18705 push p, cx 18706 call symout## 18707 pop p, cx 18708 ifg. q1 18709 caile q1, strblc 18710 anskp. 18711 txmsg <,' 18712 '> 18713 movei t1, .priou 18714 movn t2, q1 18715 adjbp t2, q2 18716 movn t3, q1 18717 SOUT% 18718 erjmpr .+1 18719 txmsg <' 18720 18721 > 18722 else. 18723 ifn. q1 18724 txmsg <, *** absurd length *** 18725 18726 > 18727 else. 18728 txmsg < 18729 18730 > 18731 endif. 18732 endif. 18733 ret 18734 >;repeat 0 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20IOC MAC 12-May-24 20:27 Builds a Search String 18735 subttl Builds a Search String 18736 18737 ; Call: 18738 ; 18739 ; t1/ Whether observing case or not 18740 ; 0, Ignore case 18741 ; ~0, Observe case 18742 ; atmbuf/ Something in the atom buffer to search for. 18743 ; Does the following, in order: 18744 ; 18745 ; 1) Translates C escape sequences to the indicated character 18746 ; 2) Builds search MOVST table 18747 ; 18748 ; Returns +1, If error 18749 ; +2. Success!! 18750 ; 18751 ; strbuf/ Converted 7-bit ASCIZ string 18752 ; strptr/ 7 bit pointer to the above 18753 ; strc/ Length of converted string 18754 ; sertab/ MOVST table to stop on first letter of search string 18755 ; 18756 ; Unlike getss, will not allow string buffer to be overwritten 18757 18758 001335'01 265 16 0 00 004467' bsrchs: saveac ;[273] Needs some more registers 18759 001336'01 200 10 0 00 000001 move q4, t1 ;[273] Save case observance flag 18760 dmove t1, [ ; Set up for expansion 18761 point 7,strbuf ; Destination is string buffer 18762 001337'01 120 01 0 00 004602' point 7,atmbuf] ; Source is the typed in string 18763 001340'01 120 05 0 00 000001 dmove q1, t1 ; Save destination and source pointers 18764 001341'01 202 01 0 00 001016* movem t1, strptr ; Save destination pointer for later 18765 18766 001342'01 200 01 0 00 000002 move t1, t2 ;[248] ; Source and destination are the same 18767 001343'01 260 17 0 00 000000* call asczcp ;[248] ; Count what is in the atom buffer 18768 001344'01 377 00 0 00 000003 sosg t3 ;[248] ; Don't count the stupid NUL 18769 001345'01 400 03 0 00 000000 setz t3, ;[248] ; Normalize if went negative 18770 18771 001346'01 323 03 0 00 001364' ifg. t3 ;[248] ; Anything to do, actually? 18772 001347'01 120 01 0 00 000005 dmove t1, q1 ;[248] ; Reload destination and source 18773 remark t3, ;[248] ; Was set by asczcp, above 18774 001350'01 326 10 0 00 001353' ife. q4 ;[273] Case INsensitive compare? 18775 001351'01 201 04 0 00 000000# movei t4, chrtup ;[273] Yes, so use that table 18776 001352'01 254 00 0 00 001354' else. ;[273] Otherwise case SENSITIVE 18777 001353'01 201 04 0 00 000000# movei t4, chrtab ;[273] Different table, somewhat more efficient 18778 001354'01 endif. ;[273] End translation table determination 18779 001354'01 260 17 0 00 003451' call cescxp ; Expand any escape characters 18780 001355'01 334 00 0 00 000000 %ermsg (,r) ; pass +1 up 18781 001356'01 254 00 0 00 001362' 18782 001357'01 265 01 0 00 001324* 18783 001360'01 000000000000# 18784 001361'01 254 00 0 00 001153* 18785 000371'04 105 162 162 157 162 18786 001362'01 202 03 0 00 000773* movem t3, strc ; Store the length of the target string 18787 001363'01 254 00 0 00 001370' else. ; Otherwise, nothing in there 18788 001364'01 402 00 0 00 001362* setzm strc ; So zero the string counter 18789 001365'01 403 02 0 00 000003 setzb t2, t3 ; And scrub a dub K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-1 K20IOC MAC 12-May-24 20:27 Builds a Search String 18790 001366'01 124 02 0 00 000402* dmovem t2, strbuf ; the destination buffer 18791 001367'01 254 00 0 00 001330* retskp ; Nothing else to do 18792 001370'01 endif. ; End case something to do 18793 18794 001370'01 134 07 0 00 000005 ildb q3, q1 ; Pick up first expanded character 18795 001371'01 322 07 0 00 001367* jumpe q3, RSKP ; Can't match on NUL 18796 ; Otherwise, build a search translation table 18797 001372'01 201 01 0 00 000200 movx t1, sertln ; Length of search table in words 18798 001373'01 326 10 0 00 001376' ife. q4 ;[273] Case INsensitive compare? 18799 001374'01 201 02 0 00 000000# movei t2, btrnsu ;[273] Uppercasing base table with no stop characters 18800 001375'01 254 00 0 00 001377' else. ;[273] Otherwise, case sensitive matching 18801 001376'01 201 02 0 00 000000# movei t2, btrnst ; No, so use exact matching table, then 18802 001377'01 endif. ;[273] End case determining matching table 18803 001377'01 201 03 0 00 000000# movei t3, sertab ;[273] Destination in writable storage to be modified 18804 18805 001400'01 550 04 0 00 000002 hrrz t4, t2 ; Pick up address of base table 18806 001401'01 505 04 0 00 015000 hrli t4, (movst 0,0) ; Build instruction 18807 001402'01 202 04 0 00 000000# movem t4, trnbas ; Store as instructon to do 18808 001403'01 402 00 0 00 000000# setzm trnbas+1 ; Fill character is .chnul 18809 001404'01 123 01 0 00 004511' xblt. t1 ; Drop into place 18810 18811 001405'01 202 07 0 00 000000# movem q3, trgchr ; Might be the right character 18812 001406'01 200 01 0 00 000007 move t1, q3 ; Load the character 18813 001407'01 260 17 0 00 001426' call mrktab ; Mark the table to stop on this character 18814 001410'01 326 10 0 00 001371* jumpn q4, RSKP ;[273] If case sensitive, we're done 18815 18816 remark ;[273] Otherwise, must mark BOTH cases 18817 001411'01 200 01 0 00 000007 move t1, q3 ; Otherwise, load the character again 18818 001412'01 301 01 0 00 000141 cail t1, "a" ; Is this a lower case letter? 18819 001413'01 303 01 0 00 000172 caile t1, "z" 18820 001414'01 254 00 0 00 001420' jrst bsrch1 ; No, see if UPPER case 18821 001415'01 620 01 0 00 000040 txz t1, 40 ; Yes, convert to UPPER case 18822 001416'01 202 01 0 00 000000# movem t1, trgchr ; And save as the trigger character 18823 001417'01 254 00 0 00 001424' jrst bsrch2 ; Now go poke the table 18824 18825 001420'01 301 01 0 00 000101 bsrch1: cail t1, "A" ; No, is this an UPPER case letter? 18826 001421'01 303 01 0 00 000132 caile t1, "Z" ; If neither UPPER or lower, 18827 001422'01 254 00 0 00 001410* retskp ; we're done 18828 001423'01 660 01 0 00 000040 txo t1, 40 ; Yes, convert to lower case 18829 remark bsrch2 ; Falls through to tweak the table again 18830 18831 001424'01 260 17 0 00 001426' bsrch2: call mrktab ; Mark the table to stop on this character 18832 001425'01 254 00 0 00 001422* retskp ; Return success 18833 18834 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20IOC MAC 12-May-24 20:27 Given a character, mark a translate table entry to stop on it 18835 subttl Given a character, mark a translate table entry to stop on it 18836 18837 ; Call: 18838 ; 18839 ; t1/ Character to stop on 18840 ; 18841 ; Returns: +1, always 18842 ; 18843 ; Search table (sertab) with appropriate character pair updated 18844 ; 18845 ; To do, the indexed xct is extremely cute, but probably not really 18846 ; fast. Probably could just have done an txnn/ifskp./else./endif. 18847 ; and maybe even bummed the lsh. Even with all the extra jrst's, 18848 ; it would probably be faster. 18849 ; 18850 ; Vanity, vanity, vanity... 18851 18852 001426'01 265 16 0 00 004556' mrktab: saveac ; Don't touch the temporaries 18853 001427'01 246 01 0 00 777777 lshc t1, ^d<-1> ; Divide by two, shifting odd bit into bit zero 18854 001430'01 242 02 0 00 777735 lsh t2, ^d<-35> ; Shift remainder into bit thirty five 18855 001431'01 200 03 0 01 000000# move t3, sertab(t1) ; Load character pair 18856 xct [tlo t3,TRMCOD ; Even, pick up left half 18857 001432'01 256 00 0 02 004604' tro t3,TRMCOD](t2) ; Odd, pick up right half 18858 001433'01 202 03 0 01 000000# movem t3, sertab(t1) ; Store back into table 18859 001434'01 263 17 0 00 000000 ret ; Done 18860 18861 ;[209] End code insertion 18862 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20IOC MAC 12-May-24 20:27 OUTPUT command parsing 18863 subttl OUTPUT command parsing 18864 18865 ;[208] Originally shut off indirection, but since quoted strings allow 18866 ; us to put in an at-sign (@) as well as escape sequences, this was 18867 ; removed to allow backward compatibility with any take files which 18868 ; rely on this. 18869 18870 chgsec(code,const) ;;Chained FDB's go in const 18871 000115'02 010004 000120' outfdb: flddb. .cmcfm,,,,,outfd1 18872 000116'02 000000 000000 18873 000117'02 44 07 0 00 004220' 18874 000120'02 021004 000123' outfd1: flddb. .cmqst,,,,,outfd2 18875 000121'02 000000 000000 18876 000122'02 44 07 0 00 004227' 18877 000123'02 017004 000000 outfd2: flddb. .cmtxt,,,,, ;[208] 18878 000124'02 000000 000000 18879 000125'02 44 07 0 00 004236' 18880 retsec ;;Return to code psect 18881 cleans() ;;Clean up working symbols 18882 18883 18884 001435'01 .outpu: entry .output ; Invoked by k20par 18885 001435'01 200 16 0 00 000000# guide (string) ; Parse OUTPUT command. 18886 001436'01 260 17 0 00 000227* 18887 000126'02 000000000000# 18888 000400'04 163 164 162 151 156 18889 001437'01 201 01 0 00 000000# movei t1, outfdb ;[208] Load pointer to chained fdb's 18890 001440'01 260 17 0 00 000235* call rfield ;[208] Parse for something 18891 001441'01 135 03 0 00 004466' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ;[208] Get what was parsed 18892 18893 001442'01 302 03 0 00 000010 caie t3, .cmcfm ;[208] Parsed a confirm? 18894 001443'01 254 00 0 00 001451' ifskp. ;[208] We did, so fix up the atom buffer 18895 001444'01 205 01 0 00 064000 movx t1, ;[208] Load a carriage return 18896 001445'01 202 01 0 00 000244* movem t1, atmbuf ;[208] Stomp the atom buffer 18897 dmove t2,[ point 7, atmbuf ;[248] Point to atom buffer 18898 001446'01 120 02 0 00 004606' ^d1 ] ;[248] And its single byte 18899 001447'01 124 02 0 00 000250* dmovem t2, pars3 ;[248] Pass over to semantic action 18900 001450'01 263 17 0 00 000000 ret ;[248] Done 18901 001451'01 endif. ;[248] End case defaulting input 18902 ;[208] Otherwise, the atom buffer is valid 18903 001451'01 260 17 0 00 000272* confrm ;[208] But must be confirmed 18904 18905 dmove t1, [ ;[248] Overwritting the atom buffer in place 18906 point 7, atmbuf ;[248] So the source is the atom buffer and 18907 001452'01 120 01 0 00 004610' point 7, atmbuf ] ;[248] the destination is the atom buffer 18908 001453'01 260 17 0 00 001343* call asczcp ;[248] Move the string on top of itself, returning count 18909 001454'01 200 02 0 00 004514' move t2,[point 7,atmbuf];[248] Load address of string to possibly expand 18910 001455'01 375 00 0 00 000003 sosge t3 ;[248] Don't count the NUL at the end!! 18911 001456'01 400 03 0 00 000000 setz t3, ;[248] Stomp if went negative 18912 001457'01 124 02 0 00 001447* dmovem t2, pars3 ;[248] Store for semantic action 18913 001460'01 263 17 0 00 000000 ret ;[248] Now go do something useful with it 18914 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20IOC MAC 12-May-24 20:27 OUTPUT command execution 18915 subttl OUTPUT command execution 18916 18917 remark pars3 ;[248] Pointer to buffer with characters parsed 18918 remark pars4 ;[248] Length of buffer 18919 18920 001461'01 $outpu: entry $output ;[209] Invoked by k20par 18921 001461'01 265 16 0 00 004612' saveac ;[247] Save registers for piggy MOVST 18922 18923 remark ;[209] Expand any C escape characters 18924 001462'01 200 01 0 00 004626' move t1, [point 8,strbuf] ;[248] Destination buffer is eight bit 18925 001463'01 120 02 0 00 001457* dmove t2, pars3 ;[248] Load source buffer point and length 18926 001464'01 322 03 0 00 001361* jumpe t3, R ;[248] If nothing to do, then don't do anything 18927 001465'01 201 04 0 00 000000# movei t4, chrtab ;[209] Respect case on expansion 18928 001466'01 200 12 0 00 000001 move p2, t1 ;[248] Save output buffer pointer 18929 001467'01 260 17 0 00 003451' call cescxp ;[209] Expand string into output buffer 18930 001470'01 334 00 0 00 000000 %ermsg (,r) ;[209] Don't go any further 18931 001471'01 254 00 0 00 001475' 18932 001472'01 265 01 0 00 001357* 18933 001473'01 000000000000# 18934 001474'01 254 00 0 00 001464* 18935 000402'04 105 162 162 157 162 18936 001475'01 200 11 0 00 000003 move p1, t3 ;[247] Save length of destination 18937 18938 001476'01 337 01 0 00 000407* $outp4: skipg t1, netjfn ;[186] Comm line designator. 18939 001477'01 200 01 0 00 000410* move t1, ttyjfn ;[186] Not remote, using local 18940 001500'01 260 17 0 00 000000* call chklin ; Whatever it is, check it 18941 001501'01 332 00 0 00 000000* ifme. carier ; No carrier? 18942 001502'01 254 00 0 00 001510' 18943 001503'01 334 00 0 00 000000 %ermsg (,r) 18944 001504'01 254 00 0 00 001510' 18945 001505'01 265 01 0 00 001472* 18946 001506'01 000000000000# 18947 001507'01 254 00 0 00 001474* 18948 000411'04 125 156 141 142 154 18949 001510'01 endif. 18950 001510'01 200 02 0 00 000012 move t2, p2 ;[247] Point to converted string 18951 001511'01 210 03 0 00 000011 movn t3, p1 ;[247] Counted string (gives length of record) 18952 001512'01 400 04 0 00 000000 setz t4, ;[186] Just in case still NUL terminated (isn't) 18953 001513'01 336 00 0 00 000000# skipn parpko ;[223] Don't do this if doing packets only 18954 001514'01 260 17 0 00 004325' call putpar ;[223] Otherwise, maybe put some parity on it 18955 001515'01 336 00 0 00 000000* ifmn. tvtflg ;[271] On a TVT? 18956 001516'01 254 00 0 00 001545' 18957 001517'01 415 16 0 00 001537' block. ;[247] Yes, let's see if we need any quoting 18958 001520'01 261 17 0 00 000016 18959 001521'01 265 16 0 00 004627' saveac ;[247] Save output designator, want an accumulator 18960 001522'01 200 07 0 00 004637' move q3, [point 8, tvtbuf] ;[247] Special buffer for IAC doubling 18961 001523'01 200 01 0 00 000011 move t1, p1 ;[247] Positive length 18962 001524'01 200 03 0 00 000007 move t3, q3 ;[247] Load output area 18963 001525'01 260 17 0 00 000000* call iaciac ;[247] Go double any IAC's 18964 001526'01 334 00 0 00 000000 %ermsg (,r) ;;[247] 18965 001527'01 254 00 0 00 001533' 18966 001530'01 265 01 0 00 001505* 18967 001531'01 000000000000# 18968 001532'01 254 00 0 00 001507* 18969 000422'04 117 125 124 120 125 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25-1 K20IOC MAC 12-May-24 20:27 OUTPUT command execution 18970 001533'01 200 11 0 00 000004 move p1, t4 ;[247] Store updated length 18971 001534'01 200 12 0 00 000007 move p2, q3 ;[247] New output buffer 18972 001535'01 254 00 0 00 001425* retskp ;[247] Won! 18973 001536'01 263 17 0 00 000000 endbk. ;[247] End of block context 18974 001537'01 254 00 0 00 001544' ifskp. ;[247] Success 18975 001540'01 200 02 0 00 000012 move t2, p2 ;[247] Pass in to SOUTR% 18976 001541'01 210 03 0 00 000011 movn t3, p1 ;[247] New length 18977 001542'01 400 04 0 00 000000 setz t4, ;[247] Just in case still NUL terminated (isn't) 18978 001543'01 254 00 0 00 001545' else. ;[247] Otherwise, failed somehow 18979 001544'01 263 17 0 00 000000 ret ;[247] So get out of here 18980 001545'01 endif. ;[247] End case iaciac return handling 18981 001545'01 endif. ;[247] End TVT-binary handling 18982 001545'01 104 00 0 00 000532 SOUTR% ;[186] Push it over the network. 18983 001546'01 320 12 0 00 001550' %jserr (,) ;[186] Couldn't ... 18984 001547'01 254 00 0 00 001553' 18985 001550'01 265 01 0 00 001530* 18986 001551'01 000000000000# 18987 001552'01 254 00 0 00 001553' 18988 000430'04 103 141 156 047 164 18989 18990 001553'01 350 00 0 00 000000* aos vsoct ;[204] Count a SOUTR% done 18991 001554'01 272 11 0 00 000000* addm p1, vsotc ;[204] Update tally of SOUTR% bytes 18992 001555'01 313 11 0 00 000000* camle p1, vsomx ;[204] Length than or equal to the maximum seen? 18993 001556'01 202 11 0 00 001555* movem p1, vsomx ;[204] Nope, we have a new maximum! 18994 18995 001557'01 336 00 0 00 000000* ifmn. duplex ;[247] Half duplex connection? 18996 001560'01 254 00 0 00 001602' 18997 001561'01 201 01 0 00 000101 movei t1, .priou ; Yes, do it ourselves. 18998 001562'01 200 02 0 00 000012 move t2, p2 ;[247] Point to final string 18999 001563'01 210 03 0 00 000011 movn t3, p1 ;[247] Counted string (faster) 19000 001564'01 400 04 0 00 000000 setz t4, ;[186] Just in case (still NUL terminated) 19001 001565'01 104 00 0 00 000053 SOUT% 19002 001566'01 320 12 0 00 001567' erjmpr .+1 ;[195] 19003 remark ;[248] Only 'echo' in session log if half duplex 19004 001567'01 337 01 0 00 001170* skipg t1, sesjfn ;[195] Session logging? 19005 001570'01 254 00 0 00 001602' ifskp. ;[195] A JFN exists 19006 001571'01 336 00 0 00 001172* skipn sesflg ;[195] Is logging active? 19007 001572'01 254 00 0 00 001602' anskp. ;[195] No, so don't bother 19008 001573'01 306 01 0 00 377777 cain t1, .nulio ;[193] Just dumping it? 19009 001574'01 254 00 0 00 001602' anskp. ;[193] If so, we're done 19010 001575'01 200 02 0 00 000012 move t2, p2 ;[247] Otherwise, point again. 19011 001576'01 210 03 0 00 000011 movn t3, p1 ;[247] Counted string (faster) 19012 001577'01 400 04 0 00 000000 setz t4, ;[186] Just in case (still NUL terminated) 19013 001600'01 104 00 0 00 000053 SOUT 19014 001601'01 320 12 0 00 001602' erjmpr .+1 ;[195] 19015 001602'01 endif. ;[195] 19016 001602'01 endif. ;[247] End case half-duplex 19017 19018 001602'01 263 17 0 00 000000 ret ; Done. 19019 19020 ;[209] End code replacement 19021 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20IOC MAC 12-May-24 20:27 TRANSMIT [file] parsing tables 19022 subttl TRANSMIT [file] parsing tables 19023 19024 ;[209] Begin code replacement 19025 ; 19026 ; Moved here from k20mit and rewritten to be able drive buffered I/O. 19027 ; 19028 ; Tries for a device first as this is more efficient for NUL: and 19029 ; catches more errors earlier and more easily. Can sometimes make 19030 ; recognition not work intuitively by picking a bogus device over 19031 ; a non-existant file. 19032 ; 19033 ; Default command filespec fields for .CMFIL. These are only given 19034 ; so that we may get the flags returned by GTJFN% (which are currently 19035 ; unused) 19036 19037 chgsec(code,const) ;;GTJFN defaults are not in code, they're in const 19038 19039 000127'02 100020 000000 trnbk: gj%flg!gj%old!fld(.gjdef,.rhalf) ; .GJGEN 19040 000130'02 000100 000101 .priin,,.priou ; .GJSRC (ignored if COMND%) 19041 000131'02 000000 000000 0 ; .GJDEV (do not default the device) 19042 000132'02 000000 000000 0 ; .GJDIR (do not default the directory) 19043 000133'02 000000 000000 0 ; .GJNAM (do not default the name) 19044 000134'02 000000 000000 0 ; .GJEXT (do not default the extension) 19045 000135'02 000000 000000 0 ; .GJPRO (use system default protection) 19046 000136'02 000000 000000 0 ; .GJACT (use job's current account) 19047 000010 trnbkl==<.-trnbk> ; Length of this GTJFN argument block. 19048 retsec ;;[229] Back to where-ever we started from 19049 19050 ;[229] %table puts stuff in the correct .psect 19051 19052 000137'02 000000 000000 %table (trnswi) ;[229] The translate switch table 19053 000140'02 000000# 000005 %key2 , %tcasw ;[273] Case switch 19054 000040'03 143 141 163 145 000 19055 000141'02 000000# 000000 %key2 , %eofsw ;[229] The EOF switch parses a restricted token set 19056 000041'03 105 117 106 000 000 19057 000142'02 000000# 000003 %key2 , %maxsw ;[265] Maximum length 19058 000042'03 155 141 170 151 155 19059 000143'02 000000# 000004 %key2 , %tpasw ;[266] Pause after SOUT(R)% 19060 000045'03 160 141 165 163 145 19061 000144'02 000000# 000001 %key2 , %silsw ;[229] Tells $input to shut up about matches 19062 000047'03 163 151 154 145 156 19063 000145'02 000000# 000002 %key2 , %timsw ;[229] In case we don't want to wait forever ... 19064 000051'03 164 151 155 145 157 19065 000137'02 000006 000006 %tbend ;[229] End of table 19066 19067 remark Lifted from k20par 19068 19069 ;N.B., have to use literals here or flddb. will choke. Maybe rewrite 19070 ; this to special case .cmtok, like fldtk.? 19071 19072 define token (c) < ;;[217] Define token 19073 ;;[217] All these literals, yuck... 19074 >;;token ;;[217] 19075 19076 chgsec(code,const) ;;Chained FDB's are not in code, they're in const K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-1 K20IOC MAC 12-May-24 20:27 TRANSMIT [file] parsing tables 19077 000146'02 tranft: intern tranft ;[265] Used in K20PAR 19078 000146'02 023004 000151' flddb. .cmtok,,token(<>),,,tranf1 19079 000147'02 440700 004242' 19080 000150'02 44 07 0 00 004243' 19081 000151'02 023004 000154' tranf1: flddb. .cmtok,,token(<>),,,tranf2 19082 000152'02 440700 004254' 19083 000153'02 44 07 0 00 004255' 19084 000154'02 023004 000157' tranf2: flddb. .cmtok,,token(<$>),,,tranf3 19085 000155'02 440700 004263' 19086 000156'02 44 07 0 00 004264' 19087 000157'02 023005 000000 tranf3: flddb. .cmtok,cm%sdh,token(<>),,, 19088 000160'02 440700 004275' 19089 000161'02 44 07 0 00 004276' 19090 19091 000162'02 003000 000164' tranfs: flddb. .cmswi,,trnswi,,,tranfd ;[229] Maybe get a transmit switch 19092 000163'02 000000 000137' 19093 000164'02 006000 000166' tranfd: flddb. .cmfil,,,,,tranf4 19094 000165'02 000000 000000 19095 000166'02 016001 000000 tranf4: flddb. .cmdev,cm%sdh,,,, ;[229] Catch bare device 19096 000167'02 000000 000000 19097 19098 000170'02 015006 000000 timfdb: flddb. .cmflt,,^d10,,<10>, 19099 000171'02 000000 000012 19100 000172'02 44 07 0 00 004162' 19101 000173'02 44 07 0 00 004307' 19102 000174'02 001006 000000 maxfdb::flddb. .cmnum,,^d10,,<110>, ;;[265] 19103 000175'02 000000 000012 19104 000176'02 44 07 0 00 004310' 19105 000177'02 44 07 0 00 004320' 19106 19107 000200'02 trnswd: remark ;[266] Transmit switch dispatch 19108 000200'02 000000000000# teofsw ; %eofsw==0 ;[266] We parsed the EOF switch 19109 000201'02 000000000000# tsilsw ; %silsw==1 ;[266] We parsed the 'silent' switch 19110 000202'02 000000000000# ttimsw ; %timsw==2 ;[266] We parsed the 'timeout' switch 19111 000203'02 000000000000# tmaxsw ; %maxsw==3 ;[265] We parsed the 'maximum' (length) switch 19112 000204'02 000000000000# ttpasw ; %tpasw==4 ;[266] We parsed the 'pause' switch 19113 000205'02 000000000000# tcsasw ; %tcasw==5 ;[273] We parsed the 'case' switch 19114 000006 %tlast==.-trnswd ;[273] Last switch 19115 retsec ;;[229] Back to where-ever we started from 19116 19117 remark ;;[229] Punt temporary symbols 19118 cleans() 19119 19120 remark ;[265] Global values, which can be overridden 19121 extern teofch ;[266] Transmit EOF character (defaults to none) 19122 extern tsilen ;[266] Whether to allow blat from parsing 19123 extern tmaxln ;[266] Maximum line we'll try to force 19124 extern timeou ;[266] If timing out the SIN(R)%/SOUT(R)% 19125 extern tpause ;[266] Amount to pause, assuming nothing 19126 extern tobser ;[273] Whether observing case 19127 extern tsetsd ;[275] Default settings source 19128 extern tdefpl ;[272] Length of default prompt, if using one 19129 extern tdefpp ;[272] Pointer to default string 19130 extern tdefps ;[272] Location of default string 19131 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-2 K20IOC MAC 12-May-24 20:27 TRANSMIT [file] parsing tables 19132 ;[266] Document hairy parse variable usage. Be aware that some of these are 19133 ; shared with INPUT's parsing and semantic action. 19134 19135 remark pars1 ;[266] Linkage between parsing and semantic 19136 remark pars2 ;[266] JFN of file to transmit 19137 remark pars3 ;[266] Set if .cmcfm and using default search string 19138 remark pars4 ;[266] Integer timeout in milliseconds 19139 remark pars5 ;[273] Integer timeout, floating point seconds 19140 remark pars6 ;[266] Set to not override $INPUT's interrupt handling 19141 remark pars7 ;[266] EOF character to use (if any) 19142 remark pars8 ;[266] If doing SILENT matching 19143 remark pars9 ;[266] Maximum length of line to transmit 19144 remark pars10 ;[266] Milliseconds to pause, integer 19145 remark pars11 ;[273] Not defined as pars10 is a double 19146 remark pars12 ;[273] Whether observing case 19147 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20IOC MAC 12-May-24 20:27 TRANSMIT /silent switch parsing 19148 subttl TRANSMIT /silent switch parsing 19149 19150 extern stxfdb ;[266] Defined in K20PAR 19151 19152 ;[266] This is a little 'clever' in that if it doesn't get one of the 19153 ; keywords, it doesn't fail the parse but rather assumes that "on" 19154 ; was typed. Even though "on" is the default in the function 19155 ; descriptor, it won't be defaulted unless the user types an 19156 ; escape or a ^F. Similar games like this are played when defining 19157 ; macros 19158 19159 001603'01 200 16 0 00 000000# tsilsw: guide () ;[266] 19160 001604'01 260 17 0 00 001436* 19161 000206'02 000000000000# 19162 000435'04 162 145 155 157 164 19163 001605'01 201 01 0 00 000000* movei t1, stxfdb ;[266] Load "on" or "off" fdb 19164 001606'01 260 17 0 00 000000* call rflde ;[266] Try to get one of them 19165 001607'01 254 00 0 00 001612' ifskp. ;[266] They picked (or defaulted) one 19166 001610'01 550 02 0 02 000000 hrrz t2, (t2) ;[266] Get the value for the keyword (0 or 1). 19167 001611'01 254 00 0 00 001613' else. ;[266] Otherwise, failed the parse 19168 001612'01 474 02 0 00 000000 seto t2, ;[266] Assume they wanted it "on" 19169 001613'01 endif. ;[266] Either way, carry on 19170 19171 001613'01 202 02 0 00 001155* movem t2, pars8 ;[266] Override SET TRANSMIT DEFAULT 19172 001614'01 254 00 0 00 001535* retskp ;[266] Done 19173 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20IOC MAC 12-May-24 20:27 Next TRANSMIT /case switch parsing 19174 subttl Next TRANSMIT /case switch parsing 19175 19176 chgsec(code,const) ;;FDB's go in const .psect 19177 000207'02 000000 000000 casfdb: flddb. .cmkey,,castab,,, 19178 000210'02 000000 000007' 19179 retsec ;;Get back into code .psect 19180 19181 001615'01 200 16 0 00 000000# tcsasw: guide 19182 001616'01 260 17 0 00 001604* 19183 000211'02 000000000000# 19184 000442'04 146 157 162 040 155 19185 001617'01 201 01 0 00 000000# movei t1, casfdb ;[273] Almost the same as SET INPUT CASE ... 19186 001620'01 260 17 0 00 001440* call rfield ;[273] Parse a keyword or default 19187 001621'01 550 01 0 02 000000 hrrz t1, (t2) ;[273] Get the value for the keyword (0 or 1). 19188 001622'01 202 02 0 00 001005* movem t2, pars12 ;[273] Override any default 19189 001623'01 254 00 0 00 001614* retskp ;[273] Return for next switch 19190 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20IOC MAC 12-May-24 20:27 TRANSMIT /EOF switch parsing 19191 subttl TRANSMIT /EOF switch parsing 19192 19193 001624'01 201 01 0 00 000000# teofsw: movei t1, tranft ;[266] Look for an EOF token 19194 001625'01 260 17 0 00 001620* call rfield ;[266] Ask them to type one of them 19195 001626'01 621 03 0 00 777777 tlz t3, -1 ;[266] Isolate fdb we actually used 19196 001627'01 200 02 0 03 000001 move t2, .cmdat(t3) ;[266] Pick up the byte pointer to the character 19197 001630'01 134 01 0 00 000002 ildb t1, t2 ;[266] Load the token character (only one) 19198 001631'01 306 01 0 00 000044 cain t1, "$" ;[266] Our goofy escape synonym? 19199 001632'01 201 01 0 00 000033 movei t1, .chesc ;[266] Yes, transmogrify it 19200 001633'01 260 17 1 00 000560* call @parity ;[266] And put parity on it (if doing parity) 19201 001634'01 202 01 0 00 000000* movem t1, pars7 ;[266] Save EOF character 19202 001635'01 254 00 0 00 001623* retskp ;[266] Return for next switch 19203 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20IOC MAC 12-May-24 20:27 TRANSMIT /timeout switch parsing 19204 subttl TRANSMIT /timeout switch parsing 19205 19206 001636'01 201 01 0 00 000000# ttimsw: movei t1, timfdb ;[266] Look for a time out number (floating) 19207 001637'01 260 17 0 00 001625* call rfield ;[266] Ask them to type one it 19208 19209 001640'01 325 02 0 00 001644' ifl. t2 ;[266] Is the number in the right range? 19210 001641'01 200 01 0 00 000000# emsg ;[266] Must be superluminal... 19211 001642'01 104 00 0 00 000313 19212 000212'02 000000000000# 19213 000452'04 101 040 156 145 147 19214 001643'01 254 00 0 00 000260* jrst cmder1 ;[266] Yet allow reparse 19215 001644'01 endif. ;[266] End initial sanity checking 19216 19217 001644'01 260 17 0 00 000213* call chksec ;[266] Ensure number is in correct range 19218 001645'01 254 00 0 00 001647' ifskp. ;[266] Check and convert OK? 19219 001646'01 254 00 0 00 001635* retskp ;[266] Yes, pars4 and pars5 are set, return 19220 001647'01 endif. ;[266] End case checking and conversion 19221 19222 remark ;[266] Otherwise, couldn't swallow something 19223 001647'01 200 01 0 00 000000# emsg ;[266] 19224 001650'01 104 00 0 00 000313 19225 000213'02 000000000000# 19226 000461'04 123 160 145 143 151 19227 001651'01 254 00 0 00 001643* jrst cmder1 ;[266] Yet allow reparse 19228 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20IOC MAC 12-May-24 20:27 TRANSMIT /maximum-length switch parsing 19229 subttl TRANSMIT /maximum-length switch parsing 19230 19231 001652'01 201 01 0 00 000000# tmaxsw: movei t1, maxfdb ;[265] Look for an integer count of characters 19232 001653'01 260 17 0 00 001637* call rfield ;[265] Ask them to type one it 19233 19234 001654'01 326 02 0 00 001660' ife. t2 ;[265] Typed a zero? 19235 001655'01 201 02 0 00 004000 movei t2, strbl8 ;[265] Load maximum buffer can hold 19236 001656'01 202 02 0 00 000000* movem t2, pars9 ;[265] Return as an imagined parsed value 19237 001657'01 254 00 0 00 001646* retskp ;[265] Return success from parse block 19238 001660'01 endif. ;[265] Make life easier... 19239 19240 001660'01 325 02 0 00 001664' ifl. t2 ;[265] Is the number delusional? 19241 001661'01 200 01 0 00 000000# emsg ;[265] 19242 001662'01 104 00 0 00 000313 19243 000214'02 000000000000# 19244 000472'04 101 040 156 145 147 19245 001663'01 254 00 0 00 001651* jrst cmder1 ;[265] Yet allow reparse 19246 001664'01 endif. ;[265] End initial sanity checking 19247 19248 001664'01 301 02 0 00 004000 cail t2, strbl8 ;[265] Larger than largest we can spew? 19249 001665'01 254 00 0 00 001670' ifskp. ;[265] Nope, let's use it 19250 001666'01 202 02 0 00 001656* movem t2, pars9 ;[265] Return as parsed value 19251 001667'01 254 00 0 00 001657* retskp ;[265] And break out of the parse block 19252 001670'01 endif. ;[266] End case acceptable range check 19253 19254 remark ;[265] Otherwise, grouse at him 19255 001670'01 200 01 0 00 000000# emsg ;[265] 19256 001671'01 104 00 0 00 000313 19257 000215'02 000000000000# 19258 000504'04 123 160 145 143 151 19259 001672'01 254 00 0 00 001663* jrst cmder1 ;[265] Yet allow reparse 19260 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20IOC MAC 12-May-24 20:27 TRANSMIT /pause switch parsing 19261 subttl TRANSMIT /pause switch parsing 19262 19263 001673'01 201 01 0 00 000000* ttpasw: movei t1, trapau## ;[265] Look for a pause number (floating) 19264 001674'01 260 17 0 00 001653* call rfield ;[265] Ask them to type one it 19265 19266 001675'01 325 02 0 00 001701' ifl. t2 ;[265] Is the number in the right range? 19267 001676'01 200 01 0 00 000000# emsg ;[265] Must be imaginary.. 19268 001677'01 104 00 0 00 000313 19269 000216'02 000000000000# 19270 000516'04 101 040 156 145 147 19271 001700'01 254 00 0 00 001672* jrst cmder1 ;[265] Yet allow reparse 19272 001701'01 endif. ;[265] End initial sanity checking 19273 19274 001701'01 261 17 0 00 000373* push p, pars4 ;[266] Save possible time out, integer 19275 001702'01 261 17 0 00 000000* push p, pars5 ;[266] Save possible time out, floating 19276 001703'01 260 17 0 00 001644* call chksec ;[265] Ensure number is in correct range 19277 001704'01 254 00 0 00 001712' ifskp. ;[265] Check and convert OK? Then side-effect variables 19278 001705'01 120 01 0 00 001701* dmove t1, pars4 ;[266] Load where chksec stored stuff 19279 001706'01 124 01 0 00 000000* dmovem t1, pars10 ;[266] Save it for semantic action 19280 001707'01 262 17 0 00 001702* pop p, pars5 ;[266] Restore possible time out, floating 19281 001710'01 262 17 0 00 001705* pop p, pars4 ;[266] Restore possible time out, integer 19282 001711'01 254 00 0 00 001667* retskp ;[265] And get out of the parse block. 19283 001712'01 endif. ;[265] End case checking and conversion 19284 19285 remark ;[265] Otherwise, couldn't swallow something 19286 001712'01 200 01 0 00 000000# emsg ;[265] 19287 001713'01 104 00 0 00 000313 19288 000217'02 000000000000# 19289 000525'04 123 160 145 143 151 19290 001714'01 254 00 0 00 001700* jrst cmder1 ;[265] Yet allow reparse 19291 19292 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20IOC MAC 12-May-24 20:27 TRANSMIT/CAPTURE default values set up 19293 subttl TRANSMIT/CAPTURE default values set up 19294 19295 remark pars1 ;[266] Linkage between parsing and semantic 19296 remark pars2 ;[266] JFN of file to transmit 19297 remark pars3 ;[266] Set if .cmcfm and using default search string 19298 remark pars4 ;[266] Integer timeout in milliseconds 19299 remark pars5 ;[273] Integer timeout, floating point seconds 19300 remark pars6 ;[266] Set to not override $INPUT's interrupt handling 19301 remark pars7 ;[266] EOF character to use (if any) 19302 remark pars8 ;[266] If doing SILENT matching 19303 remark pars9 ;[266] Maximum length of line to transmit 19304 remark pars10 ;[266] Milliseconds to pause, integer 19305 remark pars11 ;[273] Not defined as pars10 is a double 19306 remark pars12 ;[273] Whether observing case 19307 19308 001715'01 332 00 0 00 000000* trcapd: ifme. tsetsd ;[275] Are parse defaults coming from SET INPUT? 19309 001716'01 254 00 0 00 001731' 19310 001717'01 403 03 0 00 000004 setzb t3, t4 ;[275] SET INPUT has no EOF or SILENT 19311 001720'01 124 03 0 00 001634* dmovem t3, pars7 ;[275] Store as if never parsed 19312 001721'01 201 01 0 00 004000 movei t1, strbl8 ;[275] SET INPUT has no Maximum line width, so 19313 001722'01 202 01 0 00 001666* movem t1, pars9 ;[275] use maximum possible and store as if parsed 19314 001723'01 120 01 0 00 000000# dmove t1, indeft ;[275] Timeout default is SET INPUT DEFAULT-TIMEOUT 19315 001724'01 124 01 0 00 001710* dmovem t1, pars4 ;[275] Store as if parsed 19316 001725'01 124 03 0 00 001706* dmovem t3, pars10 ;[275] SET INPUT has NO PAUSE 19317 001726'01 200 01 0 00 000000# move t1, incase ;[275] Case default is SET INPUT CASE 19318 001727'01 202 01 0 00 001622* movem t1, pars12 ;[275] Store as if parsed 19319 001730'01 254 00 0 00 001743' else. ;[275] No, they're coming from SET TRANSMIT 19320 001731'01 120 01 0 00 000000* dmove t1, teofch ;[266] Transmit EOF character 19321 remark t2, tsilen ;[266] Whether to allow blat from parsing 19322 001732'01 124 01 0 00 001720* dmovem t1, pars7 ;[266] Store as if parsed 19323 001733'01 200 01 0 00 000000* move t1, tmaxln ;[266] Maximum line length we'll try to force 19324 001734'01 202 01 0 00 001722* movem t1, pars9 ;[265] Store as if parsed 19325 001735'01 120 01 0 00 000000* dmove t1, timeou ;[266] Timeout, Integer Milliseconds, floating seconds 19326 001736'01 124 01 0 00 001724* dmovem t1, pars4 ;[266] Override floating, which we don't use 19327 001737'01 120 01 0 00 000000* dmove t1, tpause ;[266] Amount to pause, integer and floating 19328 001740'01 124 01 0 00 001725* dmovem t1, pars10 ;[266] Store as default parse value 19329 001741'01 200 01 0 00 000000* move t1, tobser ;[273] Whether we are observing case 19330 001742'01 202 01 0 00 001727* movem t1, pars12 ;[273] Store as default 19331 001743'01 endif. ;[275] End parse default source checking 19332 001743'01 263 17 0 00 000000 ret ;[275] All done and ready to parse ... something 19333 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20IOC MAC 12-May-24 20:27 TRANSMIT command parsing 19334 subttl TRANSMIT command parsing 19335 19336 chgsec(code,const) ;;Chained FDB's go in const 19337 000220'02 trdfdb: remark ;[272] fdb to use when defaulting search string 19338 000220'02 000000000000# fld(.cmqst,cm%fnc)!cm%hpp!cm%dpp!fld(txtfd2,cm%lst) ;[272] .cmfnp 19339 000221'02 000 00 0 00 000000 Z ;[272] .cmdat 19340 000222'02 000000000000# cascii () ;[272] .cmhlp 19341 000535'04 162 145 155 157 164 19342 000223'02 44 07 0 00 000000* point 7,tdefps ;[272] .cmdef !! 19343 retsec ;;Return to code .psect 19344 19345 ;[266] Document hairy parse variable usage. Be aware that some of these are 19346 ; shared with INPUT's parsing and semantic action. 19347 19348 001744'01 .trans: entry .trans ; Invoked from k20par 19349 001744'01 265 16 0 00 004640' saveac ; Protect some registers 19350 19351 001745'01 200 01 0 00 004654' movx t1, cz%ncl!.fhslf ; Release non-open JFN's on reparse 19352 001746'01 104 00 0 00 000034 CLZFF% 19353 001747'01 320 12 0 00 001750' erjmpr .+1 ; Catch and ignore errors 19354 001750'01 200 01 0 00 004655' move t1, [trnbk,,cjfnbk] ; Insert our file parsing defaults. 19355 001751'01 251 01 0 00 000000# blt t1, cjfnbk+trnbkl 19356 19357 001752'01 260 17 0 00 001715' call trcapd ;[275] Set up the parse/command defaults 19358 001753'01 201 11 0 00 000000# movei q5, tranfs ;[229] Doing a full complement of switches 19359 19360 001754'01 200 16 0 00 000000# .tran0: guide 19361 001755'01 260 17 0 00 001616* 19362 000224'02 000000000000# 19363 000545'04 146 151 154 145 040 19364 001756'01 .tran1: remark ;[229] Here when looping on switches 19365 001756'01 200 01 0 00 000011 move t1, q5 ;[229] Look for switch, device or file 19366 001757'01 260 17 0 00 001674* call rfield ;[229] Ask them to type something 19367 001760'01 200 06 0 00 000002 move q2, t2 ;[229] Save whatever parsed data we got 19368 001761'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[229] Pick up function code 19369 19370 001762'01 302 05 0 00 000003 caie q1, .cmswi ;[229] Did we get a switch? 19371 001763'01 254 00 0 00 001775' ifskp. ;[266] Yes, let's handle that 19372 001764'01 550 07 0 06 000000 hrrz q3, (q2) ;[229] Pick up the switch value 19373 001765'01 307 07 0 00 000006 caig q3, %tlast ;[266] Out of range? 19374 001766'01 260 17 1 07 000000# call @trnswd(q3) ;[266] No, so call the switch's parser 19375 001767'01 254 00 0 00 001772' ifskp. ;[229] Successful switch parse 19376 001770'01 254 00 0 00 001756' jrst .tran1 ;[229] Go see if more switches (or device or file) 19377 001771'01 254 00 0 00 001775' else. ;[229] Otherwise, some kind of error 19378 001772'01 200 01 0 00 000000# emsg ;[229] An internal programming error.. 19379 001773'01 104 00 0 00 000313 19380 000225'02 000000000000# 19381 000552'04 125 156 153 156 157 19382 001774'01 254 00 0 00 001714* jrst cmder1 ;[229] However, allow reparse 19383 001775'01 endif. ;[266] End switch secondary parsing 19384 001775'01 endif. ;[229] End of switch block processing 19385 19386 001775'01 200 01 0 00 000006 .tran2: move t1, q2 ;[229] Load parsed data for DVCHR% 19387 001776'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 19388 001777'01 621 01 0 00 777777 tlz t1, -1 ; No, shut off flags so DVCHR% doesn't choke K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-1 K20IOC MAC 12-May-24 20:27 TRANSMIT command parsing 19389 002000'01 104 00 0 00 000117 DVCHR% ; and find out about it 19390 002001'01 320 12 0 00 002003' %jserr (,r) 19391 002002'01 254 00 0 00 002006' 19392 002003'01 265 01 0 00 001550* 19393 002004'01 000000000000# 19394 002005'01 254 00 0 00 001532* 19395 000561'04 125 156 141 142 154 19396 002006'01 135 07 0 00 004656' ldb q3, [pointr t2, dv%typ] ; Pick up the device type 19397 19398 002007'01 302 05 0 00 000016 caie q1, .cmdev ; Typed a bare device? 19399 002010'01 254 00 0 00 002035' ifskp. ; Yes, see what it is 19400 002011'01 302 07 0 00 000015 caie q3, .dvnul ; NUL:? 19401 002012'01 254 00 0 00 002015' ifskp. ; Yes, we can simulate that 19402 002013'01 200 06 0 00 004657' movx q2, ;Use special designator and flags 19403 002014'01 254 00 0 00 002052' jrst .tran3 ;[229] Done with this special case 19404 002015'01 endif. ; Any other device is NOT VALID 19405 19406 002015'01 302 07 0 00 000000 caie q3, .dvdsk ; Bare device? 19407 002016'01 254 00 0 00 002034' ifskp. ; Yes, but needs a file name 19408 002017'01 200 01 0 00 000000# emsg ; First part of blat 19409 002020'01 104 00 0 00 000313 19410 000226'02 000000000000# 19411 000574'04 124 150 145 040 000 19412 002021'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 19413 002022'01 201 01 0 00 000101 movei t1, .priou ; Output to the terminal 19414 002023'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 19415 002024'01 320 12 0 00 002026' %jserr (,cmder1) 19416 002025'01 254 00 0 00 002031' 19417 002026'01 265 01 0 00 002003* 19418 002027'01 000000000000# 19419 002030'01 254 00 0 00 001774* 19420 000575'04 125 156 141 142 154 19421 002031'01 200 01 0 00 000000# sxtext (t1,<: structure needs a file specification>) 19422 000227'02 000000000000# 19423 000606'04 072 040 163 164 162 19424 002032'01 104 00 0 00 000076 PSOUT% ; Finish the informative blat 19425 002033'01 254 00 0 00 002030* jrst cmder1 ; Allow reparse 19426 002034'01 endif. ; Any other device is NOT VALID 19427 19428 002034'01 254 00 0 00 002105' jrst .trane ; Otherwise, handle as a general parse error 19429 002035'01 endif. ; End case .cmdev 19430 19431 remark .cmfil ; Everything else is a file 19432 19433 002035'01 302 07 0 00 000015 caie q3, .dvnul ; A JFN on NUL:?? 19434 002036'01 254 00 0 00 002050' ifskp. ; Yes, let's fix that up 19435 002037'01 200 01 0 00 000006 move t1, q2 ; Load parsed JFN 19436 002040'01 260 17 0 00 000000* call isnulj ; Convert it to a special JFN, releasing original 19437 002041'01 334 01 0 00 000000# ermsg% (,cmder1) ; Allow ^H 19438 002042'01 254 00 0 00 002046' 19439 002043'01 202 01 0 00 001313* 19440 002044'01 104 00 0 00 000313 19441 002045'01 254 00 0 00 002033* 19442 000230'02 000000000000# 19443 000616'04 113 105 122 115 111 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-2 K20IOC MAC 12-May-24 20:27 TRANSMIT command parsing 19444 19445 002046'01 200 06 0 00 000001 move q2, t1 ; Store the JFN and original parse flags 19446 002047'01 254 00 0 00 002052' jrst .tran3 ; Done with this second special NUL: (JFN) case 19447 002050'01 endif. 19448 19449 002050'01 302 07 0 00 000000 caie q3, .dvdsk ; Was this a structure? 19450 002051'01 254 00 0 00 002105' jrst .trane ; No, any other device is NOT VALID 19451 19452 19453 002052'01 .tran3: remark ;[229] Otherwise, parse is OK so far 19454 002052'01 200 10 0 00 001742* move q4, pars12 ;[273] Load whether observing case 19455 002053'01 333 01 0 00 000000* skiple t1, tdefpl ;[272] Load length of default prompt 19456 002054'01 254 00 0 00 002057' ifskp. ;[272] Not using one 19457 002055'01 260 17 0 00 000226' call .inpu1 ;[272] So go get something (or nothing) 19458 002056'01 254 00 0 00 002067' else. ;[272] Otherwise, set up to use default if wanted 19459 002057'01 200 16 0 00 000000# guide ;[272] Guide us to type the next thing 19460 002060'01 260 17 0 00 001755* 19461 000231'02 000000000000# 19462 000630'04 163 164 162 151 156 19463 002061'01 403 01 0 00 000002 setzb t1, t2 ;[272] Cons up some NUL 19464 002062'01 124 01 0 00 001445* dmovem t1, atmbuf ;[272] Give the atom buffer a good scrub a dub 19465 002063'01 201 01 0 00 000000# movei t1, trdfdb ;[272] Parse using our nifty default, if wanted 19466 002064'01 260 17 0 00 001757* call rfield ;[272] Get an input string 19467 002065'01 135 05 0 00 004466' ldb q1, [pointr (.cmfnp(t3),cm%fnc)] ;[272] Get the function code 19468 002066'01 260 17 0 00 000237' call .inpu2 ;[272] Hook in a little later in the parse chain 19469 002067'01 endif. ;[272] End case default prompt determination 19470 19471 002067'01 302 05 0 00 000010 caie q1, .cmcfm ; Defaulted search? 19472 002070'01 254 00 0 00 002102' ifskp. ; Yes, maybe fix up for TRANSMIT defaults 19473 002071'01 333 00 0 00 000000# skiple indefw ; Had we set a default search string? 19474 002072'01 254 00 0 00 002102' anskp. ; We did, so we're done 19475 remark ; Otherwise, supply another appropriate default. 19476 002073'01 336 01 0 00 000000* skipn t1, handsh ; Handshaking? 19477 002074'01 201 01 0 00 000012 movei t1, .chlfd ; No, then use linefeed. 19478 002075'01 241 01 0 00 777771 rot t1, -^d7 ; Turn into an ASCIZ word 19479 002076'01 202 01 0 00 001366* movem t1, strbuf ; Stomp the string buffer 19480 002077'01 201 02 0 00 000001 movei t2, ^d1 ; Single character long 19481 002100'01 200 03 0 00 004602' move t3, [point 7, strbuf] ; Pointer to buffer 19482 002101'01 124 02 0 00 001364* dmovem t2, strc ; Stomp into search string parameters 19483 002102'01 endif. ; Carry on 19484 19485 002102'01 202 06 0 00 000074* movem q2, pars2 ; Store the JFN and flags 19486 002103'01 476 00 0 00 000376* setom pars6 ;[209] Override the ^C handling 19487 19488 remark confirm ;[272] .inpu1/2 does this for us 19489 002104'01 263 17 0 00 000000 ret ; Done with the parse 19490 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20IOC MAC 12-May-24 20:27 TRANSMIT command parsing 19491 remark Here for common parse errors 19492 19493 002105'01 200 01 0 00 000000# .trane: emsg ; Begin whining 19494 002106'01 104 00 0 00 000313 19495 000232'02 000000000000# 19496 000634'04 124 150 145 040 000 19497 002107'01 201 01 0 00 000101 movei t1, .priou ; Output to terminal, always 19498 19499 remark ; N.B., JFNS% will choke on a device 19500 002110'01 302 05 0 00 000016 caie q1, .cmdev ; Device? 19501 002111'01 254 00 0 00 002122' ifskp. ; Yes, use DEVST% 19502 002112'01 200 02 0 00 000006 move t2, q2 ; Load whatever we parsed 19503 002113'01 104 00 0 00 000121 DEVST% ; Write the device name into the AC's 19504 002114'01 320 12 0 00 002116' %jserr (,cmder1) 19505 002115'01 254 00 0 00 002121' 19506 002116'01 265 01 0 00 002026* 19507 002117'01 000000000000# 19508 002120'01 254 00 0 00 002045* 19509 000635'04 125 156 141 142 154 19510 002121'01 254 00 0 00 002132' else. ; Otherwise, DEVST% will choke on the JFN 19511 002122'01 550 02 0 00 000006 hrrz t2, q2 ; Load just the JFN 19512 dmove t3, [ ; Just want the device name, no punctuation 19513 fld(.jsaof,js%dev) 19514 002123'01 120 03 0 00 004660' 0 ] ; No odd prefix, whatever that is 19515 002124'01 104 00 0 00 000030 JFNS% ; Convert to something readable 19516 002125'01 320 12 0 00 002127' %jserr (,cmder1) 19517 002126'01 254 00 0 00 002132' 19518 002127'01 265 01 0 00 002116* 19519 002130'01 000000000000# 19520 002131'01 254 00 0 00 002120* 19521 000645'04 125 156 141 142 154 19522 002132'01 endif. ; Either way, error should be more informative 19523 19524 002132'01 200 01 0 00 000000# txmsg <: device is not valid for TRANSMIT or CAPTURE> 19525 002133'01 104 00 0 00 000076 19526 002134'01 320 12 0 00 002135' 19527 000233'02 000000000000# 19528 000657'04 072 040 144 145 166 19529 002135'01 561 01 0 00 000360* hrroi t1, crlf ; Newline 19530 002136'01 104 00 0 00 000076 PSOUT% ; Tie off the blat 19531 002137'01 320 12 0 00 002140' erjmpr .+1 ; Catch and ignore that error, too 19532 19533 002140'01 302 05 0 00 000006 caie q1, .cmfil ; Had we parsed a file, actually? 19534 002141'01 254 00 0 00 002145' ifskp. ; Yes, then have a little clean up to do 19535 002142'01 550 01 0 00 000006 hrrz t1, q2 ; Load our poor JFN, sans flags 19536 002143'01 104 00 0 00 000023 RLJFN% ; Toss it; can't use it 19537 002144'01 320 12 0 00 002131* erjmpr cmder1 ; Ignore error and beat it 19538 002145'01 endif. 19539 19540 002145'01 254 00 0 00 002144* jrst cmder1 ; Allow ^H 19541 .endps code ;[263] Get out of code .psect 19542 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20IOC MAC 12-May-24 20:27 File I/O for Transmit, quasi-hidden data area 19543 subttl File I/O for Transmit, quasi-hidden data area 19544 19545 .psect edata,edaorg ;[263] Extended data 19546 19547 remark Used for moby map of the file 19548 19549 remark ;[263] Do not reorder any of these! Append only! 19550 000000'05 fjfn: block 1 ;[263] File JFN 19551 000001'05 f1st:! remark ;[263] First location to whack 19552 000001'05 fsizef: block 2 ;[265] Results of SIZEF%, possibly tweaked 19553 000003'05 fsizeb: block 1 ;[263] File size in bytes (remaining bytes this section) 19554 000004'05 fsizep: block 1 ;[263] File size in pages (remaining pages this section) 19555 000005'05 fbytes: block 1 ;[263] File byte size 19556 000006'05 fbytew: block 1 ;[263] Bytes per word 19557 000007'05 fsizec: block 1 ;[263] Bytes done so far 19558 000010'05 fsmapw: block 1 ;[263] SMAP% window 19559 000011'05 fpmapw: block 1 ;[263] PMAP% window 19560 000012'05 fbytep: block 2 ;[263] Mapped file byte pointer (global) 19561 000014'05 fmsecf: block 1 ;[263] Set if we have another section to do 19562 000015'05 frpage: block 1 ;[263] Remaining pages, if multi-section file 19563 000016'05 fpagfb: block 1 ;[265] Final page fragment, in characters 19564 000017'05 eacs: block 4 ;[263] Accumulators, when squawking 19565 19566 000023'05 flasta:! remark ;[263] Last address to whack 19567 000021 fwhack==flasta-f1st-1 ;[263] Calculate amount to whack 19568 .endps edata ;[263] End of extended data 19569 ;[263] Write-protected code, phew! 19570 define eemsg (t,%t,%et) < 19571 move t1, %t ;;Load Tops-20 pointer to string 19572 ESOUT% ;;Blat at the user 19573 chgsec(ecode,econst) ;;Open the extended constants .psect 19574 %t: .px7!%et ;;Point to text in extended section 19575 retsec ;;Close out section extended constants .psect 19576 chgsec(ecode,etext) ;;Open the extend text .psect 19577 %et: asciz \'t\ ;;Emit the text of the message with no CRLF 19578 retsec ;;Back to regular extended code 19579 cleans(<%t,%et>) ;;Clean up generated symbols 19580 >;;End of emsg 19581 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20IOC MAC 12-May-24 20:27 File I/O for Transmit, maps the file in 19582 subttl File I/O for Transmit, maps the file in 19583 19584 ;Call: 19585 ; 19586 ; t1/ JFN 19587 ; 19588 ; Return: 19589 ; 19590 ; Results of SIZEF% 19591 19592 .psect ecode/RONLY,ecdorg 19593 19594 000000'06 621 01 0 00 777777 emapfi: tlz t1, -1 ;[263] Stomp the flags 19595 000001'06 202 01 0 00 000000# movem t1, fjfn ;[263] Save the file JFN 19596 ;[265] N.B., f1st is *AFTER* fjfn!!! 19597 000002'06 201 02 0 00 000021 movx t2,fwhack ;[263] Load count of items to whack 19598 000003'06 415 03 0 00 000000# xmovei t3, f1st ;[263] First location to stomp 19599 000004'06 415 04 0 03 000001 xmovei t4, ^o1(t3) ;[263] Cascading zeros 19600 000005'06 402 00 0 03 000000 setzm (t3) ;[263] Stomp the first location 19601 000006'06 123 02 0 00 000614' xblt. t2 ;[263] Stomp the rest of them 19602 ;[265] Nice source of infinite NUL's and EOF's? 19603 000007'06 306 01 0 00 377777 cain t1, .nulio ;[209] Don't need to open .nulio 19604 000010'06 254 00 0 00 000165' jrst emapr2 ;[263] Return success (NUL: always works) 19605 19606 000011'06 104 00 0 00 000036 SIZEF% ;[229] Find out how large the file is 19607 000012'06 320 12 0 00 000014' ifje. r ;[229] Failed?? 19608 000013'06 254 00 0 00 000022' 19609 000014'06 200 04 0 00 000001 move t4, t1 ;[229] Save error for debuggers 19610 000015'06 200 01 0 00 000000# eemsg ;[263] Squawk 19611 000016'06 104 00 0 00 000313 19612 000000'07 000000000000# 19613 000671'04 125 156 141 142 154 19614 000017'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19615 000020'06 254 00 0 00 000170' jrst emapr1 ;[263] Fail the call 19616 000021'06 254 00 0 00 000024' else. ;[229] Otherwise, worked!!!! 19617 000022'06 124 02 0 00 000000# dmovem t2, fsizeb ;[229] So store results in file size double word 19618 000023'06 124 02 0 00 000000# dmovem t2, fsizef ;[265] Also as original to return to caller 19619 000024'06 endif. ;[229] End case SIZEF% JSYS results handling 19620 19621 dmove t2, [1,,.fbbyv ;[229] Let's have a look at the byte size 19622 000024'06 120 02 0 00 000615' t4 ] ;[229] Tuck it into t4 19623 000025'06 104 00 0 00 000063 GTFDB% ;[229] Try to pull from file descriptor block 19624 000026'06 320 12 0 00 000030' ifje. r ;[229] Failed?? 19625 000027'06 254 00 0 00 000040' 19626 000030'06 200 04 0 00 000001 move t4, t1 ;[229] Save the error for debuggers 19627 000031'06 200 01 0 00 000000# eemsg ;[263] Squawk 19628 000032'06 104 00 0 00 000313 19629 000001'07 000000000000# 19630 000703'04 125 156 141 142 154 19631 000033'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19632 000034'06 201 03 0 00 000007 movei t3, ^d7 ;[229] Ignore it and pretend ASCII 19633 000035'06 202 03 0 00 000000# movem t3, fbytes ;[263] Imagine the file byte size ... 19634 000036'06 200 01 0 00 000000# move t1, fjfn ;[229] Reload JFN for OPENF% attempt 19635 000037'06 254 00 0 00 000042' else. ;[229] Otherwise, worked 19636 000040'06 135 03 0 00 000617' ldb t3,[ pointr(t4,fb%bsz) ] ;[229] Extract byte size from packed field K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-1 K20IOC MAC 12-May-24 20:27 File I/O for Transmit, maps the file in 19637 000041'06 202 03 0 00 000000# movem t3, fbytes ;[263] Store the file byte size ... 19638 000042'06 endif. ;[229] End case GTFDB% JSYS handling 19639 ;[265] Use byte size to determine OPENF% mode 19640 000042'06 200 02 0 00 000620' movx t2, fld(7,of%bsz)!of%rd ; Assume 7-bit (also handles 36 bit PA1050) 19641 000043'06 306 03 0 00 000010 cain t3, ^d8 ;[229] Is our assumption incorrect? 19642 000044'06 200 02 0 00 000621' movx t2, fld(8,of%bsz)!of%rd ;[223] Fine, it's eight bit 19643 000045'06 104 00 0 00 000021 OPENF% 19644 000046'06 320 12 0 00 000050' ifje. r ;[209] Failed?? 19645 000047'06 254 00 0 00 000055' 19646 000050'06 200 04 0 00 000001 move t4, t1 ;[209] Save error code for debugging 19647 000051'06 200 01 0 00 000000# eemsg ;[263] Squawk and continue 19648 000052'06 104 00 0 00 000313 19649 000002'07 000000000000# 19650 000716'04 125 156 141 142 154 19651 000053'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19652 000054'06 254 00 0 00 000170' jrst emapr1 ;[263] Give failure return 19653 000055'06 endif. ;[263] End OPENF% error handling 19654 19655 remark ;[265] Determine bytes per word 19656 000055'06 201 02 0 00 000005 movx t2, ^d5 ;[263] Let's assume ASCII and five characters per word 19657 000056'06 306 03 0 00 000010 cain t3, ^d8 ;[263] Not eight bit, is it? 19658 000057'06 201 02 0 00 000004 movx t2, ^d4 ;[263] Only four characters per word 19659 000060'06 202 02 0 00 000000# movem t2, fbytew ;[263] Store bytes per word 19660 19661 remark ;[265] Determine if we have to fix up Tops-10 output 19662 000061'06 323 03 0 00 000070' ifg. t3 ;[263] If we have a positive byte size 19663 000062'06 302 01 0 00 000044 caie t1, ^d36 ;[263] PA1050 output? 19664 000063'06 254 00 0 00 000070' anskp. ;[263] No, we're done 19665 000064'06 200 02 0 00 000000# move t2, fsizeb ;[263] Load the file byte count 19666 000065'06 221 02 0 00 000005 imuli t2, ^d5 ;[263] Five seven bit bytes per word 19667 000066'06 202 02 0 00 000000# movem t2, fsizeb ;[263] Update the byte count 19668 000067'06 202 02 0 00 000000# movem t2, fsizef ;[265] Also also original 19669 000070'06 endif. ;[263] End case PA1050 fixup 19670 19671 remark ;[265] Calculate internal fragmentation of final page 19672 000070'06 120 01 0 00 000000# dmove t1, fsizef ;[265] Load original byte count and pages 19673 000071'06 240 02 0 00 000011 ash t2, ^d9 ;[265] Turn page count into word count 19674 000072'06 220 02 0 00 000000# imul t2, fbytew ;[265] By bytes per word, gets total bytes 19675 000073'06 274 02 0 00 000001 sub t2, t1 ;[265] Remainder is internal fragmentation in bytes 19676 000074'06 202 02 0 00 000000# movem t2, fpagfb ;[265] Save remaining avaiable bytes 19677 19678 remark ;[265] Construct the appropriate 30 bit byte pointer 19679 dmove t1, [ 1b12 ;[263] Flag a two word global byte pointer 19680 000075'06 120 01 0 00 000622' smporg ] ;[263] Load address of mapped file section 19681 000076'06 302 03 0 00 000010 caie t3, ^d8 ;[263] Is this an eight bit file? 19682 000077'06 254 00 0 00 000102' ifskp. ;[263] Yes, so that might be fine, maybe ... 19683 000100'06 661 01 0 00 441000 iorx t1, ;[263] Change into an eight bit pointer 19684 000101'06 254 00 0 00 000103' else. ;[263] All else is ASCII 19685 000102'06 661 01 0 00 440700 iorx t1, ;[263] Handy (but arcane) macsym generated symbol 19686 000103'06 endif. ;[263] 19687 000103'06 124 01 0 00 000000# dmovem t1, fbytep ;[263] Set the mapped file one word global pointer 19688 19689 remark ;[265] Sanity check file size 19690 000104'06 337 01 0 00 000000# skipg t1, fsizep ;[263] Does the file have any pages? 19691 000105'06 254 00 0 00 000165' jrst emapr2 ;[263] No, so don't map anything K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-2 K20IOC MAC 12-May-24 20:27 File I/O for Transmit, maps the file in 19692 000106'06 301 01 0 00 001000 cail t1, ^d512 ;[263] Less than a section? 19693 000107'06 254 00 0 00 000173' jrst smp1st ;[263] No, map the file's first section 19694 19695 000110'06 400 01 0 00 000000 setz t1, ;[263] A zero means creating a section 19696 dmove t2, [ ;[263] Doing a moby map! 19697 .fhslf,,smpsec ;[263] This process, SMAP section 19698 000111'06 120 02 0 00 000624' sm%rd!^d1 ] ;[263] Read-Only, a single section 19699 000112'06 104 00 0 00 000767 SMAP% ;[263] Case III: Creating a section 19700 000113'06 320 12 0 00 000115' ifje. r ;[263] Failed?? 19701 000114'06 254 00 0 00 000123' 19702 000115'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19703 000116'06 200 01 0 00 000000# eemsg ;[263] Squawk 19704 000117'06 104 00 0 00 000313 19705 000003'07 000000000000# 19706 000724'04 125 156 141 142 154 19707 000120'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19708 000121'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19709 000122'06 254 00 0 00 000124' else. ;[263] Otherwise, worked 19710 000123'06 202 01 0 00 000000# movem t1, fsmapw ;[263] Set the SMAP% window 19711 000124'06 endif. ;[263] End case SMAP% handling 19712 19713 remark ;[263] Next, map the entire file 19714 000124'06 514 01 0 00 000000# hrlz t1, fjfn ;[263] Mapping from file page zero 19715 000125'06 202 01 0 00 000000# movem t1, fpmapw ;[263] Set the PMAP% file window 19716 000126'06 205 02 0 00 000003 movx t2,smporg ;[263] Load smap origin address 19717 000127'06 242 02 0 00 777767 lsh t2,-^d9 ;[263] Turn into a page number 19718 000130'06 505 02 0 00 600000 hrli t2,.fhslf!fh%epn ;[263] Flag extended page number 19719 000131'06 200 03 0 00 000000# move t3, fsizep ;[263] Load the page count 19720 000132'06 302 03 0 00 000001 caie t3, ^d1 ;[263] A single page? 19721 000133'06 661 03 0 00 400000 txo t3, pm%cnt ;[263] Flag that a count exists 19722 000134'06 661 03 0 00 100200 txo t3, pm%rd!pm%epn ;[263] Extended page number, write protected 19723 000135'06 104 00 0 00 000056 PMAP% ;[263] Map the file, but don't preload 19724 000136'06 320 12 0 00 000140' ifje. r ;[263] Failed, get rid of everything and leave 19725 000137'06 254 00 0 00 000151' 19726 000140'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19727 000141'06 200 01 0 00 000000# eemsg ;[263] Squawk 19728 000142'06 104 00 0 00 000313 19729 000004'07 000000000000# 19730 000735'04 125 156 141 142 154 19731 000143'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19732 000144'06 474 01 0 00 000000 seto t1, ;[263] -1 to release storage 19733 dmove t2, [ ;[263] Doing a moby unmap! 19734 .fhslf,,smpsec ;[263] This process, SMAP section 19735 000145'06 120 02 0 00 000626' 0,,^d1 ] ;[263] No access, a single section 19736 000146'06 104 00 0 00 000767 SMAP% ;[263] Case IV: Deleting Process Sections 19737 000147'06 320 12 0 00 000150' erjmpr .+1 ;[263] Catch and ignore error 19738 000150'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19739 000151'06 endif. ;[263] End case PMAP% error handling 19740 19741 remark ;[263] Finally, guard the rest of the section 19742 000151'06 200 02 0 00 000000# move t2, fsizep ;[263] Load file size in pages as first page to do 19743 000152'06 201 04 0 00 001000 movei t4, ^d512 ;[263] Load maximum pages per section 19744 000153'06 274 04 0 00 000002 sub t4, t2 ;[263] Calculate remaining pages to guard 19745 000154'06 323 04 0 00 000165' jumple t4, emapr2 ;[263] Leave if nothing left in section to guard 19746 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-3 K20IOC MAC 12-May-24 20:27 File I/O for Transmit, maps the file in 19747 000155'06 200 01 1 00 000630' move t1, @[0,,grdmap] ;[263] Pre-calculated process mapping window 19748 000156'06 271 02 0 00 003000 addx t2,smppag ;[263] Load starting page number 19749 19750 000157'06 500 02 0 00 000001 hll t2,t1 ;[263] It's going into this self-same process 19751 000160'06 205 03 0 00 100200 movx t3,pm%rd!pm%epn ;[263] No actual access, extended page 19752 000161'06 do. ;[263] Now protect ourself from ourself 19753 000161'06 104 00 0 00 000056 PMAP% ;[263] Map the Explode-on-Use page 19754 000162'06 320 12 0 00 000165' erjmpr endlp. ;[263] Get out of here on an error 19755 000163'06 271 02 0 00 000001 addi t2, ^d1 ;[263] Next page in memory 19756 000164'06 367 04 0 00 000161' sojg t4, top. ;[263] Do the rest of them 19757 000165'06 enddo. ;[263] Falls out when done 19758 19759 000165'06 120 02 0 00 000000# emapr2: dmove t2, fsizef ;[263] Return SIZEF% results 19760 000166'06 550 06 0 00 000017 hrrz q2, p ;[263] Load in-section address of stack 19761 000167'06 350 00 1 00 000006 aos @q2 ;[263] Bump that return address 19762 000170'06 emapr1: remark ;[263] Here to return to section zero caller 19763 000170'06 254 14 0 00 000007 xsfm q3 ;[263] Get and store the flags 19764 000171'06 201 10 0 00 000000# movei q4, mapret ;[263] Load up inter-section transfer address 19765 000172'06 254 05 0 00 000007 xjrstf q3 ;[263] Take a GIANT step downstairs 19766 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20IOC MAC 12-May-24 20:27 Here to (s)map the first section of a multi-section file 19767 subttl Here to (s)map the first section of a multi-section file 19768 19769 ; Context: 19770 ; 19771 ; T1/ Pages in file 19772 ; T3/ File byte size 19773 19774 000173'06 smp1st: remark ;[265] Hlrz is fastest multiply by 512*512 on the PDP-10! 19775 000173'06 514 02 0 00 000000# hrlz t2, fbytew ;[263] Now calculate characters in the entire section 19776 000174'06 250 02 0 00 000000# exch t2, fsizeb ;[263] Exchange with larger figure 19777 000175'06 274 02 0 00 000000# sub t2, fsizeb ;[263] Calculate remaining bytes, assuming entire pages 19778 remark ;[265] Which we won't use 19779 19780 000176'06 201 04 0 00 001000 movx t4, ^d512 ;[263] Pages per section 19781 000177'06 250 04 0 00 000000# exch t4, fsizep ;[263] Swap with larger figure 19782 000200'06 274 04 0 00 000000# sub t4, fsizep ;[263] Calculate remaining pages 19783 000201'06 323 04 0 00 000205' ifg. t4 ;[263] Will there be any? 19784 000202'06 476 00 0 00 000000# setom fmsecf ;[263] Yes, set multi-section flag 19785 000203'06 202 04 0 00 000000# movem t4, frpage ;[263] Store remaining pages 19786 000204'06 254 00 0 00 000207' else. ;[265] Otherwise this is the only section 19787 000205'06 402 00 0 00 000000# setzm fmsecf ;[263] So clear multi-section flag 19788 000206'06 402 00 0 00 000000# setzm frpage ;[263] Clamp remaining pages to zero 19789 000207'06 endif. ;[263] 19790 19791 remark ;[263] Case I: Mapping File Sections to a process 19792 000207'06 514 01 0 00 000000# hrlz t1, fjfn ;[263] Load the file JFN, first section 19793 dmove t2, [ 19794 .fhslf,,smpsec ;[263] This process, SMAP%'ing section 19795 000210'06 120 02 0 00 000624' sm%rd!^d1 ] ;[263] Write protected, a single section 19796 000211'06 104 00 0 00 000767 SMAP% ;[263] Take a giant gulp of the file 19797 000212'06 320 12 0 00 000214' ifje. r ;[263] That's not good... 19798 000213'06 254 00 0 00 000221' 19799 000214'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19800 000215'06 200 01 0 00 000000# eemsg ;[263] Squawk 19801 000216'06 104 00 0 00 000313 19802 000005'07 000000000000# 19803 000745'04 125 156 141 142 154 19804 000217'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19805 000220'06 254 00 0 00 000170' jrst emapr1 ;[263] Return failure 19806 000221'06 endif. ;[263] End case SMAP% error handling 19807 19808 000221'06 202 01 0 00 000000# movem t1, fsmapw ;[263] Set the SMAP% file window 19809 000222'06 202 01 0 00 000000# movem t1, fpmapw ;[263] Set the PMAP% file window 19810 000223'06 254 00 0 00 000165' jrst emapr2 ;[263] Return good 19811 19812 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20IOC MAC 12-May-24 20:27 Here to (s)map the next section of a multi-section file 19813 subttl Here to (s)map the next section of a multi-section file 19814 19815 ; Linkage here is accumulator based because section 1 has no stack 19816 ; 19817 ; Calling environment: 19818 ; 19819 ; t1,t2,t3,t4/ Available and do not need to be preserved 19820 ; q1,q2/ Ditto 19821 ; q3/ Destination pointer 19822 ; q4/ Remaining space in destination 19823 ; q5/ Return address 19824 ; 19825 ; Returns with everything magically ready to go or drops dead 19826 19827 000224'06 336 00 0 00 000000# smpnxt: skipn fmsecf ;[263] Multi-section flag set? 19828 000225'06 254 00 0 11 000000 jrst (q5) ;[263] Nope, impossible there is anything to do 19829 19830 000226'06 200 01 0 00 000000# move t1, fbytep+1 ;[263] Load address portion of the byte pointer 19831 000227'06 200 04 0 00 000001 move t4, t1 ;[263] Save a copy for later 19832 000230'06 640 01 0 00 777000 trc t1, 777000 ;[263] Flip the page number bits 19833 000231'06 642 01 0 00 777000 trce t1, 777000 ;[263] Flip them again and skip if all zero 19834 000232'06 254 00 0 11 000000 jrst (q5) ;[263] Something set, so not into the last page 19835 000233'06 620 01 0 00 777000 trz t1, 777000 ;[263] Put us back into page zero 19836 000234'06 202 01 0 00 000000# movem t1, fbytep+1 ;[263] Store address portion of the byte pointer 19837 19838 000235'06 200 01 0 00 000004 move t1, t4 ;[263] Restore the address portion of global byte pointer 19839 000236'06 242 01 0 00 777767 lsh t1, -^d9 ;[263] Convert address to a page number 19840 000237'06 505 01 0 00 600000 hrli t1, .fhslf!fh%epn ;[263] This process, extended page number 19841 000240'06 104 00 0 00 000061 RMAP% ;[263] Get the file page that is in there 19842 000241'06 320 12 0 00 000243' ifje. r ;[263] Failed?? 19843 000242'06 254 00 0 00 000250' 19844 000243'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19845 000244'06 200 01 0 00 000000# eemsg ;[263] Squawk 19846 000245'06 104 00 0 00 000313 19847 000006'07 000000000000# 19848 000760'04 125 156 141 142 154 19849 000246'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19850 000247'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19851 000250'06 endif. ;[263] 19852 19853 000250'06 312 01 0 00 000631' came t1, [-1] ;[263] Doesn't exist?? 19854 000251'06 254 00 0 00 000255' ifskp. ;[263] No, that can't be right 19855 000252'06 200 01 0 00 000000# eemsg ;[263] Squawk 19856 000253'06 104 00 0 00 000313 19857 000007'07 000000000000# 19858 000774'04 114 141 163 164 040 19859 000254'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19860 000255'06 endif. ;[263] Should exist 19861 19862 000255'06 603 02 0 00 010000 ifxe. t2, rm%pex ;[263] Does the page exist? 19863 000256'06 254 00 0 00 000262' 19864 000257'06 200 01 0 00 000000# eemsg ;[263] Squawk 19865 000260'06 104 00 0 00 000313 19866 000010'07 000000000000# 19867 001005'04 114 141 163 164 040 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20IOC MAC 12-May-24 20:27 Here to (s)map the next section of a multi-section file 19868 000261'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19869 000262'06 endif. ;[263] And have had the existence bit turned on 19870 19871 000262'06 312 01 1 00 000630' came t1, @[0,,grdmap] ;[263] Is this the guard page?? 19872 000263'06 254 00 0 00 000267' ifskp. ;[263] It is, we can't read from that 19873 000264'06 200 01 0 00 000000# eemsg ;[263] Squawk 19874 000265'06 104 00 0 00 000313 19875 000011'07 000000000000# 19876 001017'04 114 141 163 164 040 19877 000266'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19878 000267'06 endif. ;[263] Should have been a file page 19879 19880 000267'06 202 01 0 00 000000# movem t1, fpmapw ;[263] Use as the base PMAP% file window 19881 19882 000270'06 336 00 0 00 000000# ifmn. fsmapw ;[263] Was the last file map a section map? 19883 000271'06 254 00 0 00 000335' 19884 000272'06 474 01 0 00 000000 seto t1, ;[263] -1 to release storage 19885 dmove t2, [ ;[263] Doing a moby unmap! 19886 .fhslf,,smpsec ;[263] This process, SMAP section 19887 000273'06 120 02 0 00 000626' 0,,^d1 ] ;[263] No access, a single section 19888 000274'06 104 00 0 00 000767 SMAP% ;[263] Case IV: Deleting Process Sections 19889 000275'06 320 12 0 00 000277' ifje. r ;[263] Failed?? 19890 000276'06 254 00 0 00 000304' 19891 000277'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19892 000300'06 200 01 0 00 000000# eemsg ;[263] Squawk 19893 000301'06 104 00 0 00 000313 19894 000012'07 000000000000# 19895 001030'04 125 156 141 142 154 19896 000302'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19897 000303'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19898 000304'06 endif. ;[263] End case section removal error handling 19899 000304'06 400 01 0 00 000000 setz t1, ;[263] Zero to create a private section 19900 000305'06 661 03 0 00 100000 txo t3, sm%rd ;[263] Read-only access (which is ignored when private) 19901 000306'06 104 00 0 00 000767 SMAP% ;[263] Case III: Creating a section 19902 000307'06 320 12 0 00 000311' ifje. r ;[263] Failed?? 19903 000310'06 254 00 0 00 000316' 19904 000311'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19905 000312'06 200 01 0 00 000000# eemsg 19906 000313'06 104 00 0 00 000313 19907 000013'07 000000000000# 19908 001042'04 125 156 141 142 154 19909 000314'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19910 000315'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19911 000316'06 endif. ;[263] End case private section creation error handling 19912 000316'06 402 00 0 00 000000# setzm fsmapw ;[263] Can no longer do file section mapping 19913 000317'06 200 01 0 00 000000# move t1, fpmapw ;[263] Have to map the page back in from the file 19914 000320'06 510 02 0 00 000004 hllz t2, t4 ;[263] Load the section as base page address 19915 000321'06 242 02 0 00 777767 lsh t2, -^d9 ;[263] Convert address to a page number 19916 000322'06 505 02 0 00 600000 hrli t2,.fhslf!fh%epn ;[263] This process, extended page number 19917 000323'06 205 03 0 00 100200 movx t3, pm%rd!pm%epn ;[263] Read-only, extended page number 19918 000324'06 104 00 0 00 000056 PMAP% ;[263] Case I: Mapping File Pages to a Process 19919 000325'06 320 12 0 00 000327' ifje. r ;[263] Failed?? 19920 000326'06 254 00 0 00 000334' 19921 000327'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19922 000330'06 200 01 0 00 000000# eemsg K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-2 K20IOC MAC 12-May-24 20:27 Here to (s)map the next section of a multi-section file 19923 000331'06 104 00 0 00 000313 19924 000014'07 000000000000# 19925 001057'04 125 156 141 142 154 19926 000332'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19927 000333'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19928 000334'06 endif. ;[263] End case private section creation error handling 19929 000334'06 254 00 0 00 000370' else. ;[263] Otherwise, this is a private section 19930 000335'06 200 01 0 00 000004 move t1, t4 ;[263] So the last page is now the first 19931 000336'06 242 01 0 00 777767 lsh t1, -^d9 ;[263] Convert address to a page number 19932 000337'06 505 01 0 00 600000 hrli t1,.fhslf!fh%epn ;[263] This process, extended page number 19933 000340'06 200 02 0 00 000001 move t2, t1 ;[263] Prototype the destination 19934 000341'06 620 02 0 00 000777 trz t2, 777 ;[263] It's going into page zero of the same section 19935 000342'06 205 03 0 00 100200 movx t3, pm%rd!pm%epn ;[263] Read-only, extended page number 19936 000343'06 104 00 0 00 000056 PMAP% ;[263] Case III Mapping One Fork's Pages to Another Fork 19937 000344'06 320 12 0 00 000346' ifje. r ;[263] Failed?? 19938 000345'06 254 00 0 00 000353' 19939 000346'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19940 000347'06 200 01 0 00 000000# eemsg 19941 000350'06 104 00 0 00 000313 19942 000015'07 000000000000# 19943 001072'04 125 156 141 142 154 19944 000351'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19945 000352'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19946 000353'06 endif. ;[263] End case private section creation error handling 19947 000353'06 474 01 0 00 000000 seto t1, ;[263] -1 to unmap pages 19948 000354'06 271 02 0 00 000001 addi t2, ^d1 ;[263] Starting from next page after this (last) one 19949 000355'06 621 03 0 00 100000 txz t3, pm%rd ;[263] Shut off any access 19950 000356'06 661 03 0 00 400000 txo t3, pm%cnt ;[263] Turn on the repetition count flag 19951 000357'06 541 03 0 00 000777 hrri t3, ^d511 ;[263] Punting the rest of the pages from the section 19952 000360'06 104 00 0 00 000056 PMAP% ;[263] Case IV Unmapping Pages In a Process 19953 000361'06 320 12 0 00 000363' ifje. r ;[263] Failed?? 19954 000362'06 254 00 0 00 000370' 19955 000363'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 19956 000364'06 200 01 0 00 000000# eemsg 19957 000365'06 104 00 0 00 000313 19958 000016'07 000000000000# 19959 001106'04 125 156 141 142 154 19960 000366'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 19961 000367'06 254 00 0 00 000170' jrst emapr1 ;[263] Take plus 1 return 19962 000370'06 endif. ;[263] End case private section creation error handling 19963 000370'06 endif. ;[263] End case diddling the page map 19964 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20IOC MAC 12-May-24 20:27 Here to (s)map the next section of a multi-section file 19965 Comment " 19966 19967 At this point, we have the last page in the section now mapped as 19968 the current first page in the section and the address portion of 19969 the two word global byte pointer has been reset to the bottom of 19970 the page. 19971 19972 The section mapping window (fsmapw) has been reset to be forever 19973 private because we can not no longer map from a section boundary. 19974 The page mapping window (fpmapw has been set to have the correct 19975 page in the file. 19976 19977 We must then map as much of the file as will fit in the remaining 19978 511 pages of the section, and set up any guard pages if we are in 19979 the last section of the file. 19980 19981 All that remains after that is to update the counters to see if 19982 we will need to map in another section. " 19983 19984 000370'06 200 01 0 00 000000# move t1, fpmapw ;[263] Load the base PMAP% file window 19985 000371'06 271 01 0 00 000001 addi t1, ^d1 ;[263] Getting the next file page 19986 000372'06 271 02 0 00 000001 addi t2, ^d1 ;[265] And putting it in the next memory page 19987 000373'06 200 03 0 00 000000# move t3, frpage ;[263] Load remaining pages 19988 000374'06 303 03 0 00 000777 caile t3, ^d511 ;[263] Will the rest of them fit? 19989 000375'06 201 03 0 00 000777 movei t3, ^d511 ;[263] No, clip down to the maximum that will fit 19990 000376'06 276 03 0 00 000000# subm t3, frpage ;[263] Account for them 19991 000377'06 333 00 0 00 000000# ifmle. frpage ;[263] Anything left? 19992 000400'06 254 00 0 00 000403' 19993 000401'06 402 00 0 00 000000# setzm fmsecf ;[263] No, clear the multi-section flag 19994 000402'06 254 00 0 00 000404' else. ;[263] Wow, what a whopper of a file! 19995 000403'06 476 00 0 00 000000# setom fmsecf ;[263] Yes, set the multi-section flag 19996 000404'06 endif. ;[263] Because will need another section 19997 19998 000404'06 200 05 0 00 000003 move q1, t3 ;[263] Save the total to map 19999 000405'06 302 03 0 00 000001 caie t3, ^d1 ;[263] Only have one dinky page to do? 20000 000406'06 661 03 0 00 400000 txo t3, pm%cnt ;[263] No, light the counter bit (makes PMAP% slower...) 20001 000407'06 661 03 0 00 100200 txo t3, pm%rd!pm%epn ;[263] Read-only, extended page number 20002 000410'06 104 00 0 00 000056 PMAP% ;[263] Take a giant gulp of the file 20003 000411'06 320 12 0 00 000413' ifje. r ;[263] That's not good... 20004 000412'06 254 00 0 00 000420' 20005 000413'06 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 20006 000414'06 200 01 0 00 000000# eemsg ;[263] Squawk 20007 000415'06 104 00 0 00 000313 20008 000017'07 000000000000# 20009 001124'04 125 156 141 142 154 20010 000416'06 265 11 0 00 000466' jsp q5, esquawk ;[263] Include the last Tops-20 error 20011 000417'06 254 00 0 00 000170' jrst emapr1 ;[263] Return failure 20012 000420'06 endif. ;[263] End case SMAP% error handling 20013 20014 000420'06 201 04 0 00 001000 movei t4, ^d512 ;[263] Maximum pages in a section 20015 000421'06 274 04 0 00 000005 sub t4, q1 ;[263] Subtract what we mapped in 20016 000422'06 275 04 0 00 000001 subi t4, ^d1 ;[263] Account for the previously mapped page 20017 000423'06 323 04 0 00 000442' ifg. t4 ;[263] Anything to guard? 20018 000424'06 201 01 0 00 001000 movei t1, ^d512 ;[263] Maximum pages in a section, again 20019 000425'06 274 01 0 00 000004 sub t1, t4 ;[263] Gets the starting page number K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40-1 K20IOC MAC 12-May-24 20:27 Here to (s)map the next section of a multi-section file 20020 000426'06 620 02 0 00 000777 trz t2, 777 ;[263] Stomp whatever page number is in there 20021 000427'06 434 02 0 00 000001 or t2, t1 ;[263] Starting at the end of the mapped pages 20022 000430'06 200 01 1 00 000630' move t1, @[0,,grdmap] ;[263] Load the handle for the guard page 20023 000431'06 500 02 0 00 000001 hll t2,t1 ;[263] It's going into this self-same process 20024 000432'06 205 03 0 00 100200 movx t3,pm%rd!pm%epn ;[263] No actual access, extended page 20025 000433'06 do. ;[263] Get down to some serious guarding 20026 000433'06 104 00 0 00 000056 PMAP% ;[263] Map the Explode-on-Use page 20027 000434'06 320 12 0 00 000437' erjmpr endlp. ;[263] Get out of here on an error 20028 000435'06 271 02 0 00 000001 addi t2, ^d1 ;[263] Next page in memory 20029 000436'06 367 04 0 00 000433' sojg t4, top. ;[263] Do the rest of them 20030 000437'06 enddo. ;[263] Falls out when done or on (silent) error 20031 000437'06 200 04 0 00 000005 move t4, q1 ;[263] Load count just mapped from file 20032 000440'06 271 04 0 00 000001 addi t4, ^d1 ;[263] Accounting for our current page 20033 000441'06 254 00 0 00 000443' else. ;[263] Otherwise not guarding anything 20034 000442'06 200 04 0 00 001000 move t4, ^d512 ;[263] And have a straight section to do 20035 000443'06 endif. ;[263] End case guarding the remainder of the section 20036 000443'06 202 04 0 00 000000# movem t4, fsizep ;[263] Update this section's page tally 20037 20038 remark Finally update the byte count 20039 20040 000444'06 302 04 0 00 000001 caie t4, ^d1 ;[265] Are we on the last page? 20041 000445'06 254 00 0 00 000450' ifskp. ;[265] It was, so can handle what specially 20042 000446'06 402 00 0 00 000000# setzm fpagfb ;[265] No fragmentation, it's the last page 20043 000447'06 254 00 0 11 000000 jrst (q5) ;[265] Return with the last few bytes 20044 000450'06 endif. ;[265] End case partial last page is the last page 20045 ;[265] Must calculate what we have done, first page 20046 000450'06 200 05 0 00 000000# move q1, fbytew ;[263] Load bytes per word 20047 000451'06 240 05 0 00 000011 ash q1, ^d9 ;[265] Fastest multiply by 512 on PDP-10! 20048 000452'06 274 05 0 00 000000# sub q1, fsizeb ;[265] Subtract off what we have left to swallow 20049 remark q1, ;[265] q1 now has what has been consumed in this page 20050 20051 000453'06 332 00 0 00 000000# ifme. fmsecf ;[265] If last section, will not have a full last page 20052 000454'06 254 00 0 00 000457' 20053 000455'06 200 06 0 00 000000# move q2, fpagfb ;[265] Will need to subtract internal fragmentation 20054 000456'06 254 00 0 00 000460' else. ;[265] Otherwise, doing another section 20055 000457'06 400 06 0 00 000000 setz q2, ;[265] So will not have a partial last page 20056 000460'06 endif. ;[265] End case multiple section decision 20057 20058 remark t4, ^d512 ;[263] 512 words per page 20059 000460'06 240 04 0 00 000011 ash t4, ^d9 ;[265] Fastest multiply by 512 on PDP-10! 20060 000461'06 220 04 0 00 000000# imul t4, fbytew ;[263] Multiplied by bytes per word 20061 remark t4, ;[265] t4 now has maximum we could consume 20062 000462'06 274 04 0 00 000005 sub t4, q1 ;[265] Subtract off the front 20063 000463'06 274 04 0 00 000006 sub t4, q2 ;[265] Subtract off the end (if any) 20064 remark t4, ;[265] Now has remaining bytes to consume 20065 000464'06 202 04 0 00 000000# movem t4, fsizeb ;[265] Store remaining bytes to do, this section 20066 20067 000465'06 254 00 0 11 000000 jrst (q5) ;[263] Return with another magilla to do 20068 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20IOC MAC 12-May-24 20:27 Extended Squawk has odd linkage 20069 subttl Extended Squawk has odd linkage 20070 20071 ; t4/ Captured Tops-20 error 20072 ; q5/ Accumulator that the calling jsp used 20073 20074 000466'06 124 01 0 00 000000# esquaw: dmovem t1, eacs ;[263] Save accumulators 20075 000467'06 124 03 0 00 000000# dmovem t3, eacs+2 ;[263] all four of them 20076 20077 000470'06 201 01 0 00 000054 movei t1, "," ;[263] A little punctuation 20078 000471'06 104 00 0 00 000074 PBOUT% 20079 000472'06 201 01 0 00 000040 movei t1, .chspc ;[263] And space over 20080 000473'06 104 00 0 00 000074 PBOUT% 20081 20082 000474'06 201 01 0 00 000101 movei t1, .priou ;[263] Still typing to terminal 20083 000475'06 515 02 0 00 400000 hrlzi t2, .fhslf ;[263] This process 20084 000476'06 540 02 0 00 000004 hrr t2, t4 ;[263] This (captured) error 20085 000477'06 400 03 0 00 000000 setz t3, ;[263] All the error text there is 20086 000500'06 104 00 0 00 000011 ERSTR% ;[263] Blat away! 20087 000501'06 320 12 0 00 000503' erjmpr .+2 ;[263] Ignore this strange error 20088 000502'06 320 12 0 00 000503' erjmpr .+1 ;[263] Ignore this stranger error 20089 20090 000503'06 201 01 0 00 000015 movei t1, .chcrt ;[263] Tie off 20091 000504'06 104 00 0 00 000074 PBOUT% 20092 000505'06 201 01 0 00 000012 movei t1, .chlfd ;[263] the line 20093 000506'06 104 00 0 00 000074 PBOUT% 20094 20095 000507'06 120 01 0 00 000000# dmove t1, eacs ;[263] Restore accumulators 20096 000510'06 120 03 0 00 000000# dmove t3, eacs+2 ;[263] all four of them 20097 000511'06 254 00 0 11 000000 jrst (q5) ;[263] Return to caller 20098 20099 .endps ecode ;[263] Get out of extended code 20100 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20IOC MAC 12-May-24 20:27 Wrapper to call section mapper in extended code 20101 subttl Wrapper to call section mapper in extended code 20102 20103 ; Expects T1 to have something very much like a JFN 20104 20105 .psect code ;[263] In section zero code 20106 002146'01 000001 000000# emap30: extsec,,emapfi ;[263] 30 bit address of extended code 20107 002147'01 265 16 0 00 004640' mapsec: saveac ;[263] Save plenty registers 20108 002150'01 254 14 0 00 000007 xsfm q3 ;[263] Get and store the flags 20109 002151'01 200 10 0 00 002146' move q4, emap30 ;[263] Load up inter-section transfer address 20110 002152'01 254 05 0 00 000007 xjrstf q3 ;[263] Take a GIANT step upstairs 20111 20112 002153'01 mapret: remark ;[263] Return linkage from extended code 20113 002153'01 263 17 0 00 000000 ret ;[263] Return +1 or +2 20114 .endps code ;[263] End of section zero code 20115 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20IOC MAC 12-May-24 20:27 TRANSMIT translation table for file 20116 subttl TRANSMIT translation table for file 20117 20118 .psect econst/RONLY,ecnorg 20119 ;[263] Put this in extended section 20120 000002 %lfdc==.chcnb ;[263] ASCII values proceed from Control-B 20121 .xcref %lfdc ;[263] Keep off the cross reference 20122 suppress %lfdc ;[263] Don't show in symbol table listing 20123 20124 000020'07 lfdtbl: xlist ;[263] Don't need to see all this 20125 list ;[263] Turn the listing back on 20126 20127 cleans(%lfdc) ;[263] Toss temporary symbol 20128 .endps econst ;[263] End of extend constants 20129 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20IOC MAC 12-May-24 20:27 Translate Extended SIN% terminating on Line Feed 20130 subttl Translate Extended SIN% terminating on Line Feed 20131 20132 .psect ecode ;[263] Write-protected code, phew! 20133 20134 ; Calling environment, something like SIN% 20135 ; 20136 ;** t1/ JFN (Ignored) 20137 ; t2/ Had better be a one word global pointer!! 20138 ; t3/ Size of said buffer 20139 ;** t4/ Character to stop on (Ignored) 20140 20141 remark t2 & t3 ;[263] Are expected to have been checked 20142 20143 remark q1,q2,q3,q4,q5 ;[263] Are available 20144 20145 000512'06 015 00 0 00 000000# esinmt: movst lfdtbl ;[263] Move String Translated, using above table 20146 000513'06 000000 000000 .chnul ;[263] Fill character is NUL terminator 20147 20148 000514'06 120 07 0 00 000002 esinlf: dmove q3, t2 ;[263] Save original pointer and remaining space 20149 000515'06 265 11 0 00 000224' jsp q5, smpnxt ;[263] See if we need to get the next section of the file 20150 000516'06 333 01 0 00 000000# skiple t1, fsizeb ;[263] Load remaining bytes in file 20151 000517'06 254 00 0 00 000531' ifskp. ;[263] Emptied the file... 20152 remark ;[265] Don't need a SFPTR% -1,last SFPTR% already set EOF 20153 000520'06 200 11 0 00 000002 move q5, t2 ;[265] Save the pointer 20154 dmove t1, [ ;[263] Phoney up a Tops-20 error 20155 000521'06 120 01 0 00 000632' exp .fhslf, IOX4] ;[263] This process, "End of file reached" 20156 000522'06 104 00 0 00 000336 SETER% ;[263] Pretend we got a SIN% error, with a nice message 20157 000523'06 320 12 0 00 000525' ifje. r ;[265] Failed?? 20158 000524'06 254 00 0 00 000526' 20159 000525'06 200 02 0 00 000001 move t2, t1 ;[263] Some other strange problem, so go with that 20160 000526'06 endif. ;[265] End really unlikely error 20161 000526'06 200 01 0 00 000002 move t1, t2 ;[263] Put the error as if we did an ERJMPR/ERCALR 20162 000527'06 200 02 0 00 000011 move t2, q5 ;[265] Restore the pointer 20163 000530'06 254 00 0 00 000605' jrst esinr1 ;[263] Take the error return 20164 000531'06 endif. ;[263] End case 'JSYS' error handling 20165 20166 000531'06 120 02 0 00 000000# dmove t2, fbytep ;[263] Load double word source global pointer 20167 000532'06 200 04 0 00 000010 move t4, q4 ;[263] Load maximum size of destination buffer 20168 000533'06 200 05 0 00 000007 move q1, q3 ;[263] Destination of data 20169 000534'06 400 06 0 00 000000 setz q2, ;[263] Assume destination is a one word global pointer 20170 000535'06 621 01 0 00 300000 txz t1, N!M ;[263] Shut off Number and Magnitude 20171 000536'06 661 01 0 00 400000 txo t1, S ;[263] Start translating immediately 20172 000537'06 123 01 0 00 000512' extend t1, esinmt ;[263] Go slurp the data around 20173 000540'06 320 12 0 00 000610' erjmpr esinre ;[263] Failed?? 20174 20175 000541'06 200 11 0 00 000001 move q5, t1 ;[263] Load the final count 20176 000542'06 621 11 0 00 700000 txz q5, S!N!M ;[263] Shut off Significance, Number and Magnitude 20177 000543'06 202 11 0 00 000000# movem q5, fsizeb ;[263] Update remaining bytes in file 20178 000544'06 124 02 0 00 000000# dmovem t2, fbytep ;[263] Update input byte pointer 20179 20180 000545'06 135 11 0 00 000002 ldb q5, t2 ;[263] Pick up the stop byte 20181 000546'06 323 04 0 00 000551' ifg. t4 ;[263] Do we have space for another byte? 20182 000547'06 275 04 0 00 000001 subi t4, ^d1 ;[263] Yes, account for it 20183 000550'06 136 11 0 00 000005 idpb q5, q1 ;[263] Store it 20184 000551'06 endif. ;[263] Save that K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44-1 K20IOC MAC 12-May-24 20:27 Translate Extended SIN% terminating on Line Feed 20185 20186 000551'06 302 11 0 00 000015 caie q5, .chcrt ;[265] Did we stop on a carriage return? 20187 000552'06 254 00 0 00 000566' ifskp. ;[265] We did, see if followed by a line feed 20188 000553'06 323 04 0 00 000566' andg. t4 ;[265] Any more output space? 20189 000554'06 621 01 0 00 700000 txz t1, S!N!M ;[263] Shut off Significance, Number and Magnitude 20190 000555'06 323 01 0 00 000566' andg. t1 ;[265] Any more input data? 20191 000556'06 134 11 0 00 000002 ildb q5, t2 ;[265] Yes, pick up the byte after the carriage return 20192 000557'06 302 11 0 00 000012 caie q5, .chlfd ;[265] Was it a line feed? 20193 000560'06 254 00 0 00 000566' anskp. ;[265] No, nothing further to do 20194 000561'06 136 11 0 00 000005 idpb q5, q1 ;[263] Store it 20195 000562'06 275 04 0 00 000001 subi t4, ^d1 ;[263] Account for another character output 20196 000563'06 275 01 0 00 000001 subi t1, ^d1 ;[265] Account for another character input 20197 000564'06 202 01 0 00 000000# movem t1, fsizeb ;[263] Update remaining bytes in file 20198 000565'06 124 02 0 00 000000# dmovem t2, fbytep ;[263] Update input byte pointer 20199 000566'06 endif. ;[265] End case checking for CRLF sequence 20200 20201 000566'06 323 04 0 00 000571' ifg. t4 ;[263] Do we have space for another byte? 20202 000567'06 400 01 0 00 000000 setz t1, ;[263] Yes, cons up a zero, but don't count it 20203 000570'06 136 01 0 00 000005 idpb t1, q1 ;[263] Store it, pointer will be discarded 20204 000571'06 endif. ;[263] So this will allow an append 20205 20206 000571'06 200 03 0 00 000004 move t3, t4 ;[263] Return remaining space in buffer 20207 000572'06 274 10 0 00 000004 sub q4, t4 ;[263] Calculate bytes done 20208 000573'06 200 02 0 00 000010 move t2, q4 ;[263] Load the count done 20209 000574'06 273 02 0 00 000000# addb t2, fsizec ;[263] Update the character tally 20210 000575'06 200 01 0 00 000000# move t1, fjfn ;[263] Load the file's JFN 20211 000576'06 104 00 0 00 000027 SFPTR% ;[263] Inform Tops-20 of the location for the nosey 20212 000577'06 320 12 0 00 000605' erjmpr esinr1 ;[263] Some odd error, return it 20213 000600'06 200 02 0 00 000010 move t2, q4 ;[263] Load count done 20214 000601'06 133 02 0 00 000007 adjbp t2, q3 ;[263] Advance the one word global pointer 20215 000602'06 200 04 0 00 000011 move t4, q5 ;[263] Return the character 20216 20217 000603'06 550 06 0 00 000017 esinr2: hrrz q2, p ;[263] Load in-section address of stack 20218 000604'06 350 00 1 00 000006 aos @q2 ;[263] Bump that return address 20219 20220 000605'06 esinr1: remark ;[263] Here to return to section zero caller 20221 000605'06 254 14 0 00 000007 xsfm q3 ;[263] Get and store the flags 20222 000606'06 201 10 0 00 000000# movei q4, sinret ;[263] Load up inter-section transfer address 20223 000607'06 254 05 0 00 000007 xjrstf q3 ;[263] Take a GIANT step downstairs 20224 20225 000610'06 200 01 0 00 000000# esinre: eemsg ;[263] Squawk 20226 000611'06 104 00 0 00 000313 20227 000120'07 000000000000# 20228 001137'04 115 117 126 123 124 20229 000612'06 265 11 0 00 000466' jsp q5,esquawk ;[263] And also the last Tops-20 error 20230 000613'06 254 00 0 00 000605' jrst esinr1 ;[263] Give +1 return 20231 20232 .endps ecode ;[263] Done with extended code 20233 .psect code ;[263] Return to section zero code 20234 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20IOC MAC 12-May-24 20:27 Translate SIN% terminating on Line Feed (Wrapper) 20235 subttl Translate SIN% terminating on Line Feed (Wrapper) 20236 20237 ; SIN% terminating on linefeed. Similar to a SIN%, except that it 20238 ; does not produce End of File I/O errors. Other errors are possible, 20239 ; such as mapping a file with a bad page or bumping into a guard page, 20240 ; but these situations are not expected to be very likely. 20241 ; 20242 ; Actually does very little other than setting up linkages for an 20243 ; extended call. 20244 ; 20245 ; Arguments are as per SIN%, 20246 ; 20247 ; t1/ JFN (ignored, except for .NULIO special casing) 20248 ; t2/ Pointer to where to put the data 20249 ; t3/ Positive maximum size of area 20250 ; t4/ Character to stop on (ignored) 20251 ; 20252 ; Return: 20253 ; 20254 ; +1, If failed for some reason 20255 ; +2, Got some data 20256 ; 20257 ; t1/ Trashed 20258 ; t2/ Updated to point to last character 20259 ; t3/ Updated with characters read 20260 ; t4/ Last character read 20261 ; 20262 ; If there is space in the buffer, then a NUL will be put after the 20263 ; data, but will not be counted. This will allow a PSOUT% to a terminal 20264 ; and ease $0T when DDT'ing. 20265 20266 002154'01 000001 000000# esin30: extsec,,esinlf ;[263] Transfer Extended SIN% Line Feed 30 Bit Address 20267 002155'01 302 01 0 00 377777 sinlfd: caie t1, .nulio ;[263] Reading from NUL:?? 20268 002156'01 254 00 0 00 002172' ifskp. ;[263] Yes, we couldn't have mapped that! 20269 002157'01 261 17 0 00 000002 push p, t2 ;[265] Save the pointer 20270 dmove t1, [ ;[263] Phoney up a Tops-20 error 20271 .fhslf ;[263] This process 20272 002160'01 120 01 0 00 004662' IOX4 ] ;[263] "End of file reached" 20273 002161'01 104 00 0 00 000336 SETER% ;[263] NUL: is always at end of file ... 20274 002162'01 320 12 0 00 002164' ifje. r ;[265] Some other problem? Go with that 20275 002163'01 254 00 0 00 002166' 20276 002164'01 262 17 0 00 000002 pop p, t2 ;[265] Restore the pointer 20277 002165'01 254 00 0 00 002170' else. ;[265] Otherwise, worked 20278 002166'01 200 01 0 00 000002 move t1, t2 ;[263] Load the last error as if we triggered it 20279 002167'01 262 17 0 00 000002 pop p, t2 ;[265] Restore the pointer 20280 002170'01 endif. ;[263] End case SETER% handling 20281 002170'01 474 04 0 00 000000 seto t4, ;[263] Indicate end of file here, too 20282 002171'01 263 17 0 00 000000 ret ;[263] Return +1 (failed) 20283 002172'01 endif. ;[265] End case NUL: read 20284 20285 002172'01 200 01 0 00 000002 move t1, t2 ;[263] Let's load the pointer 20286 002173'01 136 04 0 00 000001 idpb t4, t1 ;[263] Can we write it? 20287 002174'01 320 12 0 00 002005* erjmpr r ;[263] No, go pass the error back 20288 20289 remark ;[263] Unlike SIN%, byte count must always be positive K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45-1 K20IOC MAC 12-May-24 20:27 Translate SIN% terminating on Line Feed (Wrapper) 20290 002175'01 327 03 0 00 002207' ifle. t3 ;[263] Some bogus count? 20291 dmove t1, [ ;[263] Phoney up a Tops-20 error 20292 .fhslf ;[263] This process 20293 002176'01 120 01 0 00 004664' GJFX51 ] ;[263] "Byte count too small" 20294 002177'01 104 00 0 00 000336 SETER% ;[263] Not quite a SIN% error, but nice message 20295 002200'01 320 12 0 00 002202' ifje. r ;[265] Some other problem? Go with that 20296 002201'01 254 00 0 00 002204' 20297 002202'01 262 17 0 00 000002 pop p, t2 ;[265] Restore the pointer 20298 002203'01 254 00 0 00 002206' else. ;[265] Otherwise, worked 20299 002204'01 200 01 0 00 000002 move t1, t2 ;[263] Put the error as if we did an ERJMPR/ERCALR 20300 002205'01 262 17 0 00 000002 pop p, t2 ;[265] Restore the pointer 20301 002206'01 endif. ;[263] End case SETER% handling 20302 002206'01 263 17 0 00 000000 ret ;[263] Return +1 (failed) 20303 002207'01 endif. ;[263] End case sanity check of bffer length 20304 20305 002207'01 265 16 0 00 004640' saveac ;[263] Otherwise, save plenty registers 20306 002210'01 254 14 0 00 000007 xsfm q3 ;[263] Get and store the flags 20307 002211'01 200 10 0 00 002154' move q4, esin30 ;[263] Load up inter-section transfer address 20308 002212'01 254 05 0 00 000007 xjrstf q3 ;[263] Take a GIANT step upstairs 20309 20310 002213'01 sinret: remark ;[263] Here on return from extended section 20311 002213'01 263 17 0 00 000000 ret ;[263] Done 20312 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20313 subttl TRANSMIT command execution. 20314 20315 ;[266] Document hairy parse variable usage. Be aware that some of these are 20316 ; shared with INPUT's parsing and semantic action. 20317 20318 remark pars1 ;[266] Linkage between parsing and semantic 20319 remark pars2 ;[266] JFN of file to transmit 20320 remark pars3 ;[266] Set if .cmcfm and using default search string 20321 remark pars4 ;[266] Integer timeout in milliseconds 20322 remark pars5 ;[273] Whether observing case in matching 20323 remark pars6 ;[266] Set to not override $INPUT's interrupt handling 20324 remark pars7 ;[266] EOF character to use (if any) 20325 remark pars8 ;[266] If doing SILENT matching 20326 remark pars9 ;[266] Maximum length of line to transmit 20327 remark pars10 ;[266] Milliseconds to pause, if TRANSMIT is pausing 20328 20329 002214'01 $trans: entry $trans ; Called by k20par 20330 extern mycaps ;[223] Expose capability vector 20331 002214'01 265 16 0 00 004640' saveac ;[209] Needs much registers 20332 20333 002215'01 550 01 0 00 002102* hrrz t1, pars2 ;[209] First make sure we can open the file. 20334 002216'01 202 01 0 00 000000* movem t1, filjfn ;[209] Store in case we need to release 20335 002217'01 260 17 0 00 002147' call mapsec ;[263] Map the file into a seperate section 20336 002220'01 254 00 0 00 002223' ifskp. ;[263] Worked! 20337 002221'01 124 02 0 00 000000# dmovem t2, zsizeb ;[263] Store SIZEF% results in section zero 20338 002222'01 254 00 0 00 002230' else. ;[263] Didn't... 20339 002223'01 402 00 0 00 002216* setzm filjfn ;[263] Stomp JFN global storage 20340 002224'01 550 01 0 00 002215* hrrz t1, pars2 ;[263] Reload the JFN 20341 002225'01 260 17 0 00 000000* call frclos ;[263] Force it closed 20342 002226'01 600 00 0 00 000000 nop ;[263] Ignore error and carry on 20343 002227'01 263 17 0 00 000000 ret ;[263] And return; we can't do anything else 20344 002230'01 endif. ;[263] End handling failure return from mapsec 20345 20346 remark ;[209] .trans gets and decodes a prompt (search) string 20347 20348 002230'01 400 11 0 00 000000 $tran1: setz q5, ;[209] Assume not in a batch job that needs fixup 20349 002231'01 336 00 0 00 002101* skipn strc ;[209] Of course, don't bother if no search string... 20350 002232'01 254 00 0 00 002275' jrst $tran2 ;[209] There won't be anything to fix up 20351 002233'01 332 00 0 00 001613* skipe pars8 ;[229] Nor if we were told to shut up 20352 002234'01 254 00 0 00 002275' jrst $tran2 ;[229] User typed a /SILENT 20353 002235'01 336 00 0 00 000000# skipn ;[209] Now then, are we a batch job? 20354 002236'01 254 00 0 00 002275' jrst $tran2 ;[209] No, so we don't care about BATCON confusion 20355 ;[209] Otherwise, REALLY long lines are bad ... 20356 002237'01 120 01 0 00 002231* dmove t1, strc ;[209] Load the search string count and pointer 20357 002240'01 415 16 0 00 002273' block. ;[209] Enter block context for better control flow 20358 002241'01 261 17 0 00 000016 20359 002242'01 306 01 0 00 000001 cain t1, ^d1 ;[209] A single character?? 20360 002243'01 254 00 0 00 001711* retskp ;[209] Whatever it is, it needs to get tied off 20361 ;[209] A tiny hack: ibp is faster than adjbp 20362 002244'01 302 01 0 00 000003 caie t1, ^d3 ;[209] Is it EXACTLY three characters in length? 20363 002245'01 254 00 0 00 002250' ifskp. ;[209] It is, so handle this more efficiently 20364 002246'01 133 00 0 00 000002 ibp t2 ;[209] Positions us to the first byte 20365 002247'01 275 01 0 00 000001 subi t1, ^d1 ;[209] So ildb in case two works right 20366 002250'01 endif. ;[209] Fall through to case two 20367 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46-1 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20368 002250'01 302 01 0 00 000002 caie t1, ^d2 ;[209] A two character sequence, then? 20369 002251'01 254 00 0 00 002261' ifskp. ;[209] Yes, let's see if that's OK 20370 002252'01 134 03 0 00 000002 ildb t3, t2 ;[209] Let's get the first character 20371 002253'01 302 03 0 00 000015 caie t3, .chcrt ;[209] Carriage return? 20372 002254'01 254 00 0 00 002243* retskp ;[209] Nope, then batch output needs a 20373 002255'01 134 03 0 00 000002 ildb t3, t2 ;[209] Let's get the second character 20374 002256'01 302 03 0 00 000012 caie t3, .chlfd ;[209] And was that a linefeed? 20375 002257'01 254 00 0 00 002254* retskp ;[209] Nope, then batch output needs a 20376 002260'01 263 17 0 00 000000 ret ;[209] ! Batch log will be tidy 20377 002261'01 endif. ;[209] End case, a search string of two characters 20378 ;[209] Note: ldb, ildb is faster than ildb, ildb 20379 002261'01 275 01 0 00 000001 subi t1, ^d1 ;[209] Going to look at the last two characters (!!) 20380 002262'01 133 01 0 00 000002 adjbp t1, t2 ;[209] Position right on the penultimate 20381 002263'01 135 03 0 00 000001 ldb t3, t1 ;[209] Let's get the penultimate character 20382 002264'01 302 03 0 00 000015 caie t3, .chcrt ;[209] Carriage return? 20383 002265'01 254 00 0 00 002257* retskp ;[209] Nope, then batch output needs a 20384 002266'01 134 03 0 00 000001 ildb t3, t1 ;[209] Let's get the final character 20385 002267'01 302 03 0 00 000012 caie t3, .chlfd ;[209] And was that a linefeed? 20386 002270'01 254 00 0 00 002265* retskp ;[209] Nope, then batch output needs a 20387 002271'01 263 17 0 00 000000 ret ;[209] Final two are ! Batch log will be tidy 20388 002272'01 263 17 0 00 000000 endbk. ;[209] End block context 20389 002273'01 254 00 0 00 002275' ifskp. ;[209] Skip return means needs a 20390 002274'01 474 11 0 00 000000 seto q5, ;[209] So flag that for down stream 20391 002275'01 endif. ;[209] End block skip stanza 20392 20393 002275'01 260 17 0 00 000000* $tran2: call clrbuf ;[229] Clear out any crud before searching 20394 002276'01 254 00 0 00 002522' jrst $tranx ;[229] If failed, just stop doing this 20395 002277'01 337 02 0 00 001736* skipg t2, pars4 ;[229] Integer milliseconds 20396 002300'01 254 00 0 00 002303' ifskp. ;[229] Wants time outs, so set them 20397 002301'01 201 01 0 00 002613' movei t1, $trant ;[229] Where to go die on a time out 20398 002302'01 260 17 0 00 000301* call timeon ;[229] Set the timer for it 20399 002303'01 endif. ;[229] 20400 002303'01 260 17 0 00 000304* call ccon ; Turn on ^C trap 20401 002304'01 254 00 0 00 002522' jrst $tranx ; Where to go upon ^C. 20402 002305'01 332 00 0 00 000366* ifme. vtermf ;[186] Calls only make sense if not virtual 20403 002306'01 254 00 0 00 002313' 20404 002307'01 260 17 0 00 000315* call doarpa ;[186] If on a TVT, set up to allow binary 20405 002310'01 260 17 0 00 000312* call dobits ; Condition the line. 20406 002311'01 254 00 0 00 002522' jrst $tranx 20407 002312'01 260 17 0 00 000314* call ttyob ; Let controlling tty output binary. 20408 002313'01 endif. ;[186] Otherwise, MTOPR%'s might break! 20409 002313'01 201 01 0 00 002345' movei t1, $tran3 ; Where to go if ^M typed (send next) 20410 002314'01 202 01 0 00 000000* movem t1, cmloc ; ... 20411 002315'01 201 01 0 00 002405' movei t1, $tran4 ; Where to go if ^P typed (resend previous) 20412 002316'01 202 01 0 00 000000* movem t1, cploc ; ... 20413 002317'01 260 17 0 00 000000* call cmpon ; Enable interrupts on ^M, ^P. 20414 txmsg < 20415 002320'01 200 01 0 00 000000# [KERMIT-20: Transmitting > ; Tell user we're starting. 20416 002321'01 104 00 0 00 000076 20417 002322'01 320 12 0 00 002323' 20418 000234'02 000000000000# 20419 001147'04 015 012 133 113 105 20420 002323'01 201 01 0 00 000101 movei t1, .priou 20421 002324'01 200 02 0 00 002223* move t2, filjfn 20422 002325'01 403 03 0 00 000004 setzb t3, t4 ;[209] No screwy prefix... K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46-2 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20423 002326'01 104 00 0 00 000030 JFNS 20424 002327'01 320 12 0 00 002330' erjmpr .+1 20425 txmsg < 20426 If stuck, type: 20427 Carriage Return to send next line, 20428 ^P to resend current line, 20429 002330'01 200 01 0 00 000000# > ;[187] 20430 002331'01 104 00 0 00 000076 20431 002332'01 320 12 0 00 002333' 20432 000235'02 000000000000# 20433 001155'04 015 012 040 111 146 20434 20435 20436 20437 dmove t3, [ byte (7) .chspc, "^", "C", "^", "C" 20438 002333'01 120 03 0 00 004666' byte (7) .chspc, .chnul ] ;[187] Assume default 20439 002334'01 200 02 0 00 000000# move t2, mycaps+1 ;[187] Load enabled capabilities 20440 002335'01 607 02 0 00 400000 txnn t2, sc%ctc ;[187] Is Control-C turned on?? 20441 dmove t3, [ byte (7) .chspc, "^", "G", "^", "G" 20442 002336'01 120 03 0 00 004670' byte (7) .chspc, .chnul ] ;[187] Wasn't... 20443 002337'01 561 01 0 00 000003 hrroi t1, t3 ;[187] Point to proper text 20444 002340'01 104 00 0 00 000076 PSOUT% ;[187] Tell them what to type 20445 txmsg 20447 002342'01 104 00 0 00 000076 20448 002343'01 320 12 0 00 002344' 20449 000236'02 000000000000# 20450 001177'04 164 157 040 143 141 20451 20452 002344'01 260 17 0 00 000000* call statim ;[267] Start timing 20453 20454 ;... K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20455 20456 ; Get a line from the file. 20457 20458 002345'01 336 00 0 00 000000* $tran3: ifmn. cmseen ;[194] ^M typed? 20459 002346'01 254 00 0 00 002353' 20460 txmsg < Sending next...] 20461 002347'01 200 01 0 00 000000# > ; Yes, type msg 20462 002350'01 104 00 0 00 000076 20463 002351'01 320 12 0 00 002352' 20464 000237'02 000000000000# 20465 001205'04 040 123 145 156 144 20466 20467 002352'01 402 00 0 00 002345* setzm cmseen ; and unset flag. 20468 002353'01 endif. ;[194] 20469 20470 002353'01 200 01 0 00 002324* move t1, filjfn ; Input file pointer 20471 002354'01 200 02 0 00 004672' move t2, [.p08!strbf2] ;[263] Where to put the line 20472 002355'01 200 03 0 00 001734* move t3, pars9 ;[265] Load maximum we will allow 20473 002356'01 201 04 0 00 000012 movx t4, .chlfd ;[209] But, preferably terminate on linefeed. 20474 002357'01 260 17 0 00 002155' call sinlfd ;[263] Go fetch a line of the file's text 20475 002360'01 254 00 0 00 002367' ifskp. ;[263] Worked, do something clever 20476 002361'01 323 03 0 00 002365' ifg. t3 ;[209] Did we hit the linefeed? 20477 002362'01 200 10 0 00 002355* move q4, pars9 ;[263] Yes, so need to do post calculations 20478 002363'01 274 10 0 00 000003 sub q4, t3 ;[209] Calculate amount done 20479 002364'01 254 00 0 00 002366' else. ;[209] Otherwise, don't need to do any math 20480 002365'01 200 10 0 00 002362* move q4, pars9 ;[263] Put in maximum length 20481 002366'01 endif. ;[209] 20482 002366'01 254 00 0 00 002401' else. ;[263] Failed somehow 20483 002367'01 550 02 0 00 000001 hrrz t2,t1 ; Erase fork handle from left half. 20484 002370'01 302 02 0 00 600220 caie t2, iox4 ; Was error EOF? 20485 002371'01 334 00 0 00 000000 %ermsg (,$tranx) ; No, give message. 20486 002372'01 254 00 0 00 002376' 20487 002373'01 265 01 0 00 002127* 20488 002374'01 000000 000000 20489 002375'01 254 00 0 00 002522' 20490 002376'01 260 17 0 00 000000* call endtim ;[267] Finished timing 20491 002377'01 260 17 0 00 002635' call tranot ;[229] Notify us of transmit completion 20492 002400'01 254 00 0 00 002522' jrst $tranx ; But either way, we are done 20493 002401'01 endif. ;[194] 20494 20495 ; N.B., This code appears to assume a particular kind of Tops-20 20496 ; formatted text file in other words, the STANDARD kind that is 20497 ; used on *ALL* DEC operating systems and in many cases on DOS, 20498 ; OS/2 and Windows. That is, a series of variable length lines 20499 ; terminated by a carriage return and a line feed. 20500 ; 20501 ; However, if you have a Unix or Multics 20502 ; format file with bare linefeed, then this code does the wrong 20503 ; thing because it will strip them all out, giving one big long 20504 ; line. It may also do the wrong thing for consecutive linefeeds. 20505 ; This is very old behavior. 20506 ; 20507 ; If this is in fact a bug or misfeature, then the fix is 20508 ; straightforward in concept (yet not in implementation). We'd 20509 ; need to PMAP% the file and then use a MOVST to trigger on a K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-1 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20510 ; carriage return and check after it for a linefeed. If the 20511 ; linefeed existed, then we'd strip it, otherwise, this would be a 20512 ; case of overprinting, which still might work right. Bare 20513 ; linefeed's would be left alone. 20514 ; 20515 ; Leave alone for now until better understand the reason for 20516 ; swallowing trailing linefeeds. 20517 ; 20518 ; Changed to shorten the string length because we don't send NUL 20519 ; terminated strings, but rather counted ones. 20520 20521 repeat 0, < ;[229] Previous vestigial code 20522 ldb t1, t2 ;[209] Pick up the last character 20523 caie t1, .chlfd ;[209] Was it a LF? 20524 ibp t2 ;[209] No, so don't overwrite it. 20525 setz t1, ;[209] Deposit a null, overwriting 20526 call @parity ;[223] Put parity on this last dinky character 20527 dpb t1, t2 ; last char if it was a LF. 20528 > ;[229] 20529 20530 002401'01 135 01 0 00 000002 ldb t1, t2 ;[229] Pick up the final character 20531 002402'01 302 01 0 00 000012 caie t1, .chlfd ;[229] Was it a linefeed? 20532 002403'01 254 00 0 00 002405' ifskp. ;[229] It is, so don't send it 20533 002404'01 363 10 0 00 002345' sojle q4, $tran3 ;[229] Decrement the count and skip if nothing left 20534 002405'01 endif. ;[229] Still, positive, so something to do K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20535 20536 ; TRANSMIT, cont'd... Echo the string if necessary. 20537 20538 002405'01 336 00 0 00 000000* $tran4: ifmn. cpseen ;[194] ^P typed? 20539 002406'01 254 00 0 00 002413' 20540 txmsg < - Resending... 20541 002407'01 200 01 0 00 000000# > ; Yes, type msg 20542 002410'01 104 00 0 00 000076 20543 002411'01 320 12 0 00 002412' 20544 000240'02 000000000000# 20545 001211'04 040 055 040 122 145 20546 20547 002412'01 402 00 0 00 002405* setzm cpseen ; and unset flag. 20548 002413'01 endif. ;[194] 20549 20550 002413'01 $tran5: remark ;[223] Tack on desired parity, in place (if desired) 20551 002413'01 200 01 0 00 001633* move t1, parity ;[223] Pick up the parity 20552 002414'01 306 01 0 00 003731' cain t1, none ;[223] Doing any parity anyway? 20553 002415'01 254 00 0 00 002421' ifskp. ;[223] We are, so do some parity already ... 20554 002416'01 200 02 0 00 004673' move t2, [point 8, strbf2] ; Point to the string. 20555 002417'01 210 03 0 00 000010 movn t3, q4 ;[223] Load negative for SOUTR% 20556 002420'01 260 17 0 00 004325' call putpar ;[223] Stomp some parity into it 20557 002421'01 endif. ;[223] End case handling parity 20558 20559 002421'01 336 00 0 00 001557* skipn duplex ; Half duplex? 20560 002422'01 254 00 0 00 002430' jrst $tran6 ;[223] No. 20561 002423'01 200 01 0 00 004673' move t1, [point 8, strbf2] ; Point to the string. 20562 002424'01 104 00 0 00 000076 PSOUT ; Yes, display it at the tty. 20563 002425'01 201 01 0 00 000012 movei t1, .chlfd ; Also need to add linefeed. 20564 002426'01 260 17 1 00 002413* call @parity ; And any necessary parity 20565 002427'01 104 00 0 00 000074 PBOUT 20566 20567 002430'01 $tran6: remark ;[223] Finally send the string 20568 002430'01 337 01 0 00 001476* skipg t1, netjfn ;[186] ... out the communication line. 20569 002431'01 200 01 0 00 001477* move t1, ttyjfn ;[186] using local terminal 20570 002432'01 200 02 0 00 004673' move t2, [point 8, strbf2] 20571 002433'01 210 03 0 00 000010 movn t3, q4 ;[223] Load count 20572 20573 002434'01 336 00 0 00 001515* ifmn. tvtflg ;[247] On a TVT? 20574 002435'01 254 00 0 00 002466' 20575 002436'01 415 16 0 00 002455' block. ;[247] Yes, let's see if we need any quoting 20576 002437'01 261 17 0 00 000016 20577 002440'01 265 16 0 00 004627' saveac ;[247] Save output designator, want an accumulator 20578 002441'01 200 07 0 00 004637' move q3, [point 8, tvtbuf] ;[247] Special buffer for IAC doubling 20579 002442'01 200 01 0 00 000010 move t1, q4 ;[247] Positive length 20580 002443'01 200 03 0 00 000007 move t3, q3 ;[247] Load output area 20581 002444'01 260 17 0 00 001525* call iaciac ;[247] Go double any IAC's 20582 002445'01 334 00 0 00 000000 %ermsg (,r) ;;[247] 20583 002446'01 254 00 0 00 002452' 20584 002447'01 265 01 0 00 002373* 20585 002450'01 000000000000# 20586 002451'01 254 00 0 00 002174* 20587 001215'04 117 125 124 120 125 20588 002452'01 200 10 0 00 000004 move q4, t4 ;[247] Store updated length 20589 002453'01 200 02 0 00 000007 move t2, q3 ;[247] New output buffer K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-1 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20590 002454'01 263 17 0 00 000000 endbk. ;[247] End of block context 20591 002455'01 254 00 0 00 002461' ifskp. ;[247] Success 20592 002456'01 210 03 0 00 000010 movn t3, q4 ;[247] New length 20593 002457'01 400 04 0 00 000000 setz t4, ;[247] Just in case still NUL terminated (isn't) 20594 002460'01 254 00 0 00 002466' else. ;[247] Otherwise, failed somehow 20595 002461'01 334 00 0 00 000000 %ermsg (,r) 20596 002462'01 254 00 0 00 002466' 20597 002463'01 265 01 0 00 002447* 20598 002464'01 000000000000# 20599 002465'01 254 00 0 00 002451* 20600 001223'04 125 156 141 142 154 20601 002466'01 endif. ;[247] End case iaciac return handling 20602 002466'01 endif. ;[247] End TVT-binary handling 20603 20604 ;[265] N.B., there is a maximum size line beyond which you get an IOX33 20605 ; For PTY's, it appears to be about 120 characters. 20606 20607 002466'01 332 00 0 00 002305* ifme. vtermf ;[186] Not a virtual terminal? 20608 002467'01 254 00 0 00 002477' 20609 002470'01 104 00 0 00 000053 SOUT ;[186] Isn't, so olde reliable is fine 20610 002471'01 320 12 0 00 002473' %jserr (,$tranx) 20611 002472'01 254 00 0 00 002476' 20612 002473'01 265 01 0 00 002463* 20613 002474'01 000000 000000 20614 002475'01 254 00 0 00 002522' 20615 002476'01 254 00 0 00 002511' else. ;[186] Otherwise, have to get out and push 20616 002477'01 350 00 0 00 001553* aos vsoct ;[209] Count a SOUTR% done 20617 002500'01 104 00 0 00 000532 SOUTR% ;[186] 20618 002501'01 320 12 0 00 002503' %jserr (,$tranx) 20619 002502'01 254 00 0 00 002506' 20620 002503'01 265 01 0 00 002473* 20621 002504'01 000000 000000 20622 002505'01 254 00 0 00 002522' 20623 002506'01 272 10 0 00 001554* addm q4, vsotc ;[204] Update tally of SOUTR% bytes 20624 002507'01 313 10 0 00 001556* camle q4, vsomx ;[204] Length than or equal to the maximum seen? 20625 002510'01 202 10 0 00 002507* movem q4, vsomx ;[204] Nope, we have a new maximum! 20626 002511'01 endif. ;[186] 20627 20628 ;[209] Now look for the prompt. Note that everything is echo'ed because 20629 ; this is what Kermit-20 has always done. However, since CAPTURE doesn't 20630 ; echo anything (for performance purposes), all we should see here is 20631 ; the prompt. Or an error... 20632 20633 002511'01 336 00 0 00 002237* $tran7: ifmn. strc ;[266] But!! Are we doing any recognition, anyway? 20634 002512'01 254 00 0 00 002517' 20635 002513'01 260 17 0 00 000274' call $input ;[209] Let $INPUT drive the bus now 20636 002514'01 322 11 0 00 002517' ifn. q5 ;[209] Batch log needs to get tied off? 20637 002515'01 561 01 0 00 002135* hrroi t1, crlf ;[209] Yes, so load that 20638 002516'01 104 00 0 00 000076 PSOUT% ;[209] and type it 20639 002517'01 endif. ;[209] End batch log line tie off 20640 002517'01 endif. ;[266] End case looking for remote response 20641 002517'01 333 01 0 00 001740* skiple t1, pars10 ;[266] Pausing after the send? 20642 002520'01 104 00 0 00 000167 DISMS% ;[266] We are, so wait whatever 20643 002521'01 254 00 0 00 002345' jrst $tran3 ;[209] Returns on the prompt 20644 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-2 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20645 ; Done, call terminal restore routines in reverse order. 20646 20647 002522'01 260 17 0 00 000000* $tranx: call cmpoff ; ^M, ^P interrupts off. 20648 002523'01 260 17 0 00 000365* call ccoff2 ; ^C trap off. 20649 002524'01 336 01 0 00 001732* skipn t1, pars7 ;[229] Did we have an EOF character? 20650 002525'01 254 00 0 00 002557' ifskp. ;[229] We did, let's get it sent 20651 002526'01 241 01 0 00 777770 rot t1, -^d8 ;[229] Turn into an 8 bit ASCIZ string (heh) 20652 002527'01 200 05 0 00 000001 move q1, t1 ;[229] And get it out of SOUTR%'s way 20653 002530'01 201 01 0 00 000015 movei t1, .chcrt ;[229] Load a carriage return 20654 002531'01 260 17 1 00 002426* call @parity ;[229] Put parity on that (if doing parity) 20655 002532'01 241 01 0 00 777760 rot t1, -^d16 ;[229] Turn into 2nd byte of 8 bit ASCIZ string 20656 002533'01 434 05 0 00 000001 or q1, t1 ;[229] 'append' it (heh) 20657 002534'01 337 01 0 00 002430* skipg t1, netjfn ;[229] Will go out the network 20658 002535'01 200 01 0 00 002431* move t1, ttyjfn ;[229] or using the local terminal 20659 dmove t2, [ ;[229] Set up for SOUTR% 20660 point 8, q1 ;[229] Output string is in q1 20661 002536'01 120 02 0 00 004674' -2 ] ;[229] Just two dinky characters 20662 002537'01 400 04 0 00 000000 setz t4, ;[229] Should be ignored, but just in case 20663 002540'01 332 00 0 00 002466* ifme. vtermf ;[229] Going to a real terminal? 20664 002541'01 254 00 0 00 002551' 20665 002542'01 104 00 0 00 000053 SOUT% ;[229] Yes, so counted SOUT% will be fine 20666 002543'01 320 12 0 00 002545' %jserr (,) ;[229] Complain and carry on 20667 002544'01 254 00 0 00 002550' 20668 002545'01 265 01 0 00 002503* 20669 002546'01 000000 000000 20670 002547'01 254 00 0 00 002550' 20671 002550'01 254 00 0 00 002557' else. ;[229] Otherwise, needs a 'push' 20672 002551'01 104 00 0 00 000532 SOUTR% ;[229] Counted string is faster 20673 002552'01 320 12 0 00 002554' %jserr (,) ;[229] Complain and carry on 20674 002553'01 254 00 0 00 002557' 20675 002554'01 265 01 0 00 002545* 20676 002555'01 000000 000000 20677 002556'01 254 00 0 00 002557' 20678 002557'01 endif. ;[229] End case appropriate output selection 20679 002557'01 endif. ;[229] End case sending the EOF 20680 20681 002557'01 260 17 0 00 002275* call clrbuf ; Flush any junk they may have typed 20682 002560'01 600 00 0 00 000000 nop ;[186] Ignore any complaints 20683 002561'01 332 00 0 00 002540* ifme. vtermf ;[186] Calls only make sense if not virtual 20684 002562'01 254 00 0 00 002566' 20685 002563'01 260 17 0 00 000371* call ttyou ; Restore controlling tty. 20686 002564'01 260 17 0 00 000370* call unbits ; Put line back to previous state. 20687 002565'01 260 17 0 00 000372* call unarpa ;[229] And shut off TVT binary 20688 002566'01 endif. ;[186] Otherwise, MTOPR%'s might break! 20689 20690 002566'01 337 01 0 00 002353* skipg t1, filjfn ;[193] Close the file. 20691 002567'01 254 00 0 00 002610' ifskp. ;[193] If there was any 20692 002570'01 306 01 0 00 377777 cain t1, .nulio ;[193] Unless special NUL: 20693 002571'01 254 00 0 00 002610' anskp. ;[193] Which needs no releasing 20694 002572'01 474 01 0 00 000000 seto t1, ;[263] -1 to release storage 20695 dmove t2, [ ;[263] Doing a moby unmap! 20696 .fhslf,,smpsec ;[263] This process, SMAP section 20697 002573'01 120 02 0 00 004676' 0,,^d1 ] ;[263] No access, a single section 20698 002574'01 104 00 0 00 000767 SMAP% ;[263] Case IV: Deleting Process Sections 20699 002575'01 320 12 0 00 002577' ifje. r ;[263] Failed?? K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-3 K20IOC MAC 12-May-24 20:27 TRANSMIT command execution. 20700 002576'01 254 00 0 00 002605' 20701 002577'01 200 04 0 00 000001 move t4, t1 ;[263] Save error code for debugging 20702 002600'01 334 00 0 00 000000 %ermsg (,) ;[263] Squawk and continue 20703 002601'01 254 00 0 00 002605' 20704 002602'01 265 01 0 00 002554* 20705 002603'01 000000000000# 20706 002604'01 254 00 0 00 002605' 20707 001234'04 125 156 141 142 154 20708 002605'01 endif. ;[263] End case SMAP% JSYS error handling 20709 002605'01 550 01 0 00 002566* hrrz t1, filjfn ;[263] Load the JFN again 20710 002606'01 260 17 0 00 002225* call frclos ;[263] Force the JFN to close 20711 002607'01 600 00 0 00 000000 nop ;[263] Ignore any errors 20712 002610'01 endif. ;[193] End case closing a real JFN 20713 002610'01 402 00 0 00 002605* setzm filjfn ; Zero the JFN holder. 20714 002611'01 260 17 0 00 000400' call $inpcl ;[229] Clean up $input's buffer 20715 002612'01 263 17 0 00 000000 ret 20716 20717 002613'01 $trant: remark ;[229] Here on a time out 20718 002613'01 333 04 0 00 002511* skiple t4, strc ;[229] No search string, then? 20719 002614'01 254 00 0 00 002620' ifskp. ;[229] Nope, just generic complaint 20720 002615'01 200 01 0 00 000000# emsg ;[229] Suitably vague.. 20721 002616'01 104 00 0 00 000313 20722 000241'02 000000000000# 20723 001243'04 124 162 141 156 163 20724 002617'01 254 00 0 00 002632' else. ;[229] Otherwise, provide a more helpful message 20725 002620'01 200 01 0 00 000000# emsg ;[229] Begin whining 20726 002621'01 104 00 0 00 000313 20727 000242'02 000000000000# 20728 001247'04 124 162 141 156 163 20729 dmove t1, [ .priou ;[229] continue typing on terminal 20730 002622'01 120 01 0 00 004700' point 7,strbuf ] ;[229] Point to search string 20731 002623'01 210 03 0 00 000004 movn t3, t4 ;[229] Load exact count to do 20732 002624'01 104 00 0 00 000053 SOUT% ;[229] Counted SOUT% is faster 20733 002625'01 320 12 0 00 002627' %jsErr (,) ;[229] Can't win ... 20734 002626'01 254 00 0 00 002632' 20735 002627'01 265 01 0 00 002602* 20736 002630'01 000000 000000 20737 002631'01 254 00 0 00 002632' 20738 002632'01 endif. ;[229] End case no prompt 20739 20740 002632'01 561 01 0 00 002515* hrroi t1, crlf ;[229] Have to tie off the line 20741 002633'01 104 00 0 00 000076 PSOUT% ;[229] 20742 002634'01 254 00 0 00 002522' jrst $tranx ;[229] Go shut everything down 20743 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20IOC MAC 12-May-24 20:27 Notify of transmission completion 20744 subttl Notify of transmission completion 20745 20746 ;N.B., The byte count isn't what we actually sent; it's what the 20747 ; file should show up as. 20748 20749 002635'01 260 17 0 00 000000* tranot: call elptim ;[267] Compute elapsed time 20750 txmsg < 20751 002636'01 200 01 0 00 000000# [KERMIT-20: Transmit of > ;[229] Begin to tell us about it 20752 002637'01 104 00 0 00 000076 20753 002640'01 320 12 0 00 002641' 20754 000243'02 000000000000# 20755 001256'04 015 012 133 113 105 20756 20757 002641'01 200 02 0 00 002610* move t2, filjfn ;[229] Let's get ready to print the file name 20758 002642'01 302 02 0 00 377777 caie t2, .nulio ;[229] Just dumping it? 20759 002643'01 254 00 0 00 002650' ifskp. ;[229] Yes, so bum the JFNS% 20760 002644'01 200 01 0 00 000000# txmsg ;[229] (which won't work, anyway) 20761 002645'01 104 00 0 00 000076 20762 002646'01 320 12 0 00 002647' 20763 000244'02 000000000000# 20764 001264'04 116 125 114 072 000 20765 002647'01 254 00 0 00 002660' else. ;[229] Otherwise, have a real file (I hope) 20766 002650'01 201 01 0 00 000101 movei t1, .priou ;[229] Continue to display on the terminal 20767 002651'01 403 03 0 00 000004 setzb t3, t4 ;[229] No special formatting or goofy prefix 20768 002652'01 104 00 0 00 000030 JFNS% ;[229] Let's see the file name 20769 002653'01 320 12 0 00 002655' %jsErr (,) ;[229] 20770 002654'01 254 00 0 00 002660' 20771 002655'01 265 01 0 00 002627* 20772 002656'01 000000000000# 20773 002657'01 254 00 0 00 002660' 20774 001265'04 103 157 165 154 144 20775 002660'01 endif. ;[229] End case displaying the file name 20776 20777 002660'01 200 01 0 00 000000# txmsg < complete> ;[229] Prepare to blat the file length 20778 002661'01 104 00 0 00 000076 20779 002662'01 320 12 0 00 002663' 20780 000245'02 000000000000# 20781 001275'04 040 143 157 155 160 20782 002663'01 337 02 0 00 000000# skipg t2, zsizeb ;[229] Load the size of the file in bytes 20783 002664'01 254 00 0 00 002710' ifskp. ;[229] Actually had some data 20784 002665'01 200 01 0 00 000000# txmsg <, > ;[229] Punctuate for some data 20785 002666'01 104 00 0 00 000076 20786 002667'01 320 12 0 00 002670' 20787 000246'02 000000000000# 20788 001277'04 054 040 000 000 000 20789 002670'01 201 01 0 00 000101 movei t1, .priou ;[229] Continue to display on the terminal 20790 002671'01 201 03 0 00 000012 movei t3, ^d10 ;[229] File sizes are always base 10 20791 002672'01 104 00 0 00 000224 NOUT% ;[229] Finally type our length 20792 002673'01 320 12 0 00 002675' %jsErr (,) ;[229] 20793 002674'01 254 00 0 00 002700' 20794 002675'01 265 01 0 00 002655* 20795 002676'01 000000000000# 20796 002677'01 254 00 0 00 002700' 20797 001300'04 103 157 165 154 144 20798 002700'01 200 01 0 00 000000# txmsg < characters, > ;[229] However, we clipped a lot of linefeeds K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49-1 K20IOC MAC 12-May-24 20:27 Notify of transmission completion 20799 002701'01 104 00 0 00 000076 20800 002702'01 320 12 0 00 002703' 20801 000247'02 000000000000# 20802 001310'04 040 143 150 141 162 20803 002703'01 201 01 0 00 000101 movei t1, .priou ;[267] Carry on the terminal 20804 002704'01 200 03 0 00 000002 move t3, t2 ;[267] Wants total it in t3 20805 002705'01 260 17 0 00 000000* call gmkcps ;[267] Show rate 20806 002706'01 600 00 0 00 000000 nop ;[267] Ignore +1 20807 002707'01 254 00 0 00 002716' else. ;[229] Otherwise, nothing there 20808 002710'01 550 01 0 00 002641* hrrz t1, filjfn ;[229] But!! Do we actually care? 20809 002711'01 306 01 0 00 377777 cain t1, .nulio ;[229] Just dumping stuff? 20810 002712'01 254 00 0 00 002716' anskp. ;[229] Yes, so NUL: really only has one size... 20811 002713'01 200 01 0 00 000000# txmsg <(empty file)> ;[229] Nothing there... 20812 002714'01 104 00 0 00 000076 20813 002715'01 320 12 0 00 002716' 20814 000250'02 000000000000# 20815 001313'04 050 145 155 160 164 20816 002716'01 endif. ;[229] End case 20817 20818 txmsg <] 20819 002716'01 200 01 0 00 000000# > ;[229] Finish reassuring user 20820 002717'01 104 00 0 00 000076 20821 002720'01 320 12 0 00 002721' 20822 000251'02 000000000000# 20823 001316'04 135 015 012 000 000 20824 002721'01 263 17 0 00 000000 ret ;[229] Finally done 20825 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20IOC MAC 12-May-24 20:27 CAPTURE Parsing logic 20826 subttl CAPTURE Parsing logic 20827 20828 ;[229] Begin code insertion 20829 20830 ;[229] %table puts stuff in the correct .psect 20831 20832 000252'02 000000 000000 %table (capswi) ; The capture switch table 20833 000253'02 000000# 000000 %key2 , %eofsw ; The EOF switch parses a restricted token set 20834 000053'03 105 117 106 000 000 20835 000254'02 000000# 000002 %key2 , %timsw ; In case we don't want to wait forever ... 20836 000054'03 164 151 155 145 157 20837 000252'02 000002 000002 %tbend ; End of table 20838 20839 002722'01 000000000000# captfs: flddb. .cmswi,,capswi,,,tranfd ; Maybe get a capture switch 20840 002723'01 000000000000# 20841 20842 ; Default command filespec fields for .CMFIL. These are only given 20843 ; so that we may get the flags returned by GTJFN% (which are currently 20844 ; unused) 20845 20846 chgsec(code,const) ;;GTJFN defaults are not in code, they're in const 20847 20848 000255'02 600020 777777 capbk: gj%flg!gj%fou!gj%new!fld(.gjnhg,.rhalf) ; .GJGEN 20849 000256'02 000100 000101 .priin,,.priou ; .GJSRC (ignored if COMND%) 20850 000257'02 000000 000000 0 ; .GJDEV (do not default the device) 20851 000260'02 000000 000000 0 ; .GJDIR (do not default the directory) 20852 000261'02 000000 000000 0 ; .GJNAM (do not default the name) 20853 000262'02 000000 000000 0 ; .GJEXT (do not default the extension) 20854 000263'02 000000 000000 0 ; .GJPRO (use system default protection) 20855 000264'02 000000 000000 0 ; .GJACT (use job's current account) 20856 000010 capbkl==<.-capbk> ; Length of this GTJFN argument block. 20857 retsec ;;Back to where-ever we started from 20858 20859 ;[266] Document hairy parse variable usage. Be aware that some of these are 20860 ; shared with INPUT's parsing and semantic action. 20861 20862 remark pars1 ;[266] Linkage between parsing and semantic 20863 remark pars2 ;[266] JFN of file to transmit 20864 remark pars3 ;[266] Set if .cmcfm and using default search string 20865 remark pars4 ;[266] Integer timeout in milliseconds 20866 remark pars5 ;[273] Integer timeout, floating point seconds 20867 remark pars6 ;[266] Set to not override $INPUT's interrupt handling 20868 remark pars7 ;[266] EOF character to use (if any) 20869 remark pars8 ;[266] If doing SILENT matching 20870 remark pars9 ;[266] Maximum length of line to transmit 20871 remark pars10 ;[266] Milliseconds to pause, integer 20872 remark pars11 ;[273] Not defined as pars10 is a double 20873 remark pars12 ;[273] Whether observing case 20874 20875 20876 002724'01 .captu: entry .captu ; Linkage is from k20par 20877 002724'01 265 16 0 00 004640' saveac ; Protect some registers 20878 20879 002725'01 200 01 0 00 004654' movx t1, cz%ncl!.fhslf ; Release non-open JFN's on reparse 20880 002726'01 104 00 0 00 000034 CLZFF% K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50-1 K20IOC MAC 12-May-24 20:27 CAPTURE Parsing logic 20881 002727'01 320 12 0 00 002730' erjmpr .+1 ; Catch and ignore errors 20882 002730'01 200 01 0 00 004702' move t1, [capbk,,cjfnbk] ;Insert our file parsing 20883 002731'01 251 01 0 00 000000# blt t1, cjfnbk+capbkl ; defaults into the parse block 20884 20885 002732'01 260 17 0 00 001715' call trcapd ;[275] Set up the parse/command defaults 20886 002733'01 201 11 0 00 002722' movei q5, captfs ; Load our initial parse file descriptor block 20887 002734'01 254 00 0 00 001754' callret .tran0 ; The rest of it parses exactly like TRANSMIT 20888 20889 ;[230] End code insertion 20890 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20IOC MAC 12-May-24 20:27 CAPTURE semantic action 20891 subttl CAPTURE semantic action 20892 20893 ;[230] Begin code insertion 20894 20895 003776 capmxl==<-2> ;;Maximum we can store, minus at end 20896 20897 remark ; Various linkages 20898 extern inilin ; Routine to condition line for capture 20899 extern rrslin ; Routine to decondition line 20900 extern ttipar ; Count of parity errors detected 20901 extern movchr ; Location of a movslj instruction 20902 20903 002735'01 $captu: entry $captu ; Linkage is from k20par 20904 002735'01 265 16 0 00 004703' saveac ; Protect a bunch of registers 20905 20906 002736'01 337 07 0 00 002534* skipg q3, netjfn ; Assuming getting a character from the network 20907 002737'01 200 07 0 00 002535* move q3, ttyjfn ; No network, so using local terminal 20908 002740'01 200 10 0 00 002524* move q4, pars7 ; Load EOF character (if any, which will have parity) 20909 002741'01 200 13 0 00 000010 move p3, q4 ; Make a 7 bit copy 20910 002742'01 405 13 0 00 000177 andi p3, ^o177 ; by stripping off any parity 20911 002743'01 201 01 0 00 000015 movei t1, .chcrt ; Load expected end of line 20912 002744'01 260 17 1 00 002531* call @parity ; Put parity on it (if doing parity) 20913 002745'01 200 12 0 00 000001 move p2, t1 ; and keep the result in p2 20914 ; Now set up to write the prompt easily 20915 002746'01 336 04 0 00 002613* skipn t4, strc ; Load the prompt length 20916 002747'01 254 00 0 00 002771' ifskp. ; If not zero, see about using it 20917 002750'01 316 07 0 00 002737* camn q3, ttyjfn ; Not going to the terminal? 20918 002751'01 254 00 0 00 002754' ifskp. ; No, so will be doing a SOUTR% 20919 002752'01 313 04 0 00 002510* camle t4, vsomx ; Length less than or equal to the maximum seen? 20920 002753'01 202 04 0 00 002752* movem t4, vsomx ; Nope, we have a new SOUTR% maximum! 20921 002754'01 endif. ; End case SOUTR% max update 20922 002754'01 200 01 0 00 002744* move t1, parity ; Load the parity 20923 002755'01 302 01 0 00 003731' caie t1, none ; But!! Not doing any parity? 20924 002756'01 254 00 0 00 002766' ifskp. ; No, so just 'expand' the byte width 20925 002757'01 200 01 0 00 000004 move t1, t4 ; The strings are the same length 20926 002760'01 403 03 0 00 000006 setzb t3, q2 ; Both are section zero local 20927 002761'01 200 02 0 00 004602' move t2, [point 7, strbuf] ; Source is 7 bit 20928 002762'01 200 05 0 00 004673' move q1, [point 8, strbf2] ; Destination is 8 bit 20929 002763'01 123 01 0 00 000000* extend t1, movchr ; Do the byte width expansion 20930 002764'01 600 00 0 00 000000 nop ; Ignore any odd non-skip 20931 002765'01 254 00 0 00 002771' else. ; Otherwise, have to do some real parity 20932 002766'01 210 03 0 00 000004 movn t3, t4 ; genpar wants a negative count (like SOUT%) 20933 002767'01 120 01 0 00 004721' dmove t1, [ exp , ] 20934 002770'01 260 17 0 00 004346' call genpar ; Rewrite the string as 8 bit (7 + 1 bit parity) 20935 002771'01 endif. ; End 7 to 8 bit conversion, possibly with parity 20936 002771'01 endif. ; End case network prompt length check 20937 20938 002771'01 550 01 0 00 002224* hrrz t1, pars2 ; Let's get the output file opened 20939 002772'01 202 01 0 00 002710* movem t1, filjfn ; Store JFN (sans flags) 20940 002773'01 306 01 0 00 377777 cain t1, .nulio ; Opening .nulio does work, but it's a waste of time 20941 002774'01 254 00 0 00 003014' ifskp. ; A real file, so let's get this thing open 20942 002775'01 200 02 0 00 004723' movx t2, fld(7,of%bsz)!of%wr ; 7-bit bytes, write-only (I.E., no append) 20943 002776'01 104 00 0 00 000021 OPENF% ; Try to create the file 20944 002777'01 320 12 0 00 003001' ifje. r ; Failed?? 20945 003000'01 254 00 0 00 003014' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51-1 K20IOC MAC 12-May-24 20:27 CAPTURE semantic action 20946 003001'01 200 04 0 00 000001 move t4, t1 ; Save error code for debugging 20947 003002'01 334 00 0 00 000000 %ermsg (,) ; Squawk and continue 20948 003003'01 254 00 0 00 003007' 20949 003004'01 265 01 0 00 002675* 20950 003005'01 000000000000# 20951 003006'01 254 00 0 00 003007' 20952 001317'04 125 156 141 142 154 20953 003007'01 402 00 0 00 002772* setzm filjfn ; Stomp JFN global storage 20954 003010'01 550 01 0 00 002771* hrrz t1, pars2 ; Reload the JFN 20955 003011'01 260 17 0 00 002606* call frclos ; Force it closed 20956 003012'01 600 00 0 00 000000 nop ; Ignore error and carry on 20957 003013'01 263 17 0 00 000000 ret ; And return; we can't do anything else 20958 003014'01 endif. ; End case OPENF% JSYS error handling 20959 003014'01 endif. ; End case skipping an OPENF% of .nulio 20960 20961 003014'01 260 17 0 00 003075' call caphrl ; Display the capture herald 20962 003015'01 260 17 0 00 002303* call ccon ; Turn on ^C trap 20963 003016'01 254 00 0 00 003071' jrst $capux ; Where to go upon ^C. 20964 003017'01 260 17 0 00 000000* call inilin ; Initialize the line for transfer 20965 20966 003020'01 do. ; Enter loop context 20967 003020'01 260 17 0 00 003236' call getcrt ; Get a carriage return terminated line of text 20968 003021'01 254 00 0 00 003071' jrst $capux ; On error, close the file and restore the line 20969 003022'01 260 17 0 00 003377' call eofovr ; Overwrite any EOF at the end of the string 20970 003023'01 200 01 0 00 003007* move t1, filjfn ; Load the file JFN 20971 003024'01 337 01 0 00 003023* skipg t1, filjfn ;[266] Load and check the file JFN 20972 003025'01 254 00 0 00 003041' ifskp. ; Something, there, maybe use it 20973 003026'01 306 01 0 00 377777 cain t1, .nulio ; But!! Only going to toss the data? 20974 003027'01 254 00 0 00 003041' anskp. ;[266] Yes, no need to engage in this foolishness 20975 003030'01 323 14 0 00 003041' andg. p4 ; Also don't bother if we have nothing to write 20976 003031'01 200 02 0 00 004602' move t2,[point 7,strbuf] ;Source is the repacked string 20977 003032'01 210 03 0 00 000014 movn t3, p4 ; Load negative length because ... 20978 003033'01 104 00 0 00 000053 SOUT% ; Counted SOUT%'s are faster 20979 003034'01 320 12 0 00 003036' %jserr (,$capux) ; Complain and stop doing this 20980 003035'01 254 00 0 00 003041' 20981 003036'01 265 01 0 00 003004* 20982 003037'01 000000 000000 20983 003040'01 254 00 0 00 003071' 20984 003041'01 endif. ; End case writing the file (or tossing the data) 20985 003041'01 321 10 0 00 003071' jumpl q4, endlp. ; Break out of loop if allready hit EOF character 20986 003042'01 322 04 0 00 003020' jumpe t4, top. ; Don't print the prompt unless told to 20987 003043'01 336 05 0 00 002746* skipn q1, strc ; No search string, then? 20988 003044'01 254 00 0 00 003020' loop. ; No such luck, go get some more data 20989 003045'01 200 01 0 00 000007 move t1, q3 ; Load whatever transfer JFN we're using 20990 003046'01 200 02 0 00 004673' move t2,[point 8,strbf2] ;Point to search string 20991 003047'01 210 03 0 00 000005 movn t3, q1 ; Load exact count to do 20992 003050'01 312 01 0 00 002750* came t1, ttyjfn ; Going to the terminal? 20993 003051'01 254 00 0 00 003061' ifskp. ; Yes, that's easy enough 20994 003052'01 104 00 0 00 000053 SOUT% ; Boom, done 20995 003053'01 320 12 0 00 003055' %jserr (,$capux) ; or not... 20996 003054'01 254 00 0 00 003060' 20997 003055'01 265 01 0 00 003036* 20998 003056'01 000000 000000 20999 003057'01 254 00 0 00 003071' 21000 003060'01 254 00 0 00 003070' else. ; Otherwise, needs a poke to be on its way K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51-2 K20IOC MAC 12-May-24 20:27 CAPTURE semantic action 21001 003061'01 104 00 0 00 000532 SOUTR% ; Write the network 21002 003062'01 320 12 0 00 003064' %jserr (,$capux) ; or not... 21003 003063'01 254 00 0 00 003067' 21004 003064'01 265 01 0 00 003055* 21005 003065'01 000000 000000 21006 003066'01 254 00 0 00 003071' 21007 003067'01 272 05 0 00 002506* addm q1, vsotc ; Update tally of SOUTR% bytes 21008 003070'01 endif. ; End case writing the terminal 21009 003070'01 254 00 0 00 003020' loop. ; Either way, go get some more goodies 21010 003071'01 enddo. ; Exit loop lexical context 21011 21012 003071'01 260 17 0 00 000000* $capux: call rrslin ; Turn ^C trap off, close file, clear buffer 21013 003072'01 561 01 0 00 002632* hrroi t1, crlf ;[229] Tie off line 21014 003073'01 104 00 0 00 000076 PSOUT% ;[229] So INPUT in Batch works 21015 003074'01 263 17 0 00 000000 ret ; Done 21016 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20IOC MAC 12-May-24 20:27 Display herald for capture command 21017 subttl Display herald for capture command 21018 21019 ; Call: 21020 ; 21021 ; strc/ Indicates we have a prompt string 21022 ; filjfn/ Wherever we're writing the captured data 21023 ; q4/ EOF character (if we have one) 21024 ; 21025 ; N.B., If we bum all the SOUT%'s with a movslj, it will have to get 21026 ; executed in section or the text will need to be in section zero 21027 21028 003075'01 201 01 0 00 000101 caphrl: movei t1, .priou ; Output is always the terminal 21029 dxtext (t2,< 21030 003076'01 120 02 0 00 000000# [KERMIT-20: Capturing to >) ;Tell user we're starting. 21031 000265'02 000000000000# 21032 000266'02 777777 777745 21033 001325'04 015 012 133 113 105 21034 003077'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21035 003100'01 320 12 0 00 003102' %jsErr (,) ; Whine and continue 21036 003101'01 254 00 0 00 003105' 21037 003102'01 265 01 0 00 003064* 21038 003103'01 000000000000# 21039 003104'01 254 00 0 00 003105' 21040 001333'04 125 156 141 142 154 21041 003105'01 200 02 0 00 003024* move t2, filjfn ; Load the JFN 21042 003106'01 302 02 0 00 377777 caie t2, .nulio ; But!! Just tossing it? 21043 003107'01 254 00 0 00 003120' ifskp. ; Yes, can't JFNS% because it chokes on a device 21044 003110'01 120 02 0 00 000000# dxtext (t2,) ; Easy enough to 'translate' (heh) 21045 000267'02 000000000000# 21046 000270'02 777777 777774 21047 001343'04 116 125 114 072 000 21048 003111'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21049 003112'01 320 12 0 00 003114' %jsErr (,) ; What? Eh? 21050 003113'01 254 00 0 00 003117' 21051 003114'01 265 01 0 00 003102* 21052 003115'01 000000000000# 21053 003116'01 254 00 0 00 003117' 21054 001344'04 125 156 141 142 154 21055 003117'01 254 00 0 00 003127' else. ; Otherwise, assume a bona fide JFN 21056 003120'01 403 03 0 00 000004 setzb t3, t4 ; Standard formatting, no goofball prefix... 21057 003121'01 104 00 0 00 000030 JFNS% ; Type it 21058 003122'01 320 12 0 00 003124' %jsErr (,) ; Whine & continue 21059 003123'01 254 00 0 00 003127' 21060 003124'01 265 01 0 00 003114* 21061 003125'01 000000000000# 21062 003126'01 254 00 0 00 003127' 21063 001353'04 125 156 141 142 154 21064 003127'01 endif. ; End case output device special casing 21065 21066 003127'01 322 10 0 00 003164' ifn. q4 ; Do we have an EOF character? 21067 003130'01 120 02 0 00 000000# dxtext (t2,<, EOF: >) ; We do, so load the herald 21068 000271'02 000000000000# 21069 000272'02 777777 777771 21070 001364'04 054 040 105 117 106 21071 003131'01 104 00 0 00 000053 SOUT% ; Counted SOUT is faster K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-1 K20IOC MAC 12-May-24 20:27 Display herald for capture command 21072 003132'01 320 12 0 00 003134' %jsErr (,) ; Whine and continue 21073 003133'01 254 00 0 00 003137' 21074 003134'01 265 01 0 00 003124* 21075 003135'01 000000000000# 21076 003136'01 254 00 0 00 003137' 21077 001366'04 125 156 141 142 154 21078 003137'01 200 02 0 00 000010 move t2, q4 ; Load the EOF character 21079 003140'01 405 02 0 00 000177 andi t2, ^o177 ; Stomp any parity 21080 003141'01 302 02 0 00 000033 caie t2, .chesc ; The escape character? 21081 003142'01 254 00 0 00 003145' ifskp. ; It is 21082 003143'01 201 02 0 00 000044 movei t2, "$" ; Replace it with our talisman 21083 003144'01 254 00 0 00 003156' else. ; Otherwise, it is a control character 21084 003145'01 201 03 0 02 000100 movei t3, <"A"-.chcna>(t2) ; Turn into ASCII and get out of the way 21085 003146'01 201 02 0 00 000136 movei t2, "^" ; Need the pointy up arrow 21086 003147'01 104 00 0 00 000051 BOUT% ; Type it 21087 003150'01 320 12 0 00 003152' %jsErr (,) ; Blat 21088 003151'01 254 00 0 00 003155' 21089 003152'01 265 01 0 00 003134* 21090 003153'01 000000000000# 21091 003154'01 254 00 0 00 003155' 21092 001374'04 125 156 141 142 154 21093 003155'01 200 02 0 00 000003 move t2, t3 ; Restore the character 21094 003156'01 endif. ; End case tweaking the EOF character for printing 21095 003156'01 104 00 0 00 000051 BOUT% ; Finally print whatever we made up 21096 003157'01 320 12 0 00 003161' %jsErr (,) ; Blat and continue 21097 003160'01 254 00 0 00 003164' 21098 003161'01 265 01 0 00 003152* 21099 003162'01 000000000000# 21100 003163'01 254 00 0 00 003164' 21101 001405'04 125 156 141 142 154 21102 003164'01 endif. ; End case printing EOF character 21103 21104 003164'01 336 00 0 00 003043* ifmn. strc ; Do we have a prompt string? 21105 003165'01 254 00 0 00 003205' 21106 003166'01 120 02 0 00 000000# dxtext (t2,<, prompt: >) ;we do, so type it 21107 000273'02 000000000000# 21108 000274'02 777777 777766 21109 001413'04 054 040 160 162 157 21110 003167'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21111 003170'01 320 12 0 00 003172' %jsErr (,) ; Whine and continue 21112 003171'01 254 00 0 00 003175' 21113 003172'01 265 01 0 00 003161* 21114 003173'01 000000000000# 21115 003174'01 254 00 0 00 003175' 21116 001416'04 125 156 141 142 154 21117 003175'01 200 02 0 00 004673' move t2, [point 8, strbf2] ; Note, parity was put on the prompt 21118 003176'01 210 03 0 00 003164* movn t3, strc ; Load negative length because ... 21119 003177'01 104 00 0 00 000053 SOUT% ; a counted SOUT% is faster 21120 003200'01 320 12 0 00 003202' %jsErr (,); Whine and continue 21121 003201'01 254 00 0 00 003205' 21122 003202'01 265 01 0 00 003172* 21123 003203'01 000000000000# 21124 003204'01 254 00 0 00 003205' 21125 001426'04 125 156 141 142 154 21126 003205'01 endif. ; End case prompting K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-2 K20IOC MAC 12-May-24 20:27 Display herald for capture command 21127 21128 003205'01 120 02 0 00 000000# dxtext (t2,<, type: >) ; Note trailing space !! 21129 000275'02 000000000000# 21130 000276'02 777777 777770 21131 001436'04 054 040 164 171 160 21132 003206'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21133 003207'01 320 12 0 00 003211' %jsErr (,); Whine and continue 21134 003210'01 254 00 0 00 003214' 21135 003211'01 265 01 0 00 003202* 21136 003212'01 000000000000# 21137 003213'01 254 00 0 00 003214' 21138 001440'04 125 156 141 142 154 21139 003214'01 120 02 0 00 000000# dxtext (t2,<^C^C>) ; Assume default 21140 000277'02 000000000000# 21141 000300'02 777777 777774 21142 001446'04 136 103 136 103 000 21143 003215'01 200 04 0 00 000000# move t4, mycaps+1 ; Load enabled capabilities 21144 003216'01 607 04 0 00 400000 txnn t4, sc%ctc ; Is Control-C on?? 21145 003217'01 120 02 0 00 000000# dxtext (t2,<^G^G>) ; Wasn't ... 21146 000301'02 000000000000# 21147 000302'02 777777 777774 21148 001447'04 136 107 136 107 000 21149 003220'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21150 003221'01 320 12 0 00 003223' %jsErr (,) ; Whine and continue 21151 003222'01 254 00 0 00 003226' 21152 003223'01 265 01 0 00 003211* 21153 003224'01 000000000000# 21154 003225'01 254 00 0 00 003226' 21155 001450'04 125 156 141 142 154 21156 21157 dxtext (t2,< to finish] 21158 003226'01 120 02 0 00 000000# >) ; Note initial leading space !! 21159 000303'02 000000000000# 21160 000304'02 777777 777763 21161 001461'04 040 164 157 040 146 21162 21163 003227'01 104 00 0 00 000053 SOUT% ; Counted SOUT% is faster 21164 003230'01 320 12 0 00 003232' %jsErr (,) ; Whine and continue 21165 003231'01 254 00 0 00 003235' 21166 003232'01 265 01 0 00 003223* 21167 003233'01 000000000000# 21168 003234'01 254 00 0 00 003235' 21169 001464'04 125 156 141 142 154 21170 21171 003235'01 263 17 0 00 000000 ret ; Finally done 21172 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20IOC MAC 12-May-24 20:27 Get a carriage return terminated line of text 21173 subttl Get a carriage return terminated line of text 21174 21175 ; Call: 21176 ; 21177 ; q3/ JFN we're reading from, typically netjfn 21178 ; p2/ EOF character without parity 21179 ; q4/ EOF character, if doing EOF 21180 ; 21181 ; Return: 21182 ; 21183 ; +1/ Any kind of error 21184 ; +2/ Hit either carriage return or an EOF 21185 ; 21186 ; t4/ 0 if didn't hit a carriage return 21187 ; -1 if we did (a linefeed will be appended!!) 21188 ; q1/ Points to last character in seven bit stream 21189 ; q4/ -1 if hit the EOF character 21190 ; p2/ Preserved, always 21191 ; p4/ Total characters that have been buffered up 21192 21193 003236'01 265 16 0 00 004724' getcrt: saveac ; Used as scratch 21194 003237'01 403 14 0 00 000015 setzb p4, p5 ; Assume won't buffer anything or hit a CR 21195 003240'01 200 13 0 00 004626' move p3,[point 8,strbuf] ;Will be reading into the string buffer 21196 ; Loop reads until EOF, CR or buffer full 21197 003241'01 do. ; Enter loop context 21198 003241'01 301 14 0 00 003776 cail p4, capmxl ; Would the read overflow the buffer? 21199 003242'01 254 00 0 00 003346' exit. ; Then don't read another thing 21200 003243'01 200 01 0 00 000007 move t1, q3 ; Load the input JFN 21201 003244'01 104 00 0 00 000050 BIN% ; Wait for a byte 21202 003245'01 320 12 0 00 003247' %jsErr (,r) ; Whine and return 21203 003246'01 254 00 0 00 003252' 21204 003247'01 265 01 0 00 003232* 21205 003250'01 000000000000# 21206 003251'01 254 00 0 00 002465* 21207 001474'04 105 162 162 157 162 21208 003252'01 312 01 0 00 003050* came t1, ttyjfn ; Was this the local terminal? 21209 003253'01 350 00 0 00 000446* aos nbict ; No, so count a network BIN%, then 21210 003254'01 200 01 0 00 000002 move t1, t2 ; Check the parity on this poor character 21211 003255'01 260 17 1 00 002754* call @parity ; Calculate the parity (if any) 21212 003256'01 312 01 0 00 000002 came t1, t2 ; Is the parity the same?? 21213 003257'01 254 00 0 00 003274' ifskp. ; That's dandy, let's use it 21214 remark t2, 177 ;[266] Do NOT stomp the checked parity! 21215 003260'01 136 02 0 00 000013 idpb t2, p3 ; Append the single byte we got 21216 003261'01 271 14 0 00 000001 addi p4, ^d1 ; and count it 21217 003262'01 322 10 0 00 003267' ifn. q4 ; Doing EOF?? 21218 003263'01 312 02 0 00 000010 came t2, q4 ; We are. Is this the EOF? 21219 003264'01 254 00 0 00 003267' anskp. ; Isn't, so just carry on 21220 003265'01 474 10 0 00 000000 seto q4, ; Flag hit EOF 21221 003266'01 254 00 0 00 003346' exit. ; Exit the loop 21222 003267'01 endif. ; End case possible EOF checking 21223 003267'01 312 02 0 00 000012 came t2, p2 ; Was the character a carriage return? 21224 003270'01 254 00 0 00 003273' ifskp. ; It was, so check and return this line 21225 003271'01 474 15 0 00 000000 seto p5, ; Flag hit carriage return 21226 003272'01 254 00 0 00 003346' exit. ; Get out of the loop 21227 003273'01 endif. ; End case checking for carriage return K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53-1 K20IOC MAC 12-May-24 20:27 Get a carriage return terminated line of text 21228 003273'01 254 00 0 00 003306' else. ; Not, so a parity error 21229 003274'01 350 00 0 00 000605* aos ttipar ; Count a detected parity error 21230 003275'01 332 00 0 00 000000# ifme. paract ;[266] Is the parity action to abort? 21231 003276'01 254 00 0 00 003302' 21232 003277'01 200 01 0 00 000000# emsg 21233 003300'01 104 00 0 00 000313 21234 000305'02 000000000000# 21235 001502'04 102 141 144 040 160 21236 003301'01 263 17 0 00 000000 ret ; And give an error return 21237 003302'01 endif. ;[266] Otherwise, substitute and carry on 21238 003302'01 200 02 0 00 000000# move t2, parsub ;[266] Load Parity substitution character 21239 003303'01 405 02 0 00 000177 andi t2, 177 ;[266] Strip off parity; it's converted 21240 003304'01 136 02 0 00 000013 idpb t2, p3 ;[266] Append substituted character 21241 003305'01 271 14 0 00 000001 addi p4, ^d1 ;[266] we're going to use and count it 21242 003306'01 endif. ; End case checking parity 21243 003306'01 260 17 0 00 000505* call clrest ; Find out how much, if anything, remains 21244 003307'01 263 17 0 00 000000 ret ; Failed somehow, just give up 21245 003310'01 322 01 0 00 003241' jumpe t1, top. ; If nothing to read, go wait for something 21246 remark ; Otherwise, get the rest of the goodies 21247 003311'01 200 02 0 00 000001 move t2, t1 ; Save a working copy 21248 003312'01 270 02 0 00 000014 add t2, p4 ; Calculate what would be the final total 21249 003313'01 307 02 0 00 003776 caig t2, capmxl ; Would this read overflow the buffer? 21250 003314'01 254 00 0 00 003317' ifskp. ; It would, so clip down to maximum 21251 003315'01 275 02 0 00 003776 subi t2, capmxl ; Calculate the overflow 21252 003316'01 274 01 0 00 000002 sub t1, t2 ; And reduce the read by that amount 21253 003317'01 endif. ; End case buffer overflow check 21254 003317'01 200 11 0 00 000001 move p1, t1 ; Save final maximum 21255 003320'01 200 01 0 00 000007 move t1, q3 ; Load whatever transfer JFN we're using 21256 003321'01 200 02 0 00 000013 move t2, p3 ; Load current position in buffer 21257 003322'01 120 03 0 00 000011 dmove t3, p1 ; Load maximum we'll read and terminator 21258 003323'01 104 00 0 00 000052 SIN% ; And grab whatever else is waiting for us 21259 003324'01 320 12 0 00 003326' %jsErr (,r) ; Whine and return 21260 003325'01 254 00 0 00 003331' 21261 003326'01 265 01 0 00 003247* 21262 003327'01 000000000000# 21263 003330'01 254 00 0 00 003251* 21264 001513'04 105 162 162 157 162 21265 003331'01 200 13 0 00 000002 move p3, t2 ; Update current position in buffer 21266 003332'01 274 11 0 00 000003 sub p1, t3 ; Subtract negative to get total characters transferred 21267 003333'01 316 07 0 00 003252* camn q3, ttyjfn ; Not using the local terminal? 21268 003334'01 254 00 0 00 003341' ifskp. ; No, so updates some more variables 21269 003335'01 350 00 0 00 000521* aos nsici ; Update Network SIN%'s Issued 21270 003336'01 313 11 0 00 000517* camle p1, nsimx ; Smaller than biggest? 21271 003337'01 202 11 0 00 003336* movem p1, nsimx ; Nope, we have a new winner 21272 003340'01 272 11 0 00 000547* addm p1, nsitc ; Update Network SIN% total characters read 21273 003341'01 endif. ; End case network tally updates 21274 003341'01 270 14 0 00 000011 add p4, p1 ; Compute total characters in strbuf 21275 003342'01 135 01 0 00 000002 ldb t1, t2 ; Pick up the last eight bit character 21276 003343'01 312 01 0 00 000012 came t1, p2 ; Was it a carriage return?? 21277 003344'01 254 00 0 00 003241' loop. ; Wasn't, so go get some more data 21278 003345'01 474 15 0 00 000000 seto p5, ; Otherwise, it was, so flag and fall out of the loop 21279 003346'01 enddo. ; End loop lexical context 21280 21281 remark ; Check parity and repack the string 21282 003346'01 200 02 0 00 004626' move t2,[point 8,strbuf] ;Point to network input buffer K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53-2 K20IOC MAC 12-May-24 20:27 Get a carriage return terminated line of text 21283 003347'01 210 03 0 00 000014 movn t3, p4 ; Pretend doing a SOUT% 21284 remark ; If no parity, chkpar will return +2 21285 003350'01 260 17 0 00 004371' call chkpar ; Check the parity 21286 003351'01 254 00 0 00 003362' ifskp. ; Everything is fine, so convert to 7 bit 21287 003352'01 200 01 0 00 000014 move t1, p4 ; Source length is the total characters gotten 21288 003353'01 200 02 0 00 004626' move t2,[point 8,strbuf] ;Which comes from the network data 21289 003354'01 403 03 0 00 000006 setzb t3, q2 ; Pointers are section zero local 21290 003355'01 200 04 0 00 000014 move t4, p4 ; Output string is same length 21291 003356'01 200 05 0 00 004602' move q1,[point 7,strbuf] ;Destination is same with smaller byte size 21292 003357'01 123 01 0 00 002763* extend t1, movchr ; Repack the string in place (which is safe) 21293 003360'01 600 00 0 00 000000 nop ; Ignore any odd non-skip 21294 003361'01 254 00 0 00 003365' else. ; Otherwise, badness 21295 003362'01 200 01 0 00 000000# emsg 21296 003363'01 104 00 0 00 000313 21297 000306'02 000000000000# 21298 001522'04 102 141 144 040 160 21299 remark ttipar ;;chkpar counts detected parity errors 21300 003364'01 263 17 0 00 000000 ret ; And fail the call 21301 003365'01 endif. ; End parity check 21302 21303 003365'01 326 15 0 00 003372' ife. p5 ; If no CR, fix up the last pointer 21304 003366'01 474 02 0 00 000000 seto t2, ; movchr points PAST the last character 21305 003367'01 133 02 0 00 000005 adjbp t2, q1 ; So back up the 7 bit pointer by one 21306 003370'01 200 05 0 00 000002 move q1, t2 ; And pass that back 21307 003371'01 254 00 0 00 003375' else. ; Otherwise, we hit the carriage return!! 21308 003372'01 201 01 0 00 000012 movei t1, .chlfd ; So will need a line feed 21309 003373'01 136 01 0 00 000005 idpb t1, q1 ; Append it 21310 003374'01 271 14 0 00 000001 addi p4, ^d1 ; and acCOUNT for it (Boo...) 21311 003375'01 endif. ; End case carriage return fix up 21312 21313 003375'01 200 04 0 00 000015 move t4, p5 ; Pass back the carriage return flag 21314 003376'01 254 00 0 00 002270* retskp ; Return success 21315 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20IOC MAC 12-May-24 20:27 Check for and Overwrite EOF at the end of the string 21316 subttl Check for and Overwrite EOF at the end of the string 21317 21318 ; Assumes that the EOF is always within three characters of the last 21319 ; character, including that character. This is based on how the EOF 21320 ; logic sends the character in TRANSMIT and how the CAPTURE logic will 21321 ; append a linefeed to any carriage return it finds. In other words, 21322 ; the sequence we check for is . However, if we bump 21323 ; into the EOF before we've checked everything, that's fine, too. 21324 ; 21325 ; Call: 21326 ; 21327 ; q1/ Points to the last character in the seven bit stream 21328 ; q4/ EOF character with parity (if we're doing any parity) 21329 ; p3/ EOF character without parity (whether or not we're doing parity) 21330 ; p4/ Length of string we're just about to write 21331 ; 21332 ; Return: 21333 ; 21334 ; +1, always 21335 ; 21336 ; q1/ Unchanged, string will have EOF character stripped if q4 was -1 21337 ; q4/ Set to -1, if found the EOF character 21338 ; p3/ Unchanged 21339 ; p4/ Length will be less, depending on where we found the EOF 21340 ; 21341 ; All other registers are preserved 21342 ; 21343 ; N.B., EVERYTHING after the EOF is tossed, including the EOF!! 21344 21345 003377'01 322 13 0 00 003330* eofovr: jumpe p3, r ; If not checking EOF, we have nothing to do 21346 003400'01 323 14 0 00 003377* jumple p4, r ; Don't bother if funny length, either 21347 ; First do the trivial edge cases 21348 003401'01 325 10 0 00 003404' ifl. q4 ; So, did somebody else already flag this? 21349 003402'01 275 14 0 00 000001 subi p4, ^d1 ; They did, so don't write the EOF to the file 21350 003403'01 263 17 0 00 000000 ret ; After shortening length, we're done 21351 003404'01 endif. ; End trivial case of somebody already told us 21352 ; Next trivial case? Is it at the end? 21353 003404'01 135 01 0 00 000005 ldb t1, q1 ; Get the last character 21354 003405'01 312 01 0 00 000013 came t1, p3 ; EOF already? 21355 003406'01 254 00 0 00 003412' ifskp. ; That was easy, just reduce the length 21356 003407'01 474 10 0 00 000000 seto q4, ; Flag we hit EOF 21357 003410'01 275 14 0 00 000001 subi p4, ^d1 ; We're not writing EOF to the file 21358 003411'01 263 17 0 00 000000 ret ; and return; we're done 21359 003412'01 endif. ; End case checking last character 21360 ; Final trivial case, a single character string 21361 003412'01 306 14 0 00 000001 cain p4, ^d1 ; Just this one dinky character? 21362 003413'01 263 17 0 00 000000 ret ; Fine, we didn't hit the EOF ... 21363 ; Otherwise, this is about to get harder 21364 003414'01 265 16 0 00 004736' saveac 21365 003415'01 201 07 0 00 000003 movei q3, ^d3 ; Will assume sequence is 21366 003416'01 313 07 0 00 000014 camle q3, p4 ; BUT!! Do we have enough characters? 21367 003417'01 200 07 0 00 000014 move q3, p4 ; No, so clip it down to remaining 21368 003420'01 363 07 0 00 003400* sojle q3, R ; Account for character we just checked (in t1) 21369 ; Also double checks our arithmatic, above 21370 003421'01 474 06 0 00 000000 seto q2, ; Back up the pointer K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54-1 K20IOC MAC 12-May-24 20:27 Check for and Overwrite EOF at the end of the string 21371 003422'01 133 06 0 00 000005 adjbp q2, q1 ; Now pointing at penultimate character 21372 003423'01 135 02 0 00 000006 ldb t2, q2 ; and load that character 21373 003424'01 312 02 0 00 000013 came t2, p3 ; Hit the EOF? 21374 003425'01 254 00 0 00 003432' ifskp. ; We did 21375 003426'01 474 10 0 00 000000 seto q4, ; Flag we hit EOF 21376 003427'01 275 14 0 00 000002 subi p4, ^d2 ; We punted two characters from the string 21377 003430'01 263 17 0 00 000000 ret ; and return; we're done 21378 003431'01 254 00 0 00 003434' else. ; We didn't hit the EOF 21379 003432'01 306 07 0 00 000001 cain q3, ^d1 ; Was it a two character string, then? 21380 003433'01 263 17 0 00 000000 ret ; Then we're done, no EOF found 21381 003434'01 endif. ; End case checking penultimate character 21382 003434'01 363 07 0 00 003420* sojle q3, R ; Account for this second character we just checked 21383 ; Checking last character, so can reuse q3 21384 003435'01 474 07 0 00 000000 seto q3, ; Back up the pointer one more 21385 003436'01 133 07 0 00 000006 adjbp q3, q2 ; Now pointing at the antipenultimate character 21386 003437'01 135 03 0 00 000007 ldb t3, q3 ; and load that character 21387 003440'01 312 03 0 00 000013 came t3, p3 ; Hit the EOF finally?? 21388 003441'01 263 17 0 00 000000 ret ; Nope, so wasn't in this string 21389 003442'01 474 10 0 00 000000 seto q4, ; It's the EOF! So flag we found it 21390 003443'01 275 14 0 00 000003 subi p4, ^d3 ; Punting three characters from the string 21391 003444'01 263 17 0 00 000000 ret ; and return; we're done 21392 21393 ;[230] End code insertion 21394 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20IOC MAC 12-May-24 20:27 Translation table for MOVST to not uppercase 21395 subttl Translation table for MOVST to not uppercase 21396 21397 ;[209] Begin code and table insertion 21398 21399 ; Inspired by my rewrite of SETNOD, SETND2 (ND2SUB.MAC) 21400 21401 chgsec(code,const) ;;Put tables in the constants .psect 21402 21403 000002 %ascii=.chcnb ; ASCII values start at Control-B 21404 21405 remark Character table simply moves characters until a backslash is hit 21406 21407 000307'02 chrtab: intern chrtab ; Also used by k20par 21408 000307'02 100000 000001 xwd eoscod,.chcna ; NUL is end of string, ^A is allowed 21409 xlist ; Don't need to see all this junk 21410 list ; Restart the blather 21411 21412 000407' %eochr=. ; Remember end of table 21413 000365'02 reloc chrtab+<<"\">_-1> ; Gets us to the corrct halfword pair 21414 000365'02 500134 000135 xwd >,135 ;Stop on a backslash, emit a right brocket 21415 000407'02 reloc %eochr ; Get to end of table 21416 21417 100200 %ascii=eoscod!200!.chnul ; Anything we translate with bit 8 is bad 21418 xlist ; Don't need to see all this junk 21419 list ; Restart the blather 21420 21421 000607' %eotup=. ; Remember end of table 21422 000565'02 reloc chrtup+<<"\">_-1> ; Gets us to the corrct halfword pair 21423 000565'02 500134 000135 xwd >,135 ;Stop on a backslash, emit a right brocket 21424 000567'02 reloc chrtup+<<"`">_-1> ; Gets us to the corrct halfword pair 21425 000567'02 000140 000101 xwd "`","A" ; Convert lowercase a to UPPERcase A 21426 000102 %ascus="B" ; Starting at lowercase b 21427 xlist ; Don't need to see all this junk 21428 list ; Restart the blather 21429 000604'02 000132 000173 xwd "Z",173 ; Last letter and Left brace 21430 21431 000607'02 reloc %eotup ; Get to end of table 21432 21433 remark For eight bit data, everything stops us 21434 21435 100200 %ascus=eoscod!200!.chnul ; Anything we translate with bit 8 is bad 21436 xlist ; Don't need to see all this junk 21437 list ; Restart the blather 21438 retsec ; Re-open executable code 21439 21440 cleans(<%ascus,%eotup>) ; Don't polute the symbol table 21441 21442 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20IOC MAC 12-May-24 20:27 cescxp C Escape Expansion 21443 subttl cescxp C Escape Expansion 21444 21445 ; Given a source and destination pointer, copies the string from the 21446 ; source to the destination, triggering C escape expansion where 21447 ; appropriate. The source string MUST be NUL terminated 21448 ; 21449 ; If case is being ignored, then the string is UPPERcased as it is 21450 ; copied to facilitate later usage of string comparison instructions. 21451 ; 21452 ; Returns updated pointers and length. The destination buffer can 21453 ; never fill before the input buffer empties because any expansion 21454 ; involves converting two or more characters to a single character. 21455 ; 21456 21457 ; Parity MUST be stripped before calling this routine. Although it is 21458 ; commonly called with a 7 bit pointer, it will accept 8 bit pointers 21459 ; PROVIDED that the parity bit has been removed. It will FAIL if it 21460 ; detects a character with bit 8 set. 21461 ; 21462 ; Assumes section local pointers, do not use OWGP as the wrong 21463 ; thing will be returned. 21464 21465 003445'01 015 00 0 00 000000# chrmov: movst 0,chrtab ; Moves string without UPPERcasing 21466 003446'01 000000 000000 .chnul ; Fill character is end of string 21467 21468 003447'01 015 00 0 00 000000# chrmup: movst 0,chrtup ; Translate table to UPPERcase 21469 003450'01 000000 000000 .chnul ; Fill character is end of string 21470 21471 ; Call: 21472 ; 21473 ; t1/ Destination string pointer 21474 ; t2/ Source string pointer 21475 ; t3/ Maximum length of destination 21476 ; t4/ Translation table to use (whether matching case or not) 21477 ; 21478 ; Returns: 21479 ; 21480 ; +1/ Something bad happened or did nothing 21481 ; +2/ Good return 21482 ; 21483 ; t1/ Updated destination string pointer 21484 ; t2/ Updated source string pointer 21485 ; t3/ Length we translated 21486 21487 003451'01 cescxp: entry cescxp ; Also used by k20par 21488 003451'01 265 16 0 00 004754' saveac ;[248] Save registers for piggy MOVST 21489 003452'01 550 11 0 00 000004 hrrz p1, t4 ; Save requested table 21490 003453'01 505 11 0 00 015000 hrli p1, (movst 0,) ; Load correct extended instruction opcode 21491 003454'01 400 12 0 00 000000 setz p2, ; .chnul is the fill character 21492 003455'01 200 05 0 00 000001 move q1, t1 ; Position destination for MOVST 21493 003456'01 200 01 0 00 000003 move t1, t3 ; Set source length 21494 003457'01 200 04 0 00 000003 move t4, t3 ; Same as destination (so no fill) 21495 003460'01 200 07 0 00 000003 move q3, t3 ; Save (original) length for later 21496 003461'01 403 03 0 00 000006 setzb t3, q2 ; Force local pointers 21497 003462'01 400 13 0 00 000000 setz p3, ;[248] Count of characters munched K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57-1 K20IOC MAC 12-May-24 20:27 cescxp C Escape Expansion 21498 003463'01 621 01 0 00 300000 txz t1, N!M ; Clear translation flags 21499 21500 003464'01 do. ; Enter loop context 21501 003464'01 661 01 0 00 400000 txo t1,S ; Set significance flag (start translating) 21502 003465'01 123 01 0 00 000011 extend t1, p1 ; Move the string, testing for end and 21503 003466'01 320 12 0 00 003470' %jserr (, r) ; Pass any machine error back up 21504 003467'01 254 00 0 00 003473' 21505 003470'01 265 01 0 00 003326* 21506 003471'01 000000000000# 21507 003472'01 254 00 0 00 003434* 21508 001534'04 115 117 126 123 124 21509 003473'01 623 01 0 00 200000 txze t1, N ; Bumped into a backslash? 21510 003474'01 254 00 0 00 003501' ifskp. ; We did not and may not have exhausted source 21511 003475'01 621 01 0 00 700000 txz t1, S!N!M ; Clear all the flags 21512 003476'01 200 10 0 00 000002 move q4, t2 ; Keep stopping source pointer 21513 003477'01 322 01 0 00 003510' jumpe t1, endlp. ;[248] If source is exhausted, we're done 21514 003500'01 344 01 0 00 003510' aoja t1, endlp. ; Account that .chnul was not consumed 21515 003501'01 endif. ; and we are done with the string move 21516 003501'01 621 01 0 00 700000 txz t1, S!N!M ; Clear all the flags 21517 003502'01 323 01 0 00 003510' jumple t1, endlp. ;[248] Done if no more source 21518 003503'01 323 04 0 00 003510' jumple t4, endlp. ;[248] Done if no more destination 21519 003504'01 271 13 0 00 000001 addi p3, ^d1 ;[248] Account for a backslash skipped 21520 003505'01 260 17 0 00 003532' call escchr ; Otherwise, process an escape character 21521 003506'01 263 17 0 00 000000 ret ; Failed, just stop right now 21522 003507'01 327 01 0 00 003464' jumpg t1, top. ; Keep moving characters until no more 21523 003510'01 enddo. ; End loop context 21524 21525 remark t2, ; Still has source 21526 003510'01 200 03 0 00 000007 move t3, q3 ; Load original length 21527 003511'01 274 03 0 00 000013 sub t3, p3 ;[248] ; Calculate what we finally produced 21528 003512'01 200 04 0 00 000001 move t4, t1 ;[248] ; Save final source count: 21529 003513'01 200 01 0 00 000005 move t1, q1 ;[248] ; Restore updated destination BEFORE terminating it 21530 003514'01 136 06 0 00 000005 idpb q2, q1 ;[248] ; Tie off destination 21531 ; Stopped before the end of the string? 21532 003515'01 323 04 0 00 003526' ifg. t4 ;[248] ; Uh oh... Stopped early. What did that? 21533 003516'01 135 04 0 00 000010 ldb t4, q4 ; Load source character that stopped us 21534 003517'01 246 04 0 00 777777 lshc t4, ^d<-1> ; Divide by two, shifting odd bit into bit zero 21535 003520'01 242 05 0 00 777735 lsh q1, ^d<-35> ; Shift into bit zero 21536 xct [ hlrz q2,chrtab(t4) ; Even, pick up left half 21537 003521'01 256 00 0 05 004772' hrrz q2,chrtab(t4) ](q1) ; Even, pick up right half 21538 003522'01 626 06 0 00 100000 txzn q2, eoscod ; Had to be an end of string 21539 003523'01 254 00 0 00 003526' anskp. ; But wasn't, so we're done 21540 003524'01 622 06 0 00 000200 txze q2, 200 ; Any parity? 21541 003525'01 263 17 0 00 000000 ret ; Yes, so that's bad; return +1 21542 003526'01 endif. ; End eigth bit checking 21543 003526'01 323 03 0 00 003472* jumple t3, R ; Nothing to do if nothing read 21544 003527'01 254 00 0 00 003376* retskp ; Return +2 21545 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20IOC MAC 12-May-24 20:27 Escape table for escape character substitution 21546 subttl Escape table for escape character substitution 21547 21548 ; The translate table assumes that exactly a SINGLE character is to be 21549 ; translated, unless a number is being given. The logic coupled with 21550 ; it is as follows: 21551 ; 21552 ; 1) If the character count is zero, then a single character 21553 ; substitution was possible and we are done. 21554 ; 21555 ; 2) Any character that does not have a valid escape mapping will 21556 ; terminate with the N bit set (note TRMCOD opcode). 21557 ; 21558 ; 3) Any character that requires further processing will terminate 21559 ; processing (EOSCOD), but the count will not be zero. These 21560 ; characters are currenly upper and lower X and decimal digits. 21561 21562 chgsec(code,const) ;;Put table in the constants .psect 21563 21564 000000 %escha=0 ; Starts out at .CHNUL 21565 21566 000707'02 esctab: remark ; Appropriately trigger on escape values 21567 xlist ; Don't need to see all this junk 21568 list ; Restart the blather 21569 21570 001007' %eoesc=. ; Remember end of table 21571 21572 000737'02 reloc esctab+<<"0">_-1> ; Gets us to the correct halfword pair 21573 xlist ; Save the trees!!! 21574 list ; Restart the blather 21575 21576 define escsub(chr1,sub1,chr2,sub2) < 21577 reloc esctab+<<&177>_-1> ;;Gets us to the correct halfword pair 21578 xwd sub1,sub2 ;;Emit the appropriate pair 21579 >;;escsub 21580 21581 000736'02 000056 500057 escsub(".",<".">,"/",) ;;Tops-10 monitor prompt 21582 000747'02 000100 000007 escsub("@",<"@">,"A",.chbel) ;;I kept fat fingering \@ ... 21583 000750'02 000010 000003 escsub("B",.chbsp,"C",.chcnc) 21584 000751'02 000004 000033 escsub("D",.chcnd,"E",.chesc) 21585 000752'02 000014 500107 escsub("F",.chffd,"G",); 21586 21587 000756'02 000012 000177 escsub("N",.chlfd,"O",.chdel) ;;[246] Obliterate 21588 000757'02 500120 000042 escsub("P",,"Q",.chdbq) 21589 000760'02 000015 500123 escsub("R",.chcrt,"S",) 21590 000761'02 000011 000000 escsub("T",.chtab,"U",.chnul) ;;[246] NUL 21591 000762'02 000013 500127 escsub("V",.chvtb,"W",) 21592 000764'02 000032 500133 escsub("Z",.chcnz,"[",) ;;Left brocket 21593 21594 000767'02 500140 000007 escsub("`",,"a",.chbel) 21595 000770'02 000010 000003 escsub("b",.chbsp,"c",.chcnc) 21596 000771'02 000004 000033 escsub("d",.chcnd,"e",.chesc) 21597 000772'02 000014 500147 escsub("f",.chffd,"g",); 21598 21599 000776'02 000012 000177 escsub("n",.chlfd,"o",.chdel) ;;[246] Obliterate 21600 000777'02 500160 000042 escsub("p",,"q",.chdbq) K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58-1 K20IOC MAC 12-May-24 20:27 Escape table for escape character substitution 21601 001000'02 000015 500163 escsub("r",.chcrt,"s",) 21602 001001'02 000011 000000 escsub("t",.chtab,"u",.chnul) ;;[246] NUL 21603 001002'02 000013 500167 escsub("v",.chvtb,"w",) 21604 001004'02 000032 500173 escsub("z",.chcnz,173,) ;;Left curly brace 21605 21606 000730'02 000042 500043 escsub(.chdbq,.chdbq,"#",) ;;Double quote 21607 000732'02 500046 000047 escsub("&",,"'","'") 21608 000746'02 500076 000077 escsub(76,,"?","?") ;;Left pointy bracket 21609 000765'02 000134 500135 escsub("\","\","]",) ;;Right broket 21610 21611 001007'02 reloc %eoesc ; Get to back to end of table 21612 retsec ;;Re-open executable code 21613 21614 cleans(<%escha,%eoesc>) ;;Don't polute the symbol table 21615 21616 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20IOC MAC 12-May-24 20:27 Handle escape character substitution and expansion 21617 subttl Handle escape character substitution and expansion 21618 21619 ; See esctab commentary above for this routine's logic summary. In 21620 ; this routine's case, the MOVST is not being used for the efficiency 21621 ; of moving a string but rather for the 'relative' ease of using a 21622 ; table driven approach. However, this would still probably be more 21623 ; efficient than a worst case skip chain. 21624 ; 21625 ; Call: 21626 ; 21627 ; t1/ Remaining bytes in source string 21628 ; t2/ Section local pointer to source 21629 ; t3/ 0 (and must be zero) 21630 ; t4/ Remaining bytes in destination string 21631 ; q1/ Section local pointer to destination 21632 ; q2/ 0 (and must be zero) 21633 ; p3/ Count of characters skipped in source (like backslash and octal digits) ;[248] 21634 ; 21635 ; Return: 21636 ; 21637 ; +1/ Failed somehow 21638 ; +2/ Escape character substituted or expanded 21639 ; 21640 ; t1 through q2 updates as appropriate. 21641 ; p3 updated if doing something like a \002 ;[248] 21642 ; 21643 ; Be aware of the following: 21644 ; 21645 ; While the routine is fairly defensively coded, it makes an 21646 ; assumption that the destination string is always at least as long as 21647 ; the source. If this is the case, then the destination storage space 21648 ; can NEVER be overflowed because the minimal substitution will remove 21649 ; two characters from the source while depositing a single character 21650 ; in the destination. 21651 21652 003530'01 015 00 0 00 000000# escmov: movst 0,esctab ; Actual extend instruction being executed 21653 003531'01 000000 000000 .chnul ; Fill character is end of string (never used) 21654 21655 003532'01 escchr: entry escchr ; Used in k20par 21656 003532'01 265 16 0 00 004570' saveac ;[248] Extend needs SO many registers... 21657 003533'01 621 01 0 00 700000 txz t1, N!M!S ; Stomp flags so math and EXTEND work 21658 003534'01 337 07 0 00 000001 skipg q3, t1 ; Save and check remaining source count 21659 003535'01 334 00 0 00 000000 %ermsg (,r) 21660 003536'01 254 00 0 00 003542' 21661 003537'01 265 01 0 00 003470* 21662 003540'01 000000000000# 21663 003541'01 254 00 0 00 003526* 21664 001537'04 105 163 143 141 160 21665 003542'01 200 10 0 00 000004 move q4, t4 ; Save current remaining destination count 21666 21667 003543'01 200 01 0 00 004774' move t1,[S!<^d1>] ; Only looking at a SINGLE character of source 21668 003544'01 201 04 0 00 000001 movei t4,^d1 ; Destination will be always be one character 21669 003545'01 123 01 0 00 003530' extend t1, escmov ; Try to expand the escape 21670 003546'01 320 12 0 00 003550' %jserr (, r) ; Pass any machine error back up 21671 003547'01 254 00 0 00 003553' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59-1 K20IOC MAC 12-May-24 20:27 Handle escape character substitution and expansion 21672 003550'01 265 01 0 00 003537* 21673 003551'01 000000000000# 21674 003552'01 254 00 0 00 003541* 21675 001550'04 105 163 143 141 160 21676 21677 003553'01 607 01 0 00 200000 ifxn. t1, N ; Invalid escape character?? 21678 003554'01 254 00 0 00 003565' 21679 003555'01 200 01 0 00 000000# emsg 21680 003556'01 104 00 0 00 000313 21681 001007'02 000000000000# 21682 001554'04 111 154 154 145 147 21683 003557'01 135 01 0 00 000002 ldb t1, t2 ; Pick up what didn't work 21684 003560'01 104 00 0 00 000074 PBOUT% ; Show us 21685 003561'01 561 01 0 00 003072* hrroi t1, crlf ; Load end of line 21686 003562'01 104 00 0 00 000076 PSOUT% ; Print it 21687 003563'01 263 17 0 00 000000 ret ; Return failure 21688 003564'01 254 00 0 00 003567' else. ;[248] ; Otherwise, valid translation 21689 003565'01 621 01 0 00 700000 txz t1, N!M!S ;[248] ; Stomp flags so math works 21690 003566'01 200 11 0 00 000001 move p1, t1 ;[248] ; Save source count 21691 003567'01 endif. ;[248] ; End case handling an invalid escape character 21692 21693 003567'01 326 04 0 00 003605' ife. t4 ; Was this a simple substitution? 21694 003570'01 375 01 0 00 000007 sosge t1, q3 ; Yes, account for source byte consumed 21695 003571'01 334 00 0 00 000000 %ermsg (,r) 21696 003572'01 254 00 0 00 003576' 21697 003573'01 265 01 0 00 003550* 21698 003574'01 000000000000# 21699 003575'01 254 00 0 00 003552* 21700 001562'04 105 163 143 141 160 21701 003576'01 375 04 0 00 000010 sosge t4, q4 ; Account for destination byte consumed 21702 003577'01 334 00 0 00 000000 %ermsg (,r) 21703 003600'01 254 00 0 00 003604' 21704 003601'01 265 01 0 00 003573* 21705 003602'01 000000000000# 21706 003603'01 254 00 0 00 003575* 21707 001573'04 105 163 143 141 160 21708 003604'01 254 00 0 00 003527* retskp ; Return success 21709 003605'01 endif. 21710 21711 remark ; Here if we hit a digit 0 through 9 21712 003605'01 200 01 0 00 000007 move t1, q3 ; Original remaining source bytes is fine 21713 003606'01 200 11 0 00 000007 move p1, q3 ;[248] ; Save for later calculations 21714 003607'01 474 03 0 00 000000 seto t3, ; But must back up the source pointer 21715 003610'01 133 03 0 00 000002 adjbp t3, t2 ; because it did not translate the byte 21716 003611'01 200 02 0 00 000003 move t2, t3 ; Overwrite current 21717 003612'01 400 03 0 00 000000 setz t3, ; Keep source pointer section local 21718 003613'01 200 04 0 00 000010 move t4, q4 ; Restore original remaining destination bytes 21719 003614'01 260 17 0 00 003641' call cvtoct ; Convert ASCII octal digits to binary 21720 003615'01 263 17 0 00 000000 ret ; Pass the error up 21721 003616'01 274 11 0 00 000001 sub p1, t1 ;[248] ; Calculate digits consumed 21722 003617'01 270 13 0 00 000011 add p3, p1 ;[248] ; Add those into running total 21723 ; Range check result 21724 003620'01 303 03 0 00 000177 caile t3, .chdel ; It's not too big, is it? 21725 003621'01 334 00 0 00 000000 %ermsg (,r) 21726 003622'01 254 00 0 00 003626' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59-2 K20IOC MAC 12-May-24 20:27 Handle escape character substitution and expansion 21727 003623'01 265 01 0 00 003601* 21728 003624'01 000000000000# 21729 003625'01 254 00 0 00 003603* 21730 001605'04 123 160 145 143 151 21731 003626'01 136 03 0 00 000005 idpb t3, q1 ; Deposit in output buffer 21732 003627'01 400 03 0 00 000000 setz t3, ; Keep source string section local 21733 003630'01 375 00 0 00 000004 sosge t4 ; Account for destination byte consumed 21734 003631'01 334 00 0 00 000000 %ermsg (,r) 21735 003632'01 254 00 0 00 003636' 21736 003633'01 265 01 0 00 003623* 21737 003634'01 000000000000# 21738 003635'01 254 00 0 00 003625* 21739 001616'04 105 163 143 141 160 21740 003636'01 254 00 0 00 003604* retskp ; Worked! 21741 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 60 K20IOC MAC 12-May-24 20:27 ASCII Octal to Binary Octal Conversion table 21742 subttl ASCII Octal to Binary Octal Conversion table 21743 21744 chgsec(code,const) ;;Put the table in the constants .psect 21745 21746 000000 %octal=0 ; ASCII values start at .chnul 21747 21748 001010'02 octtab: xlist ; Save the trees!!! 21749 list ; Safe to look now, phew!!!! 21750 21751 001110' %eooct==. ; Remember the end of octal table 21752 21753 001040'02 reloc octtab+<<"0">_-1> ; Gets us to the corrct halfword pair 21754 000000 %octal=0 ; Starting octal digit VALUE 21755 21756 repeat ^d4,< ; Only doing 4 pairs of digits 0 through 7 21757 xwd %octal,%octal+1 ; Emit the octal value for the ASCII digit 21758 %octal==%octal+2 ;;Step to next character pair 21759 > 21760 001040'02 000000 000001 21761 001041'02 000002 000003 21762 001042'02 000004 000005 21763 001043'02 000006 000007 21764 21765 remark 8,9 ;;Fail on decimal digits!!!! 21766 001044'02 500070 500071 xwd trmcod!<"8">,trmcod!<"9"> 21767 21768 001110'02 reloc %eooct ; Get back to the end of octtab table 21769 retsec ;;Restore code psect 21770 cleans(<%octal,%eooct>) ;;Don't polute the symbol table 21771 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61 K20IOC MAC 12-May-24 20:27 Octal Conversion 21772 subttl Octal Conversion 21773 21774 ; The purpose of the function is to bum a NIN%. This done for two 21775 ; reasons: 21776 ; 21777 ; 1) It's faster (no JSYS overhead) 21778 ; 2) It keeps counters straight. 21779 ; 21780 ; Done only in the context of a previous movst (see escchr, 21781 ; above), so has an odd register file to contend with. 21782 ; 21783 ; Although a 36 bit word will hold twelve 3 bit octal digits, we limit 21784 ; it to eleven digits so we don't wind up having to deal with any 21785 ; goofy numbers that look negative. 21786 ; 21787 ; However, the limit here is 12. This allows us to determine the 21788 ; difference between a number that is too long and a character that 21789 ; terminated the translation. 21790 ; 21791 ; The conversion code is trivial, we don't even use a cvtdbo (which is 21792 ; the wrong base, anyway), but rather take a seven bit ASCII digit, 21793 ; subtract ASCII zero ("0") from it and then deposit it in a register. 21794 ; This is all done with a single MOVST. 21795 ; 21796 ; Upon termination, that binary octal number is left-normalized and 21797 ; need merely be right-normalized with a lshc. 21798 ; 21799 ; Call: 21800 ; 21801 ; t1/ Remaining bytes in source string 21802 ; t2/ Section local pointer to source 21803 ; t3/ 0 (and must be zero) 21804 ; t4/ Remaining bytes in destination string 21805 ; q1/ Section local pointer to destination 21806 ; q2/ 0 (and must be zero) 21807 ; 21808 ; Return: 21809 ; 21810 ; +1 Some kind of failure 21811 ; +2 21812 ; t1/ Updated with bytes consumed 21813 ; t2/ Updated pointer past digits consumed 21814 ; t3/ Binary form of octal number 21815 ; t4/ Preserved 21816 ; q1/ Preserved 21817 ; q2/ Preserved 21818 ; q3/ Preserved 21819 ; q4/ Preserved 21820 ; 21821 ; N.B., Caller *MUST* rezero t3!!! 21822 21823 003637'01 015 00 0 00 000000# octmov: movst 0,octtab ; Actual extend instruction being executed 21824 003640'01 000000 000000 .chnul ; Fill character is end of string (never used) 21825 21826 003641'01 265 16 0 00 004775' cvtoct: saveac ; Preserve what we'll stomp K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61-1 K20IOC MAC 12-May-24 20:27 Octal Conversion 21827 003642'01 621 01 0 00 300000 txz t1, N!M ; Clear the number flags 21828 003643'01 200 10 0 00 000001 move q4, t1 ;[259] ; Make a copy 21829 003644'01 303 10 0 00 000014 caile q4, ^d12 ;[259] ; Do not allow over a 36 bit number 21830 003645'01 201 10 0 00 000014 movei q4, ^d12 ;[259] ; Clamp to 36 bits 21831 003646'01 661 01 0 00 400000 txo t1, S ; Start translating immediately 21832 003647'01 200 04 0 00 000010 move t4, q4 ;[259] ; Load maximum destination length 21833 003650'01 200 05 0 00 005011' move q1, [point 3, q3 ] ; N.B., 3 bit bytes!! 21834 003651'01 403 03 0 00 000006 setzb t3, q2 ;[248] ; Maintain section local pointers 21835 003652'01 400 07 0 00 000000 setz q3, ; Give the destination a clean slate 21836 003653'01 123 01 0 00 003637' extend t1, octmov ; Convert Octal digits 21837 003654'01 320 12 0 00 003656' %jserr (,r) 21838 003655'01 254 00 0 00 003661' 21839 003656'01 265 01 0 00 003633* 21840 003657'01 000000000000# 21841 003660'01 254 00 0 00 003635* 21842 001627'04 106 141 151 154 145 21843 21844 003661'01 607 01 0 00 200000 ifxn. t1, N ; Invalid digit?? 21845 003662'01 254 00 0 00 003672' 21846 003663'01 200 01 0 00 000000# emsg 21847 003664'01 104 00 0 00 000313 21848 001110'02 000000000000# 21849 001636'04 111 154 154 145 147 21850 003665'01 135 01 0 00 000002 ldb t1, t2 ; Pick up what didn't work 21851 003666'01 104 00 0 00 000074 PBOUT% ; Show us 21852 003667'01 561 01 0 00 003561* hrroi t1, crlf ; Load end of line 21853 003670'01 104 00 0 00 000076 PSOUT% ; Print it 21854 003671'01 263 17 0 00 000000 ret ; Return failure 21855 003672'01 endif. 21856 21857 003672'01 327 04 0 00 003702' ifle. t4 ; Exhausted destination string? 21858 003673'01 621 01 0 00 700000 txz t1, N!M!S ;[259] Shut off the flags 21859 003674'01 322 01 0 00 003702' ifn. t1 ;[259] Error is only valid if remaining string 21860 003675'01 334 00 0 00 000000 %ermsg (,r) 21861 003676'01 254 00 0 00 003702' 21862 003677'01 265 01 0 00 003656* 21863 003700'01 000000000000# 21864 003701'01 254 00 0 00 003660* 21865 001646'04 123 160 145 143 151 21866 003702'01 endif. 21867 003702'01 endif. 21868 21869 003702'01 250 04 0 00 000007 exch t4, q3 ; Position left-justified result in adjacent AC 21870 003703'01 200 06 0 00 000010 move q2, q4 ; Load original (slightly bogus) limit 21871 003704'01 274 06 0 00 000007 sub q2, q3 ; Calculate log base 8 of final number (heh) 21872 003705'01 325 06 0 00 003713' ifl. q2 ; Complete gubbish? 21873 003706'01 334 00 0 00 000000 %ermsg (,r) 21874 003707'01 254 00 0 00 003713' 21875 003710'01 265 01 0 00 003677* 21876 003711'01 000000000000# 21877 003712'01 254 00 0 00 003701* 21878 001661'04 117 143 164 141 154 21879 003713'01 endif. 21880 003713'01 326 06 0 00 003721' ife. q2 ; Never did anything?? 21881 003714'01 334 00 0 00 000000 %ermsg (,r) K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61-2 K20IOC MAC 12-May-24 20:27 Octal Conversion 21882 003715'01 254 00 0 00 003721' 21883 003716'01 265 01 0 00 003710* 21884 003717'01 000000000000# 21885 003720'01 254 00 0 00 003712* 21886 001671'04 117 143 164 141 154 21887 003721'01 endif. ; Very puzzling 21888 21889 003721'01 221 06 0 00 000003 imuli q2, ^d3 ; Three bits per octal digit 21890 003722'01 246 03 0 06 000000 lshc t3, (q2) ; Shift the bits into the right place 21891 21892 003723'01 621 01 0 00 700000 txz t1, S!N!M ; Clear the flags some more 21893 003724'01 271 01 0 00 000001 addi t1,^d1 ; Account for character we stopped on 21894 003725'01 474 06 0 00 000000 seto q2, ; But are now at, so back up the point 21895 003726'01 133 06 0 00 000002 adjbp q2, t2 ; so that an ildb works and the consequent 21896 003727'01 250 06 0 00 000002 exch q2, t2 ; Say this is the real pointer 21897 003730'01 254 00 0 00 003636* retskp ; And return with the correct register file 21898 21899 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62 K20IOC MAC 12-May-24 20:27 Translation table for first character to search for 21900 subttl Translation table for first character to search for 21901 21902 ; Translate tables cannot be in extended text (non-zero section) 21903 ; because we need to use them to transfer a few characters for match 21904 ; purposes. 21905 ; 21906 ; N.B., a NUL character stops the search, but does NOT set the 'N' 21907 ; bit! ntrigr has to account for this because data that comes back 21908 ; from Tops-10 can have NUL's in it. Might be padding. 21909 21910 chgsec(code,const) ;;Put table in constants area 21911 21912 000002 %asc1c==.chcnb ; ASCII values proceed from Control-B 21913 21914 remark Base translate table passes all 7 bit data 21915 21916 001111'02 100000 000001 btrnst: xwd eoscod!.chnul,.chcna ;;NUL terminates 21917 xlist ; Don't need to see all this junk 21918 list ; Restart the blather 21919 21920 remark For eight bit data, everything stops us 21921 21922 100200 %asc1c=eoscod!200!.chnul ; Anything we translate with bit 8 is bad 21923 21924 xlist ; Don't need to see all this junk 21925 list ; Restart the blather 21926 000200 sertln==.-btrnst ; Calculate search table length 21927 ; After second pass, not needed at all 21928 cleans(<%asc1c>) ;;Don't polute the symbol table 21929 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63 K20IOC MAC 12-May-24 20:27 Caseless Translation table for first character to search for 21930 subttl Caseless Translation table for first character to search for 21931 21932 ; N.B., a NUL character stops the search, but does NOT set the 'N' 21933 ; bit! ntrigr has to account for this because data that comes back 21934 ; from Tops-10 can have NUL's in it. 21935 21936 000002 %asc1u=.chcnb ; ASCII values start at Control-B 21937 21938 remark Base translate table passes all 7 bit data, uppercasing along the way 21939 21940 001311'02 100000 000001 btrnsu: xwd eoscod!.chnul,.chcna ;;NUL terminates 21941 xlist ; Don't need to see all this junk 21942 list ; Restart the blather 21943 21944 001411' %eotsu=. ; Remember end of table 21945 21946 001371'02 reloc btrnsu+<<"`">_-1> ; Gets us to the corrct halfword pair 21947 001371'02 000140 000101 xwd "`","A" ; Convert lowercase a to UPPERcase A 21948 21949 000102 %asc1u="B" ; Starting at lowercase b 21950 xlist ; Don't need to see all this junk 21951 list ; Restart the blather 21952 21953 001406'02 000132 000173 xwd "Z",173 ; Last letter and Left brace 21954 21955 001411'02 reloc %eotsu ; Get back to end of table 21956 21957 remark For eight bit data, everything stops us 21958 21959 100200 %asc1u==eoscod!200!.chnul ; Anything we translate with bit 8 is bad 21960 .xcref %asc1u ; Keep off cross reference 21961 21962 xlist ; Don't need to see all this junk 21963 list ; Restart the blather 21964 21965 cleans(<%asc1u,%eotsu>) ;;Punt working symbols 21966 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 64 K20IOC MAC 12-May-24 20:27 Macro to build a parity generating and checking tables 21967 subttl Macro to build a parity generating and checking tables 21968 21969 ; Inspired by PARBIT remote macro in TTYSRV (see CHITAB). buildp is 21970 ; a more generalized approach to handle both checking and generating 21971 ; any kind of a parity table, suitable for string instructions. 21972 ; 21973 ; To generate various parities: 21974 ; 21975 ; Mark buildp(200,200) ;;Sets both odd and even, always 21976 ; Space buildp(0,0) ;;N.B., can be optimized with movslj for 7 bit 21977 ; Even buildp(200,0) ;;Only emit even parity bit 21978 ; Odd buildp(0,200) ;;Only emit odd parity bit 21979 ; 21980 ; To double check the table, set the parity you want and run a timing test 21981 21982 define buildp(evn,odp) < ;;Builds a parity table 21983 xlist ;; Save us the blat, please ... 21984 odp!.chnul,,evn!.chcna ;; 0 ^@,, 1 ^A NULL,, 21985 evn!.chcnb,,odp!.chcnc ;; 2 ^B,, 3 ^C 21986 evn!.chcnd,,odp!.chcne ;; 4 ^D,, 5 ^E 21987 odp!.chcnf,,evn!.chbel ;; 6 ^F,, 7 ^G ,,Bell 21988 evn!.chbsp,,odp!.chtab ;; 10 ^H,, 11 ^I Backspace,,Tab 21989 odp!.chlfd,,evn!.chvtb ;; 12 ^J,, 13 ^K Line-Feed,,Vertical Tab 21990 odp!.chffd,,evn!.chcrt ;; 14 ^L,, 15 ^M Form Feed,,Carriage Return 21991 evn!.chcnn,,odp!.chcno ;; 16 ^N,, 17 ^O 21992 evn!.chcnp,,odp!.chcnq ;; 20 ^P,, 21 ^Q 21993 odp!.chcnr,,evn!.chcns ;; 22 ^R,, 23 ^S 21994 odp!.chcnt,,evn!.chcnu ;; 24 ^T,, 25 ^U 21995 evn!.chcnv,,odp!.chcnw ;; 26 ^V,, 27 ^W 21996 odp!.chcnx,,evn!.chcny ;; 30 ^X,, 31 ^Y 21997 evn!.chcnz,,odp!.chesc ;; 32 ^Z,, 33 ^[ ,,Escape Control 21998 evn!.chcbs,,odp!.chcrb ;; 34 ^\,, 35 ^] Control Backslash,,Right Bracket 21999 odp!.chccf,,evn!.chcun ;; 36 ^^,, 37 ^_ Control Cicumflex,,Underline 22000 evn!.chspc,,odp!"!" ;; 40 ,, 41 ! Space,, 22001 odp!.chdbq,,evn!"#" ;; 42 " ,, 43 # Double quote,, 22002 odp!"$",,evn!"%" ;; 44 $ ,, 45 % 22003 evn!"&",,odp!"'" ;; 46 & ,, 47 ' 22004 odp!"(",,evn!")" ;; 50 ( ,, 51 ) 22005 evn!"*",,odp!"+" ;; 52 * ,, 53 + 22006 evn!",",,odp!"-" ;; 54 , ,, 55 - Comma,,Dash (Minus Sign) 22007 odp!".",,evn!"/" ;; 56 . ,, 57 / Dot,,Forward Slash 22008 odp!"0",,evn!"1" ;; 60 0 ,, 61 1 22009 evn!"2",,odp!"3" ;; 62 2 ,, 63 3 22010 evn!"4",,odp!"5" ;; 64 4 ,, 65 5 22011 odp!"6",,evn!"7" ;; 66 6 ,, 67 7 22012 evn!"8",,odp!"9" ;; 70 8 ,, 71 9 22013 odp!":",,evn!";" ;; 72 : ,, 73 ; Colen,, Semicolen 22014 odp!.chlpt,,evn!"=" ;; 74 ,, 75 = Left pointy,, 22015 evn!.chrpt,,odp!"?" ;; 76 ,, 77 ? Right pointy,, 22016 evn!"@",,odp!"A" ;; 100 @ ,,101 A 22017 odp!"B",,evn!"C" ;; 102 B ,,103 C 22018 odp!"D",,evn!"E" ;; 104 D ,,105 E 22019 evn!"F",,odp!"G" ;; 106 F ,,107 G 22020 odp!"H",,evn!"I" ;; 110 H ,,111 I 22021 evn!"J",,odp!"K" ;; 112 J ,,113 K K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 64-1 K20IOC MAC 12-May-24 20:27 Macro to build a parity generating and checking tables 22022 evn!"L",,odp!"M" ;; 114 L ,,115 M 22023 odp!"N",,evn!"O" ;; 116 N ,,117 O 22024 odp!"P",,evn!"Q" ;; 120 P ,,121 Q 22025 evn!"R",,odp!"S" ;; 122 R ,,123 S 22026 evn!"T",,odp!"U" ;; 124 T ,,125 U 22027 odp!"V",,evn!"W" ;; 126 V ,,127 W 22028 evn!"X",,odp!"Y" ;; 130 X ,,131 Y 22029 odp!"Z",,evn!"[" ;; 132 Z ,,133 [ ,,Open Broket 22030 odp!"\",,evn!"]" ;; 134 \ ,,135 ] Backslash,,Close Broket 22031 evn!"^",,odp!"_" ;; 136 ^ ,,137 _ Up arrow,,Underline 22032 odp!"`",,evn!"a" ;; 140 ` ,,141 a Backtic (accent grave) 22033 evn!"b",,odp!"c" ;; 142 b ,,143 c 22034 evn!"d",,odp!"e" ;; 144 d ,,145 e 22035 odp!"f",,evn!"g" ;; 146 f ,,147 g 22036 evn!"h",,odp!"i" ;; 150 h ,,151 i 22037 odp!"j",,evn!"k" ;; 152 j ,,153 k 22038 odp!"l",,evn!"m" ;; 154 l ,,155 m 22039 evn!"n",,odp!"o" ;; 156 n ,,157 o 22040 evn!"p",,odp!"q" ;; 160 p ,,161 q 22041 odp!"r",,evn!"s" ;; 162 r ,,163 s 22042 odp!"t",,evn!"u" ;; 164 t ,,165 u 22043 evn!"v",,odp!"w" ;; 166 v ,,167 w 22044 odp!"x",,evn!"y" ;; 170 x ,,171 y 22045 evn!"z",,odp!"{" ;; 172 z ,,173 { Open Curly Brace 22046 evn!"|",,odp!"}" ;; 174 | ,,175 } Vertical Bar,,Close Curley Brace 22047 odp!"~",,evn!.chdel ;; 176 ~ ,,177 $? HZ2000 Lead in (!),,Rubout 22048 list ;; Turn the blat back on 22049 >;;buildp 22050 22051 define badpar (b,%b,%c) < ;;Generates a table with bad parity 22052 ifb ,<%b=0> ;;If no bit specified, default to zero 22053 ifnb ,<%b=b> ;;Otherwise, use the bit 22054 %c=trmcod!%b!.chnul ;;Starts out with NUL character, which fails 22055 xlist ; Don't need to see all this junk 22056 repeat ^d<<128>_-1>,< ;;Fill table with one to one translations 22057 xwd %c,%c+1 ;;Properly fill half words, failing every single one 22058 %c=%c+2 ;;Step to next pair 22059 >;;repeat ^d64 ;;Do remaining 126 characters 22060 list ; Restart the blather 22061 cleans(<%b,%c>) ;;Punt working symbols 22062 > 22063 22064 ;[209] End code insertion 22065 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65 K20IOC MAC 12-May-24 20:27 String based parity generating and checking tables 22066 subttl String based parity generating and checking tables 22067 22068 ;[223] Begin table insertions (still in const .psect) 22069 22070 remark Seven to Eight bit parity generating tables 22071 22072 ; N.B., as with single character routines, bit 8 is disregarded 22073 ; when generating parity 22074 22075 001511'02 spar7t: buildp(0,0) ; Space parity simply always clears bit 8 22076 buildp(0,0) ; Clear it for anything with bit 8 up 22077 001711'02 mpar7t: buildp(200,200) ; Mark parity simply always sets bit 8 22078 buildp(200,200) ; Set it for anthing with bit 8 up 22079 002111'02 epar7t: buildp(200,0) ; Build even parity generating table 22080 buildp(200,0) ; Ignore bit 8 and process as if it were zero 22081 002311'02 opar7t: buildp(0,200) ; Build odd parity generating table 22082 buildp(0,200) ; Ignore bit 8 and process as if it were zero 22083 22084 subttl Eight to Seven bit parity checking tables 22085 22086 002511'02 spar8t: buildp(0,0) ; For space, the 1st 128 do not have bit 8 set, so fine 22087 badpar(200) ; However, any with bit 8 up are BAD 22088 002711'02 mpar8t: badpar(0) ; For mark, the 1st 128 do not have bit 8 set, so BAD 22089 buildp(0,0) ; 2nd 128 have bit 8 up, so fine; strip off the parity 22090 003111'02 epar8t: buildp(trmcod,0) ; Anything with even parity should NOT be in lower 128 22091 buildp(0,trmcod) ; Otherwise, odd parity should not be in upper 128 22092 003311'02 opar8t: buildp(0,trmcod) ; Any odd parity set should not be in lower 128 22093 buildp(trmcod,0) ; Likewise, even parity should not be in upper 128 22094 22095 retsec ; Back into code .psect 22096 22097 ;[223] End table insertions 22098 22099 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66 K20IOC MAC 12-May-24 20:27 Parity routines, used for a single byte and checking 22100 subttl Parity routines, used for a single byte and checking 22101 22102 ; All accept a character in t1, returning the same character with proper 22103 ; parity in t1. +1 always because nothing fails. Supposedly... 22104 22105 003731'01 none: remark ; Default, don't touch the eighth bit. 22106 entry none 22107 003731'01 263 17 0 00 000000 ret 22108 22109 003732'01 mark: remark ; Mark, bit 8 is always 1. 22110 entry mark 22111 003732'01 435 01 0 00 000200 ori t1, ^o200 ; Turn on the parity bit. 22112 003733'01 263 17 0 00 000000 ret 22113 22114 003734'01 space: remark ; Space, opposite of mark, bit 8 is always zero. 22115 entry space 22116 003734'01 405 01 0 00 000177 andi t1, ^o177 ; Turn off the parity bit. 22117 003735'01 263 17 0 00 000000 ret 22118 22119 003736'01 even: remark ; Even, the total number of one bits should be even. 22120 entry even 22121 003736'01 265 16 0 00 005012' saveac 22122 003737'01 405 01 0 00 000177 andi t1, ^o177 ; Start off with bit 8 = 0. 22123 003740'01 200 02 0 00 000001 move t2, t1 22124 003741'01 254 00 0 00 003745' jrst evnodd 22125 22126 003742'01 odd: remark ; Odd, the total number of one bits should be odd. 22127 entry odd 22128 003742'01 265 16 0 00 005012' saveac 22129 003743'01 405 01 0 00 000177 andi t1, ^o177 ; Turn off the parity bit. 22130 003744'01 201 02 0 01 000200 movei t2, ^o200(t1) ; Start off with bit 8 = 1. 22131 22132 003745'01 evnodd: remark ; The actual worker subroutine 22133 003745'01 242 02 0 00 777774 lsh t2, -4 ; Get high order 4 bits of character 22134 003746'01 431 02 0 01 000000 xori t2, (t1) ; Fold into 4 bits. 22135 003747'01 642 02 0 00 000014 trce t2, 14 ; Left two bits both 0 or 1? 22136 003750'01 606 02 0 00 000014 trnn t2, 14 ; or both 1? 22137 003751'01 431 01 0 00 000200 xori t1, 200 ; Yes, set parity 22138 003752'01 642 02 0 00 000003 trce t2, 3 ; Right two bits both 0? 22139 003753'01 606 02 0 00 000003 trnn t2, 3 ; or both 1? 22140 003754'01 431 01 0 00 000200 xori t1, 200 ; Yes, set parity. 22141 003755'01 263 17 0 00 000000 ret 22142 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67 K20IOC MAC 12-May-24 20:27 Set Parity /substitution (character) tables 22143 subttl Set Parity /substitution (character) tables 22144 22145 ;[258] Begin Table Insertion, all [258] 22146 22147 define sschrs (c) < ;;Define macro to populate a single character table 22148 xlist ;;Don't need to see this in the listing 22149 irpc c,< ;;Go through all the characters 22150 %key2 <'c>,<"'c"> ;;Emit character and its ASCII equivalent 22151 >;;irpc ;;End of argument expansion 22152 list ;;Turn the listing back on 22153 >;;eschrs ;;End of macro definition 22154 22155 remark this is all maybe kind of glitzy, but looks nice on a "?" 22156 22157 003511'02 000000 000000 %table(subupl) ;;Upper case letter table 22158 sschrs (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;;UPPERCASE letters!! 22159 003511'02 000032 000032 %tbend ;;End of upper case table 22160 22161 003544'02 000000 000000 %table(sublol) ;;Lower case letter table 22162 sschrs (abcdefghijklmnopqrstuvwxyz) ;;lowercase letters 22163 003544'02 000032 000032 %tbend ;;End of lower case letter table 22164 22165 003577'02 000000 000000 %table(subdig) ;;Digit table 22166 sschrs (0123456789) ;;Digits 22167 003577'02 000012 000012 %tbend ;;End of lower case letter table 22168 22169 extern esctkn ; Control character table in K20PAR 22170 22171 003612'02 000000 000000 %table(subcla) ;;Preliminary character classes 22172 003613'02 000000# 000000* %key2 , esctkn ;;Parsing hairy control table 22173 000154'03 143 157 156 164 162 22174 003614'02 000000# 003641' %key2 , digfdb ;;ASCII digit 22175 000160'03 144 145 143 151 155 22176 003615'02 000000# 003660' %key2 , grmfdb ;;Other odds and ends 22177 000163'03 147 162 141 155 155 22178 003616'02 000000# 003644' %key2 , lolfdb ;;lowercase ASCII letters 22179 000167'03 154 157 167 145 162 22180 003617'02 000000# 003647' %key2 , uppfdb ;;Uppercase ASCII letters 22181 000173'03 125 120 120 105 122 22182 003612'02 000005 000005 %tbend ;;end of preliminary character 22183 22184 003620'02 000000 000000 %table(gsntab) ;;Grammatical symbol name table 22185 003621'02 000000# 000054 %key2 , "," ;;Breaks Kermit's macro expansion 22186 000177'03 143 157 155 155 141 22187 003622'02 000000# 003624' %keyf3 , %dele, ;;Keep dash hidden 22188 000201'03 002000 000005 22189 000202'03 144 000 000 000 000 22190 003623'02 000000# 000055 %keyf3 , .chdas, cm%inv ;;Common slang for hyphen 22191 000203'03 002000 000001 22192 000204'03 144 141 163 150 000 22193 003624'02 000000# 000177 %dele:! %key2 , .chdel ;;'Official' name 22194 000205'03 144 145 154 145 164 22195 003625'02 000000# 003627' %keyf3 , %excl, ;;Escape shows American idiom 22196 000207'03 002000 000005 22197 000210'03 145 000 000 000 000 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-1 K20IOC MAC 12-May-24 20:27 Set Parity /substitution (character) tables 22198 003626'02 000000# 000041 %keyf3 , "!", cm%inv ;;British idiom 22199 000211'03 002000 000001 22200 000212'03 145 170 143 154 141 22201 003627'02 000000# 000041 %excl:! %key2 , "!" ;;COMND% swallows as comment character 22202 000216'03 145 170 143 154 141 22203 003630'02 000000# 003632' %keyf3 , %hyph, ;;Keep horizontal tab good and invisible 22204 000222'03 002000 000005 22205 000223'03 150 000 000 000 000 22206 003631'02 000000# 000011 %keyf3 , .chtab, cm%inv ;;ASCII idiom 22207 000224'03 002000 000001 22208 000225'03 150 157 162 151 172 22209 003632'02 000000# 000055 %hyph:! %key2 , .chhyp ;;COMND% swallows as line continuation 22210 000230'03 150 171 160 150 145 22211 003633'02 000000# 000077 %key2 , "?" ;;COMND% uses to display alternatives 22212 000232'03 161 165 145 163 164 22213 003634'02 000000# 000177 %keyf3 , .chdel, cm%inv ;;Common alternative name for delete 22214 000235'03 002000 000001 22215 000236'03 162 165 142 157 165 22216 003635'02 000000# 000073 %key2 , .chsem ;;COMND% swallows as comment character 22217 000240'03 163 145 155 151 143 22218 003636'02 000000# 000040 %key2 , .chspc ;;COMND% chews white space and tabs 22219 000242'03 163 160 141 143 145 22220 003637'02 000000# 000011 %key2 , .chtab ;;Here just in case forgot Control-I 22221 000244'03 164 141 142 000 000 22222 003620'02 000017 000017 %tbend ;;End of named symbols 22223 22224 .xcref %dele, %excl, %hyph ;;Keep symbols off cross reference 22225 suppress %dele, %excl, %hyph ;; and off the symbol table listing 22226 if2 < purge %dele, %excl, %hyph > ;;Not needed after pass two 22227 22228 chgsec(code,const) ;;FDB's are not in code, they're in const 22229 22230 22231 define pchupa ; Up arrow 22232 003640'02 136 000 00000000 tchupa:! byte (7) .chupa,.chnul ; Done this way so we can reuse it 22233 22234 003641'02 000004 000000 digfdb: flddb. .cmkey,,subdig,,, 22235 003642'02 000000 003577' 22236 003643'02 44 07 0 00 004321' 22237 003644'02 000004 000000 lolfdb: flddb. .cmkey,,sublol,,, 22238 003645'02 000000 003544' 22239 003646'02 44 07 0 00 004324' 22240 003647'02 000004 000000 uppfdb: flddb. .cmkey,,subupl,,, 22241 003650'02 000000 003511' 22242 003651'02 44 07 0 00 004331' 22243 22244 remark Tokens that MACRO can choke on 22245 22246 define pchdbq ; double quote 22247 003652'02 042 000 00000000 tchdbq:! byte (7) .chdbq,.chnul ; token macro uses this 22248 22249 define pchsnq ; single quote 22250 003653'02 047 000 00000000 tchsnq:! byte (7) .chsnq,.chnul ; MACRO uses this as a paste character 22251 22252 define pchlpa ; Left parenthesis K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-2 K20IOC MAC 12-May-24 20:27 Set Parity /substitution (character) tables 22253 003654'02 050 000 00000000 tchlpa:! byte (7) .chlpa,.chnul ; MACRO gets confused with swap half words 22254 22255 define pchrpa ; Right parenthesis 22256 003655'02 051 000 00000000 tchrpa:! byte (7) .chrpa,.chnul ; MACRO gets confused with arguments closure 22257 22258 define pchlpt ; Left pointy bracket 22259 003656'02 074 000 00000000 tchlpt:! byte (7) .chlpt,.chnul ; MACRO gets confused with arguments list open 22260 22261 define pchrpt ; Right pointy bracket 22262 003657'02 076 000 00000000 tchrpt:! byte (7) .chrpt,.chnul ; MACRO gets confused with arguments list closure 22263 22264 remark Our gigantic token table, pheh... 22265 22266 003660'02 000000 003662' grmfdb: flddb. .cmkey,,gsntab,,,gtkT ;;First, keywords for what COMND% can't do 22267 003661'02 000000 003620' 22268 22269 remark And then the tokens, COMND% tested to handle all of the below 22270 22271 003662'02 gtkT:! intern gtkT ;[258] Replaces q01 through q30 in K20PAR 22272 003662'02 023005 003665' flddb. .cmtok,cm%sdh,pchdbq,,,gtk0 22273 003663'02 44 07 0 00 003652' 22274 003664'02 44 07 0 00 004336' 22275 003665'02 023004 003670' gtk0:! flddb. .cmtok,,token(<#>),,,gtk1 22276 003666'02 440700 004347' 22277 003667'02 44 07 0 00 004350' 22278 003670'02 023004 003673' gtk1:! flddb. .cmtok,,token(<$>),,,gtk2 22279 003671'02 440700 004263' 22280 003672'02 44 07 0 00 004357' 22281 003673'02 023004 003676' gtk2:! flddb. .cmtok,,token(<%>),,,gtk3 22282 003674'02 440700 004366' 22283 003675'02 44 07 0 00 004367' 22284 003676'02 023004 003701' gtk3:! flddb. .cmtok,,token(<&>),,,gtk4 22285 003677'02 440700 004376' 22286 003700'02 44 07 0 00 004377' 22287 003701'02 023004 003704' gtk4:! flddb. .cmtok,,pchsnq,,,gtk5 22288 003702'02 44 07 0 00 003653' 22289 003703'02 44 07 0 00 004405' 22290 003704'02 023004 003707' gtk5:! flddb. .cmtok,,pchlpa,,,gtk6 22291 003705'02 44 07 0 00 003654' 22292 003706'02 44 07 0 00 004412' 22293 003707'02 023004 003712' gtk6:! flddb. .cmtok,,pchrpa,,,gtk7 22294 003710'02 44 07 0 00 003655' 22295 003711'02 44 07 0 00 004422' 22296 003712'02 023004 003715' gtk7:! flddb. .cmtok,,token(<*>),,,gtk8 22297 003713'02 440700 004432' 22298 003714'02 44 07 0 00 004433' 22299 003715'02 023004 003720' gtk8:! flddb. .cmtok,,token(<+>),,,gtk9 22300 003716'02 440700 004441' 22301 003717'02 44 07 0 00 004442' 22302 003720'02 023004 003723' gtk9:! flddb. .cmtok,,token(<.>),,,gtkA 22303 003721'02 440700 004451' 22304 003722'02 44 07 0 00 004452' 22305 003723'02 023004 003726' gtkA:! flddb. .cmtok,,token(),,,gtkB 22306 003724'02 440700 004460' 22307 003725'02 44 07 0 00 004461' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-3 K20IOC MAC 12-May-24 20:27 Set Parity /substitution (character) tables 22308 003726'02 023004 003731' gtkB:! flddb. .cmtok,,token(<:>),,,gtkC 22309 003727'02 440700 004470' 22310 003730'02 44 07 0 00 004471' 22311 003731'02 023004 003734' gtkC:! flddb. .cmtok,,pchlpt,,,gtkD 22312 003732'02 44 07 0 00 003656' 22313 003733'02 44 07 0 00 004476' 22314 003734'02 023004 003737' gtkD:! flddb. .cmtok,,token(<=>),,,gtkE 22315 003735'02 440700 004506' 22316 003736'02 44 07 0 00 004507' 22317 003737'02 023004 003742' gtkE:! flddb. .cmtok,,pchrpt,,,gtkF 22318 003740'02 44 07 0 00 003657' 22319 003741'02 44 07 0 00 004516' 22320 003742'02 023004 003745' gtkF:! flddb. .cmtok,,token(<@>),,,gtkG 22321 003743'02 440700 004526' 22322 003744'02 44 07 0 00 004527' 22323 003745'02 023004 003750' gtkG:! flddb. .cmtok,,token(<[>),,,gtkH 22324 003746'02 440700 004537' 22325 003747'02 44 07 0 00 004540' 22326 003750'02 023004 003753' gtkH:! flddb. .cmtok,,token(<\>),,,gtkI 22327 003751'02 440700 004547' 22328 003752'02 44 07 0 00 004550' 22329 003753'02 023004 003756' gtkI:! flddb. .cmtok,,token(<]>),,,gtkJ 22330 003754'02 440700 004556' 22331 003755'02 44 07 0 00 004557' 22332 003756'02 023004 003761' gtkJ:! flddb. .cmtok,,pchupa,,,gtkK 22333 003757'02 44 07 0 00 003640' 22334 003760'02 44 07 0 00 004566' 22335 003761'02 023004 003764' gtkK:! flddb. .cmtok,,token(<_>),,,gtkL 22336 003762'02 440700 004574' 22337 003763'02 44 07 0 00 004575' 22338 003764'02 023004 003767' gtkL:! flddb. .cmtok,,token(<`>),,,gtkM 22339 003765'02 440700 004604' 22340 003766'02 44 07 0 00 004605' 22341 003767'02 023004 003772' gtkM:! flddb. .cmtok,,token(<{>),,,gtkN 22342 003770'02 440700 004613' 22343 003771'02 44 07 0 00 004614' 22344 003772'02 023004 003775' gtkN:! flddb. .cmtok,,token(<|>),,,gtkO 22345 003773'02 440700 004622' 22346 003774'02 44 07 0 00 004623' 22347 003775'02 023004 004000' gtkO:! flddb. .cmtok,,token(<}>),,,gtkP 22348 003776'02 440700 004632' 22349 003777'02 44 07 0 00 004633' 22350 004000'02 023004 000000 gtkP:! flddb. .cmtok,,token(<~>),,, 22351 004001'02 440700 004642' 22352 004002'02 44 07 0 00 004643' 22353 22354 ;;Keep silly symbols off the cross reference and symbol table listings 22355 22356 tokcln(,<.xcref>,<123456789ABCDEFGHIJKLMN>) 22357 tokcln(,,<123456789ABCDEFGHIJKLMN>) 22358 if2 < remark ;;Don't need at all after second pass 22359 tokcln(,,<123456789ABCDEFGHIJKLMN>) 22360 >;if2 22361 22362 remark /SUBSTITUTE switch's Top-level parse table K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-4 K20IOC MAC 12-May-24 20:27 Set Parity /substitution (character) tables 22363 22364 004003'02 021006 004007' subfdb: flddb. .cmqst,,,,<"~">,subfd0 22365 004004'02 000000 000000 22366 004005'02 44 07 0 00 004653' 22367 004006'02 44 07 0 00 004662' 22368 004007'02 023004 004012' subfd0: flddb. .cmtok,,pchupa,,,subfd1 22369 004010'02 44 07 0 00 003640' 22370 004011'02 44 07 0 00 004663' 22371 004012'02 000004 004015' subfd1: flddb. .cmkey,,subdig,,,subfd2 22372 004013'02 000000 003577' 22373 004014'02 44 07 0 00 004673' 22374 004015'02 000004 004020' subfd2: flddb. .cmkey,,subupl,,,subfd3 22375 004016'02 000000 003511' 22376 004017'02 44 07 0 00 004702' 22377 004020'02 000004 004023' subfd3: flddb. .cmkey,,subcla,,,subfd4 22378 004021'02 000000 003612' 22379 004022'02 44 07 0 00 004713' 22380 004023'02 000004 003662' subfd4: flddb. .cmkey,,gsntab,,,gtkT 22381 004024'02 000000 003620' 22382 004025'02 44 07 0 00 004722' 22383 22384 22385 define clnc (b,c) < ;;Clean up a bunch of symbols by character 22386 remark 'b is the base, 'c is the character suffix 22387 irpc c,< 22388 .xcref 'b'c ;;Don't want symbol in cross reference 22389 .noddt 'b'c ;;Don't need symbol in DDT 22390 suppress 'b'c ;;Don't want symbol in symbol table listing 22391 if2 < purge 'b'c > ;;After second pass, don't need symbol at all 22392 >;;irpc 22393 >;;clnc 22394 clnc (subfd,<01234>) ;;Clean up working symbols 22395 22396 remark ; Other constants 22397 22398 004026'02 44 07 0 00 000000* atmbps: point 7, atmbuf ; Atom buffer pointers, never modified 22399 004027'02 44 07 0 00 004026* point 7, atmbuf ; Used to overwrite in place 22400 22401 retsec ;;Back to where-ever we started from 22402 22403 ;[258] End Table Insertion 22404 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68 K20IOC MAC 12-May-24 20:27 SET PARITY character substition parsing 22405 subttl SET PARITY character substition parsing 22406 22407 ;[258] Begin Code Insertion 22408 22409 260740 subcal==<<(call 0,0)>&<0,,-1>> ; Keep XWD from choking 22410 22411 003756'01 265 16 0 00 005020' subchr: saveac ; Just in case anybody is paying attention 22412 dmove t1, [ subfdb ; Load address of our initial absurdity 22413 003757'01 120 01 0 00 005032' cm%xif ] ; Load the no indirection flag 22414 003760'01 436 02 0 00 000000# orm t2, sbk+.cmflg ; And dink the COMND% state block 22415 003761'01 260 17 0 00 001606* call rflde ; Try to get one of them 22416 003762'01 254 00 0 00 003767' ifskp. ; Worked!! 22417 003763'01 205 04 0 00 002000 movx t4, cm%xif ; Load indirection flag again 22418 003764'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ; And restore the COMND% state block 22419 003765'01 135 04 0 00 004466' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 22420 003766'01 254 00 0 00 003772' else. ; Otherwise, failed the parse 22421 003767'01 205 04 0 00 002000 movx t4, cm%xif ; Load indirection flag again 22422 003770'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ; and restore the COMND% state block 22423 003771'01 263 17 0 00 000000 ret ; Hand error off to unsuspecting caller ... 22424 003772'01 endif. ; End handling COMND% returns 22425 22426 003772'01 302 04 0 00 000021 caie t4, .cmqst ; Quoted the character? 22427 003773'01 254 00 0 00 004020' ifskp. ; Yep, try to do something useful 22428 003774'01 120 01 0 00 000000# dmove t1, atmbps ; Load atom buffer pointers 22429 003775'01 260 17 0 00 001453* call asczcp ; Move the string on top of itself, returning count 22430 003776'01 363 03 0 00 003720* sojle t3, R ; Don't count the trailing NUL, ignore empty string 22431 003777'01 120 01 0 00 000000# dmove t1, atmbps ; Load atom buffer pointers again 22432 remark t3, ; Will be expanding (I.E., shrinking) in place 22433 004000'01 201 04 0 00 000000# movei t4, chrtab ; Not doing upper casing 22434 004001'01 260 17 0 00 003451' call cescxp ; Expand any C-escape-sequences 22435 004002'01 334 00 0 00 000000 %ermsg (,r) ; Failed?? 22436 004003'01 254 00 0 00 004007' 22437 004004'01 265 01 0 00 003716* 22438 004005'01 000000000000# 22439 004006'01 254 00 0 00 003776* 22440 001702'04 163 165 142 163 164 22441 004007'01 327 03 0 00 004015' ifle. t3 ; Might be shorter, but not empty 22442 004010'01 334 00 0 00 000000 %ermsg (,r) ; Failed?? 22443 004011'01 254 00 0 00 004015' 22444 004012'01 265 01 0 00 004004* 22445 004013'01 000000000000# 22446 004014'01 254 00 0 00 004006* 22447 001713'04 163 165 142 163 164 22448 004015'01 endif. ; End post c-expansion sanity check 22449 004015'01 135 01 0 00 005034' ldb t1,[point 7, atmbuf, 6] ; Pick up first character in atom buffer 22450 004016'01 202 01 0 00 002740* movem t1, pars7 ; Store for semantic action 22451 004017'01 263 17 0 00 000000 ret ; Done with this case 22452 004020'01 endif. ; End case .cmqst (quoted string) 22453 22454 004020'01 302 04 0 00 000023 caie t4, .cmtok ; Did we type a token? 22455 004021'01 254 00 0 00 004033' ifskp. ; Yes, maybe do a tiny hack to convert into a keyword 22456 004022'01 621 03 0 00 777777 tlz t3, -1 ; Isolate fdb we actually used 22457 004023'01 200 02 0 03 000001 move t2, .cmdat(t3) ; Pick up the byte pointer to the character 22458 004024'01 134 01 0 00 000002 ildb t1, t2 ; Load the token character (there will be only one) 22459 004025'01 306 01 0 00 000136 cain t1, "^" ; Wasn't control character caret? K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-1 K20IOC MAC 12-May-24 20:27 SET PARITY character substition parsing 22460 004026'01 254 00 0 00 004031' ifskp. ; No, it was the actual character; nothing else to parse 22461 004027'01 202 01 0 00 004016* movem t1, pars7 ; Hand the character off to semantic action 22462 004030'01 263 17 0 00 000000 ret ; Done 22463 004031'01 endif. ; Otherwise, turn it into a keyword and parse some more 22464 004031'01 201 04 0 00 000000 movei t4, .cmkey ; Poof! You're a keyword 22465 004032'01 201 02 0 00 005035' movei t2, [esctkn] ; Address of fdb for control characters 22466 004033'01 endif. ; End case uparrow transmorgrification 22467 22468 004033'01 302 04 0 00 000000 caie t4, .cmkey ; A keyword? 22469 004034'01 254 00 0 00 004064' ifskp. ; That's easy enough, even if this part is prolix 22470 004035'01 550 01 0 02 000000 hrrz t1, (t2) ; Load the next fdb to parse 22471 004036'01 201 02 0 00 000177 movei t2, 177 ; Set up a character detection mask 22472 004037'01 410 02 0 00 000001 andca t2, t1 ; Whack those 22473 004040'01 326 02 0 00 004043' ife. t2 ; Was the parsed item not an address? 22474 004041'01 202 01 0 00 004027* movem t1, pars7 ; Wasn't, so hand the character off semantic action 22475 004042'01 263 17 0 00 000000 ret ; Done! 22476 004043'01 endif. ; End of block skip return processing 22477 004043'01 205 02 0 00 002000 movx t2, cm%xif ; Load the no indirection flag (.cmtok of @) 22478 004044'01 436 02 0 00 000000# orm t2, sbk+.cmflg ; And dink the COMND% state block 22479 004045'01 260 17 0 00 003761* call rflde ; Try to get one of secondary items 22480 004046'01 254 00 0 00 004053' ifskp. ; Worked!! 22481 004047'01 205 04 0 00 002000 movx t4, cm%xif ; Load indirection flag again 22482 004050'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ; And restore the COMND% state block 22483 004051'01 135 04 0 00 004466' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 22484 004052'01 254 00 0 00 004056' else. ; Otherwise, failed the parse 22485 004053'01 205 04 0 00 002000 movx t4, cm%xif ; Load indirection flag again 22486 004054'01 412 04 0 00 000000# andcam t4, sbk+.cmflg ; And restore the COMND% state block 22487 004055'01 263 17 0 00 000000 ret ; Hand error off to unsuspecting caller ... 22488 004056'01 endif. ; End handling COMND% returns 22489 004056'01 135 04 0 00 004466' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get what was parsed 22490 004057'01 302 04 0 00 000000 caie t4, .cmkey ; A keyword? 22491 004060'01 254 00 0 00 004064' anskp. ; No, handle that as unchained 22492 004061'01 550 01 0 02 000000 hrrz t1, (t2) ; Load the corresponding character 22493 004062'01 202 01 0 00 004041* movem t1, pars7 ; Hand off to semantic action 22494 004063'01 263 17 0 00 000000 ret ; Done 22495 004064'01 endif. ; End case .cmkey 22496 22497 004064'01 302 04 0 00 000023 caie t4, .cmtok ; Some kind of token? 22498 004065'01 254 00 0 00 004073' ifskp. ; Yes, we can just pick that right up 22499 004066'01 621 03 0 00 777777 tlz t3, -1 ; Isolate fdb we actually used 22500 004067'01 200 02 0 03 000001 move t2, .cmdat(t3) ; Pick up the byte pointer to the character 22501 004070'01 134 01 0 00 000002 ildb t1, t2 ; Load the token character (there will be only one) 22502 004071'01 202 01 0 00 004062* movem t1, pars7 ; Hand off to semantic action 22503 004072'01 263 17 0 00 000000 ret ; Done 22504 004073'01 endif. ; End case .cmtok 22505 22506 remark ; If none of the above, then a table error 22507 004073'01 200 01 0 00 000000# emsg ; Begin whining 22508 004074'01 104 00 0 00 000313 22509 004030'02 000000000000# 22510 001723'04 111 156 166 141 154 22511 004075'01 201 01 0 00 000101 movei t1, .priou ; Still going to terminal 22512 004076'01 200 02 0 00 000004 move t2, t4 ; Load the bad parse value 22513 004077'01 201 03 0 00 000010 movei t3, ^d8 ; It will be octal 22514 004100'01 104 00 0 00 000224 NOUT% ; Type it K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-2 K20IOC MAC 12-May-24 20:27 SET PARITY character substition parsing 22515 004101'01 320 12 0 00 004102' erjmpr .+1 ; Catch and ignore error 22516 004102'01 561 01 0 00 003667* hrroi t1, crlf ; Tie off 22517 004103'01 104 00 0 00 000076 PSOUT% ; the line 22518 004104'01 263 17 0 00 000000 ret ; Return failure and go no further 22519 22520 ;[258] End Code Insertion 22521 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69 K20IOC MAC 12-May-24 20:27 SET PARITY parsing tables 22522 subttl SET PARITY parsing tables 22523 22524 ;[223] This code moved from k20par and updated 22525 22526 004031'02 000000 000000 %table(partab) ;[223] Values are all table offsets, below 22527 004032'02 000000# 000003 %key2 , .parev ;[223] 22528 000245'03 145 166 145 156 000 22529 004033'02 000000# 000002 %key2 , .parmk ;[223] 22530 000246'03 155 141 162 153 000 22531 004034'02 000000# 000000 %key2 , .parno ;[223] 22532 000247'03 156 157 156 145 000 22533 004035'02 000000# 004036' %keyf3 , %odd, ;[223] Abbreviate documented name 22534 000250'03 002000 000005 22535 000251'03 157 000 000 000 000 22536 004036'02 000000# 000004 %odd:! %key2 , .parod ;[223] 22537 000252'03 157 144 144 000 000 22538 004037'02 000000# 000002 %keyf3 , .parmk, cm%inv ;[223] A common nickname for 'mark' 22539 000253'03 002000 000001 22540 000254'03 157 156 145 000 000 22541 004040'02 000000# 000001 %key2 , .parsp ;[223] 22542 000255'03 163 160 141 143 145 22543 004041'02 000000# 000001 %keyf3 , .parsp, cm%inv ;[223] A common nickname for 'space' 22544 000257'03 002000 000001 22545 000260'03 172 145 162 157 000 22546 004031'02 000010 000010 %tbend 22547 22548 .xcref %odd ;[223] Keep symbol off cross reference 22549 suppress %odd ;[223] and off the symbol table listing 22550 if2 < purge %odd > ;[223] Not needed after pass 2 22551 22552 ;[223] Begin Switch table insertion 22553 22554 comment " The plethora of invisible entries are a result of my being 22555 purely unable to come up with what I thought would be a good 22556 keyword, picking something to get on with it, becoming 22557 dissatisified or otherwise annoyed with that particular 22558 choice and then trying something else until things finally 22559 'looked right', both in a printed switch list and in the 22560 help text. Of course, then I would remember the old names 22561 and ... 22562 " 22563 22564 ; Define some mnemonic symbols to help us not to be confused... 22565 22566 define %Yes <;;> ;;There should only be four (4) documented entries 22567 000001 %No==cm%inv ;;Means not documented in k20hlp.mac 22568 22569 remark Parse variables usage usage is all part of 258 rework 22570 22571 remark Parse Variable Comment 22572 ; ====== ===== ======== ================ 22573 remark pars3 Parity Offset into the single character table (schrpr) 22574 remark pars4 parpko Set if doing parity on packets, only 22575 remark pars5 parrck Set if checking parity on recieve in addition to sending 22576 remark pars6 paract Action on bad parity, 0 = abort, non-0, count & proceed K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69-1 K20IOC MAC 12-May-24 20:27 SET PARITY parsing tables 22577 remark pars7 parsub Character to substitute when NOT aborting 22578 remark pars8 ttipar Count of parity errors detected 22579 22580 remark ; These are the parity switches 22581 22582 004042'02 000000 000000 %table(parswi) 22583 remark Switch Name Instruction Variable Documented? 22584 004043'02 000000# 000000# %key3 (, <(setzm 0,0)>, pars6) 22585 000261'03 141 142 157 162 164 22586 000265'03 402000 000000* 22587 %Yes ;;[258] 22588 004044'02 000000# 000000# %keyf4 (, <(setzm 0,0)>, pars4, %No ) 22589 000266'03 002000 000001 22590 000267'03 141 154 154 055 143 22591 000272'03 402000 000000* 22592 004045'02 000000# 000000# %key3 (, <(setom 0,0)>, pars5) 22593 000273'03 143 150 145 143 153 22594 000277'03 476000 000000* 22595 %Yes 22596 004046'02 000000# 000000# %key3 (, <(setom 0,0)>, pars6) 22597 000300'03 143 157 165 156 164 22598 000304'03 476000 000265* 22599 %Yes ;;[258] 22600 004047'02 000000# 000000# %keyf4 (, <(setzm 0,0)>, pars4, %No ) 22601 000305'03 002000 000001 22602 000306'03 145 166 145 162 171 22603 000311'03 402000 000272* 22604 004050'02 000000# 000000# %key3 (, <(setzm 0,0)>, pars5) 22605 000312'03 147 145 156 145 162 22606 000315'03 402000 000277* 22607 %Yes 22608 004051'02 000000# 000000# %key3 (, <(setom 0,0)>, pars4) 22609 000316'03 160 141 143 153 145 22610 000321'03 476000 000311* 22611 %Yes 22612 004052'02 000000# 000000# %keyf4 (, <(setom 0,0)>, pars5, %No ) 22613 000322'03 002000 000001 22614 000323'03 160 141 162 151 164 22615 000327'03 476000 000315* 22616 004053'02 000000# 000000# %keyf4 (, <(setom 0,0)>, pars6, %No ) ;;[258] 22617 000330'03 002000 000001 22618 000331'03 160 162 157 143 145 22619 000333'03 476000 000304* 22620 004054'02 000000# 004057' %keyf3 , %rese, ;;Prefer visible reset-error-count 22621 000334'03 002000 000005 22622 000335'03 162 000 000 000 000 22623 004055'02 000000# 004057' %keyf3 , %rese, ;;over INVISIBLE receive-check 22624 000336'03 002000 000005 22625 000337'03 162 145 000 000 000 22626 004056'02 000000# 000000# %keyf4 (, <(setom 0,0)>, pars5, %No ) 22627 000340'03 002000 000001 22628 000341'03 162 145 143 145 151 22629 000344'03 476000 000327* 22630 004057'02 000000# 000000# %rese:! %key3 (, <(setzm 0,0)>, pars8) 22631 000345'03 162 145 163 145 164 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69-2 K20IOC MAC 12-May-24 20:27 SET PARITY parsing tables 22632 000351'03 402000 000000* 22633 %Yes 22634 004060'02 000000# 000000# %key3 (,, subchr) 22635 000352'03 163 165 142 163 164 22636 000357'03 260740 000000# 22637 %Yes ;;[258] 22638 004061'02 000000# 000000# %key3 (, <(setzm 0,0)>, pars4) 22639 000360'03 164 145 162 155 151 22640 000365'03 402000 000321* 22641 %Yes 22642 004042'02 000017 000017 %tbend 22643 22644 cleans(<%Yes,%No,%rese>) ;;Clean up worker symbols 22645 22646 ;[223] End switch table insertion 22647 22648 chgsec(code,const) ;;[223] FDB's are not in code, they're in const 22649 22650 004062'02 schrpr: remark ;[223] Single character parity routines 22651 004062'02 000000000000# none ;[223] Don't do parity 22652 004063'02 000000000000# space ;[223] Bit 8 is always clear 22653 004064'02 000000000000# mark ;[223] Bit 8 is always set 22654 004065'02 000000000000# even ;[223] Even parity 22655 004066'02 000000000000# odd ;[223] Odd parity 22656 22657 004067'02 stpart: intern stpart ;[223] String based parity tables 22658 004067'02 000 00 0 00 000000 Z ;[223] None means do nothing 22659 004070'02 001511' 002511' spar7t,,spar8t ;[223] Space parity generating and checking 22660 004071'02 001711' 002711' mpar7t,,mpar8t ;[223] Mark parity generating and checking 22661 004072'02 002111' 003111' epar7t,,epar8t ;[223] Even parity generating and checking 22662 004073'02 002311' 003311' opar7t,,opar8t ;[223] Odd parity generating and checking 22663 22664 004074'02 010004 004077' spafdb: flddb. .cmcfm,,,,,spafdd 22665 004075'02 000000 000000 22666 004076'02 44 07 0 00 004733' 22667 004077'02 000000 004104' spafdd: flddb. .cmkey,,partab,,,spwfdd ;;[260] If in a define 22668 004100'02 000000 004031' 22669 22670 004101'02 010004 004104' spwfdb: flddb. .cmcfm,,,,,spwfdd 22671 004102'02 000000 000000 22672 004103'02 44 07 0 00 004744' 22673 004104'02 003002 000000 spwfdd: flddb. .cmswi,,parswi,,,, ;;[223] If in a define 22674 004105'02 000000 004042' 22675 004106'02 000000 000000 22676 004107'02 44 07 0 00 004751' 22677 22678 retsec ;;Back to where-ever we started from 22679 22680 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70 K20IOC MAC 12-May-24 20:27 SET PARITY parsing 22681 subttl SET PARITY parsing 22682 22683 004105'01 .setpa: entry .setpa ;[223] Invoked from k20par 22684 004105'01 200 16 0 00 000000# guide 22685 004106'01 260 17 0 00 002060* 22686 004110'02 000000000000# 22687 001732'04 164 157 000 000 000 22688 remark ;[258] Don't reset parameters unless explicitly told to 22689 22690 004107'01 200 01 0 00 003255* move t1, parity ;[258] Load current parity routine's address 22691 004110'01 400 05 0 00 000000 setz q1, ;[258] Let's assume there is none 22692 004111'01 306 01 0 00 003734' cain t1, space ;[258] Always clearing bit 8? 22693 004112'01 201 05 0 00 000001 movei q1, .parsp ;[258] Yes, phoney up its parse table offset 22694 004113'01 306 01 0 00 003732' cain t1, mark ;[258] Always setting bit 8? 22695 004114'01 201 05 0 00 000002 movei q1, .parmk ;[258] Yes, phoney up its parse table offset 22696 004115'01 306 01 0 00 003736' cain t1, even ;[258] Even parity? 22697 004116'01 201 05 0 00 000003 movei q1, .parev ;[258] Yes, phoney up its parse table offset 22698 004117'01 306 01 0 00 003742' cain t1, odd ;[258] Odd parity? 22699 004120'01 201 05 0 00 000004 movei q1, .parod ;[258] Yes, phoney up its parse table offset 22700 004121'01 202 05 0 00 001463* movem q1, pars3 ;[258] Store as the parsed value 22701 22702 004122'01 120 02 0 00 000000# dmove t2, parpko ;[258] Load whether doing parity on packets only 22703 004123'01 124 02 0 00 002277* dmovem t2, pars4 ;[258] and whether we're checking it and store 22704 004124'01 120 02 0 00 000000# dmove t2, paract ;[258] Load current parity action and substitution 22705 004125'01 124 02 0 00 002103* dmovem t2, pars6 ;[258] characters to use as defaults 22706 004126'01 200 01 0 00 003274* move t1, ttipar ;[258] Propagate parity error counter 22707 004127'01 202 01 0 00 002233* movem t1, pars8 ;[258] unless we explicitly clear it 22708 22709 004130'01 201 01 0 00 000000# movei t1, spafdb ;[223] Assume not defining a macro 22710 004131'01 332 00 0 00 000270* skipe definf ;[223] But!! Are we in a define? 22711 004132'01 201 01 0 00 000000# movei t1, spafdd ;[223] Indeed; don't parse a confirm 22712 004133'01 260 17 0 00 004045* call rflde ;[260] Try to parse something 22713 004134'01 254 00 0 00 004137' ifskp. ;[260] Worked!! 22714 004135'01 135 03 0 00 004466' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ;[260] Get what was parsed 22715 004136'01 254 00 0 00 004142' else. ;[260] Otherwise, failed the parse 22716 004137'01 336 00 0 00 004131* skipn definf ;[260] In DEFINE? 22717 004140'01 254 00 0 00 000000* jrst cmderr ;[260] No, so a definite parse error; allow retry 22718 004141'01 263 17 0 00 000000 ret ;[260] Otherwise, return into DEFINE & see if that chokes 22719 004142'01 endif. ;[260] End parse result handling 22720 22721 004142'01 302 03 0 00 000010 caie t3, .cmcfm ;[223] Parsed a confirm? 22722 004143'01 254 00 0 00 004146' ifskp. ;[223] We did 22723 004144'01 402 00 0 00 004121* setzm pars3 ;[258] Shut off parity, leave other stuff alone 22724 004145'01 263 17 0 00 000000 ret ;[223] Nothing further to do; comand is confirmed 22725 004146'01 endif. ;[223] End requesting default values 22726 22727 004146'01 265 16 0 00 004467' saveac ;[223] Needs a few more registers 22728 22729 004147'01 302 03 0 00 000000 caie t3, .cmkey ;[258] Did we skip the parity type keyword? 22730 004150'01 254 00 0 00 004153' ifskp. ;[258] No, so get that parse value 22731 004151'01 550 02 0 02 000000 hrrz t2, (t2) ; Get the value for the keyword. 22732 004152'01 120 05 0 00 000002 dmove q1, t2 ;[223] Save value and parse type 22733 004153'01 endif. ;[258] Done case of parity keyword 22734 22735 004153'01 302 03 0 00 000003 caie t3, .cmswi ;[258] Did we directly type a switch? K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70-1 K20IOC MAC 12-May-24 20:27 SET PARITY parsing 22736 004154'01 254 00 0 00 004160' ifskp. ;[258] We did, and skipped the keyword 22737 004155'01 550 01 0 02 000000 hrrz t1, (t2) ;[258] Address of switch's instruction and address pair 22738 004156'01 256 00 0 01 000000 xct (t1) ;[258] Execute it to side-effect something 22739 004157'01 320 12 0 00 004140* erjmpr cmderr ;[258] Failed?? 22740 004160'01 endif. ;[258] End case directly typed a switch, firs 22741 22742 004160'01 do. ;[223] Enter loop context 22743 004160'01 201 01 0 00 000000# movei t1, spwfdb ;[223] Assume we can confirm 22744 004161'01 332 00 0 00 004137* skipe definf ;[223] But!! Are we in a define? 22745 004162'01 201 01 0 00 000000# movei t1, spwfdd ;[223] We are; wait on the confirm 22746 004163'01 260 17 0 00 004133* call rflde ;[223] Try to parse something 22747 004164'01 254 00 0 00 004174' ifskp. ;[223] Worked!! 22748 004165'01 135 06 0 00 004466' ldb q2, [pointr (.cmfnp(t3),cm%fnc)] ;[223] Get function code. 22749 004166'01 306 06 0 00 000010 cain q2, .cmcfm ;[223] Finally finished typing switches? 22750 004167'01 254 00 0 00 004200' exit. ;[223] Yes, break out of the loop 22751 004170'01 550 01 0 02 000000 hrrz t1, (t2) ;[258] Address of switch's instruction and address pair 22752 004171'01 256 00 0 01 000000 xct (t1) ;[258] Execute it to side-effect something 22753 004172'01 320 12 0 00 004157* erjmpr cmderr ;[258] Failed?? 22754 004173'01 254 00 0 00 004177' else. ;[223] Otherwise, failed the parse 22755 004174'01 336 00 0 00 004161* skipn definf ;[223] In DEFINE? 22756 004175'01 254 00 0 00 004172* jrst cmderr ;[223] No, so a definite parse error; allow retry 22757 004176'01 263 17 0 00 000000 ret ;[223] Return into DEFINE and see if that chokes 22758 004177'01 endif. ;[223] End parse result handling 22759 004177'01 254 00 0 00 004160' loop. ;[223] Get another switch 22760 004200'01 enddo. ;[223] End loop lexical context 22761 22762 004200'01 202 05 0 00 004144* movem q1, pars3 ;[223] Store parity actions 22763 004201'01 263 17 0 00 000000 ret ;[223] Whether or not in a define, can return 22764 22765 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71 K20IOC MAC 12-May-24 20:27 SET PARITY semantic action 22766 subttl SET PARITY semantic action 22767 22768 extern nrtflg ;[223] Tops-20/Tops-10 DECnet NRT? 22769 extern ptyflg ;[223] Talking to ourselves? 22770 extern lclpar ;[223] Whether local line will do parity 22771 extern opnpar ;[223] Whether open device will do parity 22772 extern parity ;[194] Parity routine we'll use 22773 extern ebq ;[194] Eight bit quoting character 22774 extern ebqr ;[194] We'll request eight bit quoting 22775 22776 chgsec(code,data) ;[223] Need writable storage 22777 000000'10 000 00 0 00 000000 genint:: Z ;** DO NOT ;[223] Constructed instruction to generate parity 22778 000001'10 000 00 0 00 000000 chkint:: Z ; REORDER ** ;[223] Constructed instruction to check parity 22779 000002'10 000 00 0 00 000000 parpko:: Z ;** DO NOT ;[223] Doing parity on packets, only 22780 000003'10 000 00 0 00 000000 parrck:: Z ; REORDER ** ;[223] Checking parity on recieve in addition to sending 22781 000004'10 000 00 0 00 000000 paract:: Z ;** DO NOT ;[258] Parity Action, 0 is abort, else count & proceed 22782 000005'10 000000 000176 parsub:: "~" ; REORDER ** ;[258] Parity substitution character 22783 000006'10 777777 777777 parbla: -1 ;[258] Parity blatting 22784 000007'10 000 00 0 00 000000 par2nd: Z ;[258] Used when forcing a 2nd parse 22785 retsec ;[223] Get back into code psect 22786 22787 004202'01 $setpa: entry $setpa ;[223] Invoked from k20par 22788 extern ttfork ;[223] Parity change forces a fork-reset 22789 004202'01 265 16 0 00 004501' saveac ;[223] Needs a register 22790 22791 004203'01 200 01 0 00 004127* move t1, pars8 ;[258] Pick up progated (or zeroed) error count 22792 004204'01 202 01 0 00 004126* movem t1, ttipar ;[258] Set to previous value or zero 22793 004205'01 120 01 0 00 004123* dmove t1, pars4 ;[223] Pick up parity domain parse results 22794 004206'01 124 01 0 00 000000# dmovem t1, parpko ;[223] Store in global variables 22795 22796 004207'01 200 05 0 00 004200* move q1, pars3 ;[223] What did they say? 22797 004210'01 200 06 0 05 000000# move q2, schrpr(q1) ;[223] Pick up single character parity routine 22798 004211'01 554 02 0 05 000000# hlrz t2, stpart(q1) ;[223] Load string based parity generation routine 22799 004212'01 322 02 0 00 004217' ifn. t2 ;[223] Do we have anything? 22800 004213'01 550 03 0 05 000000# hrrz t3, stpart(q1) ;[223] Yes, load string based parity checking routine 22801 004214'01 505 02 0 00 015000 hrli t2, (movst 0,0) ;[223] Drop in the 22802 004215'01 505 03 0 00 015000 hrli t3, (movst 0,0) ;[223] extended opcodes 22803 004216'01 254 00 0 00 004220' else. ;[223] Otherwise, this is 'none', which is special cased 22804 004217'01 400 03 0 00 000000 setz t3, ;[223] Nothing in t3 22805 004220'01 endif. ;[223] End case extended instruction construction 22806 004220'01 124 02 0 00 000000# dmovem t2, genint ;[223] Store both extended string instructions 22807 004221'01 202 06 0 00 004107* movem q2, parity ;[223] Store single character routines 22808 22809 004222'01 200 01 0 00 004071* move t1, pars7 ;[258] Load substitution character 22810 004223'01 260 17 0 06 000000 call (q2) ;[258] Compute possible parity 22811 004224'01 200 02 0 00 000001 move t2, t1 ;[258] Reposition 22812 004225'01 200 01 0 00 004125* move t1, pars6 ;[258] Load parity action 22813 004226'01 124 01 0 00 000000# dmovem t1, paract ;[258] Store parity acttion and substitution 22814 ;[258] character in global variables 22815 004227'01 260 17 0 00 004315' call parchr ;[223] Recompute parity on other characters 22816 004230'01 336 01 0 00 000000* skipn t1, ttfork ;[223] Are we doing interactive communications? 22817 004231'01 254 00 0 00 004241' ifskp. ;[223] We are, must reset to use new parity 22818 004232'01 104 00 0 00 000153 KFORK% ;[223] Whack the communications fork 22819 004233'01 320 12 0 00 004235' %jsErr (,) ;[223] 22820 004234'01 254 00 0 00 004240' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71-1 K20IOC MAC 12-May-24 20:27 SET PARITY semantic action 22821 004235'01 265 01 0 00 004012* 22822 004236'01 000000000000# 22823 004237'01 254 00 0 00 004240' 22824 001733'04 125 156 141 142 154 22825 004240'01 402 00 0 00 004230* setzm ttfork ;[223] And force a recreate 22826 004241'01 endif. ;[223] End case resetting comunications fork 22827 22828 004241'01 302 06 0 00 003731' caie q2, none ;[194] Was the parity NONE? 22829 004242'01 254 00 0 00 004250' ifskp. ;[194] Yes, it was 22830 004243'01 201 01 0 00 000131 movei t1, "Y" ;[194] Just say we will do 8th-bit 22831 004244'01 202 01 0 00 000000* movem t1, ebq ;[95] prefixing if requested. 22832 004245'01 402 00 0 00 000000* setzm ebqr ;[95] But we won't request it ourselves. 22833 004246'01 476 00 0 00 000000# setom parbla ;[261] Reset the parity blatting count 22834 004247'01 263 17 0 00 000000 ret ;[261] If none, then nothing further to do, so leave 22835 004250'01 endif. ;[261] End case shutting off parity 22836 22837 remark ;[261] Otherwise, not NONE 22838 004250'01 476 00 0 00 004245* setom ebqr ;[194] So request 8th-bit prefixing. 22839 004251'01 201 02 0 00 000046 movei t2, dqbin ;[89] Use the default prefix. 22840 004252'01 202 02 0 00 004244* movem t2, ebq ;[89] 22841 004253'01 352 00 0 00 000000# aose parbla ;[261] Have we seen this message? 22842 004254'01 263 17 0 00 000000 ret ;[261] Yes, just shut up and get on with it 22843 22844 remark ;[261] May have some kind of blatting to do 22845 004255'01 336 00 0 00 002736* ifmn. netjfn ;[223] Network connection? 22846 004256'01 254 00 0 00 004304' 22847 004257'01 332 00 0 00 000000* ifme. opnpar ;[223] Yes, does line NOT do parity? 22848 004260'01 254 00 0 00 004303' 22849 004261'01 336 00 0 00 000000* ifmn. nrtflg ;[223] DECnet connection? 22850 004262'01 254 00 0 00 004267' 22851 004263'01 200 01 0 00 000000# txmsg <%Network connection> ;[223] Yes, say as such 22852 004264'01 104 00 0 00 000076 22853 004265'01 320 12 0 00 004266' 22854 004111'02 000000000000# 22855 001746'04 045 116 145 164 167 22856 004266'01 254 00 0 00 004300' else. ;[223] Otherwise, it's something else 22857 004267'01 336 00 0 00 000000* ifmn. ptyflg ;[223] PTY? 22858 004270'01 254 00 0 00 004275' 22859 004271'01 200 01 0 00 000000# txmsg <%Pseudo-terminal> ;[223] 22860 004272'01 104 00 0 00 000076 22861 004273'01 320 12 0 00 004274' 22862 004112'02 000000000000# 22863 001752'04 045 120 163 145 165 22864 004274'01 254 00 0 00 004300' else. ;[223] Otherwise, physical line 22865 004275'01 200 01 0 00 000000# txmsg <%Terminal line> ;[223] 22866 004276'01 104 00 0 00 000076 22867 004277'01 320 12 0 00 004300' 22868 004113'02 000000000000# 22869 001756'04 045 124 145 162 155 22870 004300'01 endif. ;[223] End PTY decision 22871 004300'01 endif. ;[223] End NRT decision 22872 txmsg < does not support parity 22873 004300'01 200 01 0 00 000000# > ;[223] Remind terminal-and-packets ill-advised 22874 004301'01 104 00 0 00 000076 22875 004302'01 320 12 0 00 004303' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71-2 K20IOC MAC 12-May-24 20:27 SET PARITY semantic action 22876 004114'02 000000000000# 22877 001761'04 040 144 157 145 163 22878 22879 004303'01 endif. ;[223] End case parity on network device 22880 004303'01 254 00 0 00 004311' else. ;[223] Otherwise, using control terminal 22881 004304'01 332 00 0 00 000000* ifme. lclpar ;[223] Will local line will do parity? 22882 004305'01 254 00 0 00 004311' 22883 txmsg <%Control terminal line does not support parity 22884 004306'01 200 01 0 00 000000# > ;[223] Remind terminal-and-packets ill-advised 22885 004307'01 104 00 0 00 000076 22886 004310'01 320 12 0 00 004311' 22887 004115'02 000000000000# 22888 001767'04 045 103 157 156 164 22889 22890 004311'01 endif. ;[223] 22891 004311'01 endif. ;[223] End case checking device parity toleration 22892 22893 txmsg <%Will request 8th-bit prefixing. 22894 If the other KERMIT doesn't agree, binary files cannot be sent correctly. 22895 004311'01 200 01 0 00 000000# > 22896 004312'01 104 00 0 00 000076 22897 004313'01 320 12 0 00 004314' 22898 004116'02 000000000000# 22899 002001'04 045 127 151 154 154 22900 22901 22902 004314'01 263 17 0 00 000000 ret 22903 22904 ;[223] End code move 22905 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72 K20IOC MAC 12-May-24 20:27 If parity changes, side effect certain characters 22906 subttl If parity changes, side effect certain characters 22907 22908 ;[223] Begin code insertion 22909 22910 ; Parity had been computed on all characters in a sending packet 22911 ; except where a character might be outside of the packet proper. One 22912 ; such character would be padding, which is simply emitted before the 22913 ; packet itself is sent. 22914 ; 22915 ; Now the entire message is built including the padding, start-of- 22916 ; header and end-of-line characters and then putpar is called to apply 22917 ; parity in a single extended instruction. 22918 ; 22919 ; There are certain situations where the characters are looked for 22920 ; individually, so this code applies parity to all of them whenever 22921 ; parity changes. If the characters themselves change, then the 22922 ; routines doing the changes apply current parity. 22923 ; 22924 ; Note that we don't tweak the received characters because the chkpar 22925 ; routine is called before we ever get to checking them. Since it 22926 ; strips parity, we don't need to worry about it; when receiving... 22927 22928 remark ; Document what we'll be tweaking 22929 extern ssthdr ; Sending start of header character 22930 remark rsthdr ; Receiving start of header character 22931 extern spadch ; Sending padding character 22932 remark rpadch ; Receiving padding character 22933 extern seolch ; Sending End of Line character 22934 remark reolch ; Receiving End of Line character 22935 extern handsh ; Handshake character 22936 22937 chgsec(code,const) ; Table of addresses is constant data 22938 22939 004117'02 000000000000# pchars: ssthdr ; Sending start of header character 22940 004120'02 000000000000# spadch ; Sending padding character 22941 004121'02 000000000000# seolchseolch ; Sending End of Line character 22942 004122'02 000000000000# handsh ; Handshake character 22943 004123'02 000000000000# parsub ; Substitution character if proceeding on parity error 22944 000005 pcharl==.-pchars ; Number of entries in the table 22945 22946 retsec ; Return to code psect 22947 22948 ; Call: 22949 ; 22950 ; q1/ Contains the address of the single character parity generating routine 22951 22952 004315'01 265 16 0 00 004460' parchr: saveac ; Used as a counter 22953 004316'01 201 05 0 00 000004 movx q1, ; Load maximum offset 22954 22955 004317'01 do. ; Enter loop context 22956 004317'01 200 01 1 05 000000# move t1, @pchars(q1) ; Load the character 22957 004320'01 405 01 0 00 000177 andi t1, ^o177 ; Stomp any previous parity 22958 004321'01 260 17 0 06 000000 call (q2) ; Apply the appropriate parity 22959 004322'01 202 01 1 05 000000# movem t1, @pchars(q1) ; Store the proper character 22960 004323'01 365 05 0 00 004317' sojge q1, top. ; Do the next character until done K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72-1 K20IOC MAC 12-May-24 20:27 If parity changes, side effect certain characters 22961 004324'01 enddo. ; End of loop lexical context 22962 22963 004324'01 263 17 0 00 000000 ret ; Done fixing up everything 22964 22965 cleans () ; Clean up working symbol 22966 22967 ;[223] End code insertion 22968 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73 K20IOC MAC 12-May-24 20:27 Put parity on an eight bit stream 22969 subttl Put parity on an eight bit stream 22970 22971 ;[223] Begin code insertion 22972 22973 ; The algorythm is actually straightforward; the routine is passed a 22974 ; pointer to a buffer that is almost ready to send, meaning we are the 22975 ; last operation directly before the SOUT%/SOUTR%. The buffer is 22976 ; assumed to contain 7 bit ASCII characters in 8 bit bytes, thus 22977 ; giving the routine a place to put the parity. 22978 ; 22979 ; It checks whether parity is being done and, if so, loads the single 22980 ; instruction that will perform the operation. This is a MOVST which 22981 ; has been constructed with the appropriate translate table. 22982 ; 22983 ; Again, although the byte pointer being passed is eight bits, the 22984 ; string is treated as a series of seven bit bytes in 8 bit fields 22985 ; where the current setting of the eigth bit is discarded. The string 22986 ; is overwritten in place with the correct parity, at which point, it 22987 ; will be completely ready to be sent. 22988 ; 22989 ; Once the MOVST is started, the whole process is effectively a series 22990 ; of table lookups with no computations involved at all. 22991 ; 22992 ; The routine is faster than calling the single character conversion 22993 ; routines, even for the shortest possible Kermit packet of three 22994 ; characters. In other words, even with all the register pushing and 22995 ; popping, it still always wins. 22996 ; 22997 ; Depending on your view, the amount of memory taken up by the 22998 ; translation tables is not flagrant: a single kiloword and it is 22999 ; shared. 23000 ; 23001 ; Call: (Expected to be just before SOUT%/SOUTR%) 23002 ; 23003 ; t2/ Pointer to eight bit data to overwrite 23004 ; t3/ Negative length of data to do 23005 ; 23006 ; Return: 23007 ; 23008 ; +1, always; appropriate parity, if parity is being done (I.E., not 'none') 23009 23010 004325'01 putpar: entry putpar ; Used by packet routines in k20mit 23011 004325'01 325 03 0 00 004014* jumpge t3, R ; Zero or gubbish? Just leave it alone... 23012 004326'01 200 16 0 00 004221* move cx, parity ; Load current parity setting 23013 004327'01 306 16 0 00 003731' cain cx, none ; Not doing anything? 23014 004330'01 263 17 0 00 000000 ret ; No, so don't do anything 23015 23016 004331'01 putpaa: entry putpaa ;[256] ; PUT PArity ALWAYS 23017 004331'01 265 16 0 00 005036' saveac ; Preserve required eight registers ... 23018 004332'01 210 01 0 00 000003 movn t1, t3 ; Source length 23019 004333'01 200 04 0 00 000001 move t4, t1 ; destination is the same length 23020 004334'01 200 05 0 00 000002 move q1, t2 ; String will be updated in place (I.E., overwritten) 23021 004335'01 403 03 0 00 000006 setzb t3, q2 ; Section local pointers 23022 004336'01 336 07 0 00 000000# skipn q3, genint ; Load and double check extended string instruction 23023 004337'01 263 17 0 00 000000 ret ; Very odd! We checked above, but ignore it K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-1 K20IOC MAC 12-May-24 20:27 Put parity on an eight bit stream 23024 004340'01 400 10 0 00 000000 setz q4, ; Fill character is NUL (yet unused...) 23025 004341'01 621 01 0 00 300000 txz t1, N!M ; Shut off Negative and Mark 23026 004342'01 661 01 0 00 400000 txo t1, S ; Have to dink the foolish significance bit... 23027 004343'01 123 01 0 00 000007 extend t1, q3 ; Get down to some serious string translating 23028 004344'01 600 00 0 00 000000 nop ; Can't happen 23029 004345'01 263 17 0 00 000000 ret ; Done 23030 23031 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74 K20IOC MAC 12-May-24 20:27 Generate parity on a seven bit stream 23032 subttl Generate parity on a seven bit stream 23033 23034 ; Like the above, except creates a new eight stream from a seven bit 23035 ; stream instead of overwriting the eight bit stream in place. 23036 ; 23037 ; t1/ Pointer to eight bit destination data 23038 ; t2/ Pointer to seven bit source data 23039 ; t3/ Negative length of data to do 23040 ; 23041 ; If parity is being done, then t2 will be updated to the original 23042 ; value of t1, otherwise it is unchanged. t1 is always trashed, 23043 ; everything else is preserved. 23044 ; 23045 ; N.B., The above is fine and everything ...but... 23046 ; THE BYTE WIDTHS ARE *NOT* CHECKED!!!! 23047 23048 004346'01 genpar: entry genpar ; Also used by k20dsp and k20net 23049 004346'01 325 03 0 00 004325* jumpge t3, R ; Zero or gubbish? Just leave it alone... 23050 004347'01 200 16 0 00 004326* move cx, parity ; Load current parity setting 23051 004350'01 306 16 0 00 003731' cain cx, none ; Not doing any parity? 23052 004351'01 263 17 0 00 000000 ret ; No, so don't do anything 23053 ; Otherwise, go hog wild on registers 23054 004352'01 265 16 0 00 005054' saveac 23055 004353'01 200 11 0 00 000001 move q5, t1 ; Save original destination 23056 004354'01 200 05 0 00 000001 move q1, t1 ; and put it where movst wants to use it 23057 004355'01 210 01 0 00 000003 movn t1, t3 ; Source length is positive 23058 004356'01 200 04 0 00 000001 move t4, t1 ; destination is the same length 23059 004357'01 403 03 0 00 000006 setzb t3, q2 ; Section local pointers 23060 004360'01 336 07 0 00 000000# skipn q3, genint ; Load and double check extended string instruction 23061 004361'01 263 17 0 00 000000 ret ; Very odd! We checked above, but ignore it 23062 004362'01 400 10 0 00 000000 setz q4, ; Fill character is NUL (yet unused...) 23063 004363'01 621 01 0 00 300000 txz t1, N!M ; Shut off Negative and Mark 23064 004364'01 661 01 0 00 400000 txo t1, S ; Have to dink the foolish significance bit... 23065 004365'01 123 01 0 00 000007 extend t1, q3 ; Get down to some serious string translating 23066 004366'01 600 00 0 00 000000 nop ; Can't happen 23067 004367'01 200 02 0 00 000011 move t2, q5 ; Return new source for SOUT%/SOUTR% 23068 004370'01 263 17 0 00 000000 ret ; Done 23069 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 75 K20IOC MAC 12-May-24 20:27 Check Parity 23070 subttl Check Parity 23071 23072 ; Call: 23073 ; 23074 ; t2/ Pointer to eight bit data 23075 ; t3/ Negative length of data to do 23076 ; 23077 ; Return: 23078 ; 23079 ; +1, Bad parity, if parity is not none 23080 ; +2, Good parity or none or zero length 23081 ; 23082 ; The routine is faster than calling single character conversion 23083 ; routines for the shortest possible Kermit packet of three 23084 ; characters. In other words, even with all the register pushing and 23085 ; popping, it still always wins. 23086 23087 004371'01 chkpar: entry chkpar ; Used by k20mit 23088 004371'01 325 03 0 00 003730* jumpge t3, RSKP ; Zero or gubbish? Just leave it alone... 23089 004372'01 200 16 0 00 004347* move cx, parity ; Load current parity setting 23090 004373'01 306 16 0 00 003731' cain cx, none ; Not doing anything? 23091 004374'01 254 00 0 00 004371* retskp ; No, so don't do anything 23092 ; Otherwise, preserve eight registers ... 23093 004375'01 chkpaa: remark ;[257] ; Internal entry when know we're doing parity 23094 004375'01 265 16 0 00 005036' saveac 23095 004376'01 336 07 0 00 000000# skipn q3, chkint ; Load and double check extended string instruction 23096 004377'01 254 00 0 00 004374* retskp ; Very odd! We checked above, but ignore it 23097 004400'01 200 10 0 00 000000# move q4,parsub ;[258] ; Fill character will be the same as subsitution 23098 004401'01 200 05 0 00 000002 move q1, t2 ; String will be updated in place (I.E., overwritten) 23099 004402'01 210 01 0 00 000003 movn t1, t3 ; Source length 23100 004403'01 200 04 0 00 000001 move t4, t1 ; destination is the same length 23101 004404'01 403 03 0 00 000006 setzb t3, q2 ; Section local pointers 23102 004405'01 621 01 0 00 300000 txz t1, N!M ; Shut off Negative and Mark 23103 004406'01 661 01 0 00 400000 txo t1, S ; Have to dink the foolish significance bit... 23104 004407'01 do. ;[258] ; Enter loop lexical context (in case proceeding) 23105 004407'01 123 01 0 00 000007 extend t1, q3 ; Get down to some serious string translating 23106 004410'01 600 00 0 00 000000 nop ; Can't happen 23107 004411'01 627 01 0 00 200000 txzn t1, N ; Bump into any bad parity? 23108 004412'01 254 00 0 00 004377* retskp ; Nope, we're done 23109 004413'01 350 00 0 00 004204* aos ttipar ;[258] ; Count a parity error 23110 004414'01 336 00 0 00 000000# skipn paract ;[258] ; Are we just giving up? 23111 004415'01 263 17 0 00 000000 ret ;[258] ; Yes, we are, so signal bad parity 23112 004416'01 136 10 0 00 000005 idpb q4, q1 ;[258] ; Replace bad character with substitute 23113 004417'01 367 04 0 00 004407' sojg t4, top. ;[258] ; If not at end, go do some more 23114 004420'01 enddo. ;[258] ; Otherwise, fall out of the loop 23115 004420'01 254 00 0 00 004412* retskp ;[258] ; Always true 23116 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76 K20IOC MAC 12-May-24 20:27 padbuf - Generate a buffer of padding characters with correct parity 23117 subttl padbuf - Generate a buffer of padding characters with correct parity 23118 23119 ; Call: 23120 ; 23121 ; t1/ Number of padding characters 23122 ; t2/ 7 bit padding character 23123 ; t3/ Parity to form 23124 ; t4/ Address of buffer to put the padding with proper parity in 23125 ; 23126 ; Returns +1, always 23127 23128 004421'01 padbuf: entry padbuf ; Called from k20mit 23129 004421'01 265 16 0 00 004612' saveac ; Wants some scratch 23130 23131 004422'01 120 05 0 00 000001 dmove q1, t1 ; Save length and character 23132 004423'01 120 07 0 00 000003 dmove q3, t3 ; Save parity and buffer address 23133 004424'01 200 11 0 00 002434* move p1, tvtflg ;[247] ; If might need to do IAC doubling 23134 23135 004425'01 200 01 0 00 000002 move t1, t2 ; Load padding character 23136 004426'01 260 17 1 00 000007 call @q3 ; Calculate parity 23137 004427'01 200 12 0 00 000001 move p2, t1 ;[247] ; Save character with parity 23138 23139 004430'01 200 06 0 00 000001 move q2, t1 ; Make a copy 23140 repeat ^d3, < ; Construct the next four characters 23141 lsh q2, ^d8 ; Shift over an eight bit character 23142 or q2, t1 ; Or in the padding character 23143 > 23144 004431'01 242 06 0 00 000010 23145 004432'01 434 06 0 00 000001 23146 004433'01 242 06 0 00 000010 23147 004434'01 434 06 0 00 000001 23148 004435'01 242 06 0 00 000010 23149 004436'01 434 06 0 00 000001 23150 23151 004437'01 242 06 0 00 000004 lsh q2, ^d4 ; Left justify to make 8 bit ASCIZ 23152 004440'01 202 06 0 10 000000 movem q2,(q4) ; Stomp first word of buffer 23153 23154 004441'01 322 11 0 00 004445' ifn. p1 ;[247] ; TVT Binary? 23155 004442'01 302 12 0 00 000377 caie p2, IAC ;[247] ; Yes, is it an IAC? 23156 004443'01 254 00 0 00 004445' anskp. ;[247] ; No, it isn't, so nothing to double 23157 004444'01 242 05 0 00 000001 lsh q1, ^d1 ;[247] ; Otherwise, double it 23158 004445'01 endif. ;[247] ; End case using IAC as padding character 23159 23160 004445'01 200 01 0 00 000005 move t1, q1 ; Load original length 23161 004446'01 231 01 0 00 000004 idivi t1, ^d4 ; Four 8 bit characters per word 23162 004447'01 302 02 0 00 000000 caie t2, 0 ; No remainder? 23163 004450'01 271 01 0 00 000001 addi t1, ^d1 ; Round up a word 23164 004451'01 275 01 0 00 000001 subi t1, ^d1 ; Already did first word 23165 004452'01 323 01 0 00 004346* jumple t1, R ; Four characters or less? 23166 ; Otherwise, fill out the rest of the buffer 23167 004453'01 200 02 0 00 000010 move t2, q4 ; Starting address in buffer 23168 004454'01 201 03 0 02 000001 movei t3, 1(t2) ; Next address to fill out the rest of the necessary 23169 004455'01 123 01 0 00 004511' xblt. t1 ; words in the buffer (but not the whole buffer) 23170 004456'01 200 01 0 00 000005 move t1, q1 ;[247] ; Return possibly updated length 23171 004457'01 263 17 0 00 000000 ret ; Done K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76-1 K20IOC MAC 12-May-24 20:27 padbuf - Generate a buffer of padding characters with correct parity 23172 23173 ;[223] End code insertion 23174 23175 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 77 K20IOC MAC 12-May-24 20:27 Close out Code section 23176 subttl Close out Code section 23177 23178 xlist ; Save the trees!!!!! 23179 list 23180 23181 .endps code ; End of code .psect 23182 K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 78 K20IOC MAC 12-May-24 20:27 Local storage 23183 subttl Local storage 23184 23185 .psect data ;Write-able area 23186 23187 000010'10 000000 000000 intima:: defita ;[160] Timeout action for INPUT search. 23188 000011'10 000000 000000 incase:: defics ;[160] Case conversion flag for INPUT search. 23189 000012'10 000000 011610 indeft:: defito ; ** DO NOT ;[194] Default timeout for INPUT search (milliseconds) 23190 000013'10 203500 000000 indeff:: defitf ; REORDER ** ;[212] Same value as floating point seconds 23191 23192 000014'10 000000 000000 indefc:: 0 ;[209] Default search string length in characters 23193 000015'10 000000 000000 indefw:: 0 ;[209] Same length in words 23194 000016'10 indefs:: block strblw ;[209] Storage for default search string (if set) 23195 23196 001016'10 trgchr: block 1 ;[209] The 'trigger' character 23197 001017'10 trnbas: block 2 ;[209] Translation base table we used 23198 001021'10 sertab: block sertln ;[209] Search table 23199 23200 ;[209] Handles register spill from searching routines 23201 23202 001221'10 ornetc: block 1 ; ** DO NOT ;[209] Original network count 23203 001222'10 ornetp: block 1 ; REORDER ** ;[209] Original network pointer (end of buffer) 23204 23205 ;[209] Next two variables are for cross INPUT calls with left over data 23206 23207 001223'10 000000 000000 inpcbf:: 0 ;[209] Number of characters we flushed 23208 001224'10 000000 000000 inpcnt:: 0 ;** DO NOT REORDER** ;[209] Number of characters in buffer 23209 001225'10 44 07 0 00 001226' inpptr: point 7, inpbuf ;[209] Current position in buffer 23210 001226'10 inpbuf:: block strblw ;[209] Area to read data into 23211 23212 002226'10 zsizeb: block 2 ;[263] Results of SIZEF% from section one 23213 23214 .endps data ; Close out storage area 23215 23216 .psect text ;[209] Read-only storage 23217 000366'03 inpini: intern inpini ;[209] Used by buffer clearing routines 23218 000366'03 000000 000000 0 ;[209] Nothing in INPUT command buffer 23219 000367'03 44 07 0 00 000000# point 7, inpbuf ;[209] So pointing at beginning 23220 .endps text ;[209] Close out section zero text 23221 23222 23223 .xcmsy ;[194] Ditch MACSYM junk 23224 23225 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 005073 FOR CODE PSECT 2 BREAK IS 004757 FOR CONST PSECT 3 BREAK IS 000370 FOR TEXT PSECT 4 BREAK IS 002030 FOR ETEXT PSECT 5 BREAK IS 000023 FOR EDATA PSECT 6 BREAK IS 000634 FOR ECODE PSECT 7 BREAK IS 000121 FOR ECONST PSECT 10 BREAK IS 002230 FOR DATA K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page 78-1 K20IOC MAC 12-May-24 20:27 Local storage CPU TIME USED 00:02.863 155P CORE USED K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE ASCZCP 000000 ext DISMS% 104000 000167 int NOIRTN 000000 ext SC%CTC 400000 000000 sin ATMBLN 000141 spd DOARPA 000000 ext NOP 600000 000000 sin SESFLG 000000 ext ATMBUF 000000 ext DOBITS 000000 ext NOUT% 104000 000224 int SESJFN 000000 ext BIN% 104000 000050 int DQBIN 000046 spd NSICI 000000 ext SETER% 104000 000336 int BOUT% 104000 000051 int DUPLEX 000000 ext NSIMX 000000 ext SFPTR% 104000 000027 int BUFFER 000000 ext DV%TYP 000777 000000 sin NSITC 000000 ext SIN% 104000 000052 int CALL 260740 000000 DVCHR% 104000 000117 int NUL4 000000 ext SIZEF% 104000 000036 int CALLRE 254000 000000 spd ECDORG 000001 572000 spd OF%BSZ 770000 000000 sin SM%RD 100000 000000 sin CARIER 000000 ext ECNORG 000001 577000 spd OF%RD 200000 sin SMAP% 104000 000767 int CCOFF2 000000 ext ECODE 000000 ext OF%WR 100000 sin SMPORG 000003 000000 spd CCON 000000 ext ECONST 000000 ext OPENF% 104000 000021 int SMPPAG 003000 spd CFMRTN 000000 ext EDAORG 000001 650000 spd P 000017 SMPSEC 000003 spd CHKLIN 000000 ext EDATA 000000 ext P1 000011 spd SOUT 104000 000053 int CHKSEC 000000 ext ELPTIM 000000 ext P2 000012 spd SOUT% 104000 000053 int CJFNBK 000000 ext ENDTIM 000000 ext P3 000013 spd SOUTR% 104000 000532 int CJFNLN 000020 spd EOSCOD 100000 spd P4 000014 spd SPSIZ 000000 ext CLRBUF 000000 ext ERJMPR 320500 000000 int P5 000015 spd STATIM 000000 ext CLREST 000000 ext ERRPTR 000000 ext PARITY 000000 ext STRBF2 000000 ext CLZFF% 104000 000034 int ERSTR% 104000 000011 int PARS1 000000 ext STRBL8 004000 spd CM%ABR 000004 sin ESOUT% 104000 000313 int PARS10 000000 ext STRBLC 005000 spd CM%DPP 000002 000000 sin ETEXT 000000 ext PARS12 000000 ext STRBLW 001000 spd CM%FNC 777000 000000 sin EXTSEC 000001 spd PARS2 000000 ext STRBUF 000000 ext CM%FW 002000 000000 sin F 000000 spd PARS3 000000 ext STRC 000000 ext CM%HPP 000004 000000 sin FB%BSZ 007700 000000 sin PARS4 000000 ext STRPTR 000000 ext CM%INV 000001 sin FH%EPN 200000 sin PARS5 000000 ext T1 000001 spd CM%LST 777777 sin FILJFN 000000 ext PARS6 000000 ext T2 000002 spd CM%SDH 000001 000000 sin FRCLOS 000000 ext PARS7 000000 ext T3 000003 spd CM%XIF 002000 000000 sin GJ%FLG 000020 000000 sin PARS8 000000 ext T4 000004 spd CMDACS 000000 ext GJ%FOU 400000 000000 sin PARS9 000000 ext TAKJFN 000000 ext CMDBLN 000141 spd GJ%GIV 000001 000000 sin PBOUT 104000 000074 int TEXT 000000 ext CMDBUF 000000 ext GJ%GND 000040 000000 sin PBOUT% 104000 000074 int TIMDEL 000000 ext CMDER1 000000 ext GJ%NEW 200000 000000 sin PM%CNT 400000 000000 sin TIMEON 000000 ext CMDERR 000000 ext GJ%OLD 100000 000000 sin PM%EPN 000200 000000 sin TRMCOD 500000 spd CMDFRM 000000 ext GJ%UHV 004000 000000 sin PM%RD 100000 000000 sin TTIPAR 000000 ext CMDPDL 000000 ext GJFX51 602211 int PMAP% 104000 000056 int TTYJFN 000000 ext CMDPLN 000200 spd GMKCPS 000000 ext POPJFN 000000 ext TTYOB 000000 ext CMLOC 000000 ext GRDMAP 000000 ext PSOUT 104000 000076 int TTYOU 000000 ext CMPOFF 000000 ext GTFDB% 104000 000063 int PSOUT% 104000 000076 int TVTBUF 000000 ext CMPON 000000 ext HANDSH 000000 ext PTYTTY 000000 ext TVTFLG 000000 ext CMSEEN 000000 ext IAC 000377 spd Q1 000005 spd UNARPA 000000 ext CODE 000000 ext IACIAC 000000 ext Q2 000006 spd UNBITS 000000 ext CONST 000000 ext IOX4 600220 int Q3 000007 spd VSOCT 000000 ext CPLOC 000000 ext ISNULJ 000000 ext Q4 000010 spd VSOMX 000000 ext CPSEEN 000000 ext JFNS 104000 000030 int Q5 000011 spd VSOTC 000000 ext CRLF 000000 ext JFNS% 104000 000030 int R 000000 ext VTERMF 000000 ext CX 000016 JOBTAB 000000 ext REPARA 000000 ext XJRSTF 254240 000000 int CZ%NCL 040000 000000 sin JS%DEV 700000 000000 sin RET 263740 000000 XMOVEI 415000 000000 int DATA 000000 ext KFORK% 104000 000153 int RFIELD 000000 ext XSFM 254600 000000 int DATBUF 000000 ext LOCAL 000000 ext RFLDE 000000 ext %%JSER 000000 ext DEFICS 000000 spd M 100000 000000 spd RLJFN% 104000 000023 int ..MSK 777777 777777 spd DEFINF 000000 ext MOVSLJ 016000 000000 RM%PEX 010000 000000 sin .A16 000016 spd DEFITA 000000 spd MOVST 015000 000000 RMAP% 104000 000061 int .CHBEL 000007 sin DEFITF 203500 000000 spd N 200000 000000 spd RSKP 000000 ext .CHBSP 000010 sin DEFITO 011610 spd NBICT 000000 ext S 400000 000000 spd .CHCBS 000034 sin DEVST% 104000 000121 int NETJFN 000000 ext SBK 000000 ext .CHCCF 000036 sin K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE .CHCNA 000001 sin .FBBYV 000011 sin .CHCNB 000002 sin .FHSLF 400000 sin .CHCNC 000003 sin .FP 000015 spd .CHCND 000004 sin .FPAC 000005 spd .CHCNE 000005 sin .GJDEF 000000 sin .CHCNF 000006 sin .GJNHG 777777 sin .CHCNN 000016 sin .JIBAT 000011 sin .CHCNO 000017 sin .JSAOF 000001 sin .CHCNP 000020 sin .NULIO 377777 sin .CHCNQ 000021 sin .P08 540000 000000 sin .CHCNR 000022 sin .PAREV 000003 spd .CHCNS 000023 sin .PARMK 000002 spd .CHCNT 000024 sin .PARNO 000000 spd .CHCNU 000025 sin .PAROD 000004 spd .CHCNV 000026 sin .PARSP 000001 spd .CHCNW 000027 sin .PRIIN 000100 sin .CHCNX 000030 sin .PRIOU 000101 sin .CHCNY 000031 sin .PX7 610001 000000 spd .CHCNZ 000032 sin .RHALF 777777 sin .CHCRB 000035 sin .SAC 000016 .CHCRT 000015 sin .SAV1 000000 ext .CHCUN 000037 sin .SAV2 000000 ext .CHDAS 000055 sin .SAV3 000000 ext .CHDBQ 000042 spd .CHDEL 000177 sin .CHESC 000033 sin .CHFFD 000014 sin .CHHYP 000055 sin .CHLFD 000012 sin .CHLPA 000050 spd .CHLPT 000074 spd .CHNUL 000000 sin .CHRPA 000051 spd .CHRPT 000076 spd .CHSEM 000073 sin .CHSNQ 000047 spd .CHSPC 000040 sin .CHTAB 000011 sin .CHUPA 000136 spd .CHVTB 000013 sin .CMCFM 000010 sin .CMDAT 000001 sin .CMDEV 000016 sin .CMFIL 000006 sin .CMFLG 000000 sin .CMFLT 000015 sin .CMFNP 000000 sin .CMKEY 000000 sin .CMNUM 000001 sin .CMQST 000021 sin .CMSWI 000003 sin .CMTOK 000023 sin .CMTXT 000017 sin .DVDSK 000000 sin .DVNUL 000015 sin K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT CODE ASCZCP 003775' ext GETCRT 003236' PUTPAR 004325' ent VSOCT 002477' ext ATMBUF 005034' ext GMKCPS 002705' ext R 004452' ext VSOMX 002753' ext BSRCH1 001420' HANDSH 002073' ext RFIELD 002064' ext VSOTC 003067' ext BSRCH2 001424' IACIAC 002444' ext RFLDE 004163' ext VTERMF 002561' ext BSRCHS 001335' INILIN 003017' ext RRSLIN 003071' ext $CAPTU 002735' ent BUFBEG 001214' INPBFA 001332' RSKP 004420' ext $CAPUX 003071' CAPHRL 003075' INPBFC 001215' ent SBK 000000 ext $INP4A 000302' CAPMXL 003776 spd INPBTC 001331' SEOLCH 000000 ext $INPCL 000400' CAPTFS 002722' INPCLR 001203' ent SESFLG 001571' ext $INPU9 000317' CARIER 001501' ext ISNULJ 002040' ext SESJFN 001567' ext $INPUT 000274' ent CCOFF2 002523' ext JOBTAB 000000 ext SINLFD 002155' $INPUX 000363' CCON 003015' ext LCLPAR 004304' ext SINRET 002213' $INPUY 000362' CESCXP 003451' ent LOOPIO 000624' SPACE 003734' ent $OUTP4 001476' CFMRTN 001451' ext LOOPOV 000630' SPADCH 000000 ext $OUTPU 001461' ent CHKLIN 001500' ext LOOPTM 000626' SSTHDR 000000 ext $SETPA 004202' ent CHKPAA 004375' M1STCH 000636' STATIM 002344' ext $SINSE 000076' CHKPAR 004371' ent MAPRET 002153' STR2BP 000645' $SINSI 000065' CHKSEC 001703' ext MAPSEC 002147' STRBF2 004673' ext $TRAN1 002230' CHRMOV 003445' MARK 003732' ent STRBUF 004701' ext $TRAN2 002275' CHRMUP 003447' MATCHS 000646' STRC 003176' ext $TRAN3 002345' CJFNBK 004702' ext MOVCHR 003357' ext STRPTR 001341' ext $TRAN4 002405' CLRBUF 002557' ext MOVSUP 000640' STXFDB 001605' ext $TRAN5 002413' CLREST 003306' ext MRKTAB 001426' SUBCAL 260740 spd $TRAN6 002430' CMDER1 002145' ext MYCAPS 000000 ext SUBCHR 003756' $TRAN7 002511' CMDERR 004175' ext NBICT 003253' ext TAKJFN 000342' ext $TRANS 002214' ent CMLOC 002314' ext NETINS 000405' TCSASW 001615' $TRANT 002613' CMPOFF 002522' ext NETJFN 004255' ext TDEFPL 002053' ext $TRANX 002522' CMPON 002317' ext NETPRN 001153' TDEFPP 000000 ext %%JSER 004235' ext CMPRMN 000642' int NOIRTN 004106' ext TDEFPS 000000 ext %EOFSW 000000 spd CMSEEN 002352' ext NONE 003731' ent TEOFCH 001731' ext %MAXSW 000003 spd CPLOC 002316' ext NRTFLG 004261' ext TEOFSW 001624' %SILSW 000001 spd CPSEEN 002412' ext NSICI 003335' ext TIMDEL 000375' ext %TCASW 000005 spd CRLF 004102' ext NSIMX 003337' ext TIMEON 002302' ext %TIMSW 000002 spd CVTOCT 003641' NSITC 003340' ext TIMEOU 001735' ext %TPASW 000004 spd DATBUF 004523' ext NTRIGR 001121' TMAXLN 001733' ext ..0030 000023' spd DEFINF 004174' ext NUL4 000350' ext TMAXSW 001652' ..0031 000024' spd DOARPA 002307' ext OCTMOV 003637' TOBSER 001741' ext ..0040 000046' spd DOBITS 002310' ext ODD 003742' ent TPAUSE 001737' ext ..0041 000052' spd DUPLEX 002421' ext OPNPAR 004257' ext TRANOT 002635' ..0042 000052' spd EBQ 004252' ext PADBUF 004421' ent TRAPAU 001673' ext ..0056 000062' spd EBQR 004250' ext PARCHR 004315' TRCAPD 001715' ..0057 000065' spd ELPTIM 002635' ext PARITY 004372' ext TSETSD 001715' ext ..0066 000103' spd EMAP30 002146' PARS10 002517' ext TSILEN 000000 ext ..0070 000111' spd ENDTIM 002376' ext PARS12 002052' ext TSILSW 001603' ..0075 000112' spd EOFOVR 003377' PARS2 003010' ext TTFORK 004240' ext ..0113 000133' spd ERRPTR 002043' ext PARS3 004207' ext TTIMSW 001636' ..0114 000134' spd ESCCHR 003532' ent PARS4 004205' ext TTIPAR 004413' ext ..0127 000177' spd ESCMOV 003530' PARS5 001707' ext TTPASW 001673' ..0132 000171' spd ESCTKN 000000 ext PARS6 004225' ext TTYJFN 003333' ext ..0137 000167' spd ESIN30 002154' PARS7 004222' ext TTYOB 002312' ext ..0145 000174' spd EVEN 003736' ent PARS8 004203' ext TTYOU 002563' ext ..0146 000177' spd EVNODD 003745' PARS9 002365' ext TVTBUF 004637' ext ..0155 000204' spd FILJFN 003105' ext POPJFN 000362' ext TVTFLG 004424' ext ..0163 000223' spd FRCLOS 003011' ext PTYFLG 004267' ext UNARPA 002565' ext ..0164 000226' spd GENPAR 004346' ent PUTPAA 004331' ent UNBITS 002564' ext ..0165 000213' spd K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT CODE ..0172 000222' spd ..0613 001042' spd ..1737 002204' spd ..2515 003241' spd ..0201 000217' spd ..0615 001067' spd ..1740 002206' spd ..2516 003346' spd ..0202 000222' spd ..0632 001101' spd ..1745 002223' spd ..2526 003274' spd ..0213 000251' spd ..0634 001106' spd ..1746 002230' spd ..2527 003306' spd ..0221 000246' spd ..0642 001133' spd ..1750 002273' spd ..2530 003267' spd ..0222 000250' spd ..0657 001141' spd ..1755 002250' spd ..2542 003273' spd ..0223 000264' spd ..0661 001170' spd ..1763 002261' spd ..2544 003302' spd ..0230 000265' spd ..0704 001254' spd ..1771 002275' spd ..2560 003317' spd ..0235 000273' spd ..0715 001266' spd ..1777 002303' spd ..2571 003341' spd ..0243 000302' spd ..0722 001317' spd ..2001 002313' spd ..2577 003362' spd ..0245 000306' spd ..0727 001320' spd ..2015 002353' spd ..2600 003365' spd ..0253 000316' spd ..0734 001304' spd ..2031 002367' spd ..2603 003372' spd ..0261 000325' spd ..0745 001316' spd ..2032 002401' spd ..2610 003375' spd ..0266 000327' spd ..0755 001364' spd ..2033 002365' spd ..2611 003404' spd ..0273 000337' spd ..0762 001370' spd ..2040 002366' spd ..2623 003412' spd ..0311 000360' spd ..0763 001353' spd ..2047 002405' spd ..2631 003432' spd ..0317 000355' spd ..0770 001354' spd ..2051 002413' spd ..2632 003434' spd ..0320 000360' spd ..0773 001376' spd ..2065 002421' spd ..2640 003464' spd ..0321 000373' spd ..1000 001377' spd ..2067 002466' spd ..2641 003510' spd ..0327 000373' spd ..1007 001451' spd ..2076 002455' spd ..2651 003501' spd ..0341 000376' spd ..1013 001510' spd ..2105 002461' spd ..2653 003526' spd ..0350 000412' spd ..1023 001545' spd ..2106 002466' spd ..2666 003565' spd ..0351 000622' spd ..1032 001537' spd ..2111 002477' spd ..2673 003567' spd ..0356 000424' spd ..1041 001544' spd ..2116 002511' spd ..2676 003605' spd ..0361 000435' spd ..1042 001545' spd ..2125 002517' spd ..2717 003672' spd ..0367 000426' spd ..1046 001602' spd ..2133 002517' spd ..2727 003702' spd ..0370 000434' spd ..1060 001602' spd ..2145 002557' spd ..2735 003702' spd ..0375 000437' spd ..1101 001612' spd ..2147 002551' spd ..2745 003713' spd ..0403 000465' spd ..1102 001613' spd ..2154 002557' spd ..2755 003721' spd ..0410 000471' spd ..1105 001644' spd ..2163 002566' spd ..3136 003767' spd ..0411 000505' spd ..1121 001647' spd ..2175 002610' spd ..3137 003772' spd ..0412 000502' spd ..1125 001660' spd ..2204 002605' spd ..3144 004020' spd ..0417 000505' spd ..1133 001664' spd ..2214 002620' spd ..3150 004015' spd ..0422 000615' spd ..1147 001670' spd ..2215 002632' spd ..3164 004033' spd ..0431 000534' spd ..1153 001701' spd ..2233 002650' spd ..3172 004031' spd ..0436 000537' spd ..1167 001712' spd ..2234 002660' spd ..3200 004064' spd ..0437 000540' spd ..1173 001731' spd ..2250 002710' spd ..3202 004043' spd ..0445 000555' spd ..1200 001743' spd ..2251 002716' spd ..3214 004053' spd ..0452 000600' spd ..1210 001775' spd ..2276 002771' spd ..3215 004056' spd ..0457 000605' spd ..1216 001772' spd ..2304 002754' spd ..3222 004073' spd ..0460 000615' spd ..1217 001775' spd ..2312 002766' spd ..3306 004137' spd ..0466 000655' spd ..1231 002035' spd ..2313 002771' spd ..3307 004142' spd ..0473 000663' spd ..1237 002015' spd ..2320 003014' spd ..3314 004146' spd ..0502 000675' spd ..1245 002034' spd ..2327 003014' spd ..3322 004153' spd ..0514 000750' spd ..1262 002050' spd ..2340 003020' spd ..3330 004160' spd ..0516 000733' spd ..1273 002057' spd ..2341 003071' spd ..3337 004160' spd ..0524 000733' spd ..1274 002067' spd ..2346 003041' spd ..3340 004200' spd ..0535 000740' spd ..1303 002102' spd ..2357 003061' spd ..3345 004174' spd ..0543 000760' spd ..1313 002122' spd ..2360 003070' spd ..3346 004177' spd ..0555 000773' spd ..1314 002132' spd ..2401 003120' spd ..3347 004217' spd ..0563 001000' spd ..1331 002145' spd ..2402 003127' spd ..3354 004220' spd ..0565 001013' spd ..1713 002172' spd ..2414 003164' spd ..3361 004241' spd ..0572 001015' spd ..1722 002166' spd ..2434 003145' spd ..3372 004250' spd ..0573 001054' spd ..1723 002170' spd ..2435 003156' spd ..3374 004304' spd ..0601 001031' spd ..1724 002207' spd ..2444 003205' spd ..3401 004311' spd K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT CODE ..3402 004303' spd ..3410 004267' spd ..3415 004300' spd ..3420 004275' spd ..3425 004300' spd ..3434 004311' spd ..3453 004317' spd ..3454 004324' spd ..3462 004407' spd ..3463 004420' spd ..3464 004445' spd ..IFT 200000 000001 spd ..JX1 200000 000000 spd ..MX1 000004 spd ..MX2 000001 spd ..TX1 200000 000000 spd ..TX2 000001 spd .CAPTU 002724' ent .INPU0 000147' .INPU1 000226' .INPU2 000237' .INPUT 000142' ent .OUTPU 001435' ent .SETIN 000000' ent .SETPA 004105' ent .SINCA 000007' .SINDT 000032' .SINSE 000066' .SINTA 000117' .TRAN0 001754' .TRAN1 001756' .TRAN2 001775' .TRAN3 002052' .TRANE 002105' .TRANS 001744' ent K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT CONST ATMBPS 004026' SPWFDB 004101' ATMBUF 004027' ext SPWFDD 004104' BTRNST 001111' SSTHDR 000000 ext BTRNSU 001311' STPART 004067' int CAPBK 000255' SUBCLA 003612' CAPBKL 000010 spd SUBDIG 003577' CAPSWI 000252' SUBFDB 004003' CASFDB 000207' SUBLOL 003544' CASTAB 000007' int SUBUPL 003511' CHRTAB 000307' int TCHDBQ 003652' spd CHRTUP 000507' int TCHLPA 003654' spd DIGFDB 003641' TCHLPT 003656' spd EPAR7T 002111' TCHRPA 003655' spd EPAR8T 003111' TCHRPT 003657' spd ESCTAB 000707' TCHSNQ 003653' spd ESCTKN 003613' ext TCHUPA 003640' spd GRMFDB 003660' TDEFPS 000223' ext GSNTAB 003620' TIMFDB 000170' GTK0 003665' spd TINFDB 000005' GTKO 003775' spd TRANFD 000164' GTKP 004000' spd TRANFS 000162' GTKT 003662' sin TRANFT 000146' int HANDSH 000000 ext TRDFDB 000220' INCFD1 000016' TRNBK 000127' INCFDB 000013' TRNBKL 000010 spd INDFD1 000024' TRNSWD 000200' INDFDB 000021' TRNSWI 000137' INPFD1 000056' TXTFD1 000064' INPFDB 000053' TXTFD2 000067' INPSW1 000051' TXTFDB 000061' INPSWF 000047' UPPFDB 003647' INPSWI 000045' %TLAST 000006 spd INTFD1 000042' ..XX 003002 000000 spd INTFDB 000037' ITATAB 000032' LOLFDB 003644' MAXFDB 000174' int MPAR7T 001711' MPAR8T 002711' OCTTAB 001010' OPAR7T 002311' OPAR8T 003311' OUTFDB 000115' PARSWI 004042' PARTAB 004031' PCHARS 004117' SCHRPR 004062' SEOLCH 000000 ext SERTLN 000200 spd SINTAB 000000' SPADCH 000000 ext SPAFDB 004074' SPAFDD 004077' SPAR7T 001511' SPAR8T 002511' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT TEXT INPINI 000366' int PARS4 000365' ext PARS5 000344' ext PARS6 000333' ext PARS8 000351' ext K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-8 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT EDATA EACS 000017' F1ST 000001' spd FBYTEP 000012' FBYTES 000005' FBYTEW 000006' FJFN 000000' FLASTA 000023' spd FMSECF 000014' FPAGFB 000016' FPMAPW 000011' FRPAGE 000015' FSIZEB 000003' FSIZEC 000007' FSIZEF 000001' FSIZEP 000004' FSMAPW 000010' FWHACK 000021 spd K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-9 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT ECODE EMAPFI 000000' EMAPR1 000170' EMAPR2 000165' ESINLF 000514' ESINMT 000512' ESINR1 000605' ESINR2 000603' ESINRE 000610' ESQUAW 000466' GRDMAP 000630' ext SMP1ST 000173' SMPNXT 000224' ..1340 000022' spd ..1341 000024' spd ..1351 000040' spd ..1352 000042' spd ..1362 000055' spd ..1366 000070' spd ..1400 000102' spd ..1401 000103' spd ..1407 000123' spd ..1410 000124' spd ..1420 000151' spd ..1431 000161' spd ..1432 000165' spd ..1433 000205' spd ..1440 000207' spd ..1446 000221' spd ..1457 000250' spd ..1467 000255' spd ..1473 000262' spd ..1507 000267' spd ..1513 000335' spd ..1520 000370' spd ..1526 000304' spd ..1537 000316' spd ..1550 000334' spd ..1561 000353' spd ..1572 000370' spd ..1576 000403' spd ..1603 000404' spd ..1611 000420' spd ..1615 000442' spd ..1622 000443' spd ..1630 000433' spd ..1631 000437' spd ..1636 000450' spd ..1640 000457' spd ..1645 000460' spd ..1652 000531' spd ..1661 000526' spd ..1663 000551' spd ..1675 000566' spd ..1677 000571' spd K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-10 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT ECONST LFDTBL 000020' K20IOC Kermit Input/Output statement Control MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-11 K20IOC MAC 12-May-24 20:27 SYMBOL TABLE FOR PSECT DATA CHKINT 000001' int GENINT 000000' int INCASE 000011' int INDEFC 000014' int INDEFF 000013' int INDEFS 000016' int INDEFT 000012' int INDEFW 000015' int INPBUF 001226' int INPCBF 001223' int INPCNT 001224' int INPPTR 001225' INTIMA 000010' int ORNETC 001221' ORNETP 001222' PAR2ND 000007' PARACT 000004' int PARBLA 000006' PARPKO 000002' int PARRCK 000003' int PARSUB 000005' int SERTAB 001021' TRGCHR 001016' TRNBAS 001017' ZSIZEB 002226' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20DSP MAC 20-Aug-24 23:41 Preliminaries 23226 title k20dsp - Kermit-20 Display Routines 23227 23228 ; All display code was removed from k20mit and moved to this module as 23229 ; part of Edit 194 to address the issue of a very large single source 23230 ; file that unexpectedly began generating MCRNEC errors. 23231 ; 23232 ; During this time, some code was rewritten to decrease symbol table 23233 ; usage, to (hopefully) clean up control flow and provide for 23234 ; additional checking and better recovery. Speed ups were not avoided 23235 ; where possible, typically space being traded for time. However, 23236 ; this was not done at the expense of clarity, maintainability being 23237 ; of paramount concern. 23238 ; 23239 ; The code here should be differentiated from the extensive help text 23240 ; which is contained in k20hlp, which is constant, does not change 23241 ; during runtime and resides in its own .PSECT. The text here is 23242 ; dynamically generated. 23243 23244 subttl Preliminaries 23245 23246 search monsym,macsym,cmd,k20unv ;[194] 23247 cmdacs ^ ;Clean up p1-p4 definitions 23248 23249 sall ; Tidy listing 23250 .directive flblst ; We don't need to see all the ASCIZ bytes... 23251 23252 remark common parsing external data 23253 23254 extern pars1 ; Data from first parse. 23255 extern pars2 ; Data from second parse. 23256 extern pars3 ; Data from third parse. 23257 extern pars4 ; Data from fourth parse. 23258 extern pars5 ;[41] ... 23259 23260 remark for file handling 23261 23262 extern filjfn ; JFN of currently open file 23263 23264 remark other useful routines and data 23265 23266 extern qlog ; Quit logging 23267 extern %%jser ; Support for error macros 23268 extern %%smsg ; Support for smsg macro 23269 extern BOUTI% ;[216] BOUT% Internal 23270 extern errptr ; Pointer to error message 23271 extern getnti ; Get information about line 23272 extern ccon, ccoff ; Handle control-C, if we have it 23273 extern crlf ; Carriage return line feed 23274 extern crlflf ; As previous, but double line feed 23275 extern ttyjfn ; JFN on local terminal 23276 extern $priou ; Terminal primary output 23277 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20DSP MAC 20-Aug-24 23:41 Various NUL: ASCII strings and lengths 23278 subttl Various NUL: ASCII strings and lengths 23279 23280 .psect text ; Text goes in text psect 23281 000000'01 472531 435032 nulnam: byte (7) "N","U","L",":", .chcrt, .chlfd, .chlfd, .chnul 23282 000002'01 252352 546164 astnul: byte (7) "*","N","U","L",":", .chnul 23283 .endps text 23284 23285 .psect const ; Read-only constants go in constants psecn 23286 000000'02 44 07 0 00 000000# nulptr: point 7, nulnam ; Pointer to fixed "NUL:" string 23287 000001'02 777777 777770 -^d8 ; "NUL:" (4) + crlflf (4) 23288 000002'02 44 07 0 00 000000# nul5: point 7, astnul ; Pointer to fixed "*NUL:" ASCIZ 23289 000003'02 777777 777773 -^d5 ; Length of same 23290 .endps const ; End of constants 23291 23292 .psect code/ronly ; Don't allow stores 23293 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20DSP MAC 20-Aug-24 23:41 Clear Control-O, if set 23294 subttl Clear Control-O, if set 23295 23296 ; Preserves all registers, +1 always 23297 ; 23298 ; This is concerned about the local controlling terminal, not anything 23299 ; remote over a pseudo-terminal, network or (maybe) pipe. 23300 23301 000000'03 clrcno: entry clrcno 23302 000000'03 265 16 0 00 004644' saveac ; Just don't touch 23303 23304 000001'03 200 01 0 00 000000* move t1, $PRIOU ; Whatever is best to choose for primary output 23305 000002'03 104 00 0 00 000107 RFMOD% ; Find out about control-O 23306 000003'03 320 12 0 00 000005' ifje. r ; Failed?? 23307 000004'03 254 00 0 00 000010' 23308 000005'03 200 04 0 00 000001 move t4, t1 ; Save error, just in case 23309 000006'03 400 02 0 00 000000 setz t2, ; Assume ^O has not been typed 23310 000007'03 200 01 0 00 000001* move t1, $PRIOU ; Reload JFN or device, just in case 23311 000010'03 endif. 23312 23313 000010'03 627 02 0 00 400000 txzn t2, tt%osp ; Is Output suppress (^O) on? 23314 000011'03 263 17 0 00 000000 ret ; No, nothing to do 23315 000012'03 104 00 0 00 000110 SFMOD% ; Otherwise, turn it off 23316 000013'03 320 12 0 00 000015' ifje. r ; Failed?? But we just read it... 23317 000014'03 254 00 0 00 000017' 23318 000015'03 200 04 0 00 000001 move t4, t1 ; Save error, just in case 23319 000016'03 200 01 0 00 000007* move t1, $PRIOU ; Reload JFN or device, just in case 23320 000017'03 endif. 23321 23322 000017'03 263 17 0 00 000000 ret ; Done 23323 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20DSP MAC 20-Aug-24 23:41 typnam - Type a file name 23324 subttl typnam - Type a file name 23325 23326 ; t1/ Output JFN or designator 23327 ; t2/ JFN to render 23328 ; 23329 ; Updates t1, if string pointer 23330 ; 23331 ; +1/ If failed along the way (t1 unchanged) 23332 ; +2/ Succeeded 23333 23334 000020'03 typnam: entry typnam ;[220] 23335 000020'03 265 16 0 00 004656' saveac ; Save these anyway 23336 000021'03 200 05 0 00 000001 move q1, t1 ; Save output designator 23337 000022'03 400 04 0 00 000000 setz t4, ; No string prefix or stop character 23338 23339 000023'03 302 02 0 00 377777 caie t2, .nulio ;[193] NUL: talisman? 23340 000024'03 254 00 0 00 000035' ifskp. ;[193] Yes, that's easy 23341 000025'03 120 02 0 00 000000# dmove t2, nulptr ;[193] Point to equivalent string 23342 000026'03 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 23343 000027'03 320 12 0 00 000031' ifje. r ;[194] Failed?? 23344 000030'03 254 00 0 00 000034' 23345 000031'03 200 04 0 00 000001 move t4, t1 ;[193] Save error for debuggers 23346 000032'03 200 01 0 00 000005 move t1, q1 ;[193] Restore output designator 23347 000033'03 263 17 0 00 000000 ret ;[194] Give error return 23348 000034'03 endif. ;]194] End SOUT% error handling 23349 000034'03 254 00 0 00 000053' else. ;[193] Otherwise, a real JFN 23350 000035'03 400 03 0 00 000000 setz t3, ; Default formatting 23351 000036'03 104 00 0 00 000030 JFNS% ; Type it someplace 23352 000037'03 320 12 0 00 000041' ifje. r ;[194] Failed?? 23353 000040'03 254 00 0 00 000044' 23354 000041'03 200 04 0 00 000001 move t4, t1 ;[194] Save error for debuggers 23355 000042'03 200 01 0 00 000005 move t1, q1 ;[194] Restore output designator 23356 000043'03 263 17 0 00 000000 ret ;[194] Give error return 23357 000044'03 endif. ;]194] End JFN% error handling 23358 dmove t2, [ point 7, crlflf ;[194] Double linefeed 23359 000044'03 120 02 0 00 004670' -^d4 ] ;[194] Four characters total in string 23360 000045'03 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 23361 000046'03 320 12 0 00 000050' ifje. r ;[194] Failed?? 23362 000047'03 254 00 0 00 000053' 23363 000050'03 200 04 0 00 000001 move t4, t1 ;[193] Save error for debuggers 23364 000051'03 200 01 0 00 000005 move t1, q1 ;[193] Restore output designator 23365 000052'03 263 17 0 00 000000 ret ;[194] Give error return 23366 000053'03 endif. ;]194] End SOUT% error handling 23367 000053'03 endif. ;[193] End .nulio special casing 23368 23369 000053'03 254 00 0 00 000000* retskp ;[194] Won!! 23370 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20DSP MAC 20-Aug-24 23:41 Routine to type a file at the local terminal. 23371 subttl Routine to type a file at the local terminal. 23372 23373 ; Call: 23374 ; 23375 ; t1/ JFN of file to type 23376 ; t3/ Byte size 23377 ; 23378 ; Returns +1, If anything strange 23379 ; +2, Success 23380 ; 23381 ; Rewritten be a little more picky about the calling arguments and to 23382 ; use PMAP% instead of SIN%. Passing a HRROI in to a file opened in 8 23383 ; bit mode did the wrong thing, anyway. 23384 ; 23385 ; Will also generate parity for a seven bit file, if we're asked to 23386 ; to do that. That should normally never happen as the monitor should 23387 ; be handling this. The code here is largely for testing purposes. 23388 ; 23389 ; Note: The routine checks for a byte size between 1 and 36, however 23390 ; only a byte size of 7 or 8 are properly handled, everything 23391 ; but 8 being displayed as a seven bit (I.E., ASCII) file. This 23392 ; will properly type 36 bit listings generated by PA1050 and is 23393 ; no worse then the previous (incorrect) behavior. 23394 ; 23395 ; N.B., For an eight bit file, parity must be ignored--you're on your 23396 ; own... 23397 23398 000054'03 typfil: entry typfil ;[220] 23399 000054'03 265 16 0 00 004672' saveac 23400 23401 000055'03 514 05 0 00 000001 hrlz q1, t1 ; Save JFN, start at file page zero 23402 000056'03 621 01 0 00 777777 tlz t1, -1 ; Whack any flags left lying around 23403 000057'03 306 01 0 00 377777 cain t1, .nulio ; Asked to type NUL:? 23404 000060'03 254 00 0 00 000053* retskp ; That's easy; we're done already! 23405 23406 000061'03 323 03 0 00 000066' ifg. t3 ; Could the byte size be reasonable? 23407 000062'03 303 03 0 00 000044 caile t3, ^d36 ; Yes, but is it actually so? 23408 000063'03 254 00 0 00 000066' anskp. ; No, it's delusional 23409 000064'03 200 06 0 00 000003 move q2, t3 ; It's fine, so save the validated file byte size 23410 000065'03 254 00 0 00 000106' else. ; Otherwise, byte size is some kind of gubbish 23411 000066'03 200 01 0 00 000000# txmsg <% KERMIT-20 can not type a file with a byte size of: > 23412 000067'03 104 00 0 00 000076 23413 000070'03 320 12 0 00 000071' 23414 000004'02 000000000000# 23415 000000'04 045 040 113 105 122 23416 000071'03 201 01 0 00 000101 movei t1, .priou ; continue on this terminal 23417 000072'03 200 02 0 00 000003 move t2, t3 ; Load it where NOUT% wants it 23418 000073'03 201 03 0 00 000012 movei t3, ^d10 ; Base ten 23419 000074'03 104 00 0 00 000224 NOUT% ; Type the bogus byte size 23420 000075'03 320 12 0 00 000077' ifje. r ; Catch and ignore error 23421 000076'03 254 00 0 00 000103' 23422 000077'03 200 04 0 00 000001 move t4, t1 ; Store error for debugger 23423 000100'03 200 01 0 00 000000# txmsg <*ERROR*> ; About as good as we can do 23424 000101'03 104 00 0 00 000076 23425 000102'03 320 12 0 00 000103' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-1 K20DSP MAC 20-Aug-24 23:41 Routine to type a file at the local terminal. 23426 000005'02 000000000000# 23427 000013'04 052 105 122 122 117 23428 000103'03 endif. ; End NOUT% error handling 23429 000103'03 561 01 0 00 000000* hrroi t1, crlf ; Tie off the line 23430 000104'03 104 00 0 00 000076 PSOUT% 23431 000105'03 263 17 0 00 000000 ret ; Return a failure 23432 000106'03 endif. ; End byte size checking 23433 23434 000106'03 104 00 0 00 000024 GTSTS% ; Otherwise, see if we can use the JFN at all 23435 000107'03 320 12 0 00 000111' ifje. r ; Failed?? 23436 000110'03 254 00 0 00 000131' 23437 000111'03 200 04 0 00 000001 move t4, t1 ; Store error for debugging 23438 000112'03 200 01 0 00 000000# emsg ;Begin complaining 23439 000113'03 104 00 0 00 000313 23440 000006'02 000000000000# 23441 000015'04 103 141 156 047 164 23442 000114'03 201 01 0 00 000101 movei t1, .priou ; continue on this terminal 23443 000115'03 554 02 0 00 000005 hlrz t2, q1 ; Load JFN, which was stored prepratory to PMAP%ing 23444 000116'03 201 03 0 00 000010 movei t3, ^d8 ; JFN's are base 8 23445 000117'03 104 00 0 00 000224 NOUT% ; Type it (or try to, anyway) 23446 000120'03 320 12 0 00 000122' ifje. r ; Catch and ignore error 23447 000121'03 254 00 0 00 000126' 23448 000122'03 200 04 0 00 000001 move t4, t1 ; Store error for debugger 23449 000123'03 200 01 0 00 000000# txmsg <*ERROR*> ; About as good as we can do 23450 000124'03 104 00 0 00 000076 23451 000125'03 320 12 0 00 000126' 23452 000007'02 000000000000# 23453 000022'04 052 105 122 122 117 23454 000126'03 endif. ; End NOUT% error handling 23455 000126'03 561 01 0 00 000103* hrroi t1, crlf ; And tie off the complaint 23456 000127'03 104 00 0 00 000076 PSOUT% 23457 000130'03 263 17 0 00 000000 ret ; And get out of here 23458 000131'03 endif. ; End case JSYS error handling 23459 23460 000131'03 603 02 0 00 000200 ifxe. t2, gs%nam ; So does anything in there smell like a JFN? 23461 000132'03 254 00 0 00 000154' 23462 000133'03 200 04 0 00 000001 move t4, t1 ; Store error for debugging 23463 000134'03 200 01 0 00 000000# emsg ;Begin complaining 23464 000135'03 104 00 0 00 000313 23465 000010'02 000000000000# 23466 000024'04 103 141 156 047 164 23467 000136'03 201 01 0 00 000101 movei t1, .priou ; continue on this terminal 23468 000137'03 554 02 0 00 000005 hlrz t2, q1 ; Load JFN, which was stored prepratory to PMAP%ing 23469 000140'03 201 03 0 00 000010 movei t3, ^d8 ; JFN's are base 8 23470 000141'03 104 00 0 00 000224 NOUT% ; Type it (or try to, anyway) 23471 000142'03 320 12 0 00 000144' ifje. r ; Catch and ignore error 23472 000143'03 254 00 0 00 000150' 23473 000144'03 200 04 0 00 000001 move t4, t1 ; Store error for debugger 23474 000145'03 200 01 0 00 000000# txmsg <*ERROR*> ; About as good as we can do 23475 000146'03 104 00 0 00 000076 23476 000147'03 320 12 0 00 000150' 23477 000011'02 000000000000# 23478 000031'04 052 105 122 122 117 23479 000150'03 endif. ; End NOUT% error handling 23480 000150'03 561 01 0 00 000126* hrroi t1, crlf ; And tie off the complaint k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-2 K20DSP MAC 20-Aug-24 23:41 Routine to type a file at the local terminal. 23481 000151'03 104 00 0 00 000076 PSOUT% 23482 000152'03 263 17 0 00 000000 ret ; And get out of here 23483 000153'03 254 00 0 00 000155' else. ; Otherwise, at least the JSYS worked 23484 000154'03 200 04 0 00 000002 move t4, t2 ; So save the status bits past the DVCHR% 23485 000155'03 endif. ; End case initial JFN check 23486 23487 000155'03 104 00 0 00 000117 DVCHR% ; Now let's have a look at the device 23488 000156'03 320 12 0 00 000160' ifje. r ; Failed?? 23489 000157'03 254 00 0 00 000162' 23490 000160'03 200 04 0 00 000001 move t4, t1 ; Get the error out of the way 23491 000161'03 477 02 0 00 000003 setob t2, t3 ; Assume no kind of device 23492 000162'03 endif. 23493 23494 000162'03 135 03 0 00 004710' load t3, dv%typ,t2 ; Pick up the device type 23495 000163'03 306 03 0 00 000015 cain t3, .dvnul ; Did this manage to slip through?? 23496 000164'03 254 00 0 00 000060* retskp ; Strangely, it did; silently ignore it 23497 23498 000165'03 306 03 0 00 000000 cain t3, .dvdsk ; Not a disk? 23499 000166'03 254 00 0 00 000207' ifskp. ; Won't be mapping it, then 23500 000167'03 200 01 0 00 000000# emsg 23501 000170'03 104 00 0 00 000313 23502 000012'02 000000000000# 23503 000033'04 103 141 156 047 164 23504 000171'03 201 01 0 00 000101 movei t1, .priou ; Carry on typing to the terminal 23505 000172'03 554 02 0 00 000005 hlrz t2, q1 ; Load the JFN (which we know is bound) 23506 000173'03 403 03 0 00 000004 setzb t3, t4 ; No special formatting or odd prefix 23507 000174'03 104 00 0 00 000030 JFNS% ; Tell us what we choked on 23508 000175'03 320 12 0 00 000177' ifje. r ; Catch and ignore error 23509 000176'03 254 00 0 00 000203' 23510 000177'03 200 04 0 00 000001 move t4, t1 ; Store error for debugger 23511 000200'03 200 01 0 00 000000# txmsg <*ERROR*> ; About as good as we can do 23512 000201'03 104 00 0 00 000076 23513 000202'03 320 12 0 00 000203' 23514 000013'02 000000000000# 23515 000041'04 052 105 122 122 117 23516 000203'03 endif. ; End NOUT% error handling 23517 000203'03 561 01 0 00 000150* hrroi t1, crlf ; And tie off the complaint 23518 000204'03 104 00 0 00 000076 PSOUT% 23519 000205'03 263 17 0 00 000000 ret ; And get out of here 23520 000206'03 254 00 0 00 000210' else. ; Ok to proceed 23521 000207'03 554 01 0 00 000005 hlrz t1, q1 ; Reload the JFN (which DVCHR% smashed) 23522 000210'03 endif. 23523 23524 000210'03 104 00 0 00 000036 SIZEF% ; Find the file size 23525 000211'03 320 16 0 00 000213' ifje. ; Failed?? 23526 000212'03 254 00 0 00 000216' 23527 000213'03 200 04 0 00 000001 move t4, t1 ; Get the error out of the way 23528 000214'03 403 02 0 00 000003 setzb t2, t3 ; Assume no kind of length 23529 000215'03 554 01 0 00 000005 hlrz t1, q1 ; Reload the JFN, just in case 23530 000216'03 endif. 23531 ; Investigate SIZEF% results 23532 000216'03 322 02 0 00 000164* jumpe t2, rskp ; If no bytes, nothing to do. 23533 000217'03 322 03 0 00 000216* jumpe t3, rskp ; No pages to map? Nothing to do... 23534 000220'03 120 07 0 00 000002 dmove q3, t2 ; Save quantities as loop counters 23535 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-3 K20DSP MAC 20-Aug-24 23:41 Routine to type a file at the local terminal. 23536 000221'03 321 04 0 00 000233' ifxe. t4, gs%opn ; Finally, is the file open? 23537 remark ; It isn't, but we can silently recover 23538 000222'03 200 02 0 00 004711' movx t2,fld(^d8,of%bsz)!of%rd ; Assume reading an 8 bit file 23539 000223'03 302 06 0 00 000010 caie q2, ^d8 ; But!! Not eight bit? 23540 000224'03 200 02 0 00 004712' movx t2,fld(^d7,of%bsz)!of%rd ; Everything else is 7 bit 23541 000225'03 104 00 0 00 000021 OPENF% ; Open it 23542 000226'03 320 12 0 00 000230' %jserr (,r) ; Punt 23543 000227'03 254 00 0 00 000233' 23544 000230'03 265 01 0 00 000000* 23545 000231'03 000000000000# 23546 000232'03 254 00 0 00 000000* 23547 000043'04 125 156 141 142 154 23548 000233'03 endif. ; End case trying to recover from an unopened file 23549 23550 000233'03 260 17 0 00 000427' call whakfp ; Whack anything left over 23551 000234'03 263 17 0 00 000000 ret ; Go no further if something failed 23552 000235'03 302 06 0 00 000007 caie q2, ^d7 ; 7 bit ASCII? 23553 000236'03 254 00 0 00 000242' ifskp. ; OK, routine type out 23554 000237'03 201 04 0 00 005000 movx t4,^d<512*<36/7>> ;Count of seven bit bytes in page 23555 000240'03 505 06 0 00 440700 hrli q2, () ;Using a seven bit pointer, then 23556 000241'03 254 00 0 00 000244' else. ; Otherwise, 8 bit ASCII 23557 000242'03 201 04 0 00 004000 movx t4,^d<512*<36/8>> ;So less bytes per page 23558 000243'03 505 06 0 00 441000 hrli q2, () ;and using an eight bit pointer 23559 000244'03 endif. 23560 000244'03 541 06 0 00 007000 hrri q2, maporg ; Either way, coming from same address 23561 23562 000245'03 do. ; Finally enter loop context 23563 000245'03 200 01 0 00 000005 move t1, q1 ; Case I, load JFN and file page 23564 000246'03 120 02 0 00 004713' dmove t2, [ exp <.fhslf,,mappag>, pm%rd ] 23565 000247'03 104 00 0 00 000056 PMAP% ; Map it in, read-only 23566 000250'03 320 12 0 00 000252' %jserr (,r) ; Punt 23567 000251'03 254 00 0 00 000255' 23568 000252'03 265 01 0 00 000230* 23569 000253'03 000000000000# 23570 000254'03 254 00 0 00 000232* 23571 000050'04 125 156 141 142 154 23572 000255'03 210 03 0 00 000004 movn t3, t4 ; Let's assume the maximum 23573 000256'03 313 04 0 00 000007 camle t4, q3 ; Unless we are within the end of file 23574 000257'03 210 03 0 00 000007 movn t3, q3 ; Otherwise, just do remainder 23575 000260'03 270 07 0 00 000003 add q3, t3 ; Subtract off remaining total 23576 000261'03 200 02 0 00 000006 move t2, q2 ; Load the source pointer 23577 000262'03 200 01 0 00 000000* move t1, parity ; But! Are we putting parity on this? 23578 000263'03 306 01 0 00 000000* cain t1, none ; Anything but none means we might be doing exactly that 23579 000264'03 254 00 0 00 000304' ifskp. ; OK, some some kind of parity being done, check further 23580 000265'03 554 01 0 00 000006 hlrz t1, q2 ; Pick up the default pointer fields 23581 000266'03 306 01 0 00 441000 cain t1, () ; Not doing eight bit? 23582 000267'03 254 00 0 00 000304' anskp. ; No, can't put parity on an eight bit file 23583 000270'03 332 00 0 00 000000* skipe parpko ; Just doing parity on packets? 23584 000271'03 254 00 0 00 000304' anskp. ; Yes, so don't muck up the type out 23585 000272'03 415 16 0 00 000304' block. ; Generate the parity then 23586 000273'03 261 17 0 00 000016 23587 000274'03 265 16 0 00 004715' saveac 23588 000275'03 211 01 0 00 010000 movni t1,^d<4*strblw*2> ; Load maximum count for combined buffers 23589 000276'03 313 01 0 00 000003 camle t1, t3 ; Overflow? (have to compare negative numbers backwards) 23590 000277'03 200 03 0 00 000001 move t3, t1 ; Clip down to maximum k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-4 K20DSP MAC 20-Aug-24 23:41 Routine to type a file at the local terminal. 23591 000300'03 201 01 0 00 000000* movei t1,strbuf ; Resolve address of string buffer 23592 000301'03 505 01 0 00 441000 hrli t1, <(point 8,0)> ;Finish building eight bit pointer 23593 000302'03 260 17 0 00 000000* call genpar ; Generate a new string with parity 23594 000303'03 263 17 0 00 000000 endbk. ; End block context 23595 000304'03 endif. ; End case parity handling 23596 000304'03 201 01 0 00 000101 movei t1, .priou ; Type it on whatever primary output is 23597 000305'03 104 00 0 00 000053 SOUT% ; Counted SOUT% is efficient 23598 000306'03 320 12 0 00 000310' %jserr (,r) ; Punt 23599 000307'03 254 00 0 00 000313' 23600 000310'03 265 01 0 00 000252* 23601 000311'03 000000000000# 23602 000312'03 254 00 0 00 000254* 23603 000055'04 125 156 141 142 154 23604 000313'03 323 07 0 00 000316' jumple q3, endlp. ; Exit if done with all the characters 23605 000314'03 271 05 0 00 000001 addi q1, ^d1 ; Bump to next file page 23606 000315'03 367 10 0 00 000245' sojg q4, top. ; Do it, if any pages left 23607 000316'03 enddo. ; Exit loop lexical context 23608 23609 000316'03 254 00 0 00 000427' jrst whakfp ; Whack any pages 23610 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20DSP MAC 20-Aug-24 23:41 Character echoing routine. 23611 subttl Character echoing routine. 23612 23613 ; Need to do this because having tty open in binary mode overrides ccoc 23614 ; settings. t2 contains character to echo. 23615 ; 23616 ;[151] 23617 23618 000317'03 echo: entry echo ;[196] 23619 000317'03 265 16 0 00 004644' saveac ;[186] Must save all ACs. 23620 23621 000320'03 620 02 0 00 000200 trz t2, 200 ; Strip any parity. 23622 000321'03 200 03 0 00 000002 move t3, t2 ; Make a copy of the character. 23623 23624 000322'03 301 03 0 00 000040 cail t3, 40 ;[18] Check most common case first, 23625 000323'03 303 03 0 00 000126 caile t3, 126 ;[18] namely, whether it's a printable 23626 000324'03 334 00 0 00 000000 skipa ;[18] character. 23627 000325'03 254 00 0 00 000402' jrst echo2 ;[18] If so, just go print it. 23628 23629 000326'03 307 03 0 00 000006 caig t3, 6 ; Check for control char, null thru ^F. 23630 000327'03 254 00 0 00 000354' jrst echo1 23631 000330'03 306 03 0 00 000013 cain t3, 13 ; ^K 23632 000331'03 254 00 0 00 000354' jrst echo1 23633 000332'03 301 03 0 00 000016 cail t3, 16 ; ^N-^Z 23634 000333'03 303 03 0 00 000032 caile t3, 32 23635 000334'03 334 00 0 00 000000 skipa 23636 000335'03 254 00 0 00 000354' jrst echo1 23637 000336'03 301 03 0 00 000034 cail t3, 34 ; ^\-^_ 23638 000337'03 303 03 0 00 000037 caile t3, 37 23639 000340'03 334 00 0 00 000000 skipa 23640 000341'03 254 00 0 00 000354' jrst echo1 23641 000342'03 302 03 0 00 000033 caie t3, 33 ;[194] ESC? 23642 000343'03 254 00 0 00 000346' ifskp. ;[194] Yes 23643 000344'03 201 02 0 00 000044 movei t2, "$" ; Echo as dollar sign 23644 000345'03 254 00 0 00 000402' jrst echo2 23645 000346'03 endif. ;[194] 23646 000346'03 302 03 0 00 000177 caie t3, 177 ;[194] DEL? 23647 000347'03 254 00 0 00 000352' ifskp. ;[194] Yes 23648 000350'03 474 03 0 00 000000 seto t3, ; So it echoes as ^? (100-1=77="?") 23649 000351'03 254 00 0 00 000354' jrst echo1 23650 000352'03 endif. ;[194] 23651 000352'03 200 02 0 00 000003 move t2, t3 ; Anything else, just type it. 23652 000353'03 254 00 0 00 000402' jrst echo2 23653 23654 000354'03 337 01 0 00 000000* echo1: skipg t1, ttyjfn ; Echo it on the tty. 23655 000355'03 201 01 0 00 000101 movei t1, .priou 23656 000356'03 201 02 0 00 000136 movei t2, "^" ; Print an uparrow 23657 000357'03 104 00 0 00 000051 BOUT 23658 000360'03 320 12 0 00 000362' %jserr (,) 23659 000361'03 254 00 0 00 000365' 23660 000362'03 265 01 0 00 000310* 23661 000363'03 000000 000000 23662 000364'03 254 00 0 00 000365' 23663 23664 000365'03 337 01 0 00 000000* skipg t1, sesjfn ;[195] Logging? 23665 000366'03 254 00 0 00 000401' ifskp. ;[195] Yes k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6-1 K20DSP MAC 20-Aug-24 23:41 Character echoing routine. 23666 000367'03 336 00 0 00 000000* skipn sesflg ;[195] Active? 23667 000370'03 254 00 0 00 000401' anskp. ;[195] No 23668 000371'03 306 01 0 00 377777 cain t1, .nulio ;[193] Just dumping it? 23669 000372'03 254 00 0 00 000401' anskp. ;[195] Yeah, don't even bother then 23670 000373'03 104 00 0 00 000051 BOUT ; Yes, do that. 23671 000374'03 320 12 0 00 000376' %jserr (,qlog) ; Error, print msg, close log, rtn from there. 23672 000375'03 254 00 0 00 000401' 23673 000376'03 265 01 0 00 000362* 23674 000377'03 000000 000000 23675 000400'03 254 00 0 00 000000* 23676 000401'03 endif. ;[195] 23677 23678 000401'03 201 02 0 03 000100 movei t2, 100(t3) ; Convert to char to uncontrollified version. 23679 000402'03 337 01 0 00 000354* echo2: skipg t1, ttyjfn ; Back to TTY. 23680 000403'03 201 01 0 00 000101 movei t1, .priou 23681 000404'03 104 00 0 00 000051 BOUT ; Print the character itself. 23682 000405'03 320 12 0 00 000407' %jserr (,) 23683 000406'03 254 00 0 00 000412' 23684 000407'03 265 01 0 00 000376* 23685 000410'03 000000 000000 23686 000411'03 254 00 0 00 000412' 23687 23688 000412'03 337 01 0 00 000365* skipg t1, sesjfn ;[195] Logging? 23689 000413'03 254 00 0 00 000426' ifskp. ;[195] Yes 23690 000414'03 336 00 0 00 000367* skipn sesflg ;[195] Active? 23691 000415'03 254 00 0 00 000426' anskp. ;[195] No 23692 000416'03 306 01 0 00 377777 cain t1, .nulio ;[193] Just dumping it? 23693 000417'03 254 00 0 00 000426' anskp. ;[195] Yeah, don't even bother then 23694 000420'03 104 00 0 00 000051 BOUT ; Yes, do that. 23695 000421'03 320 12 0 00 000423' %jserr (,qlog) ; Error, print msg, close log, rtn from there. 23696 000422'03 254 00 0 00 000426' 23697 000423'03 265 01 0 00 000407* 23698 000424'03 000000 000000 23699 000425'03 254 00 0 00 000400* 23700 000426'03 endif. ;[195] 23701 23702 000426'03 263 17 0 00 000000 ret 23703 23704 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20DSP MAC 20-Aug-24 23:41 Whack a file page, if it exists 23705 subttl Whack a file page, if it exists 23706 23707 000427'03 whakfp: entry whakfp ;[220] 23708 remark RPACS% ; Could have used this, but didn't ... 23709 000427'03 200 01 0 00 007000 move t1, maporg ; Did anything get left lying around? 23710 000430'03 320 12 0 00 000432' ifje. r ; No, so that's fine 23711 000431'03 254 00 0 00 000435' 23712 000432'03 200 04 0 00 000001 move t4, t1 ; But save the error for the curious 23713 000433'03 254 00 0 00 000217* retskp ; Succeed (since nothing to do) 23714 000434'03 254 00 0 00 000445' else. ; Otherwise, ditch whatever is there 23715 000435'03 474 01 0 00 000000 seto t1, ; Case IV, whacking a process page 23716 000436'03 120 02 0 00 004731' dmove t2, [ exp <.fhslf,,mappag>, 0 ] ; From our address space 23717 000437'03 104 00 0 00 000056 PMAP% ; Kick the page into oblivion 23718 000440'03 320 12 0 00 000442' %jserr (,r) 23719 000441'03 254 00 0 00 000445' 23720 000442'03 265 01 0 00 000423* 23721 000443'03 000000000000# 23722 000444'03 254 00 0 00 000312* 23723 000062'04 125 156 141 142 154 23724 000445'03 endif. 23725 23726 000445'03 254 00 0 00 000433* retskp ; And done 23727 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20DSP MAC 20-Aug-24 23:41 STATISTICS external variables 23728 subttl STATISTICS external variables 23729 23730 extern nnak ; Number of NAK's seen 23731 extern ntimou ; Number of time outs 23732 extern pause ; Interpacket pause in milliseconds 23733 extern rpsiz ; Maximum receive packet size 23734 extern rtchr ; Total characters receieved 23735 extern rtot ; Received total characters 23736 extern sec ; Seconds (for figuring baud rate 23737 extern speed ; Line speed, if physical line 23738 extern spsiz ; Maximum send packet size 23739 extern statxt ; Status text 23740 extern stchr ; Total characters sent 23741 extern ewallt ;[207] Elapsed wall time block 23742 extern durtim ;[207] Prints a duration 23743 extern stot ; Sent total characters 23744 extern timerx ; Count of TIMER% JSYS errors 23745 extern ttibin ; BIN% counter 23746 extern ttildb ; ildb's over SIN%'ed data 23747 extern ttimax ; Maximum size a SIN% can do 23748 extern ttisin ; Largest SIN% we ever did 23749 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 23750 subttl STATISTICS command 23751 23752 000446'03 $srvt: entry $srvt ;[194] 23753 000446'03 334 01 0 00 004733' skipa t1,[point 7, statxt] ;[216] Server statistics 23754 000447'03 $stat: entry $stat ;[194] 23755 000447'03 201 01 0 00 000101 movei t1,.priou ;[189] Otherwise local 23756 smsg < 23757 000450'03 120 02 0 00 000000# Maximum number of characters in packet: > ;[189] 23758 000451'03 260 17 0 00 000000* 23759 000014'02 000000000000# 23760 000015'02 777777 777724 23761 000072'04 015 012 040 115 141 23762 000452'03 200 02 0 00 000000* srvnum rpsiz ;[189] 23763 000453'03 201 03 0 00 000012 23764 000454'03 104 00 0 00 000224 23765 000455'03 320 14 0 00 000456' 23766 000456'03 120 02 0 00 000000# smsg < received: > ;[189] 23767 000457'03 260 17 0 00 000451* 23768 000016'02 000000000000# 23769 000017'02 777777 777765 23770 000103'04 040 162 145 143 145 23771 000460'03 200 02 0 00 000000* srvnum spsiz ;[189] 23772 000461'03 201 03 0 00 000012 23773 000462'03 104 00 0 00 000224 23774 000463'03 320 14 0 00 000464' 23775 smsg < sent 23776 000464'03 120 02 0 00 000000# > ;[189] 23777 000465'03 260 17 0 00 000457* 23778 000020'02 000000000000# 23779 000021'02 777777 777771 23780 000106'04 040 163 145 156 164 23781 23782 000466'03 415 16 0 00 000504' block. ;[207] Set up a stack frame for registers 23783 000467'03 261 17 0 00 000016 23784 000470'03 265 16 0 00 004734' saveac ;[207] Holds a pointer to elapsed DK10 ticks double word 23785 000471'03 201 05 0 00 000000* movei q1,ewallt ;[207] Resolve address of elapsted wall time block 23786 000472'03 120 02 0 05 000017 dmove t2, .datus(q1) ;[207] Load the actual value 23787 000473'03 434 02 0 00 000003 or t2, t3 ;[207] Checking for non-zero either word 23788 000474'03 322 02 0 00 000503' ifn. t2 ;[207] Did this take any time, actually? 23789 000475'03 120 02 0 00 000000# smsg < Communications duration: > ;[207] It did 23790 000476'03 260 17 0 00 000465* 23791 000022'02 000000000000# 23792 000023'02 777777 777746 23793 000110'04 040 103 157 155 155 23794 000477'03 200 02 0 00 000005 move t2, q1 ;[207] So load pointer to the value 23795 000500'03 260 17 0 00 000000* call durtim ;[207] Print the duration 23796 smsg <, analysis: 23797 000501'03 120 02 0 00 000000# > ;[207] Close off 23798 000502'03 260 17 0 00 000476* 23799 000024'02 000000000000# 23800 000025'02 777777 777763 23801 000116'04 054 040 141 156 141 23802 23803 000503'03 endif. ;[207] End case elapsed DK10 ticks 23804 000503'03 263 17 0 00 000000 endbk. ;[207] Restore stack frame k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-1 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 23805 23806 smsg < 23807 000504'03 120 02 0 00 000000# Sent: > ;[189] 23808 000505'03 260 17 0 00 000502* 23809 000026'02 000000000000# 23810 000027'02 777777 777762 23811 000121'04 015 012 011 123 145 23812 000506'03 200 02 0 00 000000* srvnum stot ;[189] 23813 000507'03 201 03 0 00 000012 23814 000510'03 104 00 0 00 000224 23815 000511'03 320 14 0 00 000512' 23816 23817 000512'03 120 02 0 00 000000# smsg < Efficiency: > ;[189] 23818 000513'03 260 17 0 00 000505* 23819 000030'02 000000000000# 23820 000031'02 777777 777757 23821 000124'04 040 040 040 040 011 23822 000514'03 200 02 0 00 000000* move t2, stchr 23823 000515'03 200 03 0 00 000506* move t3, stot 23824 000516'03 260 17 0 00 004430' call peffif ;[189] Print Efficiency Factor 23825 smsg < 23826 000517'03 120 02 0 00 000000# Received: > ;[189] 23827 000520'03 260 17 0 00 000513* 23828 000032'02 000000000000# 23829 000033'02 777777 777762 23830 000130'04 015 012 011 122 145 23831 000521'03 200 02 0 00 000000* srvnum rtot ;[189] 23832 000522'03 201 03 0 00 000012 23833 000523'03 104 00 0 00 000224 23834 000524'03 320 14 0 00 000525' 23835 000525'03 120 02 0 00 000000# smsg < Efficiency: > ;[189] 23836 000526'03 260 17 0 00 000520* 23837 000034'02 000000000000# 23838 000035'02 777777 777757 23839 000133'04 040 040 040 040 011 23840 000527'03 200 02 0 00 000000* move t2, rtchr 23841 000530'03 200 03 0 00 000521* move t3, rtot 23842 000531'03 260 17 0 00 004430' call peffif ;[189] Print Efficiency Factor 23843 23844 smsg < 23845 000532'03 120 02 0 00 000000# Total: > ;[189] 23846 000533'03 260 17 0 00 000526* 23847 000036'02 000000000000# 23848 000037'02 777777 777762 23849 000137'04 015 012 011 124 157 23850 000534'03 200 02 0 00 000530* move t2, rtot 23851 000535'03 270 02 0 00 000515* add t2, stot 23852 000536'03 200 04 0 00 000002 move t4, t2 ; Save the total number of chars. 23853 000537'03 201 03 0 00 000012 movei t3, ^d10 ;[194] 23854 000540'03 104 00 0 00 000224 NOUT% ;[194] 23855 000541'03 320 14 0 00 000542' erjmps .+1 ;[194] 23856 23857 000542'03 120 02 0 00 000000# smsg < Efficiency: > ;[189] 23858 000543'03 260 17 0 00 000533* 23859 000040'02 000000000000# k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-2 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 23860 000041'02 777777 777757 23861 000142'04 040 040 040 040 011 23862 000544'03 200 02 0 00 000004 move t2, t4 ;[189] Load total of all communications chars 23863 000545'03 200 03 0 00 000514* move t3, stchr ;[189] Load file characters sent 23864 000546'03 270 03 0 00 000527* add t3, rtchr ;[189] add total receieved 23865 000547'03 260 17 0 00 004430' call peffif ;[189] One or the other will not be zero 23866 23867 smsg < 23868 23869 000550'03 120 02 0 00 000000# Total characters per second: > ;[189] 23870 000551'03 260 17 0 00 000543* 23871 000042'02 000000000000# 23872 000043'02 777777 777736 23873 000146'04 015 012 015 012 040 23874 23875 000552'03 337 03 0 00 000004 skipg t3, t4 ;[207] Did we send anything. actually? 23876 000553'03 254 00 0 00 000557' ifskp. ;[207] Looks like it 23877 000554'03 260 17 0 00 004503' call gmkcps ;[207] Print characters per second 23878 000555'03 254 00 0 00 000557' anskp. ;[207] Unless some problem (like no time) 23879 000556'03 254 00 0 00 000561' else. ;[207] In either case, don't do any math 23880 000557'03 120 02 0 00 000000# smsg <[N/A]> ;[207] So say really can't do it 23881 000560'03 260 17 0 00 000551* 23882 000044'02 000000000000# 23883 000045'02 777777 777773 23884 000155'04 133 116 057 101 135 23885 000561'03 endif. ;[207] End handling characters per second 23886 23887 smsg < 23888 000561'03 120 02 0 00 000000# Effective data rate: > ;[189] 23889 000562'03 260 17 0 00 000560* 23890 000046'02 000000000000# 23891 000047'02 777777 777747 23892 000157'04 015 012 040 105 146 23893 000563'03 336 03 0 00 000545* skipn t3, stchr ;[189] Is the number of chars sent zero? 23894 000564'03 200 03 0 00 000546* move t3, rtchr ;[189] If so we were receiving. 23895 000565'03 322 03 0 00 000570' ifn. t3 ;[207] Was there any data? 23896 000566'03 260 17 0 00 004526' call gmkbps ;[189] Display a more readable baud rate 23897 000567'03 254 00 0 00 000572' else. ;[207] Otherwise, number makes no sense 23898 000570'03 120 02 0 00 000000# smsg <[N/A]> ;[207] So say it isn't applicable 23899 000571'03 260 17 0 00 000562* 23900 000050'02 000000000000# 23901 000051'02 777777 777773 23902 000165'04 133 116 057 101 135 23903 000572'03 endif. 23904 23905 000572'03 337 00 0 00 000000# skipg pvbaud ;[210] Do we have a virtual baud rate? 23906 000573'03 333 00 0 00 000000* skiple speed ;[207] or on a real terminal? 23907 000574'03 260 17 0 00 000703' call pspeef ;[207] Go print speed efficiency (maybe) 23908 ;[180]... 23909 smsg < 23910 000575'03 120 02 0 00 000000# ILDB: > ;[189] 23911 000576'03 260 17 0 00 000571* 23912 000052'02 000000000000# 23913 000053'02 777777 777767 23914 000167'04 015 012 040 111 114 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-3 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 23915 000577'03 200 02 0 00 000000* srvnum ttildb ;[189] 23916 000600'03 201 03 0 00 000012 23917 000601'03 104 00 0 00 000224 23918 000602'03 320 14 0 00 000603' 23919 000603'03 120 02 0 00 000000# smsg < SIN: > ;[189] 23920 000604'03 260 17 0 00 000576* 23921 000054'02 000000000000# 23922 000055'02 777777 777770 23923 000171'04 040 040 123 111 116 23924 000605'03 200 02 0 00 000000* srvnum ttisin ;[189] 23925 000606'03 201 03 0 00 000012 23926 000607'03 104 00 0 00 000224 23927 000610'03 320 14 0 00 000611' 23928 000611'03 120 02 0 00 000000# smsg < SIN Max: > ;[189] 23929 000612'03 260 17 0 00 000604* 23930 000056'02 000000000000# 23931 000057'02 777777 777764 23932 000173'04 040 040 123 111 116 23933 000613'03 200 02 0 00 000000* srvnum ttimax ;[189] 23934 000614'03 201 03 0 00 000012 23935 000615'03 104 00 0 00 000224 23936 000616'03 320 14 0 00 000617' 23937 000617'03 120 02 0 00 000000# smsg < BIN: > ;[189] 23938 000620'03 260 17 0 00 000612* 23939 000060'02 000000000000# 23940 000061'02 777777 777770 23941 000176'04 040 040 102 111 116 23942 000621'03 200 02 0 00 000000* srvnum ttibin ;[189] 23943 000622'03 201 03 0 00 000012 23944 000623'03 104 00 0 00 000224 23945 000624'03 320 14 0 00 000625' 23946 ;...[180] 23947 23948 000625'03 336 00 0 00 000000* $stat4: skipn errptr ; Was there an error? 23949 000626'03 254 00 0 00 000640' jrst $statx ; If not, done. 23950 smsg < 23951 000627'03 120 02 0 00 000000# Canceled by error: > ;[189] 23952 000630'03 260 17 0 00 000620* 23953 000062'02 000000000000# 23954 000063'02 777777 777751 23955 000200'04 015 012 040 103 141 23956 000631'03 200 02 0 00 000625* move t2, errptr ;[189] 23957 000632'03 403 03 0 00 000004 setzb t3, t4 ;[189] 23958 000633'03 104 00 0 00 000053 SOUT% ;[189] ; If so output it. 23959 000634'03 320 14 0 00 000635' erjmps .+1 ;[189] 23960 000635'03 561 02 0 00 000203* hrroi t2, crlf ;[189] ;[50] 23961 000636'03 104 00 0 00 000053 SOUT% ;[189] 23962 000637'03 320 14 0 00 000640' erjmps .+1 ;[189] 23963 23964 ;[36] Interpacket pause. 23965 23966 $statx: smsg < 23967 000640'03 120 02 0 00 000000# Interpacket pause in effect: > 23968 000641'03 260 17 0 00 000630* 23969 000064'02 000000000000# k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-4 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 23970 000065'02 777777 777740 23971 000205'04 015 012 040 111 156 23972 000642'03 200 02 0 00 000000* srvnum pause ;[196] 23973 000643'03 201 03 0 00 000012 23974 000644'03 104 00 0 00 000224 23975 000645'03 320 14 0 00 000646' 23976 smsg < ms 23977 23978 000646'03 120 02 0 00 000000# Timeouts: > ;[196] ;[54] How many timeouts and NAKs. 23979 000647'03 260 17 0 00 000641* 23980 000066'02 000000000000# 23981 000067'02 777777 777756 23982 000214'04 040 155 163 015 012 23983 23984 000650'03 200 02 0 00 000000* srvnum ntimou ;[189] 23985 000651'03 201 03 0 00 000012 23986 000652'03 104 00 0 00 000224 23987 000653'03 320 14 0 00 000654' 23988 smsg < 23989 000654'03 120 02 0 00 000000# NAKs: > ;[189] 23990 000655'03 260 17 0 00 000647* 23991 000070'02 000000000000# 23992 000071'02 777777 777764 23993 000220'04 015 012 040 116 101 23994 000656'03 200 02 0 00 000000* srvnum nnak ;[189] 23995 000657'03 201 03 0 00 000012 23996 000660'03 104 00 0 00 000224 23997 000661'03 320 14 0 00 000662' 23998 23999 ;[47][132] If debugging, tell most recent JSYS error. 24000 24001 000662'03 322 14 0 00 000700' jumpe debug, $statz ;[132] Debugging? 24002 $statj: smsg < 24003 000663'03 120 02 0 00 000000# Last JSYS error: > ;[189] ; Yes, tell about last error. 24004 000664'03 260 17 0 00 000655* 24005 000072'02 000000000000# 24006 000073'02 777777 777754 24007 000223'04 015 012 040 114 141 24008 000665'03 525 02 0 00 400000 hrloi t2, .fhslf 24009 000666'03 400 03 0 00 000000 setz t3, 24010 000667'03 104 00 0 00 000011 ERSTR 24011 000670'03 320 14 0 00 000672' erjmps .+2 ;[189] Ignore strange error 24012 000671'03 320 14 0 00 000672' erjmps .+1 ;[189] Ignore stranger error 24013 smsg < 24014 000672'03 120 02 0 00 000000# Timer errors: > ;[189] ;[132] Also, give hints if anything is 24015 000673'03 260 17 0 00 000664* 24016 000074'02 000000000000# 24017 000075'02 777777 777754 24018 000230'04 015 012 040 124 151 24019 000674'03 200 02 0 00 000000* srvnum timerx ;[189] ; going wrong with timers. 24020 000675'03 201 03 0 00 000012 24021 000676'03 104 00 0 00 000224 24022 000677'03 320 14 0 00 000700' 24023 24024 $statz: smsg < k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-5 K20DSP MAC 20-Aug-24 23:41 STATISTICS command 24025 24026 000700'03 120 02 0 00 000000# > ;[189] 24027 000701'03 260 17 0 00 000673* 24028 000076'02 000000000000# 24029 000077'02 777777 777774 24030 000235'04 015 012 015 012 000 24031 000702'03 263 17 0 00 000000 ret 24032 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20DSP MAC 20-Aug-24 23:41 Print Speed Efficiency (if we have some kind of baud rate) 24033 subttl Print Speed Efficiency (if we have some kind of baud rate) 24034 24035 ; Rewrite of previous code for nanosecond resolution 24036 24037 ; N.B., Code IGNORES split speed and uses only the recieve speed 24038 24039 extern dblscl ; Double integer scaling factor 24040 24041 chgsec(code,const) 24042 000100'02 207620 000000 percnt: 100. ; Factor to range up to a percent 24043 000101'02 000000 000000 0. ; Double floating multiplier!! 24044 retsec 24045 24046 000703'03 pspeef: remark t1 ; It is DEADLY to touch t1!! 24047 remark ; Assumes these may be smashed 24048 remark t5, q1 ; These are aliased 24049 000703'03 265 16 0 00 004734' saveac ; Play it safe 24050 000704'03 265 16 0 00 000000* trvar <,,,,,> 24051 000705'03 000000 000014 24052 ; Naming conventions for transient variables 24053 remark dichrs ; Double Integer characters 24054 remark dfchrs ; Double floating characters 24055 remark dietic ; Double Integer elapsed ticks 24056 remark dfetic ; Double floating elapsed ticks 24057 remark disped ; Double integer speed 24058 remark dfsped ; Double floating speed 24059 24060 000706'03 403 02 0 00 000003 setzb t2, t3 ; Let's assume we'll need to float 24061 000707'03 124 02 0 15 000011 dmovem t2, disped ; an integer 24062 000710'03 124 02 0 15 000013 dmovem t2, dfsped ; baud rate 24063 24064 000711'03 135 02 0 00 004742' ldb t2,[POINTR(,nttype)] ;[210] Maybe remote, so find out 24065 000712'03 135 03 0 00 004743' ldb t3,[POINTR(,ntline)] ;[210] about our local line 24066 000713'03 332 00 0 00 000000* ifme. ptyflg ; Not connected to a pseudo terminal? 24067 000714'03 254 00 0 00 000737' 24068 000715'03 332 00 0 00 000000* skipe nrtflg ; Network remote? 24069 000716'03 254 00 0 00 000737' anskp. ; So do that 24070 000717'03 302 02 0 00 000000 caie t2, nw%nnt ; Not a network transport? 24071 000720'03 254 00 0 00 000737' anskp. ; No, so either a front end or PTY 24072 000721'03 306 03 0 00 000002 cain t3, nw%pt ; But!! Are we on a pseudo-terminal?? 24073 000722'03 254 00 0 00 000737' anskp. ; No, so can only be the front-end case 24074 smsg < 24075 000723'03 120 02 0 00 000000# Efficiency: > ; Begin more blat 24076 000724'03 260 17 0 00 000701* 24077 000102'02 000000000000# 24078 000103'02 777777 777757 24079 000236'04 015 012 040 105 146 24080 000725'03 333 03 0 00 000573* skiple t3, speed ; Load and check speed 24081 000726'03 254 00 0 00 000732' ifskp. ; Is this absurd? 24082 000727'03 120 02 0 00 000000# smsg <[SPEED ERROR]> ;Report speed error 24083 000730'03 260 17 0 00 000724* 24084 000104'02 000000000000# 24085 000105'02 777777 777763 24086 000242'04 133 123 120 105 105 24087 000731'03 263 17 0 00 000000 ret ; Leave, can't do anything else k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-1 K20DSP MAC 20-Aug-24 23:41 Print Speed Efficiency (if we have some kind of baud rate) 24088 000732'03 endif. ; end speed load and check 24089 000732'03 400 02 0 00 000000 setz t2, ; Assume hardware baud is not an unsigned int 24090 000733'03 623 03 0 00 400000 tlze t3, (1b0) ; Cast unsigned to signed long 24091 000734'03 201 02 0 00 000001 movei t2, ^d1 ; Propagate to high order 24092 000735'03 124 02 0 15 000011 dmovem t2, disped ; And store as the speed 24093 000736'03 254 00 0 00 000761' else. ; Otherwise, might have done virtual timing 24094 000737'03 400 05 0 00 000000 setz q1, ;[210] Let's assume we don't know what to load 24095 000740'03 332 00 0 00 000713* skipe ptyflg ;[210] Connected to a PTY? 24096 000741'03 201 05 0 00 000000# movei q1, pvbaud ;[210] Address of its virtual baud rate 24097 000742'03 332 00 0 00 000715* skipe nrtflg ;[210] How about an NRT? 24098 000743'03 201 05 0 00 000000# movei q1, dnbaud ;[210] Address of DECnet virtual baud rate 24099 000744'03 326 05 0 00 000752' ife. q1 ;[210] Still don't know? 24100 000745'03 306 03 0 00 000002 cain t3, nw%pt ;[210] A pseudo-terminal? 24101 000746'03 201 05 0 00 000000# movei q1, pvbaud ;[210] Address of its virtual baud rate 24102 000747'03 306 03 0 00 000003 cain t3, nw%mc ;[210] An NRT? 24103 000750'03 201 05 0 00 000000# movei q1, dnbaud ;[210] Address of DECnet virtual baud rate 24104 000751'03 322 05 0 00 000444* jumpe q1, R ;[210] If still nothing, then done 24105 000752'03 endif. ;[210] Otherwise some valid address in q1 24106 000752'03 120 02 0 05 000000 dmove t2, (q1) ;[210] Load any timing test data 24107 000753'03 323 02 0 00 000751* jumple t2, R ;[210] No test or bad test 24108 000754'03 124 02 0 15 000013 dmovem t2, dfsped ; Store precomputed virtual rate 24109 000755'03 477 02 0 00 000003 setob t2, t3 ; Cons up an impossible double integer baud rate 24110 000756'03 124 02 0 15 000011 dmovem t2, disped ; And store as the speed 24111 smsg < 24112 000757'03 120 02 0 00 000000# Pseudo-efficiency: > ; Begin pseudo-blat 24113 000760'03 260 17 0 00 000730* 24114 000106'02 000000000000# 24115 000107'02 777777 777751 24116 000245'04 015 012 040 120 163 24117 000761'03 endif. ; End case local or remote instrumented PTY 24118 24119 000761'03 336 03 0 00 000563* skipn t3, stchr ; Nothing sent? 24120 000762'03 200 03 0 00 000564* move t3, rtchr ; No, so this was a recieve 24121 000763'03 326 03 0 00 000767' ife. t3 ; Or did nothing happen at all? 24122 000764'03 120 02 0 00 000000# smsg <[N/A]> ; So say it isn't applicable 24123 000765'03 260 17 0 00 000760* 24124 000110'02 000000000000# 24125 000111'02 777777 777773 24126 000252'04 133 116 057 101 135 24127 000766'03 263 17 0 00 000000 ret ; And get out of here 24128 000767'03 endif. 24129 24130 000767'03 400 02 0 00 000000 setz t2, ; Assume characters are not unsigned int 24131 000770'03 623 03 0 00 400000 tlze t3, (1b0) ; Cast unsigned to signed long 24132 000771'03 201 02 0 00 000001 movei t2, ^d1 ; Propagate to high order 24133 000772'03 124 02 0 15 000001 dmovem t2, dichrs ; And store signed long 24134 24135 000773'03 415 16 0 00 001001' block. ; Enter block context for better control flow 24136 000774'03 261 17 0 00 000016 24137 000775'03 120 02 0 00 000000# dmove t2,ewallt+.datus ;Load double elapsed DK10 ticks 24138 000776'03 327 02 0 00 000445* jumpg t2, RSKP ; Non-zero high order is good 24139 000777'03 327 03 0 00 000776* jumpg t3, RSKP ; Ditto low order 24140 001000'03 263 17 0 00 000000 endbk. ; End block context 24141 001001'03 254 00 0 00 001004' ifskp. ; Positive number? 24142 001002'03 124 02 0 15 000005 dmovem t2, dietic ; Yes, so store elapsed wall time k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-2 K20DSP MAC 20-Aug-24 23:41 Print Speed Efficiency (if we have some kind of baud rate) 24143 001003'03 254 00 0 00 001007' else. ; Otherwise, zero or negative 24144 001004'03 120 02 0 00 000000# smsg <[TIME ERROR]> ; Report time error 24145 001005'03 260 17 0 00 000765* 24146 000112'02 000000000000# 24147 000113'02 777777 777764 24148 000254'04 133 124 111 115 105 24149 001006'03 263 17 0 00 000000 ret ; Leave, can't do anything else 24150 001007'03 endif. 24151 24152 001007'03 415 16 0 00 001034' block. ; Enter block context to double float everything 24153 001010'03 261 17 0 00 000016 24154 001011'03 265 16 0 00 004744' saveac ; Save precious T1 24155 001012'03 120 01 0 15 000011 dmove t1, disped ; Load integer baud 24156 001013'03 321 01 0 00 001017' ifge. t1 ; Already did this? 24157 001014'03 260 17 0 00 000000* call dfloat ; Convert to double floating point 24158 001015'03 263 17 0 00 000000 ret ; Or not 24159 001016'03 124 01 0 15 000013 dmovem t1, dfsped ; Store double floating speed 24160 001017'03 endif. ; Otherwise, already done 24161 24162 001017'03 120 01 0 15 000005 dmove t1, dietic ; Load double integer elapsed ticks 24163 001020'03 260 17 0 00 001014* call dfloat ; Convert to double floating point 24164 001021'03 263 17 0 00 000000 ret ; But couldn't... 24165 001022'03 124 01 0 15 000007 dmovem t1, dfetic ; Store double floating elapsed ticks 24166 001023'03 120 01 0 15 000001 dmove t1, dichrs ; Load double integer characters 24167 001024'03 116 01 0 00 000000* dmul t1, dblscl ; Scale up by nanosecond ratio 24168 001025'03 124 03 0 15 000001 dmovem t3, dichrs ; Store scaled double integer elapsed ticks 24169 24170 001026'03 120 01 0 00 000003 dmove t1, t3 ; Load same for double floating 24171 001027'03 260 17 0 00 001020* call dfloat ; Convert to double floating point 24172 001030'03 263 17 0 00 000000 ret ; Yet failed 24173 001031'03 124 01 0 15 000003 dmovem t1, dfchrs ; Store double floating characters 24174 001032'03 254 00 0 00 000777* retskp ; Indicate complete double floating success 24175 001033'03 263 17 0 00 000000 endbk. ; End block context, release frame 24176 001034'03 254 00 0 00 001040' ifskp. ; Worked 24177 001035'03 120 02 0 15 000003 dmove t2, dfchrs ; Load double floating characters 24178 001036'03 112 02 0 00 004524' dfmp t2, baud ; Convert to bits for baud rate 24179 001037'03 254 00 0 00 001043' else. ; Something went wrong... 24180 001040'03 120 02 0 00 000000# smsg <[DFLOAT ERROR]> ; Yes, whine about it 24181 001041'03 260 17 0 00 001005* 24182 000114'02 000000000000# 24183 000115'02 777777 777762 24184 000257'04 133 104 106 114 117 24185 001042'03 263 17 0 00 000000 ret ; Return, can't go any further 24186 001043'03 endif. 24187 24188 001043'03 113 02 0 15 000007 dfdv t2, dfetic ; Compute effective baud rate 24189 001044'03 112 02 0 00 000000# dfmp t2, percnt ; Scale to percentage 24190 001045'03 113 02 0 15 000013 dfdv t2, dfsped ; Divide by line rate to get efficiency 24191 001046'03 260 17 0 00 004470' call peffi0 ; Print it 24192 001047'03 120 02 0 00 000000# smsg < per cent> ;[189] 24193 001050'03 260 17 0 00 001041* 24194 000116'02 000000000000# 24195 000117'02 777777 777767 24196 000262'04 040 160 145 162 040 24197 001051'03 263 17 0 00 000000 ret k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-3 K20DSP MAC 20-Aug-24 23:41 Print Speed Efficiency (if we have some kind of baud rate) 24198 24199 endtv. ; End lexical context transient variables 24200 24201 ;[207] End code insertion 24202 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20DSP MAC 20-Aug-24 23:41 Print real or virtual baud rate 24203 subttl Print real or virtual baud rate 24204 24205 extern ntiblk ;[210] NTINF% of local line 24206 24207 001052'03 332 00 0 00 000740* prntbd: skipe ptyflg ;[210] Connected to a PTY? 24208 001053'03 254 00 0 00 001107' jrst prntbv ;[210] Yes, show the virtual baud rate 24209 001054'03 332 00 0 00 000742* skipe nrtflg ;[210] How about an NRT? 24210 001055'03 254 00 0 00 001107' jrst prntbv ;[210] Yes, show the virtual baud rate 24211 remark pipflg ;[210] Connected via a pipe? 24212 remark prntbv ;[210] Yes, show the virtual baud rate 24213 ;[210] Load network and line type of local terminal 24214 001056'03 135 01 0 00 004752' ldb t1,[POINTR(,nttype)] ;[210] 24215 001057'03 135 02 0 00 004753' ldb t2,[POINTR(,ntline)] ;[210] 24216 001060'03 302 01 0 00 000000 caie t1, nw%nnt ;[210] Not a 'network' terminal? 24217 001061'03 254 00 0 00 001101' jrst prntnv ;[210] No see if it has a network virtual baud rate 24218 001062'03 306 02 0 00 000002 cain t2, nw%pt ;[210] But!! Are we on a pseudo-terminal?? 24219 001063'03 254 00 0 00 001101' jrst prntnv ;[210] We are, see if we did a speed test 24220 remark ;[210] Only other non-network terminal is FE: 24221 24222 001064'03 337 02 0 00 000725* prntbs: skipg t2,speed ; If negative, we don't really know it. 24223 001065'03 254 00 0 00 001100' ifskp. ;[194] We know it 24224 txmsg < 24225 001066'03 200 01 0 00 000000# Speed: > ; Line speed. 24226 001067'03 104 00 0 00 000076 24227 001070'03 320 12 0 00 001071' 24228 000120'02 000000000000# 24229 000264'04 015 012 040 040 123 24230 001071'03 201 01 0 00 000101 movei t1, .priou 24231 001072'03 201 03 0 00 000012 movei t3, ^d10 24232 001073'03 104 00 0 00 000224 NOUT% 24233 001074'03 320 14 0 00 001075' erjmps .+1 24234 001075'03 200 01 0 00 000000# txmsg < Bd> ;[210] Recognized suffix for "baud" 24235 001076'03 104 00 0 00 000076 24236 001077'03 320 12 0 00 001100' 24237 000121'02 000000000000# 24238 000270'04 040 102 144 000 000 24239 001100'03 endif. ;[194] 24240 001100'03 263 17 0 00 000000 ret ;[210] Either way, done 24241 24242 001101'03 400 01 0 00 000000 prntnv: setz t1, ;[210] Let's assume we don't know what to load 24243 001102'03 306 02 0 00 000002 cain t2, nw%pt ;[210] A pseudo-terminal? 24244 001103'03 201 01 0 00 000000# movei t1, pvbaud ;[210] Address of its virtual baud rate 24245 001104'03 306 02 0 00 000003 cain t2, nw%mc ;[210] An NRT? 24246 001105'03 201 01 0 00 000000# movei t1, dnbaud ;[210] Address of DECnet virtual baud rate 24247 001106'03 254 00 0 00 001114' jrst prntcm ;[210] See if anything to print 24248 24249 001107'03 400 01 0 00 000000 prntbv: setz t1, ;[210] Let's assume we don't know what to load 24250 001110'03 332 00 0 00 001052* skipe ptyflg ;[210] Connected to a PTY? 24251 001111'03 201 01 0 00 000000# movei t1, pvbaud ;[210] Address of its virtual baud rate 24252 001112'03 332 00 0 00 001054* skipe nrtflg ;[210] How about an NRT? 24253 001113'03 201 01 0 00 000000# movei t1, dnbaud ;[210] Address of DECnet virtual baud rate 24254 remark pipflg ;[210] Connected via a pipe? 24255 remark t1, pibaud ;[210] Address of its virtual baud rate 24256 24257 001114'03 prntcm: remark ;[210] Common virtual speed k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11-1 K20DSP MAC 20-Aug-24 23:41 Print real or virtual baud rate 24258 001114'03 322 01 0 00 000753* jumpe t1, r ;[210] Return if nobody is volunteering anything 24259 001115'03 265 16 0 00 004734' saveac ;[210] Preserve for proper return xct 24260 remark t5, q1 ;[210] Because t4:t5 pair used 24261 001116'03 120 04 0 01 000000 dmove t4, (t1) ;[210] Load virtual baud rate 24262 001117'03 323 04 0 00 001114* jumple t4, r ;[210] If nothing, then don't print anything 24263 txmsg < 24264 001120'03 200 01 0 00 000000# Pseudo Speed: > ;[210] Instrumented PTY speed 24265 001121'03 104 00 0 00 000076 24266 001122'03 320 12 0 00 001123' 24267 000122'02 000000000000# 24268 000271'04 015 012 040 040 120 24269 001123'03 201 01 0 00 000101 movei t1, .priou ;[210] Display it on terminal 24270 001124'03 254 00 0 00 004543' callret gmkbp1 ;[210] Print the baud rate 24271 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20DSP MAC 20-Aug-24 23:41 Print real or virtual baud rate 24272 remark Test command semantic action 24273 24274 ;[210] Begin Code Insertion 24275 24276 extern dptybd ; Discover PTY: virtual baud rate 24277 extern dnulbd ; Discover NUL: virtual baud rate 24278 extern dpipbd ; Discover PIP: virtual baud rate 24279 extern dsrvbd ; Discover DECnet (DCN:/SRV:) virtual baud rate 24280 extern timdev ; Device being timed 24281 24282 001125'03 $time: intern $time ; Called from k20par 24283 001125'03 265 16 0 00 004734' saveac ; Just in case anybody might needit 24284 001126'03 331 01 0 00 000000* skipl t1, pars2 ; Pick up the device to test 24285 001127'03 254 00 0 00 001151' ifskp. ; Special return?? 24286 001130'03 316 01 0 00 004754' camn t1, [-1] ; Error that somebody else blatted? 24287 001131'03 263 17 0 00 000000 ret ; We're done 24288 001132'03 554 02 0 00 000001 hlrz t2, t1 ; Reposition source device type 24289 001133'03 620 02 0 00 600000 trz t2, .dvdes ; Now have a device number 24290 001134'03 200 01 0 00 000000# txmsg 24291 001135'03 104 00 0 00 000076 24292 001136'03 320 12 0 00 001137' 24293 000123'02 000000000000# 24294 000276'04 103 157 160 151 145 24295 001137'03 200 01 0 00 000002 move t1, t2 ; Position for conversion to text 24296 001140'03 260 17 0 00 001262' call ascdev ; Do so 24297 001141'03 104 00 0 00 000076 PSOUT% ; Type the text 24298 001142'03 200 01 0 00 000000# txmsg < to > ; Where it's going 24299 001143'03 104 00 0 00 000076 24300 001144'03 320 12 0 00 001145' 24301 000124'02 000000000000# 24302 000304'04 040 164 157 040 000 24303 001145'03 200 02 0 00 000000* move t2, pars3 ; Load destination device 24304 001146'03 202 02 0 00 001126* movem t2, pars2 ; Put where downstream wants it 24305 001147'03 120 04 0 00 000000* dmove t4, pars4 ; Load the timing results 24306 001150'03 254 00 0 00 001323' callret $time1 ; And go type something 24307 001151'03 endif. 24308 24309 001151'03 202 01 0 00 000000* movem t1, timdev ; Remember device being timed 24310 001152'03 302 01 0 00 000013 caie t1, .dvpty ; Pseudo-terminal? 24311 001153'03 254 00 0 00 001172' ifskp. ; Yep, so let's run that test 24312 001154'03 476 00 0 00 000000# setom pvbaud ; Say no PTY virtual baud rate 24313 001155'03 476 00 0 00 000000# setom pvbaud+1 ; It's a double 24314 001156'03 260 17 0 00 000000* call dptybd ; Found in k20net 24315 001157'03 254 00 0 00 001165' ifskp. 24316 001160'03 327 04 0 00 001164' ifle. t4 ; Did it work? 24317 001161'03 200 01 0 00 000000# emsg 24318 001162'03 104 00 0 00 000313 24319 000125'02 000000000000# 24320 000305'04 120 163 145 165 144 24321 001163'03 263 17 0 00 000000 ret ; Can't do anything further 24322 001164'03 endif. ; Otherwise, have a valid number 24323 001164'03 254 00 0 00 001170' else. 24324 001165'03 200 01 0 00 000000# emsg 24325 001166'03 104 00 0 00 000313 24326 000126'02 000000000000# k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-1 K20DSP MAC 20-Aug-24 23:41 Print real or virtual baud rate 24327 000316'04 120 163 145 165 144 24328 001167'03 263 17 0 00 000000 ret ; Can't do anything further 24329 001170'03 endif. 24330 24331 001170'03 124 04 0 00 000000# dmovem t4, pvbaud ; Side-effect virtual baud rate 24332 001171'03 254 00 0 00 001323' callret $time1 ; And display it 24333 001172'03 endif. ; End case pseudo-terminal 24334 24335 001172'03 302 01 0 00 000015 caie t1, .dvnul ; NUL: device? 24336 001173'03 254 00 0 00 001212' ifskp. ; OK, so let's see how fast we can dump stuff 24337 001174'03 476 00 0 00 000000# setom nlbaud ; Assume fails 24338 001175'03 476 00 0 00 000000# setom nlbaud+1 ; It's a double word 24339 001176'03 260 17 0 00 000000* call dnulbd ; Go do some nanosecond timing 24340 001177'03 254 00 0 00 001205' ifskp. 24341 001200'03 327 04 0 00 001204' ifle. t4 ; Did it work? 24342 001201'03 200 01 0 00 000000# emsg 24343 001202'03 104 00 0 00 000313 24344 000127'02 000000000000# 24345 000327'04 104 141 164 141 040 24346 001203'03 263 17 0 00 000000 ret ; Can't do anything further 24347 001204'03 endif. ; Otherwise, have a valid number 24348 001204'03 254 00 0 00 001210' else. 24349 001205'03 200 01 0 00 000000# emsg 24350 001206'03 104 00 0 00 000313 24351 000130'02 000000000000# 24352 000337'04 104 141 164 141 040 24353 001207'03 263 17 0 00 000000 ret ; Can't do anything further 24354 001210'03 endif. 24355 24356 001210'03 124 04 0 00 000000# dmovem t4, nlbaud ; Store NUL's virtual baud rate 24357 001211'03 254 00 0 00 001323' callret $time1 ; Hit display epilogue 24358 001212'03 endif. 24359 24360 001212'03 302 01 0 00 000403 caie t1, .dvpip ; Pipe device? 24361 001213'03 254 00 0 00 001232' ifskp. ; Yep, so let's run that test 24362 001214'03 476 00 0 00 000000# setom pibaud ; Assume fails 24363 001215'03 476 00 0 00 000000# setom pibaud+1 ; It's a double word 24364 001216'03 260 17 0 00 000000* call dpipbd ; Found in k20net 24365 001217'03 254 00 0 00 001225' ifskp. 24366 001220'03 327 04 0 00 001224' ifle. t4 ; Did it work? 24367 001221'03 200 01 0 00 000000# emsg 24368 001222'03 104 00 0 00 000313 24369 000131'02 000000000000# 24370 000347'04 120 151 160 145 040 24371 001223'03 263 17 0 00 000000 ret ; Can't do anything further 24372 001224'03 endif. ; Otherwise, have a valid number 24373 001224'03 254 00 0 00 001230' else. 24374 001225'03 200 01 0 00 000000# emsg 24375 001226'03 104 00 0 00 000313 24376 000132'02 000000000000# 24377 000356'04 120 151 160 145 040 24378 001227'03 263 17 0 00 000000 ret ; Can't do anything further 24379 001230'03 endif. 24380 24381 001230'03 124 04 0 00 000000# dmovem t4, pibaud ; Store the calculated baud rate k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-2 K20DSP MAC 20-Aug-24 23:41 Print real or virtual baud rate 24382 001231'03 254 00 0 00 001323' callret $time1 ; Hit display epilogue 24383 001232'03 endif. ; End case pseudo-terminal 24384 24385 001232'03 306 01 0 00 000022 cain t1, .dvdcn ; DECnet active component? 24386 001233'03 201 01 0 00 000023 movei t1, .dvsrv ; Replace with DECnet passive component 24387 24388 001234'03 302 01 0 00 000023 caie t1, .dvsrv ; DECnet? 24389 001235'03 254 00 0 00 001254' ifskp. ; Yep, so let's run that test 24390 001236'03 476 00 0 00 000000# setom dnbaud ; Assume no DECnet baud rate detected 24391 001237'03 476 00 0 00 000000# setom dnbaud+1 ; It's a double 24392 001240'03 260 17 0 00 000000* call dsrvbd ; Found in k20net 24393 001241'03 254 00 0 00 001247' ifskp. 24394 001242'03 327 04 0 00 001246' ifle. t4 ; Did it work? 24395 001243'03 200 01 0 00 000000# emsg 24396 001244'03 104 00 0 00 000313 24397 000133'02 000000000000# 24398 000365'04 104 105 103 156 145 24399 001245'03 263 17 0 00 000000 ret ; Can't do anything further 24400 001246'03 endif. ; Otherwise, have a valid number 24401 001246'03 254 00 0 00 001252' else. 24402 001247'03 200 01 0 00 000000# emsg 24403 001250'03 104 00 0 00 000313 24404 000134'02 000000000000# 24405 000375'04 104 105 103 156 145 24406 001251'03 263 17 0 00 000000 ret ; Can't do anything further 24407 001252'03 endif. 24408 24409 001252'03 124 04 0 00 000000# dmovem t4, dnbaud ; Store the calculated baud rate 24410 001253'03 254 00 0 00 001323' callret $time1 ; Hit display epilogue 24411 001254'03 endif. ; End case pseudo-terminal 24412 24413 001254'03 260 17 0 00 001262' call ascdev ; Turn device number in t1 into a name 24414 001255'03 104 00 0 00 000313 ESOUT% ; Begin whining 24415 txmsg < does not have a timing routine 24416 001256'03 200 01 0 00 000000# > ; Complete whining 24417 001257'03 104 00 0 00 000076 24418 001260'03 320 12 0 00 001261' 24419 000135'02 000000000000# 24420 000404'04 040 144 157 145 163 24421 24422 001261'03 263 17 0 00 000000 ret ; Beat it 24423 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20DSP MAC 20-Aug-24 23:41 Handle unknown and known timing devices 24424 subttl Handle unknown and known timing devices 24425 24426 ; Call: 24427 ; 24428 ; t1/ Device number to translate 24429 ; 24430 ; Return: +1 always 24431 ; 24432 ; t1/ pointer to constructed device text 24433 ; (even if unknown device) 24434 24435 chgsec(code,data) ; Need some writable storage 24436 000000'05 devtxt: block 4 ; Space for ASCII device name 24437 retsec ; Close off writable storage 24438 24439 chgsec(code,text) ; Emit some program text 24440 000004'01 125 156 153 156 157 unktxt: asciz "Unknown:" ; if we have no clue 24441 000006'01 000000 000072 dvpunc: exp ":", .chnul ; Device punctuation 24442 retsec ; Close off program text 24443 24444 001262'03 ascdev: intern ascdev ; In case K20TIM wants to directly use it 24445 001262'03 265 16 0 00 004755' saveac ; Needs some registers 24446 001263'03 200 05 0 00 000001 move q1, t1 ; Save device number 24447 24448 001264'03 260 17 0 00 001310' call devunt ; If device has units, use that 24449 001265'03 326 01 0 00 001117* jumpn t1, r ; Was transformed 24450 ; OK, not a device with units 24451 001266'03 525 02 0 05 600000 hrloi t2, .dvdes(q1) ; Turn back into a real device 24452 001267'03 201 01 0 00 000000# movei t1, devtxt ; Writable to put ASCII device name 24453 001270'03 403 03 0 00 000004 setzb t3, t4 ; Ten .chnul's of device name (6 max) 24454 001271'03 124 03 0 01 000000 dmovem t3, 0(t1) ; Stomp area 24455 001272'03 124 03 0 01 000002 dmovem t3, 2(t1) ; Plus extra for good measure 24456 001273'03 661 01 0 00 777777 tlo t1, -1 ; Now have a Tops-20 JSYS pointer 24457 24458 001274'03 104 00 0 00 000121 DEVST% ; Turn into a string 24459 001275'03 320 12 0 00 001277' ifje. r ; Catch error 24460 001276'03 254 00 0 00 001302' 24461 001277'03 200 02 0 00 000001 move t2, t1 ; And keep for a debugger 24462 001300'03 561 01 0 00 000000# hrroi t1, unktxt ; Say we don't know... 24463 001301'03 254 00 0 00 001307' else. ; Otherwise, have some text 24464 001302'03 120 02 0 00 000000# dmove t2, dvpunc ; Load device punctuation 24465 001303'03 136 02 0 00 000001 idpb t2, t1 ; Drop in the colon 24466 001304'03 200 02 0 00 000001 move t2, t1 ; Copy the pointer 24467 001305'03 136 03 0 00 000002 idpb t3, t2 ; Close off string, allowing append 24468 001306'03 561 01 0 00 000000# hrroi t1, devtxt ; Return pointer to constructed text 24469 001307'03 endif. 24470 24471 001307'03 263 17 0 00 000000 ret ; Finally return, something... 24472 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20DSP MAC 20-Aug-24 23:41 devunt Turns a device with unit numbers into generic 24473 subttl devunt Turns a device with unit numbers into generic 24474 24475 ;Can't use chgsec here, doesn't nest 24476 24477 define gendev(d,t,%a) < 24478 xwd d,%a ;;Create an entry for this device 24479 .endps const ;;Out of constants 24480 .psect text ;;Program text 24481 %a: asciz "'t:" ;;Emit the text, no output to DDT 24482 .endps text ;;Close of text 24483 .psect const ;;Back in constants 24484 cleans(<%a>) 24485 >;;gendev 24486 24487 ; Build table of generic device text for unit based devices 24488 24489 ; The first three currently exist on PANDA and can be entered to .cmdev 24490 24491 chgsec(code,const) 24492 000136'02 000013 000000# gentab: gendev(.dvpty,PTY) ;;Pseudo-terminal (most common) 24493 000010'01 120 124 131 072 000 24494 000137'02 000012 000000# gendev(.dvtty,TTY) ;;Terminal (second most common) 24495 000011'01 124 124 131 072 000 24496 000140'02 000011 000000# gendev(.dvfe,FE) ;;Front end (may get noticed) 24497 000012'01 106 105 072 000 000 24498 remark ;;Otherwise, do in numeric order 24499 000141'02 000002 000000# gendev(.dvmta,MTA) ;;Physical magnetic tape 24500 000013'01 115 124 101 072 000 24501 000142'02 000003 000000# gendev(.dvdta,DTA) ;;1031 had these as does MOUNTR 24502 000014'01 104 124 101 072 000 24503 000143'02 000004 000000# gendev(.dvptr,PTR) ;;Paper tape reader 24504 000015'01 120 124 122 072 000 24505 000144'02 000005 000000# gendev(.dvptp,PTP) ;;Paper tape punch 24506 000016'01 120 124 120 072 000 24507 000145'02 000006 000000# gendev(.dvdsp,DIS) ;;Display 24508 000017'01 104 111 123 072 000 24509 000146'02 000007 000000# gendev(.dvlpt,LPT) ;;Line printer 24510 000020'01 114 120 124 072 000 24511 000147'02 000010 000000# gendev(.dvcdr,CDR) ;;Card reader 24512 000021'01 103 104 122 072 000 24513 000150'02 000017 000000# gendev(.dvplt,PLT) ;;Plotter 24514 000022'01 120 114 124 072 000 24515 000151'02 000021 000000# gendev(.dvcdp,CDP) ;;Card punch 24516 000023'01 103 104 120 072 000 24517 remark ; N.B., .dvats usurped by .dvnft 24518 ; gendev(.dvats,ATS) ;;Applications terminal SERVICE 24519 000152'02 000025 000000# gendev(.dvads,ADS) ;;Aydin display 24520 000024'01 101 104 123 072 000 24521 000153'02 000000000000# 0 ; Mark end of table 24522 retsec 24523 24524 ; Call: t1/ Device number, as per MONSYM 24525 ; Return: t1/ Maybe a pointer if a unit based device 24526 24527 001310'03 265 16 0 00 004767' devunt: saveac ; Just in case we get careless k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14-1 K20DSP MAC 20-Aug-24 23:41 devunt Turns a device with unit numbers into generic 24528 001311'03 200 03 0 00 000001 move t3, t1 ; Move device number to someplace safer 24529 001312'03 400 01 0 00 000000 setz t1, ; Let's assume not a unit based device 24530 001313'03 201 04 0 00 000000# movei t4, gentab ; Load address of generics table 24531 24532 001314'03 do. ; Enter loop context 24533 001314'03 554 02 0 04 000000 hlrz t2, (t4) ; Load candidate device number 24534 001315'03 322 02 0 00 001265* jumpe t2, r ; If empty, none of the above 24535 001316'03 316 02 0 00 000003 camn t2, t3 ; Hit our device, yet? 24536 001317'03 254 00 0 00 001321' exit. ; Hot zing! Have a string to return 24537 001320'03 344 04 0 00 001314' aoja t4, top. ; Otherwise, next device 24538 001321'03 enddo. ; Exit loop context 24539 24540 001321'03 560 01 0 04 000000 hrro t1, (t4) ; Pick up address of text 24541 001322'03 263 17 0 00 000000 ret ; Return as a Tops-20 pointer 24542 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20DSP MAC 20-Aug-24 23:41 Common Display Epilogue 24543 subttl Common Display Epilogue 24544 24545 ; T4/T5 Baud rate to display 24546 24547 001323'03 200 01 0 00 001146* $time1: move t1, pars2 ; Load device number 24548 001324'03 260 17 0 00 001262' call ascdev ; Turn into a reasonable string 24549 001325'03 104 00 0 00 000076 PSOUT% ; Type it 24550 001326'03 120 01 0 00 005001' dmove t1, [exp .priou, .chspc] 24551 001327'03 104 00 0 00 000051 BOUT% ; And space over 24552 24553 001330'03 254 00 0 00 004543' callret gmkbp1 ; Print the baud rate 24554 001331'03 561 01 0 00 000635* hrroi t1, crlf ; Tie off the line 24555 001332'03 104 00 0 00 000076 PSOUT% 24556 001333'03 263 17 0 00 000000 ret ; And done 24557 24558 ;[210] End code insertion 24559 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20DSP MAC 20-Aug-24 23:41 SHOW VERSION 24560 subttl SHOW VERSION 24561 24562 extern $verno ;[194] Major version 24563 extern $mnver ;[194] Minor version 24564 extern $edno ;[194] Edit number 24565 extern $who ;[194] Who last edited 24566 24567 001334'03 $shtop: entry $shtop ;[194] ;[39] Top of SHOW command. 24568 001334'03 $shver: entry $shver ;[194] 24569 001334'03 200 01 0 00 000000# txmsg 24570 001335'03 104 00 0 00 000076 24571 001336'03 320 12 0 00 001337' 24572 000154'02 000000000000# 24573 000413'04 124 117 120 123 055 24574 24575 001337'03 201 01 0 00 000101 movei t1, .priou ;[194] 24576 dmove t2, [ $verno ;[197] major version 24577 001340'03 120 02 0 00 005003' ^d10 ] ;[197] Using decimal versions 24578 001341'03 104 00 0 00 000224 NOUT% ;[194] 24579 001342'03 320 14 0 00 001343' erjmps .+1 ;[194] 24580 24581 001343'03 336 02 0 00 005005' skipn t2, [$mnver] ;[197] 24582 001344'03 254 00 0 00 001353' ifskp. ;[197] minor version 24583 001345'03 201 01 0 00 000056 movei t1, "." ;[95] Use new decimal notation 24584 001346'03 104 00 0 00 000074 PBOUT ;[95] 24585 001347'03 320 14 0 00 001350' erjmps .+1 ;[194] 24586 001350'03 201 01 0 00 000101 movei t1, .priou ;[194] 24587 001351'03 104 00 0 00 000224 NOUT% ;[194] 24588 001352'03 320 14 0 00 001353' erjmps .+1 ;[194] 24589 001353'03 endif. ;[194] 24590 24591 001353'03 336 02 0 00 005006' skipn t2, [$edno] ;[197] edit 24592 001354'03 254 00 0 00 001366' ifskp. ;[197] 24593 001355'03 201 01 0 00 000050 movei t1, "(" 24594 001356'03 104 00 0 00 000074 PBOUT 24595 001357'03 320 14 0 00 001360' erjmps .+1 ;[194] 24596 001360'03 201 01 0 00 000101 movei t1, .priou ;[194] 24597 001361'03 104 00 0 00 000224 NOUT% ;[194] 24598 001362'03 320 14 0 00 001363' erjmps .+1 ;[194] 24599 001363'03 201 01 0 00 000051 movei t1, ")" 24600 001364'03 104 00 0 00 000074 PBOUT 24601 001365'03 320 14 0 00 001366' erjmps .+1 ;[194] 24602 001366'03 endif. ;[194] 24603 24604 001366'03 336 02 0 00 005007' skipn t2, [$who] ;[197] who 24605 001367'03 254 00 0 00 001376' ifskp. ;[197] 24606 001370'03 201 01 0 00 000055 movei t1, "-" 24607 001371'03 104 00 0 00 000074 PBOUT 24608 001372'03 320 14 0 00 001373' erjmps .+1 ;[194] 24609 001373'03 201 01 0 00 000101 movei t1, .priou ;[194] 24610 001374'03 104 00 0 00 000224 NOUT% ;[194] 24611 001375'03 320 14 0 00 001376' erjmps .+1 ;[194] 24612 001376'03 endif. ;[194] 24613 24614 001376'03 561 01 0 00 000000* hrroi t1, crlflf ;[194] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16-1 K20DSP MAC 20-Aug-24 23:41 SHOW VERSION 24615 001377'03 104 00 0 00 000076 PSOUT% ;[194] 24616 001400'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 24617 remark ;[194] May fall through .. 24618 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20DSP MAC 20-Aug-24 23:41 SHOW DAYTIME 24619 subttl SHOW DAYTIME 24620 24621 001401'03 $shday: entry $shday ;[194] 24622 001401'03 120 01 0 00 005010' dmove t1, [ exp .priou, -1 ] ;[194] Current date and time. 24623 001402'03 205 03 0 00 336001 movx t3, ot%day!ot%fdy!ot%fmn!ot%4yr!ot%dam!ot%spa!ot%scl 24624 001403'03 104 00 0 00 000220 ODTIM% 24625 001404'03 320 12 0 00 001405' erjmpr .+1 ;[194] Catch and ignore error 24626 001405'03 260 17 0 00 003652' call moon ; Phase of the moon. 24627 24628 001406'03 561 01 0 00 001376* hrroi t1, crlflf ;[194] 24629 001407'03 104 00 0 00 000076 PSOUT% ;[194] 24630 001410'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 24631 remark ;[194] May fall through .. 24632 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20DSP MAC 20-Aug-24 23:41 SHOW LINE external variable usage (all [194]) 24633 subttl SHOW LINE external variable usage (all [194]) 24634 24635 extern rosnpt ; Remote operating system name pointer 24636 extern brk ; Number of NUL's to send to simulate a break 24637 extern carier ; On a modem line, set if have carrier 24638 extern duplex ; Line duplex setting 24639 extern escape ; Escape character 24640 extern flow ; Type of flow control, if any 24641 extern handsh ; Handshake character 24642 extern local ; Set if in local mode 24643 extern mdmlin ; Set if dial-up line 24644 extern mytty ; Current logged in line (if not detached) 24645 extern nbict ; Network BIN% count 24646 extern netjfn ; Network JFN (even if we're remote...) 24647 extern nodnam ; Remote DECnet node name 24648 extern nodnum ; Remote DECnet node number (if monitor supports this) 24649 extern nrtflg ; Set if a valid Network Remote Terminal 24650 extern ptyflg ; Set if doing pseudo-terminal I/O 24651 extern ptynam ; ASCII device name 24652 extern sesflg ; Set if session logging is active 24653 extern sesjfn ; Contains session logging jfn 24654 extern ttynum ; Number of terminal being used 24655 extern tvtflg ; Set if on a TVT 24656 extern tvtchk ; Set if doing TVT discovery 24657 extern tvtbin ;[271] ; If doing binary, if not doing discovery, forcing it 24658 extern tvtunk ;[271] ; If negotiating, whether we know it or not 24659 extern vbict ; Virtual Terminal BIN% Count 24660 extern vchrcn ; Total characters flushed virtual terminal 24661 extern inpcbf ; INPUT network Characters Buffer Flushed 24662 extern vtermf ; Set if virtual line (I.E., PTY or NRT) 24663 24664 remark ;[223] Parity storage 24665 extern parity ; Type of parity in use 24666 extern none ;[223] No parity being enforced 24667 extern space ; Space parity routine (0, always) 24668 extern mark ; Mark parity routine (1, always) 24669 extern even ; Even parity routine 24670 extern odd ; Odd parity routine 24671 extern parpko ;[223] Non-zero if doing parity on packets, only 24672 extern parrck ;[223] Checking parity on recieve in addition to sending 24673 extern paract ;[258] Action on parity error 24674 extern parsub ;[258] Character to substitute if proceeding on parity 24675 extern ttipar ;[223] Total parity errors for session 24676 extern genpar ;[223] Use string instructions to generate a new string 24677 extern strc ;[223] Count of characters in temporary buffer 24678 extern strptr ;[223] Appropriate pointer to same 24679 extern strbuf ;[223] Global address of string buffer 24680 remark strbf2 ;[223] Flows into this, too 24681 24682 remark ; DECnet information (is in k20net) 24683 extern mynode ; Number of local executor (us) 24684 extern myname ; Local executor name 24685 extern ndvfxp ; If monitor has extended node verify (T79) 24686 24687 remark Some support routines k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18-1 K20DSP MAC 20-Aug-24 23:41 SHOW LINE external variable usage (all [194]) 24688 24689 extern chklin ; Checks a line's status, physical, network, Etc. 24690 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24691 subttle SHOW LINE display 24692 24693 001411'03 $shlin: entry $shlin ;[194] Also used in command loop 24694 001411'03 336 00 0 00 001112* ifmn. nrtflg ;[186] DECnet NRT? 24695 001412'03 254 00 0 00 001502' 24696 001413'03 200 01 0 00 000000# txmsg ;[186] 24697 001414'03 104 00 0 00 000076 24698 001415'03 320 12 0 00 001416' 24699 000155'02 000000000000# 24700 000420'04 122 145 155 157 164 24701 001416'03 561 01 0 00 000000* hrroi t1, nodnam ;[186] Point to the node 24702 001417'03 104 00 0 00 000076 PSOUT% ;[186] Type it 24703 001420'03 200 01 0 00 000000# txmsg <::> ;[186] Trailing punctuation 24704 001421'03 104 00 0 00 000076 24705 001422'03 320 12 0 00 001423' 24706 000156'02 000000000000# 24707 000427'04 072 072 000 000 000 24708 24709 remark ;[186] If we don't have T79, see if we can fake it 24710 001423'03 332 00 0 00 000000* ifme. ndvfxp ;[186] Does the monitor NOT have extended node verify? 24711 001424'03 254 00 0 00 001441' 24712 001425'03 120 01 0 00 000000* dmove t1, myname ;[186] Load only node name we really know about 24713 001426'03 415 16 0 00 001436' block. ;[186] Enter block context for easier decisioning 24714 001427'03 261 17 0 00 000016 24715 001430'03 312 01 0 00 001416* came t1, nodnam ;[186] DECnet node name is maximum of six ASCII bytes 24716 001431'03 263 17 0 00 000000 ret ;[186] First 5 characters didn't match 24717 001432'03 312 02 0 00 000000# came t2, nodnam+1 ;[186] How about the last character? 24718 001433'03 263 17 0 00 000000 ret ;[186] Didn't match ... 24719 001434'03 254 00 0 00 001032* retskp ;[186] Connection is to local node! 24720 001435'03 263 17 0 00 000000 endbk. ;[186] Tear down block frame 24721 001436'03 254 00 0 00 001441' ifskp. ;[186] +2 means we knew the node inately 24722 001437'03 200 03 0 00 000000* move t3, mynode ;[186] Load number of local executor (that's us!) 24723 001440'03 202 03 0 00 000000* movem t3, nodnum ;[186] Stomp into connection data 24724 001441'03 endif. ;[186] End case attempted node recognition 24725 001441'03 endif. ;[186] End case monitor does not have T79 24726 24727 remark ;[186] N.B., requires monitor edit T79 24728 001441'03 337 04 0 00 001440* skipg t4, nodnum ;[186] Do we know the node number? 24729 001442'03 254 00 0 00 001464' ifskp. ;[186] We do, let's type it 24730 001443'03 200 01 0 00 000000# txmsg ( [) ;[186] Appropriately open broket it 24731 001444'03 104 00 0 00 000076 24732 001445'03 320 12 0 00 001446' 24733 000157'02 000000000000# 24734 000430'04 040 133 000 000 000 24735 001446'03 201 01 0 00 000101 movei t1, .priou ;[186] Still going to terminal 24736 001447'03 201 03 0 00 000012 movei t3, ^d10 ;[186] Node numbers are in octal 24737 001450'03 135 02 0 00 005012' ldb t2,[pointr t4,n%area] ;[186] Load DECnet Area Number 24738 001451'03 322 02 0 00 001457' ifn. t2 ;[186] If none, may be phase II ... 24739 001452'03 104 00 0 00 000224 NOUT% ;[186] Otherwise, type it 24740 001453'03 320 14 0 00 001454' erjmps .+1 ;[186] Catch and suppress error 24741 001454'03 201 02 0 00 000056 movei t2, "." ;[186] Punctuation suffix for areas 24742 001455'03 104 00 0 00 000051 BOUT% ;[186] Punctuate the node number 24743 001456'03 320 14 0 00 001457' erjmps .+1 ;[186] Catch and suppress error 24744 001457'03 endif. ;[186] End case non-zero area 24745 001457'03 135 02 0 00 005013' ldb t2,[pointr t4,n%node] ;[186] Load DECnet Node Number k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-1 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24746 001460'03 104 00 0 00 000224 NOUT% ;[186] Type it 24747 001461'03 320 14 0 00 001462' erjmps .+1 ;[186] Catch and suppress error 24748 001462'03 201 02 0 00 000135 movei t2, "]" ;[186] Close broket 24749 001463'03 104 00 0 00 000051 BOUT% ;[186] Trailing punctuation on DECnet node number 24750 001464'03 endif. ;[186] End case known node number 24751 24752 001464'03 200 04 0 00 000000* move t4, rosnpt ;[186] Load remote operating system name pointer 24753 001465'03 316 04 0 00 004754' camn t4, [-1] ;[186] Not our special bogon talisman? 24754 001466'03 254 00 0 00 001476' ifskp. ;[186] No, it's a valid text pointer 24755 001467'03 200 01 0 00 000000# txmsg < (> ;[186] Put it in parenthesis 24756 001470'03 104 00 0 00 000076 24757 001471'03 320 12 0 00 001472' 24758 000160'02 000000000000# 24759 000431'04 040 050 000 000 000 24760 001472'03 200 01 0 00 000004 move t1, t4 ;[186] Load pointer to the remote os name 24761 001473'03 104 00 0 00 000076 PSOUT% ;[186] Type it 24762 001474'03 201 01 0 00 000051 movei t1, ")" ;[186] Closing parenthesis 24763 001475'03 104 00 0 00 000074 PBOUT% ;[186] Tie off the operating system name 24764 001476'03 endif. ;[186] End case known remote operating system 24765 24766 txmsg < 24767 001476'03 200 01 0 00 000000# (Network Remote Terminal, KERMIT-20 is LOCAL)> ;[186] Not using any local TTY 24768 001477'03 104 00 0 00 000076 24769 001500'03 320 12 0 00 001501' 24770 000161'02 000000000000# 24771 000432'04 015 012 040 050 116 24772 001501'03 254 00 0 00 001575' jrst $show3 ;[186] Skip the modem control 24773 001502'03 endif. ;[186] End case DECnet NRT 24774 24775 001502'03 200 01 0 00 000000# txmsg 24776 001503'03 104 00 0 00 000076 24777 001504'03 320 12 0 00 001505' 24778 000162'02 000000000000# 24779 000444'04 124 124 131 040 146 24780 001505'03 201 01 0 00 000101 numout ttynum, 8 24781 001506'03 200 02 0 00 000000* 24782 001507'03 201 03 0 00 000010 24783 001510'03 104 00 0 00 000224 24784 001511'03 320 14 0 00 001512' 24785 001512'03 312 02 0 00 000000# came t2, ctynum ;[223] Is this the console? 24786 001513'03 254 00 0 00 001517' ifskp. ;[223] Yes, remark about that 24787 001514'03 200 01 0 00 000000# txmsg < [Console]> ;[223] A discrete indicator 24788 001515'03 104 00 0 00 000076 24789 001516'03 320 12 0 00 001517' 24790 000163'02 000000000000# 24791 000451'04 040 133 103 157 156 24792 001517'03 endif. ;[223] 24793 24794 001517'03 332 00 0 00 001110* ifme. ptyflg ;[186] Physical line? 24795 001520'03 254 00 0 00 001534' 24796 001521'03 200 04 0 00 000000* move t4, mytty ; See whether we're local or remote... 24797 001522'03 312 04 0 00 001506* came t4, ttynum ; If it's us 24798 001523'03 254 00 0 00 001530' ifskp. ; Then we are the remote 24799 txmsg < 24800 001524'03 200 01 0 00 000000# (job's controlling terminal, KERMIT-20 is REMOTE)> k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-2 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24801 001525'03 104 00 0 00 000076 24802 001526'03 320 12 0 00 001527' 24803 000164'02 000000000000# 24804 000454'04 015 012 040 050 152 24805 001527'03 254 00 0 00 001533' else. ; Anything else means we're local 24806 txmsg < 24807 001530'03 200 01 0 00 000000# (assigned TTY line, KERMIT-20 is LOCAL)> 24808 001531'03 104 00 0 00 000076 24809 001532'03 320 12 0 00 001533' 24810 000165'02 000000000000# 24811 000467'04 015 012 040 050 141 24812 001533'03 endif. 24813 001533'03 254 00 0 00 001554' else. ;[186] Otherwise, it's a pseudo terminal 24814 001534'03 200 01 0 00 000000# txmsg (< [>) ;[186] Type opening broket 24815 001535'03 104 00 0 00 000076 24816 001536'03 320 12 0 00 001537' 24817 000166'02 000000000000# 24818 000500'04 040 133 000 000 000 24819 001537'03 561 01 0 00 000000* hrroi t1, ptynam ;[186] Load the name of the pseudo-terminal 24820 001540'03 104 00 0 00 000076 PSOUT% ;[186] Type the punctuated device 24821 001541'03 201 01 0 00 000135 movei t1, "]" ;[186] Load closing broket 24822 001542'03 104 00 0 00 000074 PBOUT% ;[186] and type that 24823 txmsg < 24824 001543'03 200 01 0 00 000000# (pseudo-terminal loopback to > ;[186] 24825 001544'03 104 00 0 00 000076 24826 001545'03 320 12 0 00 001546' 24827 000167'02 000000000000# 24828 000501'04 015 012 040 050 160 24829 001546'03 561 01 0 00 001425* hrroi t1, myname ;[186] Name of local node 24830 001547'03 104 00 0 00 000076 PSOUT% ;[186] Type that 24831 001550'03 200 01 0 00 000000# txmsg <::, KERMIT-20 is LOCAL)> ;[186] 24832 001551'03 104 00 0 00 000076 24833 001552'03 320 12 0 00 001553' 24834 000170'02 000000000000# 24835 000510'04 072 072 054 040 113 24836 001553'03 254 00 0 00 001575' jrst $show3 ;[186] PTY never has modem control 24837 001554'03 endif. ;[186] End case terminal check 24838 24839 001554'03 337 01 0 00 000000* skipg t1, netjfn ;[186] Tell about modem control & carrier. 24840 001555'03 200 01 0 00 000402* move t1, ttyjfn ;[186] Unless using local terminal 24841 001556'03 260 17 0 00 000000* call chklin 24842 001557'03 336 00 0 00 000000* ifmn. mdmlin ;[194] 24843 001560'03 254 00 0 00 001575' 24844 txmsg < 24845 Line has modem control 24846 001561'03 200 01 0 00 000000# Carrier: > 24847 001562'03 104 00 0 00 000076 24848 001563'03 320 12 0 00 001564' 24849 000171'02 000000000000# 24850 000515'04 015 012 040 040 114 24851 24852 001564'03 336 00 0 00 000000* ifmn. carier ; Is it? 24853 001565'03 254 00 0 00 001572' 24854 001566'03 200 01 0 00 000000# txmsg ; Say it's on. 24855 001567'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-3 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24856 001570'03 320 12 0 00 001571' 24857 000172'02 000000000000# 24858 000526'04 117 156 000 000 000 24859 001571'03 254 00 0 00 001575' else. ; Otherwise... 24860 001572'03 200 01 0 00 000000# txmsg ; No. 24861 001573'03 104 00 0 00 000076 24862 001574'03 320 12 0 00 001575' 24863 000173'02 000000000000# 24864 000527'04 117 146 146 000 000 24865 001575'03 endif. 24866 001575'03 endif. ;[194] 24867 24868 $show3: txmsg < 24869 001575'03 200 01 0 00 000000# Handshake: > ;[76] Handshake 24870 001576'03 104 00 0 00 000076 24871 001577'03 320 12 0 00 001600' 24872 000174'02 000000000000# 24873 000530'04 015 012 040 040 110 24874 001600'03 332 01 0 00 000000* skipe t1, handsh ;[194] Any? 24875 001601'03 254 00 0 00 001606' ifskp. ;[194] Blew up the front end, anyway 24876 001602'03 200 01 0 00 000000# txmsg 24877 001603'03 104 00 0 00 000076 24878 001604'03 320 12 0 00 001605' 24879 000175'02 000000000000# 24880 000534'04 116 157 156 145 000 24881 001605'03 254 00 0 00 001607' else. ;[194] Otherwise, type it 24882 001606'03 260 17 0 00 004203' call putc 24883 001607'03 endif. ;[194] 24884 24885 txmsg < 24886 001607'03 200 01 0 00 000000# Flow-Control: > ;[143] 24887 001610'03 104 00 0 00 000076 24888 001611'03 320 12 0 00 001612' 24889 000176'02 000000000000# 24890 000535'04 015 012 040 040 106 24891 001612'03 336 00 0 00 000000* ifmn. flow 24892 001613'03 254 00 0 00 001620' 24893 001614'03 200 01 0 00 000000# txmsg 24894 001615'03 104 00 0 00 000076 24895 001616'03 320 12 0 00 001617' 24896 000177'02 000000000000# 24897 000542'04 130 117 116 055 130 24898 001617'03 254 00 0 00 001623' else. 24899 001620'03 200 01 0 00 000000# txmsg 24900 001621'03 104 00 0 00 000076 24901 001622'03 320 12 0 00 001623' 24902 000200'02 000000000000# 24903 000544'04 116 157 156 145 000 24904 001623'03 endif. 24905 24906 001623'03 336 00 0 00 000000* ifmn. local ;[194] Don't confuse them with this 24907 001624'03 254 00 0 00 001632' 24908 txmsg < 24909 001625'03 200 01 0 00 000000# Escape Character: > ;[217] Present the escape character 24910 001626'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-4 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24911 001627'03 320 12 0 00 001630' 24912 000201'02 000000000000# 24913 000545'04 015 012 040 040 105 24914 001630'03 200 01 0 00 000000* move t1, escape 24915 001631'03 260 17 0 00 004203' call putc 24916 001632'03 endif. ;[194] 24917 24918 24919 $show4: txmsg < 24920 001632'03 200 01 0 00 000000# Parity: > 24921 001633'03 104 00 0 00 000076 24922 001634'03 320 12 0 00 001635' 24923 000202'02 000000000000# 24924 000552'04 015 012 040 040 120 24925 001635'03 200 02 0 00 000262* move t2, parity 24926 001636'03 415 01 0 00 000000# xmovei t1, enone ; None 24927 001637'03 306 02 0 00 000000* cain t2, space ; Space 24928 001640'03 415 01 0 00 000000# xmovei t1, espac 24929 001641'03 306 02 0 00 000000* cain t2, mark ; Mark 24930 001642'03 415 01 0 00 000000# xmovei t1, emark 24931 001643'03 306 02 0 00 000000* cain t2, odd ; Odd 24932 001644'03 415 01 0 00 000000# xmovei t1, eodd 24933 001645'03 306 02 0 00 000000* cain t2, even ; Even 24934 001646'03 415 01 0 00 000000# xmovei t1, eeven 24935 001647'03 661 01 0 00 610001 txo t1, .px7 ; Turn into a OWGP 24936 001650'03 104 00 0 00 000076 PSOUT% ; Finally type something 24937 24938 001651'03 306 02 0 00 000263* cain t2, none ;[223] Doing any parity at all? 24939 001652'03 254 00 0 00 001727' jrst $sho4b ;[258] No, skip domains 24940 001653'03 120 02 0 00 000270* dmove t2, parpko ;[223] Load parity domains 24941 001654'03 200 04 0 00 000002 move t4, t2 ;[223] See if doing either 24942 001655'03 434 04 0 00 000003 or t4, t3 ;[223] by seeing if either were set 24943 001656'03 322 04 0 00 001702' jumpe t4, $sho4a ;[223] If zero, no domain modification 24944 24945 001657'03 200 04 0 00 000002 move t4, t2 ;[223] See if doing both 24946 001660'03 404 04 0 00 000003 and t4, t3 ;[223] by seeing if both set 24947 001661'03 201 01 0 00 000040 movei t1, .chspc ;[223] Space over 24948 001662'03 104 00 0 00 000074 PBOUT% ;[223] 24949 001663'03 201 01 0 00 000133 movei t1, "[" ;[223] Open broket 24950 001664'03 104 00 0 00 000074 PBOUT% ;[223] 24951 001665'03 322 02 0 00 001671' ifn. t2 ;[223] Packets Only? 24952 001666'03 200 01 0 00 000000# txmsg () ;[223] 24953 001667'03 104 00 0 00 000076 24954 001670'03 320 12 0 00 001671' 24955 000203'02 000000000000# 24956 000556'04 120 141 143 153 145 24957 001671'03 endif. ;[223] 24958 001671'03 322 04 0 00 001674' ifn. t4 ;[223] Plural? 24959 001672'03 201 01 0 00 000054 movei t1, "," ;[223] Yes, wants a comma, then 24960 001673'03 104 00 0 00 000074 PBOUT% ;[223] 24961 001674'03 endif. ;[223] 24962 001674'03 322 03 0 00 001700' ifn. t3 ;[223] Not just generating parity? 24963 001675'03 200 01 0 00 000000# txmsg () ;[223] 24964 001676'03 104 00 0 00 000076 24965 001677'03 320 12 0 00 001700' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-5 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 24966 000204'02 000000000000# 24967 000561'04 122 145 143 145 151 24968 001700'03 endif. ;[223] 24969 001700'03 201 01 0 00 000135 movei t1, "]" ;[223] Close broket 24970 001701'03 104 00 0 00 000074 PBOUT% ;[223] 24971 24972 24973 001702'03 336 04 0 00 000000* $sho4a: skipn t4, ttipar ;[258] Any parity errors?? 24974 001703'03 254 00 0 00 001714' ifskp. ;[223] Yes, type these 24975 txmsg < 24976 001704'03 200 01 0 00 000000# Parity Errors: > ;[223] 24977 001705'03 104 00 0 00 000076 24978 001706'03 320 12 0 00 001707' 24979 000205'02 000000000000# 24980 000565'04 015 012 040 040 120 24981 001707'03 201 01 0 00 000101 numout t4 ;[223] Type how many 24982 001710'03 200 02 0 00 000004 24983 001711'03 201 03 0 00 000012 24984 001712'03 104 00 0 00 000224 24985 001713'03 320 14 0 00 001714' 24986 001714'03 endif. ;[223] Done or nothing to do 24987 24988 001714'03 332 00 0 00 000000* ifme. paract ;[258] Abort on parity error 24989 001715'03 254 00 0 00 001722' 24990 txmsg < 24991 001716'03 200 01 0 00 000000# Parity Action: Abort> ;[258] 24992 001717'03 104 00 0 00 000076 24993 001720'03 320 12 0 00 001721' 24994 000206'02 000000000000# 24995 000572'04 015 012 040 040 120 24996 001721'03 254 00 0 00 001727' else. ;[258] 24997 txmsg < 24998 Parity Action: Proceed 24999 001722'03 200 01 0 00 000000# Substitution: > ;[258] 25000 001723'03 104 00 0 00 000076 25001 001724'03 320 12 0 00 001725' 25002 000207'02 000000000000# 25003 000600'04 015 012 040 040 120 25004 25005 001725'03 200 02 0 00 000000* move t2, parsub ;[258] Load substitution character 25006 001726'03 260 17 0 00 004230' call dspchr ;[266] 25007 001727'03 endif. ;[258] Done or nothing to do 25008 25009 25010 $sho4b: txmsg < 25011 001727'03 200 01 0 00 000000# Duplex: > ;[258] 25012 001730'03 104 00 0 00 000076 25013 001731'03 320 12 0 00 001732' 25014 000210'02 000000000000# 25015 000613'04 015 012 040 040 104 25016 001732'03 200 02 0 00 000000* move t2, duplex 25017 001733'03 302 02 0 00 000000 caie t2, dxfull 25018 001734'03 254 00 0 00 001741' ifskp. 25019 001735'03 200 01 0 00 000000# txmsg 25020 001736'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-6 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 25021 001737'03 320 12 0 00 001740' 25022 000211'02 000000000000# 25023 000617'04 106 165 154 154 000 25024 001740'03 254 00 0 00 001744' else. 25025 001741'03 200 01 0 00 000000# txmsg 25026 001742'03 104 00 0 00 000076 25027 001743'03 320 12 0 00 001744' 25028 000212'02 000000000000# 25029 000620'04 110 141 154 146 000 25030 001744'03 endif. 25031 25032 001744'03 337 02 0 00 001064* skipg t2,speed ; If negative, we don't really know it. 25033 001745'03 254 00 0 00 001755' ifskp. ;[194] We know it 25034 txmsg < 25035 001746'03 200 01 0 00 000000# Speed: > ; Line speed. 25036 001747'03 104 00 0 00 000076 25037 001750'03 320 12 0 00 001751' 25038 000213'02 000000000000# 25039 000621'04 015 012 040 040 123 25040 001751'03 201 01 0 00 000101 movei t1, .priou 25041 001752'03 201 03 0 00 000012 movei t3, ^d10 25042 001753'03 104 00 0 00 000224 NOUT% 25043 001754'03 320 14 0 00 001755' erjmps .+1 25044 001755'03 endif. ;[194] 25045 25046 txmsg < 25047 001755'03 200 01 0 00 000000# Break Simulation: > 25048 001756'03 104 00 0 00 000076 25049 001757'03 320 12 0 00 001760' 25050 000214'02 000000000000# 25051 000625'04 015 012 040 040 102 25052 001760'03 337 00 0 00 001744* ifmg. speed 25053 001761'03 254 00 0 00 001776' 25054 001762'03 200 01 0 00 000000# txmsg 25055 001763'03 104 00 0 00 000076 25056 001764'03 320 12 0 00 001765' 25057 000215'02 000000000000# 25058 000632'04 105 156 141 142 154 25059 001765'03 201 01 0 00 000101 numout brk 25060 001766'03 200 02 0 00 000000* 25061 001767'03 201 03 0 00 000012 25062 001770'03 104 00 0 00 000224 25063 001771'03 320 14 0 00 001772' 25064 001772'03 200 01 0 00 000000# txmsg < NULs at 50 baud> 25065 001773'03 104 00 0 00 000076 25066 001774'03 320 12 0 00 001775' 25067 000216'02 000000000000# 25068 000634'04 040 116 125 114 163 25069 001775'03 254 00 0 00 002001' else. 25070 001776'03 200 01 0 00 000000# txmsg 25071 001777'03 104 00 0 00 000076 25072 002000'03 320 12 0 00 002001' 25073 000217'02 000000000000# 25074 000640'04 104 151 163 141 142 25075 002001'03 endif. k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-7 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 25076 25077 002001'03 336 00 0 00 000000* skipn vtermf ;[186] Virtual terminal? 25078 002002'03 254 00 0 00 002035' jrst $sho4e ;[186] No, then this makes no sense 25079 25080 002003'03 332 00 0 00 001517* ifme. ptyflg ;[186] Unless loopback 25081 002004'03 254 00 0 00 002011' 25082 txmsg < 25083 002005'03 200 01 0 00 000000# NRT Connection: > ;[186] Status of connection 25084 002006'03 104 00 0 00 000076 25085 002007'03 320 12 0 00 002010' 25086 000220'02 000000000000# 25087 000642'04 015 012 040 040 116 25088 002010'03 254 00 0 00 002014' else. 25089 txmsg < 25090 002011'03 200 01 0 00 000000# PTY Connection: > ;[186] Status of connection 25091 002012'03 104 00 0 00 000076 25092 002013'03 320 12 0 00 002014' 25093 000221'02 000000000000# 25094 000647'04 015 012 040 040 120 25095 002014'03 endif. ;[186] 25096 25097 002014'03 337 01 0 00 001554* skipg t1,netjfn ;[186] Load line to check 25098 002015'03 200 01 0 00 001555* move t1, ttyjfn ;[186] Unless using local terminal 25099 002016'03 260 17 0 00 001556* call chklin ;[186] Check 'line' status 25100 002017'03 336 00 0 00 001564* ifmn. carier ;[186] However, is it? 25101 002020'03 254 00 0 00 002025' 25102 002021'03 200 01 0 00 000000# txmsg ;[186] Assume good news 25103 002022'03 104 00 0 00 000076 25104 002023'03 320 12 0 00 002024' 25105 000222'02 000000000000# 25106 000654'04 117 156 154 151 156 25107 002024'03 254 00 0 00 002030' else. 25108 002025'03 200 01 0 00 000000# txmsg ;[186] It isn't, sigh... 25109 002026'03 104 00 0 00 000076 25110 002027'03 320 12 0 00 002030' 25111 000223'02 000000000000# 25112 000656'04 104 162 157 160 160 25113 002030'03 endif. ;[186] Either way, tell us 25114 25115 002030'03 260 17 0 00 001052' call prntbd ;[210] Print some kind of baud rate maybe 25116 25117 002031'03 200 01 0 00 000000* move t1, vbict ;[186] Ever connected? 25118 002032'03 270 01 0 00 000000* add t1, nbict ;[186] any network output 25119 002033'03 322 01 0 00 002035' ifn. t1 ;[186] Yes to either one means display something 25120 002034'03 260 17 0 00 003761' call disper ;[186] Display information concerning performance 25121 002035'03 endif. 25122 25123 remark $sho4e ;[186] Falls through 25124 25125 002035'03 337 04 0 00 000412* $sho4e: skipg t4, sesjfn ;[195] Are we logging? 25126 002036'03 254 00 0 00 002130' ifskp. ;[195] Well, are we? 25127 002037'03 336 00 0 00 000414* ifmn. sesflg ;[195] BUT!! Are we actively logging right now? 25128 002040'03 254 00 0 00 002045' 25129 txmsg < 25130 002041'03 200 01 0 00 000000# Log: (Enabled) > ;[220] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-8 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 25131 002042'03 104 00 0 00 000076 25132 002043'03 320 12 0 00 002044' 25133 000224'02 000000000000# 25134 000660'04 015 012 040 040 114 25135 002044'03 254 00 0 00 002050' else. ;[220] Otherwise, not ACTIVELY logging 25136 txmsg < 25137 002045'03 200 01 0 00 000000# Log: (Disabled) > ;[220] 25138 002046'03 104 00 0 00 000076 25139 002047'03 320 12 0 00 002050' 25140 000225'02 000000000000# 25141 000665'04 015 012 040 040 114 25142 002050'03 endif. ;[220] 25143 002050'03 200 02 0 00 000004 move t2, t4 ;[220] Reload the logging JFN 25144 002051'03 201 01 0 00 000101 movei t1, .priou ;[220] Typing on the terminal? 25145 002052'03 302 02 0 00 377777 caie t2, .nulio ;[193] Efficiently dumping it? 25146 002053'03 254 00 0 00 002064' ifskp. ;[193] Yes, that's a constant string 25147 002054'03 120 02 0 00 000000# dmove t2, nul5 ;[193] Point to said string 25148 002055'03 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 25149 002056'03 320 12 0 00 002060' %jserr (,) ;[193] ?? 25150 002057'03 254 00 0 00 002063' 25151 002060'03 265 01 0 00 000442* 25152 002061'03 000000000000# 25153 002062'03 254 00 0 00 002063' 25154 000672'04 125 156 141 142 154 25155 002063'03 254 00 0 00 002130' else. ;[193] Otherwise, a 'real' JFN 25156 002064'03 201 02 0 00 000040 movx t2, .chspc ;[193] Space over 25157 002065'03 104 00 0 00 000051 BOUT% ;[193] So columns line up 25158 002066'03 320 12 0 00 002070' %jserr (,) ;[194] ??? 25159 002067'03 254 00 0 00 002073' 25160 002070'03 265 01 0 00 002060* 25161 002071'03 000000000000# 25162 002072'03 254 00 0 00 002073' 25163 000700'04 125 156 141 142 154 25164 002073'03 200 02 0 00 000004 move t2, t4 ;[193] Restore the logging JFN 25165 002074'03 403 03 0 00 000004 setzb t3, t4 ;[193] Use default formatting, no prefix 25166 002075'03 104 00 0 00 000030 JFNS ; Say what it is. 25167 002076'03 320 12 0 00 002100' %jserr (,) ;[194] 25168 002077'03 254 00 0 00 002103' 25169 002100'03 265 01 0 00 002070* 25170 002101'03 000000000000# 25171 002102'03 254 00 0 00 002103' 25172 000707'04 125 156 141 142 154 25173 002103'03 200 01 0 00 000002 move t1, t2 ;[240] Load the file JFN 25174 002104'03 104 00 0 00 000043 RFPTR% ;[240] Get the current position in the file 25175 002105'03 320 12 0 00 002107' ifje. r ;[240] Couldn't ... 25176 002106'03 254 00 0 00 002111' 25177 002107'03 200 04 0 00 000001 move t4, t1 ;[240] Save the error for debugging heros 25178 002110'03 474 02 0 00 000000 seto t2, ;[240] Flag an error for downstream 25179 002111'03 endif. ;[240] End case JSYS error handling 25180 002111'03 323 02 0 00 002130' ifg. t2 ;[240] Only display if we've written something 25181 002112'03 200 01 0 00 000000# txmsg <, > ;[240] Punctuate and space over 25182 002113'03 104 00 0 00 000076 25183 002114'03 320 12 0 00 002115' 25184 000226'02 000000000000# 25185 000716'04 054 040 000 000 000 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-9 K20DSP MAC 20-Aug-24 23:41 SHOW LINE display 25186 002115'03 201 01 0 00 000101 movei t1, .priou ;[240] Still going to terminal 25187 002116'03 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ;[240] Byte count is decimal 25188 002117'03 104 00 0 00 000224 NOUT% ;[240] Type it 25189 002120'03 320 12 0 00 002122' %jserr (,) ;[240] 25190 002121'03 254 00 0 00 002125' 25191 002122'03 265 01 0 00 002100* 25192 002123'03 000000000000# 25193 002124'03 254 00 0 00 002125' 25194 000717'04 125 156 141 142 154 25195 002125'03 200 01 0 00 000000# txmsg < Bytes Written> ;[240] 25196 002126'03 104 00 0 00 000076 25197 002127'03 320 12 0 00 002130' 25198 000227'02 000000000000# 25199 000730'04 040 102 171 164 145 25200 002130'03 endif. ;[240] End case displaying file offset 25201 002130'03 endif. ;[193] End .nulio special casing 25202 002130'03 endif. ;[194] End case session logging JFN open 25203 25204 002130'03 332 00 0 00 001411* $sho4f: ifme. nrtflg ;[223] Not if NRT; line number is meaningless 25205 002131'03 254 00 0 00 002137' 25206 002132'03 200 01 0 00 001522* move t1, ttynum ;[223] Load line number (FE or TTY# of PTY, if PTY) 25207 002133'03 260 17 0 00 000000* call getnti ;[223] Get network information on this line 25208 002134'03 254 00 0 00 002137' anskp. ;[223] Failed, so better skip the line characteristics 25209 remark t1, ;[223] Network Type from NTINF% 25210 remark t2, ;[223] Line Type from NTINF% 25211 002135'03 200 03 0 00 002132* move t3, ttynum ;[223] Load line number 25212 002136'03 260 17 0 00 004267' call linchr ;[186] Show some things 25213 002137'03 endif. ;[223] 25214 25215 002137'03 $sho4h: remark ;put next one here... 25216 25217 002137'03 561 01 0 00 001406* $sho4x: hrroi t1, crlflf ;[194] Double line feed 25218 002140'03 104 00 0 00 000076 PSOUT% ;[194] Tie off the blat 25219 002141'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 25220 remark ;[194] May fall through .. 25221 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20DSP MAC 20-Aug-24 23:41 SHOW FILE-INFO external variables 25222 subttl SHOW FILE-INFO external variables 25223 25224 extern abtfil ; Set if keeping a file, zero to discard 25225 extern autbyt ; Set if doing auto-bytesize detection 25226 extern ebtflg ; Set if forcing 8-bit mode 25227 extern tbtflg ;[223] ; Set if forcing 36-bit mode 25228 extern expung ; Set if deletes are expunging 25229 extern itsflg ; Flag for handling ITS-binary format files 25230 extern tlgjfn ; Transaction log JFN 25231 extern xfnflg ; Flag for filename conversion 25232 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20DSP MAC 20-Aug-24 23:41 SHOW FILE-INFO display logic 25233 subttl SHOW FILE-INFO display logic 25234 25235 002142'03 $shfil: entry $shfil 25236 25237 002142'03 200 01 0 00 000000# txmsg 25238 002143'03 104 00 0 00 000076 25239 002144'03 320 12 0 00 002145' 25240 000230'02 000000000000# 25241 000733'04 102 171 164 145 040 25242 002145'03 332 00 0 00 000000* ifme. autbyt ;[194] Not auto-byte 25243 002146'03 254 00 0 00 002167' 25244 002147'03 332 00 0 00 000000* ifme. tbtflg ;[232] Not 36 bit 25245 002150'03 254 00 0 00 002163' 25246 002151'03 332 00 0 00 000000* ifme. ebtflg 25247 002152'03 254 00 0 00 002157' 25248 002153'03 200 01 0 00 000000# txmsg 25249 002154'03 104 00 0 00 000076 25250 002155'03 320 12 0 00 002156' 25251 000231'02 000000000000# 25252 000740'04 123 145 166 145 156 25253 002156'03 254 00 0 00 002162' else. 25254 002157'03 200 01 0 00 000000# txmsg 25255 002160'03 104 00 0 00 000076 25256 002161'03 320 12 0 00 002162' 25257 000232'02 000000000000# 25258 000742'04 105 151 147 150 164 25259 002162'03 endif. 25260 002162'03 254 00 0 00 002166' else. ;[232] Really post-processed 7 bit mode 25261 002163'03 200 01 0 00 000000# txmsg 25262 002164'03 104 00 0 00 000076 25263 002165'03 320 12 0 00 002166' 25264 000233'02 000000000000# 25265 000744'04 124 150 151 162 164 25266 002166'03 endif. ;[232] 25267 002166'03 254 00 0 00 002172' else. 25268 002167'03 200 01 0 00 000000# txmsg 25269 002170'03 104 00 0 00 000076 25270 002171'03 320 12 0 00 002172' 25271 000234'02 000000000000# 25272 000751'04 101 165 164 157 000 25273 002172'03 endif. ;[194] 25274 txmsg < 25275 002172'03 200 01 0 00 000000# File name conversion: > ;[84] 25276 002173'03 104 00 0 00 000076 25277 002174'03 320 12 0 00 002175' 25278 000235'02 000000000000# 25279 000752'04 015 012 040 040 106 25280 002175'03 332 00 0 00 000000* ifme. xfnflg ;[84] 25281 002176'03 254 00 0 00 002203' 25282 002177'03 200 01 0 00 000000# txmsg ;[84] 25283 002200'03 104 00 0 00 000076 25284 002201'03 320 12 0 00 002202' 25285 000236'02 000000000000# 25286 000760'04 117 146 146 000 000 25287 002202'03 254 00 0 00 002206' else. ;[84] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-1 K20DSP MAC 20-Aug-24 23:41 SHOW FILE-INFO display logic 25288 002203'03 200 01 0 00 000000# txmsg ;[84] 25289 002204'03 104 00 0 00 000076 25290 002205'03 320 12 0 00 002206' 25291 000237'02 000000000000# 25292 000761'04 117 156 000 000 000 25293 002206'03 endif. ;[84] 25294 txmsg < 25295 002206'03 200 01 0 00 000000# ITS-binary-format file recognition: > ;[75] 25296 002207'03 104 00 0 00 000076 25297 002210'03 320 12 0 00 002211' 25298 000240'02 000000000000# 25299 000762'04 015 012 040 040 111 25300 002211'03 336 00 0 00 000000* ifmn. itsflg ;[75] 25301 002212'03 254 00 0 00 002217' 25302 002213'03 200 01 0 00 000000# txmsg ;[75] 25303 002214'03 104 00 0 00 000076 25304 002215'03 320 12 0 00 002216' 25305 000241'02 000000000000# 25306 000773'04 145 156 141 142 154 25307 002216'03 254 00 0 00 002222' else. ;[75] 25308 002217'03 200 01 0 00 000000# txmsg ;[75] 25309 002220'03 104 00 0 00 000076 25310 002221'03 320 12 0 00 002222' 25311 000242'02 000000000000# 25312 000775'04 144 151 163 141 142 25313 002222'03 endif. ;[75] 25314 txmsg < 25315 002222'03 200 01 0 00 000000# Disposition for incomplete incoming files: > ;[42] 25316 002223'03 104 00 0 00 000076 25317 002224'03 320 12 0 00 002225' 25318 000243'02 000000000000# 25319 000777'04 015 012 040 040 104 25320 002225'03 332 00 0 00 000000* ifme. abtfil ;[42] 25321 002226'03 254 00 0 00 002233' 25322 002227'03 200 01 0 00 000000# txmsg ;[42] 25323 002230'03 104 00 0 00 000076 25324 002231'03 320 12 0 00 002232' 25325 000244'02 000000000000# 25326 001011'04 104 151 163 143 141 25327 002232'03 254 00 0 00 002236' else. ;[42] 25328 002233'03 200 01 0 00 000000# txmsg ;[42] 25329 002234'03 104 00 0 00 000076 25330 002235'03 320 12 0 00 002236' 25331 000245'02 000000000000# 25332 001013'04 113 145 145 160 040 25333 002236'03 endif. ;[42] 25334 txmsg < 25335 002236'03 200 01 0 00 000000# Deleted files are > ;[143] 25336 002237'03 104 00 0 00 000076 25337 002240'03 320 12 0 00 002241' 25338 000246'02 000000000000# 25339 001021'04 015 012 040 040 104 25340 002241'03 332 00 0 00 000000* ifme. expung ;[194] 25341 002242'03 254 00 0 00 002246' 25342 002243'03 200 01 0 00 000000# txmsg ;[194] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-2 K20DSP MAC 20-Aug-24 23:41 SHOW FILE-INFO display logic 25343 002244'03 104 00 0 00 000076 25344 002245'03 320 12 0 00 002246' 25345 000247'02 000000000000# 25346 001026'04 116 117 124 040 000 25347 002246'03 endif. ;[194] 25348 txmsg ;[126] 25350 002247'03 104 00 0 00 000076 25351 002250'03 320 12 0 00 002251' 25352 000250'02 000000000000# 25353 001027'04 145 170 160 165 156 25354 25355 25356 002251'03 337 02 0 00 000000* skipg t2, tlgjfn ; Any transaction log? 25357 002252'03 254 00 0 00 002324' ifskp. ;[194] Yes 25358 002253'03 201 01 0 00 000101 movei t1, .priou ; Yes, a real file, 25359 002254'03 400 04 0 00 000000 setz t4, ;[193] Let's assume no prefix or stop character 25360 002255'03 302 02 0 00 377777 caie t2, .nulio ;[193] Efficiently dumping it? 25361 002256'03 254 00 0 00 002267' ifskp. ;[193] Yes, that's a constant string 25362 002257'03 120 02 0 00 000000# dmove t2, nul5 ;[193] Point to said string 25363 002260'03 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 25364 002261'03 320 12 0 00 002263' %jserr (,) ;[193] ?? 25365 002262'03 254 00 0 00 002266' 25366 002263'03 265 01 0 00 002122* 25367 002264'03 000000000000# 25368 002265'03 254 00 0 00 002266' 25369 001041'04 125 156 141 142 154 25370 002266'03 254 00 0 00 002323' else. ;[193] Otherwise, a 'real' JFN 25371 002267'03 400 03 0 00 000000 setz t3, ;[194] Use default formatting 25372 002270'03 104 00 0 00 000030 JFNS ; Say what it is. 25373 002271'03 320 12 0 00 002273' %jserr (,) ;[194] 25374 002272'03 254 00 0 00 002276' 25375 002273'03 265 01 0 00 002263* 25376 002274'03 000000000000# 25377 002275'03 254 00 0 00 002276' 25378 001047'04 125 156 141 142 154 25379 002276'03 200 01 0 00 000002 move t1, t2 ;[240] Load the file JFN 25380 002277'03 104 00 0 00 000043 RFPTR% ;[240] Get the current position in the file 25381 002300'03 320 12 0 00 002302' ifje. r ;[240] Couldn't ... 25382 002301'03 254 00 0 00 002304' 25383 002302'03 200 04 0 00 000001 move t4, t1 ;[240] Save the error for debugging heros 25384 002303'03 474 02 0 00 000000 seto t2, ;[240] Flag an error for downstream 25385 002304'03 endif. ;[240] End case JSYS error handling 25386 002304'03 323 02 0 00 002323' ifg. t2 ;[240] Only display if we've written something 25387 002305'03 200 01 0 00 000000# txmsg <, > ;[240] Punctuate and space over 25388 002306'03 104 00 0 00 000076 25389 002307'03 320 12 0 00 002310' 25390 000251'02 000000000000# 25391 001057'04 054 040 000 000 000 25392 002310'03 201 01 0 00 000101 movei t1, .priou ;[240] Still going to terminal 25393 002311'03 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ;[240] Byte count is decimal 25394 002312'03 104 00 0 00 000224 NOUT% ;[240] Type it 25395 002313'03 320 12 0 00 002315' %jserr (,) ;[240] 25396 002314'03 254 00 0 00 002320' 25397 002315'03 265 01 0 00 002273* k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-3 K20DSP MAC 20-Aug-24 23:41 SHOW FILE-INFO display logic 25398 002316'03 000000000000# 25399 002317'03 254 00 0 00 002320' 25400 001060'04 125 156 141 142 154 25401 002320'03 200 01 0 00 000000# txmsg < Bytes Written> ;[240] 25402 002321'03 104 00 0 00 000076 25403 002322'03 320 12 0 00 002323' 25404 000252'02 000000000000# 25405 001071'04 040 102 171 164 145 25406 002323'03 endif. ;[240] End case displaying file offset 25407 002323'03 endif. ;[193] End .nulio special casing 25408 002323'03 254 00 0 00 002327' else. ;[194] Otherwise, don't have one 25409 002324'03 200 01 0 00 000000# txmsg <(none)> 25410 002325'03 104 00 0 00 000076 25411 002326'03 320 12 0 00 002327' 25412 000253'02 000000000000# 25413 001074'04 050 156 157 156 145 25414 002327'03 endif. ;[194] 25415 25416 002327'03 561 01 0 00 002137* hrroi t1, crlflf ;[194] 25417 002330'03 104 00 0 00 000076 PSOUT% ;[194] 25418 002331'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 25419 remark ;[194] May fall through .. 25420 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20DSP MAC 20-Aug-24 23:41 SHOW DEBUG 25421 subttl SHOW DEBUG 25422 25423 extern logbsz ;[41] Log file byte size. 25424 extern logjfn ; Log file JFN 25425 extern pdcodf ;[221] If Packet Debug is also doing decoding 25426 extern mhptod ;[239] If monitor supports high precision 25427 25428 002332'03 $shdeb: entry $shdeb 25429 002332'03 200 01 0 00 000000# txmsg 25430 002333'03 104 00 0 00 000076 25431 002334'03 320 12 0 00 002335' 25432 000254'02 000000000000# 25433 001076'04 104 145 142 165 147 25434 002335'03 200 01 0 14 000000# move t1, debtab(debug) 25435 002336'03 104 00 0 00 000076 PSOUT% 25436 25437 002337'03 302 14 0 00 000002 caie debug, 2 ;[221] Are we debugging packets (I.E., dumping them?)? 25438 002340'03 254 00 0 00 002366' ifskp. ;[221] Indeed we are 25439 002341'03 336 00 0 00 000000* ifmn. pdcodf ;[239] Yes; are we decoding them? 25440 002342'03 254 00 0 00 002355' 25441 002343'03 336 00 0 00 000000* ifmn. mhptod ;[239] Some extra-soothing blat 25442 002344'03 254 00 0 00 002351' 25443 002345'03 200 01 0 00 000000# txmsg < [Decoding, 10 microsecond resolution]> ;[239] 25444 002346'03 104 00 0 00 000076 25445 002347'03 320 12 0 00 002350' 25446 000255'02 000000000000# 25447 001101'04 040 133 104 145 143 25448 002350'03 254 00 0 00 002354' else. ;[239] Otherwise, monitor doesn't have HPTIM% .HPTOD 25449 002351'03 200 01 0 00 000000# txmsg < [Decoding, 1 millisecond resolution]> ;[239] 25450 002352'03 104 00 0 00 000076 25451 002353'03 320 12 0 00 002354' 25452 000256'02 000000000000# 25453 001111'04 040 133 104 145 143 25454 002354'03 endif. ;[239] End case reporting decoding granularity 25455 002354'03 254 00 0 00 002366' else. ;[239] Not decoding, so don't remark about that 25456 002355'03 336 00 0 00 002343* ifmn. mhptod ;[239] Some extra-soothing blat 25457 002356'03 254 00 0 00 002363' 25458 002357'03 200 01 0 00 000000# txmsg < [10 microsecond resolution]> ;[239] 25459 002360'03 104 00 0 00 000076 25460 002361'03 320 12 0 00 002362' 25461 000257'02 000000000000# 25462 001121'04 040 133 061 060 040 25463 002362'03 254 00 0 00 002366' else. ;[239] Otherwise, monitor doesn't have HPTIM% .HPTOD 25464 002363'03 200 01 0 00 000000# txmsg < [1 millisecond resolution]> ;[239] 25465 002364'03 104 00 0 00 000076 25466 002365'03 320 12 0 00 002366' 25467 000260'02 000000000000# 25468 001127'04 040 133 061 040 155 25469 002366'03 endif. ;[239] End case reporting non-decoding granularity 25470 002366'03 endif. ;[239] End case granularity reporting 25471 002366'03 endif. ;[221] End special case debugging packets 25472 25473 002366'03 322 14 0 00 002460' ifn. debug ;[194] Only if actually debugging something 25474 txmsg < 25475 002367'03 200 01 0 00 000000# Debugging log file: > ;[38] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-1 K20DSP MAC 20-Aug-24 23:41 SHOW DEBUG 25476 002370'03 104 00 0 00 000076 25477 002371'03 320 12 0 00 002372' 25478 000261'02 000000000000# 25479 001135'04 015 012 040 040 104 25480 002372'03 337 02 0 00 000000* skipg t2, logjfn ;[198] Load debugging log file JFN (if there is one) 25481 002373'03 254 00 0 00 002455' ifskp. ;[194] There is, let's type something 25482 002374'03 201 01 0 00 000101 movei t1, .priou ; Yes, a real file, 25483 002375'03 400 04 0 00 000000 setz t4, ;[193] Let's assume no prefix or stop character 25484 002376'03 302 02 0 00 377777 caie t2, .nulio ;[193] Efficiently dumping it? 25485 002377'03 254 00 0 00 002410' ifskp. ;[193] Yes, that's a constant string 25486 002400'03 120 02 0 00 000000# dmove t2, nul5 ;[193] Point to said string 25487 002401'03 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 25488 002402'03 320 12 0 00 002404' %jserr (,) ;[193] ?? 25489 002403'03 254 00 0 00 002407' 25490 002404'03 265 01 0 00 002315* 25491 002405'03 000000000000# 25492 002406'03 254 00 0 00 002407' 25493 001142'04 125 156 141 142 154 25494 002407'03 254 00 0 00 002444' else. ;[193] Otherwise, a 'real' JFN 25495 002410'03 400 03 0 00 000000 setz t3, ;[194] Use default formatting 25496 002411'03 104 00 0 00 000030 JFNS ; Say what it is. 25497 002412'03 320 12 0 00 002414' %jserr (,) ;[194] 25498 002413'03 254 00 0 00 002417' 25499 002414'03 265 01 0 00 002404* 25500 002415'03 000000000000# 25501 002416'03 254 00 0 00 002417' 25502 001150'04 125 156 141 142 154 25503 002417'03 200 01 0 00 000002 move t1, t2 ;[240] Load the file JFN 25504 002420'03 104 00 0 00 000043 RFPTR% ;[240] Get the current position in the file 25505 002421'03 320 12 0 00 002423' ifje. r ;[240] Couldn't ... 25506 002422'03 254 00 0 00 002425' 25507 002423'03 200 04 0 00 000001 move t4, t1 ;[240] Save the error for debugging heros 25508 002424'03 474 02 0 00 000000 seto t2, ;[240] Flag an error for downstream 25509 002425'03 endif. ;[240] End case JSYS error handling 25510 002425'03 323 02 0 00 002444' ifg. t2 ;[240] Only display if we've written something 25511 002426'03 200 01 0 00 000000# txmsg <, > ;[240] 25512 002427'03 104 00 0 00 000076 25513 002430'03 320 12 0 00 002431' 25514 000262'02 000000000000# 25515 001157'04 054 040 000 000 000 25516 002431'03 201 01 0 00 000101 movei t1, .priou ;[240] Still going to terminal 25517 002432'03 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ;[240] Byte count is decimal 25518 002433'03 104 00 0 00 000224 NOUT% ;[240] Type it 25519 002434'03 320 12 0 00 002436' %jserr (,) ;[240] 25520 002435'03 254 00 0 00 002441' 25521 002436'03 265 01 0 00 002414* 25522 002437'03 000000000000# 25523 002440'03 254 00 0 00 002441' 25524 001160'04 125 156 141 142 154 25525 002441'03 200 01 0 00 000000# txmsg < Bytes Written> ;[240] 25526 002442'03 104 00 0 00 000076 25527 002443'03 320 12 0 00 002444' 25528 000263'02 000000000000# 25529 001171'04 040 102 171 164 145 25530 002444'03 endif. ;[240] End case displaying file offset k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-2 K20DSP MAC 20-Aug-24 23:41 SHOW DEBUG 25531 002444'03 endif. ;[198] End .nulio special casing 25532 002444'03 200 01 0 00 000000# txmsg <, Byte Size >;[240] 25533 002445'03 104 00 0 00 000076 25534 002446'03 320 12 0 00 002447' 25535 000264'02 000000000000# 25536 001174'04 054 040 102 171 164 25537 002447'03 201 01 0 00 000101 numout logbsz ;[41] 25538 002450'03 200 02 0 00 000000* 25539 002451'03 201 03 0 00 000012 25540 002452'03 104 00 0 00 000224 25541 002453'03 320 14 0 00 002454' 25542 002454'03 254 00 0 00 002460' else. ;[194] Otherwise, don't have a debugging log file 25543 002455'03 200 01 0 00 000000# txmsg < (none)> ;[38] None. 25544 002456'03 104 00 0 00 000076 25545 002457'03 320 12 0 00 002460' 25546 000265'02 000000000000# 25547 001177'04 040 050 156 157 156 25548 002460'03 endif. ;[194] End log file printing decision 25549 002460'03 endif. ;[194] End case debugging 25550 25551 002460'03 561 01 0 00 002327* hrroi t1, crlflf ;[194] 25552 002461'03 104 00 0 00 000076 PSOUT% ;[194] 25553 002462'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 25554 remark ;[194] May fall through .. 25555 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20DSP MAC 20-Aug-24 23:41 SHOW PACKET-INFO external variables (all [194]) 25556 subttl SHOW PACKET-INFO external variables (all [194]) 25557 25558 extern bctr ; Block check type requested (character). 25559 extern bctu ; Block check type in use (number). 25560 extern ebq ; 8th-bit-on prefix. 25561 extern ebqflg ; 8th-bit prefixing flag. 25562 extern ebqr ; 8th-bit prefix field for Send-Init. 25563 extern reolch ; EOL character Tops-20 needs. 25564 extern rpadch ; Padding character Tops-20 wants. 25565 extern rpadn ; Number of padding characters for Tops-20. 25566 extern rptflg ; Repeat count processing flag. 25567 extern rptq ; Repeat count prefix. 25568 extern rquote ; Quote character Tops-20 wants. 25569 extern rsthdr ; Start of header character to receive. 25570 extern seolch ; EOL character micro needs. 25571 extern spadch ; Padding character micro wants. 25572 extern spadn ; Number of padding characters for micro. 25573 extern squote ; Quote character micro wants. 25574 extern ssthdr ; Start of header character to send. 25575 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20DSP MAC 20-Aug-24 23:41 SHOW PACKET-INFO display code 25576 subttl SHOW PACKET-INFO display code 25577 25578 ;[100] New headings, less confusing. 25579 25580 002463'03 $shpkt: entry $shpkt 25581 txmsg 25585 002464'03 104 00 0 00 000076 25586 002465'03 320 12 0 00 002466' 25587 000266'02 000000000000# 25588 001201'04 120 141 143 153 145 25589 25590 25591 25592 002466'03 201 01 0 00 000101 numout rpsiz 25593 002467'03 200 02 0 00 000452* 25594 002470'03 201 03 0 00 000012 25595 002471'03 104 00 0 00 000224 25596 002472'03 320 14 0 00 002473' 25597 002473'03 200 01 0 00 000000# txmsg < > 25598 002474'03 104 00 0 00 000076 25599 002475'03 320 12 0 00 002476' 25600 000267'02 000000000000# 25601 001217'04 011 011 000 000 000 25602 002476'03 201 01 0 00 000101 numout spsiz 25603 002477'03 200 02 0 00 000460* 25604 002500'03 201 03 0 00 000012 25605 002501'03 104 00 0 00 000224 25606 002502'03 320 14 0 00 002503' 25607 25608 002503'03 200 01 0 00 000000* move t1, rpadn ;[194] Load receive padding count 25609 002504'03 270 01 0 00 000000* add t1, spadn ;[194] Add sending padding count 25610 002505'03 323 01 0 00 002540' ifg. t1 ;[194] Only print characters if actually padding 25611 txmsg < characters 25612 002506'03 200 01 0 00 000000# Padding: > 25613 002507'03 104 00 0 00 000076 25614 002510'03 320 12 0 00 002511' 25615 000270'02 000000000000# 25616 001220'04 040 143 150 141 162 25617 25618 002511'03 201 01 0 00 000101 numout rpadn 25619 002512'03 200 02 0 00 002503* 25620 002513'03 201 03 0 00 000012 25621 002514'03 104 00 0 00 000224 25622 002515'03 320 14 0 00 002516' 25623 002516'03 200 01 0 00 000000# txmsg < > 25624 002517'03 104 00 0 00 000076 25625 002520'03 320 12 0 00 002521' 25626 000271'02 000000000000# 25627 001226'04 011 011 000 000 000 25628 002521'03 201 01 0 00 000101 numout spadn 25629 002522'03 200 02 0 00 002504* 25630 002523'03 201 03 0 00 000012 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-1 K20DSP MAC 20-Aug-24 23:41 SHOW PACKET-INFO display code 25631 002524'03 104 00 0 00 000224 25632 002525'03 320 14 0 00 002526' 25633 txmsg < 25634 002526'03 200 01 0 00 000000# Pad Character: > 25635 002527'03 104 00 0 00 000076 25636 002530'03 320 12 0 00 002531' 25637 000272'02 000000000000# 25638 001227'04 015 012 040 040 120 25639 002531'03 200 01 0 00 000000* move t1, rpadch 25640 002532'03 260 17 0 00 004203' call putc 25641 002533'03 200 01 0 00 000000# txmsg < > 25642 002534'03 104 00 0 00 000076 25643 002535'03 320 12 0 00 002536' 25644 000273'02 000000000000# 25645 001234'04 011 011 000 000 000 25646 002536'03 200 01 0 00 000000* move t1, spadch 25647 002537'03 260 17 0 00 004203' call putc 25648 002540'03 endif. ;[194] 25649 25650 txmsg < 25651 002540'03 200 01 0 00 000000# End-Of-Line: > 25652 002541'03 104 00 0 00 000076 25653 002542'03 320 12 0 00 002543' 25654 000274'02 000000000000# 25655 001235'04 015 012 040 040 105 25656 002543'03 200 01 0 00 000000* move t1, reolch 25657 002544'03 260 17 0 00 004203' call putc 25658 002545'03 200 01 0 00 000000# txmsg < > 25659 002546'03 104 00 0 00 000076 25660 002547'03 320 12 0 00 002550' 25661 000275'02 000000000000# 25662 001242'04 011 011 000 000 000 25663 002550'03 200 01 0 00 000000* move t1, seolch 25664 002551'03 260 17 0 00 004203' call putc 25665 txmsg < 25666 002552'03 200 01 0 00 000000# Control Prefix: > 25667 002553'03 104 00 0 00 000076 25668 002554'03 320 12 0 00 002555' 25669 000276'02 000000000000# 25670 001243'04 015 012 040 040 103 25671 002555'03 200 01 0 00 000000* move t1, rquote 25672 002556'03 260 17 0 00 004203' call putc 25673 002557'03 200 01 0 00 000000# txmsg < > 25674 002560'03 104 00 0 00 000076 25675 002561'03 320 12 0 00 002562' 25676 000277'02 000000000000# 25677 001250'04 011 011 000 000 000 25678 002562'03 200 01 0 00 000000* move t1, squote 25679 002563'03 260 17 0 00 004203' call putc 25680 25681 txmsg < 25682 002564'03 200 01 0 00 000000# Start-Of-Packet: > 25683 002565'03 104 00 0 00 000076 25684 002566'03 320 12 0 00 002567' 25685 000300'02 000000000000# k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-2 K20DSP MAC 20-Aug-24 23:41 SHOW PACKET-INFO display code 25686 001251'04 015 012 040 040 123 25687 002567'03 200 01 0 00 000000* move t1, ssthdr ;[18] 25688 002570'03 260 17 0 00 004203' call putc 25689 002571'03 200 01 0 00 000000# txmsg < > 25690 002572'03 104 00 0 00 000076 25691 002573'03 320 12 0 00 002574' 25692 000301'02 000000000000# 25693 001256'04 011 011 000 000 000 25694 002574'03 200 01 0 00 000000* move t1, rsthdr ;[18] 25695 002575'03 260 17 0 00 004203' call putc 25696 25697 ;[100] New headings for this stuff. 25698 25699 txmsg < 25700 25701 Requested Used 25702 002576'03 200 01 0 00 000000# 8th-bit Prefix: > ;[88] Begin addition 25703 002577'03 104 00 0 00 000076 25704 002600'03 320 12 0 00 002601' 25705 000302'02 000000000000# 25706 001257'04 015 012 015 012 011 25707 25708 25709 002601'03 336 00 0 00 000000* ifmn. ebqr ;[194] Did our user request 8th bit prefix? 25710 002602'03 254 00 0 00 002611' 25711 002603'03 200 01 0 00 000000* move t1, ebq ; Yes. 25712 002604'03 260 17 0 00 004203' call putc ; Say what it is. 25713 002605'03 200 01 0 00 000000# txmsg < > 25714 002606'03 104 00 0 00 000076 25715 002607'03 320 12 0 00 002610' 25716 000303'02 000000000000# 25717 001272'04 011 011 000 000 000 25718 002610'03 254 00 0 00 002614' else. ;[194] Otherwise, don't have one 25719 002611'03 200 01 0 00 000000# txmsg <(none) > ; Just say we'll do it if asked. 25720 002612'03 104 00 0 00 000076 25721 002613'03 320 12 0 00 002614' 25722 000304'02 000000000000# 25723 001273'04 050 156 157 156 145 25724 002614'03 endif. ;[194] 25725 25726 002614'03 336 00 0 00 000000* ifmn. ebqflg ;[194] Was it used during last transfer? 25727 002615'03 254 00 0 00 002621' 25728 002616'03 200 01 0 00 002603* move t1, ebq ; Looks like it, say what prefix. 25729 002617'03 260 17 0 00 004203' call putc 25730 002620'03 254 00 0 00 002624' else. ;[194] Wasn't used 25731 002621'03 200 01 0 00 000000# txmsg <(none)> ; Just say we would have done it if asked. 25732 002622'03 104 00 0 00 000076 25733 002623'03 320 12 0 00 002624' 25734 000305'02 000000000000# 25735 001275'04 050 156 157 156 145 25736 002624'03 endif. ;[194] 25737 25738 txmsg < 25739 002624'03 200 01 0 00 000000# Repeat Prefix: > ;[92] Begin addition 25740 002625'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-3 K20DSP MAC 20-Aug-24 23:41 SHOW PACKET-INFO display code 25741 002626'03 320 12 0 00 002627' 25742 000306'02 000000000000# 25743 001277'04 015 012 040 040 122 25744 002627'03 200 01 0 00 000000* move t1, rptq ; What we would use to flag repeat counts. 25745 002630'03 260 17 0 00 004203' call putc 25746 002631'03 200 01 0 00 000000# txmsg < > 25747 002632'03 104 00 0 00 000076 25748 002633'03 320 12 0 00 002634' 25749 000307'02 000000000000# 25750 001304'04 011 011 000 000 000 25751 25752 002634'03 336 00 0 00 000000* ifmn. rptflg ;[194] Was it actually used? 25753 002635'03 254 00 0 00 002641' 25754 002636'03 200 01 0 00 002627* move t1, rptq ;[194] Show it 25755 002637'03 260 17 0 00 004203' call putc 25756 002640'03 254 00 0 00 002644' else. ;[194] Otherwise didn't use it 25757 002641'03 200 01 0 00 000000# txmsg <(none)> ; Just say we would have done it if asked. 25758 002642'03 104 00 0 00 000076 25759 002643'03 320 12 0 00 002644' 25760 000310'02 000000000000# 25761 001305'04 050 156 157 156 145 25762 002644'03 endif. ;[194] 25763 25764 txmsg < 25765 002644'03 200 01 0 00 000000# Block Check: > ;[98] Block check type. 25766 002645'03 104 00 0 00 000076 25767 002646'03 320 12 0 00 002647' 25768 000311'02 000000000000# 25769 001307'04 015 012 040 040 102 25770 002647'03 200 01 0 00 000000* move t1, bctr 25771 002650'03 260 17 0 00 004203' call putc 25772 002651'03 200 01 0 00 000000# txmsg < > 25773 002652'03 104 00 0 00 000076 25774 002653'03 320 12 0 00 002654' 25775 000312'02 000000000000# 25776 001314'04 011 011 000 000 000 25777 002654'03 201 01 0 00 000101 numout bctu ;[98] 25778 002655'03 200 02 0 00 000000* 25779 002656'03 201 03 0 00 000012 25780 002657'03 104 00 0 00 000224 25781 002660'03 320 14 0 00 002661' 25782 25783 002661'03 561 01 0 00 002460* hrroi t1, crlflf ;[194] Tie off the line 25784 002662'03 104 00 0 00 000076 PSOUT% 25785 002663'03 256 00 0 00 000005 xct q1 ;[39] return or proceed... 25786 remark ;[194] May fall through .. 25787 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20DSP MAC 20-Aug-24 23:41 SHOW TIMING-INFO external variable usage 25788 subttl SHOW TIMING-INFO external variable usage 25789 25790 extern delay ; Milliseconds to wait before sending first packet 25791 extern delayf ; Same number as floating point seconds 25792 extern imxtry ; Maximum retries in send initiate. 25793 extern maxtry ; Maximum retries for an ordinary packet. 25794 extern rpause ; Pause before ACKing data packet. 25795 extern rpausf ; Same number as floating point 25796 extern rtimou ; Minimum timeout interval Tops-20 needs. 25797 extern spause ; Pause before sending data packet. 25798 extern spausf ; Same number as floating point 25799 extern srvtim ; Server command wait timeout interval. 25800 extern stimou ; Interval for current timer 25801 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20DSP MAC 20-Aug-24 23:41 SHOW TIMING-INFO numeric output flags 25802 subttl SHOW TIMING-INFO numeric output flags 25803 25804 ;[212] Begin code Insertion 25805 25806 remark Complex flag usage set up 25807 25808 ; Integer and floating output flags to line up columns. 25809 ; The hairy floating flags can be found in DOC:JSYS_REFERENCE.MEM, 25810 ; section 2.9.1.2, table xx, pages 2-87, 88. 25811 25812 ; Integer flags 25813 120006 000012 int%f== 25814 .xcref int%f ; Don't need on cross reference 25815 suppress int%f ; Don't want in symbol table listing 25816 120006 000012 show. (int%f) ; Show final word 25817 25818 ; Floating point flags 25819 000000 flt%f==0 ; Floating output flags; no output to DDT 25820 .xcref flt%f ; No need on the cross reference 25821 suppress flt%f ; No need in symbol table listing 25822 25823 define fltf (v,f) < ;;Define a macro to build floating flag word 25824 ifnb ,< ;;Non-blank field specified? 25825 flt%f==> ;; OR in the value in the field 25826 >;; ifnb 25827 ifb ,< ;;Blank field? 25828 flt%f==> ;;OR in the bit 25829 >;; ifb 25830 .xcref flt%f ;;Still don't need on cross reference 25831 >;; fltf 25832 25833 fltf(.flspc,fl%sgn) ;;First character is a space 25834 fltf(.fllsp,fl%jus) ;;Right justify, leading spaces 25835 fltf(fl%one) ;;Output at least one digit 25836 fltf(fl%pnt) ;;Output the decimal point, always 25837 fltf(.flexn,fl%exp) ;;Don't output an exponent 25838 fltf(fl%ovl) ;;Output on overflow 25839 fltf(^d6,fl%fst) ;;Properly justify integral portion 25840 fltf(^d4,fl%snd) ;;Digits in second field 25841 25842 224100 060400 show. (flt%f) ;;Finally show what we got 25843 25844 ;[212] End code insertion 25845 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20DSP MAC 20-Aug-24 23:41 SHOW TIMING-INFO code 25846 subttl SHOW TIMING-INFO code 25847 25848 remark Timeout in floating seconds and integral milliseconds 25849 25850 002664'03 $shtim: entry $shtim 25851 002664'03 474 04 0 00 000000 seto t4, ;[212] Let's suppose no time outs 25852 txmsg ;[212] 25856 002666'03 104 00 0 00 000076 25857 002667'03 320 12 0 00 002670' 25858 000313'02 000000000000# 25859 001315'04 124 151 155 151 156 25860 25861 25862 25863 002670'03 120 01 0 00 000000* dmove t1,rtimou ;[212] Load timeout int ms and floating seconds 25864 002671'03 322 01 0 00 002702' ifn. t1 ;[212] Prefer int (because of a parser fluke) 25865 002672'03 201 01 0 00 000101 movei t1, .priou ;[212] 25866 002673'03 120 03 0 00 005014' dmove t3, [exp flt%f,0] ;[212] Special columnar formatting, flag non-zero 25867 002674'03 104 00 0 00 000233 FLOUT% ;[212] 25868 002675'03 320 14 0 00 002676' erjmps .+1 ;[212] 25869 002676'03 200 01 0 00 000000# txmsg < > ;[212] Two spaces to send column 25870 002677'03 104 00 0 00 000076 25871 002700'03 320 12 0 00 002701' 25872 000314'02 000000000000# 25873 001331'04 040 040 000 000 000 25874 002701'03 254 00 0 00 002705' else. ;[186] Otherwise, special case it 25875 002702'03 200 01 0 00 000000# txmsg < (none) > ;[186] Make it STAND OUT 25876 002703'03 104 00 0 00 000076 25877 002704'03 320 12 0 00 002705' 25878 000315'02 000000000000# 25879 001332'04 040 040 040 040 040 25880 002705'03 endif. ;[186] End special casing recieved 25881 25882 25883 002705'03 120 01 0 00 000000* dmove t1,stimou ;[212] Load timeout int ms and floating seconds 25884 002706'03 322 01 0 00 002714' ifn. t1 ;[212] Prefer int (because of a parser fluke) 25885 002707'03 201 01 0 00 000101 movei t1, .priou ;[212] 25886 002710'03 120 03 0 00 005014' dmove t3, [exp flt%f,0] ;[212] special columnar formatting, flag non-zero 25887 002711'03 104 00 0 00 000233 FLOUT ;[212] 25888 002712'03 320 14 0 00 002713' erjmps .+1 ;[212] 25889 002713'03 254 00 0 00 002717' else. ;[194] Otherwise, who knows? 25890 002714'03 200 01 0 00 000000# txmsg < (none)> ;[212] Five spaces 25891 002715'03 104 00 0 00 000076 25892 002716'03 320 12 0 00 002717' 25893 000316'02 000000000000# 25894 001335'04 040 040 040 040 040 25895 002717'03 endif. ;[194] 25896 25897 remark ;[212] If never printed a time out, suppress ms's 25898 002717'03 326 04 0 00 002771' ife. t4 ;[212] Ever do anthing? 25899 002720'03 200 01 0 00 000000# txmsg < sec (> ;[212] Yes, so label the seconds field 25900 002721'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27-1 K20DSP MAC 20-Aug-24 23:41 SHOW TIMING-INFO code 25901 002722'03 320 12 0 00 002723' 25902 000317'02 000000000000# 25903 001340'04 040 163 145 143 040 25904 002723'03 201 01 0 00 000101 numout [maxtim/^d1000] ;[212] 25905 002724'03 200 02 0 00 005016' 25906 002725'03 201 03 0 00 000012 25907 002726'03 104 00 0 00 000224 25908 002727'03 320 14 0 00 002730' 25909 txmsg < max) 25910 002730'03 200 01 0 00 000000# > ;[212] 25911 002731'03 104 00 0 00 000076 25912 002732'03 320 12 0 00 002733' 25913 000320'02 000000000000# 25914 001342'04 040 155 141 170 051 25915 25916 002733'03 337 02 0 00 002670* skipg t2,rtimou ;[212] Non-zero receive timeout? 25917 002734'03 254 00 0 00 002745' ifskp. ;[212] Yes,display it 25918 002735'03 200 01 0 00 000000# txmsg < > ;[212] One tab, seven spaces to recieve field 25919 002736'03 104 00 0 00 000076 25920 002737'03 320 12 0 00 002740' 25921 000321'02 000000000000# 25922 001344'04 011 040 040 040 040 25923 002740'03 201 01 0 00 000101 movei t1, .priou ;[194] 25924 002741'03 200 03 0 00 005017' movx t3, int%f ;[212] Special integer formatting 25925 002742'03 104 00 0 00 000224 NOUT% ;rtimou ;[186] Not rrtimo ... 25926 002743'03 320 14 0 00 002744' erjmps .+1 ;[194] 25927 002744'03 254 00 0 00 002750' else. ;[212] Otherwise, blank the field 25928 002745'03 200 01 0 00 000000# txmsg < > ;[212] 2 tabs, 7 spaces to end of recieve 25929 002746'03 104 00 0 00 000076 25930 002747'03 320 12 0 00 002750' 25931 000322'02 000000000000# 25932 001346'04 011 011 040 040 040 25933 002750'03 endif. ;[212] Done printing 25934 25935 002750'03 337 02 0 00 002705* skipg t2,stimou ;[212] Non-zero receive timeout? 25936 002751'03 254 00 0 00 002762' ifskp. ;[212] Yes,display it 25937 002752'03 200 01 0 00 000000# txmsg < > ;[212] One tab, four spaces 25938 002753'03 104 00 0 00 000076 25939 002754'03 320 12 0 00 002755' 25940 000323'02 000000000000# 25941 001350'04 011 040 040 040 040 25942 002755'03 201 01 0 00 000101 movei t1, .priou ;[194] 25943 002756'03 200 03 0 00 005017' movx t3, int%f ;[212] Special integer formatting 25944 002757'03 104 00 0 00 000224 NOUT% ;[186] 25945 002760'03 320 14 0 00 002761' erjmps .+1 ;[194] 25946 002761'03 254 00 0 00 002765' else. ;[212] Otherwise, no send timeout 25947 002762'03 200 01 0 00 000000# txmsg < > ;[212] Two tabs, two spaces 25948 002763'03 104 00 0 00 000076 25949 002764'03 320 12 0 00 002765' 25950 000324'02 000000000000# 25951 001352'04 011 011 040 040 000 25952 002765'03 endif. ;[212] Either should be in correct column now 25953 txmsg < ms 25954 002765'03 200 01 0 00 000000# > ;[212] Must always label non-zero milliseconds 25955 002766'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27-2 K20DSP MAC 20-Aug-24 23:41 SHOW TIMING-INFO code 25956 002767'03 320 12 0 00 002770' 25957 000325'02 000000000000# 25958 001353'04 040 155 163 015 012 25959 002770'03 254 00 0 00 002774' else. ;[212] Otherwise, no time outs at all, ever 25960 txmsg < 25961 002771'03 200 01 0 00 000000# > ;[212] So just tie off the line 25962 002772'03 104 00 0 00 000076 25963 002773'03 320 12 0 00 002774' 25964 000326'02 000000000000# 25965 001355'04 015 012 000 000 000 25966 002774'03 endif. ;[212] End whether ever printed anything 25967 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20DSP MAC 20-Aug-24 23:41 Pause in floating seconds and integral milliseconds 25968 subttl Pause in floating seconds and integral milliseconds 25969 25970 002774'03 400 04 0 00 000000 setz t4, ;[212] Assume nothing printed 25971 txmsg < 25972 002775'03 200 01 0 00 000000# Pause: > ;[196] 25973 002776'03 104 00 0 00 000076 25974 002777'03 320 12 0 00 003000' 25975 000327'02 000000000000# 25976 001356'04 015 012 040 040 120 25977 003000'03 200 03 0 00 005014' movx t3, ;[212] Special columnar formatting, always 25978 25979 003001'03 337 02 0 00 000000* skipg t2, rpausf ;[212] Load and check floating component 25980 003002'03 254 00 0 00 003010' ifskp. ;[212] Non-zero, type it 25981 003003'03 201 01 0 00 000101 movei t1, .priou ;[212] This terminal 25982 003004'03 104 00 0 00 000233 FLOUT ;[36] 25983 003005'03 320 14 0 00 003006' erjmps .+1 ;[212] Catch and suppress errors 25984 003006'03 474 04 0 00 000000 seto t4, ;[212] Flag printed something 25985 003007'03 254 00 0 00 003013' else. ;[212] Otherwise, special case zero 25986 003010'03 200 01 0 00 000000# txmsg < (none)> ;[212] with plain text 25987 003011'03 104 00 0 00 000076 25988 003012'03 320 12 0 00 003013' 25989 000330'02 000000000000# 25990 001361'04 040 040 040 040 040 25991 003013'03 endif. 25992 25993 003013'03 337 02 0 00 000000* skipg t2, spausf ;[212] Load and check floating component 25994 003014'03 254 00 0 00 003025' ifskp. ;[212] Non-zero, type it 25995 003015'03 200 01 0 00 000000# txmsg < > ;[212] Two spaces 25996 003016'03 104 00 0 00 000076 25997 003017'03 320 12 0 00 003020' 25998 000331'02 000000000000# 25999 001364'04 040 040 000 000 000 26000 003020'03 201 01 0 00 000101 movei t1, .priou ;[36] 26001 003021'03 104 00 0 00 000233 FLOUT ;[36] 26002 003022'03 320 14 0 00 003023' erjmps .+1 ;[194] 26003 003023'03 474 04 0 00 000000 seto t4, ;[212] Flag printed something 26004 003024'03 254 00 0 00 003030' else. ;[212] Otherwise, special case zero 26005 003025'03 200 01 0 00 000000# txmsg < (none)> ;[212] with plain text 26006 003026'03 104 00 0 00 000076 26007 003027'03 320 12 0 00 003030' 26008 000332'02 000000000000# 26009 001365'04 040 040 040 040 040 26010 003030'03 endif. 26011 26012 003030'03 322 04 0 00 003065' ifn. t4 ;[212] Printed any numbers? 26013 txmsg < sec 26014 003031'03 200 01 0 00 000000# > ;[212] Yes; one tab, seven spaces to recieve field 26015 003032'03 104 00 0 00 000076 26016 003033'03 320 12 0 00 003034' 26017 000333'02 000000000000# 26018 001370'04 040 163 145 143 015 26019 26020 003034'03 200 03 0 00 005017' movx t3, ;[212] Special integer formatting 26021 26022 003035'03 337 02 0 00 000000* skipg t2, rpause ;[212] Integer millisecond recieve pause k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20DSP MAC 20-Aug-24 23:41 Pause in floating seconds and integral milliseconds 26023 003036'03 254 00 0 00 003046' ifskp. ;[212] A real number, print it 26024 003037'03 201 01 0 00 000101 movei t1, .priou ;[212] Going to primary output 26025 003040'03 104 00 0 00 000224 NOUT% ;[212] Output it (but nicely) 26026 003041'03 320 14 0 00 003042' erjmps .+1 ;[212] Catch and suppress error 26027 003042'03 200 01 0 00 000000# txmsg < > ;[212] One tab, four spaces 26028 003043'03 104 00 0 00 000076 26029 003044'03 320 12 0 00 003045' 26030 000334'02 000000000000# 26031 001373'04 011 040 040 040 040 26032 003045'03 254 00 0 00 003051' else. ;[212] Otherwise, suppress completely 26033 003046'03 200 01 0 00 000000# txmsg < > ;[212] Two tabs, four spaces 26034 003047'03 104 00 0 00 000076 26035 003050'03 320 12 0 00 003051' 26036 000335'02 000000000000# 26037 001375'04 011 011 040 040 040 26038 003051'03 endif. ;[212] End suppression decision 26039 26040 003051'03 337 02 0 00 000000* skipg t2, spause ;[212] Integer millisecond send pause 26041 003052'03 254 00 0 00 003057' ifskp. ;[212] A real number, print it 26042 003053'03 201 01 0 00 000101 movei t1, .priou ;[212] Going to primary output 26043 003054'03 104 00 0 00 000224 NOUT% ;[212] Output it (but nicely) 26044 003055'03 320 14 0 00 003056' erjmps .+1 ;[212] Catch and suppress error 26045 003056'03 254 00 0 00 003062' else. ;[212] Otherwise, suppress number entirely 26046 003057'03 200 01 0 00 000000# txmsg < > ;[212] One tab, four spaces 26047 003060'03 104 00 0 00 000076 26048 003061'03 320 12 0 00 003062' 26049 000336'02 000000000000# 26050 001377'04 011 040 040 000 000 26051 003062'03 endif. ;[212] End suppression decision 26052 26053 003062'03 200 01 0 00 000000# txmsg < ms> ;[196] 26054 003063'03 104 00 0 00 000076 26055 003064'03 320 12 0 00 003065' 26056 000337'02 000000000000# 26057 001400'04 040 155 163 000 000 26058 003065'03 endif. ;[212] 26059 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20DSP MAC 20-Aug-24 23:41 Delay in floating seconds and integral milliseconds 26060 subttl Delay in floating seconds and integral milliseconds 26061 26062 txmsg < 26063 26064 003065'03 200 01 0 00 000000# Delay before sending first packet: > ;[196] 26065 003066'03 104 00 0 00 000076 26066 003067'03 320 12 0 00 003070' 26067 000340'02 000000000000# 26068 001401'04 015 012 015 012 040 26069 26070 003070'03 336 00 0 00 001623* ifmn. local ;[194] Local? 26071 003071'03 254 00 0 00 003076' 26072 003072'03 200 01 0 00 000000# txmsg ;[194] Never waits for anybody 26073 003073'03 104 00 0 00 000076 26074 003074'03 320 12 0 00 003075' 26075 000341'02 000000000000# 26076 001412'04 116 157 156 145 000 26077 003075'03 254 00 0 00 003131' else. ;[194] Remote, actually 26078 003076'03 332 02 0 00 000000* skipe t2, delayf ;[194] Do we have any delay, then? 26079 003077'03 254 00 0 00 003104' ifskp. ;[194] No, so special case that 26080 003100'03 200 01 0 00 000000# txmsg ;[194] A little different from local 26081 003101'03 104 00 0 00 000076 26082 003102'03 320 12 0 00 003103' 26083 000342'02 000000000000# 26084 001413'04 132 145 162 157 040 26085 003103'03 254 00 0 00 003131' else. 26086 003104'03 201 01 0 00 000101 movei t1, .priou ;[194] 26087 003105'03 400 03 0 00 000000 setz t3, ;[194] Default flags 26088 003106'03 104 00 0 00 000233 FLOUT% ;[194] Type it 26089 003107'03 320 12 0 00 003110' erjmpr .+1 ;[194] 26090 003110'03 312 02 0 00 005020' came t2,[1.0] ;[212] Exactly one second? 26091 003111'03 254 00 0 00 003116' ifskp. ;[212] Yes, inflect for singular case 26092 003112'03 200 01 0 00 000000# txmsg < sec (> ;[212] Label and punctuate 26093 003113'03 104 00 0 00 000076 26094 003114'03 320 12 0 00 003115' 26095 000343'02 000000000000# 26096 001416'04 040 163 145 143 040 26097 003115'03 254 00 0 00 003121' else. ;[212] Otherwise, use plural inflection 26098 003116'03 200 01 0 00 000000# txmsg < secs (> ;[212] Label and punctuate 26099 003117'03 104 00 0 00 000076 26100 003120'03 320 12 0 00 003121' 26101 000344'02 000000000000# 26102 001420'04 040 163 145 143 163 26103 003121'03 endif. ;[212] End grammatical analysis 26104 003121'03 201 01 0 00 000101 movei t1, .priou ;[194] 26105 003122'03 200 02 0 00 000000* move t2, delay ;[194] Load milliseconds 26106 003123'03 201 03 0 00 000012 movei t3, ^d10 ;[194] 26107 003124'03 104 00 0 00 000224 NOUT% ;[194] 26108 003125'03 320 12 0 00 003126' erjmpr .+1 ;[194] 26109 003126'03 200 01 0 00 000000# txmsg < ms)> ;[194] 26110 003127'03 104 00 0 00 000076 26111 003130'03 320 12 0 00 003131' 26112 000345'02 000000000000# 26113 001422'04 040 155 163 051 000 26114 003131'03 endif. ;[194] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29-1 K20DSP MAC 20-Aug-24 23:41 Delay in floating seconds and integral milliseconds 26115 003131'03 endif. ;[194] End delay listing 26116 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20DSP MAC 20-Aug-24 23:41 Retries, Pause and other Misc 26117 subttl Retries, Pause and other Misc 26118 26119 extern blip ;[277] Number of packets per blip, defined in k20mit 26120 26121 txmsg < 26122 003131'03 200 01 0 00 000000# Packet retries before timeout: > 26123 003132'03 104 00 0 00 000076 26124 003133'03 320 12 0 00 003134' 26125 000346'02 000000000000# 26126 001423'04 015 012 040 040 120 26127 003134'03 201 01 0 00 000101 numout maxtry 26128 003135'03 200 02 0 00 000000* 26129 003136'03 201 03 0 00 000012 26130 003137'03 104 00 0 00 000224 26131 003140'03 320 14 0 00 003141' 26132 26133 txmsg < 26134 003141'03 200 01 0 00 000000# Number of retries for init packet: > 26135 003142'03 104 00 0 00 000076 26136 003143'03 320 12 0 00 003144' 26137 000347'02 000000000000# 26138 001434'04 015 012 040 040 116 26139 003144'03 201 01 0 00 000101 numout imxtry 26140 003145'03 200 02 0 00 000000* 26141 003146'03 201 03 0 00 000012 26142 003147'03 104 00 0 00 000224 26143 003150'03 320 14 0 00 003151' 26144 26145 remark in floating seconds and integral milliseconds 26146 26147 003151'03 336 00 0 00 000000* ifmn. srvtim ;[194] Any NAK'ing? 26148 003152'03 254 00 0 00 003206' 26149 txmsg < 26150 003153'03 200 01 0 00 000000# Server sends NAKs every > ;[212] Yes, begin the blat 26151 003154'03 104 00 0 00 000076 26152 003155'03 320 12 0 00 003156' 26153 000350'02 000000000000# 26154 001445'04 015 012 040 040 123 26155 003156'03 201 01 0 00 000101 movei t1, .priou ;[212] Output to terminal 26156 003157'03 200 02 0 00 000000# move t2, ;[212] Pick up floating component 26157 003160'03 200 04 0 00 000002 move t4, t2 ;[212] Save a copy 26158 003161'03 400 03 0 00 000000 setz t3, ;[212] Default (non-columnar) formatting 26159 003162'03 104 00 0 00 000233 FLOUT% ;[212] Type it 26160 003163'03 320 14 0 00 003164' erjmps .+1 ;[212] Catch and suppress error 26161 003164'03 312 04 0 00 005020' came t4,[1.0] ;[212] Exactly one second? 26162 003165'03 254 00 0 00 003172' ifskp. ;[212] Yes, inflect for singular case 26163 003166'03 200 01 0 00 000000# txmsg < sec (> ;[212] Label and punctuate 26164 003167'03 104 00 0 00 000076 26165 003170'03 320 12 0 00 003171' 26166 000351'02 000000000000# 26167 001453'04 040 163 145 143 040 26168 003171'03 254 00 0 00 003175' else. ;[212] Otherwise, use plural inflection 26169 003172'03 200 01 0 00 000000# txmsg < secs (> ;[212] Label and punctuate 26170 003173'03 104 00 0 00 000076 26171 003174'03 320 12 0 00 003175' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30-1 K20DSP MAC 20-Aug-24 23:41 Retries, Pause and other Misc 26172 000352'02 000000000000# 26173 001455'04 040 163 145 143 163 26174 003175'03 endif. ;[212] End grammatical analysis 26175 003175'03 201 01 0 00 000101 movei t1, .priou ;[212] NOUT% goes to terminal, too 26176 003176'03 200 02 0 00 003151* move t2, srvtim ;[212] Load milliseconds 26177 003177'03 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ;[212] Base ten, but free format 26178 003200'03 104 00 0 00 000224 NOUT% ;[212] Type equivalent milliseconds 26179 003201'03 320 14 0 00 003202' erjmps .+1 ;[212] Catch and suppress error 26180 003202'03 200 01 0 00 000000# txmsg < ms)> ;[212] Abbreviation needs no inflection 26181 003203'03 104 00 0 00 000076 26182 003204'03 320 12 0 00 003205' 26183 000353'02 000000000000# 26184 001457'04 040 155 163 051 000 26185 003205'03 254 00 0 00 003211' else. ;[212] 26186 txmsg < 26187 003206'03 200 01 0 00 000000# Server will not NAK the communications line> 26188 003207'03 104 00 0 00 000076 26189 003210'03 320 12 0 00 003211' 26190 000354'02 000000000000# 26191 001460'04 015 012 040 040 123 26192 003211'03 endif. ;[212] 26193 26194 remark Other misc 26195 26196 003211'03 332 00 0 00 000014 ifme. debug ;[194] No blips if debugging. 26197 003212'03 254 00 0 00 003246' 26198 003213'03 336 00 0 00 003070* skipn local ; Or if not local. 26199 003214'03 254 00 0 00 003246' anskp. ;[194] 26200 003215'03 336 02 0 00 000000* skipn t2, blip ;[277] OK, so we just might be blipping 26201 003216'03 254 00 0 00 003243' ifskp. ;[277] We are, blat about it 26202 txmsg < 26203 26204 003217'03 200 01 0 00 000000# "." for every > ;[4] 26205 003220'03 104 00 0 00 000076 26206 003221'03 320 12 0 00 003222' 26207 000355'02 000000000000# 26208 001472'04 015 012 015 012 040 26209 003222'03 302 02 0 00 000001 caie t2, ^d1 ;[277] Ratio is one to one? 26210 003223'03 254 00 0 00 003230' ifskp. ;[277] Might be super long packets 26211 003224'03 200 01 0 00 000000# txmsg ;[277] point this out 26212 003225'03 104 00 0 00 000076 26213 003226'03 320 12 0 00 003227' 26214 000356'02 000000000000# 26215 001477'04 163 151 156 147 154 26216 003227'03 254 00 0 00 003237' else. 26217 003230'03 201 01 0 00 000101 movei t1, .priou ;[277] Continue output on terminal 26218 003231'03 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ;[277] Base ten, but free format 26219 003232'03 104 00 0 00 000224 NOUT% ;[277] Type current blip count 26220 003233'03 320 14 0 00 003234' erjmps .+1 ;[277] Catch and suppress error 26221 003234'03 200 01 0 00 000000# txmsg < packets> ;[277] Always (correctly) inflected for plural case 26222 003235'03 104 00 0 00 000076 26223 003236'03 320 12 0 00 003237' 26224 000357'02 000000000000# 26225 001502'04 040 160 141 143 153 26226 003237'03 endif. ;[277] End case numeric inflection k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30-2 K20DSP MAC 20-Aug-24 23:41 Retries, Pause and other Misc 26227 003237'03 200 01 0 00 000000# txmsg <, "%" for each NAK.> ;[277] 26228 003240'03 104 00 0 00 000076 26229 003241'03 320 12 0 00 003242' 26230 000360'02 000000000000# 26231 001504'04 054 040 042 045 042 26232 003242'03 254 00 0 00 003246' else. ;[277] Otherwise, not blipping 26233 txmsg < 26234 26235 003243'03 200 01 0 00 000000# No blipping in effect.> ;[277] So say as much 26236 003244'03 104 00 0 00 000076 26237 003245'03 320 12 0 00 003246' 26238 000361'02 000000000000# 26239 001510'04 015 012 015 012 040 26240 003246'03 endif. ;[277] End case blipping or not 26241 003246'03 endif. ;[194] 26242 26243 003246'03 561 01 0 00 002661* hrroi t1, crlflf ;[194] 26244 003247'03 104 00 0 00 000076 PSOUT% ;[194] 26245 003250'03 256 00 0 00 000005 xct q1 26246 remark ;[194] May fall through .. 26247 26248 if2 < purge int%f,flt%f,fltf > ;[212] Don't need symbols or macro after pass 2 26249 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20DSP MAC 20-Aug-24 23:41 Show INPUT parameters 26250 subttl Show INPUT parameters 26251 26252 extern incase ; Case conversion flag for INPUT search. 26253 extern indeft ; Default timeout for INPUT search, floating seconds 26254 extern indeff ; Same value as milliseconds 26255 extern intima ; Timeout action for INPUT search. 26256 26257 extern indefc ;[209] Default search string length in characters 26258 extern indefw ;[209] Same thing in words (for xblt) 26259 extern indefs ;[209] Expanded search string 26260 26261 ;[160] 26262 26263 003251'03 $shinp: entry $shinp 26264 txmsg 26267 003252'03 104 00 0 00 000076 26268 003253'03 320 12 0 00 003254' 26269 000362'02 000000000000# 26270 001516'04 120 141 162 141 155 26271 26272 003254'03 332 00 0 00 000000* ifme. incase 26273 003255'03 254 00 0 00 003262' 26274 003256'03 200 01 0 00 000000# txmsg 26275 003257'03 104 00 0 00 000076 26276 003260'03 320 12 0 00 003261' 26277 000363'02 000000000000# 26278 001531'04 111 147 156 157 162 26279 003261'03 254 00 0 00 003265' else. ;[209] In case set means case sensitive 26280 003262'03 200 01 0 00 000000# txmsg 26281 003263'03 104 00 0 00 000076 26282 003264'03 320 12 0 00 003265' 26283 000364'02 000000000000# 26284 001535'04 117 142 163 145 162 26285 003265'03 endif. 26286 26287 txmsg < 26288 003265'03 200 01 0 00 000000# Default Timeout: > 26289 003266'03 104 00 0 00 000076 26290 003267'03 320 12 0 00 003270' 26291 000365'02 000000000000# 26292 001542'04 015 012 040 040 104 26293 003270'03 337 02 0 00 000000* skipg t2, indeff ;[194] Load default value, if exists 26294 003271'03 254 00 0 00 003312' ifskp. ;[194] Doing time outs 26295 003272'03 201 01 0 00 000101 movei t1, .priou ;[194] 26296 003273'03 400 03 0 00 000000 setz t3, ;[194] Default flags 26297 003274'03 104 00 0 00 000233 FLOUT% ;[194] Type it 26298 003275'03 320 12 0 00 003276' erjmpr .+1 ;[194] 26299 003276'03 200 01 0 00 000000# txmsg < sec, > ;[194] 26300 003277'03 104 00 0 00 000076 26301 003300'03 320 12 0 00 003301' 26302 000366'02 000000000000# 26303 001547'04 040 163 145 143 054 26304 003301'03 201 01 0 00 000101 movei t1, .priou ;[194] k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-1 K20DSP MAC 20-Aug-24 23:41 Show INPUT parameters 26305 003302'03 200 02 0 00 000000* move t2, indeft ;[194] Load milliseconds 26306 003303'03 201 03 0 00 000012 movei t3, ^d10 ;[194] 26307 003304'03 104 00 0 00 000224 NOUT% ;[194] 26308 003305'03 320 12 0 00 003306' erjmpr .+1 ;[194] 26309 003306'03 200 01 0 00 000000# txmsg < ms> ;[194] 26310 003307'03 104 00 0 00 000076 26311 003310'03 320 12 0 00 003311' 26312 000367'02 000000000000# 26313 001551'04 040 155 163 000 000 26314 003311'03 254 00 0 00 003315' else. ;[194] Otherwise, not timing out 26315 003312'03 200 01 0 00 000000# txmsg ;[194] 26316 003313'03 104 00 0 00 000076 26317 003314'03 320 12 0 00 003315' 26318 000370'02 000000000000# 26319 001552'04 111 156 146 151 156 26320 003315'03 endif. ;[194] 26321 26322 txmsg < 26323 003315'03 200 01 0 00 000000# Timeout Action: > ;[209] 26324 003316'03 104 00 0 00 000076 26325 003317'03 320 12 0 00 003320' 26326 000371'02 000000000000# 26327 001554'04 015 012 040 040 124 26328 003320'03 332 00 0 00 000000* ifme. intima ;[209] 26329 003321'03 254 00 0 00 003326' 26330 003322'03 200 01 0 00 000000# txmsg ;[209] 26331 003323'03 104 00 0 00 000076 26332 003324'03 320 12 0 00 003325' 26333 000372'02 000000000000# 26334 001561'04 120 162 157 143 145 26335 003325'03 254 00 0 00 003331' else. ;[209] 26336 003326'03 200 01 0 00 000000# txmsg ;[209] 26337 003327'03 104 00 0 00 000076 26338 003330'03 320 12 0 00 003331' 26339 000373'02 000000000000# 26340 001567'04 121 165 151 164 040 26341 003331'03 endif. ;[209] 26342 26343 txmsg < 26344 003331'03 200 01 0 00 000000# Default Search: > ;[209] 26345 003332'03 104 00 0 00 000076 26346 003333'03 320 12 0 00 003334' 26347 000374'02 000000000000# 26348 001574'04 015 012 040 040 104 26349 26350 003334'03 332 00 0 00 000000* ifme. indefw ;[209] Anything set? 26351 003335'03 254 00 0 00 003342' 26352 003336'03 200 01 0 00 000000# txmsg <*Carriage Return Line Feed*> ;[209] Nope, so point that out 26353 003337'03 104 00 0 00 000076 26354 003340'03 320 12 0 00 003341' 26355 000375'02 000000000000# 26356 001601'04 052 103 141 162 162 26357 003341'03 254 00 0 00 003364' else. ;[209] Otherwise, something there 26358 003342'03 201 01 0 00 000040 movei t1, .chspc ;[209] Load a space 26359 003343'03 104 00 0 00 000074 PBOUT% ;[209] Line up the text k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-2 K20DSP MAC 20-Aug-24 23:41 Show INPUT parameters 26360 003344'03 201 01 0 00 000042 movei t1, .chdbq ;[209] Load Double quote 26361 003345'03 104 00 0 00 000074 PBOUT% ;[209] Type it 26362 003346'03 201 01 0 00 000101 movei t1, .priou ;[209] Output to terminal 26363 003347'03 561 02 0 00 000000* hrroi t2, indefs ;[209] Point to default string 26364 003350'03 210 03 0 00 000000* movn t3, indefc ;[209] Load negative count of characters 26365 003351'03 400 04 0 00 000000 setz t4, ;[209] Stop on NUL, just in case 26366 003352'03 104 00 0 00 000053 SOUT% ;[209] Type it (counted SOUT% faster) 26367 003353'03 320 12 0 00 003355' ifje. r ;[209] Catch any JSYS error 26368 003354'03 254 00 0 00 003362' 26369 003355'03 200 04 0 00 000001 move t4, t1 ;[209] Save error for debuggers 26370 003356'03 200 01 0 00 000000# txmsg <*** ERROR ***> ;[209] Something obvious, I guess 26371 003357'03 104 00 0 00 000076 26372 003360'03 320 12 0 00 003361' 26373 000376'02 000000000000# 26374 001607'04 052 052 052 040 105 26375 003361'03 201 01 0 00 000101 movei t1, .priou ;[209] Reload primary output 26376 003362'03 endif. ;[209] 26377 003362'03 201 01 0 00 000042 movei t1, .chdbq ;[209] Load Double quote 26378 003363'03 104 00 0 00 000074 PBOUT% ;[209] Type it 26379 003364'03 endif. ;[209] End case displaying search string 26380 26381 003364'03 561 01 0 00 003246* hrroi t1, crlflf ;[209] Tie off the line 26382 003365'03 104 00 0 00 000076 PSOUT% ;[209] 26383 26384 003366'03 256 00 0 00 000005 xct q1 26385 remark ;[194] May fall through .. 26386 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20DSP MAC 20-Aug-24 23:41 Show Transmit-Capture parameters 26387 subttl Show Transmit-Capture parameters 26388 26389 remark ;[265] All set by K20PAR, used in K20IOC 26390 extern teofch ;[266] Transmit EOF character (defaults to none) 26391 extern tsilen ;[266] Whether to allow blat from parsing 26392 extern tmaxln ;[266] Maximum line we'll try to force 26393 extern tpause ;[266] Amount to pause, assuming nothing 26394 extern tobser ;[273] Case observed/ignored in search 26395 extern tsetsd ;[275] Settings defaults come from SET INPUT 26396 extern timeou ;[266] If timing out the SIN(R)%/SOUT(R)% 26397 extern tdefpl ;[272] Length of default prompt, if using one 26398 extern tdefpp ;[272] Pointer to default prompt, if using one 26399 26400 003367'03 $shtrc: entry $shtrc ;[266] Called from K20PAR 26401 26402 txmsg ;[266] Present it 26405 003370'03 104 00 0 00 000076 26406 003371'03 320 12 0 00 003372' 26407 000377'02 000000000000# 26408 001612'04 120 141 162 141 155 26409 26410 003372'03 336 02 0 00 000000* skipn t2, teofch ;[266] Load it 26411 003373'03 254 00 0 00 003376' ifskp. ;[266] If using one 26412 003374'03 260 17 0 00 004230' call dspchr ;[266] Type it very nicely 26413 003375'03 254 00 0 00 003400' else. ;[266] Otherwise, not sending EOF 26414 003376'03 561 01 0 00 005021' tmsg ;[266] So say as much 26415 003377'03 104 00 0 00 000076 26416 003400'03 endif. ;[266] 26417 txmsg < 26418 003400'03 200 01 0 00 000000# Maximum Line Length: > ;[266] Present the value 26419 003401'03 104 00 0 00 000076 26420 003402'03 320 12 0 00 003403' 26421 000400'02 000000000000# 26422 001631'04 015 012 040 040 040 26423 003403'03 201 01 0 00 000101 movei t1, .priou ;[266] Continuing on the terminal 26424 003404'03 200 02 0 00 000000* move t2, tmaxln ;[266] Load the value 26425 003405'03 201 03 0 00 000012 movei t3, ^d10 ;[266] Which is displayed in decimal 26426 003406'03 104 00 0 00 000224 NOUT% ;[266] Type it 26427 003407'03 320 12 0 00 003410' erjmpr .+1 ;[266] Catch and ignore error 26428 txmsg < 26429 003410'03 200 01 0 00 000000# Pause after each send: > ;[266] Present the value 26430 003411'03 104 00 0 00 000076 26431 003412'03 320 12 0 00 003413' 26432 000401'02 000000000000# 26433 001637'04 015 012 040 040 040 26434 003413'03 337 02 0 00 000000# skipg t2, tpause+1 ;[266] Amount to pause, floating 26435 003414'03 254 00 0 00 003435' ifskp. ;[266] We're pausing 26436 003415'03 201 01 0 00 000101 movei t1, .priou ;[266] Still going to the terminal 26437 003416'03 400 03 0 00 000000 setz t3, ;[266] Default flags 26438 003417'03 104 00 0 00 000233 FLOUT% ;[266] Type floating seconds 26439 003420'03 320 12 0 00 003421' erjmpr .+1 ;[266] Catch and ignore error 26440 003421'03 200 01 0 00 000000# txmsg < sec, > ;[266] Abbreviate 26441 003422'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-1 K20DSP MAC 20-Aug-24 23:41 Show Transmit-Capture parameters 26442 003423'03 320 12 0 00 003424' 26443 000402'02 000000000000# 26444 001645'04 040 163 145 143 054 26445 003424'03 201 01 0 00 000101 movei t1, .priou ;[266] Reload terminal designatore 26446 003425'03 200 02 0 00 000000* move t2, tpause ;[266] Load integer milliseconds 26447 003426'03 201 03 0 00 000012 movei t3, ^d10 ;[266] Which are in decimal 26448 003427'03 104 00 0 00 000224 NOUT% ;[266] Type them 26449 003430'03 320 12 0 00 003431' erjmpr .+1 ;[266] Catch and ignore error 26450 003431'03 200 01 0 00 000000# txmsg < ms> ;[266] Give units 26451 003432'03 104 00 0 00 000076 26452 003433'03 320 12 0 00 003434' 26453 000403'02 000000000000# 26454 001647'04 040 155 163 000 000 26455 003434'03 254 00 0 00 003440' else. ;[266] Otherwise, not pausing 26456 003435'03 200 01 0 00 000000# txmsg ;[266] 26457 003436'03 104 00 0 00 000076 26458 003437'03 320 12 0 00 003440' 26459 000404'02 000000000000# 26460 001650'04 116 157 156 145 000 26461 003440'03 endif. ;[266] 26462 txmsg < 26463 003440'03 200 01 0 00 000000# Time out: > ;[266] Present the value 26464 003441'03 104 00 0 00 000076 26465 003442'03 320 12 0 00 003443' 26466 000405'02 000000000000# 26467 001651'04 015 012 011 011 040 26468 003443'03 337 02 0 00 000000# skipg t2, timeou+1 ;[266] Duration of timer, floating 26469 003444'03 254 00 0 00 003465' ifskp. ;[266] We're pausing 26470 003445'03 201 01 0 00 000101 movei t1, .priou ;[266] Still going to the terminal 26471 003446'03 400 03 0 00 000000 setz t3, ;[266] Default flags 26472 003447'03 104 00 0 00 000233 FLOUT% ;[266] Type floating seconds 26473 003450'03 320 12 0 00 003451' erjmpr .+1 ;[266] Catch and ignore error 26474 003451'03 200 01 0 00 000000# txmsg < sec, > ;[266] Abbreviate 26475 003452'03 104 00 0 00 000076 26476 003453'03 320 12 0 00 003454' 26477 000406'02 000000000000# 26478 001655'04 040 163 145 143 054 26479 003454'03 201 01 0 00 000101 movei t1, .priou ;[266] Reload terminal designatore 26480 003455'03 200 02 0 00 000000* move t2, timeout ;[266] Load integer milliseconds 26481 003456'03 201 03 0 00 000012 movei t3, ^d10 ;[266] Which are in decimal 26482 003457'03 104 00 0 00 000224 NOUT% ;[266] Type them 26483 003460'03 320 12 0 00 003461' erjmpr .+1 ;[266] Catch and ignore error 26484 003461'03 200 01 0 00 000000# txmsg < ms> ;[266] Give units 26485 003462'03 104 00 0 00 000076 26486 003463'03 320 12 0 00 003464' 26487 000407'02 000000000000# 26488 001657'04 040 155 163 000 000 26489 003464'03 254 00 0 00 003470' else. ;[266] Otherwise, not pausing 26490 003465'03 200 01 0 00 000000# txmsg ;[266] 26491 003466'03 104 00 0 00 000076 26492 003467'03 320 12 0 00 003470' 26493 000410'02 000000000000# 26494 001660'04 116 157 156 145 000 26495 003470'03 endif. ;[266] 26496 txmsg < k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-2 K20DSP MAC 20-Aug-24 23:41 Show Transmit-Capture parameters 26497 003470'03 200 01 0 00 000000# Settings Defaults Context: > ;[275] Present the value 26498 003471'03 104 00 0 00 000076 26499 003472'03 320 12 0 00 003473' 26500 000411'02 000000000000# 26501 001661'04 015 012 123 145 164 26502 003473'03 332 00 0 00 000000* ifme. tsetsd ;[275] Coming from INPUT? 26503 003474'03 254 00 0 00 003501' 26504 003475'03 200 01 0 00 000000# txmsg ;[275] Yes, say what put INPUT 26505 003476'03 104 00 0 00 000076 26506 003477'03 320 12 0 00 003500' 26507 000412'02 000000000000# 26508 001667'04 123 105 124 040 111 26509 003500'03 254 00 0 00 003504' else. ;[275] Otherwise, using SET TRANSMIT 26510 003501'03 200 01 0 00 000000# txmsg ;[275] 26511 003502'03 104 00 0 00 000076 26512 003503'03 320 12 0 00 003504' 26513 000413'02 000000000000# 26514 001671'04 123 105 124 040 124 26515 003504'03 endif. ;[275] 26516 txmsg < 26517 003504'03 200 01 0 00 000000# Remote Response Matching: > ;[273] Present the value 26518 003505'03 104 00 0 00 000076 26519 003506'03 320 12 0 00 003507' 26520 000414'02 000000000000# 26521 001674'04 015 012 040 122 145 26522 003507'03 332 00 0 00 000000* ifme. tobserv ;[273] Ignoring it? 26523 003510'03 254 00 0 00 003515' 26524 003511'03 200 01 0 00 000000# txmsg ;[273] Say as much 26525 003512'03 104 00 0 00 000076 26526 003513'03 320 12 0 00 003514' 26527 000415'02 000000000000# 26528 001702'04 103 141 163 145 040 26529 003514'03 254 00 0 00 003520' else. ;[273] Must be observing it (binary value) 26530 003515'03 200 01 0 00 000000# txmsg ;[273] Say as much 26531 003516'03 104 00 0 00 000076 26532 003517'03 320 12 0 00 003520' 26533 000416'02 000000000000# 26534 001705'04 103 141 163 145 040 26535 003520'03 endif. ;[273] 26536 txmsg < 26537 003520'03 200 01 0 00 000000# Silence Remote Responses: > ;[266] Present the value 26538 003521'03 104 00 0 00 000076 26539 003522'03 320 12 0 00 003523' 26540 000417'02 000000000000# 26541 001710'04 015 012 040 123 151 26542 003523'03 332 00 0 00 000000* ifme. tsilen ;[266] Decide what to type 26543 003524'03 254 00 0 00 003531' 26544 003525'03 200 01 0 00 000000# txmsg ;[266] Not doing it 26545 003526'03 104 00 0 00 000076 26546 003527'03 320 12 0 00 003530' 26547 000420'02 000000000000# 26548 001716'04 117 146 146 000 000 26549 003530'03 254 00 0 00 003534' else. ;[266] Otherwise, must be doing it 26550 003531'03 200 01 0 00 000000# txmsg ;[266] Say as much 26551 003532'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-3 K20DSP MAC 20-Aug-24 23:41 Show Transmit-Capture parameters 26552 003533'03 320 12 0 00 003534' 26553 000421'02 000000000000# 26554 001717'04 117 156 000 000 000 26555 003534'03 endif. ;[266] 26556 txmsg < 26557 003534'03 200 01 0 00 000000# Default Remote Prompt: > ;[272] Present the value 26558 003535'03 104 00 0 00 000076 26559 003536'03 320 12 0 00 003537' 26560 000422'02 000000000000# 26561 001720'04 015 012 040 040 040 26562 003537'03 210 03 0 00 000000* movn t3, tdefpl ;[272] Load negative of length 26563 003540'03 326 03 0 00 003545' ife. t3 ;[272] Umm, do we have a default? 26564 003541'03 200 01 0 00 000000# txmsg ;[272] Nope, so let's not print anything silly 26565 003542'03 104 00 0 00 000076 26566 003543'03 320 12 0 00 003544' 26567 000423'02 000000000000# 26568 001726'04 116 157 156 145 000 26569 003544'03 254 00 0 00 003551' else. ;[272] Otherwise, have something!! 26570 003545'03 200 02 0 00 000000* move t2, tdefpp ;[272] Load pointer to default prompt 26571 003546'03 201 01 0 00 000101 movei t1, .priou ;[272] Still printing to terminal 26572 003547'03 104 00 0 00 000053 SOUT% ;[272] Counted SOUT% is faster 26573 003550'03 320 12 0 00 003551' erjmpr .+1 ;[272] Unless it doesn't work... Ignore. 26574 003551'03 endif. ;[272] Done with remote prompt handling 26575 26576 003551'03 561 01 0 00 003364* hrroi t1, crlflf ;[209] Tie off the line 26577 003552'03 104 00 0 00 000076 PSOUT% ;[209] 26578 26579 003553'03 256 00 0 00 000005 xct q1 ;[266] Might return 26580 remark ;[194] May fall through .. 26581 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20DSP MAC 20-Aug-24 23:41 SHOW MACRO DEFINITIONS 26582 subttl SHOW MACRO DEFINITIONS 26583 26584 ;[77] SHOW MACRO DEFINITIONS 26585 26586 extern mactab ;[194] Macro table 26587 26588 003554'03 $shmac: entry $shmac 26589 003554'03 554 04 0 00 000000* hlrz t4, mactab ; Anything in macro table? 26590 003555'03 327 04 0 00 003562' ifle. t4 ;[194] If don't have any 26591 txmsg <%No macros defined 26592 003556'03 200 01 0 00 000000# > ;[203] Then say that 26593 003557'03 104 00 0 00 000076 26594 003560'03 320 12 0 00 003561' 26595 000424'02 000000000000# 26596 001727'04 045 116 157 040 155 26597 26598 003561'03 254 00 0 00 003651' jrst $shmax ;[194] And we're all done 26599 003562'03 endif. ;[203] Otherwise, have some blat 26600 ;[203] So dump the macros 26601 003562'03 201 01 0 00 000101 movei t1,.priou ;[203] Still going to terminal 26602 003563'03 200 02 0 00 000004 move t2,t4 ;[203] Load how many used 26603 003564'03 201 03 0 00 000012 movei t3,^d10 ;[203] Humans grok base 10 26604 003565'03 104 00 0 00 000224 NOUT% ;[203] Convert to external and display 26605 003566'03 320 12 0 00 003567' erjmpr .+1 ;[203] Catch and ignore error 26606 003567'03 200 01 0 00 000000# txmsg < macro> ;[203] Begin description 26607 003570'03 104 00 0 00 000076 26608 003571'03 320 12 0 00 003572' 26609 000425'02 000000000000# 26610 001734'04 040 155 141 143 162 26611 003572'03 201 01 0 00 000163 movei t1,"s" ;[203] Load inflection 26612 003573'03 302 04 0 00 000001 caie t4,^d1 ;[203] Singular case? 26613 003574'03 104 00 0 00 000074 PBOUT% ;[203] No, must inflect it 26614 003575'03 200 01 0 00 000000# txmsg < used, > ;[203] Continue description 26615 003576'03 104 00 0 00 000076 26616 003577'03 320 12 0 00 003600' 26617 000426'02 000000000000# 26618 001736'04 040 165 163 145 144 26619 26620 003600'03 201 01 0 00 000101 movei t1,.priou ;[203] Still going to terminal 26621 003601'03 550 02 0 00 003554* hrrz t2, mactab ;[203] Load maximum number of macros 26622 003602'03 274 02 0 00 000004 sub t2,t4 ;[203] Subtract off used 26623 003603'03 104 00 0 00 000224 NOUT% ;[203] Convert to external and display 26624 003604'03 320 12 0 00 003605' erjmpr .+1 ;[203] Catch and ignore error 26625 003605'03 200 01 0 00 000000# txmsg < available. Remaining storage: > 26626 003606'03 104 00 0 00 000076 26627 003607'03 320 12 0 00 003610' 26628 000427'02 000000000000# 26629 001740'04 040 141 166 141 151 26630 003610'03 260 17 0 00 000000* call $mchrs## ;[203] Get remaining space 26631 003611'03 200 02 0 00 000001 move t2, t1 ;[203] Load remaining characters 26632 003612'03 200 04 0 00 000001 move t4, t1 ;[203] Save a copy 26633 003613'03 201 01 0 00 000101 movei t1, .priou ;[203] This terminal 26634 003614'03 201 03 0 00 000012 movei t3, ^d10 ;[203] Base ten 26635 003615'03 104 00 0 00 000224 NOUT% ;[203] Convert to external and display 26636 003616'03 320 12 0 00 003617' erjmpr .+1 ;[203] Catch and ignore error k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33-1 K20DSP MAC 20-Aug-24 23:41 SHOW MACRO DEFINITIONS 26637 003617'03 200 01 0 00 000000# txmsg < character> ;[203] 26638 003620'03 104 00 0 00 000076 26639 003621'03 320 12 0 00 003622' 26640 000430'02 000000000000# 26641 001747'04 040 143 150 141 162 26642 003622'03 201 01 0 00 000163 movei t1,"s" ;[203] Load inflection 26643 003623'03 302 04 0 00 000001 caie t4,^d1 ;[203] Singular case? 26644 003624'03 104 00 0 00 000074 PBOUT% ;[203] No, must inflect it 26645 txmsg < 26646 26647 Definitions: 26648 26649 003625'03 200 01 0 00 000000# > ;[203] 26650 003626'03 104 00 0 00 000076 26651 003627'03 320 12 0 00 003630' 26652 000431'02 000000000000# 26653 001752'04 015 012 015 012 104 26654 26655 003630'03 554 04 0 00 003601* hlrz t4, mactab ;[203] Reload macro table length 26656 003631'03 201 03 0 00 000001 movei t3, 1 ;[194] Point at first entry of TBLUK% tabke 26657 ;[194] Fall through to loop context 26658 003632'03 do. ;[194] Enter loop lexical context 26659 003632'03 200 01 0 00 000000# txmsg < > ;[194] Space over twice 26660 003633'03 104 00 0 00 000076 26661 003634'03 320 12 0 00 003635' 26662 000432'02 000000000000# 26663 001757'04 040 040 000 000 000 26664 003635'03 564 01 0 03 003630* hlro t1, mactab(t3) ; Point to macro name. 26665 003636'03 104 00 0 00 000076 PSOUT ; Print it. 26666 003637'03 200 01 0 00 000000# txmsg < = > 26667 003640'03 104 00 0 00 000076 26668 003641'03 320 12 0 00 003642' 26669 000433'02 000000000000# 26670 001760'04 040 075 040 000 000 26671 003642'03 560 01 0 03 003635* hrro t1, mactab(t3) ; Same deal for macro body. 26672 003643'03 104 00 0 00 000076 PSOUT 26673 003644'03 260 17 0 00 004161' call ifcrlf ;[194] See if it wants a CRLF 26674 003645'03 350 00 0 00 000003 aos t3 ; Bump TBLUK% index. 26675 003646'03 367 04 0 00 003632' sojg t4, top. ; Do for all macros in table. 26676 003647'03 enddo. ;[194] 26677 26678 003647'03 561 01 0 00 001331* hrroi t1, crlf ;[194] 26679 003650'03 104 00 0 00 000076 PSOUT% 26680 26681 003651'03 263 17 0 00 000000 $shmax: ret ;[83] Last one, always want to return. 26682 remark q1 ; Last show command always returns 26683 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20DSP MAC 20-Aug-24 23:41 ITS Phase of Moon 26684 subttl ITS Phase of Moon 26685 26686 ;[6] (this whole routine, just for fun...) 26687 ; 26688 ; This code stolen from MOON.MAC (anybody know who wrote it?). 26689 ; Just changed OUTCHR's to PBOUT%'s via a macro. - Frank. 26690 ; 26691 ; The code is from MIT and may have been named in jest after famed 26692 ; MIT hacker David A. Moon. Also, see below. - Tom. 26693 ; 26694 ;[190] Change OUTCHR macro to not store in write-protected area 26695 ;[194] Slight rework to reduce symbol table 26696 26697 003652'03 265 16 0 00 005022' moon: saveac <5,6> 26698 003653'03 403 03 0 00 000004 setzb 3,4 26699 003654'03 474 02 0 00 000000 seto 2, 26700 003655'03 104 00 0 00 000222 ODCNV% 26701 003656'03 320 16 0 00 001315* erjmp r 26702 003657'03 621 04 0 00 000077 tlz 4,77 26703 003660'03 104 00 0 00 000223 IDCNV% 26704 003661'03 320 16 0 00 003656* erjmp r ; Return upon any error. 26705 003662'03 200 01 0 00 000000# txmsg <, Moon: > ; OK so far, say what we're doing. 26706 003663'03 104 00 0 00 000076 26707 003664'03 320 12 0 00 003665' 26708 000434'02 000000000000# 26709 001761'04 054 040 115 157 157 26710 26711 ; AC2= Universal time adjusted for time zone. 26712 26713 003665'03 200 01 0 00 000002 move 1,2 ; Right place. 26714 003666'03 274 01 0 00 000000# sub 1,newmn ; Sub off base new moon 26715 003667'03 230 01 0 00 000000# idiv 1,period ; Divide by the period 26716 003670'03 230 02 0 00 000000# idiv 2,perio4 ; Get fractions of a period 26717 003671'03 317 03 0 00 000000# camg 3,perio8 ; Check for phase + or - 26718 003672'03 254 00 0 00 003677' ifskp. ;[194] ; Not more than 3+ days 26719 003673'03 274 03 0 00 000000# sub 3,perio4 ; Make it next phase -n days 26720 003674'03 306 02 0 00 000003 cain 2,3 ; Is it LQ+3D+? 26721 003675'03 634 02 0 00 000002 tdza 2,2 ; It is 26722 003676'03 340 02 0 00 000000 aoj 2, ; Increment phase 26723 003677'03 endif. 26724 26725 003677'03 510 01 0 02 000000# hllz 1,table(2) ; Get SIXBIT phase 26726 003700'03 335 00 0 00 000003 skipge 3 ; 3 < 0 then minus phase output 26727 003701'03 665 01 0 00 000015 tloa 1,'-' ; - 26728 003702'03 665 01 0 00 000013 tloa 1,'+' ; + 26729 003703'03 217 00 0 00 000003 movms 3 ; Fix mag of 3 26730 003704'03 200 02 0 00 005032' move 2,[point 6,1] ; Byte pointer 26731 003705'03 201 05 0 00 000002 movei 5,2 ; Loop 3 times 26732 26733 003706'03 do. ;[194] Enter loop context 26734 003706'03 134 04 0 00 000002 ildb 4,2 ; Get a character 26735 003707'03 271 04 0 00 000040 addi 4," " ; Make ASCII 26736 003710'03 261 17 0 00 000001 OUTCHR 4 ; Type it 26737 003711'03 200 01 0 00 000004 26738 003712'03 104 00 0 00 000074 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-1 K20DSP MAC 20-Aug-24 23:41 ITS Phase of Moon 26739 003713'03 320 12 0 00 003714' 26740 003714'03 262 17 0 00 000001 26741 003715'03 365 05 0 00 003706' sojge 5,top. ;[194] ; Loop 26742 003716'03 enddo. 26743 26744 003716'03 205 04 0 00 777774 movsi 4,-4 ; Make aobjn pointer 26745 26746 003717'03 do. ;[194] Enter loop context 26747 003717'03 550 02 0 04 000000# hrrz 2,table(4) ; Get a multiplier 26748 003720'03 620 02 0 00 774000 trz 2,774000 ; Strip off ascii character 26749 003721'03 221 03 0 02 000000 imuli 3,(2) ; Get the value decoded 26750 003722'03 554 01 0 00 000003 hlrz 1,3 ; Get value 26751 003723'03 621 03 0 00 777777 tlz 3,-1 ; Zap old LH 26752 003724'03 200 05 0 00 000001 move 5,1 ; Use 5 & 6 here 26753 003725'03 231 05 0 00 000012 idivi 5,12 ; Radix 10 26754 003726'03 271 05 0 00 000060 addi 5,60 ; Make ASCII 26755 003727'03 307 05 0 00 000060 caig 5,60 ;[194] Check for leading zero 26756 003730'03 254 00 0 00 003736' ifskp. ;[194] Not a leading zero 26757 003731'03 261 17 0 00 000001 OUTCHR 5 ; Type it. 26758 003732'03 200 01 0 00 000005 26759 003733'03 104 00 0 00 000074 26760 003734'03 320 12 0 00 003735' 26761 003735'03 262 17 0 00 000001 26762 003736'03 endif. ;[194] 26763 003736'03 271 06 0 00 000060 addi 6,60 ; Make ASCII 26764 003737'03 261 17 0 00 000001 OUTCHR 6 26765 003740'03 200 01 0 00 000006 26766 003741'03 104 00 0 00 000074 26767 003742'03 320 12 0 00 003743' 26768 003743'03 262 17 0 00 000001 26769 003744'03 135 05 0 00 005033' ldb 5,[point 7,table(4),24] ; Get d/h/m/s 26770 003745'03 261 17 0 00 000001 OUTCHR 5 ; Type it. 26771 003746'03 200 01 0 00 000005 26772 003747'03 104 00 0 00 000074 26773 003750'03 320 12 0 00 003751' 26774 003751'03 262 17 0 00 000001 26775 003752'03 261 17 0 00 000001 OUTCHR ["."] ; Follow with a dot. 26776 003753'03 200 01 0 00 005034' 26777 003754'03 104 00 0 00 000074 26778 003755'03 320 12 0 00 003756' 26779 003756'03 262 17 0 00 000001 26780 003757'03 253 04 0 00 003717' aobjn 4, top. ;[194] ; Loop. 26781 003760'03 enddo. ;[194] 26782 26783 003760'03 263 17 0 00 000000 ret ; Done, return. 26784 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20DSP MAC 20-Aug-24 23:41 Pure data for MOON 26785 subttl Pure data for MOON 26786 26787 ; 12:47am Monday, 1 August 2022 26788 ; 26789 ; This routine uses a lunar period of 29 days, 12 hours, 53 minutes 26790 ; and 19 seconds. 26791 ; 26792 ; After 43 years, 6 months, 3 days, 23 hours, 29 minutes and 12 26793 ; seconds, it might be of interest to see how accurate this still is; 26794 ; meaning, has the period changed (I.E., increased) to the extent 26795 ; that we are accumulating a detectable difference. 26796 ; 26797 ; Wikipedia reports that a lunation, or synodic month, is the time 26798 ; period from one new moon to the next. In the J2000. 0 epoch, the 26799 ; average length of a lunation is 29.53059 days (or 29 days, 12 hours, 26800 ; 44 minutes, and 3 seconds). That is quite a difference. 26801 ; 26802 ; And it might be irrelevant. 26803 ; 26804 ; Since Earth's orbit around the Sun is elliptical and not circular, 26805 ; the speed of Earth's progression around the Sun varies during the 26806 ; year. Thus, the angular rate is faster nearer periapsis and slower 26807 ; near apoapsis. 26808 ; 26809 ; The same is also true for the Moon's orbit around the Earth. 26810 ; Because of these variations in angular rate, the actual time between 26811 ; lunations may vary from about 29.18 to about 29.93 days. The 26812 ; average duration in modern times is 29.53059 days with up to seven 26813 ; hours variation about the mean in any given year. 26814 26815 chgsec(code,const) ;;Constants go in CONST .PSECT 26816 26817 000435'02 125575 034343 newmn: 125575,,34343 ; 28-jan-79 0120 est 26818 000035 422752 per==35,,422752 ; 29d.12h.53m.19s 26819 000436'02 000035 422752 period: per 26820 000437'02 000007 304572 perio4: per/4 26821 000440'02 000003 542275 perio8: per/10 26822 26823 000441'02 565500 144 0001 table: byte(18)'NM '(7)"d"(11)^D1 ; New moon - days - 1 26824 000442'02 466100 150 0030 byte(18)'FQ '(7)"h"(11)^D24 ; First quarter - hours - 24 26825 000443'02 465500 155 0074 byte(18)'FM '(7)"m"(11)^D60 ; Full moon - minutes - 60 26826 000444'02 546100 163 0074 byte(18)'LQ '(7)"s"(11)^D60 ; Last quarter - seconds - 60 26827 26828 retsec ;;Return to previous .PSECT 26829 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20DSP MAC 20-Aug-24 23:41 Display line performance external variables 26830 subttl Display line performance external variables 26831 26832 extern nsici ; Network SIN%'s Issued 26833 extern nsimx ; Network SIN% maximum length 26834 extern nsitc ; Network SIN% total characters 26835 extern vboct ; Virtual Terminal BOUT% Count (simulated) 26836 extern vsict ; Virtual Terminal SIN% Count (number done) 26837 extern vsimx ; Virtual Terminal SIN% Maximum length 26838 extern vsitc ; Virtual Terminal total characters SIN%'ed 26839 extern vsoct ; Virtual Terminal SOUTR%'s Issued 26840 extern vsotc ; Virtual Terminal SOUTR% Total Characters 26841 extern vsomx ; Virtual Terminal SOUTR% Maximum length 26842 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20DSP MAC 20-Aug-24 23:41 Display information concerning line performance 26843 subttl Display information concerning line performance 26844 26845 ; Previous code from TELNET used BIN%/BOUT% loops in two forks to 26846 ; input data from the terminal and display results asynchronously. In 26847 ; terms of computational overhead, using a BIN% and a BOUT% for each 26848 ; character is the most expensive way to do it. 26849 ; 26850 ; It's also a certain way to become unpopular on a heavily loaded 26851 ; system or otherwise adversely impact other activities. On the other 26852 ; hand, data can not be left in the buffer in the case of a real front 26853 ; end, as this will crash RSX20F. 26854 ; 26855 ; The code was rewritten to wait for a character and then determine 26856 ; after the read whether more data existed in the buffer. If this was 26857 ; the case, then the remaining data was read. This also occurs on 26858 ; output. A Virtual BOUT% in this case is a SOUTR% of one character 26859 ; to get it pushed over the network. 26860 26861 003761'03 265 16 0 00 004644' disper: saveac ; Not called with anything, doesn't touch AC's 26862 26863 remark ; transmission fork keep these 26864 003762'03 336 00 0 00 002031* ifmn. vbict 26865 003763'03 254 00 0 00 003774' 26866 txmsg < 26867 003764'03 200 01 0 00 000000# Terminal BIN%'s: > 26868 003765'03 104 00 0 00 000076 26869 003766'03 320 12 0 00 003767' 26870 000445'02 000000000000# 26871 001763'04 015 012 040 040 124 26872 003767'03 201 01 0 00 000101 numout vbict ; Virtual Terminal BIN% Count 26873 003770'03 200 02 0 00 003762* 26874 003771'03 201 03 0 00 000012 26875 003772'03 104 00 0 00 000224 26876 003773'03 320 14 0 00 003774' 26877 003774'03 endif. 26878 003774'03 336 00 0 00 000000* ifmn. vchrcn 26879 003775'03 254 00 0 00 004006' 26880 txmsg < 26881 003776'03 200 01 0 00 000000# Virtual CFIBF%'s: > 26882 003777'03 104 00 0 00 000076 26883 004000'03 320 12 0 00 004001' 26884 000446'02 000000000000# 26885 001770'04 015 012 040 040 126 26886 004001'03 201 01 0 00 000101 numout vchrcn ; Virtual CHaRcters flushed CouNt 26887 004002'03 200 02 0 00 003774* 26888 004003'03 201 03 0 00 000012 26889 004004'03 104 00 0 00 000224 26890 004005'03 320 14 0 00 004006' 26891 004006'03 endif. 26892 004006'03 336 00 0 00 000000* ifmn. inpcbf 26893 004007'03 254 00 0 00 004020' 26894 txmsg < 26895 004010'03 200 01 0 00 000000# Buffer CFIBF%'s: > 26896 004011'03 104 00 0 00 000076 26897 004012'03 320 12 0 00 004013' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-1 K20DSP MAC 20-Aug-24 23:41 Display information concerning line performance 26898 000447'02 000000000000# 26899 001775'04 015 012 040 040 040 26900 004013'03 201 01 0 00 000101 numout inpcbf ; INPUT network Buffer characters flushed 26901 004014'03 200 02 0 00 004006* 26902 004015'03 201 03 0 00 000012 26903 004016'03 104 00 0 00 000224 26904 004017'03 320 14 0 00 004020' 26905 004020'03 endif. 26906 004020'03 336 00 0 00 000000* ifmn. vboct 26907 004021'03 254 00 0 00 004032' 26908 txmsg < 26909 004022'03 200 01 0 00 000000# Virtual BOUT%'s: > 26910 004023'03 104 00 0 00 000076 26911 004024'03 320 12 0 00 004025' 26912 000450'02 000000000000# 26913 002002'04 015 012 040 040 126 26914 004025'03 201 01 0 00 000101 numout vboct ; Virtual Terminal BOUT% Count (simulated) 26915 004026'03 200 02 0 00 004020* 26916 004027'03 201 03 0 00 000012 26917 004030'03 104 00 0 00 000224 26918 004031'03 320 14 0 00 004032' 26919 004032'03 endif. 26920 004032'03 336 00 0 00 000000* ifmn. vsict 26921 004033'03 254 00 0 00 004064' 26922 txmsg < 26923 004034'03 200 01 0 00 000000# SIN%'s Issued: > 26924 004035'03 104 00 0 00 000076 26925 004036'03 320 12 0 00 004037' 26926 000451'02 000000000000# 26927 002007'04 015 012 040 040 123 26928 004037'03 201 01 0 00 000101 numout vsict ; Virtual Terminal SIN% Count 26929 004040'03 200 02 0 00 004032* 26930 004041'03 201 03 0 00 000012 26931 004042'03 104 00 0 00 000224 26932 004043'03 320 14 0 00 004044' 26933 txmsg < 26934 004044'03 200 01 0 00 000000# SIN% Bytes Total: > 26935 004045'03 104 00 0 00 000076 26936 004046'03 320 12 0 00 004047' 26937 000452'02 000000000000# 26938 002014'04 015 012 040 040 123 26939 004047'03 201 01 0 00 000101 numout vsitc ; Virtual Terminal total characters SIN%'ed 26940 004050'03 200 02 0 00 000000* 26941 004051'03 201 03 0 00 000012 26942 004052'03 104 00 0 00 000224 26943 004053'03 320 14 0 00 004054' 26944 txmsg < 26945 004054'03 200 01 0 00 000000# Max SIN% Length: > 26946 004055'03 104 00 0 00 000076 26947 004056'03 320 12 0 00 004057' 26948 000453'02 000000000000# 26949 002021'04 015 012 040 040 115 26950 004057'03 201 01 0 00 000101 numout vsimx ; Maximum length SIN% ever did 26951 004060'03 200 02 0 00 000000* 26952 004061'03 201 03 0 00 000012 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-2 K20DSP MAC 20-Aug-24 23:41 Display information concerning line performance 26953 004062'03 104 00 0 00 000224 26954 004063'03 320 14 0 00 004064' 26955 004064'03 endif. 26956 26957 004064'03 336 00 0 00 000000* ifmn. vsoct 26958 004065'03 254 00 0 00 004116' 26959 txmsg < 26960 004066'03 200 01 0 00 000000# SOUTR%'s Issued: > 26961 004067'03 104 00 0 00 000076 26962 004070'03 320 12 0 00 004071' 26963 000454'02 000000000000# 26964 002026'04 015 012 040 040 123 26965 004071'03 201 01 0 00 000101 numout vsoct ; Virtual Terminal SOUTR% Count 26966 004072'03 200 02 0 00 004064* 26967 004073'03 201 03 0 00 000012 26968 004074'03 104 00 0 00 000224 26969 004075'03 320 14 0 00 004076' 26970 txmsg < 26971 004076'03 200 01 0 00 000000# SOUTR% Bytes: > 26972 004077'03 104 00 0 00 000076 26973 004100'03 320 12 0 00 004101' 26974 000455'02 000000000000# 26975 002033'04 015 012 040 040 123 26976 004101'03 201 01 0 00 000101 numout vsotc ; Virtual Terminal SOUTR% Bytes Total 26977 004102'03 200 02 0 00 000000* 26978 004103'03 201 03 0 00 000012 26979 004104'03 104 00 0 00 000224 26980 004105'03 320 14 0 00 004106' 26981 txmsg < 26982 004106'03 200 01 0 00 000000# Max SOUTR% Len: > 26983 004107'03 104 00 0 00 000076 26984 004110'03 320 12 0 00 004111' 26985 000456'02 000000000000# 26986 002040'04 015 012 040 040 115 26987 004111'03 201 01 0 00 000101 numout vsomx ; Virtual Terminal SOUTR% Maximum length 26988 004112'03 200 02 0 00 000000* 26989 004113'03 201 03 0 00 000012 26990 004114'03 104 00 0 00 000224 26991 004115'03 320 14 0 00 004116' 26992 004116'03 endif. 26993 26994 remark ; Network input fork updates these 26995 004116'03 336 00 0 00 002032* ifmn. nbict ; Did any network input? 26996 004117'03 254 00 0 00 004160' 26997 txmsg < 26998 004120'03 200 01 0 00 000000# Network BIN%'s: > 26999 004121'03 104 00 0 00 000076 27000 004122'03 320 12 0 00 004123' 27001 000457'02 000000000000# 27002 002045'04 015 012 040 040 116 27003 004123'03 201 01 0 00 000101 numout nbict ; Network BIN% count 27004 004124'03 200 02 0 00 004116* 27005 004125'03 201 03 0 00 000012 27006 004126'03 104 00 0 00 000224 27007 004127'03 320 14 0 00 004130' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-3 K20DSP MAC 20-Aug-24 23:41 Display information concerning line performance 27008 txmsg < 27009 004130'03 200 01 0 00 000000# Network SIN%'s: > 27010 004131'03 104 00 0 00 000076 27011 004132'03 320 12 0 00 004133' 27012 000460'02 000000000000# 27013 002052'04 015 012 040 040 116 27014 004133'03 201 01 0 00 000101 numout nsici ; Network SIN%'s Issued 27015 004134'03 200 02 0 00 000000* 27016 004135'03 201 03 0 00 000012 27017 004136'03 104 00 0 00 000224 27018 004137'03 320 14 0 00 004140' 27019 txmsg < 27020 004140'03 200 01 0 00 000000# Network SIN% Cnt: > 27021 004141'03 104 00 0 00 000076 27022 004142'03 320 12 0 00 004143' 27023 000461'02 000000000000# 27024 002057'04 015 012 040 040 116 27025 004143'03 201 01 0 00 000101 numout nsitc ; Network SIN% total characters 27026 004144'03 200 02 0 00 000000* 27027 004145'03 201 03 0 00 000012 27028 004146'03 104 00 0 00 000224 27029 004147'03 320 14 0 00 004150' 27030 txmsg < 27031 004150'03 200 01 0 00 000000# Network SIN% Max: > 27032 004151'03 104 00 0 00 000076 27033 004152'03 320 12 0 00 004153' 27034 000462'02 000000000000# 27035 002064'04 015 012 040 040 116 27036 004153'03 201 01 0 00 000101 numout nsimx ; Network SIN% maximum length 27037 004154'03 200 02 0 00 000000* 27038 004155'03 201 03 0 00 000012 27039 004156'03 104 00 0 00 000224 27040 004157'03 320 14 0 00 004160' 27041 004160'03 endif. 27042 27043 004160'03 263 17 0 00 000000 ret 27044 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20DSP MAC 20-Aug-24 23:41 ifcrlf -- maybe type a carriage return line feed 27045 subttl ifcrlf -- maybe type a carriage return line feed 27046 27047 ; Call: t1/ Updated point of PSOUT%'ed macro body 27048 ; 27049 ; [194] fixed a case of a macro not being terminated with a carriage 27050 ; return. This is unlikely, but could happen. That being the 27051 ; the case, when displaying the macros, we now have to check to 27052 ; see if we need to print a crlf. 27053 27054 004161'03 ifcrlf: entry ifcrlf ; Inform LINK of our location 27055 remark t1, t2 ; Smashes these 27056 004161'03 265 16 0 00 005035' saveac ; Holds counter and pointers!! 27057 ; Last three characters should be 27058 remark .chcrt, .chlfd, .chnul 27059 004162'03 211 02 0 00 000003 movni t2, ^d3 ; Check the end of the macro string 27060 004163'03 133 02 0 00 000001 adjbp t2, t1 ; May not have a CRLF ... 27061 004164'03 134 03 0 00 000002 ildb t3, t2 ; Pick up penultimate character 27062 004165'03 134 04 0 00 000002 ildb t4, t2 ; Pick up last character 27063 27064 004166'03 306 03 0 00 000015 cain t3, .chcrt ; Did they tie off the line? 27065 004167'03 254 00 0 00 004174' ifskp. ; Apparently not 27066 004170'03 306 04 0 00 000015 cain t4, .chcrt ; Unless they did it backwards 27067 004171'03 254 00 0 00 004174' anskp. ; Odd, but be happy... 27068 004172'03 201 01 0 00 000015 movei t1, .chcrt ; Otherwise, do the carriage return 27069 004173'03 104 00 0 00 000074 PBOUT% 27070 004174'03 endif. 27071 27072 004174'03 306 04 0 00 000012 cain t4, .chlfd ; Did they scroll the carriage? 27073 004175'03 254 00 0 00 004202' ifskp. ; Perhaps not 27074 004176'03 306 03 0 00 000012 cain t3, .chlfd ; Unless they did it backwards 27075 004177'03 254 00 0 00 004202' anskp. ; Odd, but be happy ... 27076 004200'03 201 01 0 00 000012 movei t1, .chlfd ; Otherwise, do the line feed 27077 004201'03 104 00 0 00 000074 PBOUT% 27078 004202'03 endif. 27079 27080 004202'03 263 17 0 00 000000 ret 27081 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20DSP MAC 20-Aug-24 23:41 PUTC -- Print a single character, using ^X notation, DEL, etc. 27082 subttl PUTC -- Print a single character, using ^X notation, DEL, etc. 27083 27084 ; Call with t1/ character to print. 27085 ; 27086 ;[223] Modifies no registers 27087 27088 004203'03 putc: entry putc ;[194] Inform LINK of our location 27089 004203'03 261 17 0 00 000001 push p, t1 ;[223] Save the character 27090 004204'03 405 01 0 00 000177 andi t1, ^o177 ;[223] Stomp the parity 27091 27092 004205'03 302 01 0 00 000177 caie t1, .chdel ;[194] A rubout? 27093 004206'03 254 00 0 00 004216' ifskp. ;[194] It is 27094 004207'03 261 17 0 00 000002 push p, t2 ;[194] Don't bump into anything 27095 004210'03 200 01 0 00 000000# txmsg ;[194] type this 27096 004211'03 104 00 0 00 000076 27097 004212'03 320 12 0 00 004213' 27098 000463'02 000000000000# 27099 002071'04 104 105 114 000 000 27100 004213'03 262 17 0 00 000002 pop p, t2 ;[194] Restore in case somebody cared 27101 004214'03 262 17 0 00 000001 pop p, t1 ;[223] Restore the original character 27102 004215'03 263 17 0 00 000000 ret 27103 004216'03 endif. ;[194] 27104 27105 004216'03 301 01 0 00 000040 cail t1, .chspc ;[194] Is it a control char? 27106 004217'03 254 00 0 00 004225' ifskp. ;[194] It is 27107 004220'03 261 17 0 00 000001 push p, t1 ; Save the char. 27108 004221'03 201 01 0 00 000136 movei t1, "^" ; Get the control quote. 27109 004222'03 104 00 0 00 000074 PBOUT% 27110 004223'03 262 17 0 00 000001 pop p, t1 27111 004224'03 435 01 0 00 000100 ori t1, ^o100 ; Turn on the non-control bit. 27112 004225'03 endif. ;[194] 27113 27114 004225'03 104 00 0 00 000074 PBOUT% 27115 004226'03 262 17 0 00 000001 pop p, t1 ;[223] Restore the original character 27116 004227'03 263 17 0 00 000000 ret 27117 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20DSP MAC 20-Aug-24 23:41 display a specific character in t2 27118 subttl display a specific character in t2 27119 27120 004230'03 405 02 0 00 000177 dspchr: andi t2, 177 ;[258] Strip off any parity 27121 004231'03 302 02 0 00 000177 caie t2, .chdel ;[258] A rubout? 27122 004232'03 254 00 0 00 004236' ifskp. ;[258] Yes, quotes around that look silly 27123 004233'03 201 01 0 00 000177 movei t1, .chdel ;[258] Load the rubout 27124 004234'03 260 17 0 00 004203' call putc ;[258] Special case, type that 27125 004235'03 254 00 0 00 004266' else. ;[258] Otherwise, do some beautification 27126 004236'03 201 03 0 00 000042 movei t3, .chdbq ;[258] Assume a double quote 27127 004237'03 306 02 0 00 000042 cain t2, .chdbq ;[258] BUT!! Is it a double quote? 27128 004240'03 201 03 0 00 000047 movei t3, .chsnq ;[258] Use a single quote (less confusing) 27129 004241'03 200 01 0 00 000003 move t1, t3 ;[258] Finally load whatever we're using 27130 004242'03 104 00 0 00 000074 PBOUT% ;[258] Type it 27131 004243'03 320 12 0 00 004244' erjmpr .+1 ;[258] Catch and ignore error 27132 004244'03 200 01 0 00 000002 move t1, t2 ;[258] Load substitution character again 27133 004245'03 260 17 0 00 004203' call putc ;[258] Pretty print it 27134 004246'03 200 01 0 00 000003 move t1, t3 ;[258] Load the selected quoting character 27135 004247'03 104 00 0 00 000074 PBOUT% ;[258] Type it 27136 004250'03 320 12 0 00 004251' erjmpr .+1 ;[258] Catch and ignore error 27137 004251'03 201 01 0 00 000040 movei t1, .chspc ;[258] Space over 27138 004252'03 104 00 0 00 000074 PBOUT% ;[258] Type it 27139 004253'03 320 12 0 00 004254' erjmpr .+1 ;[258] Catch and ignore error 27140 004254'03 201 01 0 00 000050 movei t1, .chlpa ;[258] Left parenthesis 27141 004255'03 104 00 0 00 000074 PBOUT% ;[258] Type it 27142 004256'03 320 12 0 00 004257' erjmpr .+1 ;[258] Catch and ignore error 27143 004257'03 201 01 0 00 000101 movei t1, .priou ;[258] Continue to type on the terminal 27144 004260'03 201 03 0 00 000010 movei t3, ^d8 ;[258] List the character in octal 27145 004261'03 104 00 0 00 000224 NOUT% ;[258] Give numeric value 27146 004262'03 320 12 0 00 004263' erjmpr .+1 ;[258] Catch and ignore error 27147 004263'03 201 01 0 00 000051 movei t1, .chrpa ;[258] Right parenthesis 27148 004264'03 104 00 0 00 000074 PBOUT% ;[258] Type it 27149 004265'03 320 12 0 00 004266' erjmpr .+1 ;[258] Catch and ignore error 27150 004266'03 endif. ;[258] End case runout special case 27151 004266'03 263 17 0 00 000000 ret ;[266] 27152 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20DSP MAC 20-Aug-24 23:41 show a line's characteristics 27153 subttl show a line's characteristics 27154 27155 ; Says some interesting things about the line that is passed in t1 27156 ; 27157 ; Such information does not effect the protocol, per se. It is rather 27158 ; used for debugging and as part of a heuristic as to what kind of 27159 ; performance could be expected. As there are a rather large number 27160 ; of other factors that can impact performance, what is displayed can 27161 ; in no way be assumed to be determinative. 27162 ; 27163 ; All part of 186, plus some 223 flavoring 27164 27165 ;[223] Line type names 27166 27167 chgsec(code,const) ;[223] Table goes in const psect 27168 000464'02 000000000000# ltname: cascii() ;[223] NW%UND Undefined 27169 002072'04 125 156 144 145 146 27170 000465'02 000000000000# cascii() ;[223] NW%FW Front end (RSX-20F) 27171 002074'04 106 105 000 000 000 27172 000466'02 000000000000# cascii() ;[223] NW%PT Pseudo-terminal 27173 002075'04 120 124 131 000 000 27174 000467'02 000000000000# cascii() ;[223] NW%MC Network Remote Terminal (MCB) 27175 002076'04 116 122 124 000 000 27176 000470'02 000000000000# cascii() ;[223] NW%TV Telnet Virtual Terminal 27177 002077'04 124 126 124 000 000 27178 000471'02 000000000000# cascii() ;[223] NW%CH CTERM 27179 002100'04 103 124 105 122 115 27180 000472'02 000000000000# cascii() ;[223] NW%LH Local Area Terminal 27181 002102'04 114 101 124 000 000 27182 000473'02 ltneot: remark ;[223] Mark end of table 27183 000007 nw%mx== ;[223] Maximum type 27184 retsec ;[223] Back into code 27185 cleans() ;[223] 27186 27187 ; Call: 27188 ; 27189 ; t1/ Network Type 27190 ; t2/ Line Type 27191 ; t3/ Line number 27192 27193 extern lclpar ;[223] Whether local line will do parity 27194 extern opnpar ;[223] Whether open device will do parity 27195 27196 004267'03 265 16 0 00 005045' linchr: saveac 27197 ;[223] Does not overwrite any register 27198 004270'03 200 05 0 00 000003 move q1, t3 ;[223] Save line number 27199 004271'03 301 02 0 00 000000 cail t2, 0 ;[223] Negative line type? 27200 004272'03 301 02 0 00 000007 cail t2, nw%mx ;[223] or over the maximum? 27201 004273'03 400 02 0 00 000000 setz t2, ;[223] Yes to either, reset to NW%UND 27202 004274'03 120 06 0 00 000001 dmove q2, t1 ;[223] Store network and line type 27203 27204 004275'03 326 07 0 00 004306' ife. q3 ;[223] Undefined line type? (NW%UND) 27205 txmsg < 27206 004276'03 200 01 0 00 000000# Unknown Line: > ; So do error blat 27207 004277'03 104 00 0 00 000076 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41-1 K20DSP MAC 20-Aug-24 23:41 show a line's characteristics 27208 004300'03 320 12 0 00 004301' 27209 000473'02 000000000000# 27210 002103'04 015 012 040 125 156 27211 004301'03 201 01 0 00 000101 numout q1, ^d8 ; Type whatever we did get passed 27212 004302'03 200 02 0 00 000005 27213 004303'03 201 03 0 00 000010 27214 004304'03 104 00 0 00 000224 27215 004305'03 320 14 0 00 004306' 27216 004306'03 endif. ;[223] Try the rest of it 27217 27218 txmsg < 27219 004306'03 200 01 0 00 000000# Controlling Type: > 27220 004307'03 104 00 0 00 000076 27221 004310'03 320 12 0 00 004311' 27222 000474'02 000000000000# 27223 002110'04 015 012 040 040 103 27224 004311'03 200 01 0 07 000000# move t1, ltname(q3) ;[223] Pick up address of the correct string 27225 004312'03 104 00 0 00 000076 PSOUT% ;[223] And type it 27226 004313'03 320 12 0 00 004314' erjmpr .+1 27227 27228 004314'03 200 04 0 00 000000* move t4, lclpar ;[223] Assume we're doing the controlling terminal 27229 004315'03 312 05 0 00 001521* came q1, mytty ;[223] BUT!! Is this the controlling terminal? 27230 004316'03 200 04 0 00 000000* move t4, opnpar ;[223] Parity tolerated will be set by k20net 27231 004317'03 322 04 0 00 004323' ifn. t4 ;[223] So, does the thing do parity? 27232 004320'03 200 01 0 00 000000# txmsg < [Parity]> ;[223] Yes, somebody will generate it, if asked 27233 004321'03 104 00 0 00 000076 27234 004322'03 320 12 0 00 004323' 27235 000475'02 000000000000# 27236 002115'04 040 133 120 141 162 27237 004323'03 endif. ;[223] Otherwise, nothing to say 27238 27239 004323'03 260 17 0 00 001052' call prntbd ;[210] Print some kind of baud rate, maybe 27240 27241 004324'03 302 07 0 00 000004 caie q3, nw%tv ;[223] A TCP Virtual Terminal (TVT)? 27242 004325'03 254 00 0 00 004366' ifskp. ;[223] Yes, then let's display those specifics 27243 004326'03 336 00 0 00 000000* skipn tvtflg ;[271] Let's just double check; we're on a TVT, right? 27244 004327'03 254 00 0 00 004366' anskp. ;[271] No, let's not confuse the user 27245 txmsg < 27246 004330'03 200 01 0 00 000000# TVT Negotiate: > ;[182] ARPAnet TVT discovery 27247 004331'03 104 00 0 00 000076 27248 004332'03 320 12 0 00 004333' 27249 000476'02 000000000000# 27250 002117'04 015 012 040 040 124 27251 004333'03 332 00 0 00 000000* ifme. tvtchk ;[271] Not doing it? 27252 004334'03 254 00 0 00 004341' 27253 004335'03 200 01 0 00 000000# txmsg ;[271] Will not negotiate 27254 004336'03 104 00 0 00 000076 27255 004337'03 320 12 0 00 004340' 27256 000477'02 000000000000# 27257 002124'04 117 166 145 162 162 27258 004340'03 254 00 0 00 004344' else. ;[271] No, will try to negotiate it somehow 27259 004341'03 200 01 0 00 000000# txmsg ;[271] Which we must have for 8 bit transfers 27260 004342'03 104 00 0 00 000076 27261 004343'03 320 12 0 00 004344' 27262 000500'02 000000000000# k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41-2 K20DSP MAC 20-Aug-24 23:41 show a line's characteristics 27263 002126'04 101 165 164 157 155 27264 004344'03 endif. ;[271] 27265 txmsg < 27266 004344'03 200 01 0 00 000000# TVT Binary: > ;[271] ARPAnet TVT binary mode whether forced or not 27267 004345'03 104 00 0 00 000076 27268 004346'03 320 12 0 00 004347' 27269 000501'02 000000000000# 27270 002130'04 015 012 040 040 124 27271 004347'03 336 00 0 00 000000* ifmn. tvtunk ;[271] Do we know it, yet? 27272 004350'03 254 00 0 00 004355' 27273 004351'03 200 01 0 00 000000# txmsg <*Unknown> ;[271] No, so can't say anything about it 27274 004352'03 104 00 0 00 000076 27275 004353'03 320 12 0 00 004354' 27276 000502'02 000000000000# 27277 002134'04 052 125 156 153 156 27278 004354'03 254 00 0 00 004366' else. ;[271] Otherwise, either know it or forcing it 27279 004355'03 332 00 0 00 000000* ifme. tvtbin ;[271] Not using it or forcing it off? 27280 004356'03 254 00 0 00 004363' 27281 004357'03 200 01 0 00 000000# txmsg < Off> ;[271] No, this may break 8 bit transfers 27282 004360'03 104 00 0 00 000076 27283 004361'03 320 12 0 00 004362' 27284 000503'02 000000000000# 27285 002136'04 040 117 146 146 000 27286 004362'03 254 00 0 00 004366' else. ;[271] Otherwise, using it or forcing it on? 27287 004363'03 200 01 0 00 000000# txmsg < On> ;[271] Which we must have for 8 bit transfers 27288 004364'03 104 00 0 00 000076 27289 004365'03 320 12 0 00 004366' 27290 000504'02 000000000000# 27291 002137'04 040 117 156 000 000 27292 004366'03 endif. ;[271] End case binary usage decision 27293 004366'03 endif. ;[271] End case TVT knowledge check 27294 004366'03 endif. ;[223] End case TCP Virtual Terminal 27295 27296 004366'03 200 01 0 00 000005 move t1, q1 ; Load line number 27297 004367'03 660 01 0 00 400000 txo t1, .ttdes ; Turn into a terminal designator (if not already one) 27298 004370'03 104 00 0 00 000303 GTTYP% ; Odd that buffers are returned here... 27299 004371'03 320 12 0 00 004373' %jsErr (,r) 27300 004372'03 254 00 0 00 004376' 27301 004373'03 265 01 0 00 002436* 27302 004374'03 000000000000# 27303 004375'03 254 00 0 00 003661* 27304 002140'04 125 156 141 142 154 27305 004376'03 200 04 0 00 000003 move t4, t3 ; Get the buffer counts out of the way 27306 27307 txmsg < 27308 004377'03 200 01 0 00 000000# Input Buffers: > ; Present the input buffer count 27309 004400'03 104 00 0 00 000076 27310 004401'03 320 12 0 00 004402' 27311 000505'02 000000000000# 27312 002150'04 015 012 040 040 111 27313 004402'03 201 01 0 00 000101 movei t1, .priou ; On the terminal 27314 004403'03 554 02 0 00 000004 hlrz t2, t4 ; Load input buffer count 27315 004404'03 201 03 0 00 000012 movei t3, ^d10 ; Is in base ten 27316 004405'03 104 00 0 00 000224 NOUT% 27317 004406'03 320 12 0 00 004410' %jsErr (,) k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41-3 K20DSP MAC 20-Aug-24 23:41 show a line's characteristics 27318 004407'03 254 00 0 00 004413' 27319 004410'03 265 01 0 00 004373* 27320 004411'03 000000000000# 27321 004412'03 254 00 0 00 004413' 27322 002155'04 125 156 141 142 154 27323 27324 txmsg < 27325 004413'03 200 01 0 00 000000# Output Buffers: > ; Present the output buffer count 27326 004414'03 104 00 0 00 000076 27327 004415'03 320 12 0 00 004416' 27328 000506'02 000000000000# 27329 002167'04 015 012 040 040 117 27330 004416'03 201 01 0 00 000101 movei t1, .priou ; On the terminal 27331 004417'03 550 02 0 00 000004 hrrz t2,t4 ; Load output buffer count 27332 004420'03 201 03 0 00 000012 movei t3, ^d10 ; Is in base ten 27333 004421'03 104 00 0 00 000224 NOUT% 27334 004422'03 320 12 0 00 004424' %jsErr (,) 27335 004423'03 254 00 0 00 004427' 27336 004424'03 265 01 0 00 004410* 27337 004425'03 000000000000# 27338 004426'03 254 00 0 00 004427' 27339 002174'04 125 156 141 142 154 27340 27341 004427'03 263 17 0 00 000000 ret 27342 27343 cleans() 27344 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20DSP MAC 20-Aug-24 23:41 Print Efficiency Factor 27345 subttl Print Efficiency Factor 27346 27347 ; Overhead calculations 27348 ; 27349 ; T1/ Output JFN or pointer, sacred 27350 ; T2/ Total characters in file(s) 27351 ; T3/ Total characters transferred, every single one 27352 ; 27353 ; In other words, t3 has what was necessary to communicate t2 27354 ; 27355 ; A factor over 1, how much compression is winning you 27356 ; under 1, how much the prefixing is costing you 27357 ; 27358 ; Describe various totals kept for $stat 27359 ; 27360 ; stot - total characters sent, including everything 27361 ; stchr - total characters all files 27362 ; rtot - total characters received, every single one of them 27363 ; rtchr - total characters all files 27364 ; 27365 ; Question, do we really need DOUBLE floating point? fltr will 'only' 27366 ; lose precision for a communications or combined file character total 27367 ; that is greater than 134,217,728 (2**27). 27368 ; 27369 ; This would be a file in excess of 52,429 pages, which is over 2/3's 27370 ; of an RP06. Even if some transfers happened over weekends, it is 27371 ; doubtful that this much data could have been sent--it was more 27372 ; common to just send a magnetic tape. Besides, disk space was 27373 ; EXPENSIVE. If you could afford the platters, you could certainly 27374 ; afford the cost of a tape, the tape mount, the mount time and the 27375 ; postage. 27376 ; 27377 ; Disk space is now effectively free, most structures being double 27378 ; RP07's, having a (then) gargantuan storage capability of over a 27379 ; gigabyte of ASCII text. However, since Kermit speeds are now in 27380 ; the megabyte range, a transfer of multiple large files could 27381 ; exceed 35 bit integer precision. This is certainly possibly if 27382 ; you are using your 20 to store .jpeg's or digital audio. 27383 27384 extern dfloat ; In k20sub (originally from eftpsa) 27385 27386 004430'03 265 16 0 00 004755' peffif: saveac ; Don't touch other temporaries 27387 ; First handle some simple cases 27388 004431'03 327 02 0 00 004435' ifle. t2 ; Is this a zero length file (or balony?) 27389 004432'03 120 02 0 00 000000# smsg <[100% Overhead]> ;Make it stand out 27390 004433'03 260 17 0 00 001050* 27391 000507'02 000000000000# 27392 000510'02 777777 777761 27393 002206'04 133 061 060 060 045 27394 004434'03 263 17 0 00 000000 ret ; That was easy ... 27395 004435'03 endif. 27396 ; Have a non-zero length file here? 27397 004435'03 326 03 0 00 004441' ife. t3 ; Zero length file (like NUL:)? 27398 004436'03 120 02 0 00 000000# smsg <[ZERO]> ; Make it stand out 27399 004437'03 260 17 0 00 004433* k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42-1 K20DSP MAC 20-Aug-24 23:41 Print Efficiency Factor 27400 000511'02 000000000000# 27401 000512'02 777777 777772 27402 002212'04 133 132 105 122 117 27403 004440'03 263 17 0 00 000000 ret ; That was easy ... 27404 004441'03 endif. 27405 27406 004441'03 325 03 0 00 004445' ifl. t3 ; Impossible communications count? 27407 004442'03 120 02 0 00 000000# smsg <[ERROR]> ; Make it stand out 27408 004443'03 260 17 0 00 004437* 27409 000513'02 000000000000# 27410 000514'02 777777 777771 27411 002214'04 133 105 122 122 117 27412 004444'03 263 17 0 00 000000 ret ; That was easy ... 27413 004445'03 endif. 27414 ; Guess we have some real work to do 27415 004445'03 415 16 0 00 004467' block. ; Set up a stack frame for easier return 27416 004446'03 261 17 0 00 000016 27417 004447'03 265 16 0 00 005063' saveac ; Preserve some more registers 27418 remark t1,t2,t3,t4,t5 ; Can use these for this block 27419 004450'03 200 05 0 00 000002 move t5, t2 ; Save total characters in files 27420 004451'03 400 01 0 00 000000 setz t1, ; No integer high order 27421 004452'03 200 02 0 00 000003 move t2, t3 ; Load total characters communicated 27422 004453'03 260 17 0 00 001027* call dfloat ; Double float the double integer 27423 004454'03 263 17 0 00 000000 ret ; But couldn't 27424 004455'03 250 02 0 00 000005 exch t2, t5 ; Store floating low order and restore 27425 004456'03 200 04 0 00 000001 move t4, t1 ; Store floating high order 27426 004457'03 400 01 0 00 000000 setz t1, ; No integer high order 27427 004460'03 260 17 0 00 004453* call dfloat ; Double float the double integer 27428 004461'03 263 17 0 00 000000 ret ; But couldn't 27429 004462'03 200 03 0 00 000002 move t3, t2 ; Reposition low order 27430 004463'03 200 02 0 00 000001 move t2, t1 ; Reposition high order 27431 004464'03 113 02 0 00 000004 dfdv t2,t4 ; Divide extremely slowly 27432 004465'03 254 00 0 00 001434* retskp ; Win 27433 004466'03 263 17 0 00 000000 endbk. ; End block context, restore registers 27434 004467'03 263 17 0 00 000000 ret ; Passing any error up 27435 27436 004470'03 200 04 0 00 000000# peffi0: move t4,fmcntl ; Load format control 27437 004471'03 104 00 0 00 000235 DFOUT% ; Show us a nice number 27438 004472'03 320 14 0 00 004473' erjmps .+1 ; Don't touch precious t1!! 27439 27440 004473'03 316 04 0 00 000000# camn t4,fmcntl ; Overwritten with error? 27441 004474'03 263 17 0 00 000000 ret ; Nope, we're fine 27442 004475'03 334 00 0 00 000000 %ermsg (,r) 27443 004476'03 254 00 0 00 004502' 27444 004477'03 265 01 0 00 004424* 27445 004500'03 000000000000# 27446 004501'03 254 00 0 00 004375* 27447 002216'04 125 156 141 142 154 27448 004502'03 263 17 0 00 000000 ret ; Finally done 27449 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20DSP MAC 20-Aug-24 23:41 Define hairy DFOUT% control word 27450 subttl Define hairy DFOUT% control word 27451 27452 000000 fmcntw==0 ; Initialize format control word 27453 27454 define blcntl (value,field,format) < 27455 ifnb , 27456 ifb , 27457 > 27458 27459 blcntl(.fldig,fl%sgn) ;;Sign control is start with a digit 27460 blcntl(.fllsp,fl%jus) ;;Justification is leading spaces 27461 blcntl(fl%one) ;;Output at least one digit, even if zero 27462 blcntl(fl%pnt) ;;Always print a decimal point 27463 blcntl(.flexn,fl%exp) ;;No exponent (too confusing) 27464 blcntl(fl%ovl) ;;Output any overflow 27465 blcntl(-1,fl%rnd) ;;Don't do any rounding 27466 blcntl(^d4,fl%fst) ;;Allow 9,999 improvement 27467 blcntl(^d4,fl%snd) ;;Allow .0001 degradation 27468 27469 chgsec(code,const) ;;This is a constant 27470 000515'02 024137 040400 fmcntl: fmcntw ; Final control word 27471 retsec ;;Back to previous .PSECT 27472 27473 if2 < purge blcntl > ;;Not needed after pass 2 27474 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20DSP MAC 20-Aug-24 23:41 Calculate Giga, Mega, Kilo character rate 27475 subttl Calculate Giga, Mega, Kilo character rate 27476 27477 ; Uses double floating point to print a more readable, accurate byte rate. 27478 ; 27479 ; t3/ Total characters sent or received 27480 ; 27481 ; +1 - Some odd thing happened 27482 ; +2 - The math worked, at least 27483 27484 extern dblcal ; Found with other math routines in k20tim 27485 27486 004503'03 gmkcps: entry gmkcps ;[267] Also used in k20ioc 27487 004503'03 265 16 0 00 005075' saveac ; Need some more scratch 27488 27489 004504'03 415 16 0 00 004515' block. ;[207] Enter block context for better control flow 27490 004505'03 261 17 0 00 000016 27491 004506'03 265 16 0 00 004656' saveac ;[207] Used for DK10 double word 27492 004507'03 201 05 0 00 000471* movei q1, ewallt ;[207] Construct pointer to elapsed wall time 27493 004510'03 201 02 0 05 000017 movei t2, .datus(q1) ;[207] Load pointer to DK10 double word 27494 004511'03 120 03 0 02 000000 dmove t3, (t2) ;[207] Load DK10 tick wall time 27495 004512'03 327 03 0 00 004465* jumpg t3, RSKP ;[207] Non-zero high order is OK 27496 004513'03 327 04 0 00 004512* jumpg t4, RSKP ;[207] Ditto low order 27497 004514'03 263 17 0 00 000000 endbk. ;[207] End block context, restore registers 27498 004515'03 263 17 0 00 000000 ret ;[207] Zero ticks?? Uh, forget it 27499 004516'03 260 17 0 00 000000* call dblcal ; Calculate double floating character rate 27500 004517'03 263 17 0 00 000000 ret ; Failed 27501 004520'03 260 17 0 00 004551' call ranger ; Put result into kilo, mega or giga range 27502 004521'03 260 17 0 00 004470' call peffi0 ; Type it 27503 004522'03 260 17 0 00 004605' call chrsfx ; Puts in the right character suffix 27504 27505 004523'03 254 00 0 00 004513* retskp ; Worked!! 27506 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20DSP MAC 20-Aug-24 23:41 Calculate Giga, Mega, Kilo baud rate 27507 subttl Calculate Giga, Mega, Kilo baud rate 27508 27509 ; Uses double floating point to print a more readable, accurate byte rate. 27510 ; 27511 ; t3/ Total characters sent or received 27512 27513 ; t4/ High order floating point bit rate (unranged) 27514 ; t5/ Low order, ditto 27515 27516 004524'03 204500 000000 baud: exp 10. ; Assume ten bits per character 27517 004525'03 000000 000000 0 ; Which is not valid for 110 baud 27518 27519 004526'03 gmkbps: extern dblcal ; Found with math routines in k20sub 27520 004526'03 265 16 0 00 005075' saveac ; Need some more scratch 27521 27522 004527'03 415 16 0 00 004537' block. ;[207] Enter block context for better control flow 27523 004530'03 261 17 0 00 000016 27524 004531'03 265 16 0 00 005035' saveac ;[207] Used for DK10 double word 27525 004532'03 201 02 0 00 000000# movei t2,.datus+ewallt;[207] Construct pointer to elapsed DK10 tick wall time 27526 004533'03 120 03 0 02 000000 dmove t3, (t2) ;[207] Load DK10 tick wall time 27527 004534'03 327 03 0 00 004523* jumpg t3, RSKP ;[207] Non-zero high order is OK 27528 004535'03 327 04 0 00 004534* jumpg t4, RSKP ;[207] Ditto low order 27529 004536'03 263 17 0 00 000000 endbk. ;[207] End block context, restore registers 27530 004537'03 263 17 0 00 000000 ret ;[207] Zero ticks?? Uh, forget it 27531 27532 004540'03 260 17 0 00 004516* call dblcal ; Calculate double floating character rate 27533 004541'03 263 17 0 00 000000 ret ; Failed 27534 004542'03 112 04 0 00 004524' dfmp t4, baud ; Scale to baud rate 27535 27536 004543'03 gmkbp1: remark ; Common exit epilogue 27537 004543'03 260 17 0 00 004551' call ranger ; Put result into kilo, mega or giga range 27538 004544'03 260 17 0 00 004470' call peffi0 ; Type it 27539 004545'03 260 17 0 00 004615' call baudsf ; Puts in the right suffix 27540 27541 004546'03 263 17 0 00 000000 ret 27542 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20DSP MAC 20-Aug-24 23:41 Put result into kilo, mega, giga or tera range 27543 subttl Put result into kilo, mega, giga or tera range 27544 27545 ; Call: 27546 ; 27547 ; t1/ Output designator, unused, but preserved, anyway 27548 ; t4/ High order floating point bit rate (unranged) 27549 ; t5/ Low order, ditto 27550 ; 27551 ; Returns: +1, always 27552 ; 27553 ; t1/ Unmodified output designator 27554 ; t2/ High order, possibly ranged 27555 ; t3/ Low order, ditto 27556 ; t5/ Rate prefix (K, M, G, T), if any 27557 ; 27558 ; N.B., Since we are checking for less than 1,024 in the high 27559 ; order. It is unnecessary to compare the low order word, 27560 ; so we can bum a DCAM. 27561 ; 27562 ; A 'T' prefix means terabaud and is probably either wrong or 27563 ; otherwise delusional in some way. It should be doubted. 27564 27565 004547'03 213400 000000 kilo: 1024. ; Used for ranging (floating!!!) 27566 004550'03 000000 000000 0 ; Also used as double floating divisor 27567 27568 004551'03 265 16 0 00 004744' ranger: saveac ; Let's just leave that alone 27569 004552'03 311 04 0 00 004547' caml t4,kilo ; Into kilobaud already?? 27570 004553'03 254 00 0 00 004557' ifskp. ; Nope, not even, so not much to do, then 27571 004554'03 120 02 0 00 000004 dmove t2,t4 ; Load puny hundreds of baud rate (yech) 27572 004555'03 400 05 0 00 000000 setz t5, ; Not even a prefix character, sniff 27573 004556'03 263 17 0 00 000000 ret ; Well, that was easy 27574 004557'03 endif. ; Otherwise, at least in kilobaud 27575 27576 004557'03 113 04 0 00 004547' dfdv t4,kilo ; Reduce by ten orders of binary magnitude 27577 004560'03 311 04 0 00 004547' caml t4,kilo ; Into Megabaud? 27578 004561'03 254 00 0 00 004565' ifskp. ; No, but respectable anyway (or used to be) 27579 004562'03 120 02 0 00 000004 dmove t2,t4 ; Load kilobaud rate 27580 004563'03 201 05 0 00 000113 movei t5,"K" ; Load the Kilobaud prefix 27581 004564'03 263 17 0 00 000000 ret ; Return kilo or greater, but less than mega 27582 004565'03 endif. ; Otherwise, at least in megabaud 27583 27584 004565'03 113 04 0 00 004547' dfdv t4,kilo ; Reduce by ten orders of binary magnitude 27585 004566'03 311 04 0 00 004547' caml t4,kilo ; Into Gigabaud? 27586 004567'03 254 00 0 00 004573' ifskp. ; No, but at NI/CI speeds! 27587 004570'03 120 02 0 00 000004 dmove t2,t4 ; Load Megabaud rate 27588 004571'03 201 05 0 00 000115 movei t5,"M" ; Load the Megabaud prefix 27589 004572'03 263 17 0 00 000000 ret ; Return mega or greater, but less than giga 27590 004573'03 endif. ; Otherwise, at least in Gigabaud 27591 27592 004573'03 113 04 0 00 004547' dfdv t4,kilo ; Reduce by ten orders of binary magnitude 27593 004574'03 311 04 0 00 004547' caml t4,kilo ; Into Terabaud?? 27594 004575'03 254 00 0 00 004601' ifskp. ; No, but 1000BaseT is nothing to sneeze at! 27595 004576'03 120 02 0 00 000004 dmove t2,t4 ; Load Gigabaud rate 27596 004577'03 201 05 0 00 000107 movei t5,"G" ; Load the Gigabaud prefix 27597 004600'03 263 17 0 00 000000 ret ; Return giga or greater, but less that tera k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46-1 K20DSP MAC 20-Aug-24 23:41 Put result into kilo, mega, giga or tera range 27598 004601'03 endif. ; Otherwise, some kind of incredible rate 27599 27600 remark Dude!! ; What kind of com gear are you using? 27601 004601'03 113 04 0 00 004547' dfdv t4,kilo ; Reduce by ten orders of binary magnitude 27602 004602'03 120 02 0 00 000004 dmove t2,t4 ; Load Terabaud rate 27603 004603'03 201 05 0 00 000124 movei t5,"T" ; Load Terabaud prefix 27604 004604'03 263 17 0 00 000000 ret ; Return from ...Fantasy Island... 27605 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20DSP MAC 20-Aug-24 23:41 Print correct character suffix 27606 subttle Print correct character suffix 27607 27608 ; Call: 27609 ; 27610 ; t1/ Output designator (updated, if string) 27611 ; t5/ character prefix character (if any) 27612 27613 004605'03 201 02 0 00 000040 chrsfx: movei t2,.chspc ; Load a space 27614 004606'03 260 17 0 00 000000* call BOUTI% ;[216] Properly emit 27615 27616 004607'03 336 02 0 00 000005 skipn t2,t5 ; Load prefix character 27617 004610'03 254 00 0 00 004612' ifskp. ; If there is one, then type it 27618 004611'03 260 17 0 00 004606* call BOUTI% ;[216] Properly emit it 27619 004612'03 endif. 27620 27621 004612'03 120 02 0 00 000000# smsg 27622 004613'03 260 17 0 00 004443* 27623 000516'02 000000000000# 27624 000517'02 777777 777775 27625 002227'04 103 057 163 000 000 27626 004614'03 263 17 0 00 000000 ret 27627 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20DSP MAC 20-Aug-24 23:41 Print correct baud suffix 27628 subttle Print correct baud suffix 27629 27630 ; Call: 27631 ; 27632 ; t1/ Output designator (updated, if string) 27633 ; t5/ character prefix character (if any) 27634 27635 004615'03 201 02 0 00 000040 baudsf: movei t2,.chspc ; Load a space 27636 004616'03 260 17 0 00 004611* call BOUTI% ;[216] Seperate number from text 27637 004617'03 336 02 0 00 000005 skipn t2,t5 ; Load prefix character 27638 004620'03 254 00 0 00 004622' ifskp. ; If there is one, then type it 27639 004621'03 260 17 0 00 004616* call BOUTI% ;[216] 27640 004622'03 endif. 27641 27642 004622'03 120 02 0 00 000000# smsg ; Accepted abbreviation for Baud 27643 004623'03 260 17 0 00 004613* 27644 000520'02 000000000000# 27645 000521'02 777777 777776 27646 002230'04 102 144 000 000 000 27647 004624'03 263 17 0 00 000000 ret 27648 27649 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20DSP MAC 20-Aug-24 23:41 Determine the console's line number 27650 subttl Determine the console's line number 27651 27652 ;[223] Begin code insertion 27653 27654 ; Want to know this because the CTY is not a good line to use as you 27655 ; can't control what a front end might type as well as Tops-20's own 27656 ; needs. Using it can cause messages to never get seen, being simply 27657 ; thrown away as a packet resend. 27658 ; 27659 ; It is for this reason that the PANDA access control job (ACJ) will 27660 ; not allow the CTY to be assigned (either explicitly with ASND% or 27661 ; implicitly with an OPENF%) by anything else than an enabled WHEEL or 27662 ; OPERATOR. 27663 27664 chgsec(code,data) ; Need to store the data... 27665 000004'05 ctyerr: block 1 ; Any STDEV% error 27666 000005'05 ctydev: block 1 ;** DO NOT ; Console in 'device' format 27667 000006'05 ctynum: block 1 ; REORDER ** ; Bare line number of console 27668 retsec ; Restore psect assumptions 27669 27670 chgsec(code,const) ; The device name of the console is eternal 27671 000522'02 103 124 131 000 000 ctynam: asciz /CTY/ ; Note, NO device punctuation! 27672 retsec ; Restore psect assumptions 27673 27674 004625'03 inicty: entry inicty ; Called at program start up 27675 004625'03 265 16 0 00 004644' saveac ; Let's not touch anything 27676 27677 004626'03 561 01 0 00 000000# hrroi t1, ctynam ; Tops-20 pointer to CTY device name 27678 004627'03 104 00 0 00 000120 STDEV% ; Turn the string into a device 27679 004630'03 320 12 0 00 004632' ifje. r ; This is REALLY supposed to be defined... 27680 004631'03 254 00 0 00 004636' 27681 004632'03 202 01 0 00 000000# movem t1, ctyerr ; Store error for the curious 27682 004633'03 477 02 0 00 000003 setob t2, t3 ; Cons up a pair bogus talismen 27683 004634'03 124 02 0 00 000000# dmovem t2, ctydev ; Flag that they are useless 27684 004635'03 263 17 0 00 000000 ret ; Go no further 27685 004636'03 endif. ; End STDEV% error handling 27686 27687 remark ; Otherwise, worked!! 27688 004636'03 202 02 0 00 000000# movem t2, ctydev ; Save in device format for ASND% check 27689 004637'03 620 02 0 00 400000 txz t2, .ttdes ; Shut off terminal designator if half word 27690 004640'03 552 02 0 00 000000# hrrzm t2, ctynum ; Save just the line number 27691 004641'03 201 04 0 00 601405 movx t4, lstrx1 ; Say it worked fine 27692 004642'03 202 04 0 00 000000# movem t4, ctyerr ; Store (lack of) error for the curious 27693 27694 004643'03 263 17 0 00 000000 ret ; Finally done 27695 27696 ;[223] End code insertion 27697 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20DSP MAC 20-Aug-24 23:41 Finishing items 27698 subttl Finishing items 27699 27700 xlist ; Save the trees!! 27701 list ; Resume listing 27702 27703 .endps code ; Close the code .psect 27704 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20DSP MAC 20-Aug-24 23:41 Extended Text for Display 27705 subttl Extended Text for Display 27706 27707 .psect etext ;[209] Need to put some things in extended text 27708 27709 remark Various types of parity 27710 27711 002231'04 116 157 156 145 000 enone: asciz/None/ 27712 002232'04 123 160 141 143 145 espac: asciz/Space/ 27713 002234'04 115 141 162 153 000 emark: asciz/Mark/ 27714 002235'04 117 144 144 000 000 eodd: asciz/Odd/ 27715 002236'04 105 166 145 156 000 eeven: asciz/Even/ 27716 27717 remark Various states of debugging 27718 27719 002237'04 117 146 146 000 000 deboff: asciz/Off/ 27720 002240'04 123 164 141 164 145 debsts: asciz/States/ 27721 002242'04 120 141 143 153 145 debpks: asciz/Packets/ 27722 27723 .endps etext ; Close out section 1 text 27724 27725 remark Pointers to extended text which MUST be in section zero 27726 27727 .psect const ; Constants 27728 27729 000523'02 000000000000# debtab: .px7!deboff 27730 000524'02 000000000000# .px7!debsts 27731 000525'02 000000000000# .px7!debpks 27732 27733 .endps const 27734 k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20DSP MAC 20-Aug-24 23:41 Display Module local storage 27735 subttl Display Module local storage 27736 27737 .psect data ; Writable storage 27738 000007'05 000000 000000 pvbaud:: exp 0,0 ; PTY: virtual baud rate 27739 000011'05 000000 000000 pibaud:: exp 0,0 ; PIP: virtual baud rate 27740 000013'05 000000 000000 nlbaud:: exp 0,0 ; NUL: virtual baud rate 27741 000015'05 000000 000000 dnbaud:: exp 0,0 ; DECnet virtual baud rate 27742 27743 .endps data ; End of data psect 27744 27745 .xcmsy ;[194] Ditch MACSYM junk 27746 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 000025 FOR TEXT PSECT 2 BREAK IS 000526 FOR CONST PSECT 3 BREAK IS 005105 FOR CODE PSECT 4 BREAK IS 002244 FOR ETEXT PSECT 5 BREAK IS 000017 FOR DATA CPU TIME USED 00:02.021 141P CORE USED k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE BOUT 104000 000051 int NO%RDX 777777 sin T3 000003 spd .SAV2 000000 ext BOUT% 104000 000051 int NOUT% 104000 000224 int T4 000004 spd .SAV3 000000 ext BOUTI% 000000 ext NTLINE 777777 spd T5 000005 spd .TTDES 400000 sin CALL 260740 000000 NTTYPE 000777 000000 spd TEXT 000000 ext .XTRST 000000 ext CALLRE 254000 000000 spd NW%MC 000003 sin TT%OSP 400000 000000 sin CCOFF 000000 ext NW%NNT 000000 sin TTYJFN 000000 ext CCON 000000 ext NW%PT 000002 sin XMOVEI 415000 000000 int CODE 000000 ext NW%TV 000004 sin $PRIOU 000000 ext CONST 000000 ext ODCNV% 104000 000222 int %%JSER 000000 ext CRLF 000000 ext ODTIM% 104000 000220 int %%SMSG 000000 ext CRLFLF 000000 ext OF%BSZ 770000 000000 sin ..MSK 777777 777777 spd CX 000016 OF%RD 200000 sin .A16 000016 spd DATA 000000 ext OPENF% 104000 000021 int .AC1 000001 spd DEBUG 000014 spd OT%4YR 010000 000000 sin .CHCRT 000015 sin DEVST% 104000 000121 int OT%DAM 004000 000000 sin .CHDBQ 000042 spd DFOUT% 104000 000235 int OT%DAY 200000 000000 sin .CHDEL 000177 sin DV%TYP 000777 000000 sin OT%FDY 100000 000000 sin .CHLFD 000012 sin DVCHR% 104000 000117 int OT%FMN 020000 000000 sin .CHLPA 000050 spd DXFULL 000000 spd OT%SCL 000001 000000 sin .CHNUL 000000 sin ERJMP 320700 000000 int OT%SPA 002000 000000 sin .CHRPA 000051 spd ERJMPR 320500 000000 int P 000017 .CHSNQ 000047 spd ERJMPS 320600 000000 int P1 000011 spd .CHSPC 000040 sin ERRPTR 000000 ext P2 000012 spd .DATUS 000017 spd ERSTR 104000 000011 int P3 000013 spd .DVADS 000025 sin ESOUT% 104000 000313 int P4 000014 spd .DVCDP 000021 sin ETEXT 000000 ext P5 000015 spd .DVCDR 000010 sin FILJFN 000000 ext PARS1 000000 ext .DVDCN 000022 sin FL%EXP 003000 000000 sin PARS2 000000 ext .DVDES 600000 sin FL%FST 770000 sin PARS3 000000 ext .DVDSK 000000 sin FL%JUS 140000 000000 sin PARS4 000000 ext .DVDSP 000006 sin FL%ONE 020000 000000 sin PARS5 000000 ext .DVDTA 000003 sin FL%OVL 000100 000000 sin PBOUT 104000 000074 int .DVFE 000011 sin FL%PNT 004000 000000 sin PBOUT% 104000 000074 int .DVLPT 000007 sin FL%RND 000037 000000 sin PM%RD 100000 000000 sin .DVMTA 000002 sin FL%SGN 600000 000000 sin PMAP% 104000 000056 int .DVNUL 000015 sin FL%SND 007700 sin PSOUT 104000 000076 int .DVPIP 000403 sin FLOUT 104000 000233 int PSOUT% 104000 000076 int .DVPLT 000017 sin FLOUT% 104000 000233 int Q1 000005 spd .DVPTP 000005 sin GETNTI 000000 ext Q2 000006 spd .DVPTR 000004 sin GS%NAM 000200 000000 sin Q3 000007 spd .DVPTY 000013 sin GS%OPN 400000 000000 sin Q4 000010 spd .DVSRV 000023 sin GTSTS% 104000 000024 int Q5 000011 spd .DVTTY 000012 sin GTTYP% 104000 000303 int QLOG 000000 ext .FHSLF 400000 sin IDCNV% 104000 000223 int R 000000 ext .FLDIG 000000 sin JFNS 104000 000030 int RET 263740 000000 .FLEXN 000000 sin JFNS% 104000 000030 int RFMOD% 104000 000107 int .FLLSP 000000 sin LSTRX1 601405 int RFPTR% 104000 000043 int .FLSPC 000001 sin MAPORG 007000 spd RSKP 000000 ext .FP 000015 spd MAPPAG 000007 spd SFMOD% 104000 000110 int .FPAC 000005 spd MAXTIM 267460 SIZEF% 104000 000036 int .NULIO 377777 sin N%AREA 176000 spd SOUT% 104000 000053 int .NWTTF 000004 sin N%NODE 001777 spd STDEV% 104000 000120 int .PRIOU 000101 sin NO%COL 000177 000000 sin STRBLW 001000 spd .PX7 610001 000000 spd NO%LFL 100000 000000 sin T1 000001 spd .SAC 000016 NO%OOV 020000 000000 sin T2 000002 spd .SAV1 000000 ext k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT TEXT ASTNUL 000002' DVPUNC 000006' NULNAM 000000' UNKTXT 000004' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT CONST CTYNAM 000522' DEBTAB 000523' FMCNTL 000515' GENTAB 000136' LTNAME 000464' NEWMN 000435' NUL5 000002' NULPTR 000000' PER 000035 422752 spd PERCNT 000100' PERIO4 000437' PERIO8 000440' PERIOD 000436' TABLE 000441' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT CODE ABTFIL 002225' ext INDEFS 003347' ext PTYFLG 002003' ext TTIBIN 000621' ext ASCDEV 001262' int INDEFT 003302' ext PTYNAM 001537' ext TTILDB 000577' ext AUTBYT 002145' ext INDEFW 003334' ext PUTC 004203' ent TTIMAX 000613' ext BAUD 004524' INICTY 004625' ent QLOG 000425' ext TTIPAR 001702' ext BAUDSF 004615' INPCBF 004014' ext R 004501' ext TTISIN 000605' ext BCTR 002647' ext INTIMA 003320' ext RANGER 004551' TTYJFN 002015' ext BCTU 002655' ext ITSFLG 002211' ext REOLCH 002543' ext TTYNUM 002135' ext BLIP 003215' ext KILO 004547' ROSNPT 001464' ext TVTBIN 004355' ext BOUTI% 004621' ext LCLPAR 004314' ext RPADCH 002531' ext TVTCHK 004333' ext BRK 001766' ext LINCHR 004267' RPADN 002512' ext TVTFLG 004326' ext CARIER 002017' ext LOCAL 003213' ext RPAUSE 003035' ext TVTUNK 004347' ext CHKLIN 002016' ext LOGBSZ 002450' ext RPAUSF 003001' ext TYPFIL 000054' ent CHRSFX 004605' LOGJFN 002372' ext RPSIZ 002467' ext TYPNAM 000020' ent CLRCNO 000000' ent MACTAB 003642' ext RPTFLG 002634' ext VBICT 003770' ext CRLF 003647' ext MARK 001641' ext RPTQ 002636' ext VBOCT 004026' ext CRLFLF 004670' ext MAXTRY 003135' ext RQUOTE 002555' ext VCHRCN 004002' ext DBLCAL 004540' ext MDMLIN 001557' ext RSKP 004535' ext VSICT 004040' ext DBLSCL 001024' ext MHPTOD 002355' ext RSTHDR 002574' ext VSIMX 004060' ext DELAY 003122' ext MOON 003652' RTCHR 000762' ext VSITC 004050' ext DELAYF 003076' ext MYNAME 001546' ext RTIMOU 002733' ext VSOCT 004072' ext DEVUNT 001310' MYNODE 001437' ext RTOT 000534' ext VSOMX 004112' ext DFLOAT 004460' ext MYTTY 004315' ext SEC 000000 ext VSOTC 004102' ext DISPER 003761' NBICT 004124' ext SEOLCH 002550' ext VTERMF 002001' ext DNULBD 001176' ext NDVFXP 001423' ext SESFLG 002037' ext WHAKFP 000427' ent DPIPBD 001216' ext NETJFN 002014' ext SESJFN 002035' ext XFNFLG 002175' ext DPTYBD 001156' ext NNAK 000656' ext SPACE 001637' ext $DFCHR 000015 000003 spd DSPCHR 004230' NODNAM 001430' ext SPADCH 002536' ext $DFETI 000015 000007 spd DSRVBD 001240' ext NODNUM 001441' ext SPADN 002522' ext $DFSPE 000015 000013 spd DUPLEX 001732' ext NONE 001651' ext SPAUSE 003051' ext $DICHR 000015 000001 spd DURTIM 000500' ext NRTFLG 002130' ext SPAUSF 003013' ext $DIETI 000015 000005 spd EBQ 002616' ext NSICI 004134' ext SPEED 001760' ext $DISPE 000015 000011 spd EBQFLG 002614' ext NSIMX 004154' ext SPSIZ 002477' ext $EDNO 000000 ext EBQR 002601' ext NSITC 004144' ext SQUOTE 002562' ext $MCHRS 003610' ext EBTFLG 002151' ext NTIBLK 000000 ext SRVTIM 003176' ext $MNVER 000000 ext ECHO 000317' ent NTIMOU 000650' ext SSTHDR 002567' ext $PRIOU 000016' ext ECHO1 000354' ODD 001643' ext STATXT 004733' ext $SHDAY 001401' ent ECHO2 000402' OPNPAR 004316' ext STCHR 000761' ext $SHDEB 002332' ent ERRPTR 000631' ext PARACT 001714' ext STIMOU 002750' ext $SHFIL 002142' ent ESCAPE 001630' ext PARITY 001635' ext STOT 000535' ext $SHINP 003251' ent EVEN 001645' ext PARPKO 001653' ext STRBUF 000300' ext $SHLIN 001411' ent EWALLT 004507' ext PARRCK 000000 ext STRC 000000 ext $SHMAC 003554' ent EXPUNG 002241' ext PARS2 001323' ext STRPTR 000000 ext $SHMAX 003651' FLOW 001612' ext PARS3 001145' ext TBTFLG 002147' ext $SHO4A 001702' FMCNTW 024137 040400 spd PARS4 001147' ext TDEFPL 003537' ext $SHO4B 001727' GENPAR 000302' ext PARSUB 001725' ext TDEFPP 003545' ext $SHO4E 002035' GETNTI 002133' ext PAUSE 000642' ext TEOFCH 003372' ext $SHO4F 002130' GMKBP1 004543' PDCODF 002341' ext TIMDEV 001151' ext $SHO4H 002137' GMKBPS 004526' PEFFI0 004470' TIMEOU 003455' ext $SHO4X 002137' GMKCPS 004503' ent PEFFIF 004430' TIMERX 000674' ext $SHOW3 001575' HANDSH 001600' ext PRNTBD 001052' TLGJFN 002251' ext $SHOW4 001632' IFCRLF 004161' ent PRNTBS 001064' TMAXLN 003404' ext $SHPKT 002463' ent IMXTRY 003145' ext PRNTBV 001107' TOBSER 003507' ext $SHTIM 002664' ent INCASE 003254' ext PRNTCM 001114' TPAUSE 003425' ext $SHTOP 001334' ent INDEFC 003350' ext PRNTNV 001101' TSETSD 003473' ext $SHTRC 003367' ent INDEFF 003270' ext PSPEEF 000703' TSILEN 003523' ext $SHVER 001334' ent k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT CODE $SRVT 000446' ent ..0476 000732' spd ..1225 001671' spd ..1747 002425' spd $STAT 000447' ent ..0503 000752' spd ..1235 001674' spd ..1751 002444' spd $STAT4 000625' ..0514 000767' spd ..1243 001700' spd ..1776 002540' spd $STATJ 000663' ..0526 001001' spd ..1257 001714' spd ..2032 002611' spd $STATX 000640' ..0533 001004' spd ..1263 001722' spd ..2037 002614' spd $STATZ 000700' ..0534 001007' spd ..1270 001727' spd ..2044 002621' spd $TIME 001125' int ..0541 001034' spd ..1303 001741' spd ..2051 002624' spd $TIME1 001323' ..0542 001017' spd ..1304 001744' spd ..2060 002641' spd $VERNO 000000 ext ..0554 001040' spd ..1315 001755' spd ..2065 002644' spd $WHO 000000 ext ..0555 001043' spd ..1323 001776' spd ..2076 002702' spd %%JSER 004477' ext ..0570 001100' spd ..1330 002001' spd ..2103 002705' spd %%SMSG 004623' ext ..0604 001151' spd ..1337 002011' spd ..2110 002714' spd ....Z 224100 060400 ..0616 001172' spd ..1344 002014' spd ..2115 002717' spd ...X 000002 spd ..0624 001165' spd ..1351 002025' spd ..2120 002771' spd ..0006 000010' spd ..0625 001170' spd ..1356 002030' spd ..2125 002774' spd ..0015 000017' spd ..0626 001164' spd ..1363 002035' spd ..2136 002745' spd ..0023 000035' spd ..0644 001212' spd ..1375 002130' spd ..2137 002750' spd ..0024 000053' spd ..0652 001205' spd ..1377 002045' spd ..2150 002762' spd ..0032 000034' spd ..0653 001210' spd ..1404 002050' spd ..2151 002765' spd ..0041 000044' spd ..0654 001204' spd ..1415 002064' spd ..2170 003010' spd ..0050 000053' spd ..0672 001232' spd ..1416 002130' spd ..2171 003013' spd ..0052 000066' spd ..0700 001225' spd ..1435 002111' spd ..2200 003025' spd ..0057 000106' spd ..0701 001230' spd ..1437 002130' spd ..2201 003030' spd ..0067 000103' spd ..0702 001224' spd ..1454 002137' spd ..2206 003065' spd ..0100 000131' spd ..0720 001254' spd ..1464 002167' spd ..2222 003046' spd ..0111 000126' spd ..0726 001247' spd ..1471 002172' spd ..2223 003051' spd ..0115 000154' spd ..0727 001252' spd ..1472 002163' spd ..2234 003057' spd ..0122 000155' spd ..0730 001246' spd ..1477 002166' spd ..2235 003062' spd ..0132 000150' spd ..0751 001302' spd ..1500 002157' spd ..2244 003076' spd ..0143 000162' spd ..0752 001307' spd ..1505 002162' spd ..2251 003131' spd ..0151 000207' spd ..0775 001314' spd ..1520 002203' spd ..2260 003104' spd ..0152 000210' spd ..0776 001321' spd ..1525 002206' spd ..2261 003131' spd ..0162 000203' spd ..1005 001353' spd ..1534 002217' spd ..2270 003116' spd ..0173 000216' spd ..1013 001366' spd ..1541 002222' spd ..2271 003121' spd ..0175 000233' spd ..1021 001376' spd ..1550 002233' spd ..2304 003206' spd ..0212 000242' spd ..1023 001502' spd ..1555 002236' spd ..2311 003211' spd ..0213 000244' spd ..1035 001441' spd ..1564 002246' spd ..2320 003172' spd ..0221 000245' spd ..1044 001436' spd ..1602 002324' spd ..2321 003175' spd ..0222 000316' spd ..1051 001441' spd ..1603 002327' spd ..2332 003246' spd ..0232 000304' spd ..1057 001464' spd ..1610 002267' spd ..2344 003243' spd ..0235 000304' spd ..1063 001457' spd ..1611 002323' spd ..2345 003246' spd ..0245 000346' spd ..1075 001476' spd ..1625 002304' spd ..2354 003230' spd ..0253 000352' spd ..1111 001517' spd ..1627 002323' spd ..2355 003237' spd ..0264 000401' spd ..1115 001534' spd ..1654 002366' spd ..2370 003262' spd ..0300 000426' spd ..1122 001554' spd ..1656 002355' spd ..2375 003265' spd ..0312 000435' spd ..1127 001530' spd ..1663 002366' spd ..2410 003312' spd ..0313 000445' spd ..1130 001533' spd ..1664 002351' spd ..2411 003315' spd ..0331 000504' spd ..1143 001575' spd ..1671 002354' spd ..2422 003326' spd ..0332 000503' spd ..1153 001572' spd ..1676 002363' spd ..2427 003331' spd ..0377 000557' spd ..1160 001575' spd ..1703 002366' spd ..2436 003342' spd ..0400 000561' spd ..1173 001606' spd ..1710 002460' spd ..2443 003364' spd ..0407 000570' spd ..1174 001607' spd ..1724 002455' spd ..2453 003362' spd ..0414 000572' spd ..1201 001620' spd ..1725 002460' spd ..2465 003376' spd ..0461 000737' spd ..1206 001623' spd ..1732 002410' spd ..2466 003400' spd ..0466 000761' spd ..1213 001632' spd ..1733 002444' spd ..2477 003435' spd k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT CODE ..2500 003440' spd ..CSC 000004 spd ..2515 003465' spd ..CSN 000003 spd ..2516 003470' spd ..IFT 000000 spd ..2527 003501' spd ..JX1 400000 000000 spd ..2534 003504' spd ..MX1 601405 spd ..2543 003515' spd ..MX2 000001 spd ..2550 003520' spd ..NV 000015 spd ..2557 003531' spd ..PST 000003 spd ..2564 003534' spd ..TRR 000010 spd ..2573 003545' spd ..TX1 400000 spd ..2600 003551' spd ..TX2 000001 spd ..2603 003562' spd .XTRST 000704' ext ..2632 003632' spd ..2633 003647' spd ..2646 003677' spd ..2655 003706' spd ..2656 003716' spd ..2664 003717' spd ..2665 003760' spd ..2672 003736' spd ..2674 003774' spd ..2704 004006' spd ..2714 004020' spd ..2724 004032' spd ..2734 004064' spd ..2750 004116' spd ..2764 004160' spd ..3006 004174' spd ..3014 004202' spd ..3022 004216' spd ..3032 004225' spd ..3040 004236' spd ..3041 004266' spd ..3051 004306' spd ..3063 004323' spd ..3077 004366' spd ..3103 004341' spd ..3110 004344' spd ..3117 004355' spd ..3124 004366' spd ..3127 004363' spd ..3134 004366' spd ..3156 004435' spd ..3167 004441' spd ..3200 004445' spd ..3212 004467' spd ..3216 004515' spd ..3220 004537' spd ..3225 004557' spd ..3233 004565' spd ..3241 004573' spd ..3247 004601' spd ..3255 004612' spd ..3266 004622' spd ..3300 004636' spd k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT ETEXT DEBOFF 002237' DEBPKS 002242' DEBSTS 002240' EEVEN 002236' EMARK 002234' ENONE 002231' EODD 002235' ESPAC 002232' k20dsp - Kermit-20 Display Routines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-8 K20DSP MAC 20-Aug-24 23:41 SYMBOL TABLE FOR PSECT DATA CTYDEV 000005' CTYERR 000004' CTYNUM 000006' DEVTXT 000000' DNBAUD 000015' int NLBAUD 000013' int PIBAUD 000011' int PVBAUD 000007' int k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20PDC MAC 27-Mar-24 20:17 27747 title k20pdc - Kermit (Visual) Packet Decoding 27748 27749 ; All display code was removed from k20mit and moved to the k20dsp 27750 ; module as part of Edit 194 to address the issue of a very large 27751 ; single source file that unexpectedly began generating MCRNEC errors. 27752 ; 27753 ; With the exception the 'main' k20mit module, any time a module gets 27754 ; near 50 pages, a code split happens. Thus far, this has happened 27755 ; with: 27756 ; 27757 ; k20ioc - Kermit INPUT/OUTPUT/TRANSMIT support 27758 ; k20mac - Kermit Macros (DEFINE command) 27759 ; k20srv - Kermit Server Commands 27760 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20PDC MAC 27-Mar-24 20:17 Preliminaries 27761 subttl Preliminaries 27762 27763 search monsym,macsym,cmd,k20unv ;[194] 27764 cmdacs ^ ;Clean up p1-p4 definitions 27765 27766 sall ; Tidy listing 27767 .directive flblst ; We don't need to see all the ASCIZ bytes... 27768 27769 extern rquote ; Receive quote character 27770 extern squote ; Send quote character 27771 27772 extern $closd ; Close debugging log 27773 extern logjfn ; Debugging log JFN 27774 extern BOUTI% ; Byte output to JFN or append to string 27775 extern %%smsg ; smsg macro support 27776 remark ; N.B., %%smsg *ONLY* handles OWGP's!!!!! 27777 27778 repeat 0,< remark ;;;; ; Put these in later to bum a BOUT% 27779 extern s8ccv7 ; String eight controlified convert to seven 27780 extern trnbuf ; Where it leaves this 27781 > 27782 .psect code/ronly ; Pure code. Pure Heaven 27783 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20PDC MAC 27-Mar-24 20:17 DIAMSG Print packet type and number if debugging "states" 27784 subttl DIAMSG Print packet type and number if debugging "states" 27785 27786 ;[114] DIAMSG 27787 ; 27788 ; Enter with: 27789 ; t1/ packet type 27790 ; t2/ packet number 27791 ; t4/ pointer to data 27792 ; logjfn/ debugging log file jfn 27793 ; Returns +1 always, with all ACs unchanged. 27794 27795 000000'01 diamsg: entry diamsg ;[221] Moved here from k20mit 27796 000000'01 306 14 0 00 000001 cain debug, 1 ; Only for protocol debugging. 27797 000001'01 336 00 0 00 000000* skipn logjfn ; Got a log JFN? 27798 000002'01 263 17 0 00 000000 ret ; Nope, forget it. 27799 27800 000003'01 265 16 0 00 001012' saveac ; Save these. 27801 000004'01 405 01 0 00 000177 andi t1, 177 ;[235] Strip off any parity 27802 000005'01 261 17 0 00 000001 push p, t1 ; Save packet type for sec. 27803 000006'01 200 01 0 00 000001* move t1, logjfn ; Get debugging log file JFN. 27804 000007'01 201 03 0 00 000010 movei t3, ^d8 ;[194] Tops-20 displays ASCII numeric as Octal 27805 000010'01 104 00 0 00 000224 NOUT% 27806 000011'01 320 12 0 00 000013' ifje. r ;[194] Catch and ignore error 27807 000012'01 254 00 0 00 000016' 27808 000013'01 262 17 0 00 000002 pop p, t2 ;[194] Keep the stack straight!!!!! 27809 000014'01 254 00 0 00 000031' jrst deberr ;[174] 27810 000015'01 254 00 0 00 000017' else. ;[194] Otherwise, worked 27811 000016'01 262 17 0 00 000002 pop p, t2 ; Pop packet type 27812 000017'01 endif. ;[194] 27813 000017'01 260 17 0 00 000000* call BOUTI% 27814 000020'01 302 02 0 00 000107 caie t2, "G" ; Generic command? 27815 000021'01 254 00 0 00 000026' ifskp. ;[194] Yes, first character of one 27816 000022'01 200 03 0 00 000004 move t3, t4 ; Log the first character of the data packet. 27817 000023'01 134 02 0 00 000003 ildb t2, t3 27818 000024'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 27819 000025'01 260 17 0 00 000017* call BOUTI% ;[174] 27820 000026'01 endif. ;[194] 27821 27822 000026'01 201 02 0 00 000040 diamsz: movei t2, " " ; A space for delimitation. 27823 000027'01 260 17 0 00 000025* call BOUTI% ;[174] 27824 000030'01 263 17 0 00 000000 ret 27825 27826 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20PDC MAC 27-Mar-24 20:17 Handle I/O errors writing to debugging log file. 27827 subttl Handle I/O errors writing to debugging log file. 27828 27829 ;[174] 27830 27831 000031'01 deberr: entry deberr ;[221] Moved here from k20mit 27832 txmsg < 27833 000031'01 200 01 0 00 000000# %KERMIT-20: Error writing debug log file - > 27834 000032'01 104 00 0 00 000076 27835 000033'01 320 12 0 00 000034' 27836 000000'02 000000000000# 27837 000000'03 015 012 045 113 105 27838 000034'01 201 01 0 00 000101 movei t1, .priou 27839 000035'01 525 02 0 00 400000 hrloi t2, .fhslf 27840 000036'01 400 03 0 00 000000 setz t3, 27841 000037'01 104 00 0 00 000011 ERSTR% 27842 000040'01 320 14 0 00 000042' erjmps .+2 ; Ignore its strange return 27843 000041'01 320 14 0 00 000042' erjmps .+1 ; Ignore its stranger return 27844 txmsg < 27845 000042'01 200 01 0 00 000000# > 27846 000043'01 104 00 0 00 000076 27847 000044'01 320 12 0 00 000045' 27848 000001'02 000000000000# 27849 000012'03 015 012 000 000 000 27850 000045'01 400 01 0 00 000000 setz t1, ; Close the log file if possible 27851 000046'01 260 17 0 00 000000* call $closd ;[194] ; and turn off debug log. 27852 000047'01 263 17 0 00 000000 ret 27853 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20PDC MAC 27-Mar-24 20:17 Packet Decode 27854 subttl Packet Decode 27855 27856 ; t1/ LH, "S" or "R" (Sending or Receiving 27857 ; RH, Debugging log JFN or terminal device id 27858 ; t2/ Point 8, packet to send or packet we got 27859 27860 000050'01 pdecod: entry pdecod ; Called by k10mit packet routines 27861 remark ; *MUST* be saved by caller!!!! 27862 000050'01 265 16 0 00 001024' saveac ; Needs some more registers 27863 27864 000051'01 337 13 0 00 000006* skipg p3, logjfn ; Do we have a logging JFN? (can be .priou) 27865 000052'01 263 17 0 00 000000 ret ; No, so don't log anything 27866 000053'01 554 11 0 00 000001 hlrz p1, t1 ; Load the packet context 27867 000054'01 621 01 0 00 777777 tlz t1, -1 ; And stomp it out of the register 27868 000055'01 120 05 0 00 000001 dmove q1, t1 ; Let's save these for a moment 27869 000056'01 120 07 0 00 000003 dmove q3, t3 ; all of the temporaries 27870 27871 000057'01 415 16 0 00 000067' block. ; Carefully review the context character 27872 000060'01 261 17 0 00 000016 27873 000061'01 306 11 0 00 000122 cain p1, "R" ; Receiving? 27874 000062'01 254 00 0 00 000000* retskp ; Yes, this is valid 27875 000063'01 306 11 0 00 000123 cain p1, "S" ; Sending? 27876 000064'01 254 00 0 00 000062* retskp ; Yes, that's valid, too 27877 000065'01 263 17 0 00 000000 ret ; Otherwise, some kind of bad 27878 000066'01 263 17 0 00 000000 endbk. ; End of block context 27879 000067'01 254 00 0 00 000076' ifskp. ; +2 means we thought it was fine 27880 000070'01 306 11 0 00 000122 cain p1, "R" ; Receiving? 27881 000071'01 254 00 0 00 000107' callret rpdecd ; Yes, go do something about that 27882 000072'01 306 11 0 00 000123 cain p1, "S" ; Receiving? 27883 000073'01 254 00 0 00 000152' callret spdecd ; Yes, go do something about that, too 27884 000074'01 254 00 0 00 000076' anskp. ; ??? Shouldn't happen--we just checked 27885 000075'01 254 00 0 00 000106' else. ; Otherwise, unknown context 27886 000076'01 200 01 0 00 000013 move t1, p3 ; Pick up the log JFN 27887 000077'01 120 02 0 00 000000# smsg <% "> ; Begin confusion blat 27888 000100'01 260 17 0 00 000000* 27889 000002'02 000000000000# 27890 000003'02 777777 777775 27891 000013'03 045 040 042 000 000 27892 000101'01 200 11 0 00 000011 move p1, p1 ; Pick up the unknown context character 27893 000102'01 260 17 0 00 000027* call BOUTI% ; Put it into the log file 27894 smsg <" is not a known transmission context 27895 000103'01 120 02 0 00 000000# > ; Finish the blat and close off the line 27896 000104'01 260 17 0 00 000100* 27897 000004'02 000000000000# 27898 000005'02 777777 777731 27899 000014'03 042 040 151 163 040 27900 27901 000105'01 263 17 0 00 000000 ret ; Get out of here and don't risk bogosity 27902 000106'01 endif. ; End case context character scrub 27903 27904 000106'01 263 17 0 00 000000 ret ; Superstition... 27905 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20PDC MAC 27-Mar-24 20:17 Receive Context 27906 subttl Receive Context 27907 27908 ; Invoked at the end of the receive 27909 ; 27910 ; AC's: 27911 ; 27912 ; t1/ Packet type 27913 ; t2/ Packet number 27914 ; t3/ Length of data field 27915 ; t4/ 8-bit byte pointer to data field 27916 27917 extern rsthdr ; Start of Packet 27918 extern num ; Packet Number 27919 extern type ; Message Type 27920 extern datlen ; Data length 27921 extern pktlen ; Packet length 27922 extern islong ; Set if a long packet 27923 extern datptr ; Pointer to data area of packet 27924 extern pktbct ; Block check type for this packet on receive 27925 extern blkchk ; Final computed block check 27926 extern fintim ; Fine grained time of day (in K20TIM) 27927 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20PDC MAC 27-Mar-24 20:17 Decode a received packet 27928 subttl Decode a received packet 27929 27930 000107'01 rpdecd: remark ; Saved by original external caller 27931 remark ; Saved by internal control linkage 27932 repeat 0,< 27933 setzb t1, t2 ; Cons up some .CHNUL's 27934 dmovem t1, sop8st ; Start of Packet character as an 8 bit ASCII string 27935 dmovem t1, trnbuf ; Same character as expanded 7 bit ASCIZ 27936 > 27937 000107'01 200 01 0 00 000013 move t1, p3 ; Load the log file JFN 27938 000110'01 120 02 0 00 000000# smsg () ; "R" for Receive 27939 000111'01 260 17 0 00 000104* 27940 000006'02 000000000000# 27941 000007'02 777777 777776 27942 000024'03 122 054 000 000 000 27943 000112'01 260 17 0 00 000000* call fintim ; Print Time of Day down to HP ticks 27944 000113'01 254 00 0 00 000031' jrst deberr ; Something went wrong, stop doing this 27945 000114'01 201 04 0 00 000122 movei t4, "R" ; Flag that we're receiving 27946 000115'01 260 17 0 00 000734' call pkthdr ; Display packet head 27947 000116'01 254 00 0 00 000031' jrst deberr ; Failed somehow 27948 27949 000117'01 200 02 0 00 000000* move t2, datptr ; Load what receieve sets up 27950 000120'01 202 02 0 00 000000* movem t2, sdatpt ; Pretend we're sending it for code re-use 27951 27952 000121'01 200 04 0 00 000000* move t4, type ; Reload the type 27953 000122'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 27954 000123'01 301 04 0 00 000101 cail t4, "A" ; Before "A"? 27955 000124'01 303 04 0 00 000132 caile t4, "Z" ; or after "Z"? 27956 000125'01 254 00 0 00 000213' jrst invsnd ; Can't do the jump table 27957 27958 000126'01 415 16 0 00 000136' block. ; Enter block context for better control flow 27959 000127'01 261 17 0 00 000016 27960 000130'01 306 04 0 00 000131 cain t4, "Y" ; An acknowledge? 27961 000131'01 263 17 0 00 000000 ret ; Don't overwrite what ACK is ack'ing 27962 000132'01 306 04 0 00 000116 cain t4, "N" ; A negative acknowledge? 27963 000133'01 263 17 0 00 000000 ret ; Don't overwrite what NAK is nak'ing 27964 000134'01 254 00 0 00 000064* retskp ; Otherwise, OK to update context 27965 000135'01 263 17 0 00 000000 endbk. ; End of block context 27966 000136'01 254 00 0 00 000140' ifskp. ; +2 means OK to overwrite 27967 000137'01 202 04 0 00 000000# movem t4, lstpkt ; Remember last packet type 27968 000140'01 endif. 27969 27970 000140'01 265 16 0 00 001042' saveac ; Needs some scratch 27971 000141'01 200 05 0 00 000120* move q1, sdatpt ; Load the pointer to the packet's data field 27972 000142'01 200 07 0 00 000000* move q3, datlen ; Number of initialization bytes 27973 27974 000143'01 200 03 0 00 000004 move t3, t4 ; Save a working copy 27975 000144'01 275 03 0 00 000101 subi t3, "A" ; Bring into offset range 27976 000145'01 260 17 1 03 000000# call @sndpkt(t3) ; Call the right routine 27977 000146'01 263 17 0 00 000000 ret ; Pass the error back up 27978 27979 smsg < 27980 000147'01 120 02 0 00 000000# > ; Tie off the log file line 27981 000150'01 260 17 0 00 000111* 27982 000010'02 000000000000# k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7-1 K20PDC MAC 27-Mar-24 20:17 Decode a received packet 27983 000011'02 777777 777776 27984 000025'03 015 012 000 000 000 27985 000151'01 263 17 0 00 000000 ret ; +1, always 27986 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20PDC MAC 27-Mar-24 20:17 Decode a sent packet 27987 subttl Decode a sent packet 27988 27989 extern sseqn ; Sending Sequence Number 27990 extern sdatpt ; Sending Data Pointer (points inside the packet) 27991 extern spakpt ; Sending packet pointer 27992 27993 000152'01 spdecd: remark ; Saved by original external caller 27994 remark ; Saved by internal control linkage 27995 repeat 0,< 27996 setzb t1, t2 ; Cons up some .CHNUL's 27997 dmovem t1, sop8st ; Start of Packet character as an 8 bit ASCII string 27998 dmovem t1, trnbuf ; Same character as expanded 7 bit ASCIZ 27999 > 28000 000152'01 200 01 0 00 000013 move t1, p3 ; Load the log file JFN 28001 000153'01 120 02 0 00 000000# smsg () ; "S" for Send 28002 000154'01 260 17 0 00 000150* 28003 000012'02 000000000000# 28004 000013'02 777777 777776 28005 000026'03 123 054 000 000 000 28006 000155'01 260 17 0 00 000112* call fintim ; Print Time of Day down to HP ticks 28007 000156'01 254 00 0 00 000031' jrst deberr ; Something went wrong, stop doing this 28008 000157'01 201 04 0 00 000123 movei t4, "S" ; Flag that we're sending 28009 000160'01 260 17 0 00 000734' call pkthdr ; Dump basic packet headers 28010 000161'01 254 00 0 00 000031' jrst deberr ; Failed somehow 28011 28012 000162'01 200 04 0 00 000121* move t4, type ; Reload the type 28013 000163'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28014 000164'01 301 04 0 00 000101 cail t4, "A" ; Before "A"? 28015 000165'01 303 04 0 00 000132 caile t4, "Z" ; or after "Z"? 28016 000166'01 254 00 0 00 000213' jrst invsnd ; Can't do the jump table 28017 28018 000167'01 415 16 0 00 000177' block. ; Enter block context for better control flow 28019 000170'01 261 17 0 00 000016 28020 000171'01 306 04 0 00 000131 cain t4, "Y" ; An acknowledge? 28021 000172'01 263 17 0 00 000000 ret ; Don't overwrite what ACK is ack'ing 28022 000173'01 306 04 0 00 000116 cain t4, "N" ; A negative acknowledge? 28023 000174'01 263 17 0 00 000000 ret ; Don't overwrite what NAK is nak'ing 28024 000175'01 254 00 0 00 000134* retskp ; Otherwise, OK to update context 28025 000176'01 263 17 0 00 000000 endbk. ; End of block context 28026 000177'01 254 00 0 00 000201' ifskp. ; +2 means OK to overwrite 28027 000200'01 202 04 0 00 000000# movem t4, lstpkt ; Remember last packet type 28028 000201'01 endif. 28029 28030 000201'01 265 16 0 00 001042' saveac ; Needs some scratch 28031 000202'01 200 05 0 00 000141* move q1, sdatpt ; Load the pointer to the packet's data field 28032 000203'01 200 07 0 00 000142* move q3, datlen ; Number of initialization bytes 28033 28034 000204'01 200 03 0 00 000004 move t3, t4 ; Save a working copy 28035 000205'01 275 03 0 00 000101 subi t3, "A" ; Bring into offset range 28036 000206'01 260 17 1 03 000000# call @sndpkt(t3) ; Call the right routine 28037 000207'01 263 17 0 00 000000 ret ; Pass the error back up 28038 smsg < 28039 000210'01 120 02 0 00 000000# > ; Otherwise, tie off the log file line 28040 000211'01 260 17 0 00 000154* 28041 000014'02 000000000000# k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-1 K20PDC MAC 27-Mar-24 20:17 Decode a sent packet 28042 000015'02 777777 777776 28043 000027'03 015 012 000 000 000 28044 000212'01 263 17 0 00 000000 ret ; Returns +1, always 28045 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20PDC MAC 27-Mar-24 20:17 Jump table for sent packet types 28046 subttl Jump table for sent packet types 28047 28048 .endps code ; Constant tables don't go in code 28049 .psect const ; they go into the constants psect 28050 28051 000016'02 000000000000# sndpkt: INVSND ; "A" - Attributes 28052 000017'02 000000000000# sndeot ; "B" - EOT 28053 000020'02 000000000000# INVSND ; "C" - Largely unimplemented host command 28054 000021'02 000000000000# sndata ; "D" - Data 28055 000022'02 000000000000# snderr ; "E" - Error packet 28056 000023'02 000000000000# sndfil ; "F" - File Header 28057 000024'02 000000000000# sndgen ; "G" - Sending a generic command 28058 000025'02 000000000000# INVSND ; "H" - Undefined 28059 000026'02 000000000000# sndinz ; "I" - Info Packet 28060 000027'02 000000000000# INVSND ; "J" - Undefined 28061 000030'02 000000000000# INVSND ; "K" - Undefined 28062 000031'02 000000000000# INVSND ; "L" - Undefined 28063 000032'02 000000000000# INVSND ; "M" - Undefined 28064 000033'02 000000000000# sndnak ; "N" - Negative Acknowledge (NAK) 28065 000034'02 000000000000# INVSND ; "O" - Undefined 28066 000035'02 000000000000# INVSND ; "P" - Undefined 28067 000036'02 000000000000# INVSND ; "Q" - Undefined 28068 000037'02 000000000000# sndrec ; "R" - Receive (GET) 28069 000040'02 000000000000# sndini ; "S" - Send 28070 000041'02 000000000000# INVSND ; "T" - Specially handled, somehow 28071 000042'02 000000000000# INVSND ; "U" - Undefined 28072 000043'02 000000000000# INVSND ; "V" - Undefined 28073 000044'02 000000000000# INVSND ; "W" - Undefined 28074 000045'02 000000000000# sndtxt ; "X" - Text Header 28075 000046'02 000000000000# sndack ; "Y" - Acknowledge (ACK) 28076 000047'02 000000000000# sndeof ; "Z" - EOF 28077 28078 .endps const ; Done with constants 28079 .psect code ; Back to generating code 28080 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20PDC MAC 27-Mar-24 20:17 Invalid Send Packet 28081 subttl Invalid Send Packet 28082 28083 000213'01 200 01 0 00 000013 INVSND: move t1, p3 ; Load log file 28084 000214'01 120 02 0 00 000000# smsg (<, Invalid packet type: ">) ;" Fool font crock mode 28085 000215'01 260 17 0 00 000211* 28086 000050'02 000000000000# 28087 000051'02 777777 777750 28088 000030'03 054 040 111 156 166 28089 000216'01 200 02 0 00 000004 invsn1: move t2, t4 ; Load it 28090 000217'01 260 17 0 00 000102* call BOUTI% ; Put it in the log 28091 000220'01 201 02 0 00 000042 invsn2: movei t2, .chdbq ; Load closing double quote 28092 000221'01 260 17 0 00 000217* call BOUTI% ; Put it in the log 28093 000222'01 361 07 0 00 000175* sojl q3, RSKP ; Nothing here? That's fine 28094 000223'01 254 00 0 00 000233' callret sndata ; Dump any data that came along with it 28095 000224'01 254 00 0 00 000222* retskp ; Successfully whined ... 28096 28097 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20PDC MAC 27-Mar-24 20:17 Various Commands, many mostly dinky 28098 subttl Various Commands, many mostly dinky 28099 28100 000225'01 sndeot: remark Sending a "B" - End of Transmission 28101 000225'01 120 02 0 00 000000# smsg (<, End of Transmission>) 28102 000226'01 260 17 0 00 000215* 28103 000052'02 000000000000# 28104 000053'02 777777 777753 28105 000035'03 054 040 105 156 144 28106 000227'01 361 07 0 00 000224* sojl q3, RSKP ; Nothing here? That's fine 28107 000230'01 120 02 0 00 000000# smsg <: > ; Shouldn't have anything in it, but... 28108 000231'01 260 17 0 00 000226* 28109 000054'02 000000000000# 28110 000055'02 777777 777776 28111 000042'03 072 040 000 000 000 28112 000232'01 254 00 0 00 000250' callret sndat1 ; Dump it 28113 28114 28115 000233'01 sndata: remark Sending a "D" - Data Packet 28116 000233'01 120 02 0 00 000000# smsg <, Data: > ; The packet data 28117 000234'01 260 17 0 00 000231* 28118 000056'02 000000000000# 28119 000057'02 777777 777770 28120 000043'03 054 040 104 141 164 28121 000235'01 337 02 0 00 000203* skipg t2,datlen ;[241] ; typing anything? 28122 000236'01 254 00 0 00 000250' ifskp. ;[241] ; Yes, say how long 28123 000237'01 201 03 0 00 000012 movx t3,fld(^d10,no%rdx) ;[241] 28124 000240'01 104 00 0 00 000224 NOUT% ;[241] ; Length is in decimal 28125 000241'01 320 14 0 00 000243' ifje. s ;[241] ; Catch and suppress error 28126 000242'01 254 00 0 00 000246' 28127 000243'01 120 02 0 00 000000# smsg ();[241] ; Flag an error 28128 000244'01 260 17 0 00 000234* 28129 000060'02 000000000000# 28130 000061'02 777777 777775 28131 000045'03 077 054 040 000 000 28132 000245'01 254 00 0 00 000250' else. ;[241] ; Otherwise, worked fine 28133 000246'01 120 02 0 00 000000# smsg (<, >) ;[241] ; space over 28134 000247'01 260 17 0 00 000244* 28135 000062'02 000000000000# 28136 000063'02 777777 777776 28137 000046'03 054 040 000 000 000 28138 000250'01 endif. ;[241] ; End case NOUT% result handling 28139 000250'01 endif. ;[241] ; End case data packet 28140 28141 000250'01 200 02 0 00 000202* sndat1: move t2, sdatpt ; Load pointer to data area of packet 28142 000251'01 210 03 0 00 000235* movn t3, datlen ; Length of same 28143 000252'01 322 03 0 00 000256' ifn. t3 ; Ditch the SOUT% if nothing there 28144 000253'01 104 00 0 00 000053 SOUT% ; Spew that 28145 000254'01 320 12 0 00 000031' erjmpr deberr ; Or didn't 28146 000255'01 254 00 0 00 000260' else. ; That's odd 28147 000256'01 120 02 0 00 000000# smsg (<(null)>) ; Blat about it 28148 000257'01 260 17 0 00 000247* 28149 000064'02 000000000000# 28150 000065'02 777777 777772 28151 000047'03 050 156 165 154 154 28152 000260'01 endif. ; End case non-zero data k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11-1 K20PDC MAC 27-Mar-24 20:17 Various Commands, many mostly dinky 28153 000260'01 254 00 0 00 000227* retskp 28154 28155 28156 000261'01 snderr: remark Sending an "E" - Error (Fatal) 28157 000261'01 120 02 0 00 000000# smsg (<, Error>) 28158 000262'01 260 17 0 00 000257* 28159 000066'02 000000000000# 28160 000067'02 777777 777771 28161 000051'03 054 040 105 162 162 28162 000263'01 361 07 0 00 000260* sojl q3, RSKP ; Nothing here? That's fine 28163 000264'01 254 00 0 00 000233' callret sndata ; Dump it 28164 28165 28166 000265'01 sndfil: remark Sending a "F" - (Fetch or Name this File) 28167 000265'01 120 02 0 00 000000# smsg <, File: > ; The packet name 28168 000266'01 260 17 0 00 000262* 28169 000070'02 000000000000# 28170 000071'02 777777 777770 28171 000053'03 054 040 106 151 154 28172 000267'01 254 00 0 00 000250' callret sndat1 ; Dump it 28173 28174 28175 000270'01 sndinz: remark Sending an "I" - Initialization (here are my parameters) 28176 smsg (<, Initialization 28177 000270'01 120 02 0 00 000000# >) 28178 000271'01 260 17 0 00 000266* 28179 000072'02 000000000000# 28180 000073'02 777777 777752 28181 000055'03 054 040 111 156 151 28182 28183 000272'01 254 00 0 00 000527' callret params ; Break out the parameters 28184 28185 000273'01 sndnak: remark Sending an "N" - Negative acknowledgement 28186 000273'01 120 02 0 00 000000# smsg (<, Negative Acknowledge>) 28187 000274'01 260 17 0 00 000271* 28188 000074'02 000000000000# 28189 000075'02 777777 777752 28190 000062'03 054 040 116 145 147 28191 000275'01 254 00 0 00 000263* retskp 28192 28193 000276'01 sndrec: remark Sending an "R" - Receive (this file) 28194 000276'01 120 02 0 00 000000# smsg <, Receive: > ; The packet name 28195 000277'01 260 17 0 00 000274* 28196 000076'02 000000000000# 28197 000077'02 777777 777765 28198 000067'03 054 040 122 145 143 28199 000300'01 254 00 0 00 000250' callret sndat1 ; Dump it 28200 28201 28202 000301'01 sndini: remark Sending an "S" - Send Initiation 28203 smsg (<, Send Initiation 28204 000301'01 120 02 0 00 000000# >) 28205 000302'01 260 17 0 00 000277* 28206 000100'02 000000000000# 28207 000101'02 777777 777751 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11-2 K20PDC MAC 27-Mar-24 20:17 Various Commands, many mostly dinky 28208 000072'03 054 040 123 145 156 28209 28210 000303'01 254 00 0 00 000527' callret params ; Break out the parameters 28211 28212 000304'01 sndtxt: remark Sending an "X" - Display this data on terminal 28213 000304'01 120 02 0 00 000000# smsg <, Text: > ; ; The packet name 28214 000305'01 260 17 0 00 000302* 28215 000102'02 000000000000# 28216 000103'02 777777 777770 28217 000077'03 054 040 124 145 170 28218 000306'01 254 00 0 00 000250' callret sndat1 ; Dump it 28219 28220 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20PDC MAC 27-Mar-24 20:17 Sending Acknowledgement table 28221 subttl Sending Acknowledgement table 28222 28223 .endps code ; Constant tables don't go in code 28224 .psect const ; they go into the constants psect 28225 28226 000104'02 000000000000# acktab: defack ; "A" - Attributes 28227 000105'02 000000000000# defack ; "B" - EOT 28228 000106'02 000000000000# defack ; "C" - Largely unimplemented host command 28229 000107'02 000000000000# defack ; "D" - Data 28230 000110'02 000000000000# errack ; "E" - Error packet 28231 000111'02 000000000000# defack ; "F" - File Header 28232 000112'02 000000000000# defack ; "G" - Sending a generic command 28233 000113'02 000000000000# defack ; "H" - Undefined 28234 000114'02 000000000000# inzack ; "I" - Info Packet 28235 000115'02 000000000000# UNDACK ; "J" - Undefined 28236 000116'02 000000000000# UNDACK ; "K" - Undefined 28237 000117'02 000000000000# UNDACK ; "L" - Undefined 28238 000120'02 000000000000# UNDACK ; "M" - Undefined 28239 000121'02 000000000000# errack ; "N" - Negative Acknowledge (NAK) 28240 000122'02 000000000000# UNDACK ; "O" - Undefined 28241 000123'02 000000000000# UNDACK ; "P" - Undefined 28242 000124'02 000000000000# UNDACK ; "Q" - Undefined 28243 000125'02 000000000000# defack ; "R" - Receive (GET) 28244 000126'02 000000000000# iniack ; "S" - Send 28245 000127'02 000000000000# defack ; "T" - Specially handled, somehow 28246 000130'02 000000000000# UNDACK ; "U" - Undefined 28247 000131'02 000000000000# UNDACK ; "V" - Undefined 28248 000132'02 000000000000# UNDACK ; "W" - Undefined 28249 000133'02 000000000000# defack ; "X" - Text Header 28250 000134'02 000000000000# errack ; "Y" - Acknowledge (ACK) 28251 000135'02 000000000000# defack ; "Z" - EOF 28252 28253 .endps const ; Done with constants 28254 .psect code ; Back to generating code 28255 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20PDC MAC 27-Mar-24 20:17 Acknowledgement dispatch 28256 subttl Acknowledgement dispatch 28257 28258 000307'01 265 16 0 00 001042' sndack: saveac ; Needs some scratch 28259 000310'01 200 05 0 00 000250* move q1, sdatpt ; Load the pointer to the packet's data field 28260 000311'01 200 07 0 00 000251* move q3, datlen ; Number of initialization bytes 28261 28262 000312'01 200 04 0 00 000000# move t4, lstpkt ; Load what we should be acknowledging 28263 000313'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28264 000314'01 200 03 0 00 000004 move t3, t4 ; Save a working copy 28265 000315'01 275 03 0 00 000101 subi t3, "A" ; Bring into offset range 28266 000316'01 254 00 1 03 000000# callret @acktab(t3) ; Continue the right routine 28267 28268 28269 000317'01 UNDACK: remark ; Packet type the Kermit-20 does not do 28270 000317'01 120 02 0 00 000000# smsg (<, Undefined Acknowlege for packet type: ">) ;" Fool font crock mode 28271 000320'01 260 17 0 00 000305* 28272 000136'02 000000000000# 28273 000137'02 777777 777727 28274 000101'03 054 040 125 156 144 28275 000321'01 254 00 0 00 000216' callret invsn1 ; Finish logging it 28276 28277 000322'01 errack: remark ; Shouldn't acknowledge "Y", "N" or "E" 28278 000322'01 120 02 0 00 000000# smsg (<, ERROR: should not be acknowledging a packet type: ">) ;" Fool 28279 000323'01 260 17 0 00 000320* 28280 000140'02 000000000000# 28281 000141'02 777777 777713 28282 000112'03 054 040 105 122 122 28283 000324'01 254 00 0 00 000216' callret invsn1 ; Finish logging it 28284 28285 000325'01 iniack: remark ; Response to "S" 28286 smsg (<, Send Initiation Acknowledgement 28287 000325'01 120 02 0 00 000000# >) 28288 000326'01 260 17 0 00 000323* 28289 000142'02 000000000000# 28290 000143'02 777777 777731 28291 000125'03 054 040 123 145 156 28292 28293 000327'01 254 00 0 00 000527' callret params ; Break out the parameters 28294 28295 000330'01 inzack: remark ; Response to "I" 28296 smsg (<, Initialization Acknowledgement 28297 000330'01 120 02 0 00 000000# >) 28298 000331'01 260 17 0 00 000326* 28299 000144'02 000000000000# 28300 000145'02 777777 777732 28301 000135'03 054 040 111 156 151 28302 28303 000332'01 254 00 0 00 000527' callret params ; Break out the parameters 28304 28305 000333'01 defack: remark ; All others is to print any contents 28306 000333'01 326 07 0 00 000351' ife. q3 ; If none, then nothing further to do 28307 000334'01 120 02 0 00 000000# smsg (<, Acknowledged packet type ">) ;" Fool font crock mode 28308 000335'01 260 17 0 00 000331* 28309 000146'02 000000000000# 28310 000147'02 777777 777744 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13-1 K20PDC MAC 27-Mar-24 20:17 Acknowledgement dispatch 28311 000145'03 054 040 101 143 153 28312 000336'01 200 02 0 00 000004 move t2, t4 ; Load what we're acknowledging 28313 000337'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28314 000340'01 260 17 0 00 000221* call BOUTI% ; Append to log 28315 000341'01 302 02 0 00 000107 caie t2, "G" ; Was this a generic command? 28316 000342'01 254 00 0 00 000346' ifskp. ; It was, so provide a little more clarity 28317 000343'01 200 02 0 00 000000# move t2, lstgen ; Load the kind of last generic 28318 000344'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28319 000345'01 260 17 0 00 000340* call BOUTI% ; Append to log 28320 000346'01 endif. 28321 000346'01 201 02 0 00 000042 movei t2, .chdbq ; Closing double quote 28322 000347'01 260 17 0 00 000345* call BOUTI% ; Append that, too 28323 000350'01 254 00 0 00 000275* retskp ; Worked, wonderfully... 28324 000351'01 endif. 28325 28326 000351'01 120 02 0 00 000000# smsg (<, Ack(>) ; Short acknowledgement 28327 000352'01 260 17 0 00 000335* 28328 000150'02 000000000000# 28329 000151'02 777777 777772 28330 000153'03 054 040 101 143 153 28331 000353'01 200 02 0 00 000004 move t2, t4 ; Load what we're acknowledging 28332 000354'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28333 000355'01 260 17 0 00 000347* call BOUTI% ; Append to log 28334 000356'01 302 02 0 00 000107 caie t2, "G" ; Was this a generic command? 28335 000357'01 254 00 0 00 000363' ifskp. ; It was, so provide a little more clarity 28336 000360'01 200 02 0 00 000000# move t2, lstgen ; By getting the last generic command 28337 000361'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28338 000362'01 260 17 0 00 000355* call BOUTI% ; Append to log 28339 000363'01 endif. 28340 000363'01 120 02 0 00 000000# smsg (<), >) ; Close and space over 28341 000364'01 260 17 0 00 000352* 28342 000152'02 000000000000# 28343 000153'02 777777 777775 28344 000155'03 051 054 040 000 000 28345 28346 000365'01 200 02 0 00 000005 move t2, q1 ; Load the pointer to the data area 28347 000366'01 210 03 0 00 000007 movn t3, q3 ; Negative length of data area 28348 000367'01 104 00 0 00 000053 SOUT% ; Get the response into the log 28349 000370'01 320 12 0 00 000031' erjmpr deberr ; Or didn't... 28350 000371'01 254 00 0 00 000350* retskp ; Worked!! 28351 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20PDC MAC 27-Mar-24 20:17 Sending a "Z" - End of File 28352 subttl Sending a "Z" - End of File 28353 28354 000372'01 120 02 0 00 000000# sndeof: smsg (<, End of File>) 28355 000373'01 260 17 0 00 000364* 28356 000154'02 000000000000# 28357 000155'02 777777 777763 28358 000156'03 054 040 105 156 144 28359 000374'01 200 05 0 00 000310* move q1, sdatpt ; Load the pointer the packet's data field 28360 000375'01 200 07 0 00 000311* move q3, datlen ; Number of initialization bytes 28361 ; See if being told to discard file 28362 000376'01 361 07 0 00 000371* sojl q3, RSKP ; But only if there is a character 28363 000377'01 134 06 0 00 000005 ildb q2, q1 ; Load the action character 28364 000400'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28365 000401'01 302 06 0 00 000104 caie q2, "D" ; Got told to discard? 28366 000402'01 254 00 0 00 000406' ifskp. ; We did 28367 000403'01 120 02 0 00 000000# smsg (<, Discarding>) ; Blat about it 28368 000404'01 260 17 0 00 000373* 28369 000156'02 000000000000# 28370 000157'02 777777 777764 28371 000161'03 054 040 104 151 163 28372 000405'01 254 00 0 00 000411' else. ; Otherwise, something odd 28373 000406'01 120 02 0 00 000000# smsg (<, >) ; So blat about that 28374 000407'01 260 17 0 00 000404* 28375 000160'02 000000000000# 28376 000161'02 777777 777776 28377 000164'03 054 040 000 000 000 28378 000410'01 254 00 0 00 000250' callret sndat1 ; and put into the log 28379 000411'01 endif. ; End of Discard decision 28380 28381 000411'01 254 00 0 00 000376* retskp ; Successfully decode the packet 28382 28383 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20PDC MAC 27-Mar-24 20:17 Generic Send Packet Types 28384 subttl Generic Send Packet Types 28385 28386 .endps code ; Constant tables don't go in code 28387 .psect const ; they go into the constants psect 28388 28389 000162'02 000000000000# sgenpt: genpwd ; A - PWD 28390 000163'02 000000000000# INVGEN ; B - Undefined 28391 000164'02 000000000000# gencwd ; C - CWD 28392 000165'02 000000000000# gendir ; D - Directory 28393 000166'02 000000000000# gendel ; E - Erase (delete) 28394 000167'02 000000000000# genfin ; F - Finish 28395 000170'02 000000000000# gencdu ;[254] ; G - CDUP 28396 000171'02 000000000000# genhlp ; H - Help 28397 000172'02 000000000000# INVGEN ; I - Login (not yet implemented) 28398 000173'02 000000000000# INVGEN ; J - Journal control (nyi) 28399 000174'02 000000000000# INVGEN ; K - Copy (nyi) 28400 000175'02 000000000000# genbye ; L - Logout, Bye 28401 000176'02 000000000000# INVGEN ; M - Undefined 28402 000177'02 000000000000# INVGEN ; N - Undefined 28403 000200'02 000000000000# INVGEN ; O - Undefined 28404 000201'02 000000000000# INVGEN ; P - Program invocation (nyi) 28405 000202'02 000000000000# gensta ; Q - Server status query 28406 000203'02 000000000000# INVGEN ; R - Rename (nyi) 28407 000204'02 000000000000# INVGEN ; S - Undefined 28408 000205'02 000000000000# INVGEN ; T - Type 28409 000206'02 000000000000# gendsk ; U - Disk Usage 28410 000207'02 000000000000# INVGEN ; V - Variable Set/Query 28411 000210'02 000000000000# INVGEN ; W - Who (Finger) 28412 000211'02 000000000000# INVGEN ; X - Undefined 28413 000212'02 000000000000# INVGEN ; Y - Undefined 28414 000213'02 000000000000# INVGEN ; Z - Undefined 28415 28416 .endps const ; Done with constants 28417 .psect code ; Back to generating code 28418 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20PDC MAC 27-Mar-24 20:17 Send Generic Command 28419 subttl Send Generic Command 28420 28421 000412'01 sndgen: remark t1, p3 ; Already loaded with JFN 28422 000412'01 120 02 0 00 000000# smsg <, Generic, > ; A generic packet type 28423 000413'01 260 17 0 00 000407* 28424 000214'02 000000000000# 28425 000215'02 777777 777765 28426 000165'03 054 040 107 145 156 28427 28428 000414'01 371 00 0 00 000007 sosl q3 ; Malformed? 28429 000415'01 254 00 0 00 000421' ifskp. ; It is 28430 000416'01 120 02 0 00 000000# smsg (<(% No action character)>) 28431 000417'01 260 17 0 00 000413* 28432 000216'02 000000000000# 28433 000217'02 777777 777751 28434 000170'03 050 045 040 116 157 28435 000420'01 254 00 0 00 000411* retskp ; Handled malformed character OK 28436 000421'01 endif. 28437 28438 000421'01 134 04 0 00 000005 ildb t4, q1 ; Pick up the generic command character 28439 000422'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28440 000423'01 301 04 0 00 000101 cail t4, "A" ; Before "A"? 28441 000424'01 303 04 0 00 000132 caile t4, "Z" ; or after "Z"? 28442 000425'01 254 00 0 00 000432' jrst invgen ; Can't do the jump table 28443 000426'01 202 04 0 00 000000# movem t4, lstgen ; Set last generic 28444 28445 000427'01 200 03 0 00 000004 move t3, t4 ; Save a copy in case of error 28446 000430'01 275 03 0 00 000101 subi t3, "A" ; Bring into offset range 28447 000431'01 254 00 1 03 000000# callret @sgenpt(t3) ; Invoke the correct decoding routine 28448 28449 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20PDC MAC 27-Mar-24 20:17 Invalid Generic message type 28450 subttl Invalid Generic message type 28451 28452 000432'01 120 02 0 00 000000# INVGEN: smsg () ;" Fool font crock mode 28453 000433'01 260 17 0 00 000417* 28454 000220'02 000000000000# 28455 000221'02 777777 777751 28456 000175'03 111 156 166 141 154 28457 000434'01 254 00 0 00 000216' callret invsn1 ; Finish logging it 28458 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20PDC MAC 27-Mar-24 20:17 Trivial Generic Requests 28459 subttl Trivial Generic Requests 28460 28461 000435'01 genpwd: remark "A" 28462 000435'01 120 02 0 00 000000# smsg () 28463 000436'01 260 17 0 00 000433* 28464 000222'02 000000000000# 28465 000223'02 777777 777751 28466 000202'03 120 162 151 156 164 28467 000437'01 254 00 0 00 000420* retskp 28468 28469 000440'01 gencdu: remark "G" ;[254] 28470 000440'01 120 02 0 00 000000# smsg () ;;[254] 28471 000441'01 260 17 0 00 000436* 28472 000224'02 000000000000# 28473 000225'02 777777 777746 28474 000207'03 103 157 156 156 145 28475 000442'01 254 00 0 00 000437* retskp ;[254] 28476 28477 000443'01 gencwd: remark "C" 28478 000443'01 120 02 0 00 000000# smsg () 28479 000444'01 260 17 0 00 000441* 28480 000226'02 000000000000# 28481 000227'02 777777 777750 28482 000215'03 103 150 141 156 147 28483 000445'01 260 17 0 00 000475' call genarg ; Print the working directory, if any 28484 000446'01 600 00 0 00 000000 nop ; Ignore error 28485 000447'01 254 00 0 00 000442* retskp 28486 28487 000450'01 gendir: remark "D" 28488 000450'01 120 02 0 00 000000# smsg () 28489 000451'01 260 17 0 00 000444* 28490 000230'02 000000000000# 28491 000231'02 777777 777767 28492 000222'03 104 151 162 145 143 28493 000452'01 254 00 0 00 000475' callret genarg 28494 28495 000453'01 gendel: remark "E" 28496 000453'01 120 02 0 00 000000# smsg () 28497 000454'01 260 17 0 00 000451* 28498 000232'02 000000000000# 28499 000233'02 777777 777773 28500 000224'03 105 162 141 163 145 28501 000455'01 254 00 0 00 000475' callret genarg 28502 28503 000456'01 genfin: remark "F" 28504 000456'01 120 02 0 00 000000# smsg () 28505 000457'01 260 17 0 00 000454* 28506 000234'02 000000000000# 28507 000235'02 777777 777772 28508 000226'03 106 151 156 151 163 28509 000460'01 254 00 0 00 000447* retskp 28510 28511 000461'01 genhlp: remark "H" 28512 000461'01 120 02 0 00 000000# smsg () 28513 000462'01 260 17 0 00 000457* k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18-1 K20PDC MAC 27-Mar-24 20:17 Trivial Generic Requests 28514 000236'02 000000000000# 28515 000237'02 777777 777774 28516 000230'03 110 145 154 160 000 28517 000463'01 254 00 0 00 000460* retskp 28518 28519 000464'01 genbye: remark "L" 28520 000464'01 120 02 0 00 000000# smsg () 28521 000465'01 260 17 0 00 000462* 28522 000240'02 000000000000# 28523 000241'02 777777 777772 28524 000231'03 114 157 147 157 165 28525 000466'01 254 00 0 00 000463* retskp 28526 28527 000467'01 gensta: remark "Q" 28528 000467'01 120 02 0 00 000000# smsg () 28529 000470'01 260 17 0 00 000465* 28530 000242'02 000000000000# 28531 000243'02 777777 777755 28532 000233'03 123 145 162 166 145 28533 000471'01 254 00 0 00 000466* retskp 28534 28535 000472'01 gendsk: remark "U" 28536 000472'01 120 02 0 00 000000# smsg () 28537 000473'01 260 17 0 00 000470* 28538 000244'02 000000000000# 28539 000245'02 777777 777766 28540 000237'03 104 151 163 153 040 28541 000474'01 254 00 0 00 000471* retskp 28542 28543 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20PDC MAC 27-Mar-24 20:17 Generic Argument Decode 28544 subttl Generic Argument Decode 28545 28546 000475'01 361 07 0 00 000474* genarg: sojl q3, RSKP ; If nothing left, we're done 28547 000476'01 134 04 0 00 000005 ildb t4, q1 ; Pick up the length of the argument 28548 000477'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28549 28550 000500'01 200 12 0 00 000000* move p2, rquote ; Let's assume we are receiving 28551 000501'01 302 11 0 00 000122 caie p1, "R" ; However, are we? 28552 000502'01 200 12 0 00 000000* move p2, squote ; Nope, we are sending 28553 28554 000503'01 do. ; Enter loop context for each argument 28555 000503'01 312 12 0 00 000004 came p2, t4 ; Is the length the same as the quote 28556 000504'01 254 00 0 00 000510' ifskp. ; They are, so then the length has to be quoted 28557 000505'01 361 07 0 00 000475* sojl q3, RSKP ; If nothing left, we're done 28558 000506'01 134 04 0 00 000005 ildb t4, q1 ; Pick up the length of this argument 28559 000507'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28560 000510'01 endif. ; End case quoted length 28561 000510'01 275 04 0 00 000040 subi t4, .chspc ; Bring into numeric range 28562 000511'01 323 04 0 00 000505* jumple t4, RSKP ; No argument, depart 28563 000512'01 120 02 0 00 000000# smsg (<, >) ; Punctuate the argument 28564 000513'01 260 17 0 00 000473* 28565 000246'02 000000000000# 28566 000247'02 777777 777776 28567 000242'03 054 040 000 000 000 28568 000514'01 200 02 0 00 000005 move t2, q1 ; Load the properly advanced pointer 28569 000515'01 210 03 0 00 000004 movn t3, t4 ; Load the negative length 28570 000516'01 104 00 0 00 000053 SOUT% ; Put into the log 28571 000517'01 320 14 0 00 000000* erjmps r ; Shouldn't happen, JFN was fine 28572 000520'01 200 05 0 00 000002 move q1, t2 ; Update packet pointer 28573 000521'01 274 07 0 00 000004 sub q3, t4 ; Count off the characters we did 28574 000522'01 361 07 0 00 000511* sojl q3, RSKP ; See if we have another field and exit if not 28575 000523'01 134 04 0 00 000005 ildb t4, q1 ; Pick up the length of the argument 28576 000524'01 405 04 0 00 000177 andi t4, 177 ;[235] Strip off any parity 28577 000525'01 254 00 0 00 000503' loop. ; And go take care of that 28578 000526'01 enddo. ; End loop lexical context 28579 28580 000526'01 254 00 0 00 000522* retskp ; Superstition 28581 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20PDC MAC 27-Mar-24 20:17 Break out parameters for S and I packets 28582 subttl Break out parameters for S and I packets 28583 28584 ; Call: 28585 ; 28586 ; q1/ Pointer to packet's data field 28587 ; *q2/ Used internally for packet characters 28588 ; q3/ Number of bytes in packet's data field 28589 ; 28590 ; Return: 28591 ; 28592 ; +1 Some kind of failure 28593 ; +2 Successfully decoded 28594 28595 000527'01 120 02 0 00 000000# params: smsg () 28596 000530'01 260 17 0 00 000513* 28597 000250'02 000000000000# 28598 000251'02 777777 777770 28599 000243'03 120 141 162 141 155 28600 000531'01 200 02 0 00 000375* move t2, datlen 28601 000532'01 201 03 0 00 000012 movei t3, ^d10 28602 000533'01 104 00 0 00 000224 NOUT% 28603 000534'01 320 12 0 00 000517* erjmpr r 28604 28605 000535'01 361 07 0 00 000526* sojl q3, RSKP ; Only if there 28606 000536'01 134 06 0 00 000005 ildb q2, q1 ; Load the maximum length 28607 000537'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28608 000540'01 120 02 0 00 000000# smsg (<, MaxL: >) 28609 000541'01 260 17 0 00 000530* 28610 000252'02 000000000000# 28611 000253'02 777777 777770 28612 000245'03 054 040 115 141 170 28613 000542'01 200 02 0 00 000006 move t2, q2 28614 000543'01 275 02 0 00 000040 subi t2, .chspc 28615 000544'01 201 03 0 00 000012 movei t3, ^d10 28616 000545'01 104 00 0 00 000224 NOUT% ; 1 Packet size 28617 000546'01 320 12 0 00 000534* erjmpr r 28618 28619 000547'01 361 07 0 00 000535* sojl q3, RSKP ; Only if there 28620 000550'01 134 06 0 00 000005 ildb q2, q1 ; Load the time out 28621 000551'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28622 000552'01 120 02 0 00 000000# smsg (<, TimO: >) 28623 000553'01 260 17 0 00 000541* 28624 000254'02 000000000000# 28625 000255'02 777777 777770 28626 000247'03 054 040 124 151 155 28627 000554'01 200 02 0 00 000006 move t2, q2 28628 000555'01 275 02 0 00 000040 subi t2, .chspc 28629 000556'01 201 03 0 00 000012 movei t3, ^d10 28630 000557'01 104 00 0 00 000224 NOUT% ; 2 Time out 28631 000560'01 320 12 0 00 000546* erjmpr r 28632 28633 000561'01 361 07 0 00 000547* sojl q3, RSKP ; Only if there 28634 000562'01 134 06 0 00 000005 ildb q2, q1 ; Load the number of padding characters 28635 000563'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28636 000564'01 120 02 0 00 000000# smsg (<, Npad: >) k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20-1 K20PDC MAC 27-Mar-24 20:17 Break out parameters for S and I packets 28637 000565'01 260 17 0 00 000553* 28638 000256'02 000000000000# 28639 000257'02 777777 777770 28640 000251'03 054 040 116 160 141 28641 000566'01 200 02 0 00 000006 move t2, q2 28642 000567'01 275 02 0 00 000040 subi t2, .chspc 28643 000570'01 201 03 0 00 000012 movei t3, ^d10 28644 000571'01 104 00 0 00 000224 NOUT% ; 3 Padding (character count) 28645 000572'01 320 12 0 00 000560* erjmpr r 28646 28647 000573'01 361 07 0 00 000561* sojl q3, RSKP ; Only if there 28648 000574'01 134 06 0 00 000005 ildb q2, q1 ; Load the padding character 28649 000575'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28650 000576'01 120 02 0 00 000000# smsg (<, PadC: >) ; 4 28651 000577'01 260 17 0 00 000565* 28652 000260'02 000000000000# 28653 000261'02 777777 777770 28654 000253'03 054 040 120 141 144 28655 000600'01 200 02 0 00 000006 move t2, q2 28656 000601'01 271 02 0 00 000100 addi t2, ^o100 ; It's in excess 64 (decimal) 28657 000602'01 405 02 0 00 000177 andi t2, ^o177 ; Clip if it went to eight bits 28658 000603'01 260 17 0 00 000774' call outc ; Output as a control character 28659 28660 000604'01 361 07 0 00 000573* sojl q3, RSKP ; Only if there 28661 000605'01 134 06 0 00 000005 ildb q2, q1 ; Load the packet terminator 28662 000606'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28663 000607'01 120 02 0 00 000000# smsg (<, EOL: >) ; 5 28664 000610'01 260 17 0 00 000577* 28665 000262'02 000000000000# 28666 000263'02 777777 777771 28667 000255'03 054 040 105 117 114 28668 000611'01 200 02 0 00 000006 move t2, q2 28669 000612'01 275 02 0 00 000040 subi t2, .chspc ; Bring into control range 28670 000613'01 260 17 0 00 000774' call outc ; Output as a control character 28671 28672 000614'01 361 07 0 00 000604* sojl q3, RSKP ; Only if there 28673 000615'01 134 06 0 00 000005 ildb q2, q1 ; Load the control prefix 28674 000616'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28675 000617'01 120 02 0 00 000000# smsg (<, Qctl: >) ; 6 28676 000620'01 260 17 0 00 000610* 28677 000264'02 000000000000# 28678 000265'02 777777 777770 28679 000257'03 054 040 121 143 164 28680 000621'01 200 02 0 00 000006 move t2, q2 28681 000622'01 260 17 0 00 000774' call outc ; Output as a control character 28682 28683 000623'01 361 07 0 00 000614* sojl q3, RSKP ; Only if there 28684 000624'01 134 06 0 00 000005 ildb q2, q1 ; Load the eight bit quote 28685 000625'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28686 000626'01 120 02 0 00 000000# smsg (<, Qbin: >) ; 7 28687 000627'01 260 17 0 00 000620* 28688 000266'02 000000000000# 28689 000267'02 777777 777770 28690 000261'03 054 040 121 142 151 28691 000630'01 200 02 0 00 000006 move t2, q2 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20-2 K20PDC MAC 27-Mar-24 20:17 Break out parameters for S and I packets 28692 000631'01 302 02 0 00 000131 caie t2, "Y" ; Am I agreeing? 28693 000632'01 254 00 0 00 000636' ifskp. ; I'm agreeable 28694 000633'01 120 02 0 00 000000# smsg 28695 000634'01 260 17 0 00 000627* 28696 000270'02 000000000000# 28697 000271'02 777777 777775 28698 000263'03 131 145 163 000 000 28699 000635'01 254 00 0 00 000644' else. ; Otherwise, could be other things 28700 000636'01 302 02 0 00 000116 caie t2, "N" ; Am I refusing 8 bit 28701 000637'01 254 00 0 00 000643' ifskp. ; I'm disagreeble 28702 000640'01 120 02 0 00 000000# smsg 28703 000641'01 260 17 0 00 000634* 28704 000272'02 000000000000# 28705 000273'02 777777 777776 28706 000264'03 116 157 000 000 000 28707 000642'01 254 00 0 00 000644' else. ; Neither one is the 8 bit quote character 28708 000643'01 260 17 0 00 000774' call outc ; Output as a possible control character 28709 000644'01 endif. ; End case No or actual character 28710 000644'01 endif. ; End case Yes or something else 28711 28712 000644'01 361 07 0 00 000623* sojl q3, RSKP ; Only if there 28713 000645'01 134 06 0 00 000005 ildb q2, q1 ; Load the block check type 28714 000646'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28715 000647'01 120 02 0 00 000000# smsg (<, ChkT: >) ; 8 28716 000650'01 260 17 0 00 000641* 28717 000274'02 000000000000# 28718 000275'02 777777 777770 28719 000265'03 054 040 103 150 153 28720 000651'01 200 04 0 00 000006 move t4, q2 28721 000652'01 120 02 0 00 000000# dxtext (t2, ) 28722 000276'02 000000000000# 28723 000277'02 777777 777761 28724 000267'03 040 074 117 165 164 28725 000653'01 306 04 0 00 000061 cain t4, "1" 28726 000654'01 120 02 0 00 000000# dxtext (t2,<6-bit>) 28727 000300'02 000000000000# 28728 000301'02 777777 777773 28729 000273'03 066 055 142 151 164 28730 000655'01 306 04 0 00 000062 cain t4, "2" 28731 000656'01 120 02 0 00 000000# dxtext (t2,<12-bit>) 28732 000302'02 000000000000# 28733 000303'02 777777 777772 28734 000275'03 061 062 055 142 151 28735 000657'01 306 04 0 00 000063 cain t4, "3" 28736 000660'01 120 02 0 00 000000# dxtext (t2,<16-bit CRC>) 28737 000304'02 000000000000# 28738 000305'02 777777 777766 28739 000277'03 061 066 055 142 151 28740 000661'01 260 17 0 00 000650* call %%smsg ; Handle as if I did an smsg 28741 28742 000662'01 361 07 0 00 000644* sojl q3, RSKP ; Only if there 28743 000663'01 134 06 0 00 000005 ildb q2, q1 ; Load the repeat count prefix 28744 000664'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28745 000665'01 120 02 0 00 000000# smsg (<, Rept: >) ; 9 28746 000666'01 260 17 0 00 000661* k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20-3 K20PDC MAC 27-Mar-24 20:17 Break out parameters for S and I packets 28747 000306'02 000000000000# 28748 000307'02 777777 777770 28749 000302'03 054 040 122 145 160 28750 000667'01 200 02 0 00 000006 move t2, q2 28751 000670'01 260 17 0 00 000362* call BOUTI% 28752 28753 remark Extended capabilities 28754 28755 000671'01 361 07 0 00 000662* sojl q3, RSKP ; If nothing left, we're done 28756 000672'01 134 06 0 00 000005 ildb q2, q1 ; Otherwise, pick up first capability mask 28757 000673'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28758 000674'01 275 06 0 00 000040 subi q2, .chspc ; Bring into numeric range 28759 000675'01 606 06 0 00 000002 trnn q2, 2 ; Is the Long Packets capability bit on? 28760 000676'01 254 00 0 00 000671* retskp ; No, we can't do anything else 28761 000677'01 120 02 0 00 000000# smsg (<, Long: >) ; 10 28762 000700'01 260 17 0 00 000666* 28763 000310'02 000000000000# 28764 000311'02 777777 777770 28765 000304'03 054 040 114 157 156 28766 28767 000701'01 415 16 0 00 000723' block. ; Enter block context for better control flow 28768 000702'01 261 17 0 00 000016 28769 000703'01 361 07 0 00 000572* sojl q3, r ; Stop if Sliding Windows isn't there 28770 000704'01 134 06 0 00 000005 ildb q2, q1 ; Yet ignore it because we don't do it 28771 000705'01 405 06 0 00 000177 andi q2, 177 ;[235] Strip off any parity 28772 000706'01 361 07 0 00 000703* sojl q3, r ; Stop if high order is not there 28773 000707'01 134 02 0 00 000005 ildb t2, q1 ; Load the high order 28774 000710'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28775 000711'01 275 02 0 00 000040 subi t2, .chspc ; Bring into numeric range 28776 000712'01 221 02 0 00 000137 imuli t2, ^d95 ; High digit is base 94 28777 000713'01 361 07 0 00 000706* sojl q3, r ; Fail if low order is not there 28778 000714'01 134 03 0 00 000005 ildb t3, q1 ; It's there, load it 28779 000715'01 405 03 0 00 000177 andi t3, 177 ;[235] Strip off any parity 28780 000716'01 275 03 0 00 000040 subi t3, .chspc ; Bring into numeric range 28781 000717'01 270 02 0 00 000003 add t2, t3 ; Combine with high order 28782 000720'01 201 03 0 00 000012 movei t3, ^d10 ; Base 10 28783 000721'01 254 00 0 00 000676* retskp ; Flag we're actually doing long windows 28784 000722'01 263 17 0 00 000000 endbk. ; End block context 28785 000723'01 254 00 0 00 000730' ifskp. ; Have a number to type 28786 000724'01 104 00 0 00 000224 NOUT% ; Type it 28787 000725'01 320 12 0 00 000713* erjmpr r ; Or not 28788 000726'01 254 00 0 00 000721* retskp ; Succeed 28789 000727'01 254 00 0 00 000733' else. ; Otherwise, this is a request 28790 000730'01 120 02 0 00 000000# smsg () ; Say we'll accept it 28791 000731'01 260 17 0 00 000700* 28792 000312'02 000000000000# 28793 000313'02 777777 777767 28794 000306'03 101 166 141 151 154 28795 000732'01 254 00 0 00 000726* retskp ; This is OK, too 28796 000733'01 endif. 28797 28798 000733'01 254 00 0 00 000732* retskp ; This is superstition 28799 28800 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20PDC MAC 27-Mar-24 20:17 Packet Header 28801 subttl Packet Header 28802 28803 ; t4/ "R" or "S", depending on what we're doing 28804 28805 000734'01 200 01 0 00 000013 pkthdr: move t1, p3 ; Load the logging JFN 28806 000735'01 120 02 0 00 000000# smsg <, type: > ; The packet type 28807 000736'01 260 17 0 00 000731* 28808 000314'02 000000000000# 28809 000315'02 777777 777770 28810 000310'03 054 040 164 171 160 28811 000737'01 200 02 0 00 000162* move t2, type ; Message Type 28812 000740'01 405 02 0 00 000177 andi t2, 177 ;[235] Strip off any parity 28813 000741'01 260 17 0 00 000670* call BOUTI% ; Will further expand downstream 28814 000742'01 200 04 0 00 000002 move t4, t2 ; Save a copy of the type 28815 28816 000743'01 120 02 0 00 000000# smsg <, seq: > ; The sequence number 28817 000744'01 260 17 0 00 000736* 28818 000316'02 000000000000# 28819 000317'02 777777 777771 28820 000312'03 054 040 163 145 161 28821 000745'01 200 02 0 00 000000* move t2, sseqn ; Load the Sending Packet Number 28822 000746'01 302 04 0 00 000123 caie t4, "S" ; But are we? 28823 000747'01 200 02 0 00 000000* move t2, num ; No, so load the received Packet Number 28824 000750'01 201 03 0 00 000012 movei t3, ^d10 ; It's in base 10 28825 000751'01 104 00 0 00 000224 NOUT% ; Type that 28826 000752'01 320 12 0 00 000031' erjmpr deberr ; Or not... 28827 28828 000753'01 120 02 0 00 000000# smsg <, len: > ; Total packet length 28829 000754'01 260 17 0 00 000744* 28830 000320'02 000000000000# 28831 000321'02 777777 777771 28832 000314'03 054 040 154 145 156 28833 000755'01 200 02 0 00 000000* move t2, pktlen ; Includes the checksum 28834 000756'01 201 03 0 00 000012 movei t3, ^d10 ; It's in base 10 28835 000757'01 104 00 0 00 000224 NOUT% ; Type that 28836 000760'01 320 12 0 00 000031' erjmpr deberr ; Or not... 28837 28838 000761'01 336 00 0 00 000000* ifmn. islong ; Was this a long packet? 28839 000762'01 254 00 0 00 000765' 28840 000763'01 201 02 0 00 000114 movei t2, "L" ; Load flag for long packet 28841 000764'01 260 17 0 00 000741* call BOUTI% ; Append it as a c-like suffix 28842 000765'01 endif. ; End case long packet 28843 28844 000765'01 120 02 0 00 000000# smsg <, Blk: > ; Computed block check 28845 000766'01 260 17 0 00 000754* 28846 000322'02 000000000000# 28847 000323'02 777777 777771 28848 000316'03 054 040 102 154 153 28849 000767'01 200 02 0 00 000000* move t2, blkchk ; Load it 28850 000770'01 201 03 0 00 000012 movei t3, ^d10 ; We'll just use base 10 28851 000771'01 104 00 0 00 000224 NOUT% ; Type it 28852 000772'01 320 12 0 00 000031' erjmpr deberr ; Or not 28853 28854 000773'01 254 00 0 00 000733* retskp ; Worked 28855 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20PDC MAC 27-Mar-24 20:17 outc -- Output a single character, using ^X notation, DEL, etc. 28856 subttl outc -- Output a single character, using ^X notation, DEL, etc. 28857 28858 ; Call: 28859 ; 28860 ; t1/ JFN 28861 ; t2/ Character to frobinicate 28862 28863 extern BOUTI% ; In case this is going into a string 28864 28865 000774'01 405 02 0 00 000177 outc: andi t2, 177 ;[235] Strip off any parity 28866 000775'01 302 02 0 00 000177 caie t2, .chdel ; A rubout? 28867 000776'01 254 00 0 00 001002' ifskp. ; It is 28868 000777'01 120 02 0 00 000000# smsg ; Show it this way (^? being confusing?) 28869 001000'01 260 17 0 00 000766* 28870 000324'02 000000000000# 28871 000325'02 777777 777775 28872 000320'03 104 105 114 000 000 28873 001001'01 263 17 0 00 000000 ret ; Succeed 28874 001002'01 endif. 28875 28876 001002'01 301 02 0 00 000040 cail t2, .chspc ; Is it a control character? 28877 001003'01 254 00 0 00 001011' ifskp. ; It is 28878 001004'01 261 17 0 00 000002 push p, t2 ; Save the character 28879 001005'01 201 02 0 00 000136 movei t2, "^" ; Load the control quote 28880 001006'01 260 17 0 00 000764* call BOUTI% ; Output that 28881 001007'01 262 17 0 00 000002 pop p, t2 ; Restore original character 28882 001010'01 435 02 0 00 000100 ori t2, ^o100 ; Bring into printable range 28883 001011'01 endif. 28884 28885 001011'01 254 00 0 00 001006* callret BOUTI% ; Output possibly controlified character 28886 28887 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20PDC MAC 27-Mar-24 20:17 Vestigial Code found to be largely uninformative 28888 subttl Vestigial Code found to be largely uninformative 28889 28890 repeat 0,< ; Mark character doesn't change 28891 move t1, p3 ; Load the logging JFN 28892 smsg < 28893 sop: > ; Indicate what should start the packet 28894 move t1, rsthdr ; Load Receive Start of Packet character 28895 rot t1, -^d8 ; Position as an eight bit ASCII string 28896 movem t1, sop8st ; And store it 28897 28898 dmove t1, [ ^d1 ; We are only doing one dinky character 28899 point 8, sop8st ] ; And the source is what we just built 28900 call s8ccv7 ; String eight controlified convert to seven 28901 ret ; Shouldn't fail, but better give up 28902 >;;repeat 0 28903 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20PDC MAC 27-Mar-24 20:17 Code .psect close out 28904 subttl Code .psect close out 28905 28906 xlist ; Save the trees!! 28907 list ; Resume listing 28908 28909 .endps code ; Close the code .psect 28910 k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20PDC MAC 27-Mar-24 20:17 Module local working storage 28911 subttl Module local working storage 28912 28913 .psect data ; Open data storage 28914 000000'04 lstpkt: block 1 ; Last packet type 28915 000001'04 lstgen: block 1 ; Last generic type 28916 repeat 0,< 28917 sop8st: block 2 ; Start of Packet character as an 8 bit ASCII string 28918 > 28919 .endps data ; Close out the data .psect 28920 28921 .xcmsy ; Ditch any superfluous MACSYM junk 28922 end ; End of module NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 001054 FOR CODE PSECT 2 BREAK IS 000326 FOR CONST PSECT 3 BREAK IS 000321 FOR ETEXT PSECT 4 BREAK IS 000002 FOR DATA CPU TIME USED 00:00.424 93P CORE USED k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20PDC MAC 27-Mar-24 20:17 SYMBOL TABLE BOUTI% 000000 ext CALL 260740 000000 CALLRE 254000 000000 spd CODE 000000 ext CONST 000000 ext CX 000016 DATA 000000 ext DEBUG 000014 spd ERJMPR 320500 000000 int ERJMPS 320600 000000 int ERSTR% 104000 000011 int ETEXT 000000 ext LOGJFN 000000 ext NO%RDX 777777 sin NOP 600000 000000 sin NOUT% 104000 000224 int P 000017 P1 000011 spd P2 000012 spd P3 000013 spd P4 000014 spd P5 000015 spd PSOUT% 104000 000076 int Q1 000005 spd Q2 000006 spd Q3 000007 spd Q4 000010 spd Q5 000011 spd R 000000 ext RET 263740 000000 RQUOTE 000000 ext RSKP 000000 ext SOUT% 104000 000053 int SQUOTE 000000 ext T1 000001 spd T2 000002 spd T3 000003 spd T4 000004 spd XMOVEI 415000 000000 int $CLOSD 000000 ext %%SMSG 000000 ext ..MSK 777777 777777 spd .A16 000016 spd .CHDBQ 000042 spd .CHDEL 000177 sin .CHSPC 000040 sin .FHSLF 400000 sin .FP 000015 spd .FPAC 000005 spd .PRIOU 000101 sin .PX7 610001 000000 spd .SAC 000016 .SAV1 000000 ext .SAV2 000000 ext .SAV3 000000 ext k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20PDC MAC 27-Mar-24 20:17 SYMBOL TABLE FOR PSECT CODE BLKCHK 000767' ext SPAKPT 000000 ext BOUTI% 001011' ext SPDECD 000152' DATLEN 000531' ext SQUOTE 000502' ext DATPTR 000117' ext SSEQN 000745' ext DEBERR 000031' ent TYPE 000737' ext DEFACK 000333' UNDACK 000317' DIAMSG 000000' ent $CLOSD 000046' ext DIAMSZ 000026' %%SMSG 001000' ext ERRACK 000322' ..0006 000016' spd FINTIM 000155' ext ..0007 000017' spd GENARG 000475' ..0014 000026' spd GENBYE 000464' ..0023 000067' spd GENCDU 000440' ..0030 000076' spd GENCWD 000443' ..0031 000106' spd GENDEL 000453' ..0044 000136' spd GENDIR 000450' ..0051 000140' spd GENDSK 000472' ..0062 000177' spd GENFIN 000456' ..0067 000201' spd GENHLP 000461' ..0114 000250' spd GENPWD 000435' ..0123 000246' spd GENSTA 000467' ..0124 000250' spd INIACK 000325' ..0133 000256' spd INVGEN 000432' ..0140 000260' spd INVSN1 000216' ..0205 000351' spd INVSN2 000220' ..0222 000346' spd INVSND 000213' ..0233 000363' spd INZACK 000330' ..0247 000406' spd ISLONG 000761' ext ..0250 000411' spd LOGJFN 000051' ext ..0266 000421' spd NUM 000747' ext ..0341 000503' spd OUTC 000774' ..0342 000526' spd PARAMS 000527' ..0347 000510' spd PDECOD 000050' ent ..0410 000636' spd PKTBCT 000000 ext ..0411 000644' spd PKTHDR 000734' ..0421 000643' spd PKTLEN 000755' ext ..0422 000644' spd R 000725' ext ..0454 000723' spd RPDECD 000107' ..0461 000730' spd RQUOTE 000500' ext ..0462 000733' spd RSKP 000773' ext ..0477 000765' spd RSTHDR 000000 ext ..0514 001002' spd SDATPT 000374' ext ..0525 001011' spd SNDACK 000307' ..MX1 000012 spd SNDAT1 000250' ..MX2 000001 spd SNDATA 000233' SNDEOF 000372' SNDEOT 000225' SNDERR 000261' SNDFIL 000265' SNDGEN 000412' SNDINI 000301' SNDINZ 000270' SNDNAK 000273' SNDREC 000276' SNDTXT 000304' k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20PDC MAC 27-Mar-24 20:17 SYMBOL TABLE FOR PSECT CONST ACKTAB 000104' SGENPT 000162' SNDPKT 000016' k20pdc - Kermit (Visual) Packet Decoding MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20PDC MAC 27-Mar-24 20:17 SYMBOL TABLE FOR PSECT DATA LSTGEN 000001' LSTPKT 000000' k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20NET MAC 5-May-24 16:57 Preliminaries 28923 title k20net - Kermit-20 Network Support 28924 remark Moved to seperate module as part of 194 to address MCRNEC 28925 remark Originally part of [186] 28926 28927 subttl Preliminaries 28928 28929 search monsym,macsym,cmd,k20unv ;[194] 28930 cmdacs ^ ;Clean up p1-p4 definitions 28931 28932 sall ; Tidy listing 28933 .directive flblst ; We don't need to see all the ASCIZ bytes... 28934 28935 extern ttyjfn ; JFN for controlling terminal 28936 extern ttyini ; Condition local terminal for connection 28937 extern savlnw ; Save terminal length and width 28938 extern rstlnw ; Restore terminal length and width 28939 extern netjfn ; Holds any kind of communications JFN 28940 extern netflg ; Flags returned from GTJFN% (unused) 28941 extern nodnam ; Parsed node name 28942 extern nodnum ; Converted node number, if we have it 28943 extern asgflg ; Flags that we have assigned a device 28944 extern asgdev ; Device we assigned (always a PTY) 28945 extern srvflg ; If running as a server 28946 extern myjob ; My current logged in job 28947 extern mytty ; My current attached terminal 28948 extern ttynum ; Line number of current connection 28949 extern mycaps ; This process' capability vector 28950 extern crlf ; Handy way to save two bytes 28951 extern %%jser ; JSYS error handler 28952 extern errptr ; Pointer to copies of error messages 28953 extern symout ; Given an address, types an associated symbol 28954 28955 remark Common parsing external data 28956 28957 extern pars3 ; Data from third parsed item 28958 extern pars4 ; Data from fourth parsed item 28959 extern pars5 ; Data from fifth parsed item (rarely used) 28960 extern pars6 ;[218] Data from six parsed item (even more rare) 28961 extern pars7 ;[236] Whether we're doing .MOSNH 28962 extern atmbuf ; The atom buffer 28963 28964 remark External linkages for INPUT/OUTPUT 28965 28966 extern inpclr ;[209] Clear the buffer 28967 extern handsh ;[190] Handshake character 28968 28969 remark External Parity routines and working storage (all 233) 28970 28971 extern parity ; Type of parity in use 28972 extern none ; No parity being enforced 28973 extern space ; Space parity routine (0, always) 28974 extern mark ; Mark parity routine (1, always) 28975 extern even ; Even parity routine 28976 extern odd ; Odd parity routine 28977 extern parpko ; Non-zero if doing parity on packets, only k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-1 K20NET MAC 5-May-24 16:57 Preliminaries 28978 extern parrck ; Checking parity on recieve in addition to sending 28979 extern ttipar ; Total parity errors for session 28980 extern movchr ; Translates between 7 and 8 bit 28981 extern genpar ; Use string instructions generate a new string 28982 extern chkpar ; Use string instructions to check parity 28983 extern strc ; Count of characters in temporary buffer 28984 extern strptr ; Appropriate pointer to same 28985 extern strbuf ; Global address of string buffer 28986 remark strbf2 ; Flows into this, too 28987 28988 .psect code/ronly ; Pure code, pure heaven 28989 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20NET MAC 5-May-24 16:57 Acquire information about local node 28990 subttl Acquire information about local node 28991 28992 ; Double checks if the system even has DECnet, just in case. It is 28993 ; possible to configure a system without DECnet; in fact, *all* Toad's 28994 ; are thus because they can't change the MAC address of their network 28995 ; adaptor. 28996 ; 28997 ; A remarkable oversight, if it was one, but DEC's decision to just 28998 ; snag part of the global MAC address space always seemed questionable 28999 ; to some. 29000 ; 29001 ; So we have to do this in order to not break on either a Toad, which 29002 ; can never have DECnet (see above) or a monitor built without it. 29003 ; 29004 ; Code lifted from my rewrite of SETNOD (SETND2) and properly Kermit 29005 ; cased... 29006 29007 000000'01 lclnod: entry lclnod 29008 000000'01 265 16 0 00 005412' saveac ; Wants a few extra registers 29009 remark q1, t5 ; Note, t5 aliases q1 29010 29011 000001'01 402 00 0 00 000000# setzm ndvfxp ; Assume doesn't have extended verify 29012 000002'01 201 07 0 00 000000# movei q3, cnfigd ; Resolve area to 18 bit address 29013 000003'01 201 01 0 00 000010 movx t1, .cfiln ; Length (maximum) 29014 29015 000004'01 403 02 0 00 000003 setzb t2, t3 ; Create two handy zeros 29016 000005'01 124 01 0 07 000000 dmovem t1, .cflen(q3) ; Set length, clear processor type 29017 000006'01 124 02 0 07 000002 dmovem t2, .cfise(q3) ; Clear serial number and microcode 29018 000007'01 124 02 0 07 000004 dmovem t2, .cfiho(q3) ; Clear hardware and microcode options 29019 000010'01 124 02 0 07 000006 dmovem t2, .cfiso(q3) ; Clear software options and version 29020 29021 000011'01 124 02 0 00 000000# dmovem t2, mynode ; Zero local executor and NDVFXP 29022 000012'01 124 02 0 00 000000# dmovem t2, myname ; Scrub the node name area 29023 29024 000013'01 201 01 0 00 000000 movx t1, .cfinf ; Want basic configuration 29025 000014'01 200 02 0 00 000007 move t2, q3 ; Where to put the goodies 29026 000015'01 104 00 0 00 000627 CNFIG% ; See what this monitor has 29027 000016'01 320 12 0 00 000000* erjmpr r ; Nothing, forget about the whole thing 29028 29029 000017'01 554 03 0 07 000000 load t3, cf%wdp,.cflen(q3) ;Load words returned 29030 000020'01 275 03 0 00 000001 subi t3, ^d1 ; Convert count to offset 29031 000021'01 305 03 0 00 000007 caige t3, .cfivr ; Need Tops-20 version 29032 000022'01 263 17 0 00 000000 ret ; Unable to determine Tops-20 version 29033 29034 000023'01 135 03 0 00 005424' load t3, vi%maj,.cfivr(q3) ;Load Tops-20 major release 29035 000024'01 305 03 0 00 000007 caige t3, 7 ; Needs Phase IV 29036 000025'01 254 00 0 00 000034' ifskp. ; So far, so good 29037 000026'01 302 03 0 00 000007 caie T3, 7 ; Exactly version seven? 29038 000027'01 254 00 0 00 000033' ifskp. ; Have to check minor version 29039 000030'01 135 03 0 00 005425' load t3, vi%min,.cfivr(q3) ;Load Tops-20 minor release 29040 000031'01 305 03 0 00 000001 caige t3, 1 ; Needs .NDINT 29041 000032'01 263 17 0 00 000000 ret ; Requires Tops-20 minor version one 29042 000033'01 endif. ; Otherwise, OK or after 7 (!) 29043 000033'01 254 00 0 00 000035' else. ; Otherwise, won't work 29044 000034'01 263 17 0 00 000000 ret ; Requires at least Tops-20 major version seven k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-1 K20NET MAC 5-May-24 16:57 Acquire information about local node 29045 000035'01 endif. 29046 29047 000035'01 200 04 0 07 000006 move t4, .cfiso(q3) ; Load software options 29048 000036'01 607 04 0 00 200000 txnn t4, cf%dcn ; So, do we have DECnet? 29049 000037'01 263 17 0 00 000000 ret ; Nope, System is not configured for DECnet 29050 29051 000040'01 120 01 0 00 005426' dmove t1, [exp .ndgnm,t3] ;Get local node number 29052 000041'01 104 00 0 00 000567 NODE% ; In t3 29053 000042'01 320 12 0 00 000016* erjmpr r ; Give up, shouldn't ever fail.. 29054 000043'01 306 03 0 00 000000 cain t3, 0 ; Is DECnet running? 29055 000044'01 263 17 0 00 000000 ret ; System DECnet node number not configured 29056 000045'01 202 03 0 00 000000# movem t3, mynode ; Store away my local node number 29057 29058 000046'01 120 01 0 00 005430' dmove t1, [exp .ndgln,t3] ;Get local node name 29059 000047'01 561 03 0 00 000000# hrroi t3, myname ; Point to storage 29060 000050'01 104 00 0 00 000567 NODE% ; In t3 29061 000051'01 320 12 0 00 000053' ifje. r ; Failed?? 29062 000052'01 254 00 0 00 000055' 29063 000053'01 403 02 0 00 000003 setzb t2, t3 ; Cons up a couple of NUL's 29064 000054'01 124 02 0 00 000000# dmovem t2 ,myname ; Make sure no name 29065 000055'01 endif. 29066 29067 000055'01 332 00 0 00 000000# ifme. myname ; Get anything? 29068 000056'01 254 00 0 00 000061' 29069 000057'01 402 00 0 00 000000# setzm mynode ; Whack the executor node number 29070 000060'01 263 17 0 00 000000 ret ; System DECnet node name not configured 29071 000061'01 endif. 29072 ; At this point, we know we have DECnet 29073 remark ; See if monitor has extended verify (T79) 29074 000061'01 120 01 0 00 005432' dmove t1, [exp .ndvfx,t3] ;Node name verify, extended 29075 000062'01 561 03 0 00 000000# hrroi t3, myname ; Point to local node name 29076 000063'01 104 00 0 00 000567 NODE% ; See if .NDVFX exists 29077 000064'01 320 12 0 00 000066' ifje. r ; Oh dear, doesn't look promising 29078 000065'01 254 00 0 00 000071' 29079 000066'01 302 01 0 00 601713 caxe t1, argx02 ; Monitor doesn't have winning .NDVFX? 29080 000067'01 263 17 0 00 000000 ret ; That's fine, so don't use it 29081 000070'01 403 04 0 00 000005 setzb t4, t5 ; Zap flags and so forth 29082 000071'01 endif. ; End node processing 29083 29084 000071'01 607 04 0 00 020000 txnn t4, nd%num ; Better have gotten a number (as it is us) 29085 000072'01 263 17 0 00 000000 ret ; .NDVFX response did not get local node number 29086 000073'01 312 05 0 00 000000# came t5, mynode ; Yes, but is it in fact the local executor? 29087 000074'01 263 17 0 00 000000 ret ; Inconsistent local node number results 29088 000075'01 350 00 0 00 000000# aos ndvfxp ; Mark that it fully works 29089 000076'01 263 17 0 00 000000 ret ; We're done 29090 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20NET MAC 5-May-24 16:57 Get the 'name' of the local system 29091 subttl Get the 'name' of the local system 29092 29093 ; Because one can be going from one DECSYSTEM-20 to another, the 29094 ; message, "Returning to DEC20" might be confusing, particularly if 29095 ; one is so lucky as to have multiple parallel transfers happening to 29096 ; foreign systems. While uncommon, there is nothing preventing this 29097 ; scenario. 29098 ; 29099 ; Therefore, we pull the system name. We prefer GETAB% over NODE% 29100 ; because this should always work, whereas NODE% will give you 29101 ; something like "TOPS20" on a non-DECnet site that hasn't configured 29102 ; the name in SETSPD. 29103 ; 29104 ; If, for some reason, we can't do the GETAB% (as in some fascist ACJ 29105 ; prevents it on a truly locked down system), we will use NODE%. 29106 ; NODE% is supposed to work whether or not DECnet is in monitor (see 29107 ; STG). 29108 ; 29109 ; N.B., Since using GETAB%, we have to do a little parsing of SYSVER 29110 ; 29111 ; The problem is that SYSVER has too much blather in it and sometimes 29112 ; also includes propaganda and system version information. Since the 29113 ; first part is simply SYSTEM:MONNAM.TXT (which is supposed to be 29114 ; there), we parse the return up to the comma and use that. 29115 ; 29116 ; Code adapted from UPTIME; expects to be called AFTER lclnod in case 29117 ; SYSGT% and/or GETAB% either can't work (because no SC%GTB) or fail. 29118 ; 29119 ; Counts the string in case somebody needs it, later 29120 29121 000077'01 getnam: entry getnam 29122 000077'01 265 16 0 00 005412' saveac ; Needs some extra registers 29123 000100'01 403 01 0 00 000002 setzb t1,t2 ; Cons up a nice long zero 29124 000101'01 124 01 0 00 000000# dmovem t1,syscnt ; Stomp count and a few characters 29125 29126 000102'01 205 03 0 00 200000 movx t3,sc%gtb ; GETAB% capability? 29127 000103'01 616 03 0 00 000000# tdnn t3,mycaps+1 ; We have it, right? 29128 000104'01 254 00 0 00 000145' jrst getnod ; Most unusual! 29129 29130 000105'01 200 01 0 00 005434' movx t1,'SYSVER' ; Want system version information 29131 000106'01 104 00 0 00 000016 SYSGT% ; Pull out first word and table metadata 29132 000107'01 320 12 0 00 000145' erjmpr getnod ; Gronked?? Try something else 29133 000110'01 202 02 0 00 000000# movem t2,sysver ; Save table length and index (just in case) 29134 000111'01 550 06 0 00 000002 hrrz q2,t2 ; Cache the index in a fast place 29135 000112'01 515 05 0 00 000001 hrlzi q1,^d1 ; Put the table increment in the right place 29136 ; Now decide how long to loop 29137 000113'01 564 02 0 00 000002 hlro t2,t2 ; Turn into a fullword negative number 29138 000114'01 213 07 0 00 000002 movns q3,t2 ; Positivize it (note arcane use of self) 29139 000115'01 303 02 0 00 000011 caxle t2,syslen ; Will the table fit? 29140 000116'01 201 07 0 00 000011 movx q3,syslen ; Sadly, no. Clip it down 29141 000117'01 120 03 0 00 005435' dmove t3,[exp sysnam,0] ; Address of where to store text, nothing seen 29142 ; Fall through with first word 29143 000120'01 do. ; Enter loop context 29144 000120'01 202 01 0 03 000000 movem t1,(t3) ; Stomp the whole word into memory 29145 000121'01 334 02 0 00 000001 skipa t2,t1 ; Set up for correct shift k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20NET MAC 5-May-24 16:57 Get the 'name' of the local system 29146 000122'01 do. ; Inner loop to check characters 29147 000122'01 322 02 0 00 000130' jumpe t2,endlp. ; Processed everything? 29148 000123'01 400 01 0 00 000000 setz t1, ; clear a 'linked' register for a shift pair 29149 000124'01 246 01 0 00 000007 lshc t1,^d7 ; Peel off a character (faster than an ILDB) 29150 000125'01 306 01 0 00 000054 cain t1,"," ; A comma? 29151 000126'01 254 00 0 00 000137' jrst postab ; Yes, we've finally gone past the name 29152 000127'01 344 04 0 00 000122' aoja t4,top. ; Otherwise, count the character and inner loop 29153 000130'01 enddo. ; End inner loop to check characters 29154 000130'01 363 07 0 00 000137' sojle q3,endlp. ; Account for a full word done, maybe terminate 29155 000131'01 270 06 0 00 000005 add q2,q1 ; Bump to next GETAB% index 29156 000132'01 200 01 0 00 000006 move t1,q2 ; Load next requested word 29157 000133'01 104 00 0 00 000010 GETAB% ; Ask for it 29158 000134'01 320 12 0 00 000137' erjmpr postab ; Failed, just use what we have 29159 000135'01 322 01 0 00 000137' jumpe t1,postab ; If end, head off for post table processing 29160 000136'01 344 03 0 00 000120' aoja t3,top. ; Otherwise, handle this word 29161 000137'01 enddo. ; End of GETAB% loop context 29162 29163 000137'01 202 04 0 00 000000# postab: movem t4,syscnt ; We know the length of the system name!! 29164 000140'01 271 04 0 00 000001 addi t4,^d1 ; Get past last character (faster than ILDB) 29165 000141'01 133 04 0 00 005437' adjbp t4,[point 7,sysnam] ; Point to where we stored everything 29166 000142'01 400 01 0 00 000000 setz t1, ; Cons up a .CHNUL 29167 000143'01 137 01 0 00 000004 dpb t1,t4 ; Tie off the string (faster than ILDB) 29168 000144'01 263 17 0 00 000000 ret ; And down 29169 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20NET MAC 5-May-24 16:57 Get the 'name' of the local system 29170 remark Handle case of no SC%GTB or SYSGT%/GETAB% failure 29171 29172 ; NODE% should always work and one assumes that DECnet is set up on 29173 ; all modern systems. However, many systems had no DECnet and only 29174 ; ran ARPA code. That is less common as Galaxy assumes DECnet and 29175 ; parts of CFS seem to. 29176 ; 29177 ; As there were also systems with no ARPA code, we use a very old- 29178 ; fashioned method for getting the name and are highly defensively 29179 ; coded. 29180 ; 29181 ; Code lifted from my rewrite of SETNOD (SETND2) and properly Kermit 29182 ; cased... 29183 29184 000145'01 120 02 0 00 000000# getnod: dmove t2,myname ; Load what DECnet thinks 29185 000146'01 322 02 0 00 000170' jumpe t2,niente ; Didn't think much! Just default it 29186 000147'01 312 02 0 00 005440' came t2,[ascii "TOPS2"] ; First five of standard default? 29187 000150'01 254 00 0 00 000153' ifskp. ; Yep, let's look at the 2nd word 29188 000151'01 316 03 0 00 005441' camn t3,[ascii "0"] ; Really standard default?? 29189 000152'01 254 00 0 00 000170' jrst niente ; Default it to something nicer 29190 000153'01 endif. ; Otherwise, fall through 29191 29192 dmove t4,[point 7,sysnam ;Point to text to spew 29193 000153'01 120 04 0 00 005442' 0 ] ; Zero counter 29194 000154'01 do. ; Enter outer loop context 29195 000154'01 do. ; Enter inner loop context 29196 000154'01 400 01 0 00 000000 setz t1, ; whack the character accumulator 29197 000155'01 246 01 0 00 000007 lshc t1,^d7 ; Peel off a character (faster than an ILDB) 29198 000156'01 322 01 0 00 000161' jumpe t1,endlp. ; End of string? Do next word 29199 000157'01 136 01 0 00 000004 idpb t1,t4 ; Deposit into target string 29200 000160'01 344 05 0 00 000154' aoja q1,top. ; Next character 29201 000161'01 enddo. ; End of inner loop context 29202 000161'01 336 02 0 00 000003 skipn t2,t3 ; Position second word 29203 000162'01 254 00 0 00 000165' exit. ; Unless we're done 29204 000163'01 400 03 0 00 000000 setz t3, ; Set a talsiman 29205 000164'01 254 00 0 00 000154' jrst top. ; Peel a few more characters off 29206 000165'01 enddo. ; End of outer loop context 29207 29208 000165'01 202 05 0 00 000000# movem q1,syscnt ; Update string length count 29209 000166'01 136 03 0 00 000004 idpb t3,t4 ; Tie off the string 29210 000167'01 263 17 0 00 000000 ret ; Done 29211 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20NET MAC 5-May-24 16:57 Get the 'name' of the local system 29212 remark Here if we are just not having any luck with the local system name 29213 29214 chgsec(code,text) 29215 000000'02 104 105 103 055 062 defnam: asciz "DEC-20" ; Clear up where we are 29216 000002'02 000 00 0 00 000000 Z ; Historically what we called ourselves 29217 retsec 29218 29219 000170'01 120 01 0 00 000000# niente: dmove t1,defnam ; Load default name 29220 000171'01 124 01 0 00 000000# dmovem t1,sysnam ; Store default name 29221 000172'01 402 00 0 00 000000# setzm sysnam+2 ; Tie of the string 29222 000173'01 201 03 0 00 000006 movei t3,^d6 ; Length of unterminated string 29223 000174'01 202 03 0 00 000000# movem t3,syscnt ; Store the count 29224 29225 000175'01 263 17 0 00 000000 ret ; And done 29226 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20NET MAC 5-May-24 16:57 Set default prompt if doing network 29227 subttl Set default prompt if doing network 29228 29229 ; Sets a default prompt to use when we are NRT'ing in case it 29230 ; it is asked for by SET PROMPT (see .setpr: in k20par) 29231 29232 000176'01 setdef: entry setdef ; Called once at startup 29233 dmove t1,[point 7,myprom ; Default prompt, if needed 29234 000176'01 120 01 0 00 005444' point 7,sysnam] ; Source is local system name 29235 000177'01 200 04 0 00 000000# move t4,syscnt ; Length 29236 29237 000200'01 do. ; Enter loop context. 29238 000200'01 134 03 0 00 000002 ildb t3,t2 ; Load source from local system name 29239 000201'01 136 03 0 00 000001 idpb t3,t1 ; Deposit it in prompt 29240 000202'01 367 04 0 00 000200' sojg t4,top. ; All of it 29241 000203'01 enddo. ; Exit loop context. 29242 29243 dmove t3,[ ":" ;[270] Load a colen 29244 000203'01 120 03 0 00 005446' .chnul ] ;[270] And a nul 29245 000204'01 136 03 0 00 000001 idpb t3,t1 ;[270] Punctuate 29246 000205'01 136 03 0 00 000001 idpb t3,t1 ;[270] the node name 29247 000206'01 136 04 0 00 000001 idpb t4,t1 ;[270] Close out the string 29248 000207'01 263 17 0 00 000000 ret 29249 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20NET MAC 5-May-24 16:57 Perform network connect and initial NRT negotiation 29250 subttl Perform network connect and initial NRT negotiation 29251 29252 ; Call: 29253 ; 29254 ; nodnam has result of .CMNOD 29255 ; 29256 ; Return: 29257 ; 29258 ; +1/ Couldn't open connection 29259 ; +2/ Connection open and negotiated with a remote NRT 29260 ; t1/ Network JFN we got 29261 29262 000210'01 decnct: entry decnct ; Called by k20mit, also 29263 000210'01 402 00 0 00 000000# setzm binflg ; Assume we don't have binary 29264 000211'01 402 00 0 00 000000# setzm nrtflg ; And that we don't have an NRT, either 29265 000212'01 260 17 0 00 000233' call chknrt ; First see if node itself exists 29266 000213'01 254 00 0 00 003221' callret clscln ; Failed, scrub storage 29267 000214'01 202 01 0 00 000000* movem t1,ttynum ; Store node number as line number 29268 000215'01 260 17 0 00 000257' call openrt ; Perform initial open activities 29269 000216'01 254 00 0 00 003041' callret clsjfn ; Unless build and open fail 29270 000217'01 260 17 0 00 000325' call waitcn ; Now wait for NSP negotiation 29271 000220'01 263 17 0 00 000000 ret ; Return +1, waitcn cleans up correctly 29272 000221'01 260 17 0 00 000600' call fixnam ; Rewrite remote node name 29273 000222'01 260 17 0 00 000624' call chktop ; Ensure it suppors Tops-10/20 NRT's 29274 000223'01 263 17 0 00 000000 ret ; It does't ... chktop cleans up correctly 29275 000224'01 201 03 0 00 000022 movei t3, .dvdcn ; Opened a DECnet NRT! 29276 000225'01 202 03 0 00 000000# movem t3, opndev ; Store opened device type 29277 000226'01 476 00 0 00 000000* setom vtermf ; Set the virtual terminal flag 29278 000227'01 476 00 0 00 000000* setom local ; We're the local Kermit 29279 remark gndpar ;[223] Can't get parity from a network JFN 29280 000230'01 402 00 0 00 000000# setzm opnpar ;[223] Either way, NRT's do not support parity 29281 000231'01 550 01 0 00 000000* hrrz t1, netjfn ;[223] Return JFN, no flags 29282 000232'01 254 00 0 00 000000* retskp ; Connected and ready to go! 29283 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20NET MAC 5-May-24 16:57 Checks that the candidate node exists 29284 subttl Checks that the candidate node exists 29285 29286 ; Verifies parsed node and attempts to extract some useful 29287 ; information. This should not be necessary, because unless CM%PO 29288 ; (parse-only) is set, when doing a .CMNOD, Tops-20 itself verifies 29289 ; that whats in the atom buffer exists in the monitor's data base. 29290 ; 29291 ; However we have to do the call to get the node number, which we 29292 ; pretend is a terminal number. 29293 ; 29294 ; Call: 29295 ; 29296 ; nodnam has ... something (see above) 29297 ; 29298 ; Return: 29299 ; 29300 ; +1/ Wasn't a valid DECnet node 29301 ; +2/ Valid DECnet node, t1 has node number if monitor supports this 29302 29303 000233'01 265 16 0 00 005450' chknrt: saveac ; Alias t5 29304 000234'01 120 01 0 00 005432' dmove t1,[exp .ndvfx,t3] ;Node name verify, extended 29305 000235'01 336 00 0 00 000000# skipn ndvfxp ; Has extended verify? 29306 000236'01 201 01 0 00 000015 movx t1, .ndvfy ; Pity, but still usable 29307 000237'01 561 03 0 00 000000* hrroi t3, nodnam ; Point to whatever .CMNOD got 29308 000240'01 104 00 0 00 000567 NODE% ; Get some information 29309 000241'01 320 12 0 00 000243' ifje. r ; Catch the error 29310 000242'01 254 00 0 00 000245' 29311 000243'01 200 02 0 00 000001 move t2, t1 ; Save for debugging 29312 000244'01 403 04 0 00 000005 setzb t4, t5 ; Zap flags and so forth 29313 000245'01 endif. ; 29314 000245'01 477 01 0 00 000000* setob t1, nodnum ; Let's assume nothing works 29315 000246'01 607 04 0 00 200000 txnn t4, nd%lgl ; Double check COMND% .CMNOD, just in case 29316 000247'01 263 17 0 00 000000 ret ; Then how did it get parsed?? 29317 000250'01 607 04 0 00 400000 txnn t4, nd%exm ; Legal, but do we know it? 29318 000251'01 263 17 0 00 000000 ret ; No, we do not 29319 29320 000252'01 607 04 0 00 020000 txnn t4, nd%num ; Did we get a number? 29321 000253'01 254 00 0 00 000232* retskp ; Oh well, maybe old monitor 29322 29323 000254'01 202 05 0 00 000245* movem t5, nodnum ; Save a node number, if we have it 29324 000255'01 200 01 0 00 000005 move t1, t5 ; Return a number to caller 29325 000256'01 254 00 0 00 000253* retskp ; And we are out of here! 29326 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20NET MAC 5-May-24 16:57 Open DECnet connect to NRT object 29327 subttl Open DECnet connect to NRT object 29328 29329 ; Here to actually open the connect. Check to see if the remote 29330 ; system is Tops-10 or Tops-20, in which case we can directly use 29331 ; it as if it were a terminal. This is not possible with a CTERM 29332 ; or TVT because there would be meta-data to process. 29333 ; 29334 ; Note, current behavior is that the OPENF% will succeed whether 29335 ; or not GJ%FLG is set, but strangely, NO traffic will be possible 29336 ; if is not used! If GJ%FLG is issued, then the following flags 29337 ; are returned: 29338 ; 29339 ; Bit Name Comment 29340 ; === ====== ================================================ 29341 ; 6 GJ%UHV The file used has the highest generation number 29342 ; because a generation number of 0 was given in the 29343 ; call. This is clearly false because no generation 29344 ; number nor extension (type) is supplied. 29345 ; 29346 ; 12 GJ%GND Files marked for deletion were not considered when 29347 ; assigning JFNs. 29348 ; 29349 ; 17 GJ%GIV Invisible files were not considerd when assigning 29350 ; JFNs. 29351 ; 29352 ; Why this makes it work is anybody's guess... 29353 ; 29354 ; Call: 29355 ; 29356 ; nodnam has validated foreign node name 29357 ; 29358 ; Return: 29359 ; 29360 ; +1/ Failed to create a JFN to the remote NRT 29361 ; +2/ JFN exists for remote object and is open 29362 29363 chgsec(code,const) ; Constants 29364 000000'03 000000000000# nrtadr: nrtobj ; Where to build network file spec to MCBNRT 29365 000001'03 623075 635000 nrtdev: byte (7) "d","c","n",":",.chnul ;Device name for client connections 29366 000002'03 000003 154455 nrtnum: byte (1) 0 (7) .chnul,.chnul,"3","2",.chdas 29367 retsec 29368 29369 000257'01 402 00 0 00 000000* openrt: setzm asgflg ; Certainly will not be assigning DCN:! 29370 000260'01 402 00 0 00 000000* setzm asgdev ; So don't put it there 29371 000261'01 120 01 0 00 000000# dmove t1,nrtadr ; Load address of object and device name 29372 000262'01 202 02 0 01 000000 movem t2, (t1) ; Start with "DCN:" 29373 000263'01 505 01 0 00 100700 hrli t1,(point 7,0,27) ; Point to ":" 29374 29375 000264'01 201 03 0 00 000237* movei t3,nodnam ; Resolve address of parsed node name 29376 000265'01 505 03 0 00 440700 hrli t3,() ; Turn into a local ASCII pointer 29377 ; And append the node name 29378 000266'01 do. ; Enter loop lexical context 29379 000266'01 134 02 0 00 000003 ildb t2,t3 ; Load node name byte 29380 000267'01 322 02 0 00 000272' jumpe t2,endlp. ; Exit if at end of string 29381 000270'01 136 02 0 00 000001 idpb t2,t1 ; Append to file specification k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-1 K20NET MAC 5-May-24 16:57 Open DECnet connect to NRT object 29382 000271'01 254 00 0 00 000266' loop. ; Go get some more 29383 000272'01 enddo. ; end loop lexical context 29384 ; Append MCBNRT's object type 29385 000272'01 200 02 0 00 000000# move t2, nrtnum ; Complete NRT number portion 29386 000273'01 136 02 0 00 000001 idpb t2,t1 ; Drop in the dash 29387 000274'01 242 02 0 00 777771 lsh t2,-^d7 ; Shift the "2" into place 29388 000275'01 136 02 0 00 000001 idpb t2,t1 ; Drop in the "2" 29389 000276'01 242 02 0 00 777771 lsh t2,-^d7 ; Shift the "3" into place 29390 000277'01 136 02 0 00 000001 idpb t2,t1 ; Drop in the "3" 29391 000300'01 400 02 0 00 000000 setz t2, ; Cons up a NUL 29392 000301'01 136 02 0 00 000001 idpb t2,t1 ; Tie off the line 29393 29394 000302'01 205 01 0 00 000021 movx t1,gj%sht!gj%flg ; Do a short form GTJFN with flags 29395 000303'01 561 02 0 00 000000# hrroi t2,nrtobj ; Using the spec just built 29396 000304'01 104 00 0 00 000020 GTJFN% ; Get DCN connection 29397 000305'01 320 12 0 00 000307' %jserr (,clscln) ; Scrub storage 29398 000306'01 254 00 0 00 000312' 29399 000307'01 265 01 0 00 000000* 29400 000310'01 000000000000# 29401 000311'01 254 00 0 00 003221' 29402 000000'04 125 156 141 142 154 29403 29404 000312'01 552 01 0 00 000231* hrrzm t1,netjfn ; Save JFN for the connection 29405 000313'01 512 01 0 00 000000* hllzm t1,netflg ; Save returned flags 29406 000314'01 621 01 0 00 777777 tlz t1,-1 ; But shut them off for downstream 29407 ; 8 bit bytes, small buffers and read/write 29408 000315'01 200 02 0 00 005456' move t2,[fld(^d8,of%bsz)!fld(.gssmb,of%mod)!of%rd!of%wr] 29409 000316'01 104 00 0 00 000021 OPENF% ; Open the network connection 29410 000317'01 320 12 0 00 000321' %jserr (,clsjfn) ; Toss the JFN 29411 000320'01 254 00 0 00 000324' 29412 000321'01 265 01 0 00 000307* 29413 000322'01 000000000000# 29414 000323'01 254 00 0 00 003041' 29415 000005'04 125 156 141 142 154 29416 000324'01 254 00 0 00 000256* retskp ; Return success 29417 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20NET MAC 5-May-24 16:57 Wait for DECnet connection completion 29418 subttl Wait for DECnet connection completion 29419 29420 ; Once we are done building the connection string and have successfully 29421 ; done the OPENF%, we must wait a bit for DECnet to complete network 29422 ; level negotiations. 29423 29424 ; This was is done by sitting in a loop, waiting a quarter second, 29425 ; checking the connection status and, if connected, returning. 29426 ; Otherwise we'd go around and do it again for the specified number of 29427 ; times. 29428 ; 29429 ; The new code sets a connection interrupt (mo%cdn) which results in a 29430 ; lot snappier response. Moral of the Story: Don't Poll. 29431 29432 ;[218] Rewritten for connection interrupts 29433 29434 extern dnchb ; DECnet channel bit, defined in k20sub 29435 extern dncfld,dndfld ; DECnet channal assignment/deassignment field 29436 extern timeon,timdel ; Force a specific time, force a timer delete 29437 extern ccon,ccoff2 ; Set up Control-C handler 29438 extern cyon, cyoff ; Set up Control-Y handler 29439 extern cyseen ; Set if Control-Y typed 29440 extern delay ; Default connect time out 29441 29442 000325'01 200 01 0 00 000312* waitcn: move t1, netjfn ; Load the network JFN 29443 dmove t2, [ .moacn ; Code to enable interrupts 29444 000326'01 120 02 0 00 005457' dncfld ] ; Channel to enable on 29445 000327'01 104 00 0 00 000077 MTOPR% ; Enable the interrupt 29446 000330'01 320 12 0 00 000332' %jserr (,clsnet) 29447 000331'01 254 00 0 00 000335' 29448 000332'01 265 01 0 00 000321* 29449 000333'01 000000000000# 29450 000334'01 254 00 0 00 003044' 29451 000013'04 104 105 103 156 145 29452 dmove t1, [ .fhslf ; This process 29453 000335'01 120 01 0 00 005461' dnchb ] ; DECnet connection channel 29454 000336'01 104 00 0 00 000131 AIC% ; Turn the channel on 29455 000337'01 320 12 0 00 000341' %jserr (,clsnet) ;?? 29456 000340'01 254 00 0 00 000344' 29457 000341'01 265 01 0 00 000332* 29458 000342'01 000000000000# 29459 000343'01 254 00 0 00 003044' 29460 000024'04 104 105 103 156 145 29461 000344'01 260 17 0 00 000000* call ccon ; Turn on Control-C interrupt 29462 000345'01 254 00 0 00 000507' jrst waitcc ; Go to the wait Control-C handler 29463 000346'01 260 17 0 00 000000* call cyon ; Fielding ^Y inquires 29464 000347'01 334 00 0 00 000000 %ermsg (,) 29465 000350'01 254 00 0 00 000354' 29466 000351'01 265 01 0 00 000341* 29467 000352'01 000000000000# 29468 000353'01 254 00 0 00 000354' 29469 000034'04 103 157 165 154 144 29470 000354'01 201 01 0 00 000517' movei t1, waitmo ; Address to go to on time out 29471 000355'01 337 02 0 00 000000* skipg t2, pars6 ; Use /timeout, if specified 29472 000356'01 200 02 0 00 000000* move t2, delay ; Otherwise use default k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-1 K20NET MAC 5-May-24 16:57 Wait for DECnet connection completion 29473 000357'01 323 02 0 00 000361' ifg. t2 ; Have any reasonable delay? 29474 000360'01 260 17 0 00 000000* call timeon ; Yes, set connection expiration time 29475 000361'01 endif. ; Otherwise, we are truly patient... 29476 29477 000361'01 do. ; Enter loop context 29478 000361'01 104 00 0 00 000306 WAIT% ; Wait forever and ever (and ever) 29479 000362' $waitj==:. ; Location of JSYS as reported 29480 000362'01 336 00 0 00 000000* skipn cyseen ; Should only happen for ^Y 29481 000363'01 254 00 0 00 000500' jrst waitun ; But didn't! Unknown!! 29482 000364'01 260 17 0 00 000404' call waitpr ; Print something nice 29483 000365'01 254 00 0 00 000370' ifskp. ; Link is still healthy 29484 000366'01 402 00 0 00 000362* setzm cyseen ; Stomp ^Y seen 29485 000367'01 254 00 0 00 000377' else. ; Otherwise, we are ill 29486 000370'01 415 16 0 00 000375' block. ; Will need a frame 29487 000371'01 261 17 0 00 000016 29488 000372'01 265 16 0 00 005463' saveac ; Save temporaries 29489 000373'01 260 17 0 00 000436' call shutdn ; Turn off the interrupts 29490 000374'01 263 17 0 00 000000 endbk. ; Exit block, restoring temporaries 29491 000375'01 260 17 0 00 000541' call decerr ; Complain and close 29492 000376'01 254 00 0 00 003044' callret clsnet ; Toss JFN and return 29493 000377'01 endif. 29494 000377'01 603 03 0 00 400000 txne t3, mo%con ; Connected?? Must have missed the interrupt 29495 000400'01 254 00 0 00 000402' exit. ; Break out and return success 29496 000401'01 254 00 0 00 000361' loop. ; And go catatonic again 29497 000402'01 enddo. ; End loop lexical context 29498 29499 000402'01 waitdn: remark ; Forced here by connection interrupt 29500 000402'01 260 17 0 00 000436' call shutdn ; Get rid of all our interrupts 29501 000403'01 254 00 0 00 000324* retskp ; Return success 29502 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20NET MAC 5-May-24 16:57 Print Connection Information 29503 subttl Print Connection Information 29504 29505 ; Returns +1 if connection went bad, t2 having the DECnet abort code 29506 ; +2 if the connection is still good and we continue to wait 29507 29508 000404'01 200 01 0 00 000325* waitpr: move t1,netjfn ; Load the JFN 29509 000405'01 201 02 0 00 000025 movx t2,.morls ; Function to read link status 29510 000406'01 104 00 0 00 000077 MTOPR% ; Do the status read 29511 000407'01 320 12 0 00 000042* erjmpr r ; Handle error, getting it in t1 29512 000410'01 603 03 0 00 400000 txne t3, mo%con ; Connected?? 29513 000411'01 254 00 0 00 000403* retskp ; Must have missed the interrupt 29514 000412'01 603 03 0 00 010000 txne t3, mo%abt ; Link aborted?? 29515 000413'01 263 17 0 00 000000 ret ; Fail and return blat 29516 000414'01 603 03 0 00 004000 txne t3, mo%syn ; A normal close? 29517 000415'01 263 17 0 00 000000 ret ; Already? That's pecular... 29518 000416'01 607 03 0 00 100000 ifxn. t3, mo%wfc ; Still healthy and waiting? 29519 000417'01 254 00 0 00 000424' 29520 txmsg <% Waiting for connection 29521 000420'01 200 01 0 00 000000# > 29522 000421'01 104 00 0 00 000076 29523 000422'01 320 12 0 00 000423' 29524 000003'03 000000000000# 29525 000044'04 045 040 127 141 151 29526 29527 000423'01 254 00 0 00 000411* retskp 29528 000424'01 endif. 29529 000424'01 607 03 0 00 040000 ifxn. t3, mo%wcc ; Just about done, actually? 29530 000425'01 254 00 0 00 000432' 29531 txmsg <% Waiting for connection confirmation 29532 000426'01 200 01 0 00 000000# > 29533 000427'01 104 00 0 00 000076 29534 000430'01 320 12 0 00 000431' 29535 000004'03 000000000000# 29536 000052'04 045 040 127 141 151 29537 29538 000431'01 254 00 0 00 000423* retskp 29539 000432'01 endif. 29540 29541 txmsg <% Unknown status 29542 000432'01 200 01 0 00 000000# > 29543 000433'01 104 00 0 00 000076 29544 000434'01 320 12 0 00 000435' 29545 000005'03 000000000000# 29546 000062'04 045 040 125 156 153 29547 29548 000435'01 254 00 0 00 000431* retskp ; Still OK to wait 29549 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20NET MAC 5-May-24 16:57 Connection interrupt time out and shutdown 29550 subttl Connection interrupt time out and shutdown 29551 29552 000436'01 201 01 0 00 400000 shutdn: movx t1, .fhslf ; This process 29553 000437'01 104 00 0 00 000130 DIR% ; Shut off the entire interrupt system 29554 000440'01 320 12 0 00 000442' %jserr (,) 29555 000441'01 254 00 0 00 000445' 29556 000442'01 265 01 0 00 000351* 29557 000443'01 000000000000# 29558 000444'01 254 00 0 00 000445' 29559 000066'04 111 156 164 145 162 29560 000445'01 260 17 0 00 000000* call ccoff2 ; Force off Control-C handler 29561 000446'01 260 17 0 00 000000* call timdel ; Delete the timer 29562 000447'01 260 17 0 00 000000* call cyoff ; Release ^Y 29563 dmove t1, [ .fhslf ; This process 29564 000450'01 120 01 0 00 005475' dnchb ] ; DECnet connection channel 29565 000451'01 104 00 0 00 000133 DIC% ; Shut the channel off 29566 000452'01 320 12 0 00 000454' %jserr (,) ; Carry on 29567 000453'01 254 00 0 00 000457' 29568 000454'01 265 01 0 00 000442* 29569 000455'01 000000000000# 29570 000456'01 254 00 0 00 000457' 29571 000075'04 104 105 103 156 145 29572 000457'01 200 01 0 00 000404* move t1, netjfn ; Load the network JFN 29573 dmove t2, [ .moacn ; Code to enable interrupts 29574 000460'01 120 02 0 00 005477' dndfld ] ; Take the interrupt off this channel 29575 000461'01 104 00 0 00 000077 MTOPR% ; Enable the interrupt 29576 000462'01 320 12 0 00 000464' %jserr (,) ; Carry on 29577 000463'01 254 00 0 00 000467' 29578 000464'01 265 01 0 00 000454* 29579 000465'01 000000000000# 29580 000466'01 254 00 0 00 000467' 29581 000105'04 104 105 103 156 145 29582 000467'01 104 00 0 00 000141 CIS% ; Clear out any other interrupt crud 29583 000470'01 201 01 0 00 400000 movx t1, .fhslf ; This process 29584 000471'01 104 00 0 00 000126 EIR% ; Turn the interrupt back on 29585 000472'01 320 12 0 00 000474' %jserr (,) ; Uh oh... 29586 000473'01 254 00 0 00 000477' 29587 000474'01 265 01 0 00 000464* 29588 000475'01 000000000000# 29589 000476'01 254 00 0 00 000477' 29590 000116'04 111 156 164 145 162 29591 000477'01 263 17 0 00 000000 ret 29592 29593 000500'01 waitun: remark ; Here if we don't know why we broke out 29594 000500'01 260 17 0 00 000436' call shutdn ; Get rid of all our interrupts 29595 emsg ; Inform 29597 000502'01 104 00 0 00 000313 29598 000006'03 000000000000# 29599 000125'04 125 156 153 156 157 29600 29601 000503'01 505 02 0 00 000007 hrli t2, .DCX7 ; Code is unspecified error 29602 000504'01 200 03 0 00 000000# sxtext (t3,) 29603 000007'03 000000000000# 29604 000133'04 125 156 153 156 157 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-1 K20NET MAC 5-May-24 16:57 Connection interrupt time out and shutdown 29605 000505'01 201 04 0 00 000020 movei t4,^d16 ; Length of reject message 29606 000506'01 254 00 0 00 000525' jrst waitm1 ; Join common code 29607 29608 000507'01 waitcc: remark ; ^C event 29609 000507'01 260 17 0 00 000436' call shutdn ; Get rid of all our interrupts 29610 txmsg <% aborting connection attempt 29611 000510'01 200 01 0 00 000000# > ; Inform 29612 000511'01 104 00 0 00 000076 29613 000512'01 320 12 0 00 000513' 29614 000010'03 000000000000# 29615 000137'04 045 040 141 142 157 29616 29617 000513'01 505 02 0 00 000011 hrli t2, .DCX9 ; Code is forced explicit disconnect 29618 000514'01 200 03 0 00 000000# sxtext (t3,) 29619 000011'03 000000000000# 29620 000146'04 101 142 141 156 144 29621 000515'01 201 04 0 00 000017 movei t4,^d15 ; Length of reject message 29622 000516'01 254 00 0 00 000525' jrst waitm1 ; Join common code 29623 29624 000517'01 waitmo: remark ; Time-out event 29625 000517'01 260 17 0 00 000436' call shutdn ; Get rid of all our interrupts 29626 emsg ; Whine 29628 000521'01 104 00 0 00 000313 29629 000012'03 000000000000# 29630 000152'04 122 145 155 157 164 29631 29632 000522'01 505 02 0 00 000046 hrli t2, .DCX38 ; Code is no response 29633 000523'01 200 03 0 00 000000# sxtext (t3,) 29634 000013'03 000000000000# 29635 000160'04 101 164 164 145 155 29636 000524'01 201 04 0 00 000020 movei t4,^d16 ; Length of reject message 29637 29638 000525'01 200 01 0 00 000457* waitm1: move t1,netjfn ; Load DCN: JFN 29639 000526'01 541 02 0 00 000040 hrri t2, .moclz ; Function to close 29640 000527'01 104 00 0 00 000077 MTOPR% ; Notify NSP that we are giving up 29641 000530'01 320 12 0 00 000541' erjmpr decerr ; We can't say "No"? 29642 000531'01 254 00 0 00 003125' callret clscom ; Toss whatever is left 29643 29644 ;[218] End rewrite for connection interrupts 29645 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20NET MAC 5-May-24 16:57 Asynchronous DECnet connection event 29646 subttl Asynchronous DECnet connection event 29647 29648 ;[218] Begin code insertion 29649 29650 ; Purpose is to break us out of any jsys we might be in (probably the 29651 ; WAIT%) and redirect the path of execution to the successful return. 29652 29653 000532'01 dntrap: entry dntrap ; chntab is in k20sub 29654 000532'01 261 17 0 00 000001 push p, t1 ; Save an accumulator 29655 000533'01 201 01 0 00 000402' movei t1, waitdn ; Load the connection success address 29656 000534'01 500 01 0 00 000000* hll t1, pc3 ; Load interrupted PC's flags 29657 000535'01 661 01 0 00 010000 txo t1, pc%usr ; Force user mode to break out of any JSYS 29658 000536'01 202 01 0 00 000534* movem t1, pc3 ; Restore as if we came from there 29659 000537'01 262 17 0 00 000001 pop p, t1 ; Restore the accumulator 29660 000540'01 104 00 0 00 000136 DEBRK% ; Done with interrupt 29661 29662 ;[218] End code insertion 29663 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20NET MAC 5-May-24 16:57 Handle a DECnet connection error of some type 29664 subttl Handle a DECnet connection error of some type 29665 29666 ; Takes two kinds of errors and honks accordingly 29667 ; 29668 ; Note assumption: if t1 still has netjfn in it, then it couldn't 29669 ; possibly have gotten stomped with an erjmpr 29670 ; 29671 ; Call: 29672 ; 29673 ; t1/ JFN or error code 29674 ; 29675 ; Return: 29676 ; 29677 ; +1, always, having typed some kind of blat 29678 29679 000541'01 decerr: entry decerr ; Also hit by other modules 29680 000541'01 550 02 0 00 000001 hrrz t2,t1 ; Save a possible error 29681 000542'01 200 01 0 00 000000# emsg ;[187] 29682 000543'01 104 00 0 00 000313 29683 000014'03 000000000000# 29684 000164'04 103 157 156 156 145 29685 000544'01 316 02 0 00 000525* camn t2,netjfn ; JSYS error? 29686 000545'01 254 00 0 00 000557' ifskp. ; Yes, that's easy enough to complain about 29687 000546'01 201 01 0 00 000101 movei t1,.priou ; Continue on primary output 29688 000547'01 505 02 0 00 400000 hrli t2,.fhslf ; Wants this for explicit error 29689 000550'01 400 03 0 00 000000 setz t3, ; Don't limit length of text 29690 000551'01 104 00 0 00 000011 ERSTR% ; Type the JSYS failure reason text 29691 000552'01 320 12 0 00 000554' erjmpr .+2 ; Ignore strange error 29692 000553'01 320 12 0 00 000554' erjmpr .+1 ; Ignore stranger error 29693 000554'01 561 01 0 00 000000* hrroi t1, crlf ; Tie off the line 29694 000555'01 104 00 0 00 000076 PSOUT% 29695 000556'01 263 17 0 00 000000 ret ; And return 29696 000557'01 endif. ; End JSYS error handling 29697 29698 000557'01 400 01 0 00 000000 setz t1, ; Let's assume we never found anything 29699 000560'01 621 03 0 00 777777 tlz t3,-1 ; Scrub to just the bare error 29700 000561'01 201 04 0 00 000000# movei t4,nsptab ; Load address of error table 29701 000562'01 505 04 0 00 777744 hrli t4,-nspcnt ; Load negative number of items in table 29702 29703 000563'01 do. ; Enter loop context 29704 000563'01 554 02 0 04 000000 hlrz t2,(t4) ; Load Disconnect Code Table 29705 000564'01 312 02 0 00 000003 came t2,t3 ; Did we find the code? 29706 000565'01 254 00 0 00 000571' ifskp. ; Yes, set up the pointer 29707 000566'01 550 01 0 04 000000 hrrz t1, (t4) ; Pick up in-section case 29708 000567'01 661 01 0 00 610001 txo t1, .px7 ; Turn into a OWGP to ASCII text in ETEXT 29709 000570'01 254 00 0 00 000572' exit. ; Break out of the loop 29710 000571'01 endif. 29711 000571'01 253 04 0 00 000563' aobjn t4,top. ; Nope, try the next error code 29712 000572'01 enddo. ; End loop context 29713 29714 000572'01 326 01 0 00 000574' ife. t1 ; Did we find anything? 29715 000573'01 200 01 0 00 000000# sxtext (t1,) 29716 000015'03 000000000000# 29717 000171'04 125 156 153 156 157 29718 000574'01 endif. ; Other, can provide extra information k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14-1 K20NET MAC 5-May-24 16:57 Handle a DECnet connection error of some type 29719 000574'01 104 00 0 00 000313 ESOUT% ; Give us the bad news 29720 000575'01 561 01 0 00 000554* hrroi t1, crlf ; Tie off the line and return 29721 000576'01 104 00 0 00 000076 PSOUT% 29722 000577'01 254 00 0 00 003116' callret clsnrt ; Close the NRT object (or what's left) 29723 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20NET MAC 5-May-24 16:57 DECnet Disconnect Code Table (from MONSYM) 29724 subttl DECnet Disconnect Code Table (from MONSYM) 29725 29726 .endps code ; Pointers to extended text don't go in code 29727 29728 ; Note that the codes are stipulated by the NSP specification and 29729 ; may have meanings that are not directly implied by the comments 29730 29731 define nsperr(e,t,%et) < 29732 xwd e,%et ;;DECnet error code and in-section address 29733 chgsec(const,etext) ;;Text goes in extended section 29734 %et: asciz\'t\ ;;Drop text into extended section 29735 retsec ;;Gets back into const .psect 29736 cleans(<%et>) ;;Don't clutter listings with generated symbol 29737 >;;nsperr 29738 29739 .psect const ; Pointer table to extended text goes in const .psect 29740 29741 000016'03 000000 000000# nsptab: nsperr(.DCX0,) 29742 000201'04 122 145 152 145 143 29743 000017'03 000001 000000# nsperr(.DCX1,) 29744 000210'04 122 145 163 157 165 29745 000020'03 000002 000000# nsperr(.DCX2,) 29746 000216'04 104 145 163 164 151 29747 000021'03 000003 000000# nsperr(.DCX3,) 29748 000225'04 122 145 155 157 164 29749 000022'03 000004 000000# nsperr(.DCX4,) 29750 000233'04 104 145 163 164 151 29751 000023'03 000005 000000# nsperr(.DCX5,) 29752 000242'04 111 156 166 141 154 29753 000024'03 000006 000000# nsperr(.DCX6,) 29754 000250'04 117 142 152 145 143 29755 000025'03 000007 000000# nsperr(.DCX7,) 29756 000253'04 125 156 163 160 145 29757 000026'03 000010 000000# nsperr(.DCX8,) 29758 000257'04 101 142 157 162 164 29759 000027'03 000011 000000# nsperr(.DCX9,) 29760 000263'04 101 142 157 162 164 29761 000030'03 000012 000000# nsperr(.DCX10,) 29762 000267'04 111 156 166 141 154 29763 000031'03 000013 000000# nsperr(.DCX11,) 29764 000273'04 114 157 143 141 154 29765 000032'03 000025 000000# nsperr(.DCX21,) 29766 000277'04 103 157 156 156 145 29767 000033'03 000026 000000# nsperr(.DCX22,) 29768 000311'04 103 157 156 156 145 29769 000034'03 000027 000000# nsperr(.DCX23,) 29770 000323'04 103 157 156 156 145 29771 000035'03 000030 000000# nsperr(.DCX24,) 29772 000340'04 106 154 157 167 040 29773 000036'03 000040 000000# nsperr(.DCX32,) 29774 000345'04 124 157 157 040 155 29775 000037'03 000041 000000# nsperr(.DCX33,) 29776 000353'04 124 157 157 040 155 29777 000040'03 000042 000000# nsperr(.DCX34,) 29778 000364'04 101 143 143 145 163 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-1 K20NET MAC 5-May-24 16:57 DECnet Disconnect Code Table (from MONSYM) 29779 000041'03 000043 000000# nsperr(.DCX35,) 29780 000371'04 114 157 147 151 143 29781 000042'03 000044 000000# nsperr(.DCX36,) 29782 000400'04 111 156 166 141 154 29783 000043'03 000045 000000# nsperr(.DCX37,) 29784 000404'04 123 145 147 155 145 29785 000044'03 000046 000000# nsperr(.DCX38,) 29786 000411'04 116 157 040 162 145 29787 000045'03 000047 000000# nsperr(.DCX39,) 29788 000421'04 116 157 144 145 040 29789 000046'03 000050 000000# nsperr(.DCX40,) 29790 000425'04 114 151 156 153 040 29791 000047'03 000051 000000# nsperr(.DCX41,) 29792 000433'04 104 145 163 164 151 29793 000050'03 000052 000000# nsperr(.DCX42,) 29794 000442'04 103 157 156 146 151 29795 000051'03 000053 000000# nsperr(.DCX43,) 29796 000452'04 111 155 141 147 145 29797 000000000000# nspcnt==.-nsptab ; Number of items in table 29798 cleans() ; No need for symbol in listings, Etc. 29799 .psect code ; Back in code 29800 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20NET MAC 5-May-24 16:57 Canonicalize remote node name 29801 subttl Canonicalize remote node name 29802 29803 ; Rewrite the node name in case it was aliased. At least get it into 29804 ; UPPER case, which is what everybody wants. Also keeps gross CaMel 29805 ; case input from offending the sensitive 29806 29807 000600'01 337 02 0 00 000544* fixnam: skipg t2, netjfn ; Load JFN 29808 000601'01 263 17 0 00 000000 ret ; Unless there isn't one 29809 29810 000602'01 336 00 0 00 000000# ifmn. ndvfxp ; Have .ndvfx? 29811 000603'01 254 00 0 00 000606' 29812 000604'01 200 03 0 00 000254* move t3, nodnum ; Load previous node number 29813 000605'01 202 03 0 00 000000# movem t3, oldnum ; Store as old number 29814 000606'01 endif. ; Otherwise, will have to compare characters... 29815 29816 000606'01 120 03 0 00 000264* dmove t3, nodnam ; Load connected node name 29817 000607'01 124 03 0 00 000000# dmovem t3, oldnam ; Save (will hold six characters plus .chnul) 29818 000610'01 403 03 0 00 000004 setzb t3, t4 ; Cons up 10 .chnul's 29819 000611'01 124 03 0 00 000606* dmovem t3, nodnam ; Scrub storage enough 29820 29821 000612'01 561 01 0 00 000611* hrroi t1, nodnam ; Rewriting the node nam 29822 dmove t3, [ fld(.jsaof,js%nam) ; Just the file name 29823 000613'01 120 03 0 00 005501' 0 ] ; No strange prefix 29824 000614'01 104 00 0 00 000030 JFNS% ; Rewrite the node name 29825 000615'01 320 12 0 00 000407* erjmpr r ; ?? 29826 29827 000616'01 211 02 0 00 000003 movni t2,^d3 ; Getting before the dash 29828 000617'01 133 02 0 00 000001 adjbp t2,t1 ; back the pointer up 29829 000620'01 136 04 0 00 000002 idpb t4,t2 ; Stomp the dash, tying off the string 29830 000621'01 136 04 0 00 000002 idpb t4,t2 ; Also stomp the "2" and the ... 29831 000622'01 136 04 0 00 000002 idpb t4,t2 ; ... "3" to allow word compares 29832 000623'01 263 17 0 00 000000 ret ; Return everything all pretty 29833 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20NET MAC 5-May-24 16:57 Check if a connecting to a machine that supports Tops-20 NRT 29834 subttl Check if a connecting to a machine that supports Tops-20 NRT 29835 29836 ; Only these support a meta-data free NRT that we can use 29837 29838 ; N.B., These aren't just Tops-10 or Tops-20 machines! Ultrix-32 implements 29839 ; Tops-20 NRT. 29840 29841 000200 cnflen==200 ; Maximum characters allowed 29842 29843 000624'01 265 16 0 00 005503' chktop: saveac ; Fiddling with raw DECnet byte order 29844 000625'01 403 01 0 00 000002 setzb t1,t2 ; Cons up some zeros 29845 000626'01 124 01 0 00 000000# dmovem t1, nrtros ; Initialize unknown OS types 29846 000627'01 124 01 0 00 000000# dmovem t1, nrtflg ; and also NRT and network binary flags 29847 000630'01 402 00 0 00 000000# setzm nrtprt ; and also the NRT protocol 29848 29849 000631'01 337 01 0 00 000600* skipg t1, netjfn ; Load network JFN 29850 000632'01 263 17 0 00 000000 ret ; Unless there isn't one 29851 29852 000633'01 120 02 0 00 005513' dmove t2,[exp .morls,0] ; Read link status 29853 000634'01 104 00 0 00 000077 MTOPR% ; Request from the monitor 29854 000635'01 320 12 0 00 000541' erjmpr decerr ; Handle error 29855 29856 000636'01 607 03 0 00 020000 ifxn. t3,mo%eom ; Has an entire message? 29857 000637'01 254 00 0 00 000650' 29858 000640'01 400 02 0 00 000000 setz 2, ; Assume it's a lie 29859 000641'01 104 00 0 00 000102 SIBE% ; See what the deal is 29860 000642'01 334 00 0 00 000000 skipa ; Have some goodies to read, actually 29861 000643'01 254 00 0 00 000650' anskp. ; Or doesn't 29862 000644'01 303 02 0 00 000200 caile t2,cnflen ; Exceeds buffer length? 29863 000645'01 254 00 0 00 000650' anskp. ; clip it down 29864 000646'01 210 03 0 00 000002 movn t3,t2 ; Load exact length to read 29865 000647'01 254 00 0 00 000651' else. ; Otherwise use default length 29866 000650'01 211 03 0 00 000200 movni t3,cnflen ; Default maximum characters allowed 29867 000651'01 endif. 29868 29869 000651'01 200 02 0 00 005515' move t2,[point ^d8,cnfmsg] ;Note 8 bit pointer to config message 29870 000652'01 104 00 0 00 000531 SINR% ; Read Configuration message 29871 000653'01 320 12 0 00 000541' erjmpr decerr ; Gronked?? 29872 29873 remark ; Begin configuration message parsing 29874 000654'01 135 01 0 00 005516' ldb t1,[point ^D8,cnfmsg,7] 29875 000655'01 306 01 0 00 000001 cain t1,^d1 ; Is this a configuration message, actually? 29876 000656'01 254 00 0 00 000672' ifskp. ; No, so let's type it 29877 000657'01 200 01 0 00 000000# emsg 29878 000660'01 104 00 0 00 000313 29879 000052'03 000000000000# 29880 000460'04 077 040 111 154 154 29881 000661'01 201 01 0 00 000101 movei t1,.priou ; Output to primary 29882 000662'01 200 02 0 00 005517' move t2,[point ^d8,cnfmsg] ; Pointer to data from remote host 29883 000663'01 201 04 0 03 000200 movei t4,cnflen(t3) ; Get count received-1 29884 000664'01 210 03 0 00 000004 movn t3,t4 ; Now have output count 29885 000665'01 104 00 0 00 000053 SOUT% ; Type data on users terminal 29886 000666'01 320 12 0 00 000667' erjmpr .+1 ; Too bad for user, but ignore it 29887 000667'01 561 01 0 00 000575* hrroi t1, crlf ; Tie off 29888 000670'01 104 00 0 00 000076 PSOUT% ; the line k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-1 K20NET MAC 5-May-24 16:57 Check if a connecting to a machine that supports Tops-20 NRT 29889 000671'01 254 00 0 00 003116' callret clsnrt ; Close the connection 29890 000672'01 endif. ; End case connection message 29891 repeat 0,< ;;We don't look at the next two 29892 ldb t3,[point ^d8,cnfmsg,15] ; DEC ECO 29893 ldb t3,[point ^d8,cnfmsg,23] ; Customer ECO 29894 > 29895 000672'01 135 03 0 00 005520' ldb t3,[point ^d8,cnfmsg,34] ; Operating System type, high order byte 29896 000673'01 242 03 0 00 000010 lsh t3, ^d8 ; shift over and load the low order byte 29897 000674'01 135 04 0 00 005521' ldb t4,[point ^d8,cnfmsg+1,7] 29898 000675'01 200 05 0 00 000004 move q1, t4 ; Save constructed OS type 29899 29900 000676'01 200 01 0 00 000000# txmsg <[Remote system > ; Begin connection banner 29901 000677'01 104 00 0 00 000076 29902 000700'01 320 12 0 00 000701' 29903 000053'03 000000000000# 29904 000467'04 133 122 145 155 157 29905 000701'01 561 01 0 00 000612* hrroi t1,nodnam ; Remote system 29906 000702'01 104 00 0 00 000076 PSOUT% ; Type it 29907 000703'01 200 01 0 00 000000# txmsg <:: is running > 29908 000704'01 104 00 0 00 000076 29909 000705'01 320 12 0 00 000706' 29910 000054'03 000000000000# 29911 000473'04 072 072 040 151 163 29912 29913 000706'01 415 16 0 00 000720' block. ; Enter block context for easier control flow 29914 000707'01 261 17 0 00 000016 29915 000710'01 305 04 0 00 000000 caige t4, 0 ; Negative OS number?? 29916 000711'01 263 17 0 00 000000 ret ; That will never work 29917 000712'01 303 04 0 00 000022 caile t4, hsttyn ; Out of range? 29918 000713'01 263 17 0 00 000000 ret ; Don't know that, either 29919 000714'01 336 00 0 04 000760' skipn hsttyp(t4) ; But!! Is this entry 'known'? 29920 000715'01 263 17 0 00 000000 ret ; Nope (note table has 'reserved' gaps) 29921 000716'01 254 00 0 00 000435* retskp ; Otherwise, it's fine 29922 000717'01 263 17 0 00 000000 endbk. ; Return out of block context, one way or another 29923 000720'01 254 00 0 00 000725' ifskp. ; Skip means we know the remote OS code 29924 000721'01 200 01 0 04 000760' move t1, hsttyp(t4) ; Load OWGP to OS type string 29925 000722'01 202 01 0 00 000000# movem t1, rosnpt ; Save it for k20dsp 29926 000723'01 104 00 0 00 000076 PSOUT% ; Print it 29927 000724'01 254 00 0 00 000737' else. ; Non-skip means we didn't know it 29928 000725'01 200 01 0 00 000000# sxtext (t1,) ; Give it something to type 29929 000055'03 000000000000# 29930 000476'04 125 156 153 156 157 29931 000726'01 202 01 0 00 000000# movem t1, rosnpt ; if it wants something to type 29932 000727'01 200 01 0 00 000000# txmsg < an unknown operating system type: > ; Begin the blat 29933 000730'01 104 00 0 00 000076 29934 000731'01 320 12 0 00 000732' 29935 000056'03 000000000000# 29936 000500'04 040 141 156 040 165 29937 000732'01 201 01 0 00 000101 movei t1, .priou ; Still going to the terminal 29938 000733'01 200 02 0 00 000004 move t2, t4 ; Load the code we got 29939 000734'01 201 03 0 00 000012 movei t3, ^d10 ; These are in base 10 29940 000735'01 104 00 0 00 000224 NOUT% ; Blat the code 29941 000736'01 320 12 0 00 000737' erjmpr .+1 ; Catch and ignore the error 29942 000737'01 endif. ; End OS tyoe check 29943 txmsg <] k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-2 K20NET MAC 5-May-24 16:57 Check if a connecting to a machine that supports Tops-20 NRT 29944 000737'01 200 01 0 00 000000# > 29945 000740'01 104 00 0 00 000076 29946 000741'01 320 12 0 00 000742' 29947 000057'03 000000000000# 29948 000510'04 135 015 012 000 000 29949 000742'01 135 06 0 00 005522' ldb q2,[point ^d16,cnfmsg+1,23] ; Supported protocol types bit field 29950 000743'01 602 06 0 00 000010 ifxe. q2, TOPNRT ; Anything we understand? 29951 000744'01 254 00 0 00 000753' 29952 000745'01 561 01 0 00 000701* hrroi t1, nodnam ; Begin complaining 29953 000746'01 104 00 0 00 000313 ESOUT% ; about the node 29954 txmsg <:: does not support Tops-10/Tops-20 Network Remote Terminal protocol 29955 000747'01 200 01 0 00 000000# > 29956 000750'01 104 00 0 00 000076 29957 000751'01 320 12 0 00 000752' 29958 000060'03 000000000000# 29959 000511'04 072 072 040 144 157 29960 29961 000752'01 254 00 0 00 003116' callret clsnrt ; Close the connection 29962 000753'01 endif. 29963 29964 000753'01 202 05 0 00 000000# movem q1, nrtros ; If NRT, remote operating system type 29965 000754'01 202 06 0 00 000000# movem q2, nrtprt ; Save NRT protocols offered by remote 29966 29967 000755'01 476 00 0 00 000000# setom nrtflg ; Flag this is a valid NRT 29968 000756'01 476 00 0 00 000000# setom binflg ; Flag we will do binary 29969 000757'01 254 00 0 00 000716* retskp ; Won!! 29970 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20NET MAC 5-May-24 16:57 List of known DECnet host operating system types 29971 subttl List of known DECnet host operating system types 29972 29973 ; The base list comes from the venerable SETHOS (hence the similar 29974 ; variable names), but it has been updated with additional systems 29975 ; from the fine folks on HECnet. 29976 ; 29977 ; Be aware that these is not the same list as the DAP list!! 29978 ; (naturally...) They're not even the same between CTerm and NRT! 29979 29980 000760'01 hsttyp: intern hsttyp ; Used by k20dsp, twoo 29981 000760'01 000000000000# eascii ;^d0 29982 000530'04 122 123 124 123 000 29983 000761'01 000000000000# eascii ;^d1 29984 000531'04 122 124 055 061 061 29985 000762'01 000000000000# eascii ;^d2 29986 000533'04 122 123 124 123 057 29987 000763'01 000000000000# eascii ;^d3 29988 000535'04 122 123 130 055 061 29989 000764'01 000000000000# eascii ;^d4 29990 000537'04 122 123 130 055 061 29991 000765'01 000000000000# eascii ;^d5 29992 000541'04 122 123 130 055 061 29993 000766'01 000000000000# eascii ;^d6 29994 000543'04 111 101 123 000 000 29995 000767'01 000000000000# eascii ;^d7 29996 000544'04 126 115 123 000 000 29997 000770'01 000000000000# eascii ;^d8 (TOPS20) 29998 000545'04 124 117 120 123 055 29999 000771'01 000000000000# eascii ;^d9 (TOPS10) 30000 000547'04 124 117 120 123 055 30001 000772'01 000000000000# eascii ;^d10 30002 000551'04 122 124 123 055 070 30003 000773'01 000000000000# eascii ;^d11 (!!) 30004 000553'04 117 123 055 070 000 30005 000774'01 000000000000# eascii ;^d12 30006 000554'04 122 123 130 055 061 30007 000775'01 000000000000# eascii ;^d13 (the DN20!!) 30008 000556'04 115 103 102 000 000 30009 000776'01 000000000000# 0 ;^d14 Reserved 30010 000777'01 000000 000000 0 ;^d15 Reserved 30011 001000'01 000000 000000 0 ;^d16 Reserved 30012 001001'01 000000 000000 0 ;^d17 Reserved 30013 001002'01 000000000000# eascii ;^d18 30014 000557'04 125 114 124 122 111 30015 000000000000# hsttyn=.-hsttyp-1 ; Number of defined operating system types 30016 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20NET MAC 5-May-24 16:57 DECnet interrupt message processing (unused by Kermit) 30017 subttl DECnet interrupt message processing (unused by Kermit) 30018 30019 ; Gets an prints a DECnet interrupt message (which should never happen) 30020 ; and prints it on the user's terminal. No interrupt is enabled for 30021 ; this and the condition is checked for most irregularly. 30022 30023 001003'01 intmsg: entry intmsg 30024 001003'01 265 16 0 00 005463' saveac ; Be transparent 30025 dmove t2, [ .morim ; Read interrupt message 30026 001004'01 120 02 0 00 005523' point 7,intbuf] ; Use this area 30027 001005'01 104 00 0 00 000077 MTOPR% ; Grab the message 30028 001006'01 320 12 0 00 001010' %jserr (,r) 30029 001007'01 254 00 0 00 001013' 30030 001010'01 265 01 0 00 000474* 30031 001011'01 000000000000# 30032 001012'01 254 00 0 00 000615* 30033 000561'04 125 156 141 142 154 30034 001013'01 200 01 0 00 000000# txmsg <[KERMIT-20: DECnet Interrupt Message: > 30035 001014'01 104 00 0 00 000076 30036 001015'01 320 12 0 00 001016' 30037 000061'03 000000000000# 30038 000570'04 133 113 105 122 115 30039 dmove t1, [ .priou ; Typing on terminal 30040 001016'01 120 01 0 00 005525' point 7,intbuf] ; Point where we read this foolishness 30041 001017'01 210 03 0 00 000004 movn t3,t4 ; Doing a counted print 30042 001020'01 104 00 0 00 000053 SOUT% ; Display what we got 30043 001021'01 320 12 0 00 001023' %jserr (,r) 30044 001022'01 254 00 0 00 001026' 30045 001023'01 265 01 0 00 001010* 30046 001024'01 000000000000# 30047 001025'01 254 00 0 00 001012* 30048 000600'04 125 156 141 142 154 30049 txmsg <] 30050 001026'01 200 01 0 00 000000# > ; Close alert and tie off line 30051 001027'01 104 00 0 00 000076 30052 001030'01 320 12 0 00 001031' 30053 000062'03 000000000000# 30054 000607'04 135 015 012 000 000 30055 001031'01 263 17 0 00 000000 ret ; Return with a clean register file 30056 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20NET MAC 5-May-24 16:57 Initialize PTY parameters (adapted from BATCON) 30057 subttl Initialize PTY parameters (adapted from BATCON) 30058 30059 001032'01 inipty: entry inipty 30060 001032'01 200 01 0 00 005527' movx t1, 'TTYJOB' ; Terminal line to job number and 'hungry' 30061 001033'01 104 00 0 00 000016 SYSGT% ; Get the values 30062 001034'01 320 12 0 00 001036' ifje. r ; Fetch error for debugger 30063 001035'01 254 00 0 00 001040' 30064 001036'01 403 02 0 00 000000# setzb t2, ttygtb ; Set an impossible value 30065 001037'01 254 00 0 00 001041' else. ; Otherwise, JSYS worked 30066 001040'01 202 02 0 00 000000# movem t2, ttygtb ; So store something useful 30067 001041'01 endif. ; End case JSYS error handling 30068 30069 001041'01 200 01 0 00 005530' movx t1, 'PTYPAR' ; pseudo terminal configuration info 30070 001042'01 104 00 0 00 000016 SYSGT% ; Get the values 30071 001043'01 320 12 0 00 001045' ifje. r ; Fetch error for debugger 30072 001044'01 254 00 0 00 001047' 30073 001045'01 200 03 0 00 000001 move t3,t1 ; Save error 30074 001046'01 477 01 0 00 000002 setob t1,t2 ; Load a impossible values 30075 001047'01 endif. ; End case JSYS error handling 30076 30077 001047'01 572 01 0 00 000000# hrrem t1,pty1st ; Save TTY number of first PTY 30078 001050'01 576 01 0 00 000000# hlrem t1,ptycnt ; Save count of pseudo-terminals 30079 001051'01 202 02 0 00 000000# movem t2,ptygtb ; GETAB% index (which we'll never use) 30080 30081 001052'01 263 17 0 00 000000 ret ; Done 30082 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20NET MAC 5-May-24 16:57 PTY acquisition 30083 subttl PTY acquisition 30084 30085 ; Assign a PTY to use. This is necessary because, between the time we 30086 ; find a free PTY and the time we actually OPENF% it, somebody else may 30087 ; have already grabbed it. 30088 ; 30089 ; Another way to 'lock' the PTY for exclusive use is simply to open it. 30090 ; The approach of doing an ASND% is superior to this because the PTY 30091 ; can be opened as convenient and, if closed, can still be reused. 30092 ; Otherwise we'd have to go through this whole rigmarole again. 30093 ; 30094 ; Adapted from BATCON, which does an assign by ASND% as apposed to Phase 30095 ; II NRTSRV which assigns by OPENF%. 30096 ; 30097 ; Returns: 30098 ; 30099 ; t1/ Loopback terminal line 30100 ; t2/ Assigned PTY designator 30101 ; 30102 ; N.B., Always have to start with the first PTY and go through all of 30103 ; them because one of them may have become free. 30104 ; 30105 ; Be aware that, if you have more than one Kermit fork in a job doing 30106 ; pseudo-terminal based transfers, then this code will do the wrong 30107 ; thing because a single PTY is assumed to be used per job. There is 30108 ; no expectation of any problem as pseudo-terminals are only used for 30109 ; debugging, testing and prototyping. 30110 30111 001053'01 asipty: entry asipty ; Called by k20mit, also 30112 001053'01 265 16 0 00 005531' saveac ; Leave the registers alone 30113 30114 001054'01 402 00 0 00 000000# setzm ptyflg ; Not doing pseudo-terminals 30115 001055'01 402 00 0 00 000000# setzm binflg ; Not doing binary 30116 001056'01 336 00 0 00 000257* ifmn. asgflg ; Did we have an assigned device? 30117 001057'01 254 00 0 00 001102' 30118 001060'01 336 01 0 00 000260* skipn t1,asgdev ; That is, if we still know it 30119 001061'01 254 00 0 00 001102' anskp. ; Shouldn't happen, but... 30120 001062'01 104 00 0 00 000117 DVCHR% ; Pull the device characteristics 30121 001063'01 320 12 0 00 001065' ifje. r ; Trap error, record it 30122 001064'01 254 00 0 00 001067' 30123 001065'01 200 04 0 00 000001 move t4,t1 ; Get the error out of the way 30124 001066'01 403 01 0 00 000002 setzb t1,t2 ; Claim impossible values 30125 001067'01 endif. ; End JSYS error trap 30126 001067'01 312 01 0 00 001060* came t1,asgdev ; Double check; it's the same, right? 30127 001070'01 254 00 0 00 001102' anskp. ; Different somehow, so don't try to reuse it 30128 001071'01 135 04 0 00 005545' ldb t4,[pointr t2,dv%typ] ;Load the device type 30129 001072'01 302 04 0 00 000013 caie t4,.dvpty ; Is it a pseudo-terminal? 30130 001073'01 254 00 0 00 001102' anskp. ; No, so it is useless for loop back 30131 001074'01 574 04 0 00 000003 hlre t4,t3 ; Pick up the assigned job 30132 001075'01 312 04 0 00 000000* came t4,myjob ; Is it me? 30133 001076'01 254 00 0 00 001102' anskp. ; No, get our own, then 30134 remark t1,t2 ; Device designator and charteristics words loaded 30135 001077'01 476 00 0 00 000000# setom ptyflg ; Flag we have a pseudo-terminal 30136 001100'01 476 00 0 00 000000# setom binflg ; And that it will do binary 30137 001101'01 254 00 0 00 000757* retskp ; Return success, device string already built k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-1 K20NET MAC 5-May-24 16:57 PTY acquisition 30138 001102'01 endif. ; End case attempting device reu-se 30139 30140 001102'01 402 00 0 00 001056* setzm asgflg ; Nothing assigned 30141 001103'01 402 00 0 00 001067* setzm asgdev ; So no assigned device 30142 001104'01 337 05 0 00 000000# skipg q1,ptycnt ; Load and check count of ptys 30143 001105'01 263 17 0 00 000000 ret ; Give up right now 30144 001106'01 335 06 0 00 000000# skipge q2,pty1st ; Load line number associated with 1st PTY 30145 001107'01 263 17 0 00 000000 ret ; Don't work with junk from SYSGT% 30146 001110'01 400 07 0 00 000000 setz q3, ; Initial pseudo-terminal is PTY0: 30147 30148 001111'01 do. ; Enter loop context 30149 001111'01 205 01 0 00 600013 movsi t1,.dvdes+.dvpty ;Load pseudo-terminal device designator 30150 001112'01 540 01 0 00 000007 hrr t1,q3 ; Load the current PTY number 30151 001113'01 104 00 0 00 000117 DVCHR% ; Get device characteristics for this PTY 30152 001114'01 320 12 0 00 001116' ifje. r ; Pick up error for debugger 30153 001115'01 254 00 0 00 001117' 30154 001116'01 400 02 0 00 000000 setz t2, ; Default to not available 30155 001117'01 endif. ; End case device 30156 001117'01 607 02 0 00 010000 ifxn. t2,dv%av ; Free? (available) 30157 001120'01 254 00 0 00 001130' 30158 001121'01 120 03 0 00 000001 dmove t3,t1 ; Save designator words 30159 001122'01 104 00 0 00 000070 ASND% ; Quick! Assign it!! 30160 001123'01 320 16 0 00 001130' annje. ; Failed, do next PTY 30161 001124'01 124 03 0 00 000000# dmovem t3, ndvchr ; Save network device characteristics 30162 001125'01 476 00 0 00 001102* setom asgflg ; Assigned it. Set this flag to remember. 30163 001126'01 202 03 0 00 001103* movem t3, asgdev ; save assigned device 30164 001127'01 254 00 0 00 001133' exit. ; Got it! We're done 30165 001130'01 endif. ; End availibility/assignment attempt 30166 001130'01 114 06 0 00 005546' dadd q2,[exp 1,1] ; Bump both PTY and TTY numbers (clever) 30167 001131'01 367 05 0 00 001111' sojg q1,top. ; Try next pty 30168 001132'01 263 17 0 00 000000 ret ; Otherwise, couldn't get anything, fail 30169 001133'01 enddo. ; Exit loop context 30170 30171 001133'01 200 07 0 00 000001 move q3,t1 ; Save assigned PTY device 30172 001134'01 200 02 0 00 000001 move t2,t1 ; Use it here, too 30173 001135'01 561 01 0 00 000000# hrroi t1,ptynam ; Point to area to write PTY specification 30174 001136'01 104 00 0 00 000121 DEVST% ; Turn device into string 30175 001137'01 320 12 0 00 001025* erjmpr r ; Fail, we just assigned the device! 30176 30177 001140'01 201 02 0 00 000072 movei t2,":" ; Load terminating device punctuation 30178 001141'01 136 02 0 00 000001 idpb t2,t1 ; Complete device syntax 30179 001142'01 400 02 0 00 000000 setz t2, ; Load .chnul 30180 001143'01 136 02 0 00 000001 idpb t2,t1 ; Tie off the string 30181 30182 001144'01 205 02 0 00 600012 movsi t2,.dvdes+.dvtty ; Load terminal device designator 30183 001145'01 540 02 0 00 000006 hrr t2,q2 ; Build complete terminal designator 30184 001146'01 202 02 0 00 000000# movem t2,ptytty ; Store in case we need to manipulate it 30185 30186 001147'01 561 01 0 00 000000# hrroi t1,ttynam ; Point to area to write TTY specification 30187 001150'01 104 00 0 00 000121 DEVST% ; Turn device into string 30188 001151'01 320 12 0 00 001137* erjmpr r ; Fail, we just assigned the device! 30189 30190 001152'01 201 02 0 00 000072 movei t2,":" ; Load terminating device punctuation 30191 001153'01 136 02 0 00 000001 idpb t2,t1 ; Complete device syntax 30192 001154'01 400 02 0 00 000000 setz t2, ; Load .chnul k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-2 K20NET MAC 5-May-24 16:57 PTY acquisition 30193 001155'01 136 02 0 00 000001 idpb t2,t1 ; Tie off the string 30194 30195 001156'01 476 00 0 00 000000# setom ptyflg ; Flag we have a pseudo-terminal 30196 001157'01 476 00 0 00 000000# setom binflg ; And that it will do binary 30197 001160'01 120 01 0 00 000006 dmove t1,q2 ; Load terminal number and PTY designator 30198 001161'01 254 00 0 00 001101* retskp ; Done 30199 30200 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20NET MAC 5-May-24 16:57 Externals for Alternate Network Code 30201 subttl Externals for Alternate Network Code 30202 30203 extern doesc ; Label of main loop for escape character handling 30204 extern duplex ; Whether we're echoing or not 30205 extern echo ; Routine for local echoing 30206 extern escape ; Escape character for connecting (default ^\) 30207 extern vtermf ; Not running on real copper 30208 extern netlgx ; Label to continue error log handling 30209 extern ttfork ; Fork number of the connect receive fork. 30210 extern ttinch ; Label of main keyboard input loop 30211 extern tter1 ; Label for terminal error handling 30212 extern carier ; Carrier flag (also means connected) 30213 extern $connx ; Close connection for a physical line 30214 extern frkchn ; Fork channel interrupt number 30215 extern mdmlin ; -1 = modem-controlled line, 0 = not. 30216 extern sesjfn ; Session log file JFN. 30217 extern sesflg ; Whether the session log is active 30218 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20NET MAC 5-May-24 16:57 Execute the SET LINE command 30219 subttl Execute the SET LINE command 30220 30221 ; SET LINE is almost exactly like CONNECT, except that confirming a 30222 ; CONNECT with no arguments reconnects to an existing connection 30223 ; whereas confirming a SET LINE with no arguments CLOSES the 30224 ; connection. A subtle difference... 30225 ; 30226 ; $CONNE now has all the hairy connection logic, no matter the 30227 ; connection type, PTY, line, NRT, Etc. This routine is simply taking 30228 ; care of a historical special case. 30229 ; 30230 ;Call: 30231 ; 30232 ;pars3/ Parse type: .cmkey, .cmnod, .cmnum, Etc. 30233 ;pars4/ Device information: type, unit, line number, Etc. 30234 30235 001162'01 $setln: entry $setln 30236 001162'01 265 16 0 00 005412' saveac ;[218] Parse item 30237 001163'01 120 05 0 00 000000* dmove q1, pars3 ;[218] Load parse type and unit 30238 001164'01 302 05 0 00 000010 caie q1, .cmcfm ;[218] Wanted to close? 30239 001165'01 254 00 0 00 001200' ifskp. ;[218] We did, so let's do that 30240 001166'01 333 07 0 00 000631* skiple q3, netjfn ;[218] Umm, do we have a connection? 30241 001167'01 254 00 0 00 001173' ifskp. ;[218] We do not, so nothing to do 30242 001170'01 200 01 0 00 000000# emsg ;[218] 30243 001171'01 104 00 0 00 000313 30244 000063'03 000000000000# 30245 000610'04 116 157 040 157 160 30246 001172'01 263 17 0 00 000000 ret ;[218] Nothing further to do 30247 001173'01 endif. ;[218] Otherwise, something is up 30248 001173'01 260 17 0 00 003041' call clsjfn ;[218] Stomp the network connection 30249 txmsg <[Connection closed] 30250 001174'01 200 01 0 00 000000# > ;[218] Say it's all over 30251 001175'01 104 00 0 00 000076 30252 001176'01 320 12 0 00 001177' 30253 000064'03 000000000000# 30254 000616'04 133 103 157 156 156 30255 30256 001177'01 263 17 0 00 000000 ret ;[218] End we're done 30257 001200'01 endif. ;[218] End case confirming to close 30258 30259 001200'01 254 00 0 00 001201' callret $conne ;[218] The rest is just like CONNECT 30260 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20NET MAC 5-May-24 16:57 CONNECT command 30261 subttl CONNECT command 30262 30263 ;[151] CONNECT code totally rewritten as Edit 151. Formerly, CONNECT was 30264 ; accomplished by running a program TTLINK in a lower fork. Now, the 30265 ; code is integrated into this program. This was done for two reasons: 30266 ; 30267 ; 1. V6 of TOPS-20 doesn't allow multiple JFNs on the same TTY device. 30268 ; [V7 has yet to be vetted] 30269 ; 2. TTLINK was interrupt-driven and therefore did not work under batch. 30270 ; 30271 ; This method, similar to that used in Mark Crispin's TELNET program, uses 30272 ; separate input and output forks. It works under batch because the "pty" 30273 ; is always "hungry". 30274 ; 30275 ;[187] This isn't quite true. TELNET can't run well under Batch precisely 30276 ; BECAUSE of the asynchronous forks. Actually, it really doesn't work 30277 ; at all. 30278 ; 30279 ; The Batch paradigm is fundamentally line half-duplex. This means 30280 ; that a line of input is pushed into a PTY and a response is checked 30281 ; for. The PTY may, in fact, NOT be hungry because the program is 30282 ; busy performing the requested command. 30283 ; 30284 ; When running asynchronously, the PTY will ALWAYS look hungry since 30285 ; the fork that is waiting for the input may not even be on the same 30286 ; system. This means that BATCON will continuously stuff input until 30287 ; something goes wrong. If a command fails, then a number of commands 30288 ; will have been typed ahead with unpredictable (or even catastrophic) 30289 ; results. 30290 ; 30291 ; A local modification to BATCON implements a Batch WAIT command, 30292 ; which causes BATCON to ignore PTY hungry for the indicated number of 30293 ; seconds to give whatever is on the other side of the PTY time to 30294 ; type something. It is, at best, a hack. 30295 ; 30296 ; It's best to not use the fork at all and go with a CONNECT/STAY and 30297 ; from there user use the INPUT and OUTPUT commands. 30298 ; 30299 ; Parse results usage: 30300 ; 30301 ; pars3/ COMND% parse type (.cmkey, .cmcfm,.cmnod, Etc.) 30302 ; pars4/ COMND% parsed value (number, node, device or fork handle) 30303 ; pars5/ Whether connecting immediately or staying at local host 30304 ; pars6/ Value of /TIMEOUT parameter, if given 30305 ; pars7/ Whether using MTOPR% .MOSNH or handling communications in user mode 30306 30307 001201'01 $conne: entry $conne ;[186] Invoked from k20mit 30308 extern ttsfrk ;[186] Joins k20mit here 30309 30310 001201'01 335 01 0 00 001163* skipge t1, pars3 ;[186] Load the parse type 30311 001202'01 201 01 0 00 000010 movx t1, .cmcfm ;[186] If junk, use confirm 30312 30313 001203'01 302 01 0 00 000010 caie t1, .cmcfm ;[186] Confirmed (reconnect)? 30314 001204'01 254 00 0 00 001251' ifskp. ;[186] Yes, let's see if that makes sense 30315 001205'01 333 02 0 00 000000# skiple t2, opndev ;[186] Load currently connected device k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-1 K20NET MAC 5-May-24 16:57 CONNECT command 30316 001206'01 254 00 0 00 001212' ifskp. ;[186] Junk?? 30317 emsg ;[186] Shouldn't happen. Ever 30319 001210'01 104 00 0 00 000313 30320 000065'03 000000000000# 30321 000623'04 116 157 164 150 151 30322 30323 001211'01 263 17 0 00 000000 ret ;[186] Do not continue 30324 001212'01 endif. ;[186] End case absurd open device 30325 30326 001212'01 332 00 0 00 000227* ifme. local ;[186] Remote? 30327 001213'01 254 00 0 00 001220' 30328 001214'01 201 01 0 00 000001 movei t1, .cmnum ;[186] Can't connect to ourself 30329 001215'01 200 02 0 00 000000* move t2, mytty ;[186] So pretend we tried 30330 001216'01 124 01 0 00 001201* dmovem t1, pars3 ;[186] Stomp the parse 30331 001217'01 254 00 0 00 001251' jrst $conn1 ;[186] and carry on, eventualy to fail 30332 001220'01 endif. ;[186] End case remote reconnect 30333 30334 001220'01 302 02 0 00 000013 caie t2, .dvpty ;[186] Reconnect a PTY? 30335 001221'01 254 00 0 00 001225' ifskp. ;[186] Yes, fake that out 30336 001222'01 201 01 0 00 000000 movei t1, .cmkey ;[186] Pretend we parsed a keyword 30337 001223'01 124 01 0 00 001216* dmovem t1, pars3 ;[186] Stomp that in 30338 001224'01 254 00 0 00 001251' jrst $conn1 ;[186] Continue (re)connect 30339 001225'01 endif. ;[186] End case PTY reconnection 30340 30341 001225'01 302 02 0 00 000012 caie t2, .dvtty ;[186] Reconnect a physical terminal? 30342 001226'01 254 00 0 00 001233' ifskp. ;[186] Yes, fake that out 30343 001227'01 201 01 0 00 000001 movei t1, .cmnum ;[186] Pretend we parsed a number 30344 001230'01 200 02 0 00 000214* move t2, ttynum ;[186] Which is the currently open terminal 30345 001231'01 124 01 0 00 001223* dmovem t1, pars3 ;[186] Stomp that in and continue 30346 001232'01 254 00 0 00 001251' jrst $conn1 ;[186] Continue (re)connect 30347 001233'01 endif. ;[186] End case terminal reconnection 30348 30349 001233'01 302 02 0 00 000022 caie t2, .dvdcn ;[186] Reconnect an NRT? 30350 001234'01 254 00 0 00 001244' ifskp. ;[186] Yes, fake that out 30351 001235'01 201 01 0 00 000026 movei t1, .cmnod ;[186] Pretend we parsed a node 30352 001236'01 124 01 0 00 001231* dmovem t1, pars3 ;[186] Stomp that in 30353 001237'01 332 00 0 00 000000# skipe forkls ;[236] Wasn't in a forkless connect? 30354 001240'01 476 00 0 00 000000* setom pars7 ;[236] Pretend we parsed the /FORKLESS switch 30355 001241'01 120 03 0 00 000745* dmove t3, nodnam ;[186] Load current node name 30356 001242'01 124 03 0 00 000000* dmovem t3, atmbuf ;[186] Pretend we parsed it 30357 001243'01 254 00 0 00 001251' jrst $conn1 ;[186] Continue (re)connect 30358 001244'01 endif. ;[186] End case NRT reconnection 30359 30360 001244'01 334 01 0 00 000000# ermsg% (, r) 30361 001245'01 254 00 0 00 001251' 30362 001246'01 202 01 0 00 000000* 30363 001247'01 104 00 0 00 000313 30364 001250'01 254 00 0 00 001151* 30365 000066'03 000000000000# 30366 000632'04 113 105 122 115 111 30367 30368 001251'01 endif. ;[186] End case ,cmcfm 30369 30370 001251'01 302 01 0 00 000001 $conn1: caie t1, .cmnum ;[186] Parsed a number? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-2 K20NET MAC 5-May-24 16:57 CONNECT command 30371 001252'01 254 00 0 00 001270' ifskp. ;[186] Yes, wants a physical line 30372 001253'01 331 02 0 00 000000* skipl t2, pars4 ;[186] Sanity check the number 30373 001254'01 254 00 0 00 001260' ifskp. ;[186] Don't let's be silly... 30374 emsg ;[186] An appropriate Vulcan response 30376 001256'01 104 00 0 00 000313 30377 000067'03 000000000000# 30378 000642'04 116 145 147 141 164 30379 30380 001257'01 263 17 0 00 000000 ret ;[186] And get out of here 30381 001260'01 endif. ;[186] End case negative number 30382 30383 001260'01 312 02 0 00 001215* came t2, mytty ;[186] Is the requested line the same as ours? 30384 001261'01 254 00 0 00 001265' ifskp. ;[186] It is silly to connect to ourselves 30385 emsg ;[187] Advise user of their confusion 30388 001263'01 104 00 0 00 000313 30389 000070'03 000000000000# 30390 000653'04 131 157 165 040 143 30391 30392 30393 001264'01 263 17 0 00 000000 ret ;[186] And get out of here 30394 001265'01 endif. ;[186] End case self-connect 30395 remark ;[186] Fine, let's try to use it 30396 001265'01 505 01 0 00 000012 hrli t1, .dvtty ;[186] Requesting a terminal 30397 001266'01 540 01 0 00 000002 hrr t1, t2 ;[186] This line 30398 001267'01 254 00 0 00 001426' jrst $conn2 ;[186] Go blat about the connection 30399 001270'01 endif. ;[186] End case physical line 30400 30401 001270'01 302 01 0 00 000000 caie t1, .cmkey ;[186] Parsed a keyword? 30402 001271'01 254 00 0 00 001343' ifskp. ;[186] Yes, let's see about that 30403 001272'01 550 01 0 00 001253* hrrz t1, pars4 ;[186] Load the requested device 30404 30405 001273'01 302 01 0 00 000015 caie t1, .dvnul ;[186] Wants to close out? 30406 001274'01 254 00 0 00 001307' ifskp. ;[186] Yes, so break the connection 30407 001275'01 332 00 0 00 001212* ifme. local ;[186] Already remote? 30408 001276'01 254 00 0 00 001302' 30409 emsg 30411 001300'01 104 00 0 00 000313 30412 000071'03 000000000000# 30413 000677'04 116 157 040 156 145 30414 30415 001301'01 263 17 0 00 000000 ret ;[186] Nothing to do, bye 30416 001302'01 endif. ;[186] End case not local 30417 001302'01 260 17 0 00 003044' call clsnet ;[186] Close whatever might be open 30418 txmsg <[Connection closed] 30419 001303'01 200 01 0 00 000000# > ;[186] Should say connection with what... 30420 001304'01 104 00 0 00 000076 30421 001305'01 320 12 0 00 001306' 30422 000072'03 000000000000# 30423 000706'04 133 103 157 156 156 30424 30425 001306'01 263 17 0 00 000000 ret ;[186] Proceed no further k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-3 K20NET MAC 5-May-24 16:57 CONNECT command 30426 001307'01 endif. ;[186] End case closure 30427 30428 001307'01 302 01 0 00 000013 caie t1, .dvpty ;[186] Wants local loopback, differet job? 30429 001310'01 254 00 0 00 001313' ifskp. ;[186] Fine, let's try to use it 30430 001311'01 525 01 0 00 000013 hrloi t1, .dvpty ;[186] We don't specify the pseudo terminal 30431 001312'01 254 00 0 00 001426' jrst $conn2 ;[186] Go blat about the connection 30432 001313'01 endif. ;[186] 30433 30434 001313'01 302 01 0 00 000403 caie t1, .dvpip ;[186] Local connection, same job? 30435 001314'01 254 00 0 00 001320' ifskp. ;[186] Ok, handle that 30436 emsg () 30438 001316'01 104 00 0 00 000313 30439 000073'03 000000000000# 30440 000713'04 123 141 155 145 040 30441 30442 001317'01 263 17 0 00 000000 ret ;[186] Nothing to do, bye 30443 001320'01 endif. ;[186] End case doing a pipe 30444 30445 001320'01 302 01 0 00 777774 caie t1, .fhinf ;[205] Wants to get rid of the terminal fork? 30446 001321'01 254 00 0 00 001336' ifskp. ;[205] Does, so no 'network' activity 30447 001322'01 333 01 0 00 000000* skiple t1, ttfork ;[205] Load the fork handle 30448 001323'01 254 00 0 00 001327' ifskp. ;[205] Unless there isn't one 30449 emsg ;[205] Blat about it 30451 001325'01 104 00 0 00 000313 30452 000074'03 000000000000# 30453 000727'04 116 157 040 162 145 30454 30455 001326'01 254 00 0 00 001334' else. ;[205] Otherwise, get rid of it 30456 001327'01 104 00 0 00 000153 KFORK% ;[205] BYE!! 30457 001330'01 320 12 0 00 001331' erjmpr .+1 ;[205] Ignore error and carry on 30458 txmsg <[Killed remote terminal fork] 30459 001331'01 200 01 0 00 000000# > ;[205] 30460 001332'01 104 00 0 00 000076 30461 001333'01 320 12 0 00 001334' 30462 000075'03 000000000000# 30463 000736'04 133 113 151 154 154 30464 30465 001334'01 endif. ;[205] End fork determination actions 30466 001334'01 402 00 0 00 001322* setzm ttfork ;[205] Remember its demise 30467 001335'01 263 17 0 00 000000 ret ;[205] And we're done 30468 001336'01 endif. ;[205] End case terminal fork management 30469 30470 001336'01 334 01 0 00 000000# ermsg% (,r) ;[186] 30471 001337'01 254 00 0 00 001343' 30472 001340'01 202 01 0 00 001246* 30473 001341'01 104 00 0 00 000313 30474 001342'01 254 00 0 00 001250* 30475 000076'03 000000000000# 30476 000745'04 113 105 122 115 111 30477 30478 001343'01 endif. ;[186] End case .cmkey 30479 30480 001343'01 302 01 0 00 000026 caie t1, .cmnod ;[186] Parsed a node? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-4 K20NET MAC 5-May-24 16:57 CONNECT command 30481 001344'01 254 00 0 00 001421' ifskp. ;[186] Yes, wants to have excitement and adventure! 30482 001345'01 415 16 0 00 001371' block. ;[186] Allocate an anonymous stkvar 30483 001346'01 261 17 0 00 000016 30484 001347'01 265 16 0 00 000000* anstkv(t4,<.ndnum+1>);[186] Allocate a block for NODE% 30485 001350'01 000000 000003 30486 001351'01 415 04 0 17 777774 30487 001352'01 561 01 0 00 001242* hrroi t1, atmbuf ;[186] Point to whatever user typed 30488 001353'01 202 01 0 04 000000 movem t1, .ndnod(t4) ;[186] Store in block 30489 001354'01 403 01 0 00 000002 setzb t1, t2 ;[186] Cons up some zeros 30490 001355'01 124 01 0 04 000001 dmovem t1, .ndflg(t4) ;[186] Stomp flags and number 30491 001356'01 201 01 0 00 000023 movei t1, .ndvfx ;[186] Node name verify, extended 30492 001357'01 336 00 0 00 000000# skipn ndvfxp ;[186] Has extended verify? 30493 001360'01 201 01 0 00 000015 movx t1, .ndvfy ;[186] Unfortunate, but still doable 30494 001361'01 200 02 0 00 000004 move t2, t4 ;[186] Load base of block 30495 001362'01 104 00 0 00 000567 NODE% ;[186] Should work because .cmnod validates 30496 001363'01 320 12 0 00 001365' ifje. r ;[186] Failed?? 30497 001364'01 254 00 0 00 001367' 30498 001365'01 403 02 0 00 000003 setzb t2, t3 ;[186] Whack any supposed flags 30499 001366'01 254 00 0 00 001370' else. ;[186] Otherwise, worked 30500 001367'01 120 02 0 04 000001 dmove t2, .ndflg(t4) ;[186] Load flags and maybe number 30501 001370'01 endif. ;[186] End JSYS error processing 30502 001370'01 263 17 0 00 000000 endbk. ;[186] End block, restore stack 30503 001371'01 603 02 0 00 200000 ifxe. t2, nd%lgl ;[186] Illegal in some way? 30504 001372'01 254 00 0 00 001402' 30505 001373'01 200 01 0 00 000000# emsg ;[186] Blat about it 30506 001374'01 104 00 0 00 000313 30507 000077'03 000000000000# 30508 000756'04 111 154 154 145 147 30509 001375'01 561 01 0 00 001352* hrroi t1, atmbuf ;[186] Point to what was typed 30510 001376'01 104 00 0 00 000076 PSOUT% ;[186] Type it 30511 001377'01 561 01 0 00 000667* hrroi t1, crlf ;[186] Tie off the line 30512 001400'01 104 00 0 00 000076 PSOUT% ;[186] Type it 30513 001401'01 263 17 0 00 000000 ret ;[186] Proceed no further 30514 001402'01 endif. 30515 001402'01 321 02 0 00 001412' ifxe. t2, nd%exm ;[186] Syntax correct, but do we know about it? 30516 001403'01 200 01 0 00 000000# emsg ;[186] Blat about it 30517 001404'01 104 00 0 00 000313 30518 000100'03 000000000000# 30519 000764'04 125 156 153 156 157 30520 001405'01 561 01 0 00 001375* hrroi t1, atmbuf ;[186] Point to what was typed 30521 001406'01 104 00 0 00 000076 PSOUT% ;[186] Type it 30522 001407'01 561 01 0 00 001377* hrroi t1, crlf ;[186] Tie off the line 30523 001410'01 104 00 0 00 000076 PSOUT% ;[186] Type it 30524 001411'01 263 17 0 00 000000 ret ;[186] Proceed no further 30525 001412'01 endif. 30526 001412'01 603 02 0 00 020000 txne t2, nd%num ;[186] Did T79 give us a number? 30527 001413'01 202 03 0 00 000604* movem t3, nodnum ;[186] Yes, store it 30528 001414'01 120 01 0 00 001405* dmove t1, atmbuf ;[186] Grab the atom buffer 30529 001415'01 124 01 0 00 001241* dmovem t1, nodnam ;[186] Pass to openrt 30530 001416'01 505 01 0 00 000022 hrli t1, .dvdcn ;[186] Outgoing DECnet connection 30531 001417'01 540 01 0 00 000003 hrr t1, t3 ;[186] Use node number, if we have it 30532 001420'01 254 00 0 00 001426' jrst $conn2 ;[186] And open the connection 30533 001421'01 endif. ;[186] End case node:: typed 30534 30535 001421'01 334 01 0 00 000000# ermsg% (,r) ;[186] k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-5 K20NET MAC 5-May-24 16:57 CONNECT command 30536 001422'01 254 00 0 00 001426' 30537 001423'01 202 01 0 00 001340* 30538 001424'01 104 00 0 00 000313 30539 001425'01 254 00 0 00 001342* 30540 000101'03 000000000000# 30541 000772'04 113 105 122 115 111 30542 30543 30544 ; Set up controlling TTY for talk mode, issue connect message. 30545 30546 001426'01 260 17 0 00 003375' $conn2: call openet ;[186] Go open (or reopen) the connection 30547 001427'01 263 17 0 00 000000 ret ;[186] Couldn't; proceed no further 30548 001430'01 202 01 0 00 001166* movem t1, netjfn ;[186] Store as network JFN 30549 001431'01 336 00 0 00 000000* skipn pars5 ;[205] Don't init terminal if staying 30550 001432'01 260 17 0 00 000000* call ttyini ;[186] Init controlling TTY. 30551 30552 001433'01 200 01 0 00 000000# txmsg <[KERMIT-20: > 30553 001434'01 104 00 0 00 000076 30554 001435'01 320 12 0 00 001436' 30555 000102'03 000000000000# 30556 001005'04 133 113 105 122 115 30557 001436'01 336 00 0 00 000000# ifmn. nrtflg ;[186] Active NRT connection? 30558 001437'01 254 00 0 00 001451' 30559 001440'01 200 01 0 00 000000# txmsg 30560 001441'01 104 00 0 00 000076 30561 001442'01 320 12 0 00 001443' 30562 000103'03 000000000000# 30563 001010'04 103 157 156 156 145 30564 001443'01 561 01 0 00 001415* hrroi t1,nodnam ;[186] and don't claim it is a terminal 30565 001444'01 104 00 0 00 000076 PSOUT% ;[186] instead, type the node name 30566 001445'01 200 01 0 00 000000# txmsg <::> ;[211] DECnet node punctuation 30567 001446'01 104 00 0 00 000076 30568 001447'01 320 12 0 00 001450' 30569 000104'03 000000000000# 30570 001016'04 072 072 000 000 000 30571 001450'01 254 00 0 00 001506' else. ;[186] Otherwise, use the physical line 30572 001451'01 336 00 0 00 000000# ifmn. ptyflg ;[186] Unless using a pseudo-terminal 30573 001452'01 254 00 0 00 001471' 30574 001453'01 200 01 0 00 000000# txmsg ;[186] 30575 001454'01 104 00 0 00 000076 30576 001455'01 320 12 0 00 001456' 30577 000105'03 000000000000# 30578 001017'04 114 157 157 160 142 30579 001456'01 561 01 0 00 000000# hrroi t1,sysnam ;[186] Load local node name 30580 001457'01 104 00 0 00 000076 PSOUT% ;[186] Remind us of where we are 30581 001460'01 200 01 0 00 000000# txmsg <:: via > ;[186] some more details 30582 001461'01 104 00 0 00 000076 30583 001462'01 320 12 0 00 001463' 30584 000106'03 000000000000# 30585 001024'04 072 072 040 166 151 30586 001463'01 561 01 0 00 000000# hrroi t1,ptynam ;[186] Give pseudo-terminal number 30587 001464'01 104 00 0 00 000076 PSOUT% ;[186] Type that 30588 001465'01 200 01 0 00 000000# txmsg < as > ;[186] load final clause 30589 001466'01 104 00 0 00 000076 30590 001467'01 320 12 0 00 001470' k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-6 K20NET MAC 5-May-24 16:57 CONNECT command 30591 000107'03 000000000000# 30592 001026'04 040 141 163 040 000 30593 001470'01 254 00 0 00 001474' else. ;[186] Otherwise, physical line 30594 001471'01 200 01 0 00 000000# txmsg ;[186] 30595 001472'01 104 00 0 00 000076 30596 001473'01 320 12 0 00 001474' 30597 000110'03 000000000000# 30598 001027'04 103 157 156 156 145 30599 001474'01 endif. ;[186] End case pseudo-terminal 30600 001474'01 200 01 0 00 000000# txmsg ;[186] Type message. 30601 001475'01 104 00 0 00 000076 30602 001476'01 320 12 0 00 001477' 30603 000111'03 000000000000# 30604 001036'04 124 124 131 000 000 30605 001477'01 201 01 0 00 000101 numout ttynum,^d8 ;[186] 30606 001500'01 200 02 0 00 001230* 30607 001501'01 201 03 0 00 000010 30608 001502'01 104 00 0 00 000224 30609 001503'01 320 14 0 00 001504' 30610 001504'01 201 01 0 00 000072 movei t1,":" ;[186] Extra colon to punctuate 30611 001505'01 104 00 0 00 000074 PBOUT% ;[186] DECnet node name 30612 001506'01 endif. ;[186] 30613 001506'01 332 00 0 00 001431* ifme. pars5 ;[205] Staying at remote? 30614 001507'01 254 00 0 00 001531' 30615 001510'01 200 01 0 00 000000# txmsg <, type > ;[205] No, normal blat 30616 001511'01 104 00 0 00 000076 30617 001512'01 320 12 0 00 001513' 30618 000112'03 000000000000# 30619 001037'04 054 040 164 171 160 30620 001513'01 201 01 0 00 000074 movei t1, 74 ; Left pointy bracket... 30621 001514'01 104 00 0 00 000074 PBOUT 30622 001515'01 200 01 0 00 000000# txmsg 30623 001516'01 104 00 0 00 000076 30624 001517'01 320 12 0 00 001520' 30625 000113'03 000000000000# 30626 001041'04 103 124 122 114 055 30627 001520'01 200 01 0 00 000000* move t1, escape ; (tell escape character) 30628 001521'01 271 01 0 00 000100 addi t1, "A"-1 30629 001522'01 104 00 0 00 000074 PBOUT 30630 001523'01 201 01 0 00 000076 movei t1, 76 ; ...Right pointy bracket 30631 001524'01 104 00 0 00 000074 PBOUT 30632 001525'01 200 01 0 00 000000# txmsg < to return.] > ; Tell about session log, if any. 30633 001526'01 104 00 0 00 000076 30634 001527'01 320 12 0 00 001530' 30635 000114'03 000000000000# 30636 001043'04 040 164 157 040 162 30637 001530'01 254 00 0 00 001533' else. ;[205] No, staying, so different blat 30638 001531'01 201 01 0 00 000135 movei t1, "]" ;[205] Not much blat 30639 001532'01 104 00 0 00 000074 PBOUT% ;[205] But say what there is of it... 30640 001533'01 endif. ;[205] 30641 30642 001533'01 337 02 0 00 000000* skipg t2, sesjfn ;[195] Logging? 30643 001534'01 254 00 0 00 001573' ifskp. ;[186] No, just tie off the line 30644 txmsg < 30645 001535'01 200 01 0 00 000000# [KERMIT-20: Logging session to > ; Yes, tell them now. k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-7 K20NET MAC 5-May-24 16:57 CONNECT command 30646 001536'01 104 00 0 00 000076 30647 001537'01 320 12 0 00 001540' 30648 000115'03 000000000000# 30649 001046'04 015 012 133 113 105 30650 001540'01 201 01 0 00 000101 movei t1, .priou ; Type the filename. 30651 001541'01 302 02 0 00 377777 caie t2, .nulio ;[195] Just dumping it? 30652 001542'01 254 00 0 00 001553' ifskp. ;[195] Yep that's easy 30653 001543'01 120 02 0 00 000000* dmove t2, nul4## ;[195] In k20dsp 30654 001544'01 104 00 0 00 000053 SOUT% ;[195] 30655 001545'01 320 12 0 00 001547' %jserr (,) ;[195] 30656 001546'01 254 00 0 00 001552' 30657 001547'01 265 01 0 00 001023* 30658 001550'01 000000 000000 30659 001551'01 254 00 0 00 001552' 30660 001552'01 254 00 0 00 001562' else. ;[195] Otherwise, a real file 30661 001553'01 403 03 0 00 000004 setzb t3, t4 ;[195] 30662 001554'01 104 00 0 00 000030 JFNS% 30663 001555'01 320 12 0 00 001557' %jserr (,) 30664 001556'01 254 00 0 00 001562' 30665 001557'01 265 01 0 00 001547* 30666 001560'01 000000 000000 30667 001561'01 254 00 0 00 001562' 30668 001562'01 endif. ;[195] 30669 30670 001562'01 332 00 0 00 000000* ifme. sesflg ;[195] Active? 30671 001563'01 254 00 0 00 001567' 30672 001564'01 200 01 0 00 000000# txmsg < (Disabled)> ;[195] Nyet 30673 001565'01 104 00 0 00 000076 30674 001566'01 320 12 0 00 001567' 30675 000116'03 000000000000# 30676 001055'04 040 050 104 151 163 30677 001567'01 endif. ;[195] 30678 txmsg <] 30679 001567'01 200 01 0 00 000000# > ;[195] 30680 001570'01 104 00 0 00 000076 30681 001571'01 320 12 0 00 001572' 30682 000117'03 000000000000# 30683 001060'04 135 015 012 000 000 30684 001572'01 254 00 0 00 001575' else. ;[195] Otherwise just 30685 001573'01 561 01 0 00 001407* hrroi t1,crlf ;[195] tie off the line 30686 001574'01 104 00 0 00 000076 PSOUT% 30687 001575'01 endif. ;[195] 30688 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20NET MAC 5-May-24 16:57 CONNECT command 30689 remark Connection is open, determine what else to do with the terminal 30690 30691 001575'01 402 00 0 00 000000# setzm forkls ;[236] Clear /FORKLESS connect unless explicitly set 30692 001576'01 336 00 0 00 001240* ifmn. pars7 ;[236] Wants /FORKLESS? 30693 001577'01 254 00 0 00 001613' 30694 001600'01 332 00 0 00 000000# ifme. nrtflg ;[236] Yes, BUT!! Are we an active NRT connection? 30695 001601'01 254 00 0 00 001607' 30696 001602'01 402 00 0 00 001576* setzm pars7 ;[236] Force parse of normal connect 30697 txmsg <% /FORKLESS is only valid for DECnet connections 30698 001603'01 200 01 0 00 000000# > ;[236] Gently advise that this won't work... 30699 001604'01 104 00 0 00 000076 30700 001605'01 320 12 0 00 001606' 30701 000120'03 000000000000# 30702 001061'04 045 040 057 106 117 30703 30704 001606'01 254 00 0 00 001613' jrst $conn3 ;[236] And get on with it the olde-fashioned way 30705 001607'01 endif. ;[236] End case clearing /FORKLESS for non-NRT 30706 remark ;[236] Otherwise, flag other code we're doing /FORKLESS 30707 001607'01 476 00 0 00 000000# setom forkls ;[236] Flag doing a forkless NRT connect 30708 001610'01 332 00 0 00 001506* skipe pars5 ;[236] But! Doesn't actually want to connect yet? 30709 001611'01 263 17 0 00 000000 ret ;[236] We're done 30710 001612'01 254 00 0 00 001616' callret frklsc ;[236] Falls into the below (but saves a JRST 30711 001613'01 endif. ;[236] End case handling a /FORKLESS connection 30712 30713 001613'01 332 00 0 00 001610* $conn3: skipe pars5 ;[218] Doesn't want to connect terminal yet? 30714 001614'01 263 17 0 00 000000 ret ;[218] We're done 30715 001615'01 254 00 0 00 000000* callret ttsfrk ;[218] Otherwise, set up the forks and terminal 30716 30717 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20NET MAC 5-May-24 16:57 Forkless terminal connect 30718 subttl Forkless terminal connect 30719 30720 001616'01 frklsc: entry frklsc ;[236] Invoked by K20MIT, also 30721 001616'01 415 16 0 00 001732' block. ;[236] Otherwise, connect terminal via the monitor!! 30722 001617'01 261 17 0 00 000016 30723 001620'01 265 16 0 00 001347* anstkv(t4,.shlen) ;[236] Allocate a block for the MTOPR% 30724 001621'01 000000 000003 30725 001622'01 415 04 0 17 777774 30726 30727 remark ;[236] Construct block items 30728 001623'01 201 01 0 00 000003 movx t1, .shlen ;[236] Load length of argument block 30729 001624'01 550 02 0 00 000000* hrrz t2, ttyjfn ;[236] Only connecting our controlling terminal 30730 001625'01 550 03 0 00 001520* hrrz t3, escape ;[236] Load the escape character 30731 001626'01 332 00 0 00 000000* skipe flow ;[236] Doing flow control? 30732 001627'01 661 03 0 00 400000 txo t3, sh%lpm ;[236] Yes, turn on local page mode 30733 30734 remark ;[236] Populate the block 30735 001630'01 124 01 0 04 000000 dmovem t1, .sharg(t4) ;[236] Set first two words of the argument block 30736 001631'01 202 03 0 04 000002 movem t3, .shesc(t4) ;[236] Third word is escape character and flags 30737 30738 remark ;[236] Finally do the connect!!! 30739 001632'01 550 01 0 00 001430* hrrz t1, netjfn ;[236] Load the network JFN 30740 001633'01 201 02 0 00 000044 movx t2, .mosnh ;[236] Function is monitor NRT connect 30741 001634'01 200 03 0 00 000004 move t3, t4 ;[236] Load address of argument block 30742 001635'01 104 00 0 00 000077 MTOPR% ;[236] Do the connect 30743 001636'01 320 12 0 00 001640' %jserr (,r) ;[236] 30744 001637'01 254 00 0 00 001643' 30745 001640'01 265 01 0 00 001557* 30746 001641'01 000000000000# 30747 001642'01 254 00 0 00 001425* 30748 001074'04 125 156 141 142 154 30749 30750 001643'01 550 01 0 04 000001 hrrz t1, .shtty(t4) ;[236] Load terminal identifier we used 30751 001644'01 104 00 0 00 000050 BIN% ;[236] Swallow escape character it leaves in buffer 30752 001645'01 320 12 0 00 001647' %jserr (,r) ;[236] 30753 001646'01 254 00 0 00 001652' 30754 001647'01 265 01 0 00 001640* 30755 001650'01 000000000000# 30756 001651'01 254 00 0 00 001642* 30757 001104'04 125 156 141 142 154 30758 30759 001652'01 550 01 0 00 001632* hrrz t1, netjfn ;[236] Load the network JFN 30760 001653'01 260 17 0 00 004124' call chkdcn ;[236] Returned; get link status 30761 001654'01 332 00 0 00 000000* ifme. carier ;[236] Got disconnected? 30762 001655'01 254 00 0 00 001730' 30763 001656'01 607 03 0 00 004000 ifxn. t3,mo%syn ;[236] Normal close and 30764 001657'01 254 00 0 00 001674' 30765 001660'01 603 03 0 00 010000 andxe. t3,mo%abt ;[236] not aborted? 30766 001661'01 254 00 0 00 001674' 30767 001662'01 400 04 0 00 000000 setz t4, ;[236] Flag a normal close 30768 001663'01 200 01 0 00 000000# txmsg (<[KERMIT-20: >) ;[236] Yes, begin blat ']' (emacs) 30769 001664'01 104 00 0 00 000076 30770 001665'01 320 12 0 00 001666' 30771 000121'03 000000000000# 30772 001116'04 133 113 105 122 115 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-1 K20NET MAC 5-May-24 16:57 Forkless terminal connect 30773 001666'01 561 01 0 00 001443* hrroi t1,nodnam ;[236] Point to the remote node 30774 001667'01 104 00 0 00 000076 PSOUT% ;[236] Type it 30775 001670'01 200 01 0 00 000000# txmsg <:: has closed> ;[236] 30776 001671'01 104 00 0 00 000076 30777 001672'01 320 12 0 00 001673' 30778 000122'03 000000000000# 30779 001121'04 072 072 040 150 141 30780 001673'01 254 00 0 00 001704' else. ;[236] Otherwise, abnormal close 30781 001674'01 474 04 0 00 000000 seto t4, ;[236] Flag an ABNORMAL close 30782 001675'01 200 01 0 00 000000# emsg () ;[236] Begin an error message 30783 001676'01 104 00 0 00 000313 30784 000123'03 000000000000# 30785 001124'04 113 105 122 115 111 30786 001677'01 561 01 0 00 001666* hrroi t1,nodnam ;[236] Point to the remote node 30787 001700'01 104 00 0 00 000076 PSOUT% ;[236] Type it 30788 001701'01 200 01 0 00 000000# txmsg <:: has aborted> ;[236] 30789 001702'01 104 00 0 00 000076 30790 001703'01 320 12 0 00 001704' 30791 000124'03 000000000000# 30792 001127'04 072 072 040 150 141 30793 001704'01 endif. ;[236] End case link closure analysis 30794 001704'01 200 01 0 00 000000# txmsg (< the NRT connection because: >) ;[236] 30795 001705'01 104 00 0 00 000076 30796 001706'01 320 12 0 00 001707' 30797 000125'03 000000000000# 30798 001132'04 040 164 150 145 040 30799 001707'01 260 17 0 00 002325' call gdscpt ;[236] Get pointer to disconnect reason 30800 001710'01 104 00 0 00 000076 PSOUT% ;[236] Type it 30801 001711'01 200 01 0 00 000000# txmsg <. Returning to > ;[236] Emphasize we're not there anymore 30802 001712'01 104 00 0 00 000076 30803 001713'01 320 12 0 00 001714' 30804 000126'03 000000000000# 30805 001140'04 056 040 122 145 164 30806 001714'01 561 01 0 00 000000# hrroi t1,sysnam ;[236] Load local node name 30807 001715'01 104 00 0 00 000076 PSOUT% ;[236] and type it 30808 001716'01 200 01 0 00 000000# txmsg <::> ;[236] Punctuate the local node name 30809 001717'01 104 00 0 00 000076 30810 001720'01 320 12 0 00 001721' 30811 000127'03 000000000000# 30812 001144'04 072 072 000 000 000 30813 001721'01 326 04 0 00 001724' ife. t4 ;[236] Did it close normally? 30814 001722'01 201 01 0 00 000135 movx t1,135 ;[236] It did, so load a closing brocket 30815 001723'01 104 00 0 00 000074 PBOUT% ;[236] Type it to close off the message 30816 001724'01 endif. ;[236] End case properly formating informative message 30817 001724'01 561 01 0 00 001573* hrroi t1, crlf ;[236] Tie off the line 30818 001725'01 104 00 0 00 000076 PSOUT% ;[236] 30819 001726'01 260 17 0 00 003116' call clsnrt ;[236] Toss the NRT connection 30820 001727'01 263 17 0 00 000000 ret ;[236] Either way, return; we're done 30821 001730'01 endif. ;[236] End case disconnected 30822 30823 001730'01 254 00 0 00 001161* retskp ;[236] Otherwise, worked and they typed the escape 30824 001731'01 263 17 0 00 000000 endbk. ;[236] End block context 30825 001732'01 254 00 0 00 001735' ifskp. ;[236] Worked? 30826 001733'01 254 00 0 00 000000* callret doesc ;[236] It did, and the user typed the escape character 30827 001734'01 254 00 0 00 001736' else. ;[236] Something failed k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-2 K20NET MAC 5-May-24 16:57 Forkless terminal connect 30828 001735'01 263 17 0 00 000000 ret ;[236] Just get out of here 30829 001736'01 endif. ;[236] 30830 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20NET MAC 5-May-24 16:57 BOUTR% - BOUT% a Record 30831 subttl BOUTR% - BOUT% a Record 30832 30833 ; Necessary when doing DECnet to get a character pushed 30834 ; 30835 ; t1/ Network JFN 30836 ; t2/ Character to send 30837 ; 30838 ; Inefficient, you say? Clearly you haven't seen the code in the 30839 ; monitor that does a 'push'... 30840 ; 30841 ; Note use of anonymous stkvar to enable full re-entrancy while 30842 ; limiting symbol table usage. 30843 ; 30844 ; To do: Is a ROT and movem faster? Probably 30845 30846 001736'01 BOUTR%: entry BOUTR% ; Used in mainline 30847 001736'01 332 00 0 00 000226* ifme. vtermf ; Not a Virtual Terminal? 30848 001737'01 254 00 0 00 001747' 30849 001740'01 104 00 0 00 000051 BOUT% ; Just send the character out 30850 001741'01 320 12 0 00 001743' %jserr (,r) 30851 001742'01 254 00 0 00 001746' 30852 001743'01 265 01 0 00 001647* 30853 001744'01 000000000000# 30854 001745'01 254 00 0 00 001651* 30855 001145'04 102 117 125 124 122 30856 001746'01 254 00 0 00 001730* retskp ; Otherwise, worked!! 30857 001747'01 endif. ; End case regular line 30858 ; Otherwise, need to push it out the door 30859 remark t1,t2 ; t1 has JFN, t2 has character 30860 001747'01 265 16 0 00 005550' saveac ; Save a few things 30861 001750'01 265 16 0 00 001620* anstkv (t4,^d1) ; Allocate a one word anonymous stack variable 30862 001751'01 000000 000001 30863 001752'01 415 04 0 17 777776 30864 ; Now have something for SOUTR% to use 30865 001753'01 402 00 0 04 000000 setzm (t4) ; Clear memory (unnecessary for counted SOUTR%) 30866 001754'01 505 04 0 00 441000 hrli t4,(point 8,) ; Convert to an eight bit pointer 30867 001755'01 200 03 0 00 000004 move t3, t4 ; Make a copy of it 30868 001756'01 136 02 0 00 000003 idpb t2, t3 ; Pop the character at BEGINNING of word 30869 001757'01 200 02 0 00 000004 move t2, t4 ; Load pristine pointer for I/O 30870 001760'01 477 03 0 00 000004 setob t3, t4 ; Doing one character, no stop character 30871 001761'01 104 00 0 00 000532 SOUTR% ; Output, setting PSH 30872 001762'01 320 12 0 00 001764' ifje. r ; Catch error 30873 001763'01 254 00 0 00 001774' 30874 001764'01 200 04 0 00 000001 move t4, t1 ; Put this someplace for debuggers 30875 001765'01 334 00 0 00 000000 %ermsg (,) ; Whine 30876 001766'01 254 00 0 00 001772' 30877 001767'01 265 01 0 00 001743* 30878 001770'01 000000000000# 30879 001771'01 254 00 0 00 001772' 30880 001151'04 102 117 125 124 122 30881 001772'01 260 17 0 00 003242' call netvtx ; Whine some more 30882 001773'01 263 17 0 00 000000 ret ; Return failure 30883 001774'01 endif. ; End case JSYS error 30884 001774'01 254 00 0 00 001746* retskp ; Return success 30885 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20NET MAC 5-May-24 16:57 Alternate network input code (assumes upper fork context) 30886 subttl Alternate network input code (assumes upper fork context) 30887 30888 ; Special cased for NRT's in order to 'push' data on DECnet. Tested 30889 ; on PTY's, also. 30890 ; 30891 ; Characters are sent out with a 'push' by doing a record out, which 30892 ; gets them over to the remote NRT host immediately. Checks to see 30893 ; if we can bum BIN%'s with a SIN%. PTY code uses this, too. 30894 ; 30895 ; SIBE% is fine because we are looking at the local TTY 30896 ; 30897 ; N.B., We ALWAYS read 7-bit ASCII from our control terminal and may or 30898 ; may not put parity on it in for output 30899 30900 001775'01 vtmpsh: entry vtmpsh ; Jumped to by ttinch: 30901 remark q1, ; Have to validate that q1 is not in flight here 30902 30903 001775'01 do. ; Enter loop context. 30904 001775'01 200 01 0 00 001624* move t1, ttyjfn ; Wait for data on TTY 30905 001776'01 104 00 0 00 000050 BIN% ; Wakes up on anything 30906 001777'01 320 12 0 00 002001' %jserr (,tter1) ; What could happen? 30907 002000'01 254 00 0 00 002004' 30908 002001'01 265 01 0 00 001767* 30909 002002'01 000000000000# 30910 002003'01 254 00 0 00 000000* 30911 001156'04 103 141 156 047 164 30912 002004'01 350 00 0 00 000000# aos vbict ; Count a BIN% on a virtual terminal 30913 002005'01 201 04 0 00 000177 movei t4,177 ; 7 bit mask 30914 002006'01 407 02 0 00 000004 andb t2,t4 ; Stomp any foolish parity everywhere 30915 002007'01 316 02 0 00 001625* camn t2, escape ; Is it the escape character? 30916 002010'01 254 00 0 00 001733* jrst doesc ; Yes, go process single-char command. 30917 002011'01 104 00 0 00 000102 SIBE% ; Any more data to read maybe? 30918 002012'01 254 00 0 00 002040' ifskp. ; Nope, then just had this poor character 30919 002013'01 322 02 0 00 002021' ifn. t2 ; If zero, then no error and nothing to do 30920 002014'01 334 00 0 00 000000 %ermsg (,) ; But continue 30921 002015'01 254 00 0 00 002021' 30922 002016'01 265 01 0 00 002001* 30923 002017'01 000000000000# 30924 002020'01 254 00 0 00 002021' 30925 001163'04 125 156 141 142 154 30926 002021'01 endif. ; End case t2 having JSYS error code 30927 remark ; Yet contribute nothing to total 30928 002021'01 200 02 0 00 000004 move t2,t4 ; Load the character for duplex 30929 002022'01 332 00 0 00 000000* skipe duplex ; Have to echo locally? 30930 002023'01 260 17 0 00 000000* call echo ; Yes, do. 30931 002024'01 200 01 0 00 000004 move t1, t4 ;[223] Load in case parity 30932 002025'01 260 17 1 00 000000* call @parity ;[223] Do parity if asked 30933 002026'01 200 02 0 00 000001 move t2, t1 ;[223] Put whatever parity did in the right place 30934 002027'01 200 01 0 00 001652* move t1, netjfn ; Load JFN of our DCN: connection 30935 002030'01 260 17 0 00 001736' call BOUTR% ; Write and push to network 30936 002031'01 334 00 0 00 000000 %ermsg (,tter1) ; If error, go check. 30937 002032'01 254 00 0 00 002036' 30938 002033'01 265 01 0 00 002016* 30939 002034'01 000000000000# 30940 002035'01 254 00 0 00 002003* k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20NET MAC 5-May-24 16:57 Alternate network input code (assumes upper fork context) 30941 001174'04 103 141 156 047 164 30942 002036'01 350 00 0 00 000000# aos vboct ; Count it as a BOUT% 30943 002037'01 254 00 0 00 002064' else. ; Otherwise, maybe save us a few BIN%'s 30944 002040'01 301 02 0 00 002000 cail t2,linlen ; Rolling buffer plus BIN%? 30945 002041'01 201 02 0 00 001777 movei t2, ;Clip it down to fit the character we got 30946 002042'01 200 03 0 00 000002 move t3,t2 ; Load amount to read (positive!!) 30947 002043'01 200 05 0 00 000002 move t5,t2 ; Save a handy copy 30948 002044'01 272 05 0 00 000000# addm t5,vsitc ; Number of characters slurping up 30949 002045'01 313 05 0 00 000000# camle t5,vsimx ; Larger than largest we ever saw? 30950 002046'01 202 05 0 00 000000# movem t5,vsimx ; Yes, remember that 30951 002047'01 350 00 0 00 000000# aos vsict ; Count a SIN% 30952 002050'01 200 02 0 00 005560' move t2,[point 7,nrtbuf] ;Seven bit traffic 30953 002051'01 136 04 0 00 000002 idpb t4,t2 ; Deposit the BIN%'ed character 30954 002052'01 200 04 0 00 002007* move t4,escape ; Stop reading on escape character 30955 002053'01 104 00 0 00 000052 SIN% ; Slurp in a bunch of characters from user 30956 002054'01 320 12 0 00 002056' %jserr (,tter1) ; Handle any errors. 30957 002055'01 254 00 0 00 002061' 30958 002056'01 265 01 0 00 002033* 30959 002057'01 000000000000# 30960 002060'01 254 00 0 00 002035* 30961 001200'04 103 141 156 047 164 30962 002061'01 260 17 0 00 002066' call vtmout ; Output it 30963 002062'01 254 00 0 00 002060* jrst tter1 ; Failed somehow 30964 002063'01 326 05 0 00 002010* jumpn t5,doesc ; Use talisman to handle escape 30965 002064'01 endif. ; Done handling results from SIBE% 30966 002064'01 254 00 0 00 001775' loop. ; Go back and do it some more 30967 002065'01 enddo. ; Exit loop context 30968 ; Should never get here, but... 30969 002065'01 254 00 0 00 000000* jrst ttinch ; Go back and do it again from the top 30970 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20NET MAC 5-May-24 16:57 Network fork data writer 30971 subttl Network fork data writer 30972 30973 ; Write whatever data we have to the network, type it, log it, Etc. 30974 ; 30975 ; On entry: 30976 ; 30977 ; t1/ ttyjfn 30978 ; t2/ Updated byte pointer (buffer will have at least the BIN%'ed character) 30979 ; t3/ Remaining characters in buffer 30980 ; t4/ Escape character that may have stopped us 30981 ; t5/ Original buffer length 30982 ; 30983 ; AC usage: 30984 ; 30985 ; t5/ 0, Complete buffer written 30986 ; -1, Wasn't (hit an escape) 30987 ; 30988 ; q2/ Copy of orginal t3 (remaining characters) 30989 ; q3/ Number of characters we're actually writing 30990 ; q4/ Parity (if doing parity) 30991 30992 002066'01 265 16 0 00 005561' vtmout: saveac ; Save misc. things 30993 002067'01 200 10 0 00 002025* move q4, parity ;[223] Load parity 30994 002070'01 336 00 0 00 000000* skipn parpko ;[223] Not if packets-only 30995 002071'01 306 10 0 00 000000* cain q4, none ;[223] But!! Doing anything at all, really? 30996 002072'01 400 10 0 00 000000 setz q4, ;[223] No, so make it easier to do nothing 30997 30998 002073'01 350 07 0 00 000005 aos q3,t5 ; Store original count + BIN% 30999 002074'01 400 05 0 00 000000 setz t5, ; Let's assume didn't hit the escape 31000 002075'01 332 06 0 00 000003 skipe q2,t3 ; Save and check remaining count 31001 002076'01 474 05 0 00 000000 seto t5, ; Hit an escape... 31002 002077'01 277 03 0 00 000007 subb t3,q3 ; Calculate complete buffer size 31003 002100'01 322 07 0 00 001745* jumpe q3,r ; Don't do a push of an empty buffer 31004 31005 002101'01 210 01 0 00 000007 movn t1,q3 ; Pick up POSITIVE count of characters 31006 002102'01 272 01 0 00 000000# addm t1,vsotc ; Add in total 31007 002103'01 313 01 0 00 000000# camle t1,vsomx ; Greater than max? 31008 002104'01 202 01 0 00 000000# movem t1,vsomx ; Update maximum 31009 002105'01 350 00 0 00 000000# aos vsoct ; Count a SOUTR% 31010 31011 002106'01 200 02 0 00 005573' move t2,[point 7,nrtbuf] ;Seven bit traffic 31012 002107'01 322 10 0 00 002112' ifn. q4 ;[223] Parity? 31013 002110'01 200 01 0 00 005574' move t1,[point 8,parbuf] ;[223] Eight bit traffic 31014 002111'01 260 17 0 00 000000* call genpar ;[223] Generate a new string with parity 31015 002112'01 endif. ;[223] End case generating parity 31016 31017 002112'01 200 01 0 00 002027* move t1, netjfn ; Load JFN of our DCN: connection 31018 002113'01 104 00 0 00 000532 SOUTR% ; Write and 'push' 31019 002114'01 320 12 0 00 002116' %jserr (,r) ; If error, return +1 31020 002115'01 254 00 0 00 002121' 31021 002116'01 265 01 0 00 002056* 31022 002117'01 000000000000# 31023 002120'01 254 00 0 00 002100* 31024 001205'04 103 141 156 047 164 31025 002121'01 336 00 0 00 002022* skipn duplex ; Half duplex? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29-1 K20NET MAC 5-May-24 16:57 Network fork data writer 31026 002122'01 263 17 0 00 000000 ret ; No, nothing to echo 31027 ; Ugh... Let's get to it 31028 002123'01 265 16 0 00 005575' saveac ; Wants another register 31029 002124'01 200 06 0 00 005603' move q2,[point 7,nrtbuf] ;Load a pointer to the buffer 31030 002125'01 210 10 0 00 000007 movn q4,q3 ; Do a positive counter (unnecessary) 31031 31032 002126'01 do. ; Enter loop lexical context 31033 002126'01 134 02 0 00 000006 ildb t2,q2 ; Pick up a character from the buffer 31034 002127'01 260 17 0 00 002023* call echo ; Type it 31035 002130'01 367 10 0 00 002126' sojg q4,top. ; Do all of them 31036 002131'01 enddo. ; Exit loop lexical context 31037 31038 002131'01 263 17 0 00 000000 ret ; Done, finally 31039 31040 ; To do, this is an awful lot of instructions just to echo. 31041 ; Could temporarily restore the COC's and PSOUT%. Also could 31042 ; do a MOVST from from an eight byte buffer and overwrite it 31043 ; with a seven bit buffer with the control characters? 31044 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20NET MAC 5-May-24 16:57 Code for receive fork. 31045 subttl Code for receive fork. 31046 31047 ; Rewritten for efficiency to use less JSYI and avoid stack clash 31048 ; 31049 ; Runs forever, asynchronously, till killed. 31050 ; 31051 ; The algorithm is to wait for a character and then slurp up anything 31052 ; that might be in the monitor's input buffer for the line (or NRT). 31053 ; This can substantially cut down on BIN%/BOUT% overhead while still 31054 ; maintaining performance because the fork is effectively always waiting 31055 ; for remote output. 31056 ; 31057 ; Partially adapted from a much modified SETNOD. 31058 ; 31059 ; Be aware of a subtle Tops-20 bug! Once created, the terminal fork 31060 ; should NEVER be killed, but rather frozen. Previous Kermit behavior 31061 ; was to always kill the fork on a close, keeping the network JFN open, 31062 ; recreating the fork on every connect. While this was inefficient 31063 ; (fork creation being expensive), it was fine for a pseudo-terminal. 31064 ; 31065 ; However, killing the fork while it was waiting for NRT data caused 31066 ; Tops-20 DECnet to lose track of the buffers, the result being that 31067 ; whatever was last in the buffer was read again when the fork was 31068 ; recreated. 31069 ; 31070 ; Trying to force the monitor buffers to be correct with SINR% only 31071 ; partially worked. Output was not repeated, but a timing anomaly was 31072 ; then exposed that the result of a SIBE% was less than what was 31073 ; available, the consequence being that the SINR% would fail with 31074 ; a IOX10 error (Record is longer than user requested), the extra 31075 ; data then being dumped (into oblivion). 31076 ; 31077 ; Freezing and resuming the terminal fork prevents this situation and 31078 ; is more efficient, anyway. Therefore, make certain that the FFORK% 31079 ; at $CONX2+5 is NEVER changed back to a KFORK%! 31080 ; 31081 ; However, this does not fix the problem of output getting repeated 31082 ; into the main fork once the subfork is frozen. In particular, 31083 ; suppose the user does something very reasonable and connects to a 31084 ; remote system to sign on. Escaping back will now work fine, but if 31085 ; before this happens, the user runs a Kermit and puts it into server 31086 ; mode, the main fork will now see all the junk that the recreated 31087 ; inferior used to see plus a large pile of NUL's thrown in to boot!! 31088 ; 31089 ; Therefore, whenever we escape back, a clrbuf is done for an NRT. 31090 31091 002000 linlen==^d1024 ; Maximum characters we'll swallow at once 31092 31093 002132'01 netin: entry netin ; Jumped to by main character read loop 31094 remark q1,q2,q3,q4,p1,p2,p3 ;No need to save these in seperate fork 31095 002132'01 200 17 0 00 005604' move p,[iowd pdlsiz,frkpdl] ; Can't share stacks... 31096 002133'01 201 01 0 00 003343' movei t1, netinh ; Load Address of a halt routine 31097 002134'01 261 17 0 00 000001 push p, t1 ; Just in case we want to return over the top 31098 31099 002135'01 201 05 0 00 000000# movei q1, frkbuf ;[223] Always using the same buffer k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30-1 K20NET MAC 5-May-24 16:57 Code for receive fork. 31100 002136'01 200 01 0 00 002067* move t1, parity ;[223] Load parity setting 31101 002137'01 306 01 0 00 002071* cain t1, none ;[223] Are we doing anything? 31102 002140'01 254 00 0 00 002150' ifskp. ;[223] Some kind of parity being done, so check further 31103 002141'01 332 00 0 00 002070* skipe parpko ;[223] Only doing parity on packets? 31104 002142'01 254 00 0 00 002150' anskp. ;[223] Yes, so better leave this alone 31105 002143'01 336 00 0 00 000000* skipn parrck ;[223] Checking parity on receive and not just sending? 31106 002144'01 254 00 0 00 002150' anskp. ;[223] No, so don't pay any attention 31107 002145'01 200 13 0 00 000001 move p3, t1 ;[223] Set the flag with the parity value 31108 002146'01 505 05 0 00 441000 hrli q1,<(point 8,0)> ;[223] Do it all 7 bit ASCII with a parity bit 31109 002147'01 254 00 0 00 002152' else. ;[223] Otherwise, not doing anything special 31110 002150'01 400 13 0 00 000000 setz p3, ;[223] So clear the flag 31111 002151'01 505 05 0 00 440700 hrli q1,<(point 7,0)> ;[223] And do it all straight 7 bit ASCII 31112 002152'01 endif. ;[223] End case parity determination 31113 31114 002152'01 do. ; Enter loop context 31115 002152'01 474 06 0 00 000000 seto q2, ; Assume we get at least one chracter 31116 002153'01 550 01 0 00 002112* hrrz t1, netjfn ; Always prefer a network JFN 31117 002154'01 326 01 0 00 002156' ife. t1 ; Unless there isn't one 31118 002155'01 550 01 0 00 001775* hrrz t1, ttyjfn ; Use terminal if nothing else 31119 002156'01 endif. ; End case no network JFN 31120 002156'01 104 00 0 00 000050 BIN% ; Wait for input 31121 002157'01 320 12 0 00 002161' %jserr (,neterr) ; Handle any errors. 31122 002160'01 254 00 0 00 002164' 31123 002161'01 265 01 0 00 002116* 31124 002162'01 000000000000# 31125 002163'01 254 00 0 00 002346' 31126 001211'04 103 141 156 047 164 31127 002164'01 350 00 0 00 000000# aos nbict ; Network BIN% count 31128 002165'01 200 07 0 00 000002 move q3, t2 ; Tuck that character safely away for now 31129 002166'01 200 04 0 00 000001 move t4, t1 ; Get the PTY JFN out of the way 31130 002167'01 260 17 0 00 002622' call clrest ; Find out what awaits us 31131 002170'01 254 00 0 00 002173' ifskp. ; Worked!! 31132 002171'01 200 11 0 00 000001 move p1, t1 ; Save the count (which might be zero) 31133 002172'01 254 00 0 00 002200' else. ; Failed?? 31134 002173'01 334 00 0 00 000000 %ermsg (,neterr) 31135 002174'01 254 00 0 00 002200' 31136 002175'01 265 01 0 00 002161* 31137 002176'01 000000000000# 31138 002177'01 254 00 0 00 002346' 31139 001216'04 125 156 141 142 154 31140 002200'01 endif. 31141 002200'01 326 11 0 00 002212' ife. p1 ; Nothing but one dinky character? 31142 002201'01 322 13 0 00 002206' ifn. p3 ;[223] Are we doing parity? 31143 002202'01 200 01 0 00 000007 move t1, q3 ;[223] Yes, so load the character 31144 002203'01 260 17 0 13 000000 call (p3) ;[223] Do some kind of parity 31145 002204'01 312 01 0 00 000007 came t1, q3 ;[223] Does it check? 31146 002205'01 260 17 0 00 002337' call parier ;[223] No, go complain 31147 002206'01 endif. ;[223] End case parity checking 31148 002206'01 200 02 0 00 000005 move t2, q1 ; Load the pointer 31149 002207'01 136 07 0 00 000002 idpb q3, t2 ; Drop the character in 31150 002210'01 260 17 0 00 002245' call ntecho ; Finally echo it 31151 002211'01 254 00 0 00 002244' else. ; Otherwise, save us many BIN%'s!! 31152 002212'01 do. ; Enter read/write loop 31153 002212'01 200 02 0 00 000011 move t2, p1 ; Load the total from clrest 31154 002213'01 301 02 0 00 002000 cail t2, linlen ; Rolling buffer plus BIN%? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30-2 K20NET MAC 5-May-24 16:57 Code for receive fork. 31155 002214'01 201 02 0 00 001777 movei t2, ;Clip it down to fit the character we got 31156 002215'01 313 02 0 00 000000# camle t2, nsimx ; Smaller than biggest? 31157 002216'01 202 02 0 00 000000# movem t2, nsimx ; Nope, update total 31158 002217'01 272 02 0 00 000000# addm t2, nsitc ; Network SIN% total characters 31159 002220'01 210 03 0 00 000002 movn t3, t2 ; Calculate amount to read 31160 002221'01 274 11 0 00 000002 sub p1, t2 ; Subtract from total known 31161 002222'01 274 06 0 00 000002 sub q2, t2 ; Account for previous byte in write total 31162 002223'01 200 02 0 00 000005 move t2, q1 ; Load the pointer 31163 002224'01 136 07 0 00 000002 idpb q3, t2 ; Drop the character in 31164 002225'01 325 03 0 00 002236' Ifl. t3 ; BUT!! Are we actualy going to do anything? 31165 002226'01 350 00 0 00 000000# aos nsici ; Network SIN%'s Issued 31166 002227'01 200 01 0 00 000004 move t1, t4 ; Load the network JFN 31167 002230'01 104 00 0 00 000052 SIN% ; Get that data! 31168 002231'01 320 12 0 00 002233' %jserr (,neterr) ;Handle any errors 31169 002232'01 254 00 0 00 002236' 31170 002233'01 265 01 0 00 002175* 31171 002234'01 000000000000# 31172 002235'01 254 00 0 00 002346' 31173 001226'04 103 141 156 047 164 31174 002236'01 endif. ; End sanity check 31175 002236'01 322 13 0 00 002242' ifn. p3 ;[223] Doing any kind of parity? 31176 002237'01 120 02 0 00 000005 dmove t2, q1 ;[223] Load what will be passed to ntecho 31177 002240'01 260 17 0 00 000000* call chkpar ;[223] Check the parity 31178 002241'01 260 17 0 00 002337' call parier ;[223] Bad, go complain 31179 002242'01 endif. ;[223] End case parity checking 31180 002242'01 260 17 0 00 002245' call ntecho ; Go echo the output 31181 002243'01 327 11 0 00 002212' jumpg p1, top. ; Still more data pending, read it 31182 002244'01 enddo. ; End inner input/output loop 31183 002244'01 endif. ; End decision to read more than one character 31184 002244'01 254 00 0 00 002152' loop. ; Otherwise, go to the top and wait for more 31185 002245'01 enddo. ; End outer loop 31186 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20NET MAC 5-May-24 16:57 echo what we read from the network 31187 subttl echo what we read from the network 31188 31189 ; Called from various places in netin lower fork code to display data 31190 ; 31191 ; Expects: 31192 ; 31193 ; ttyjfn/ Valid JFN or terminal designator 31194 ; q1/ Pointer to beginning of data read 31195 ; q2/ Negative count of data (I.E., counted SOUT% ready 31196 ; p3/ Parity scrubber flag 31197 ; 31198 ; +1, always 31199 ; 31200 ; Trashes t1, t2 and t3. 31201 ; 31202 ; If doing parity, we have a buffer with eight bit bytes in it which 31203 ; must have the parity bit stripped off. If this is not done, then 31204 ; Tops-20 is going to write in 'image' mode, which can produce funny 31205 ; output on terminal emulators. 31206 ; 31207 ; The routine simply picks up an eight bit byte and replaces it with a 31208 ; seven bit byte, overwriting the storage in place. Since the 7 bit 31209 ; ASCII stream will always trail the 8 bit stream, we will never run 31210 ; out of space nor clobber anything. 31211 31212 002245'01 322 13 0 00 002301' ntecho: jumpe p3,ntech2 ;[223] Any parity to strip off? 31213 002246'01 322 06 0 00 002120* jumpe q2, r ;[223] If nothing to do, we're done! 31214 002247'01 554 01 0 00 000005 hlrz t1, q1 ;[223] A quick sanity check of the pointer width 31215 002250'01 306 01 0 00 440700 cain t1, <(point 7,0)> ;[223] Is this a waste of time, anyway? 31216 002251'01 254 00 0 00 002301' jrst ntech2 ;[223] It is, so skip all of this 31217 31218 002252'01 315 06 0 00 005605' caxge q2,-^d4 ;[223] Characters at which movslj wins (we think) 31219 002253'01 254 00 0 00 002265' jrst ntech1 ;[223] Go win big with extended instruction! 31220 31221 002254'01 265 16 0 00 005606' ntech0: saveac ;[223] Doesn't need quite so many registers... 31222 002255'01 200 02 0 00 000005 move t2, q1 ;[223] Load 8 bit source 31223 002256'01 505 05 0 00 440700 hrli q1, <(point 7,0)> ;[223] Stomp in the right pointer width 31224 002257'01 200 03 0 00 000005 move t3, q1 ;[223] Load 7 bit destination 31225 002260'01 210 04 0 00 000006 movn t4, q2 ;[223] We get less confused by positive numbers ... 31226 31227 002261'01 do. ;[223] Enter loop context 31228 002261'01 134 01 0 00 000002 ildb t1, t2 ;[223] Pick up an 8 bit byte 31229 002262'01 136 01 0 00 000003 idpb t1, t3 ;[223] And deposit as 7 bit, stripping parity 31230 002263'01 367 04 0 00 002261' sojg t4, top. ;[223] Do the rest of them 31231 002264'01 enddo. ;[223] End loop lexical context 31232 002264'01 254 00 0 00 002301' jrst ntech2 ;[223] And go type something 31233 31234 002265'01 265 16 0 00 005616' ntech1: saveac ;[223] Convert from 8 to 7 bit ASCII 31235 002266'01 120 07 0 00 000005 dmove q3, q1 ;[223] Save original arguments 31236 002267'01 210 01 0 00 000006 movn t1, q2 ;[223] movslj wants positive counts 31237 002270'01 200 04 0 00 000001 move t4, t1 ;[223] Smaller width can never overflow 31238 002271'01 200 02 0 00 000005 move t2, q1 ;[223] Section local eight bit pointer 31239 002272'01 550 05 0 00 000002 hrrz q1, t2 ;[223] Same starting address 31240 002273'01 505 05 0 00 440700 hrli q1, <(point 7,0)> ;[223] Stomp in the right pointer 31241 002274'01 500 07 0 00 000005 hll q3, q1 ;[223] And remember that new width k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-1 K20NET MAC 5-May-24 16:57 echo what we read from the network 31242 002275'01 403 03 0 00 000006 setzb t3, q2 ;[223] Section local pointers 31243 002276'01 123 01 0 00 000000* extend t1, movchr ;[223] Repack the string in place (which is safe) 31244 002277'01 600 00 0 00 000000 nop ;[223] Ignore any odd non-skip 31245 002300'01 120 05 0 00 000007 dmove q1, q3 ;[223] Restore updated calling arguments 31246 31247 002301'01 200 01 0 00 002155* ntech2: move t1, ttyjfn ;[223] ; Load local terminal 31248 002302'01 120 02 0 00 000005 dmove t2,q1 ; Load pointer and length 31249 002303'01 104 00 0 00 000053 SOUT% ; Display incoming characters on screen. 31250 002304'01 320 12 0 00 002306' %jserr (,) 31251 002305'01 254 00 0 00 002311' 31252 002306'01 265 01 0 00 002233* 31253 002307'01 000000000000# 31254 002310'01 254 00 0 00 002311' 31255 001233'04 103 141 156 047 164 31256 002311'01 337 01 0 00 001533* skipg t1, sesjfn ; Logging? 31257 002312'01 254 00 0 00 002324' ifskp. ;[195] Possibly doing it 31258 002313'01 336 00 0 00 001562* skipn sesflg ;[195] Unless not active 31259 002314'01 254 00 0 00 002324' anskp. ;[195] In which case, skip it 31260 002315'01 120 02 0 00 000005 dmove t2,q1 ; Load buffer pointer and length 31261 002316'01 104 00 0 00 000053 SOUT% ; Write it to the log 31262 002317'01 320 12 0 00 002321' %jserr (,netlgx) ;[195] 31263 002320'01 254 00 0 00 002324' 31264 002321'01 265 01 0 00 002306* 31265 002322'01 000000000000# 31266 002323'01 254 00 0 00 000000* 31267 001242'04 103 141 156 047 164 31268 002324'01 endif. ;[195] End case logging 31269 002324'01 263 17 0 00 000000 ret ; Done 31270 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20NET MAC 5-May-24 16:57 Table to map DECnet close reason code to text 31271 subttl Table to map DECnet close reason code to text 31272 31273 ;[238] Begin table insertion 31274 31275 ; Handle all the .psect stuff by hand. Have to be careful because we 31276 ; are going to the outermost .psect, which will have the wrong location 31277 ; counter. Also, getting this wrong will cause LINK to fail with a 31278 ; most informative message of "Illegal memory WRITE at SY.FP5+1", which 31279 ; is almost--but not quite--completely and utterly useless. 31280 31281 .endps code ; Get out of code .psect 31282 31283 000053 .dcxmx==.dcx43 ; Maximum code 31284 31285 .psect const ; Put all the constants in the const .psect 31286 000130'03 dsctab: remark ; Just create a label in .psect 31287 .endps const ; End of const .psect 31288 31289 define dsctxt (n,t,%et) < ;;Macro to put pointers to messages in the right place 31290 .psect const ;;Assume in const .psect 31291 reloc dsctab+n ;;Get to correct location in table 31292 .px7!%et ;;Emit pointer to text in extended text section 31293 .endps const ;;Get out of const .psect 31294 .psect etext ;;Get into extended text .psect 31295 %et: asciz \'t\ ;;Emit the actual text of the disconnect reason 31296 .endps etext ;;Close out extended text .psect 31297 cleans(<%et>) ;;Clean up generated symbol on second pass 31298 >;;dsctxt 31299 31300 000130'03 000000000000# dsctxt(.dcx0,) 31301 001247'04 122 145 152 145 143 31302 000131'03 000000000000# dsctxt(.dcx1,) 31303 001256'04 122 145 163 157 165 31304 000132'03 000000000000# dsctxt(.dcx2,) 31305 001264'04 104 145 163 164 151 31306 000133'03 000000000000# dsctxt(.dcx3,) 31307 001273'04 122 145 155 157 164 31308 000134'03 000000000000# dsctxt(.dcx4,) 31309 001301'04 104 145 163 164 151 31310 000135'03 000000000000# dsctxt(.dcx5,) 31311 001310'04 111 156 166 141 154 31312 000136'03 000000000000# dsctxt(.dcx6,) 31313 001316'04 117 142 152 145 143 31314 000137'03 000000000000# dsctxt(.dcx7,) 31315 001321'04 125 156 163 160 145 31316 000140'03 000000000000# dsctxt(.dcx8,) 31317 001325'04 124 150 151 162 144 31318 000141'03 000000000000# dsctxt(.dcx9,) 31319 001331'04 101 163 171 156 143 31320 000142'03 000000000000# dsctxt(.dcx10,) 31321 001336'04 111 156 166 141 154 31322 000143'03 000000000000# dsctxt(.dcx11,) 31323 001342'04 114 157 143 141 154 31324 000155'03 000000000000# dsctxt(.dcx21,) 31325 001347'04 103 157 156 156 145 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-1 K20NET MAC 5-May-24 16:57 Table to map DECnet close reason code to text 31326 000156'03 000000000000# dsctxt(.dcx22,) 31327 001361'04 103 157 156 156 145 31328 000157'03 000000000000# dsctxt(.dcx23,) 31329 001373'04 103 157 156 156 145 31330 000160'03 000000000000# dsctxt(.dcx24,) 31331 001406'04 106 154 157 167 040 31332 000170'03 000000000000# dsctxt(.dcx32,) 31333 001413'04 124 157 157 040 155 31334 000171'03 000000000000# dsctxt(.dcx33,) 31335 001421'04 124 157 157 040 155 31336 000172'03 000000000000# dsctxt(.dcx34,) 31337 001432'04 101 143 143 145 163 31338 000173'03 000000000000# dsctxt(.dcx35,) 31339 001437'04 114 157 147 151 143 31340 000174'03 000000000000# dsctxt(.dcx36,) 31341 001446'04 111 156 166 141 154 31342 000175'03 000000000000# dsctxt(.dcx37,) 31343 001452'04 123 145 147 155 145 31344 000176'03 000000000000# dsctxt(.dcx38,) 31345 001457'04 116 157 040 162 145 31346 000177'03 000000000000# dsctxt(.dcx39,) 31347 001467'04 116 157 040 160 141 31348 000200'03 000000000000# dsctxt(.dcx40,) 31349 001475'04 114 151 156 153 040 31350 000201'03 000000000000# dsctxt(.dcx41,) 31351 001503'04 104 145 163 164 151 31352 000202'03 000000000000# dsctxt(.dcx42,) 31353 001512'04 103 157 156 146 151 31354 000203'03 000000000000# dsctxt(.dcx43,) 31355 001522'04 111 155 141 147 145 31356 31357 .psect const ; Put all the constants in the const .psect 31358 000204'03 reloc dsctab+.dcxmx+1 ; Back to end of dsctab 31359 .endps const ; End of const .psect 31360 31361 ;[238] End table insertion 31362 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20NET MAC 5-May-24 16:57 convert DECnet close reason code to text 31363 subttl convert DECnet close reason code to text 31364 31365 remark Given a disconnect code, return a pointer to descriptive text 31366 31367 ;[238] Begin code insertion 31368 31369 ; Call: 31370 ; 31371 ; T3/ Contains result of .MORLS 31372 ; 31373 ; Return: 31374 ; 31375 ; T1/ OWGP to informative text 31376 31377 .psect etext ; Get to extended text .psect 31378 001530'04 125 156 153 156 157 unkdec: asciz "Unknown disconnect code" 31379 .endps etext ; Close out extended text .psect 31380 31381 .psect code ;;Get back into the code .psect 31382 31383 002325'01 550 02 0 00 000003 gdscpt: hrrz t2, t3 ; Pick up disconnect code 31384 002326'01 303 02 0 00 000053 caile t2, .dcxmx ; Out of range? 31385 002327'01 254 00 0 00 002334' ifskp. ; No, it's fine 31386 002330'01 336 01 0 02 000000# skipn t1, dsctab(t2) ; Load OWGP to informative text 31387 002331'01 254 00 0 00 002334' anskp. ; Unless there isn't any 31388 002332'01 263 17 0 00 000000 ret ; Otherwise, return it 31389 002333'01 254 00 0 00 002336' else. ; Otherwise, out of range or no text 31390 002334'01 200 01 0 00 005632' move t1,[.px7!unkdec] ; Say as much 31391 002335'01 263 17 0 00 000000 ret ; Return at least something 31392 002336'01 endif. ; End case range and pointer check 31393 31394 31395 ;[238] End code insertion 31396 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20NET MAC 5-May-24 16:57 Parity Error Handler 31397 subttl Parity Error Handler 31398 31399 002336'01 007 000 00000000 honk: byte (7) .chbel, .chnul ;[223] Just honk the terminal 31400 31401 002337'01 261 17 0 00 000001 parier: push p, t1 ;[223] Save the accumulator 31402 002340'01 561 01 0 00 002336' hrroi t1, honk ;[223] Point to the alert 31403 002341'01 104 00 0 00 000313 ESOUT% ;[223] Beep the terminal 31404 002342'01 320 12 0 00 002343' erjmpr .+1 ;[223] Catch and ignore error 31405 002343'01 350 00 0 00 000000* aos ttipar ;[223] Count a parity error 31406 002344'01 262 17 0 00 000001 pop p, t1 ;[223] Restore the accumulator 31407 002345'01 263 17 0 00 000000 ret ;[223] Done 31408 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20NET MAC 5-May-24 16:57 Error handler for network TTY. 31409 subttl Error handler for network TTY. 31410 31411 002346'01 336 00 0 00 001736* neterr: ifmn. vtermf ;[186] Virtual terminal? 31412 002347'01 254 00 0 00 002354' 31413 002350'01 200 01 0 00 002153* move t1, netjfn ;[186] Load network JFN 31414 002351'01 260 17 0 00 003771' call chklin ;[186] Get network status 31415 002352'01 336 00 0 00 001654* skipn carier ;[186] dropped carrier? 31416 002353'01 260 17 0 00 003242' call netvtx ;[186] Yep, we're down 31417 002354'01 endif. ;[186] End special case for non-physical line 31418 31419 002354'01 336 00 0 00 000000* skipn mdmlin ; Modem controlled line? 31420 002355'01 254 00 0 00 002132' jrst netin ; No, go back. 31421 002356'01 260 17 0 00 003771' call chklin ; Go check for carrier. 31422 002357'01 336 00 0 00 002352* skipn carier ; Still have it? 31423 002360'01 254 00 0 00 000000* jrst $connx ;[186] No, close the connection. 31424 002361'01 254 00 0 00 002132' jrst netin ; Yes, keep plugging away till they disconnect. 31425 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20NET MAC 5-May-24 16:57 Handles signal of failure of network input fork 31426 subttl Handles signal of failure of network input fork 31427 31428 002362'01 frtrap: entry frtrap 31429 extern pc3 ; Level we interrupt on 31430 31431 002362'01 261 17 0 00 000001 push p, t1 ; Save any AC we touch 31432 002363'01 261 17 0 00 000002 push p, t2 31433 002364'01 261 17 0 00 000003 push p, t3 31434 31435 002365'01 336 01 0 00 001334* skipn t1,ttfork ; Load the handle of network input fork 31436 002366'01 254 00 0 00 002372' ifskp. ; If there is one.... 31437 002367'01 104 00 0 00 000153 KFORK% ; Ditch it 31438 002370'01 320 12 0 00 002371' erjmpr .+1 ; Ignore the error 31439 002371'01 402 00 0 00 002365* setzm ttfork ; Forget about the handle; it's gone 31440 002372'01 endif. ; End case fork handler 31441 31442 002372'01 260 17 0 00 003044' call clsnet ; Whack any kind of network connection 31443 31444 002373'01 205 01 0 00 010000 movx t1,pc%usr ; Get into user mode. 31445 002374'01 436 01 0 00 000536* iorm t1,pc3 ; Resume at previous PC 31446 31447 002375'01 262 17 0 00 000003 pop p, t3 ; Restore AC's and beat it 31448 002376'01 262 17 0 00 000002 pop p, t2 31449 002377'01 262 17 0 00 000001 pop p, t1 31450 002400'01 104 00 0 00 000136 DEBRK% 31451 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20NET MAC 5-May-24 16:57 Sends a DECnet interrupt message when BREAK is requested 31452 subttl Sends a DECnet interrupt message when BREAK is requested 31453 31454 002401'01 110 145 171 041 040 nrtmsg: bldmsg () 31455 31456 002404'01 nrtbrk: entry nrtbrk ; Experimental; not really used 31457 002404'01 263 17 0 00 000000 ret ; This hangs a Tops-10 connection, don't do it 31458 31459 002405'01 265 16 0 00 005463' saveac ; Save just because we don't know 31460 002406'01 200 01 0 00 002350* move t1,netjfn ; Load network JFN 31461 002407'01 201 02 0 00 000036 movei t2,.mosim ; Function to send DECnet interrupt message 31462 dmove t3,[point 7,nrtmsg ;Point to interrupt message 31463 002410'01 120 03 0 00 005633' nrtlen ] ; Length of same 31464 002411'01 104 00 0 00 000077 MTOPR% ; Bombs away! 31465 002412'01 320 12 0 00 002414' %jserr(,r) 31466 002413'01 254 00 0 00 002417' 31467 002414'01 265 01 0 00 002321* 31468 002415'01 000000000000# 31469 002416'01 254 00 0 00 002246* 31470 001535'04 125 156 141 142 154 31471 002417'01 263 17 0 00 000000 ret 31472 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20NET MAC 5-May-24 16:57 clrbuf Clear Line Input Buffer 31473 subttl clrbuf Clear Line Input Buffer 31474 31475 ;[211] All rewritten and enhanced for non-physical terminals 31476 31477 ; Call: 31478 ; 31479 ; Nothing: appropriate thing is done based on connection context. 31480 ; 31481 ; Returns: 31482 ; 31483 ; +1/ Some problem 31484 ; +2/ Success 31485 ; t1/ Total characters chewed 31486 ; 31487 ; N.B., While SIBE% and SOBE% will work on any JFN, CFIBF% and 31488 ; CFOBF%'s will *ONLY* work with terminal lines. For PTY's 31489 ; and NRT's, we have to read the input (and toss it). 31490 31491 000310 flushc==^d200 ; Maximum characters to swallow 31492 31493 002420'01 clrbuf: entry clrbuf ; Inform link of our location 31494 002420'01 260 17 0 00 000000* call inpclr ;[209] Chuck any waiting input 31495 31496 002421'01 332 00 0 00 000000# skipe ptyflg ; Pseudo-terminal? 31497 002422'01 254 00 0 00 002524' callret ptyfls ; Yes, that has to be flushed from both sides 31498 002423'01 332 00 0 00 000000# skipe nrtflg ; DECnet NRT? 31499 002424'01 254 00 0 00 002454' callret dcnfls ; Yes, CFIBF% won't work 31500 ; Otherwise, a physical line on an FE!!!! 31501 002425'01 550 01 0 00 002406* hrrz t1, netjfn ; Although a real line, prefer network JFN 31502 002426'01 326 01 0 00 002430' ife. t1 ; Unless there isn't one 31503 002427'01 550 01 0 00 002301* hrrz t1, ttyjfn ; Use terminal if nothing else 31504 002430'01 endif. ; End case no network JFN 31505 002430'01 403 02 0 00 000003 setzb t2, t3 ; No current read, no accumulated read 31506 31507 002431'01 do. ; Enter loop context 31508 002431'01 104 00 0 00 000102 SIBE% ; Skip if input buffer empty 31509 002432'01 254 00 0 00 002442' ifskp. ; Empty? 31510 002433'01 322 02 0 00 002452' jumpe t2, endlp. ; If zero, then no error; exit loop 31511 002434'01 334 00 0 00 000000 %ermsg (,r) ;[211] 31512 002435'01 254 00 0 00 002441' 31513 002436'01 265 01 0 00 002414* 31514 002437'01 000000000000# 31515 002440'01 254 00 0 00 002416* 31516 001544'04 125 156 141 142 154 31517 002441'01 254 00 0 00 002452' else. ; Otherwise, have some junk in there 31518 002442'01 270 03 0 00 000002 add t3, t2 ; Add to total cleared 31519 002443'01 104 00 0 00 000100 CFIBF% ; Chuck the input 31520 002444'01 320 12 0 00 002446' %jserr (,r) ; Boo... 31521 002445'01 254 00 0 00 002451' 31522 002446'01 265 01 0 00 002436* 31523 002447'01 000000000000# 31524 002450'01 254 00 0 00 002440* 31525 001553'04 125 156 141 142 154 31526 002451'01 254 00 0 00 002431' loop. ; See if anything else shows up 31527 002452'01 endif. ; End of SIBE% action logic k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38-1 K20NET MAC 5-May-24 16:57 clrbuf Clear Line Input Buffer 31528 002452'01 enddo. ; End flush loop 31529 31530 002452'01 200 01 0 00 000003 move t1, t3 ; Load grand total flushed 31531 002453'01 254 00 0 00 001774* retskp ; Return success!!! 31532 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20NET MAC 5-May-24 16:57 DECnet flush 31533 subttl DECnet flush 31534 31535 ; Somewhat similar logic to physical terminal, except that 31536 ; CFIBF% won't work, so we have to read (and toss) the data. 31537 ; 31538 ; N.B., Can't use SINR% because it will discard an unknown number 31539 ; of characters. Sigh... 31540 31541 002454'01 265 16 0 00 005635' dcnfls: saveac 31542 002455'01 550 01 0 00 002425* hrrz t1, netjfn ; Pick up the network JFN 31543 002456'01 326 01 0 00 002464' ife. t1 ; Have to have this for an NRT! 31544 002457'01 334 01 0 00 000000# ermsg% (,r) 31545 002460'01 254 00 0 00 002464' 31546 002461'01 202 01 0 00 001423* 31547 002462'01 104 00 0 00 000313 31548 002463'01 254 00 0 00 002450* 31549 000204'03 000000000000# 31550 001561'04 113 105 122 115 111 31551 31552 002464'01 endif. ; End of that particular sanity check 31553 002464'01 200 05 0 00 000001 move q1, t1 ; Save whatever JFN we're using (q1 unused) 31554 002465'01 400 07 0 00 000000 setz q3, ; No initial grand tally 31555 31556 002466'01 do. ; Enter loop context 31557 002466'01 104 00 0 00 000102 SIBE% ; Skip if input buffer empty 31558 002467'01 254 00 0 00 002477' ifskp. ; Empty? 31559 002470'01 322 02 0 00 002521' jumpe t2, endlp. ; If zero, then no error; exit loop 31560 002471'01 334 00 0 00 000000 %ermsg (,r) 31561 002472'01 254 00 0 00 002476' 31562 002473'01 265 01 0 00 002446* 31563 002474'01 000000000000# 31564 002475'01 254 00 0 00 002463* 31565 001575'04 125 156 141 142 154 31566 002476'01 254 00 0 00 002520' else. ; Otherwise, have some junk in there 31567 002477'01 200 06 0 00 000002 move q2, t2 ; Load for inner loop 31568 002500'01 do. ; Enter inner loop context 31569 002500'01 336 04 0 00 000006 skipn t4, q2 ; Load remaining characters 31570 002501'01 254 00 0 00 002520' exit. ; If no more, then we're done 31571 002502'01 303 04 0 00 000310 caile t4, flushc ; More than maximum we can swallow at once? 31572 002503'01 201 04 0 00 000310 movx t4, flushc ; Yep, well just take a mouthful 31573 remark t1, q1 ; JFN is still in there 31574 002504'01 200 02 0 00 005651' move t2, [point 8,flushb] ; Load pointer to the 'flush' buffer 31575 002505'01 210 03 0 00 000004 movn t3, t4 ; Reading exactly that much 31576 002506'01 104 00 0 00 000052 SIN% ; Swallow whatever junk is in there 31577 002507'01 320 12 0 00 002511' %jserr (,r) 31578 002510'01 254 00 0 00 002514' 31579 002511'01 265 01 0 00 002473* 31580 002512'01 000000000000# 31581 002513'01 254 00 0 00 002475* 31582 001606'04 125 156 141 142 154 31583 002514'01 270 04 0 00 000003 add t4, t3 ; Keep track of what we didn't read 31584 002515'01 274 06 0 00 000004 sub q2, t4 ; Subtract from remaining 31585 002516'01 270 07 0 00 000004 add q3, t4 ; And add to total done 31586 002517'01 327 06 0 00 002500' jumpg q2, top. ; Loop if anything left to do 31587 002520'01 enddo. ; End context inner loop k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20NET MAC 5-May-24 16:57 DECnet flush 31588 002520'01 endif. ; End SIBE% results handling 31589 002520'01 254 00 0 00 002466' loop. ; See if anything else there 31590 002521'01 enddo. ; End loop lexical context 31591 31592 002521'01 272 07 0 00 000000# addm q3, vchrcn ; Update grand total characters ever flushed 31593 002522'01 200 01 0 00 000007 move t1, q3 ; Return total characters whacked this time 31594 002523'01 254 00 0 00 002453* retskp ; Return success 31595 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20NET MAC 5-May-24 16:57 DECnet flush 31596 remark Special actions to flush a PTY 31597 31598 ; Note that while a CFIBF% will not work on the PTY JFN, a CFOBF% 31599 ; *WILL* work on the terminal side for which we have the device 31600 ; designator. Since we assigned the PTY which maps to the TTY, we 31601 ; retain certain rights to the terminal, one of which is that a CFOBF% 31602 ; will work and we don't have to read anything. 31603 ; 31604 ; None the less, we check to see if anything made it over to the PTY 31605 ; buffer so we can toss that. 31606 ; 31607 ; Does not return until *both* the SOBE% and SIBE% produce zero. 31608 31609 002524'01 ptyfls: remark ; Has to work both sides of the device 31610 002524'01 265 16 0 00 005652' saveac 31611 31612 002525'01 514 05 0 00 002455* hrlz q1, netjfn ; Pick up the network JFN 31613 002526'01 326 05 0 00 002534' ife. q1 ; Have to have this for a PTY!! 31614 002527'01 334 01 0 00 000000# ermsg% (,r) 31615 002530'01 254 00 0 00 002534' 31616 002531'01 202 01 0 00 002461* 31617 002532'01 104 00 0 00 000313 31618 002533'01 254 00 0 00 002513* 31619 000205'03 000000000000# 31620 001616'04 113 105 122 115 111 31621 31622 002534'01 endif. ; End of that particular sanity check 31623 002534'01 540 05 0 00 000000# hrr q1, ptytty ; Load this PTY's associated terminal line 31624 002535'01 660 05 0 00 400000 txo q1, .ttdes ; Force alternate form of terminal designator 31625 002536'01 403 06 0 00 000007 setzb q2, q3 ; Zero working read and grand total 31626 31627 002537'01 do. ; Enter loop context 31628 002537'01 550 01 0 00 000005 hrrz t1, q1 ; Load terminal designator 31629 002540'01 104 00 0 00 000103 SOBE% ; Skip if output buffer empty 31630 002541'01 254 00 0 00 002552' ifskp. ; Empty? 31631 002542'01 322 02 0 00 002550' ifn. t2 ; If zero, then no error and nothing to do 31632 002543'01 334 00 0 00 000000 %ermsg (,r) 31633 002544'01 254 00 0 00 002550' 31634 002545'01 265 01 0 00 002511* 31635 002546'01 000000000000# 31636 002547'01 254 00 0 00 002533* 31637 001632'04 125 156 141 142 154 31638 002550'01 endif. ; End case t2 having JSYS error code 31639 002550'01 400 10 0 00 000000 setz q4, ; Whack this round's output 31640 002551'01 254 00 0 00 002562' else. ; Otherwise, have some junk in there 31641 002552'01 270 07 0 00 000002 add q3, t2 ; Accumulate in grand tally 31642 002553'01 200 10 0 00 000002 move q4, t2 ; Flag non-zero buffer, this round 31643 002554'01 104 00 0 00 000101 CFOBF% ; Clear out any blocked up crud 31644 002555'01 320 12 0 00 002557' %jserr (,r) 31645 002556'01 254 00 0 00 002562' 31646 002557'01 265 01 0 00 002545* 31647 002560'01 000000000000# 31648 002561'01 254 00 0 00 002547* 31649 001643'04 103 157 165 154 144 31650 002562'01 endif. ; End SOBE% results handling k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40-1 K20NET MAC 5-May-24 16:57 DECnet flush 31651 002562'01 554 01 0 00 000005 hlrz t1, q1 ; Load the PTY side 31652 002563'01 104 00 0 00 000102 SIBE% ; Skip if input buffer empty 31653 002564'01 254 00 0 00 002574' ifskp. ; Empty? 31654 002565'01 322 02 0 00 002573' ifn. t2 ; If zero, then no error; carry on 31655 002566'01 334 00 0 00 000000 %ermsg (,r) 31656 002567'01 254 00 0 00 002573' 31657 002570'01 265 01 0 00 002557* 31658 002571'01 000000000000# 31659 002572'01 254 00 0 00 002561* 31660 001653'04 125 156 141 142 154 31661 002573'01 endif. ; End case empty input buffer 31662 002573'01 254 00 0 00 002616' else. ; Otherwise, have some junk in there 31663 002574'01 270 10 0 00 000002 add q4, t2 ; Add to this round's tally 31664 002575'01 200 06 0 00 000002 move q2, t2 ; Load for inner loop 31665 002576'01 do. ; Enter inner loop context 31666 002576'01 337 04 0 00 000006 skipg t4, q2 ; Load remaining characters 31667 002577'01 254 00 0 00 002616' exit. ; If no more, then we're done 31668 002600'01 303 04 0 00 000310 caile t4, flushc ; More than maximum we can swallow at once? 31669 002601'01 201 04 0 00 000310 movx t4, flushc ; Yep, well just take a mouthful 31670 remark t1, q1 ; JFN is still in there 31671 002602'01 200 02 0 00 005670' move t2, [point 8,flushb] ; Load pointer to 'flush' buffer 31672 002603'01 210 03 0 00 000004 movn t3, t4 ; Reading exactly that much 31673 002604'01 104 00 0 00 000052 SIN% ; Swallow whatever junk is in there 31674 002605'01 320 12 0 00 002607' %jsErr (,r) ;[211] 31675 002606'01 254 00 0 00 002612' 31676 002607'01 265 01 0 00 002570* 31677 002610'01 000000000000# 31678 002611'01 254 00 0 00 002572* 31679 001662'04 125 156 141 142 154 31680 002612'01 270 04 0 00 000003 add t4, t3 ; Keep track of what we didn't read 31681 002613'01 270 07 0 00 000004 add q3, t4 ; And add to total done 31682 002614'01 274 06 0 00 000004 sub q2, t4 ; Subtract from remaining 31683 002615'01 327 06 0 00 002576' jumpg q2, top. ; Loop if anything left 31684 002616'01 enddo. ; End context inner loop 31685 002616'01 endif. ; End SIBE% results handling 31686 002616'01 327 10 0 00 002537' jumpg q4, top. ; If got anything, take another look 31687 002617'01 enddo. ; End of loop lexical context 31688 31689 002617'01 272 07 0 00 000000# addm q3, vchrcn ; Update grand total characters ever flushed 31690 002620'01 200 01 0 00 000007 move t1, q3 ; Return total characters whacked this time 31691 002621'01 254 00 0 00 002523* retskp ; Return success 31692 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20NET MAC 5-May-24 16:57 clrest Give an estimate of characters in input buffer 31693 subttl clrest Give an estimate of characters in input buffer 31694 31695 ; Call: 31696 ; 31697 ; Nothing: appropriate thing is done based on connection context. 31698 ; 31699 ; Returns: 31700 ; 31701 ; +1/ Some problem 31702 ; +2/ Success 31703 ; t1/ Total characters in various buffers 31704 ; 31705 ; N.B., A pseudo terminal can have characters on 'both sides', that 31706 ; is, the character's in the PTY's input buffer *AND* the 31707 ; characters in the associated TTY's output buffer that have not be 31708 ; transferred into the PTY's input buffer, yet. 31709 ; 31710 ; Thus, the use of SOBE% for pseudo-terminals in addition to the 31711 ; expected SIBE%. 31712 31713 002622'01 clrest: entry clrest ; World callable 31714 002622'01 265 16 0 00 005671' saveac ; Needs a few accumulators 31715 002623'01 550 04 0 00 002525* hrrz t4, netjfn ; Always prefer a network JFN 31716 002624'01 326 04 0 00 002626' ife. t4 ; Unless there isn't one 31717 002625'01 550 04 0 00 002427* hrrz t4, ttyjfn ; Use terminal if nothing else 31718 002626'01 endif. ; End case no network JFN 31719 002626'01 403 02 0 00 000003 setzb t2, t3 ; Clear all totals 31720 31721 002627'01 336 00 0 00 000000# ifmn. ptyflg ; If pseudo-terminal, look at both sides 31722 002630'01 254 00 0 00 002646' 31723 002631'01 550 01 0 00 000000# hrrz t1, ptytty ; Load this PTY's associated terminal line 31724 002632'01 660 01 0 00 400000 txo t1, .ttdes ; Force alternate form of terminal designator 31725 002633'01 104 00 0 00 000103 SOBE% ; Skip if output buffer empty 31726 002634'01 254 00 0 00 002644' ifskp. ; Empty? 31727 002635'01 322 02 0 00 002643' ifn. t2 ; If zero, then no error and nothing to do 31728 002636'01 334 00 0 00 000000 %ermsg (,r) 31729 002637'01 254 00 0 00 002643' 31730 002640'01 265 01 0 00 002607* 31731 002641'01 000000000000# 31732 002642'01 254 00 0 00 002611* 31733 001672'04 125 156 141 142 154 31734 002643'01 endif. ; End case t2 having JSYS error code 31735 002643'01 254 00 0 00 002646' else. ; Otherwise, have some junk in there 31736 002644'01 200 03 0 00 000002 move t3, t2 ; Keep track of TTY's output side 31737 002645'01 400 02 0 00 000000 setz t2, ; Keep nice and tidy for SIBE% 31738 002646'01 endif. ; End SOBE% results handling 31739 002646'01 endif. ; End PTY special case 31740 31741 002646'01 200 01 0 00 000004 move t1, t4 ; Load whatever JFN we decided to use 31742 002647'01 104 00 0 00 000102 SIBE% ; Skip if input buffer empty 31743 002650'01 254 00 0 00 002660' ifskp. ; Empty? 31744 002651'01 322 02 0 00 002657' ifn. t2 ; If zero, then no error and nothing to do 31745 002652'01 334 00 0 00 000000 %ermsg (,r) 31746 002653'01 254 00 0 00 002657' 31747 002654'01 265 01 0 00 002640* k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41-1 K20NET MAC 5-May-24 16:57 clrest Give an estimate of characters in input buffer 31748 002655'01 000000000000# 31749 002656'01 254 00 0 00 002642* 31750 001703'04 125 156 141 142 154 31751 002657'01 endif. ; End case t2 having JSYS error code 31752 002657'01 254 00 0 00 002661' else. ; Otherwise, have some junk in there 31753 002660'01 270 03 0 00 000002 add t3, t2 ; Add to any running tally 31754 002661'01 endif. ; End SIBE% results handling 31755 31756 002661'01 200 01 0 00 000003 move t1, t3 ; Return grand total seen 31757 002662'01 254 00 0 00 002621* retskp ; Return success 31758 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20NET MAC 5-May-24 16:57 clread Return buffer of what we cleared 31759 subttl clread Return buffer of what we cleared 31760 31761 ; Call: 31762 ; 31763 ; Nothing: appropriate thing is done based on connection context. 31764 ; 31765 ; Returns: 31766 ; 31767 ; +1/ Some problem 31768 ; +2/ Success 31769 ; t1/ Total characters read 31770 ; t2/ (Eight bit) pointer to buffer 31771 ; 31772 ; N.B., be aware of the following: 31773 ; 31774 ; 1) clread should be repeatedly called until it returns zero as 31775 ; there may be more data than we can read. 31776 ; 31777 ; 2) Can't use SINR% because it will discard an unknown number of 31778 ; characters. Sigh... 31779 31780 002663'01 clread: entry clread ; Called from K20PAR 31781 002663'01 265 16 0 00 005703' saveac 31782 remark call ;[209] Display something 31783 002664'01 260 17 0 00 002420* call inpclr ;[209] Chuck any waiting input 31784 31785 002665'01 514 05 0 00 002623* hrlz q1, netjfn ; Prefer the network JFN 31786 002666'01 326 05 0 00 002670' ife. q1 ; But!! Do we have one? 31787 002667'01 514 05 0 00 002625* hrlz q1, ttyjfn ; Use terminal if nothing else 31788 002670'01 endif. ; End case no network JFN 31789 31790 002670'01 336 00 0 00 000000# ifmn. ptyflg ; Pseudo-terminal? 31791 002671'01 254 00 0 00 002674' 31792 002672'01 540 05 0 00 000000# hrr q1, ptytty ; Load this PTY's associated terminal line 31793 002673'01 660 05 0 00 400000 txo q1, .ttdes ; Force alternate form of terminal designator 31794 002674'01 endif. ; End case pseudo-terminal 31795 31796 dmove q4, [ flushc ; Load total remaining in buffer 31797 002674'01 120 10 0 00 005721' point 8, flushb ] ; Load pointer to 'flush' buffer 31798 31799 002675'01 do. ; Enter loop context 31800 002675'01 322 10 0 00 002754' jumpe q4, endlp. ; If buffer full, then return 31801 002676'01 550 01 0 00 000005 hrrz t1, q1 ; Load terminal designator 31802 002677'01 322 01 0 00 002714' ifn. t1 ; But did we ever have one? 31803 002700'01 104 00 0 00 000103 SOBE% ; Skip if output buffer empty 31804 002701'01 254 00 0 00 002712' ifskp. ; Empty? 31805 002702'01 322 02 0 00 002710' ifn. t2 ; If zero, then no error and nothing to do 31806 002703'01 334 00 0 00 000000 %ermsg (,r) 31807 002704'01 254 00 0 00 002710' 31808 002705'01 265 01 0 00 002654* 31809 002706'01 000000000000# 31810 002707'01 254 00 0 00 002656* 31811 001712'04 125 156 141 142 154 31812 002710'01 endif. ; End case t2 having JSYS error code 31813 002710'01 400 04 0 00 000000 setz t4, ; Whack this round's PTY portion k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42-1 K20NET MAC 5-May-24 16:57 clread Return buffer of what we cleared 31814 002711'01 254 00 0 00 002713' else. ; Otherwise, have some junk in there 31815 002712'01 200 04 0 00 000002 move t4, t2 ; Flag non-zero buffer, this round 31816 002713'01 endif. ; End SOBE% results handling 31817 002713'01 254 00 0 00 002715' else. ; Otherwise no PTY 31818 002714'01 400 04 0 00 000000 setz t4, ; So no PTY contribution 31819 002715'01 endif. ; End special case for pseudo-termina 31820 002715'01 554 01 0 00 000005 hlrz t1, q1 ; Now load whatever JFN we have 31821 002716'01 104 00 0 00 000102 SIBE% ; Skip if input buffer empty 31822 002717'01 254 00 0 00 002727' ifskp. ; Empty? 31823 002720'01 322 02 0 00 002726' ifn. t2 ; If zero, then no error; carry on 31824 002721'01 334 00 0 00 000000 %ermsg (,r) 31825 002722'01 254 00 0 00 002726' 31826 002723'01 265 01 0 00 002705* 31827 002724'01 000000000000# 31828 002725'01 254 00 0 00 002707* 31829 001723'04 125 156 141 142 154 31830 002726'01 endif. ; End case empty input buffer 31831 002726'01 254 00 0 00 002730' else. ; Otherwise, have some junk in there 31832 002727'01 270 04 0 00 000002 add t4, t2 ; Add to this round's tally 31833 002730'01 endif. ; End SOBE% results handling 31834 002730'01 322 04 0 00 002754' jumpe t4, endlp. ; If nothing there, we're done 31835 002731'01 313 04 0 00 000010 camle t4, q4 ; More than what we have left? 31836 002732'01 200 04 0 00 000010 move t4, q4 ; Yep, don't overflow the buffer 31837 002733'01 200 06 0 00 000004 move q2, t4 ; Position for inner loop 31838 002734'01 400 07 0 00 000000 setz q3, ; Zero inner loop tally 31839 002735'01 do. ; Enter inner loop context 31840 remark t1, q1 ; JFN is still in there from SIBE% 31841 002735'01 200 02 0 00 000011 move t2, q5 ; Load updated pointer 31842 002736'01 210 03 0 00 000004 movn t3, t4 ; Reading exactly that much 31843 002737'01 104 00 0 00 000052 SIN% ; Swallow whatever junk is in there 31844 002740'01 320 12 0 00 002742' %jsErr (,r) 31845 002741'01 254 00 0 00 002745' 31846 002742'01 265 01 0 00 002723* 31847 002743'01 000000000000# 31848 002744'01 254 00 0 00 002725* 31849 001732'04 125 156 141 142 154 31850 002745'01 270 04 0 00 000003 add t4, t3 ; Keep track of what we did NOT read 31851 002746'01 270 07 0 00 000004 add q3, t4 ; And add to loop total done 31852 002747'01 274 06 0 00 000004 sub q2, t4 ; Subtract from remaining 31853 002750'01 327 06 0 00 002735' jumpg q2, top. ; Loop if anything left 31854 002751'01 enddo. ; End context inner loop 31855 002751'01 274 10 0 00 000007 sub q4, q3 ; Subtract from total buffer size 31856 002752'01 200 11 0 00 000002 move q5, t2 ; Store updated pointer for next round 31857 002753'01 327 10 0 00 002675' jumpg q4, top. ; If got anything, take another look 31858 002754'01 enddo. ; End of loop lexical context 31859 31860 002754'01 201 01 0 00 000310 movx t1, flushc ; Load largest possible buffer 31861 002755'01 274 01 0 00 000010 sub t1, q4 ; Subtract total remaining 31862 002756'01 272 01 0 00 000000# addm t1, vchrcn ; Update grand total characters ever flushed 31863 002757'01 200 02 0 00 005723' move t2, [point 8,flushb] ; Return pointer to 'flush' buffer 31864 002760'01 254 00 0 00 002662* retskp ; Finally return success 31865 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20NET MAC 5-May-24 16:57 Routine to unstop an XOFF'd line, added as edit 91. 31866 subttl Routine to unstop an XOFF'd line, added as edit 91. 31867 31868 002761'01 ttxon: entry ttxon ;[211] Partly rewritten for PTY's and NRT's 31869 002761'01 265 16 0 00 005724' saveac ;[211] Needs an extra register 31870 31871 002762'01 260 17 0 00 002420' call clrbuf ;[211] Call our new friend to toss data 31872 002763'01 263 17 0 00 000000 ret ;[211] But couldn't; give up 31873 31874 002764'01 332 01 0 00 002665* skipe t1, netjfn ;[186] Load the network JFN 31875 002765'01 254 00 0 00 003002' ifskp. ;[186] Unless we don't have one... 31876 002766'01 332 00 0 00 001275* skipe local ;[186] Are we remote? 31877 002767'01 334 01 0 00 000000# ermsg% (,r) ;[186] Punt 31878 002770'01 254 00 0 00 002774' 31879 002771'01 202 01 0 00 002531* 31880 002772'01 104 00 0 00 000313 31881 002773'01 254 00 0 00 002744* 31882 000206'03 000000000000# 31883 001740'04 113 105 122 115 111 31884 31885 002774'01 336 01 0 00 002667* skipn t1, ttyjfn ;[186] Yes, so just use the terminal JFN 31886 002775'01 334 01 0 00 000000# ermsg% (,r) ;[186] 31887 002776'01 254 00 0 00 003002' 31888 002777'01 202 01 0 00 002771* 31889 003000'01 104 00 0 00 000313 31890 003001'01 254 00 0 00 002773* 31891 000207'03 000000000000# 31892 001754'04 113 105 122 115 111 31893 31894 003002'01 endif. ;[186] Hopefully have SOMETHING ... 31895 003002'01 514 05 0 00 000001 hrlz q1, t1 ;[211] Save the JFN (sans flags) for later 31896 31897 003003'01 336 00 0 00 000000# ifmn. ptyflg ;[211] A pseudo-terminal? 31898 003004'01 254 00 0 00 003007' 31899 003005'01 550 01 0 00 000000# hrrz t1, ptytty ;[211] Yes, don't do this to the PTY half 31900 003006'01 660 01 0 00 400000 txo t1, .ttdes ;[211] Do it to the TTY half 31901 003007'01 endif. ;[211] End PTY-FE/NRT decision 31902 003007'01 540 05 0 00 000001 hrr q1, t1 ;[211] Save some terminal descriptor 31903 31904 ;[157] If we're doing flow control, send a ^Q (XON) to unstick the other side. 31905 31906 003010'01 336 00 0 00 001626* skipn flow ; Doing flow control? 31907 003011'01 263 17 0 00 000000 ret ; No, done. 31908 31909 003012'01 332 00 0 00 000000# skipe nrtflg ;[211] An NRT? 31910 003013'01 254 00 0 00 003034' callret ttxon3 ;[211] Skip this terminal stuff 31911 ;[211] Will never work with a DCN: JFN 31912 003014'01 550 01 0 00 000005 ttxon2: hrrz t1, q1 ;[211] Get some terminal descriptor 31913 003015'01 104 00 0 00 000107 RFMOD ; Yes, get terminal mode. 31914 003016'01 320 16 0 00 003001* erjmp r 31915 003017'01 200 03 0 00 000002 move t3, t2 ; Save it. 31916 003020'01 622 02 0 00 000300 txze t2, tt%dam ; Data mode? 31917 003021'01 254 00 0 00 003024' ifskp. ;[211] No, so no need to change 31918 003022'01 260 17 0 00 003034' call ttxon3 ; No, binary, just send it. 31919 003023'01 254 00 0 00 003033' else. ;[211] Otherwise, tweak the mode 31920 003024'01 104 00 0 00 000110 SFMOD ; Put in binary mode. k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43-1 K20NET MAC 5-May-24 16:57 Routine to unstop an XOFF'd line, added as edit 91. 31921 003025'01 320 12 0 00 003016* erjmpr r ;[211] 31922 003026'01 260 17 0 00 003034' call ttxon3 ; Send the XON. 31923 003027'01 550 01 0 00 000005 hrrz t1, q1 ;[211] Reload the terminal descriptor 31924 003030'01 200 02 0 00 000003 move t2, t3 ; Load original settings 31925 003031'01 104 00 0 00 000110 SFMOD ; Put back in data mode. 31926 003032'01 320 12 0 00 003025* erjmpr r ;[211] 31927 003033'01 endif. ;[211] End terminal mode tweaking 31928 003033'01 263 17 0 00 000000 ret 31929 31930 003034'01 554 01 0 00 000005 ttxon3: hlrz t1, q1 ;[211] Use the real JFN 31931 003035'01 201 02 0 00 000021 movei t2, xon ; Send an XON. 31932 003036'01 104 00 0 00 000051 BOUT 31933 003037'01 320 16 0 00 003032* erjmp r 31934 003040'01 263 17 0 00 000000 ret 31935 31936 ;[211] End clrbuf rewrite for non-physical terminals 31937 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20NET MAC 5-May-24 16:57 clsnet -- Close any kind of 'network' connection 31938 subttl clsnet -- Close any kind of 'network' connection 31939 31940 remark ; Has to be before first reference!! 31941 syn clscom,clsfe ; Close the terminal 31942 syn clscom,clspty ; Close the pseudo-terminal 31943 31944 ; Ignores local setting, uses netjfn, regardless. Checks the JFN, 31945 ; regardless of it possibly being absurd. 31946 31947 003041'01 clsjfn: entry clsjfn ; Invoked by Kermit exit 31948 003041'01 265 16 0 00 005740' saveac ;Don't touch anything 31949 003042'01 200 01 0 00 002764* move t1, netjfn ; Use whatever is there, no matter what 31950 003043'01 254 00 0 00 003051' jrst chkcls ; Just get started with the JFN 31951 31952 ; Expects nothing; checks local to see if we would even have the JFN 31953 ; and sanity checks the JFN 31954 31955 003044'01 clsnet: entry clsnet ; Callable by anybody 31956 extern local ; Set if we are not using .priou for transfers 31957 31958 003044'01 336 00 0 00 002766* skipn local ; Are we not using our own terminal for packets? 31959 003045'01 263 17 0 00 000000 ret ; We are, so there is nothing to clean up 31960 003046'01 265 16 0 00 005740' saveac ;Don't touch anything 31961 003047'01 337 01 0 00 003042* skipg t1, netjfn ; If we are local, then we will have a JFN 31962 003050'01 254 00 0 00 003155' jrst clsasg ; Unless we are in some odd state 31963 remark chkcls ; falls through 31964 31965 003051'01 chkcls: remark ; Here to check if we can close it 31966 003051'01 104 00 0 00 000024 GTSTS% ; Now let's find out about the JFN 31967 003052'01 320 12 0 00 003054' ifje. r ; Catch and ignore the error 31968 003053'01 254 00 0 00 003060' 31969 003054'01 200 04 0 00 000001 move t4, t1 ; Save any error code for later 31970 003055'01 400 05 0 00 000000 setz q1, ; Whack the bits, assume nothing 31971 003056'01 550 01 0 00 003047* hrrz t1, netjfn ; Reload the JFN 31972 003057'01 254 00 0 00 003061' else. ; Otherwise, worked 31973 003060'01 200 05 0 00 000002 move q1, t2 ; Save the status bits 31974 003061'01 endif. 31975 003061'01 607 05 0 00 000200 jxe q1, gs%nam, clscln ; Nothing there? Just scrub the storage 31976 003062'01 254 00 0 00 003221' 31977 31978 003063'01 104 00 0 00 000117 DVCHR% ; JFN might work 31979 003064'01 320 12 0 00 003066' ifje. r ; But didn't 31980 003065'01 254 00 0 00 003072' 31981 003066'01 200 04 0 00 000001 move t4, t1 ; Save any error code for later 31982 003067'01 477 06 0 00 000010 setob q2, q4 ; Phoney device designator and assignment 31983 003070'01 400 07 0 00 000000 setz q3, ; No characteristics 31984 003071'01 254 00 0 00 003074' else. ; Otherwise, worked. Promising... 31985 003072'01 120 06 0 00 000001 dmove q2, t1 ; Save device designator and characteristics 31986 003073'01 200 10 0 00 000003 move q4, t3 ; And assignment word 31987 003074'01 endif. 31988 003074'01 325 05 0 00 003150' jxe q1, gs%opn, clsrlj ; If it isn't open, don't close it 31989 ; Load the device type 31990 003075'01 135 04 0 00 005756' ldb t4,[pointr q3,dv%typ] 31991 003076'01 306 04 0 00 000012 cain t4, .dvtty ; Physical (front end) terminal? 31992 003077'01 254 00 0 00 003125' jrst clsfe ; Clean that up and deassign k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44-1 K20NET MAC 5-May-24 16:57 clsnet -- Close any kind of 'network' connection 31993 003100'01 306 04 0 00 000013 cain t4, .dvpty ; Pseudo terminal? 31994 003101'01 254 00 0 00 003125' jrst clspty ; Clean that up and deassign 31995 003102'01 306 04 0 00 000022 cain t4, .dvdcn ; Outgoing NRT? 31996 003103'01 254 00 0 00 003116' jrst clsnrt ; Clean that up (no deassign) 31997 31998 003104'01 334 01 0 00 000000# ermsg% (, clscom) 31999 003105'01 254 00 0 00 003111' 32000 003106'01 202 01 0 00 002777* 32001 003107'01 104 00 0 00 000313 32002 003110'01 254 00 0 00 003125' 32003 000210'03 000000000000# 32004 001770'04 113 105 122 115 111 32005 32006 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20NET MAC 5-May-24 16:57 Various JFN closure routines 32007 subttl Various JFN closure routines 32008 32009 remark ; See required location of SYN's, above 32010 remark clsfe ; Close the terminal 32011 remark clspty ; Close the pseudo-terminal 32012 32013 003111'01 44 07 0 00 003113' nrtend: point 7, .+2 ; Point to message 32014 003112'01 000000 000014 ^d12 ; Its length 32015 003113'01 113 145 162 155 151 ASCIZ "Kermit Close" ; Informative message... 32016 32017 003116'01 550 01 0 00 003056* clsnrt: hrrz t1, netjfn ; Load the network JFN 32018 003117'01 200 02 0 00 005757' move t2, [.dcx40,,.moclz] ;Object initiated close 32019 003120'01 120 03 0 00 003111' dmove t3, nrtend ; Message for remote NRT server to ignore 32020 003121'01 104 00 0 00 000077 MTOPR% ; Try to deliver the bad news 32021 003122'01 320 12 0 00 003124' ifje. r ; Catch and ignore error 32022 003123'01 254 00 0 00 003125' 32023 003124'01 200 04 0 00 000001 move t4, t1 ; Leave around for debugger 32024 003125'01 endif. 32025 remark clscom ; And proceed ...(falls through) 32026 32027 003125'01 550 01 0 00 003116* clscom: hrrz t1, netjfn ; Common close for any kind of JFN 32028 003126'01 104 00 0 00 000022 CLOSF% ; Make our first attempt 32029 003127'01 320 12 0 00 003131' ifje. r ; Catch and ignore the error 32030 003130'01 254 00 0 00 003135' 32031 003131'01 200 04 0 00 000001 move t4, t1 ; Save error for later 32032 003132'01 302 01 0 00 600160 caie t1, clsx1 ; File not open? 32033 003133'01 254 00 0 00 003136' jrst clsabt ; No, try to abort it 32034 003134'01 254 00 0 00 003150' jrst clsrlj ; Otherwise, just try to let go of it 32035 003135'01 endif. 32036 003135'01 254 00 0 00 003155' jrst clsasg ; Go clean up assignments and storage 32037 32038 003136'01 550 01 0 00 003125* clsabt: hrrz t1, netjfn ; Load the JFN, no flags 32039 003137'01 661 01 0 00 004000 txo t1, cz%abt ; Set the abort flag 32040 003140'01 104 00 0 00 000022 CLOSF% ; Toss it with reckless abandon 32041 003141'01 320 12 0 00 003143' ifje. r ; Catch and ignore the error 32042 003142'01 254 00 0 00 003147' 32043 003143'01 200 04 0 00 000001 move t4, t1 ; Save error for later 32044 003144'01 302 01 0 00 600152 caie t1, desx3 ; JFN not assigned anymore> 32045 003145'01 254 00 0 00 003136' jrst clsabt ; No, just try to let go of it 32046 003146'01 254 00 0 00 003155' jrst clsasg ; Otherwise, release assignments 32047 003147'01 endif. 32048 003147'01 254 00 0 00 003155' jrst clsasg ; Go clean up assignments 32049 32050 003150'01 550 01 0 00 003136* clsrlj: hrrz t1, netjfn ; Just try to let go 32051 003151'01 104 00 0 00 000023 RLJFN% ; and hope for the bext 32052 003152'01 320 12 0 00 003154' ifje. r ; Catch and ignore the error 32053 003153'01 254 00 0 00 003155' 32054 003154'01 200 04 0 00 000001 move t4, t1 ; Save error for later 32055 003155'01 endif. 32056 remark clsasg ; Clean up assignments 32057 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20NET MAC 5-May-24 16:57 Release any assigned terminals, pseudo or otherwise 32058 subttl Release any assigned terminals, pseudo or otherwise 32059 32060 003155'01 336 00 0 00 001125* clsasg: ifmn. asgflg ; Do we think anything assigned? 32061 003156'01 254 00 0 00 003164' 32062 003157'01 200 01 0 00 001126* move t1, asgdev ; Grab assigned device 32063 003160'01 104 00 0 00 000071 RELD% ; Punt it 32064 003161'01 320 12 0 00 003163' ifje. r ; Sigh 32065 003162'01 254 00 0 00 003164' 32066 003163'01 200 04 0 00 000001 move t4, t1 ; What if different from q2? 32067 003164'01 endif. 32068 003164'01 endif. 32069 ; Do a consistency check 32070 003164'01 574 03 0 00 000010 hlre t3, q4 ; Load job assignment 32071 003165'01 312 03 0 00 005760' came t3, [-1] ; Not assigned? 32072 003166'01 316 03 0 00 005761' camn t3, [-2] ; Allocator has it? 32073 003167'01 254 00 0 00 003221' Jrst clscln ; Then nothing else to do 32074 003170'01 312 03 0 00 001075* came t3, myjob ; Do we have this device? 32075 003171'01 254 00 0 00 003221' jrst clscln ; No, then surely cannot release it 32076 003172'01 200 01 0 00 000006 move t1, q2 ; Load JFN's device designator 32077 003173'01 316 01 0 00 003157* camn t1, asgdev ; Did we already release it, actually? 32078 003174'01 254 00 0 00 003221' jrst clscln ; Yes, so no inconsistency 32079 ; No, something extra left lying around... 32080 003175'01 554 02 0 00 000001 hlrz t2, t1 ; Pick up the device type 32081 003176'01 550 03 0 00 000001 hrrz t3, t1 ; Pick up the unit number 32082 003177'01 326 02 0 00 003207' ife. t2 ; But!! Any device type? 32083 003200'01 626 03 0 00 400000 trzn t3, .ttdes ; Universal terminal? 32084 003201'01 254 00 0 00 003221' jrst clscln ; No, some odd thing. Leave it alone 32085 003202'01 316 03 0 00 001260* camn t3, mytty ; It's a terminal. Ourself? 32086 003203'01 254 00 0 00 003221' jrst clscln ; Yes, LOGIN% or CRJOB% gave it to us 32087 003204'01 550 01 0 00 000003 hrrz t1, t3 ; Load bare terminal number 32088 003205'01 505 01 0 00 600012 hrli t1, .dvdes!.dvtty ;Give a general device designator 32089 003206'01 254 00 0 00 003215' else. ; Otherwise, fullword 32090 003207'01 200 04 0 00 000002 move t4, t2 ; Make a copy of the device designator 32091 003210'01 620 04 0 00 600000 trz t4, .dvdes ; Shut off the device designator 32092 003211'01 302 04 0 00 000012 caie t4, .dvtty ; A terminal? 32093 003212'01 254 00 0 00 003215' anskp. ; Not a terminal, so can't be our terminal 32094 003213'01 316 03 0 00 003202* camn t3, mytty ; It's a terminal. Ourself? 32095 003214'01 254 00 0 00 003221' jrst clscln ; Yes, LOGIN% or CRJOB% gave it to us 32096 003215'01 endif. ; To RELD% 32097 32098 003215'01 104 00 0 00 000071 RELD% ; Try to punt it, anyway 32099 003216'01 320 12 0 00 003220' ifje. r ; Sigh 32100 003217'01 254 00 0 00 003221' 32101 003220'01 200 04 0 00 000001 move t4, t1 ; Save error number for debuggers 32102 003221'01 endif. 32103 remark clscln ; Fall through to storage clean up 32104 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20NET MAC 5-May-24 16:57 Finally obliterate JFN related storage 32105 subttl Finally obliterate JFN related storage 32106 32107 ; Leaves ASCII device or node names alone for possible later reporting 32108 32109 003221'01 402 00 0 00 003155* clscln: setzm asgflg ; Nothing assigned 32110 003222'01 402 00 0 00 003173* setzm asgdev ; No relec of it, either 32111 003223'01 402 00 0 00 003150* setzm netjfn ; Not no JFN, not no how 32112 32113 003224'01 403 01 0 00 000002 setzb t1, t2 ; In case we have adjacent words 32114 003225'01 124 01 0 00 000000# dmovem t1, ndvchr ; Whack the characteristics double word 32115 003226'01 402 00 0 00 002346* setzm vtermf ; No kind of virtual terminal 32116 003227'01 402 00 0 00 000000# setzm nrtflg ; Not a DECnet NRT connection 32117 003230'01 402 00 0 00 000000# setzm ptytty ; No terminal assigned via PTY, either 32118 003231'01 402 00 0 00 000000# setzm ptyflg ; No a pseudo-terminal connection 32119 003232'01 402 00 0 00 000000# setzm ttyflg ; Not using a physical terminal 32120 003233'01 402 00 0 00 000000# setzm tvtflg ;[271] ; Not using an ARPA terminal 32121 003234'01 402 00 0 00 000000# setzm ttydev ; So don't have a device designator 32122 32123 003235'01 200 03 0 00 003213* move t3, mytty ; Use our local terminal 32124 003236'01 202 03 0 00 001500* movem t3, ttynum ; Use that 32125 003237'01 402 00 0 00 003044* setzm local ; We are no longer local 32126 003240'01 476 00 0 00 000000# setom opndev ; No opened device 32127 003241'01 263 17 0 00 000000 ret ; One way or another, finally done 32128 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20NET MAC 5-May-24 16:57 Lost virtual terminal connection, shut everything down 32129 subttl Lost virtual terminal connection, shut everything down 32130 32131 003242'01 netvtx: entry netvtx ;[196] 32132 extern frkchb ;[218] Convert channel number to bit 32133 txmsg < 32134 003242'01 200 01 0 00 000000# [KERMIT-20: Lost > 32135 003243'01 104 00 0 00 000076 32136 003244'01 320 12 0 00 003245' 32137 000211'03 000000000000# 32138 002000'04 015 012 007 133 113 32139 32140 003245'01 336 00 0 00 000000# ifmn. ptyflg 32141 003246'01 254 00 0 00 003264' 32142 003247'01 200 01 0 00 000000# txmsg 32143 003250'01 104 00 0 00 000076 32144 003251'01 320 12 0 00 003252' 32145 000212'03 000000000000# 32146 002005'04 160 163 145 165 144 32147 003252'01 561 01 0 00 000000# hrroi t1, ptynam ; Point to pseudo-terminal device name 32148 003253'01 104 00 0 00 000076 PSOUT% ; Type that 32149 003254'01 200 01 0 00 000000# txmsg < (> 32150 003255'01 104 00 0 00 000076 32151 003256'01 320 12 0 00 003257' 32152 000213'03 000000000000# 32153 002014'04 040 050 000 000 000 32154 003257'01 561 01 0 00 000000# hrroi t1, ttynam ; Point to associated terminal device name 32155 003260'01 104 00 0 00 000076 PSOUT% ; Type that 32156 003261'01 200 01 0 00 000000# txmsg <) > 32157 003262'01 104 00 0 00 000076 32158 003263'01 320 12 0 00 003264' 32159 000214'03 000000000000# 32160 002015'04 051 040 000 000 000 32161 003264'01 endif. 32162 32163 003264'01 336 00 0 00 000000# ifmn. nrtflg 32164 003265'01 254 00 0 00 003276' 32165 003266'01 200 01 0 00 000000# txmsg 32166 003267'01 104 00 0 00 000076 32167 003270'01 320 12 0 00 003271' 32168 000215'03 000000000000# 32169 002016'04 104 105 103 156 145 32170 003271'01 561 01 0 00 001677* hrroi t1,nodnam ; Point to the remote node 32171 003272'01 104 00 0 00 000076 PSOUT% ; Type it 32172 003273'01 200 01 0 00 000000# txmsg <:: > ; Trailing punctuation 32173 003274'01 104 00 0 00 000076 32174 003275'01 320 12 0 00 003276' 32175 000216'03 000000000000# 32176 002024'04 072 072 040 000 000 32177 003276'01 endif. 32178 32179 003276'01 200 01 0 00 000000# txmsg ; Find out where this blew up 32180 003277'01 104 00 0 00 000076 32181 003300'01 320 12 0 00 003301' 32182 000217'03 000000000000# 32183 002025'04 141 164 072 040 000 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-1 K20NET MAC 5-May-24 16:57 Lost virtual terminal connection, shut everything down 32184 003301'01 200 01 0 17 000000 move t1, (p) ; See who called us 32185 003302'01 621 01 0 00 777700 txz t1, klflgs ; Flags aren't part of the address 32186 003303'01 260 17 0 00 000000* call symout ; Symbollically! 32187 003304'01 200 01 0 00 000000# txmsg <. Returning to > 32188 003305'01 104 00 0 00 000076 32189 003306'01 320 12 0 00 003307' 32190 000220'03 000000000000# 32191 002026'04 056 040 122 145 164 32192 003307'01 561 01 0 00 000000# hrroi t1,sysnam ; Load local node name 32193 003310'01 104 00 0 00 000076 PSOUT% ; Type it, not "DEC-20" 32194 32195 dmove t1, [ .fhsup ;[218] Signaling superior Kermit 32196 003311'01 120 01 0 00 005762' frkchb ] ;[218] Inter-fork signal 32197 003312'01 104 00 0 00 000132 IIC% ; Give it a poke 32198 003313'01 320 12 0 00 003315' ifje. r ; Failed?? 32199 003314'01 254 00 0 00 003336' 32200 003315'01 302 01 0 00 600251 caie t1, FRKHX2 ; Wait! Tried to poke the wrong guy? 32201 003316'01 334 00 0 00 000000 %ermsg (,neter2) 32202 003317'01 254 00 0 00 003323' 32203 003320'01 265 01 0 00 002742* 32204 003321'01 000000000000# 32205 003322'01 254 00 0 00 003341' 32206 002032'04 125 156 141 142 154 32207 003323'01 201 01 0 00 400000 movei t1, .fhslf ;[186] We must be the inferior 32208 003324'01 104 00 0 00 000132 IIC% ;[186] So poke ourselves 32209 003325'01 320 12 0 00 003327' %jserr (,) ;[186] 32210 003326'01 254 00 0 00 003332' 32211 003327'01 265 01 0 00 003320* 32212 003330'01 000000000000# 32213 003331'01 254 00 0 00 003332' 32214 002044'04 125 156 141 142 154 32215 txmsg <:: (Sup)] 32216 32217 003332'01 200 01 0 00 000000# > 32218 003333'01 104 00 0 00 000076 32219 003334'01 320 12 0 00 003335' 32220 000221'03 000000000000# 32221 002053'04 072 072 040 050 123 32222 32223 003335'01 254 00 0 00 002360* jrst $connx ;[186] In self-case, close some other things 32224 003336'01 endif. ;[186] End signaling analysis and recovery 32225 txmsg <:: (Inf)] 32226 32227 003336'01 200 01 0 00 000000# > 32228 003337'01 104 00 0 00 000076 32229 003340'01 320 12 0 00 003341' 32230 000222'03 000000000000# 32231 002056'04 072 072 040 050 111 32232 32233 32234 003341'01 104 00 0 00 000170 neter2: HALTF ; Halt this fork. 32235 003342'01 254 00 0 00 003341' jrst neter2 ; Should never get here... 32236 32237 003343'01 261 17 0 00 000001 netinh: push p, t1 ; Save t1, just in case useful 32238 003344'01 261 17 0 00 000002 push p, t2 ; Ditto others k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-2 K20NET MAC 5-May-24 16:57 Lost virtual terminal connection, shut everything down 32239 003345'01 261 17 0 00 000003 push p, t3 32240 32241 003346'01 561 01 0 00 003364' hrroi t1, netinm ; Load error message 32242 003347'01 104 00 0 00 000313 ESOUT% ; Give ourselves an error 32243 003350'01 201 01 0 00 000101 movei t1,.priou ; Continue on primary output 32244 003351'01 525 02 0 00 400000 hrloi t2,.fhslf ; Wants this for explicit error 32245 003352'01 400 03 0 00 000000 setz t3, ; Don't limit length of text 32246 003353'01 104 00 0 00 000011 ERSTR% ; Type the JSYS failure reason text 32247 003354'01 320 12 0 00 003356' erjmpr .+2 ; Ignore strange error 32248 003355'01 320 12 0 00 003356' erjmpr .+1 ; Ignore stranger error 32249 003356'01 561 01 0 00 001724* hrroi t1, crlf ; Tie off the line 32250 003357'01 104 00 0 00 000076 PSOUT% 32251 32252 003360'01 262 17 0 00 000003 pop p, t3 ; Restore them 32253 003361'01 262 17 0 00 000002 pop p, t2 ; all of 32254 003362'01 262 17 0 00 000001 pop p, t1 ; them 32255 003363'01 254 00 0 00 003341' jrst neter2 ; Go drop dead and stay dead 32256 32257 003364'01 116 145 164 167 157 netinm: asciz /Network input subfork unexpectedly halted, / 32258 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20NET MAC 5-May-24 16:57 Open Net -- Opens network connection to somewhere 32259 subttl Open Net -- Opens network connection to somewhere 32260 32261 ; Call: 32262 ; 32263 ; t1/ LH: device type number - .dvpty, .dvdcn, .dvtty 32264 ; RH: unit number, if applicable (-1, otherwise) 32265 ; 32266 ; Return: 32267 ; 32268 ; +1/ t1, Gubbish 32269 ; t2, Ditto 32270 ; 32271 ; +2/ t1, JFN ready to use 32272 ; t2, Associated device designator (which may have been assigned) 32273 ; 32274 ; N.B., Assumes we are not treating a disk as a terminal 32275 32276 003375'01 openet: entry openet ; World callable 32277 extern flow ; Used for ^S/^Q processing 32278 003375'01 265 16 0 00 005703' saveac ;Save some things 32279 003376'01 200 05 0 00 000001 move q1, t1 ; Let's get that out of the way 32280 32281 003377'01 337 01 0 00 003223* skipg t1, netjfn ; Is anything maybe open? 32282 003400'01 254 00 0 00 003417' ifskp. ; Yes, let's get some information 32283 003401'01 104 00 0 00 000024 GTSTS% ; Get file status of JFN 32284 003402'01 320 16 0 00 003417' annje. ; Give up; JFN has to be ill 32285 003403'01 607 02 0 00 000200 ifxn. t2, gs%nam ; Don't go any further if nothing there 32286 003404'01 254 00 0 00 003416' 32287 003405'01 325 02 0 00 003416' andxn. t2, gs%opn ; And it has to be open 32288 003406'01 200 04 0 00 000002 move t4, t2 ; Save the status word 32289 003407'01 104 00 0 00 000117 DVCHR% ; Get the device characteristics 32290 003410'01 320 12 0 00 003412' ifje. r ; Catch and record error 32291 003411'01 254 00 0 00 003414' 32292 003412'01 661 04 0 00 000400 txo t4, gs%err ; Pretend the file is in error 32293 003413'01 254 00 0 00 003416' else. ; Otherwise, worked 32294 003414'01 200 06 0 00 000001 move q2, t1 ; Save device designator 32295 003415'01 120 07 0 00 000002 dmove q3, t2 ; Save characteristics and assignment 32296 003416'01 endif. ; End DVCHR error handling 32297 003416'01 endif. ; End case file status checking 32298 003416'01 254 00 0 00 003421' else. ; Otherwise, whack everything 32299 003417'01 403 04 0 00 000006 setzb t4, q2 ; No status or device designator 32300 003420'01 403 07 0 00 000010 setzb q3, q4 ; No device characteristics or assignment 32301 003421'01 endif. 32302 32303 remark ; See if we need to ditch the JFN 32304 003421'01 607 04 0 00 000200 ifxn. t4, gs%nam ; Is there a JFN already? 32305 003422'01 254 00 0 00 003426' 32306 003423'01 607 04 0 00 000400 andxn. t4, gs%err ; Any kind of error, phoney or otherwise? 32307 003424'01 254 00 0 00 003426' 32308 003425'01 260 17 0 00 003041' call clsjfn ; Yes, stomp it 32309 003426'01 endif. ; End case JFN status check 32310 32311 003426'01 554 01 0 00 000005 hlrz t1, q1 ; Finally have a look at the device type number 32312 003427'01 135 02 0 00 005764' ldb t2,[pointr q2,dv%typ];Load JFN's device type number 32313 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49-1 K20NET MAC 5-May-24 16:57 Open Net -- Opens network connection to somewhere 32314 003430'01 302 01 0 00 000013 caie t1, .dvpty ; Wants a pseudo-terminal? 32315 003431'01 254 00 0 00 003441' ifskp. ; Yes, let's see if we are reconnecting 32316 003432'01 312 01 0 00 000002 came t1, t2 ; Already has one? 32317 003433'01 254 00 0 00 003436' ifskp. ; Fine, give him the same one 32318 003434'01 550 01 0 00 003377* hrrz t1, netjfn ; Reload the JFN 32319 003435'01 254 00 0 00 002760* retskp ; Return success 32320 003436'01 endif. ; Otherwise, wants to go somewhere else 32321 003436'01 603 04 0 00 400000 txne t4, gs%opn ; Anything already open? 32322 003437'01 260 17 0 00 003041' call clsjfn ; Yes, stomp it 32323 003440'01 254 00 0 00 003517' callret opnpty ; Yes, go assign and open one 32324 003441'01 endif. ; End case pseudo-terminal connection 32325 32326 003441'01 302 01 0 00 000012 caie t1, .dvtty ; Wants a physical terminal? 32327 003442'01 254 00 0 00 003461' ifskp. ; Yes, let's see if we are reconnecting 32328 003443'01 312 01 0 00 000002 came t1, t2 ; Already has one? 32329 003444'01 254 00 0 00 003456' ifskp. ; Yes, maybe reusing the current one 32330 003445'01 550 01 0 00 000005 hrrz t1, q1 ; Pick up requested unit number 32331 003446'01 135 02 0 00 005765' ldb t2,[pointr q2,dv%unt] ;Load JFN's device type number 32332 003447'01 312 01 0 00 000002 came t1, t2 ; Are they the same? 32333 003450'01 254 00 0 00 003456' anskp. ; No, release the old one and get out of here 32334 003451'01 574 01 0 00 000010 hlre t1, q4 ; Pick up assigned job 32335 003452'01 312 01 0 00 003170* came t1, myjob ; Is it me? 32336 003453'01 254 00 0 00 003456' anskp. ; Strange, don't risk reusing it 32337 003454'01 550 01 0 00 003434* hrrz t1, netjfn ; Reload the JFN 32338 003455'01 254 00 0 00 003435* retskp ; Return success 32339 003456'01 endif. 32340 003456'01 603 04 0 00 400000 txne t4, gs%opn ; Anything already open? 32341 003457'01 260 17 0 00 003041' call clsjfn ; Yes, stomp it 32342 003460'01 254 00 0 00 003623' callret opntty ; Go assign terminal and open it 32343 003461'01 endif. ; End case physical terminal 32344 32345 003461'01 302 01 0 00 000022 caie t1, .dvdcn ; Wants a DECnet NRT?? 32346 003462'01 254 00 0 00 003512' ifskp. ; Yes, maybe going to the same place 32347 003463'01 312 01 0 00 000002 came t1, t2 ; Already there someplace? 32348 003464'01 254 00 0 00 003507' ifskp. ; Fine, give him the same one 32349 003465'01 336 00 0 00 000000# ifmn. ndvfxp ; Has extended verify? 32350 003466'01 254 00 0 00 003476' 32351 003467'01 260 17 0 00 000233' call chknrt ; OK, so check the node name 32352 003470'01 254 00 0 00 003475' ifskp. ; Worked, let's compare the numbers 32353 003471'01 312 01 0 00 000000# came t1, oldnum ; Going to same node? 32354 003472'01 254 00 0 00 003475' anskp. ; No, so close up shop and go elsewhere 32355 003473'01 550 01 0 00 003454* hrrz t1, netjfn ; The same; reload the JFN 32356 003474'01 254 00 0 00 003455* retskp ; Return success 32357 003475'01 endif. ; Done 32358 remark ; Otherwise falls out and gets new connection 32359 003475'01 254 00 0 00 003507' else. ; Otherwise, have to compare characters 32360 dmove t1, [ -1,,oldnam ; Old node name 32361 003476'01 120 01 0 00 005766' -1,,nodnam ] ; Current node name 32362 003477'01 104 00 0 00 000540 STCMP% ; Compare them 32363 003500'01 320 12 0 00 003502' ifje. r ; Failed?? 32364 003501'01 254 00 0 00 003504' 32365 003502'01 200 03 0 00 000001 move t3, t1 ; Save error code 32366 003503'01 474 01 0 00 000000 seto t1, ; For sure not equal 32367 003504'01 endif. 32368 003504'01 326 01 0 00 003507' ife. t1 ; Equal? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49-2 K20NET MAC 5-May-24 16:57 Open Net -- Opens network connection to somewhere 32369 003505'01 550 01 0 00 003473* hrrz t1, netjfn ; The same; reload the JFN 32370 003506'01 254 00 0 00 003474* retskp ; Return success 32371 003507'01 endif. 32372 003507'01 endif. ; End same destination checks 32373 003507'01 endif. 32374 003507'01 603 04 0 00 400000 txne t4, gs%opn ; Anything already open? 32375 003510'01 260 17 0 00 003041' call clsjfn ; Yes, stomp it 32376 003511'01 254 00 0 00 000210' callret decnct ; Go connect somewhere 32377 003512'01 endif. ; End case DECnet MCB terminal 32378 32379 003512'01 334 01 0 00 000000# ermsg% (,r) 32380 003513'01 254 00 0 00 003517' 32381 003514'01 202 01 0 00 003106* 32382 003515'01 104 00 0 00 000313 32383 003516'01 254 00 0 00 003037* 32384 000223'03 000000000000# 32385 002061'04 113 105 122 115 111 32386 32387 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20NET MAC 5-May-24 16:57 Open a psuedo terminal connection 32388 subttl Open a psuedo terminal connection 32389 32390 003517'01 opnpty: remark ;These are already saved 32391 003517'01 260 17 0 00 001053' call asipty ; First, assign a PTY 32392 003520'01 263 17 0 00 000000 ret ; Unless we couldn't ... 32393 003521'01 476 00 0 00 003237* setom local ; We're the local Kermit 32394 32395 003522'01 120 05 0 00 000001 dmove q1, t1 ; Load terminal line and PTY designator 32396 003523'01 202 01 0 00 003236* movem t1,ttynum ; Store associated line number 32397 003524'01 202 02 0 00 000000# movem t2,ptydev ; Store assigned PTY designator 32398 003525'01 201 03 0 00 000010 movei t3, TOPS20 ; On a pseudo-terminal (I.E., a loopback) 32399 003526'01 200 04 0 03 000760' move t4, hsttyp(t3) ; Load OWGP to OS type string 32400 003527'01 124 03 0 00 000000# dmovem t3, nrtros ; The 'remote' OS is always Tops-20... 32401 32402 remark asgflg ; asipty sets the assigned flag 32403 remark asgdev ; Ditto the assigned device 32404 remark ptyflg ; Ditto pty and bin flags 32405 003530'01 402 00 0 00 003010* setzm flow ; Don't do control flow (although works) 32406 32407 003531'01 402 00 0 00 003505* setzm netjfn ; No network JFN, yet 32408 dmove t1, [ gj%sht!gj%flg ; Want flags 32409 003532'01 120 01 0 00 005770' -1,,ptynam ] ; asipty built this for us 32410 003533'01 104 00 0 00 000020 GTJFN% ; Try to open it 32411 003534'01 320 12 0 00 003536' ifje. r ; Catch the error 32412 003535'01 254 00 0 00 003550' 32413 003536'01 200 04 0 00 000001 move t4, t1 ; Record for debugger 32414 003537'01 334 00 0 00 000000 %ermsg (,) ; Bizarre, we just got the device 32415 003540'01 254 00 0 00 003544' 32416 003541'01 265 01 0 00 003327* 32417 003542'01 000000000000# 32418 003543'01 254 00 0 00 003544' 32419 002074'04 103 141 156 047 164 32420 003544'01 200 01 0 00 000006 move t1, q2 ; Load assigned designator 32421 003545'01 260 17 0 00 003616' call deadev ; Go deasign the device 32422 003546'01 263 17 0 00 000000 ret ; Return failure 32423 003547'01 254 00 0 00 003553' else. ; Otherwise worked 32424 003550'01 552 01 0 00 003531* hrrzm t1, netjfn ; Save as network JFN 32425 003551'01 512 01 0 00 000313* hllzm t1, netflg ; Ditto the flags (just in case) 32426 003552'01 200 11 0 00 000001 move q5, t1 ; Save a copy for recovery 32427 003553'01 endif. ; End case JSYS failure 32428 32429 003553'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags them so OPENF% doesn't choke 32430 003554'01 200 02 0 00 005772' movx t2, fld(8,of%bsz)!of%wr!of%rd ; 8-bit bytes, read & write access. 32431 003555'01 104 00 0 00 000021 OPENF% ; Open the device. 32432 003556'01 320 12 0 00 003560' ifje. r ; Catch the error 32433 003557'01 254 00 0 00 003570' 32434 003560'01 200 04 0 00 000001 move t4, t1 ; Record for debugger 32435 003561'01 334 00 0 00 000000 %ermsg (,) ; Bizarre, we just got the device 32436 003562'01 254 00 0 00 003566' 32437 003563'01 265 01 0 00 003541* 32438 003564'01 000000000000# 32439 003565'01 254 00 0 00 003566' 32440 002101'04 103 157 165 154 144 32441 003566'01 550 01 0 00 000011 hrrz t1, q5 ; Load the JFN, sans flags 32442 003567'01 254 00 0 00 003041' callret clsjfn ; Call JFN and device clean up and scrub k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50-1 K20NET MAC 5-May-24 16:57 Open a psuedo terminal connection 32443 003570'01 endif. ; End case JSYS results handling 32444 ;[223] Find out about the associated terminal 32445 003570'01 200 01 0 00 000005 move t1, q1 ;[223] Load the terminal line 32446 003571'01 660 01 0 00 400000 txo t1, .ttdes ;[223] Turn it into a terminal designator 32447 003572'01 260 17 0 00 005115' call gndpar ;[223] Go find out about the parity 32448 003573'01 400 02 0 00 000000 setz t2, ;[223] Failed somehow, so no parity 32449 003574'01 606 02 0 00 000001 ifxn. t2, gd%par ;[223] Will it tolerate parity?? 32450 003575'01 254 00 0 00 003600' 32451 003576'01 476 00 0 00 000000# setom opnpar ;[223] It will 32452 003577'01 254 00 0 00 003601' else. ;[223] ...Otherwise... 32453 003600'01 402 00 0 00 000000# setzm opnpar ;[223] It won't 32454 003601'01 endif. ;[223] 32455 32456 003601'01 550 01 0 00 000011 hrrz t1, q5 ;[223] Load the PTY JFN, sans flags 32457 003602'01 201 02 0 00 000003 movei t2, .chcnc ;[186] PTY *must* have a ^C to get going 32458 003603'01 260 17 0 00 001736' call BOUTR% ;[186] Push it out, either way 32459 003604'01 334 00 0 00 000000 %ermsg (,r) ;[186] 32460 003605'01 254 00 0 00 003611' 32461 003606'01 265 01 0 00 003563* 32462 003607'01 000000000000# 32463 003610'01 254 00 0 00 003516* 32464 002106'04 106 151 162 163 164 32465 32466 003611'01 200 02 0 00 000006 move t2, q2 ; Load PTY device designator 32467 003612'01 201 03 0 00 000013 movei t3, .dvpty ; Opened a pseudo-terminal 32468 003613'01 202 03 0 00 000000# movem t3, opndev ; Store opened device type 32469 003614'01 476 00 0 00 003226* setom vtermf ; Set the virtual terminal flag 32470 003615'01 254 00 0 00 003506* retskp ; Won!! 32471 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20NET MAC 5-May-24 16:57 Used to deassign anything during opening failure 32472 subttl Used to deassign anything during opening failure 32473 32474 003616'01 104 00 0 00 000117 deadev: DVCHR% ; Pull the device characteristics 32475 003617'01 320 12 0 00 003221' erjmpr clscln ; Ignore error and scrub storage 32476 003620'01 120 06 0 00 000001 dmove q2, t1 ; Position designator and characteristics 32477 003621'01 200 10 0 00 000003 move q4, t3 ; Where clsarg wants them 32478 003622'01 254 00 0 00 003155' callret clsasg ; Go hand off to release device and scrub 32479 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20NET MAC 5-May-24 16:57 Open a physical line 32480 subttl Open a physical line 32481 32482 ; Assumes q1 has an (octal) line number 32483 32484 003623'01 265 16 0 00 005773' opntty: saveac ;[223] For a copy of the JFN 32485 003624'01 550 01 0 00 000005 hrrz t1, q1 ; Load the unit number (the terminal line) 32486 003625'01 312 01 0 00 003235* came t1, mytty ; Is it us? 32487 003626'01 254 00 0 00 003636' ifskp. ; Yes, LOGIN% or CRJOB% assigned it 32488 003627'01 402 00 0 00 003221* setzm asgflg ; Not assigned 32489 003630'01 402 00 0 00 003222* setzm asgdev ; So get rid of artifacts 32490 003631'01 402 00 0 00 000000# setzm ttydev ; all of them 32491 003632'01 550 02 0 00 000005 hrrz t2, q1 ; Begin build for DEVST% 32492 003633'01 505 02 0 00 600012 hrli t2, .dvdes!.dvtty ;Turn into a device designator 32493 003634'01 200 06 0 00 000002 move q2, t2 ; Save that, just in case 32494 003635'01 254 00 0 00 003662' jrst gttyjf ; Now go get a TTY JFN 32495 003636'01 endif. 32496 32497 003636'01 505 01 0 00 600012 hrli t1, .dvdes!.dvtty ; Turn into a device designator 32498 003637'01 200 06 0 00 000001 move q2, t1 ; Save that for later 32499 003640'01 621 01 0 00 777777 tlz t1, -1 ; Shut them back off for NTINF% 32500 003641'01 311 01 0 00 000000# caml t1, pty1st ; Into virtual range? 32501 003642'01 334 01 0 00 000000# ermsg% (, clscln) 32502 003643'01 254 00 0 00 003647' 32503 003644'01 202 01 0 00 003514* 32504 003645'01 104 00 0 00 000313 32505 003646'01 254 00 0 00 003221' 32506 000224'03 000000000000# 32507 002114'04 113 105 122 115 111 32508 32509 003647'01 200 01 0 00 000006 move t1, q2 ; Load final requested device 32510 003650'01 104 00 0 00 000070 ASND% ; Assign it, so no possible login 32511 003651'01 320 12 0 00 003653' %jserr (,clscln) 32512 003652'01 254 00 0 00 003656' 32513 003653'01 265 01 0 00 003606* 32514 003654'01 000000000000# 32515 003655'01 254 00 0 00 003221' 32516 002124'04 103 157 165 154 144 32517 003656'01 350 00 0 00 003627* aos asgflg ; Flag we have a terminal assigned 32518 003657'01 202 01 0 00 003630* movem t1, asgdev ; Store global 32519 003660'01 202 01 0 00 000000# movem t1, ttydev ; Store as terminal device designator 32520 003661'01 200 02 0 00 000001 move t2, t1 ; Position for DEVST% 32521 32522 003662'01 350 00 0 00 000000# gttyjf: aos ttyflg ; At this point, commiting to the open 32523 003663'01 561 01 0 00 000000# hrroi t1,ttynam ; Point to area to write TTY specification 32524 003664'01 552 02 0 00 003523* hrrzm t2, ttynum ; Store as foreign terminal 32525 003665'01 104 00 0 00 000121 DEVST% ; Turn device into string 32526 003666'01 320 12 0 00 003670' %jserr (,deadev) 32527 003667'01 254 00 0 00 003673' 32528 003670'01 265 01 0 00 003653* 32529 003671'01 000000000000# 32530 003672'01 254 00 0 00 003616' 32531 002133'04 103 157 165 154 144 32532 003673'01 201 02 0 00 000072 movei t2,":" ; Load terminating device punctuation 32533 003674'01 136 02 0 00 000001 idpb t2,t1 ; Complete device syntax 32534 003675'01 400 02 0 00 000000 setz t2, ; Load .chnul k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-1 K20NET MAC 5-May-24 16:57 Open a physical line 32535 003676'01 136 02 0 00 000001 idpb t2,t1 ; Tie off the string 32536 32537 003677'01 402 00 0 00 003550* setzm netjfn ; No network JFN, yet 32538 dmove t1, [ gj%sht!gj%flg ; Want flags 32539 003700'01 120 01 0 00 006001' -1,,ttynam ] ; asipty built this for us 32540 003701'01 104 00 0 00 000020 GTJFN% ; Try to open it 32541 003702'01 320 12 0 00 003704' ifje. r ; Catch the error 32542 003703'01 254 00 0 00 003716' 32543 003704'01 200 04 0 00 000001 move t4, t1 ; Record for debugger 32544 003705'01 334 00 0 00 000000 %ermsg (,) ; Bizarre, we just got the device 32545 003706'01 254 00 0 00 003712' 32546 003707'01 265 01 0 00 003670* 32547 003710'01 000000000000# 32548 003711'01 254 00 0 00 003712' 32549 002142'04 103 141 156 047 164 32550 003712'01 200 01 0 00 000006 move t1, q2 ; Load assigned designator 32551 003713'01 260 17 0 00 003616' call deadev ; Go deasign the device 32552 003714'01 263 17 0 00 000000 ret ; Return failure 32553 003715'01 254 00 0 00 003721' else. ; Otherwise, worked 32554 003716'01 552 01 0 00 003677* hrrzm t1, netjfn ; Save as network JFN 32555 003717'01 512 01 0 00 003551* hllzm t1, netflg ; Ditto the flags (just in case) 32556 003720'01 200 11 0 00 000001 move q5, t1 ;[223] Save a copy for recovery 32557 003721'01 endif. ; End case JSYS failure 32558 32559 remark 8-bit bytes, image mode, read & write access. 32560 003721'01 200 02 0 00 006003' movx t2, fld(8,of%bsz)!fld(.gsimg,of%mod)!of%wr!of%rd 32561 003722'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags them so OPENF% doesn't choke 32562 003723'01 104 00 0 00 000021 OPENF% ; Open the device. 32563 003724'01 320 12 0 00 003726' ifje. r ; Catch the error 32564 003725'01 254 00 0 00 003736' 32565 003726'01 200 04 0 00 000001 move t4, t1 ; Record for debugger 32566 003727'01 334 00 0 00 000000 %ermsg (,) ; Bizarre, we just got the device 32567 003730'01 254 00 0 00 003734' 32568 003731'01 265 01 0 00 003707* 32569 003732'01 000000000000# 32570 003733'01 254 00 0 00 003734' 32571 002147'04 103 157 165 154 144 32572 003734'01 200 01 0 00 000003 move t1, t3 ; Load the JFN 32573 003735'01 254 00 0 00 003041' callret clsjfn ; Call JFN and device clean up and scrub 32574 003736'01 endif. ; End case JSYS failure 32575 32576 003736'01 200 01 0 00 000011 move t1, q5 ;[223] Load terminal JFN and flags 32577 003737'01 260 17 0 00 005115' call gndpar ;[223] Go find out about the parity 32578 003740'01 400 02 0 00 000000 setz t2, ;[223] Failed somehow, so no parity 32579 003741'01 606 02 0 00 000001 ifxn. t2, gd%par ;[223] Will it tolerate parity?? 32580 003742'01 254 00 0 00 003745' 32581 003743'01 476 00 0 00 000000# setom opnpar ;[223] It will 32582 003744'01 254 00 0 00 003746' else. ;[223] ...Otherwise... 32583 003745'01 402 00 0 00 000000# setzm opnpar ;[223] It won't 32584 003746'01 endif. ;[223] End case parity discovery 32585 32586 003746'01 550 01 0 00 000011 hrrz t1, q5 ;[223] Load just the JFN 32587 003747'01 550 04 0 00 000005 hrrz t4, q1 ; Load the unit number again 32588 003750'01 312 04 0 00 003625* came t4, mytty ; Is it us? 32589 003751'01 254 00 0 00 003754' ifskp. ; Yes, then don't do a few things k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-2 K20NET MAC 5-May-24 16:57 Open a physical line 32590 003752'01 402 00 0 00 003521* setzm local ; Mark us as remote 32591 003753'01 254 00 0 00 003764' else. ; Otherwise, we are going places 32592 003754'01 476 00 0 00 003752* setom local ; We're the local Kermit 32593 003755'01 201 02 0 00 000015 movei t2, .chcrt ; Send a CR down the line to get things going. 32594 003756'01 260 17 0 00 001736' call BOUTR% ; Get it going 32595 003757'01 334 00 0 00 000000 %ermsg (,r) ;[186] 32596 003760'01 254 00 0 00 003764' 32597 003761'01 265 01 0 00 003731* 32598 003762'01 000000000000# 32599 003763'01 254 00 0 00 003610* 32600 002154'04 106 151 162 163 164 32601 003764'01 endif. 32602 32603 remark t1, netjfn ;[223] Still has JFN 32604 003764'01 200 02 0 00 000006 move t2, q2 ; Load TTY device designator 32605 003765'01 201 03 0 00 000012 movei t3, .dvtty ; Opened a terminal 32606 003766'01 202 03 0 00 000000# movem t3, opndev ; Store opened device type 32607 003767'01 402 00 0 00 003614* setzm vtermf ; Clear the virtual terminal flag 32608 003770'01 254 00 0 00 003615* retskp ; Won!! 32609 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20NET MAC 5-May-24 16:57 Check the line whose JFN is in t1. 32610 subttl Check the line whose JFN is in t1. 32611 32612 ; Set flags MDMLIN if line is remote, CARIER if line has carrier up. 32613 ; SPEED is set to a nonnegative number if known, -1 otherwise. 32614 ; 32615 ; Returns +1 always, with t1 unchanged, t2-t4 modified. 32616 32617 003771'01 chklin: entry chklin ;[186] Identify location for LINK 32618 extern mdmlin,speed,carier ;[186] And of everyone's necessaries 32619 32620 003771'01 265 16 0 00 006004' saveac ; Save the JFN!!! 32621 32622 003772'01 402 00 0 00 002354* setzm mdmlin ;[186] Assume line not modem-controlled. 32623 003773'01 402 00 0 00 002357* setzm carier ;[186] And no carrier 32624 003774'01 476 00 0 00 000000* setom speed ;[186] Assume speed is unknown 32625 32626 003775'01 553 04 0 00 000001 hrrzs t4, t1 ;[186] Save the JFN, sans flags 32627 003776'01 306 01 0 00 377777 cain t1, .nulio ;[186] Wants to talk with nobody? 32628 003777'01 263 17 0 00 000000 ret ;[186] That's never online 32629 004000'01 260 17 0 00 004147' call chkljf ;[186] Check basic JFN health 32630 004001'01 263 17 0 00 000000 ret ;[186] It's sick, somehow 32631 32632 004002'01 200 01 0 00 000004 move t1, t4 ;[186] restore jfn's rightful place 32633 004003'01 104 00 0 00 000117 dvchr% ;[186] get the device characteristics 32634 004004'01 320 12 0 00 004006' ifje. r ;[186] failed?? 32635 004005'01 254 00 0 00 004014' 32636 004006'01 200 04 0 00 000001 move t4, t1 ;[186] retrieve and return error code 32637 004007'01 334 00 0 00 000000 %ermsg(,r) 32638 004010'01 254 00 0 00 004014' 32639 004011'01 265 01 0 00 003761* 32640 004012'01 000000000000# 32641 004013'01 254 00 0 00 003763* 32642 002162'04 165 156 141 142 154 32643 004014'01 endif. ;[186] get out of here, nothing further to do 32644 32645 004014'01 250 01 0 00 000004 exch t1, t4 ;[186] Get the JFN back, save device 32646 004015'01 135 03 0 00 005545' ldb t3,[pointr t2,dv%typ] ;[186] Pick up a device type 32647 32648 004016'01 306 03 0 00 000022 cain t3, .dvdcn ;[186] Is this an NRT? 32649 004017'01 254 00 0 00 004124' callret chkdcn ;[186] Then can't "Read Speed" 32650 004020'01 306 03 0 00 000013 cain t3, .dvpty ;[186] pseudo-terminal? 32651 004021'01 254 00 0 00 004136' callret chkpty ;[186] Can't check terminal through the PTY 32652 004022'01 306 03 0 00 000012 cain t3, .dvtty ;[186] A terminal?? 32653 004023'01 254 00 0 00 004031' callret chktty ;[186] Yes, go handle a physical line 32654 remark t3, .dvpip ;[186] A pipe? (a place holder) 32655 remark chkpip ;[186] Yes, go handle that 32656 ;[186] Otherwise, failure 32657 004024'01 334 01 0 00 000000# ermsg% (,r) 32658 004025'01 254 00 0 00 004031' 32659 004026'01 202 01 0 00 003644* 32660 004027'01 104 00 0 00 000313 32661 004030'01 254 00 0 00 004013* 32662 000225'03 000000000000# 32663 002173'04 113 105 122 115 111 32664 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53-1 K20NET MAC 5-May-24 16:57 Check the line whose JFN is in t1. 32665 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20NET MAC 5-May-24 16:57 Case of physical line (on a DH or DL) or controlling line 32666 subttl Case of physical line (on a DH or DL) or controlling line 32667 32668 004031'01 chktty: extern setspd, monv ;[186] Physical line additional necessaries 32669 004031'01 250 04 0 00 000001 exch t4, t1 ;[208] Save the JFN, restore device 32670 remark t1, JFN ;[186] Still has terminal JFN 32671 004032'01 260 17 0 00 004174' call ntidev ;[208] Find out about it 32672 004033'01 254 00 0 00 004037' ifskp. ;[208] Worked 32673 004034'01 265 16 0 00 005503' saveac ;[208] Save for getnti results 32674 004035'01 120 05 0 00 000001 dmove q1, t1 ;[208] So save the results 32675 004036'01 254 00 0 00 004044' else. ;[208] Otherwise gronked. Sad... 32676 004037'01 334 00 0 00 000000 %ermsg (,r) 32677 004040'01 254 00 0 00 004044' 32678 004041'01 265 01 0 00 004011* 32679 004042'01 000000000000# 32680 004043'01 254 00 0 00 004030* 32681 002211'04 125 156 141 142 154 32682 004044'01 endif. ;[208] 32683 32684 004044'01 415 16 0 00 004054' block. ;[208] Enter block context for better control flow 32685 004045'01 261 17 0 00 000016 32686 004046'01 302 05 0 00 000000 caie q1, nw%nnt ;[208] Not a network terminal? 32687 004047'01 263 17 0 00 000000 ret ;[208] It is a network tty, so this makes no sense 32688 004050'01 302 06 0 00 000001 caie q2, nw%fe ;[208] DL or DH? (front end terminal) 32689 004051'01 263 17 0 00 000000 ret ;[208] No, so these won't make sense 32690 004052'01 254 00 0 00 003770* retskp ;[208] Exit block, +2; physical line 32691 004053'01 263 17 0 00 000000 endbk. ;[208] End block. lexical context 32692 004054'01 254 00 0 00 004057' ifskp. ;[208] Real hardware!! 32693 004055'01 200 01 0 00 000004 move t1, t4 ;[208] Restore the original JFN 32694 004056'01 254 00 0 00 004060' else. ;[208] Otherwise, a 'soft' terminal 32695 remark carier ;[208] Go with chkljf's GTSTS% result 32696 004057'01 263 17 0 00 000000 ret ;[208] and done 32697 004060'01 endif. 32698 32699 004060'01 201 02 0 00 000027 movei t2, .morsp ; "Read Speed" 32700 004061'01 104 00 0 00 000077 MTOPR ; Flag bits are returned in LH(T2) 32701 004062'01 320 12 0 00 004064' ifje. r ;[186] Unless it FAILS 32702 004063'01 254 00 0 00 004072' 32703 004064'01 200 04 0 00 000001 move t4, t1 ;[186] Save the error, could be useful 32704 004065'01 334 00 0 00 000000 %ermsg(,r) 32705 004066'01 254 00 0 00 004072' 32706 004067'01 265 01 0 00 004041* 32707 004070'01 000000000000# 32708 004071'01 254 00 0 00 004043* 32709 002222'04 125 156 141 142 154 32710 004072'01 endif. ;[186] Don't try to process junk--leave 32711 32712 004072'01 573 00 0 00 000003 hrres t3 ; No split speed. 32713 004073'01 321 02 0 00 004100' ifxe. t2, mo%rmt ;[194] Is carrier valid? 32714 004074'01 202 03 0 00 003774* movem t3, speed ; No, it's local, so speed is valid. 32715 004075'01 476 00 0 00 003773* setom carier ; Say local always has carrier 32716 004076'01 263 17 0 00 000000 ret ; Don't have to worry about carrier. 32717 004077'01 254 00 0 00 004101' else. ;[194] Otherwise line is a real dial up 32718 004100'01 476 00 0 00 003772* setom mdmlin ; Yes, flag for SHOW LINE, etc. 32719 004101'01 endif. ;[194] 32720 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54-1 K20NET MAC 5-May-24 16:57 Case of physical line (on a DH or DL) or controlling line 32721 004101'01 332 00 0 00 000000* ifme. setspd ;[161] Was speed NOT explicitly SET for this line? 32722 004102'01 254 00 0 00 004112' 32723 004103'01 336 00 0 00 000000* ifmn. monv ;[194] TOPS-20 V6 or later? 32724 004104'01 254 00 0 00 004107' 32725 004105'01 202 03 0 00 004074* movem t3, speed ; Yes, so we can believe the speed. 32726 004106'01 254 00 0 00 004112' else. ;[194] Otherwise, some kind of geeser (or KS) 32727 004107'01 312 03 0 00 004105* came t3, speed ; Pre-V6. Does this agree with what was set? 32728 004110'01 474 03 0 00 000000 seto t3, ; No, so we don't really know the speed. 32729 004111'01 202 03 0 00 004107* movem t3, speed ; Save the speed or else -1 for don't know. 32730 004112'01 endif. ;[194] 32731 004112'01 endif. ;[194] 32732 32733 004112'01 403 02 0 00 004075* setzb t2, carier ; See if we have carrier. 32734 004113'01 104 00 0 00 000107 RFMOD ; Get mode word. 32735 004114'01 320 12 0 00 004116' %jserr(,r) ;[186] 32736 004115'01 254 00 0 00 004121' 32737 004116'01 265 01 0 00 004067* 32738 004117'01 000000000000# 32739 004120'01 254 00 0 00 004071* 32740 002230'04 125 156 141 142 154 32741 004121'01 602 02 0 00 000001 txne t2, tt%car ; Carrier? 32742 004122'01 476 00 0 00 004112* setom carier ; Yes. 32743 004123'01 263 17 0 00 000000 ret 32744 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20NET MAC 5-May-24 16:57 DECnet Network Remote Terminal Checking 32745 subttl DECnet Network Remote Terminal Checking 32746 32747 004124'01 chkdcn: remark t1, ; Has NRT JFN 32748 004124'01 201 02 0 00 000025 movx t2,.morls ; Function to read link status 32749 004125'01 104 00 0 00 000077 MTOPR% ; Do the status read 32750 004126'01 320 12 0 00 000541' erjmpr decerr ; Handle error, getting it in t1 32751 004127'01 325 03 0 00 004132' ifxn. t3,mo%con ; Connected? 32752 004130'01 476 00 0 00 004122* setom carier ; Yes, everything is still fine 32753 004131'01 254 00 0 00 004133' else. ; Otherwise, the party is OVER 32754 004132'01 402 00 0 00 004130* setzm carier ; So drop 'carrier' 32755 004133'01 endif. ; End case connection check 32756 004133'01 603 03 0 00 002000 txne t3,mo%int ; Any interrupt message goofyness? 32757 004134'01 260 17 0 00 001003' call intmsg ; Yes, handle this oddity 32758 004135'01 263 17 0 00 000000 ret ; Finally get out of here 32759 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56 K20NET MAC 5-May-24 16:57 Pseudo-terminal status, a bit different 32760 subttl Pseudo-terminal status, a bit different 32761 32762 004136'01 chkpty: remark ; Case of PTY: device 32763 32764 repeat 0,< ; Apparently, this isn't true 32765 ifxe. q1, gs%eof ; On a PTY:, EOF is an error condition 32766 setzm carier ; So 'drop' carrier 32767 ret ; and get out of here 32768 else. ; Otherwise, might still be good 32769 setom carier ; So assume OK, for the moment 32770 endif. ; End case GTSTS% analysis for PTY 32771 > 32772 004136'01 336 01 0 00 000000# skipn t1, ttygtb ; Load GETAB% table length and number 32773 004137'01 263 17 0 00 000000 ret ; Unless there is none... 32774 004140'01 504 01 0 00 000000# hrl t1, ptytty ; Load PTY's associated terminal line 32775 004141'01 621 01 0 00 400000 tlz t1, .ttdes ; Just in case (shouldn't be on) 32776 004142'01 104 00 0 00 000010 GETAB% ; Get associated job and 'hunger' 32777 004143'01 320 12 0 00 004120* erjmpr r ; Get and ignore error, returning 32778 004144'01 325 01 0 00 004143* jumpge t1, r ; Still connected? Just return 32779 32780 004145'01 402 00 0 00 004132* setzm carier ; No job there anymore, so 'drop' carrier 32781 004146'01 263 17 0 00 000000 ret ; And get out of here 32782 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20NET MAC 5-May-24 16:57 Check Line JFN 32783 subttl Check Line JFN 32784 32785 ; Call t1/ JFN 32786 ; 32787 ; +1 / JFN is unhealthy in some way 32788 ; +2 / JFN works and is not in error, q1 has GTSTS result 32789 ; 32790 ; Sets 'carier' accordingly 32791 32792 004147'01 265 16 0 00 006014' chkljf: saveac ; Basic JFN health 32793 32794 004150'01 104 00 0 00 000024 GTSTS% ; Get the status of whatever it is 32795 004151'01 320 12 0 00 004153' ifje. r ; Failed?? 32796 004152'01 254 00 0 00 004163' 32797 004153'01 200 04 0 00 000001 move t4, t1 ; Save code for debuggers 32798 004154'01 403 02 0 00 000005 setzb t2, q1 ; Assume we have no carrier. 32799 004155'01 334 00 0 00 000000 %ermsg(,r) 32800 004156'01 254 00 0 00 004162' 32801 004157'01 265 01 0 00 004116* 32802 004160'01 000000000000# 32803 004161'01 254 00 0 00 004144* 32804 002236'04 125 156 141 142 154 32805 004162'01 254 00 0 00 004164' else. ; Otherwise, worked 32806 004163'01 200 05 0 00 000002 move q1, t2 ; So save the JFN's status 32807 004164'01 endif. 32808 32809 004164'01 641 02 0 00 400200 txc t2, gs%nam!gs%opn ; Complement the required bits 32810 004165'01 643 02 0 00 400200 txce t2, gs%nam!gs%opn ; Is it any good at and is it open? 32811 004166'01 263 17 0 00 000000 ret ; No, then there is certainly no carrier 32812 004167'01 603 02 0 00 000400 txne t2,gs%err ; Any kind of error? 32813 004170'01 263 17 0 00 000000 ret ; Yes, we're done 32814 004171'01 476 00 0 00 004145* setom carier ; Groovy, let's say we have 'carrier' 32815 004172'01 254 00 0 00 004052* retskp ; Finally get out of here 32816 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20NET MAC 5-May-24 16:57 Get Network Terminal Information 32817 subttl Get Network Terminal Information 32818 32819 ; NTINF%, which was introduced in 6.0 series Tops-20 and is now known 32820 ; to work in 7.0 series PANDA monitor and XKL. I believe there are 32821 ; also standard patches to the DEC monitor to make it work. 32822 ; 32823 ; Wants a terminal designator in t1 32824 ; 32825 ; Question: does this break for a PIP: JFN? Should it? 32826 ; 32827 ; +1 t1/ Last error code 32828 ; +2 t1/ Line Network Type (zero if not network) 32829 ; t2/ Line Terminal type or protocol 32830 32831 chgsec(code,data) ;[271] Allocate some local storage 32832 000014 MXHL==^D12 ;[271] Max length of hostname in words (from TTYSRV) 32833 000000'05 ntihst:: block MXHL ;[271] Remote host (59 characters) 32834 000014'05 ntiblk:: block ntblen ;[210] ;[182] NTINF% block for TVT 32835 000024'05 000000 000000 tvtflg:: 0 ;[271] ;[194] ;[129] Set if we are on a TVT 32836 000025'05 000000 000001 tvtchk:: 1 ;[194] ;[182] TVT discovery (MUST BE AFTER tvtflg!) 32837 000026'05 000000 000000 tvtbin:: 0 ;[271] If not doing discovery, binary mode being forced 32838 000027'05 777777 777777 tvtunk:: -1 ;[271] If doing discovery, whether we know we can do binary 32839 retsec ;[271] Back to code 32840 32841 004173'01 getnti: entry getnti ;[194] Inform LINK of our location 32842 004173'01 660 01 0 00 400000 txo t1, .ttdes ;[186] Convert line to a device designator 32843 004174'01 ntidev: remark ;[208] Alternate entry if called with a device id 32844 004174'01 265 16 0 00 005550' saveac ;[271] Don't step on these, just in case 32845 32846 004175'01 200 04 0 00 000001 move t4, t1 ;[271] Let's save the calling argument for a moment 32847 004176'01 201 01 0 00 000023 movx t1, ;[271] Length of area to initialize 32848 004177'01 201 02 0 00 000000# movei t2, ntihst ;[271] Address of first location to zero 32849 004200'01 201 03 0 02 000001 movei t3, 1(t2) ;[271] Cascading said zero 32850 004201'01 402 00 0 02 000000 setzm (t2) ;[271] Whack the first location 32851 004202'01 123 01 0 00 006022' xblt. t1 ;[271] Whack the rest of them 32852 004203'01 320 12 0 00 004205' %jsErr (,r) ;[271] Maybe hit a guard page? 32853 004204'01 254 00 0 00 004210' 32854 004205'01 265 01 0 00 004157* 32855 004206'01 000000000000# 32856 004207'01 254 00 0 00 004161* 32857 002246'04 125 156 141 142 154 32858 004210'01 200 01 0 00 000004 move t1, t4 ;[271] Restore calling argument 32859 32860 004211'01 202 01 0 00 000000# movem t1 ,ntiblk+.NWLIN ;[182] Store requested terminal 32861 004212'01 120 01 0 00 006023' dmove t1,[exp ntblen,.NWRRH] ;[182] Requesting remote host information 32862 004213'01 124 01 0 00 000000# dmovem t1,ntiblk+.NWABC ;[182] Store length and request type 32863 004214'01 561 01 0 00 000000# hrroi t1, ntihst ;[186] Point to host area 32864 004215'01 202 01 0 00 000000# movem t1, ntiblk+.NWNNP ;[182] return remote host information 32865 32866 004216'01 201 01 0 00 000000# movei t1, ntiblk ;[182] Load the address of the argument block 32867 004217'01 104 00 0 00 000632 NTINF% ;[182] finally try to see out what's going on 32868 004220'01 320 12 0 00 004222' %jsErr (,r) ;[186] Phooey, return +1 32869 004221'01 254 00 0 00 004225' 32870 004222'01 265 01 0 00 004205* 32871 004223'01 000000000000# k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58-1 K20NET MAC 5-May-24 16:57 Get Network Terminal Information 32872 004224'01 254 00 0 00 004207* 32873 002255'04 116 124 111 116 106 32874 ;[182] Load network type and line type 32875 004225'01 135 01 0 00 006025' ldb t1,[POINTR(,nttype)] 32876 004226'01 135 02 0 00 006026' ldb t2,[POINTR(,ntline)] 32877 32878 004227'01 402 00 0 00 000000# setzm tvtflg ;[271] Assume not on a TVT 32879 004230'01 306 02 0 00 000004 cain t2, nw%tv ;[271] But!! On an Internet line?? 32880 004231'01 476 00 0 00 000000# setom tvtflg ;[271] Flag on a TVT 32881 004232'01 254 00 0 00 004172* retskp ;[186] Won! 32882 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20NET MAC 5-May-24 16:57 chktvt - check to see if we are using a TVT line 32883 subttl chktvt - check to see if we are using a TVT line 32884 32885 ; We use NTINF% (see above) when the user sets TVT-Binary mode to 32886 ; automatic which is an additional keyword (used to be just on or 32887 ; off). Automatic is the default, but we still allow overide. 32888 ; 32889 ; If the NTINF% fails, then we try recover by using STAT% to 32890 ; indentify whether the line is in the range of TVT's. This should 32891 ; work on any ARPAnet monitor with TCP support; MRC noted that the 32892 ; monitor "requires STAT% to be there" 32893 ; 32894 ; PANDA monitor verified to have 400000,,RSKP in NVTDOD (see [129]) 32895 ; 32896 ; Call: nothing passed 32897 ; 32898 ; Checks to see whether we are in automatic mode and if so, we 32899 ; execute the determination code in some form. Otherwise, we 32900 ; are in override mode and we skip any checks. 32901 ; 32902 ; Return: +1, always (although may complain about Jsyi errors) 32903 32904 004233'01 chktvt: entry chktvt ;[194] Inform LINK of our location 32905 004233'01 336 00 0 00 000000# skipn tvtchk ;[182] Are we supposed to figure out if TVT? 32906 004234'01 263 17 0 00 000000 ret ;[182] No, so skip all this cruft 32907 004235'01 332 00 0 00 003767* skipe vtermf ;[271] Are we on any kind of a virtual line 32908 004236'01 263 17 0 00 000000 ret ;[271] Yes, so skip this because we are TELNET 32909 32910 004237'01 265 16 0 00 005550' saveac ;[271] Save these, just in case 32911 004240'01 336 00 0 00 003754* ifmn. local ;[271] Are we local? 32912 004241'01 254 00 0 00 004302' 32913 004242'01 336 01 0 00 003716* skipn t1, netjfn ;[271] Do we have a network connection? 32914 004243'01 254 00 0 00 004302' anskp. ;[271] No, fall back to terminal 32915 004244'01 621 01 0 00 777777 tlz t1, -1 ;[271] Get rid of any funny flags 32916 004245'01 302 01 0 00 377777 caie t1, .nulio ;[271] A connection to nowhere? 32917 004246'01 254 00 0 00 004252' ifskp. ;[271] Should never happen, but... 32918 004247'01 402 00 0 00 000000# setzm tvtflg ;[271] Surely not a Telnet Virtual Terminal 32919 004250'01 403 01 0 00 000002 setzb t1, t2 ;[271] No network or line time 32920 004251'01 263 17 0 00 000000 ret ;[271] Just get out of here 32921 004252'01 endif. ;[271] Otherwise, some kind of JFN 32922 004252'01 104 00 0 00 000117 DVCHR% ;[271] Let's get the device characteristics 32923 004253'01 320 12 0 00 004255' %jsErr (,r) ;[271] 32924 004254'01 254 00 0 00 004260' 32925 004255'01 265 01 0 00 004222* 32926 004256'01 000000000000# 32927 004257'01 254 00 0 00 004224* 32928 002260'04 125 156 141 142 154 32929 004260'01 135 04 0 00 005545' ldb t4,[pointr t2,dv%typ] ;[271] Load the device type 32930 004261'01 302 04 0 00 000022 caie t4, .dvdcn ;[271] DECnet active component (NRT) 32931 004262'01 254 00 0 00 004266' ifskp. ;[271] Get out of here, never a TVT 32932 004263'01 402 00 0 00 000000# setzm tvtflg ;[271] Surely not a Telnet Virtual Terminal 32933 004264'01 403 01 0 00 000002 setzb t1, t2 ;[271] No network or line time 32934 004265'01 263 17 0 00 000000 ret ;[271] Just get out of here 32935 004266'01 endif. ;[271] Otherwise, some kind of JFN 32936 004266'01 302 04 0 00 000013 caie t4, .dvpty ;[271] Pseudo-terminal? 32937 004267'01 254 00 0 00 004272' ifskp. ;[271] Yes, transmogrify it k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59-1 K20NET MAC 5-May-24 16:57 chktvt - check to see if we are using a TVT line 32938 004270'01 550 01 0 00 000000# hrrz t1,ptytty ;[271] Load its terminal line 32939 004271'01 201 04 0 00 000012 movei t4, .dvtty ;[271] And say it's a terminal 32940 004272'01 endif. ;[271] Otherwise, something else 32941 004272'01 302 04 0 00 000012 caie t4, .dvtty ;[271] Better be a terminal! 32942 004273'01 334 00 0 00 000000 %erMsg(,r) ;[271] Shouldn't get here 32943 004274'01 254 00 0 00 004300' 32944 004275'01 265 01 0 00 004255* 32945 004276'01 000000000000# 32946 004277'01 254 00 0 00 004257* 32947 002271'04 103 157 156 156 145 32948 004300'01 621 01 0 00 777777 tlz t1, -1 ;[271] Shut off any device baloney 32949 004301'01 254 00 0 00 004303' else. ;[271] Otherwise in remote mode 32950 004302'01 550 01 0 00 003664* hrrz t1, ttynum ;[271] Otherwise, so use our controlling terminal 32951 004303'01 endif. ;[271] Either way, should have device 32952 32953 004303'01 200 04 0 00 000001 move t4, t1 ;[271] Save that, just in case for bbntvt 32954 004304'01 660 01 0 00 400000 txo t1, .ttdes ;[271] Convert terminal line to a device designator 32955 004305'01 260 17 0 00 004174' call ntidev ;[271] Get network terminal information 32956 004306'01 254 00 0 00 004310' callret bbntvt ;[186] Try it the old fashioned way 32957 remark tvtflg ;[271] getnti already set this 32958 004307'01 263 17 0 00 000000 ret ;[182] 32959 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 60 K20NET MAC 5-May-24 16:57 Check for TVT line using BBN interface 32960 subttl Check for TVT line using BBN interface 32961 32962 ; The following code is normally not used because a BBN TCP jsys is 32963 ; called. It is fall-back because NTINF% is preferred. However, it 32964 ; should always work, no matter the monitor version as STAT% is 32965 ; required to be there (as per MRC) 32966 ; 32967 ; [129] Largely adapted from MODEM.MAC ;[271] And much modified 32968 ; 32969 ; [271] t4 is expected to have a line number 32970 32971 004310'01 402 00 0 00 000000# bbntvt: setzm tvtflg ;[271] Assume not on a TVT 32972 004311'01 205 01 0 00 000040 movx t1, tcp%nt ;[129] Want aobjn ptr for tvts 32973 004312'01 104 00 0 00 000745 STAT% ;[129] Get it 32974 004313'01 320 12 0 00 004315' %jserr (,r) ;[182] Just give up 32975 004314'01 254 00 0 00 004320' 32976 004315'01 265 01 0 00 004275* 32977 004316'01 000000000000# 32978 004317'01 254 00 0 00 004277* 32979 002277'04 123 124 101 124 040 32980 004320'01 550 01 0 00 000002 hrrz t1, t2 ;[129] Get first TVT 32981 004321'01 315 04 0 00 000001 camge t4, t1 ;[129] Are we less than the firsT? 32982 004322'01 263 17 0 00 000000 ret ;[182] Yes, so out of range 32983 004323'01 577 00 0 00 000002 hlres t2 ;[129] Calculate last TVT 32984 004324'01 274 01 0 00 000002 sub t1, t2 ;[129] ... 32985 004325'01 275 01 0 00 000001 subi t1, 1 ;[129] ... 32986 004326'01 317 04 0 00 000001 camg t4, t1 ;[129] Are we .le. last TVT? 32987 004327'01 476 00 0 00 000000# setom tvtflg ;[271] So in range, flag that 32988 004330'01 263 17 0 00 000000 ret ;[182] 32989 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61 K20NET MAC 5-May-24 16:57 Line routines 32990 subttl Line routines 32991 32992 ;[190] all moved from K20MIT to reduce its size 32993 32994 ; INILIN -- Initialize the communication line for file transfer. 32995 ; 32996 004331'01 inilin: entry inilin ;[220] Used in k20srv, too 32997 004331'01 332 00 0 00 000000# skipe inited ;[177] Already init'd? Don't do it again. 32998 004332'01 263 17 0 00 000000 ret ;[177] 32999 33000 ; Set all the terminal mode bits for transparent i/o. 33001 33002 004333'01 332 00 0 00 004235* inil2: ifme. vtermf ;[186] Physical line? 33003 004334'01 254 00 0 00 004340' 33004 004335'01 260 17 0 00 004344' call dobits ; Go do the bits. 33005 004336'01 263 17 0 00 000000 ret ; Pass along any failures. 33006 004337'01 260 17 0 00 004620' call doarpa ; Set up any Arpanet stuff. 33007 004340'01 endif. 33008 33009 004340'01 260 17 0 00 002420' call clrbuf ;[194] Clear any NAK's 33010 004341'01 600 00 0 00 000000 nop ;[186] Ignore any errors 33011 004342'01 476 00 0 00 000000# setom inited ;[177] Flag we've done this. 33012 004343'01 263 17 0 00 000000 ret k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62 K20NET MAC 5-May-24 16:57 Line routines 33013 33014 ; Set communication line bits for transparent i/o. 33015 ; Returns +1 on failure, +2 on success. 33016 33017 004344'01 dobits: entry dobits ;Used by k20ioc 33018 004344'01 265 16 0 00 005450' saveac ;[186] Used for device designator 33019 004345'01 332 05 0 00 004242* skipe q1, netjfn ;[186] Load the network JFN 33020 004346'01 254 00 0 00 004363' ifskp. ;[186] Unless we don't have one... 33021 004347'01 332 00 0 00 004240* skipe local ;[186] Are we remote? 33022 004350'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33023 004351'01 254 00 0 00 004355' 33024 004352'01 202 01 0 00 004026* 33025 004353'01 104 00 0 00 000313 33026 004354'01 254 00 0 00 004317* 33027 000226'03 000000000000# 33028 002302'04 113 105 122 115 111 33029 33030 004355'01 336 05 0 00 002774* skipn q1, ttyjfn ;[186] Yes, so just use the terminal JFN 33031 004356'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33032 004357'01 254 00 0 00 004363' 33033 004360'01 202 01 0 00 004352* 33034 004361'01 104 00 0 00 000313 33035 004362'01 254 00 0 00 004354* 33036 000227'03 000000000000# 33037 002316'04 113 105 122 115 111 33038 33039 004363'01 endif. ;[186] Hopefully have SOMETHING ... 33040 33041 004363'01 200 01 0 00 000005 move t1, q1 ;[186] ; JFN for connection to other system. 33042 004364'01 201 02 0 00 000035 movx t2, .mornt ; Read system message status. 33043 004365'01 104 00 0 00 000077 MTOPR 33044 004366'01 320 12 0 00 004370' %jserr (,dobit2) 33045 004367'01 254 00 0 00 004373' 33046 004370'01 265 01 0 00 004315* 33047 004371'01 000000 000000 33048 004372'01 254 00 0 00 004404' 33049 004373'01 202 03 0 00 000000# movem t3, sysmsg ; Save here for later restoral. 33050 004374'01 201 02 0 00 000034 movx t2, .mosnt ; Now refuse system messages. 33051 004375'01 201 03 0 00 000001 movx t3, .mosmn 33052 004376'01 104 00 0 00 000077 MTOPR 33053 004377'01 320 12 0 00 004401' %jserr (,dobit2) 33054 004400'01 254 00 0 00 004404' 33055 004401'01 265 01 0 00 004370* 33056 004402'01 000000 000000 33057 004403'01 254 00 0 00 004404' 33058 33059 004404'01 205 01 0 00 624000 dobit2: movx t1, ;[147] Clear/Refuse links, 33060 004405'01 540 01 0 00 004302* hrr t1, ttynum ;[147] on the line used for file transfer. 33061 004406'01 660 01 0 00 400000 txo t1, .ttdes ;[147] (TLINK wants a device designator.) 33062 004407'01 474 02 0 00 000000 seto t2, 33063 004410'01 104 00 0 00 000216 TLINK 33064 004411'01 320 16 0 00 004412' erjmp dobit3 ;[147] Ignore any failure. 33065 33066 004412'01 200 01 0 00 000005 dobit3: move t1, q1 ;[186] ; JFN for the file transfer line. 33067 004413'01 201 02 0 00 000044 movei t2, .morxo ; Get terminal pause end-of-page status. k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62-1 K20NET MAC 5-May-24 16:57 Line routines 33068 004414'01 104 00 0 00 000077 MTOPR% 33069 004415'01 320 12 0 00 004417' %jserr (,r) 33070 004416'01 254 00 0 00 004422' 33071 004417'01 265 01 0 00 004401* 33072 004420'01 000000 000000 33073 004421'01 254 00 0 00 004362* 33074 004422'01 202 03 0 00 000000# movem t3, oldpau ; Save the old pause mode. 33075 004423'01 201 02 0 00 000043 movei t2, .moxof ; Now set to... 33076 004424'01 201 03 0 00 000000 movei t3, .mooff ; no pause on end. 33077 004425'01 104 00 0 00 000077 MTOPR% 33078 004426'01 320 12 0 00 004430' %jserr (,r) 33079 004427'01 254 00 0 00 004433' 33080 004430'01 265 01 0 00 004417* 33081 004431'01 000000 000000 33082 004432'01 254 00 0 00 004421* 33083 004433'01 201 02 0 00 000000# movei t2, olddim ;[185] Point to line block 33084 004434'01 260 17 0 00 000000* call savlnw ;[185] Save this JFN's length and width 33085 004435'01 104 00 0 00 000107 RFMOD% ; Get current mode for this line. 33086 004436'01 320 12 0 00 004440' %jserr (,r) 33087 004437'01 254 00 0 00 004443' 33088 004440'01 265 01 0 00 004430* 33089 004441'01 000000 000000 33090 004442'01 254 00 0 00 004432* 33091 004443'01 476 00 0 00 004171* setom carier 33092 004444'01 402 00 0 00 004100* setzm mdmlin ;[130] Assume line not modem-controlled. 33093 004445'01 602 02 0 00 000001 txne t2, tt%car ;[130] Is it? 33094 004446'01 476 00 0 00 004444* setom mdmlin ;[130] Yes, flag. 33095 004447'01 202 02 0 00 000000# movem t2, oldmod ; Save the present mode. 33096 33097 ;[97] Turn off undesired bits (program echoing, links, translation). 33098 ;[97] Turn on desired bits (full duplex; TTY has form feed, tab, lowercase). 33099 ;[97] Note that any other settings are left intact, in particular TT%ECM, which 33100 ;[97] can cause a TAC to do its own echoing if turned off. 33101 33102 004450'01 dobit4: ; No echo, no links, no advice, no data mode, full duplex. 33103 004450'01 620 02 0 00 005734 txz t2, ;[129] Add TT$DUM 33104 ; No wakeup stuff, infinite width & length. 33105 004451'01 630 02 0 00 006027' txz t2, ;[127] 33106 ; No formfeed/tab/case interpretation, use XON/XOFF. 33107 004452'01 670 02 0 00 006030' txo t2, ;[129] REMOVE TT%DUM!!! 33108 33109 004453'01 336 00 0 00 000000* skipn handsh ;[155] Doing handshake? 33110 004454'01 336 00 0 00 003530* skipn flow ;[155] Doing flow control? 33111 004455'01 620 02 0 00 000002 txz t2, tt%pgm ; Handshake, or no flow - don't do XON/XOFF. 33112 004456'01 104 00 0 00 000110 SFMOD% ; Set the bits. 33113 004457'01 320 12 0 00 004461' %jserr (,) 33114 004460'01 254 00 0 00 004464' 33115 004461'01 265 01 0 00 004440* 33116 004462'01 000000 000000 33117 004463'01 254 00 0 00 004464' 33118 004464'01 104 00 0 00 000217 STPAR% 33119 004465'01 320 12 0 00 004467' %jserr (,) 33120 004466'01 254 00 0 00 004472' 33121 004467'01 265 01 0 00 004461* 33122 004470'01 000000 000000 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62-2 K20NET MAC 5-May-24 16:57 Line routines 33123 004471'01 254 00 0 00 004472' 33124 004472'01 254 00 0 00 004232* retskp k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63 K20NET MAC 5-May-24 16:57 Line routines 33125 33126 ;[181] PANDA Network Binary Mode routines 33127 33128 panda < ;[181] Only if doing Panda 33129 33130 ;[181] Returns true if we have network binary mode MTOPR% 33131 ;[181] Preserves ACs, always returns +1, havnbm: is side-effected 33132 33133 004473'01 chknbm: entry chknbm ;[190] 33134 004473'01 265 16 0 00 006031' saveac ;[181] Save the registers that MTOPR% trashes 33135 004474'01 120 01 0 00 006043' dmove t1,[ exp .CTTRM,.MORLT ] ;[181] Read local status 33136 004475'01 104 00 0 00 000077 MTOPR% ;[181] Can the monitor process this request? 33137 004476'01 320 12 0 00 004500' ifje. r ;[194] No, assume this isn't in the monitor 33138 004477'01 254 00 0 00 004503' 33139 004500'01 402 00 0 00 000000# setzm havnbm ;[181] so don't try to use it 33140 004501'01 402 00 0 00 000000# setzm setlts ;[181] and never try to restore status 33141 004502'01 254 00 0 00 004504' else. ;[194] 33142 004503'01 476 00 0 00 000000# setom havnbm ;[181] Otherwise, we have winning 33143 004504'01 endif. ;[194] 33144 004504'01 263 17 0 00 000000 ret ;[181] Panda Network Binary Mode! 33145 33146 ;[181] Sets network binary mode 33147 ;[181] Assumes it can stomp acumulators t1 through t3 33148 ;[181] Returns to doarpa's caller on success 33149 ;[181] on failure, assumes we don't have network binary mode, 33150 ;[181] clears the flag and tries it the old way 33151 33152 004505'01 332 00 0 00 000000# setnbm: skipe setlts ;[181] Did we already sucessfully set this? 33153 004506'01 263 17 0 00 000000 ret ;[181] Yes, why bother doing it twice? 33154 33155 004507'01 332 01 0 00 004345* skipe t1, netjfn ;[186] Load the network JFN 33156 004510'01 254 00 0 00 004525' ifskp. ;[186] Unless we don't have one... 33157 004511'01 332 00 0 00 004347* skipe local ;[186] Are we remote? 33158 004512'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33159 004513'01 254 00 0 00 004517' 33160 004514'01 202 01 0 00 004360* 33161 004515'01 104 00 0 00 000313 33162 004516'01 254 00 0 00 004442* 33163 000230'03 000000000000# 33164 002333'04 113 105 122 115 111 33165 33166 004517'01 336 01 0 00 004355* skipn t1, ttyjfn ;[186] Yes, so just use the terminal JFN 33167 004520'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33168 004521'01 254 00 0 00 004525' 33169 004522'01 202 01 0 00 004514* 33170 004523'01 104 00 0 00 000313 33171 004524'01 254 00 0 00 004516* 33172 000231'03 000000000000# 33173 002347'04 113 105 122 115 111 33174 33175 004525'01 endif. ;[186] Hopefully have SOMETHING ... 33176 33177 004525'01 336 00 0 00 000000# ifmn. tvtchk ;[271] Doing automatic? 33178 004526'01 254 00 0 00 004532' 33179 004527'01 476 00 0 00 000000# setom tvtunk ;[271] Yes, let's assume we don't know k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63-1 K20NET MAC 5-May-24 16:57 Line routines 33180 004530'01 402 00 0 00 000000# setzm tvtbin ;[271] And that we can't do it 33181 004531'01 254 00 0 00 004534' else. ;[271] Otherwise, not automatic 33182 004532'01 336 00 0 00 000000# skipn tvtbin ;[271] So, forcing binary? 33183 004533'01 254 00 0 00 004707' jrst noarpx ;[271] No, go complain about it 33184 004534'01 endif. ;[271] End case automatic or forcing 33185 33186 004534'01 201 02 0 00 400001 movx t2,.MORLT ;[181] Read local status 33187 004535'01 104 00 0 00 000077 MTOPR% 33188 004536'01 320 16 0 00 004560' erjmp nbmerr 33189 004537'01 202 03 0 00 000000# movem t3,OLDLTS ;[181] save old terminal status 33190 004540'01 660 03 0 00 000006 txo t3,MO%NBI!MO%NBO ;[181] network binary mode (input AND output) 33191 004541'01 201 02 0 00 400002 movx t2,.MOSLT ;[181] want to set it 33192 004542'01 104 00 0 00 000077 MTOPR% 33193 004543'01 320 16 0 00 004560' erjmp nbmerr 33194 004544'01 201 02 0 00 400001 movx t2,.MORLT ;[181] now see what actually happened 33195 004545'01 104 00 0 00 000077 MTOPR% 33196 004546'01 320 16 0 00 004560' erjmp nbmerr 33197 004547'01 640 03 0 00 000006 xorx t3,MO%NBI!MO%NBO ;[181] flip binary mode status 33198 004550'01 602 03 0 00 000006 txne t3,MO%NBI!MO%NBO ;[181] they should have been BOTH set ... 33199 004551'01 254 00 0 00 004560' jrst nbmerr 33200 004552'01 350 00 0 00 000000# aos setlts ;[181] flag that we set terminal line status 33201 33202 004553'01 336 00 0 00 000000# ifmn. tvtchk ;[271] Doing automatic? 33203 004554'01 254 00 0 00 004557' 33204 004555'01 402 00 0 00 000000# setzm tvtunk ;[271] So know we know that 33205 004556'01 476 00 0 00 000000# setom tvtbin ;[271] we can do binary 33206 004557'01 endif. ;[271] Otherwise, don't update forced settings 33207 33208 004557'01 263 17 0 00 000000 ret 33209 33210 004560'01 402 00 0 00 000000# nbmerr: setzm havnbm ;[181] We don't have network binary mode 33211 004561'01 254 00 0 00 004620' callret doarpa ;[181] Maybe the olde fashioned way works? 33212 33213 33214 ;[181] un-Sets network binary mode 33215 ;[181] Assumes it can stomp acumulators t1 through t3 33216 ;[181] Returns to unarpa's caller on success 33217 ;[181] on failure, assumes we don't have network binary mode, 33218 ;[181] clears the flag and tries it the old way 33219 33220 004562'01 400 01 0 00 000000 unsnbm: setz t1, ;[181] whatever the current state is, 33221 004563'01 250 01 0 00 000000# exch t1,setlts ;[181] say that it is no longer set 33222 004564'01 322 01 0 00 004524* jumpe t1,r ;[181] However: did we ever set nbm?? 33223 33224 004565'01 332 01 0 00 004507* skipe t1, netjfn ;[186] Load the network JFN 33225 004566'01 254 00 0 00 004603' ifskp. ;[186] Unless we don't have one... 33226 004567'01 332 00 0 00 004511* skipe local ;[186] Are we remote? 33227 004570'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33228 004571'01 254 00 0 00 004575' 33229 004572'01 202 01 0 00 004522* 33230 004573'01 104 00 0 00 000313 33231 004574'01 254 00 0 00 004564* 33232 000232'03 000000000000# 33233 002364'04 113 105 122 115 111 33234 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63-2 K20NET MAC 5-May-24 16:57 Line routines 33235 004575'01 336 01 0 00 004517* skipn t1, ttyjfn ;[186] Yes, so just use the terminal JFN 33236 004576'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33237 004577'01 254 00 0 00 004603' 33238 004600'01 202 01 0 00 004572* 33239 004601'01 104 00 0 00 000313 33240 004602'01 254 00 0 00 004574* 33241 000233'03 000000000000# 33242 002400'04 113 105 122 115 111 33243 33244 004603'01 endif. ;[186] Hopefully have SOMETHING ... 33245 33246 004603'01 332 00 0 00 000000# ifme. tvtchk ;[271] Not doing automatic? 33247 004604'01 254 00 0 00 004610' 33248 004605'01 332 00 0 00 000000# skipe tvtbin ;[271] No, so not forcing binary? 33249 004606'01 254 00 0 00 004610' anskp. ;[271] We are, so shut it off 33250 004607'01 263 17 0 00 000000 ret ;[271] Otherwise, don't do anything 33251 004610'01 endif. ;[271] Otherwise, don't update forced settings 33252 33253 004610'01 201 02 0 00 400002 movx t2,.MOSLT ;[181] Read local status 33254 004611'01 200 03 0 00 000000# move t3,OLDLTS ;[181] get former status 33255 004612'01 104 00 0 00 000077 MTOPR% ;[181] try to restore it 33256 004613'01 320 12 0 00 004615' ifje. r ;[194] Failed, don't use this any longer 33257 004614'01 254 00 0 00 004617' 33258 004615'01 402 00 0 00 000000# setzm havnbm ;[181] How could this have failed? 33259 004616'01 254 00 0 00 005034' callret unarpa ;[196] Get out of here and turn some more 33260 004617'01 endif. ;[196] things off 33261 004617'01 263 17 0 00 000000 ret 33262 33263 > ;[181] End Panda conditional 33264 ;[129] Do any required ARPAnet stuff. 33265 ; 33266 ; Important Note: The ability to send binary mode telnet negotiations 33267 ; depends on the monitor NOT doubling IACs on TVT lines. Some versions of 33268 ; TOPS-20 (particularly BBN's TCP monitor) will do this. 33269 ; 33270 ;[181] Use SOUTR% instead of SOUT% to ensure that 33271 ;[181] we flush the data to the TAC 33272 ; 33273 ; Returns +1 always, but prints warning on failure. 33274 ; 33275 004620'01 doarpa: entry doarpa ;[190] 33276 004620'01 336 00 0 00 000000# skipn tvtflg ; Are we on tvt? 33277 004621'01 263 17 0 00 000000 ret 33278 33279 004622'01 332 00 0 00 000000# panda < skipe havnbm ;[181] Does the monitor support network 33280 004623'01 254 00 0 00 004505' callret setnbm > ;[181] binary mode? 33281 33282 remark ;[271] Doesn't, so have to do it ourselves 33283 004624'01 265 16 0 00 005450' saveac ;[186] Used for device designator 33284 004625'01 332 05 0 00 004565* skipe q1, netjfn ;[186] Load the network JFN 33285 004626'01 254 00 0 00 004643' ifskp. ;[186] Unless we don't have one... 33286 004627'01 332 00 0 00 004567* skipe local ;[186] Are we remote? 33287 004630'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33288 004631'01 254 00 0 00 004635' 33289 004632'01 202 01 0 00 004600* k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63-3 K20NET MAC 5-May-24 16:57 Line routines 33290 004633'01 104 00 0 00 000313 33291 004634'01 254 00 0 00 004602* 33292 000234'03 000000000000# 33293 002415'04 113 105 122 115 111 33294 33295 004635'01 336 05 0 00 004575* skipn q1, ttyjfn ;[186] Yes, so just use the terminal JFN 33296 004636'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33297 004637'01 254 00 0 00 004643' 33298 004640'01 202 01 0 00 004632* 33299 004641'01 104 00 0 00 000313 33300 004642'01 254 00 0 00 004634* 33301 000235'03 000000000000# 33302 002431'04 113 105 122 115 111 33303 33304 004643'01 endif. ;[186] Hopefully have SOMETHING ... 33305 33306 004643'01 336 00 0 00 000000# ifmn. tvtchk ;[271] Doing automatic? 33307 004644'01 254 00 0 00 004650' 33308 004645'01 476 00 0 00 000000# setom tvtunk ;[271] Yes, let's assume we don't know 33309 004646'01 402 00 0 00 000000# setzm tvtbin ;[271] And that we can't do it 33310 004647'01 254 00 0 00 004652' else. ;[271] Otherwise, not automatic 33311 004650'01 336 00 0 00 000000# skipn tvtbin ;[271] So, forcing binary? 33312 004651'01 254 00 0 00 004707' jrst noarpx ;[271] No, go complain about it 33313 004652'01 endif. ;[271] End case automatic or forcing 33314 33315 004652'01 200 01 0 00 000005 move t1, q1 ;[186] ; Yes, talk binary. 33316 004653'01 120 02 0 00 006046' dmove t2,[exp ,-3] 33317 004654'01 104 00 0 00 000532 SOUTR% ;[181] This code adapted from MODEM.MAC 33318 004655'01 320 12 0 00 004657' %jserr(,doarpx) 33319 004656'01 254 00 0 00 004662' 33320 004657'01 265 01 0 00 004467* 33321 004660'01 000000 000000 33322 004661'01 254 00 0 00 004703' 33323 004662'01 201 01 0 00 007640 movei t1,^d4000 ; Sleep four seconds. 33324 004663'01 104 00 0 00 000167 DISMS% 33325 004664'01 200 01 0 00 000005 move t1, q1 ;[186] Tell TVT "do binary". 33326 004665'01 120 02 0 00 006051' dmove t2,[exp ,-3] 33327 004666'01 104 00 0 00 000532 SOUTR% 33328 004667'01 320 12 0 00 004671' %jserr(,doarpx) 33329 004670'01 254 00 0 00 004674' 33330 004671'01 265 01 0 00 004657* 33331 004672'01 000000 000000 33332 004673'01 254 00 0 00 004703' 33333 004674'01 201 01 0 00 007640 movei t1,^d4000 33334 004675'01 104 00 0 00 000167 DISMS 33335 33336 004676'01 336 00 0 00 000000# ifmn. tvtchk ;[271] Doing automatic? 33337 004677'01 254 00 0 00 004702' 33338 004700'01 402 00 0 00 000000# setzm tvtunk ;[271] So know we know that 33339 004701'01 476 00 0 00 000000# setom tvtbin ;[271] we can do binary 33340 004702'01 endif. ;[271] Otherwise, don't update forced settings 33341 33342 004702'01 263 17 0 00 000000 ret 33343 33344 doarpx: txmsg < k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63-4 K20NET MAC 5-May-24 16:57 Line routines 33345 %KERMIT-20: Warning -- Can't negotiate binary mode with TAC 33346 004703'01 200 01 0 00 000000# > 33347 004704'01 104 00 0 00 000076 33348 004705'01 320 12 0 00 004706' 33349 000236'03 000000000000# 33350 002446'04 015 012 045 113 105 33351 33352 004706'01 263 17 0 00 000000 ret ;[271] 33353 noarpx: txmsg < 33354 %KERMIT-20: Warning -- Will not negotiate binary mode with TAC 33355 004707'01 200 01 0 00 000000# > ;[271] They need to know about this... 33356 004710'01 104 00 0 00 000076 33357 004711'01 320 12 0 00 004712' 33358 000237'03 000000000000# 33359 002463'04 015 012 045 113 105 33360 33361 004712'01 263 17 0 00 000000 ret ;[271] And get out of here k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 64 K20NET MAC 5-May-24 16:57 Line routines 33362 33363 ; RESLIN -- Reset/Restore the communications line. 33364 ; 33365 ; Restore old terminal modes, links, length & width, etc. 33366 ; Turn off control-C trap. 33367 ; 33368 ; CALL RESLIN does nothing if server. 33369 ; CALL RRSLIN restores the line even if server. 33370 33371 extern filjfn ;[190] 33372 33373 004713'01 reslin: entry reslin ;[190] 33374 004713'01 332 00 0 00 000000* skipe srvflg ; Server? 33375 004714'01 263 17 0 00 000000 ret ; Yes, forget it. 33376 33377 004715'01 rrslin: entry rrslin ;[220] Used by k20srv 33378 004715'01 260 17 0 00 000445* call ccoff2 ; REALLY reset the line. 33379 004716'01 rrsl2: entry rrsl2 ;[220] Used by k20srv 33380 004716'01 337 01 0 00 000000* skipg t1, filjfn ; Were we doing something with a file? 33381 004717'01 254 00 0 00 004725' ifskp. ;[194] Maybe so 33382 004720'01 621 01 0 00 777777 tlz t1, -1 ;[193] Just carefully toss any flags 33383 004721'01 306 01 0 00 377777 cain t1, .nulio ;[193] Not needed for NUL: 33384 004722'01 254 00 0 00 004725' anskp. ;[193] So bum the CLOSF 33385 004723'01 104 00 0 00 000022 CLOSF 33386 004724'01 320 12 0 00 004725' erjmpr .+1 ;[193] Catch and ignore error 33387 004725'01 endif. ;[194] 33388 004725'01 402 00 0 00 004716* setzm filjfn ;[194] Either way, no file 33389 33390 004726'01 332 00 0 00 004333* ifme. vtermf ;[186] Physical line? 33391 004727'01 254 00 0 00 004733' 33392 004730'01 260 17 0 00 005034' call unarpa ; Undo Arpanet TAC binary mode. 33393 004731'01 260 17 0 00 004737' call unbits ; Restore terminal bits. 33394 004732'01 260 17 0 00 002761' call ttxon ; Clear up any XOFF condition. 33395 004733'01 endif. ;[186] 33396 33397 004733'01 260 17 0 00 002420' call clrbuf ;[194] Clear terminal buffers 33398 004734'01 600 00 0 00 000000 nop ;[186] Ignore any failure 33399 004735'01 402 00 0 00 000000# setzm inited ;[177] Flag we're back to normal. 33400 004736'01 263 17 0 00 000000 ret k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65 K20NET MAC 5-May-24 16:57 Line routines 33401 33402 ; Undo the effect of DOBITS -- restore all the communication line's 33403 ; old bits & modes. 33404 ; 33405 004737'01 unbits: entry unbits ;Used by K20IOC 33406 004737'01 265 16 0 00 005450' saveac ;[186] Used for device designator 33407 004740'01 332 05 0 00 004625* skipe q1, netjfn ;[186] Load the network JFN 33408 004741'01 254 00 0 00 004756' ifskp. ;[186] Unless we don't have one... 33409 004742'01 332 00 0 00 004627* skipe local ;[186] Are we remote? 33410 004743'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33411 004744'01 254 00 0 00 004750' 33412 004745'01 202 01 0 00 004640* 33413 004746'01 104 00 0 00 000313 33414 004747'01 254 00 0 00 004642* 33415 000240'03 000000000000# 33416 002501'04 113 105 122 115 111 33417 33418 004750'01 336 05 0 00 004635* skipn q1, ttyjfn ;[186] Yes, so just use the terminal JFN 33419 004751'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33420 004752'01 254 00 0 00 004756' 33421 004753'01 202 01 0 00 004745* 33422 004754'01 104 00 0 00 000313 33423 004755'01 254 00 0 00 004747* 33424 000241'03 000000000000# 33425 002515'04 113 105 122 115 111 33426 33427 004756'01 endif. ;[186] Hopefully have SOMETHING ... 33428 33429 004756'01 200 01 0 00 000005 move t1, q1 ;[186] ; Get the line. 33430 004757'01 201 02 0 00 000043 movei t2, .moxof ; Set the terminal pause on end mode... 33431 004760'01 200 03 0 00 000000# move t3, oldpau ; to what it was before. 33432 004761'01 104 00 0 00 000077 MTOPR% 33433 004762'01 320 12 0 00 004764' %jserr (,) 33434 004763'01 254 00 0 00 004767' 33435 004764'01 265 01 0 00 004671* 33436 004765'01 000000 000000 33437 004766'01 254 00 0 00 004767' 33438 004767'01 200 01 0 00 000005 move t1, q1 ;[186] ; Communication line JFN. 33439 004770'01 200 02 0 00 000000# move t2, oldmod ; Get the previous mode. 33440 004771'01 104 00 0 00 000110 SFMOD% 33441 004772'01 320 12 0 00 004774' %jserr (,) 33442 004773'01 254 00 0 00 004777' 33443 004774'01 265 01 0 00 004764* 33444 004775'01 000000 000000 33445 004776'01 254 00 0 00 004777' 33446 004777'01 104 00 0 00 000217 STPAR% 33447 005000'01 320 12 0 00 005002' %jserr (,) 33448 005001'01 254 00 0 00 005005' 33449 005002'01 265 01 0 00 004774* 33450 005003'01 000000 000000 33451 005004'01 254 00 0 00 005005' 33452 005005'01 201 02 0 00 000000# movei t2, olddim ;[185] Point to this JFN's dimensions 33453 005006'01 260 17 0 00 000000* call rstlnw ;[185] Restore length and width 33454 005007'01 201 02 0 00 000034 movx t2, .mosnt ; Restore system msg refuse/accept. 33455 005010'01 200 03 0 00 000000# move t3, sysmsg k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65-1 K20NET MAC 5-May-24 16:57 Line routines 33456 005011'01 104 00 0 00 000077 MTOPR 33457 005012'01 320 12 0 00 005014' %jserr (,) 33458 005013'01 254 00 0 00 005017' 33459 005014'01 265 01 0 00 005002* 33460 005015'01 000000 000000 33461 005016'01 254 00 0 00 005017' 33462 33463 ; Restore links and advice if necessary. 33464 33465 005017'01 400 01 0 00 000000 setz t1, ; Restore links & advice. 33466 005020'01 200 02 0 00 000000# move t2, oldmod ; From old tty mode word. 33467 005021'01 602 02 0 00 001000 txne t2, tt%alk ; Was receiving links before? 33468 005022'01 661 01 0 00 030000 txo t1, ; Yes, so receive links. 33469 005023'01 602 02 0 00 000400 txne t2, tt%aad ; Was receiving advice before? 33470 005024'01 661 01 0 00 006000 txo t1, ; Yes, so receive links. 33471 005025'01 322 01 0 00 004755* jumpe t1, r ; Skip to next part if no bits to set. 33472 005026'01 540 01 0 00 004405* hrr t1, ttynum ; Must set bits, form tty designator 33473 005027'01 660 01 0 00 400000 txo t1, .ttdes ; ... 33474 005030'01 400 02 0 00 000000 setz t2, ; Don't leave garbage in here... 33475 005031'01 104 00 0 00 000216 TLINK ; Restore the settings. 33476 005032'01 320 16 0 00 005033' erjmp .+1 ; Ignore any errors. 33477 005033'01 263 17 0 00 000000 ret k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66 K20NET MAC 5-May-24 16:57 Line routines 33478 33479 ; Turn off Arpanet TAC binary mode. 33480 33481 005034'01 unarpa: entry unarpa ;[271] Used by /DISCOVER in K20PAR 33482 005034'01 336 00 0 00 000000# skipn tvtflg ; Are we on a tvt? 33483 005035'01 263 17 0 00 000000 ret ; No, skip this. 33484 33485 005036'01 332 00 0 00 000000# panda < skipe havnbm ;[181] Does the monitor support network 33486 005037'01 254 00 0 00 004562' callret unsnbm > ;[181] binary mode? 33487 33488 005040'01 265 16 0 00 005450' saveac ;[186] Used for device designator 33489 005041'01 332 05 0 00 004740* skipe q1, netjfn ;[186] Load the network JFN 33490 005042'01 254 00 0 00 005057' ifskp. ;[186] Unless we don't have one... 33491 005043'01 332 00 0 00 004742* skipe local ;[186] Are we remote? 33492 005044'01 334 01 0 00 000000# ermsg% (,r) ;[186] Just punt 33493 005045'01 254 00 0 00 005051' 33494 005046'01 202 01 0 00 004753* 33495 005047'01 104 00 0 00 000313 33496 005050'01 254 00 0 00 005025* 33497 000242'03 000000000000# 33498 002532'04 113 105 122 115 111 33499 33500 005051'01 336 05 0 00 004750* skipn q1, ttyjfn ;[186] Yes, so just use the terminal JFN 33501 005052'01 334 01 0 00 000000# ermsg% (,r) ;[186] 33502 005053'01 254 00 0 00 005057' 33503 005054'01 202 01 0 00 005046* 33504 005055'01 104 00 0 00 000313 33505 005056'01 254 00 0 00 005050* 33506 000243'03 000000000000# 33507 002546'04 113 105 122 115 111 33508 33509 005057'01 endif. ;[186] Hopefully have SOMETHING ... 33510 33511 005057'01 332 00 0 00 000000# ifme. tvtchk ;[271] Not doing automatic? 33512 005060'01 254 00 0 00 005064' 33513 005061'01 332 00 0 00 000000# skipe tvtbin ;[271] No, so not forcing binary? 33514 005062'01 254 00 0 00 005064' anskp. ;[271] We are, so shut it off 33515 005063'01 263 17 0 00 000000 ret ;[271] Otherwise, don't do anything 33516 005064'01 endif. ;[271] Otherwise, don't update forced settings 33517 33518 005064'01 200 01 0 00 000005 move t1, q1 ;[186] ;[181] Get the line. 33519 005065'01 120 02 0 00 006054' dmove t2, [exp ,-3] 33520 005066'01 104 00 0 00 000053 SOUT% ; Yes, turn off binary mode. 33521 005067'01 320 12 0 00 005071' %jserr(,unarpx) 33522 005070'01 254 00 0 00 005074' 33523 005071'01 265 01 0 00 005014* 33524 005072'01 000000 000000 33525 005073'01 254 00 0 00 005111' 33526 005074'01 201 01 0 00 007640 movei t1, ^d4000 ; Wait 4 secs. 33527 005075'01 104 00 0 00 000167 DISMS% 33528 005076'01 200 01 0 00 000005 move t1, q1 ;[186] ; Send the command. 33529 005077'01 120 02 0 00 006057' dmove t2, [exp ,-3] 33530 005100'01 104 00 0 00 000053 SOUT% 33531 005101'01 320 12 0 00 005103' %jserr(,unarpx) 33532 005102'01 254 00 0 00 005106' k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66-1 K20NET MAC 5-May-24 16:57 Line routines 33533 005103'01 265 01 0 00 005071* 33534 005104'01 000000 000000 33535 005105'01 254 00 0 00 005111' 33536 005106'01 201 01 0 00 007640 movei t1, ^d4000 ; Wait another 4 secs. 33537 005107'01 104 00 0 00 000167 DISMS% 33538 005110'01 263 17 0 00 000000 ret ; Done. 33539 33540 unarpx: txmsg < 33541 %KERMIT-20: Warning -- Can't clear binary mode with TAC 33542 005111'01 200 01 0 00 000000# > ;[129] Error message for any of the above. 33543 005112'01 104 00 0 00 000076 33544 005113'01 320 12 0 00 005114' 33545 000244'03 000000000000# 33546 002563'04 015 012 045 113 105 33547 33548 33549 005114'01 263 17 0 00 000000 ret ;[129] And return 33550 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67 K20NET MAC 5-May-24 16:57 Get Network Device Status 33551 subttl Get Network Device Status 33552 33553 ;[223] Begin Code Insertion 33554 ; 33555 ; N.B., Be aware that the result of GDSTS% has to be CAREFULLY checked 33556 ; because it may not throw an error, even when followed by an 33557 ; ERJMP! In certain error scenarios, the process's last error may 33558 ; not be changed, so messing around with a before-SETER% / after- 33559 ; GETER% won't catch the problem, either. We carefully check for 33560 ; such a situation and, if detected, set the process's last error 33561 ; appropriately. Sigh... 33562 ; 33563 ; On klh10, the only line currently known to tolerate parity is the CTY. 33564 ; On a PANDA monitor, PTY's will do parity 33565 ; On real KL10 hardware, the monitor will generate parity, but the front 33566 ; end may do the generation or checking. 33567 ; 33568 ; Call: 33569 ; 33570 ; t1/ JFN on device (assumed opened in 8 bit mode) 33571 ; 33572 ; *OR* 33573 ; 33574 ; t1/ .ttdes+line number 33575 ; 33576 ; Returns: 33577 ; 33578 ; +1/ Some kind of bad 33579 ; +2/ Worked 33580 ; t1/ JFN, always 33581 ; t2/ Device-dependent status bits [If device supported GDSTS%] 33582 ; t3/ Device-dependent information [If device supported GDSTS%] 33583 ; t4/ Possible GDSTS% error 33584 33585 005115'01 gndpar: entry gndpar ; Also called from k20sub 33586 005115'01 265 16 0 00 006061' saveac ; Needs some extra registers 33587 33588 005116'01 200 05 0 00 000001 move q1, t1 ; Save JFN and any flags (which we don't use) 33589 005117'01 400 11 0 00 000000 setz q5, ; Second JFN on line 33590 33591 005120'01 606 05 0 00 400000 ifxn. q1, .ttdes ; Terminal device? 33592 005121'01 254 00 0 00 005125' 33593 005122'01 260 17 0 00 005334' call gndfil ; Yep, go get the JFN 33594 005123'01 200 11 0 00 000001 move q5, t1 ; Store it for later 33595 005124'01 254 00 0 00 005156' jrst devpar ; Go find out if it 'tolerates' parity 33596 005125'01 endif. ; End case terminal device 33597 33598 005125'01 621 01 0 00 777777 tlz t1, -1 ; Stomp the flags 33599 005126'01 104 00 0 00 000024 GTSTS% ; Get file status of JFN 33600 005127'01 320 12 0 00 005056* erjmpr r ; Failed, no way to know the parity 33601 005130'01 603 02 0 00 000200 txne t2, gs%nam ; Sanity check: does this JFN exist? 33602 005131'01 607 02 0 00 400000 txnn t2, gs%opn ; And is it open? 33603 005132'01 263 17 0 00 000000 ret ; No to one is a calling error 33604 ; Pick up and save the mode 33605 005133'01 135 04 0 00 006075' ldb t4,[pointr t2,gs%mod] k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-1 K20NET MAC 5-May-24 16:57 Get Network Device Status 33606 005134'01 200 03 0 00 000002 move t3, t2 ; Save the entire status word, too 33607 005135'01 104 00 0 00 000045 RFBSZ% ; Get the opened byte size 33608 005136'01 320 12 0 00 005127* erjmpr r ; Failed, better not go any further 33609 005137'01 415 16 0 00 005151' block. ; Build a stack frame for better control flow 33610 005140'01 261 17 0 00 000016 33611 005141'01 302 02 0 00 000007 caie t2, ^d7 ; Open in seven bit mode? 33612 005142'01 263 17 0 00 000000 ret ; Nope, have to have a new file 33613 005143'01 302 04 0 00 000000 caie t4, .gsnrm ; Opened in normal mode? 33614 005144'01 263 17 0 00 000000 ret ; No, so won't do parity 33615 005145'01 603 03 0 00 000400 txne t3, gs%err ; Nothing wrong, right? 33616 005146'01 263 17 0 00 000000 ret ; Better get our own copy 33617 005147'01 254 00 0 00 004472* retskp ; Otherwise, OK to check this JFN 33618 005150'01 263 17 0 00 000000 endbk. ; Either way, come out of the block 33619 005151'01 254 00 0 00 005154' ifskp. ; Skip means OK to check this JFN 33620 005152'01 200 11 0 00 000005 move q5, q1 ; So reuse it 33621 005153'01 254 00 0 00 005156' else. ; Otherwise, we need a copy 33622 005154'01 260 17 0 00 005334' call gndfil ; Go get a copy 33623 005155'01 200 11 0 00 000001 move q5, t1 ; Store it for later 33624 005156'01 endif. ; End of reuse determination logic 33625 33626 remark devpar ; Now check the parity (falls through) 33627 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68 K20NET MAC 5-May-24 16:57 Get Network Device Status 33628 remark Now that we have a JFN, see if it will do parity 33629 33630 005156'01 200 11 0 00 000001 devpar: move q5, t1 ; Save terminal (copy) JFN and flags 33631 005157'01 621 01 0 00 777777 panda < tlz t1, -1 ; Stomp JFN flags so MTOPR%'s don't choke 33632 005160'01 201 02 0 00 400001 movx t2, .morlt ; PANDA can extract parity status 33633 005161'01 104 00 0 00 000077 MTOPR% ; So try to get it 33634 005162'01 320 12 0 00 005164' ifje. r ; Sigh... 33635 005163'01 254 00 0 00 005166' 33636 005164'01 474 10 0 00 000000 seto q4, ; Set a talisman and do nothing else 33637 005165'01 254 00 0 00 005201' else. ; Otherise, got something! 33638 005166'01 200 10 0 00 000003 move q4, t3 ; Save current settings, first 33639 005167'01 661 10 0 00 400000 txo q4, 1b0 ; Be optimistic and assume parity exists and is on 33640 005170'01 602 03 0 00 000010 txne t3, mo%par ; Any parity? 33641 005171'01 254 00 0 00 005201' anskp. ; Nothing further to do or undo 33642 005172'01 200 10 0 00 000003 move q4, t3 ; Try turning it on, saving current settings, first 33643 005173'01 660 03 0 00 000010 txo t3, mo%par ; Turn on (even) parity 33644 005174'01 620 03 0 00 000006 txz t3, mo%nbi!mo%nbo ; Shut network binary so that doesn't get in the way 33645 005175'01 201 02 0 00 400002 movx t2, .moslt ; Function to set PANDA mode bits 33646 005176'01 104 00 0 00 000077 MTOPR% ; Give it a whirl 33647 005177'01 254 00 0 00 005201' ifskp. ; Might not be in this monitor 33648 005200'01 474 10 0 00 000000 seto q4, ; So better leave it alone 33649 005201'01 endif. ; End .moslt analysis 33650 005201'01 endif. ; End .morlt recovery and interpretation 33651 >;panda 33652 dmove t1, [ .fhslf ; Can't believe result of GDSTS% all the time... 33653 005201'01 120 01 0 00 006076' lstrx1 ] ; So let's assume it worked 33654 005202'01 104 00 0 00 000336 SETER% ; and set no errors whatsoever 33655 005203'01 320 12 0 00 005205' %jserr(,) ; VERY strange... 33656 005204'01 254 00 0 00 005210' 33657 005205'01 265 01 0 00 005103* 33658 005206'01 000000000000# 33659 005207'01 254 00 0 00 005210' 33660 002577'04 125 156 141 142 154 33661 33662 005210'01 550 01 0 00 000011 hrrz t1, q5 ; Load the JFN we got 33663 005211'01 403 02 0 00 000003 setzb t2, t3 ; Let's assume the JSYS doesn't work 33664 005212'01 104 00 0 00 000145 GDSTS% ; Finally try a device status on it 33665 005213'01 320 12 0 00 005215' ifje. r ; Catch the error (hopefully) 33666 005214'01 254 00 0 00 005224' 33667 005215'01 200 04 0 00 000001 move t4, t1 ; Put error code someplace for debugger 33668 005216'01 334 00 0 00 000000 %ermsg(,) ;[223] Complain, but carry on 33669 005217'01 254 00 0 00 005223' 33670 005220'01 265 01 0 00 005205* 33671 005221'01 000000000000# 33672 005222'01 254 00 0 00 005223' 33673 002606'04 103 157 165 154 144 33674 005223'01 254 00 0 00 005240' else. ; Otherwise, worked. Maybe... 33675 005224'01 405 02 0 00 000001 andx t2, gd%par ; Toss everything but accepts parity 33676 005225'01 200 04 0 00 000002 move t4, t2 ; Get possible status out of the way 33677 005226'01 400 02 0 00 000000 setz t2, ; Let's assume GETER% fails (impossible) 33678 005227'01 201 01 0 00 400000 movei t1, .fhslf ; This process 33679 005230'01 104 00 0 00 000012 GETER% ; Get the last error 33680 005231'01 320 12 0 00 005233' %jserr(,) ; VERY strange... 33681 005232'01 254 00 0 00 005236' 33682 005233'01 265 01 0 00 005220* k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-1 K20NET MAC 5-May-24 16:57 Get Network Device Status 33683 005234'01 000000000000# 33684 005235'01 254 00 0 00 005236' 33685 002614'04 125 156 141 142 154 33686 005236'01 621 02 0 00 777777 tlz t2, -1 ; Shut off idiotic fork handle... 33687 005237'01 250 02 0 00 000004 exch t2, t4 ; Put the last error in a common place 33688 005240'01 endif. ; End case JSYS handling 33689 33690 005240'01 302 04 0 00 601405 caie t4, lstrx1 ; Any error? 33691 005241'01 254 00 0 00 005254' ifskp. ; No. Supposedly; let's double check 33692 005242'01 302 02 0 00 601340 caie t2, desx9 ; No entry in device dispatch table for GDSTS%? 33693 005243'01 254 00 0 00 005254' anskp. ; No, assume it's fine... 33694 005244'01 200 04 0 00 000002 move t4, t2 ; Yep, device doesn't support it 33695 005245'01 201 01 0 00 400000 movei t1, .fhslf ; This process 33696 005246'01 104 00 0 00 000336 SETER% ; Force it to be our last error 33697 005247'01 320 12 0 00 005251' %jserr(,) ; VERY strange... 33698 005250'01 254 00 0 00 005254' 33699 005251'01 265 01 0 00 005233* 33700 005252'01 000000000000# 33701 005253'01 254 00 0 00 005254' 33702 002623'04 125 156 141 142 154 33703 005254'01 endif. ; End case silent failure 33704 33705 005254'01 306 04 0 00 601405 cain t4, lstrx1 ; So... No error, right? 33706 005255'01 254 00 0 00 005257' ifskp. ; Something happened... 33707 ;;;; remark We handle this properly; uncomment for debugging or prototyping 33708 ;;;; %ermsg(,) 33709 005256'01 403 02 0 00 000003 setzb t2, t3 ; Cons up no status whatsoever 33710 005257'01 endif. 33711 33712 005257'01 335 03 0 00 000010 panda < skipge t3, q4 ; Did we have to restore anything? 33713 005260'01 254 00 0 00 005270' ifskp. ; Ok, so a bit of cleaning up to do, then 33714 005261'01 200 04 0 00 000002 move t4, t2 ; Save the precious gd%par bit! 33715 005262'01 550 01 0 00 000011 hrrz t1, q5 ; Pick up the terminal JFN, no flags 33716 005263'01 201 02 0 00 400002 movx t2, .moslt ; Function to set PANDA mode bits 33717 005264'01 104 00 0 00 000077 MTOPR% ; Try to set it back to the way it was 33718 005265'01 320 12 0 00 005266' erjmpr .+1 ; Failed?? We just changed it! 33719 005266'01 200 02 0 00 000004 move t2, t4 ; Restore the precious (scrubbed) gd%par bit 33720 005267'01 254 00 0 00 005274' else. ; Otherwise, looked negative 33721 005270'01 316 03 0 00 005760' camn t3, [-1] ; Is it our talisman? 33722 005271'01 254 00 0 00 005274' ifskp. ; No, so carry forward the parity setting 33723 005272'01 405 03 0 00 000010 andx t3, mo%par ; Just keep the parity on bit 33724 005273'01 434 02 0 00 000003 or t2, t3 ; And carry that on with a possible gd%par 33725 005274'01 endif. ; End case parity setting 33726 005274'01 endif. ; End .morlt recovery and interpretation 33727 >;;panda 33728 33729 remark t2, gd%par ; So will the thing do parity? 33730 005274'01 316 05 0 00 000011 camn q1, q5 ; Reused the JFN? 33731 005275'01 254 00 0 00 005147* retskp ; We did, so nothing further to do 33732 33733 005276'01 200 07 0 00 000002 move q3, t2 ; Save the precious device-dependent status bits 33734 dmove t1, [ devclt ; On time-out, hit device close timeout 33735 005277'01 120 01 0 00 006100' ^d2500 ] ; Give it two and half seconds to make up its mind 33736 005300'01 260 17 0 00 000360* call timeon ; Start the timer going 33737 005301'01 550 01 0 00 000011 hrrz t1, q5 ; Load the JFN, no flags k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-2 K20NET MAC 5-May-24 16:57 Get Network Device Status 33738 005302'01 104 00 0 00 000022 CLOSF% ; Close it 33739 005303'01 320 12 0 00 005305' %jserr(,) ; But carry on anyway 33740 005304'01 254 00 0 00 005310' 33741 005305'01 265 01 0 00 005251* 33742 005306'01 000000000000# 33743 005307'01 254 00 0 00 005310' 33744 002632'04 125 156 141 142 154 33745 005310'01 260 17 0 00 000446* call timdel ; Toss the timer, we won 33746 33747 005311'01 200 02 0 00 000007 move t2, q3 ; Restore the device-dependent status bits 33748 005312'01 254 00 0 00 005275* retskp ; Return success, anyway 33749 33750 33751 remark ; Here on device parity close timeout 33752 33753 devclt: dmove t1, [ devabt ; On time-out, hit device abort timeout 33754 005313'01 120 01 0 00 006102' ^d2500 ] ; Give it two and half seconds to make up its mind 33755 005314'01 260 17 0 00 005300* call timeon ; Start the timer going 33756 005315'01 550 01 0 00 000011 hrrz t1, q5 ; Load the JFN, no flags and set up to 33757 005316'01 621 01 0 00 004000 txz t1, cz%abt ; abort it, we mean business this time 33758 005317'01 104 00 0 00 000022 CLOSF% ; Bombs away! 33759 005320'01 320 12 0 00 005324' erjmpr devabt ; That didn't work, just try to let go of it 33760 005321'01 260 17 0 00 005310* call timdel ; Toss the timer, it's chucked 33761 005322'01 200 02 0 00 000007 move t2, q3 ; Restore the device-dependent status bits 33762 005323'01 254 00 0 00 005312* retskp ; Return some kind of success 33763 33764 devabt: dmove t1, [ devabf ; On time-out, hit device abort timeout 33765 005324'01 120 01 0 00 006104' ^d2500 ] ; Give it two and half seconds to make up its mind 33766 005325'01 260 17 0 00 005314* call timeon ; Start the timer going 33767 005326'01 550 01 0 00 000011 hrrz t1, q5 ; Load the JFN, no flags and set up to 33768 005327'01 104 00 0 00 000023 RLJFN% ; Just try to let go of it 33769 005330'01 320 12 0 00 005332' erjmpr devabf 33770 005331'01 260 17 0 00 005321* call timdel ; Toss the timer, it's chucked 33771 33772 005332'01 devabf: remark ; If hit here, just ignore what's going on, oh well.. 33773 005332'01 200 02 0 00 000007 move t2, q3 ; Restore the device-dependent status bits 33774 005333'01 254 00 0 00 005323* retskp ; Return some kind of success 33775 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69 K20NET MAC 5-May-24 16:57 Get a seven bit handle on a (terminal) device 33776 subttl Get a seven bit handle on a (terminal) device 33777 33778 remark Constants definitions 33779 33780 000000 js%all==0 ; Has our JFNS% formatting bits 33781 .xcref js%all ; Not needed in the cross reference 33782 33783 define jsb(b) < ;;Macro to accumulate bits 33784 js%all==js%all! ;;OR in to completed word 33785 .xcref js%all ;;Keep off the cross reference!!!! 33786 >;;jsb 33787 33788 define jsf(m,v) < ; Macro to accumulate values 33789 ifb , ;;If no value, then always output 33790 ifnb , ;;If value, then use that 33791 .xcref js%all ;;Either way, keep off the cross reference 33792 >;;jsf 33793 33794 remark ; Finally cons up the formatting 33795 jsf(js%dev) ;;Device 33796 jsf(js%dir) ;;Directory 33797 jsf(js%nam) ;;Name 33798 jsf(js%typ) ;;Type 33799 jsf(js%gen) ;;Generation 33800 jsb(js%paf) ;;Punctuate all fields 33801 33802 chgsec(code,const) ; Not code, constants 33803 000245'03 allfld: intern allfld ;[252] ; Also used by K20SUB 33804 000245'03 111110 000001 js%all ; Output everything in the file name 33805 000246'03 000000 000000 0 ; No goofy prefix 33806 retsec ; Return from CONST psec 33807 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70 K20NET MAC 5-May-24 16:57 Code to do the job 33808 subttl Code to do the job 33809 33810 ; N.B., This surely will NEVER work for a pipe or a file 33811 ; 33812 ; Call: 33813 ; 33814 ; t1/ JFN on device (assumed open) 33815 ; 33816 ; *OR* 33817 ; 33818 ; t1/ .ttdes+line number 33819 ; 33820 ; Return: 33821 ; 33822 ; +1/ Some problem 33823 ; t1/ Last JSYS' error 33824 ; t3/ Possible OPENF% error code 33825 ; t4/ Possible RLJFN% error code 33826 ; 33827 ; +2/ Worked! 33828 ; t1/ New JFN and flags 33829 33830 005334'01 265 16 0 00 006106' gndfil: saveac 33831 005335'01 265 16 0 00 001750* anstkv. (q2,mxfilw) ; Stack space for text of JFN 33832 005336'01 000000 000034 33833 005337'01 415 06 0 17 777743 33834 33835 005340'01 201 01 0 00 000033 movx t1, ; Length of storage to zero 33836 005341'01 200 02 0 00 000006 move t2, q2 ; First location to zero 33837 005342'01 201 03 0 02 000001 movei t3, 1(t2) ; Second location to zero 33838 005343'01 402 00 0 02 000000 setzm (t2) ; Whack the first location 33839 005344'01 320 12 0 00 005136* erjmpr r ; Must have bumped into a guard page or off section 33840 005345'01 123 01 0 00 006022' xblt. t1 ; And away we go! 33841 005346'01 320 12 0 00 005344* erjmpr r ; Must have bumped into a guard page or off section 33842 33843 005347'01 560 01 0 00 000006 hrro t1, q2 ; Tops-20 ASCIZ pointer to text area 33844 005350'01 550 02 0 00 000005 hrrz t2, q1 ; Load the JFN, sans flags 33845 005351'01 322 02 0 00 005346* jumpe t2, r ; Gubbish? 33846 005352'01 606 02 0 00 400000 txnn t2, .ttdes ; A terminal designator? 33847 005353'01 254 00 0 00 005362' ifskp. ; Yes, JFNS% will choke on it 33848 005354'01 104 00 0 00 000121 DEVST% ; So turn designator into a string 33849 005355'01 320 12 0 00 005351* erjmpr r ; But couldn't 33850 005356'01 120 02 0 00 005446' dmove t2, [exp ":",0] ; Load appropriate suffix 33851 005357'01 136 02 0 00 000001 idpb t2, t1 ; Punctuate the device 33852 005360'01 136 03 0 00 000001 idpb t3, t1 ; Tie off the string (does not allow append) 33853 005361'01 254 00 0 00 005365' else. ; Otherwise, a JFN which JFNS% can handle 33854 005362'01 120 03 0 00 000000# dmove t3, allfld ; Load formatting bits, no goofy prefix 33855 005363'01 104 00 0 00 000030 JFNS% ; Turn the JFN into text 33856 005364'01 320 12 0 00 005355* erjmpr r ; But couldn't 33857 005365'01 endif. 33858 33859 005365'01 205 01 0 00 100020 movx t1, gj%old!gj%flg ; Return flags 33860 005366'01 560 02 0 00 000006 hrro t2, q2 ; Load Tops-20 ASCIZ pointer to constructed text 33861 005367'01 104 00 0 00 000020 GTJFN% ; Get a duplicate JFN 33862 005370'01 320 12 0 00 005364* erjmpr r ; Failed?? k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70-1 K20NET MAC 5-May-24 16:57 Code to do the job 33863 005371'01 200 07 0 00 000001 move q3, t1 ; Save file JFN and flags 33864 33865 005372'01 621 01 0 00 777777 tlz t1, -1 ; Shut off flags so OPENF% doesn't choke 33866 005373'01 200 02 0 00 006120' movx t2, fld(7,of%bsz)!fld(.gsnrm,of%mod)!of%wr!of%rd ; Force 7 bit mode!! 33867 005374'01 403 03 0 00 000004 setzb t3, t4 ; Scrub an error returns 33868 005375'01 104 00 0 00 000021 OPENF% ; Open the file (I hope) 33869 005376'01 320 12 0 00 005400' ifje. r ; Failed... 33870 005377'01 254 00 0 00 005402' 33871 005400'01 200 03 0 00 000001 move t3, t1 ; Save the error code 33872 005401'01 254 00 0 00 005404' else. ; Otherwise, worked!! 33873 005402'01 500 01 0 00 000007 hll t1, q3 ; Return the flags, too 33874 005403'01 254 00 0 00 005333* retskp ; Return success 33875 005404'01 endif. ; End initial JSYS handling 33876 33877 005404'01 550 01 0 00 000007 hrrz t1, q3 ; Reload the new JFN 33878 005405'01 104 00 0 00 000023 RLJFN% ; Toss its miserable remains 33879 005406'01 320 12 0 00 005410' ifje. r ; Failed?? 33880 005407'01 254 00 0 00 005411' 33881 005410'01 200 04 0 00 000001 move t4, t1 ; Return error code as talisman 33882 005411'01 endif. 33883 33884 005411'01 263 17 0 00 000000 ret ; Fail the call 33885 33886 ;[223] End Code Insertion 33887 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71 K20NET MAC 5-May-24 16:57 Final code particulars 33888 subttl Final code particulars 33889 33890 xlist ; Save the trees!! 33891 list ; Safe to look 33892 .endps code ; Close out the code area 33893 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72 K20NET MAC 5-May-24 16:57 Misc. data storage 33894 subttl Misc. data storage 33895 33896 .psect data ; Writeable area!! 33897 33898 000030'05 cnfigd: block .cfiln ; Space for CNFIG% .CFINF data 33899 000040'05 block 1 ; And slop 33900 000041'05 mynode:: block 1 ; Number of local executor (us) 33901 000042'05 myname:: block 2 ; Local executor name 33902 000044'05 ndvfxp:: block 1 ; Whether monitor has extended node verify 33903 33904 000045'05 syscnt:: block 1 ; Count of characters in system name 33905 000046'05 sysnam:: block syslen ; Name of local system we're running on 33906 000057'05 myprom:: block 3 ;[270] ; As a prompt prefix 33907 000062'05 sysver: block 1 ; GETAB% table for system name 33908 33909 000063'05 cnfmsg: block <+1> ; Space for configuration message 33910 000115'05 block 1 ; And slop ... 33911 33912 remark ;[190] ; Various line bits of interest 33913 33914 000116'05 000000 000000 inited: 0 ;[190] ;[177] inilin/reslin flag. 33915 000117'05 000000 000000 oldmod: 0 ;[190] ; Previous mode of the line. 33916 000120'05 000000 000000 olddim: 0 ;[190] ;[185] Old line dimensions 33917 000121'05 000000 000000 oldpau: 0 ;[190] ; Previous terminal pause on end mode. 33918 000122'05 000000 000000 sysmsg: 0 ;[190] ;[82] Accept/refuse system message status. 33919 33920 panda < remark ;[181] Storage for PANDA monitor TVT support 33921 000123'05 000000 000000 havnbm: 0 ;[181] Non-zero if we have network binary mode 33922 000124'05 000000 000000 setlts: 0 ;[181] set if we set terminal status 33923 000125'05 000000 000000 oldlts: 0 ;[181] Old terminal status 33924 > ;[181] 33925 33926 remark Do not reorder next two! 33927 000126'05 nrtros:: block 1 ; If NRT, remote operating system type 33928 000127'05 rosnpt:: block 1 ; Remote operating system name pointer 33929 000130'05 nrtflg:: block 1 ; Set if a valid Network Remote Terminal 33930 000131'05 binflg:: block 1 ; Set if terminal will do binary (they all do) 33931 000132'05 nrtprt: block 1 ; NRT protocol supported 33932 000133'05 forkls:: block 1 ;[236] ; NRT connection is forkless 33933 33934 000134'05 000000 000000 job: 0 ;[218] ;[7] Number of job that has TTY I want. 33935 000135'05 000000 000000 oasflg: 0 ;[218] ;[7] -1 if we assigned the previous TTY. 33936 000136'05 000000 000000 osgdev: 0 ;[218] ;[186] Old device I had assigned 33937 000137'05 000000 000000 oldjfn: 0 ;[218] ; JFN on previous line. 33938 33939 000140'05 000000 000000 oldnum: 0 ; Previous DECnet node number 33940 000141'05 000000 000000 oldnam: exp 0, 0, 0, 0 ; Previous DECnet node name 33941 000145'05 nrtobj: block <+1> ; Area to build object name for GTJFN% 33942 000201'05 block 2 ; And slop 33943 000203'05 intbuf: block ^d<<16/5>+1> ; Space for interupt message 33944 000207'05 block 3 ; And generous slop... (it is DECnet, after all) 33945 33946 000212'05 frkpdl: block pdlsiz ;[186] Fork's PDL 33947 ;[223] If a buffer is large enough for 8 bit, it will be large enough for 7 bit 33948 000522'05 frkbuf: block +1 ;[223] Buffer for fork to read into (if 8 bit) k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72-1 K20NET MAC 5-May-24 16:57 Misc. data storage 33949 001123'05 nrtbuf: block +1 ;[223] Buffer for sending loop (if 8 bit) 33950 001524'05 parbuf: block +1 ;[223] Buffer if building parity from terminal input 33951 33952 remark pseudo-terminal information 33953 33954 002125'05 ttygtb: block 1 ; Terminal line to job mapping GETAB% 33955 002126'05 pty1st: block 1 ; Terminal line number of first pseudo-terminal 33956 002127'05 ptycnt: block 1 ; Count of pseudo-terminals 33957 002130'05 ptygtb: block 1 ; PTYPAR GETAB% index (which we'll never use) 33958 33959 002131'05 ndvchr:: block 2 ; Device characterstics double word 33960 33961 002133'05 ptyflg:: block 1 ; Set if doing pseudo-terminal I/O 33962 002134'05 ptynam:: block 3 ; ASCII name of pseudo-terminal 33963 002137'05 ptydev:: block 1 ; Assigned PTY device designator 33964 002140'05 ptytty:: block 1 ; Line number associated with pseudo-terminal 33965 33966 002141'05 ttyflg:: block 1 ;[270] ; Flag for physical terminal 33967 002142'05 ttydev:: block 1 ; Assigned TTY device designator 33968 002143'05 ttynam:: block 3 ; ASCII name of associated terminal 33969 33970 002146'05 777777 777777 opndev: -1 ;[186] Device type we are open on 33971 002147'05 opnsts:: block 2 ;[223] GDSTS% on the open JFN 33972 002151'05 000000 000000 opnpar:: 0 ;[223] Whether device supports parity 33973 33974 002152'05 000000 000000 vbict:: 0 ;[186] Virtual Terminal BIN% Count 33975 002153'05 000000 000000 vboct:: 0 ;[186] Virtual Terminal BOUT% Count (simulated) 33976 002154'05 000000 000000 vsict:: 0 ;[186] Virtual Terminal SIN% Count (number done) 33977 002155'05 000000 000000 vsitc:: 0 ;[186] Virtual Terminal total characters SIN%'ed 33978 002156'05 000000 000000 vsimx:: 0 ;[186] Virtual Terminal SIN% Maximum length 33979 002157'05 000000 000000 vsoct:: 0 ;[186] Virtual Terminal SOUTR%'s Issued 33980 002160'05 000000 000000 vsotc:: 0 ;[186] Virtual Terminal SOUTR% Total Characters 33981 002161'05 000000 000000 vsomx:: 0 ;[186] Virtual Terminal SOUTR% Maximum length 33982 002162'05 000000 000000 nbict:: 0 ;[186] Network BIN% count 33983 002163'05 000000 000000 nsici:: 0 ;[186] Network SIN%'s Issued 33984 002164'05 000000 000000 nsitc:: 0 ;[186] Network SIN% total characters 33985 002165'05 000000 000000 nsimx:: 0 ;[186] Network SIN% maximum length 33986 33987 002166'05 000000 000000 vchrcn:: 0 ;[211] Characters flushed from virtual line 33988 002167'05 flushb: block +1 ;[211] Flush buffer in words, eight bit bytes 33989 .endps data ; Close out the data area 33990 33991 .xcmsy ;[194] Ditch MACSYM junk 33992 33993 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 006121 FOR CODE PSECT 2 BREAK IS 000003 FOR TEXT PSECT 3 BREAK IS 000247 FOR CONST PSECT 4 BREAK IS 002642 FOR ETEXT PSECT 5 BREAK IS 002252 FOR DATA CPU TIME USED 00:02.085 k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72-2 K20NET MAC 5-May-24 16:57 Misc. data storage 145P CORE USED k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20NET MAC 5-May-24 16:57 SYMBOL TABLE AIC% 104000 000131 int GJ%FLG 000020 000000 sin NTINF% 104000 000632 int SINR% 104000 000531 int ARGX02 601713 int GJ%OLD 100000 000000 sin NTLINE 777777 spd SOBE% 104000 000103 int ASGDEV 000000 ext GJ%SHT 000001 000000 sin NTTYPE 000777 000000 spd SOUT% 104000 000053 int ASGFLG 000000 ext GS%ERR 000400 000000 sin NW%FE 000001 sin SOUTR% 104000 000532 int ASND% 104000 000070 int GS%MOD 000017 sin NW%NNT 000000 sin SPACE 000000 ext ATMBUF 000000 ext GS%NAM 000200 000000 sin NW%TV 000004 sin SRVFLG 000000 ext BIN% 104000 000050 int GS%OPN 400000 000000 sin OBJLEN 000207 spd STAT% 104000 000745 int BOUT 104000 000051 int GTJFN% 104000 000020 int ODD 000000 ext STCMP% 104000 000540 int BOUT% 104000 000051 int GTSTS% 104000 000024 int OF%BSZ 770000 000000 sin STPAR% 104000 000217 int CALL 260740 000000 HALTF 104000 000170 int OF%MOD 007400 000000 sin STRBUF 000000 ext CALLRE 254000 000000 spd HANDSH 000000 ext OF%RD 200000 sin STRC 000000 ext CF%DCN 200000 000000 sin IAC 000377 spd OF%WR 100000 sin STRPTR 000000 ext CF%WDP 777777 000000 spd IIC% 104000 000132 int OPENF% 104000 000021 int SYMOUT 000000 ext CFIBF% 104000 000100 int INPCLR 000000 ext P 000017 SYSGT% 104000 000016 int CFOBF% 104000 000101 int JFNS% 104000 000030 int P1 000011 spd SYSLEN 000011 spd CHKPAR 000000 ext JS%DEV 700000 000000 sin P2 000012 spd T1 000001 spd CIS% 104000 000141 int JS%DIR 070000 000000 sin P3 000013 spd T2 000002 spd CLOSF 104000 000022 int JS%GEN 000070 000000 sin P4 000014 spd T3 000003 spd CLOSF% 104000 000022 int JS%NAM 007000 000000 sin P5 000015 spd T4 000004 spd CLSX1 600160 int JS%PAF 000001 sin PANDAS 000001 sin T5 000005 spd CNFIG% 104000 000627 int JS%TYP 000700 000000 sin PARITY 000000 ext TCP%NT 000040 000000 spd CODE 000000 ext KFORK% 104000 000153 int PARPKO 000000 ext TEXT 000000 ext CONST 000000 ext KLFLGS 777700 000000 spd PARRCK 000000 ext TL%AAD 002000 000000 sin CRLF 000000 ext LSTRX1 601405 int PARS3 000000 ext TL%ABS 010000 000000 sin CX 000016 MARK 000000 ext PARS4 000000 ext TL%COR 200000 000000 sin CZ%ABT 004000 000000 sin MO%ABT 010000 000000 sin PARS5 000000 ext TL%CRO 400000 000000 sin DEBRK% 104000 000136 int MO%CON 400000 000000 sin PARS6 000000 ext TL%SAB 020000 000000 sin DESX3 600152 int MO%EOM 020000 000000 sin PARS7 000000 ext TL%STA 004000 000000 sin DESX9 601340 int MO%INT 002000 000000 sin PBOUT 104000 000074 int TLINK 104000 000216 int DEVST% 104000 000121 int MO%NBI 000004 sin PBOUT% 104000 000074 int TOPNRT 000010 spd DIC% 104000 000133 int MO%NBO 000002 sin PC%USR 010000 000000 sin TOPS20 000010 spd DIR% 104000 000130 int MO%PAR 000010 sin PDLSIZ 000310 spd TRNBIN 000000 spd DISMS 104000 000167 int MO%RMT 400000 000000 sin PSOUT% 104000 000076 int TT%AAD 000400 sin DISMS% 104000 000167 int MO%SYN 004000 000000 sin Q1 000005 spd TT%ALK 001000 sin DO 000375 spd MO%WCC 040000 000000 sin Q2 000006 spd TT%CAR 000001 sin DONT 000376 spd MO%WFC 100000 000000 sin Q3 000007 spd TT%DAM 000300 sin DV%AV 010000 000000 sin MOVCHR 000000 ext Q4 000010 spd TT%DUM 000014 sin DV%TYP 000777 000000 sin MTOPR 104000 000077 int Q5 000011 spd TT%ECO 004000 sin DV%UNT 077777 sin MTOPR% 104000 000077 int R 000000 ext TT%LCA 040000 000000 sin DVCHR% 104000 000117 int MXFILW 000034 spd RELD% 104000 000071 int TT%LEN 037600 000000 sin EIR% 104000 000126 int MYCAPS 000000 ext RET 263740 000000 TT%LIC 000020 sin ERJMP 320700 000000 int MYJOB 000000 ext RFBSZ% 104000 000045 int TT%MFF 200000 000000 sin ERJMPR 320500 000000 int MYTTY 000000 ext RFMOD 104000 000107 int TT%PGM 000002 sin ERJMPS 320600 000000 int ND%EXM 400000 000000 sin RFMOD% 104000 000107 int TT%TAB 100000 000000 sin ERRPTR 000000 ext ND%LGL 200000 000000 sin RLJFN% 104000 000023 int TT%UOC 000040 sin ERSTR% 104000 000011 int ND%NUM 020000 000000 sin RSKP 000000 ext TT%WID 000177 000000 sin ESOUT% 104000 000313 int NETFLG 000000 ext RSTLNW 000000 ext TT%WKA 010000 sin ETEXT 000000 ext NETJFN 000000 ext SAVLNW 000000 ext TT%WKF 100000 sin EVEN 000000 ext NODE% 104000 000567 int SC%GTB 200000 000000 sin TT%WKN 040000 sin FRKHX2 600251 int NODNAM 000000 ext SETER% 104000 000336 int TT%WKP 020000 sin GD%PAR 000001 sin NODNUM 000000 ext SFMOD 104000 000110 int TTIPAR 000000 ext GDSTS% 104000 000145 int NONE 000000 ext SFMOD% 104000 000110 int TTYINI 000000 ext GENPAR 000000 ext NOP 600000 000000 sin SH%LPM 400000 000000 sin TTYJFN 000000 ext GETAB% 104000 000010 int NOUT% 104000 000224 int SIBE% 104000 000102 int TTYNUM 000000 ext GETER% 104000 000012 int NTBLEN 000010 spd SIN% 104000 000052 int VI%MAJ 077700 000000 sin k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20NET MAC 5-May-24 16:57 SYMBOL TABLE VI%MIN 000077 000000 sin .DVDES 600000 sin WAIT% 104000 000306 int .DVNUL 000015 sin WILL 000373 spd .DVPIP 000403 sin WONT 000374 spd .DVPTY 000013 sin XMOVEI 415000 000000 int .DVTTY 000012 sin XON 000021 spd .FHINF 777774 sin %%JSER 000000 ext .FHSLF 400000 sin ..MSK 777777 777777 spd .FHSUP 777777 sin .A16 000016 spd .FP 000015 spd .CFIHO 000004 sin .FPAC 000005 spd .CFILN 000010 sin .GSIMG 000010 sin .CFINF 000000 sin .GSNRM 000000 sin .CFISE 000002 sin .GSSMB 000001 sin .CFISO 000006 sin .JSAOF 000001 sin .CFIVR 000007 sin .MOACN 000024 sin .CFLEN 000000 sin .MOCLZ 000040 sin .CHBEL 000007 sin .MOOFF 000000 sin .CHCNC 000003 sin .MORIM 000035 sin .CHCRT 000015 sin .MORLS 000025 sin .CHDAS 000055 sin .MORLT 400001 sin .CHNUL 000000 sin .MORNT 000035 sin .CMCFM 000010 sin .MORSP 000027 sin .CMKEY 000000 sin .MORXO 000044 sin .CMNOD 000026 sin .MOSIM 000036 sin .CMNUM 000001 sin .MOSLT 400002 sin .CTTRM 777777 sin .MOSMN 000001 sin .DCX0 000000 sin .MOSNH 000044 sin .DCX1 000001 sin .MOSNT 000034 sin .DCX10 000012 sin .MOXOF 000043 sin .DCX11 000013 sin .NDFLG 000001 sin .DCX2 000002 sin .NDGLN 000001 sin .DCX21 000025 sin .NDGNM 000003 sin .DCX22 000026 sin .NDNOD 000000 sin .DCX23 000027 sin .NDNUM 000002 sin .DCX24 000030 sin .NDVFX 000023 sin .DCX3 000003 sin .NDVFY 000015 sin .DCX32 000040 sin .NULIO 377777 sin .DCX33 000041 sin .NWABC 000000 sin .DCX34 000042 sin .NWLIN 000002 sin .DCX35 000043 sin .NWNNP 000003 sin .DCX36 000044 sin .NWRRH 000000 sin .DCX37 000045 sin .NWTTF 000004 sin .DCX38 000046 sin .PRIOU 000101 sin .DCX39 000047 sin .PX7 610001 000000 spd .DCX4 000004 sin .SAC 000016 .DCX40 000050 sin .SAV1 000000 ext .DCX41 000051 sin .SAV2 000000 ext .DCX42 000052 sin .SAV3 000000 ext .DCX43 000053 sin .SHARG 000000 sin .DCX5 000005 sin .SHESC 000002 sin .DCX6 000006 sin .SHLEN 000003 spd .DCX7 000007 sin .SHTTY 000001 sin .DCX8 000010 sin .TTDES 400000 sin .DCX9 000011 sin .XSTKS 000000 ext .DVDCN 000022 sin k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT CODE ASGDEV 003657' ext DOBIT4 004450' NODNUM 001413' ext TTYJFN 005051' ext ASGFLG 003656' ext DOBITS 004344' ent NONE 002137' ext TTYNUM 005026' ext ASIPTY 001053' ent DOESC 002063' ext NRTBRK 002404' ent UNARPA 005034' ent ATMBUF 001414' ext DUPLEX 002121' ext NRTEND 003111' UNARPX 005111' BBNTVT 004310' ECHO 002127' ext NRTLEN 000016 spd UNBITS 004737' ent BOUTR% 001736' ent ERRPTR 005054' ext NRTMSG 002401' UNSNBM 004562' CARIER 004443' ext ESCAPE 002052' ext NTECH0 002254' VTERMF 004726' ext CCOFF2 004715' ext FILJFN 004725' ext NTECH1 002265' VTMOUT 002066' CCON 000344' ext FIXNAM 000600' NTECH2 002301' VTMPSH 001775' ent CHKCLS 003051' FLOW 004454' ext NTECHO 002245' WAITCC 000507' CHKDCN 004124' FLUSHC 000310 spd NTIDEV 004174' WAITCN 000325' CHKLIN 003771' ent FRKCHB 000000 ext NUL4 001543' ext WAITDN 000402' CHKLJF 004147' FRKCHN 000000 ext OPENET 003375' ent WAITM1 000525' CHKNBM 004473' ent FRKLSC 001616' ent OPENRT 000257' WAITMO 000517' CHKNRT 000233' FRTRAP 002362' ent OPNPTY 003517' WAITPR 000404' CHKPAR 002240' ext GDSCPT 002325' OPNTTY 003623' WAITUN 000500' CHKPTY 004136' GENPAR 002111' ext PARIER 002337' $CF%WD 000000 spd CHKTOP 000624' GETNAM 000077' ent PARITY 002136' ext $CONN1 001251' CHKTTY 004031' GETNOD 000145' PARPKO 002141' ext $CONN2 001426' CHKTVT 004233' ent GETNTI 004173' ent PARRCK 002143' ext $CONN3 001613' CLRBUF 002420' ent GNDFIL 005334' PARS3 001236' ext $CONNE 001201' ent CLREAD 002663' ent GNDPAR 005115' ent PARS4 001272' ext $CONNX 003335' ext CLREST 002622' ent GTTYJF 003662' PARS5 001613' ext $SETLN 001162' ent CLSABT 003136' HANDSH 004453' ext PARS6 000355' ext $WAITJ 000362' sin CLSASG 003155' HONK 002336' PARS7 001602' ext %%JSER 005305' ext CLSCLN 003221' HSTTYN 000000000000# pol PC3 002374' ext ..0005 000034' spd CLSCOM 003125' HSTTYP 000760' int POSTAB 000137' ..0006 000035' spd CLSFE 003125' INIL2 004333' PTYFLS 002524' ..0013 000033' spd CLSJFN 003041' ent INILIN 004331' ent R 005370' ext ..0022 000055' spd CLSNET 003044' ent INIPTY 001032' ent RESLIN 004713' ent ..0024 000061' spd CLSNRT 003116' INPCLR 002664' ext RRSL2 004716' ent ..0037 000071' spd CLSPTY 003125' INTMSG 001003' ent RRSLIN 004715' ent ..0046 000120' spd CLSRLJ 003150' JS%ALL 111110 000001 spd RSKP 005403' ext ..0047 000137' spd CNFLEN 000200 spd LCLNOD 000000' ent RSTLNW 005006' ext ..0055 000122' spd CRLF 003356' ext LINLEN 002000 spd SAVLNW 004434' ext ..0056 000130' spd CYOFF 000447' ext LOCAL 005043' ext SESFLG 002313' ext ..0063 000153' spd CYON 000346' ext MDMLIN 004446' ext SESJFN 002311' ext ..0072 000154' spd CYSEEN 000366' ext MONV 004103' ext SETDEF 000176' ent ..0073 000165' spd DCNFLS 002454' MOVCHR 002276' ext SETNBM 004505' ..0101 000154' spd DEADEV 003616' MYCAPS 000000 ext SETSPD 004101' ext ..0102 000161' spd DECERR 000541' ent MYJOB 003452' ext SHUTDN 000436' ..0110 000200' spd DECNCT 000210' ent MYTTY 003750' ext SPEED 004111' ext ..0111 000203' spd DELAY 000356' ext NBMERR 004560' SRVFLG 004713' ext ..0117 000245' spd DEVABF 005332' NETER2 003341' SYMOUT 003303' ext ..0126 000266' spd DEVABT 005324' NETERR 002346' TIMDEL 005331' ext ..0127 000272' spd DEVCLT 005313' NETFLG 003717' ext TIMEON 005325' ext ..0146 000361' spd DEVPAR 005156' NETIN 002132' ent TTER1 002062' ext ..0161 000361' spd DNCFLD 000000 ext NETINH 003343' TTFORK 002371' ext ..0162 000402' spd DNCHB 000000 ext NETINM 003364' TTINCH 002065' ext ..0167 000370' spd DNDFLD 000000 ext NETJFN 005041' ext TTIPAR 002343' ext ..0170 000377' spd DNTRAP 000532' ent NETLGX 002323' ext TTSFRK 001615' ext ..0172 000375' spd DOARPA 004620' ent NETVTX 003242' ent TTXON 002761' ent ..0173 000424' spd DOARPX 004703' NIENTE 000170' TTXON2 003014' ..0203 000432' spd DOBIT2 004404' NOARPX 004707' TTXON3 003034' ..0253 000557' spd DOBIT3 004412' NODNAM 005767' ext TTYINI 001432' ext ..0262 000563' spd k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT CODE ..0263 000572' spd ..1070 001567' spd ..1613 002617' spd ..2271 003416' spd ..0270 000571' spd ..1102 001613' spd ..1620 002552' spd ..2272 003426' spd ..0272 000574' spd ..1110 001607' spd ..1621 002562' spd ..2304 003441' spd ..0336 000606' spd ..1121 001732' spd ..1622 002550' spd ..2312 003436' spd ..0344 000650' spd ..1130 001730' spd ..1641 002574' spd ..2320 003461' spd ..0351 000651' spd ..1136 001674' spd ..1642 002616' spd ..2326 003456' spd ..0356 000672' spd ..1143 001704' spd ..1643 002573' spd ..2334 003512' spd ..0367 000720' spd ..1162 001724' spd ..1660 002576' spd ..2342 003507' spd ..0374 000725' spd ..1174 001735' spd ..1661 002616' spd ..2344 003476' spd ..0375 000737' spd ..1175 001736' spd ..1665 002626' spd ..2351 003507' spd ..0404 000753' spd ..1176 001747' spd ..1673 002646' spd ..2356 003475' spd ..0452 001040' spd ..1214 001774' spd ..1705 002644' spd ..2365 003504' spd ..0453 001041' spd ..1225 001775' spd ..1706 002646' spd ..2367 003507' spd ..0461 001047' spd ..1226 002065' spd ..1707 002643' spd ..2405 003550' spd ..0463 001102' spd ..1236 002040' spd ..1723 002660' spd ..2406 003553' spd ..0476 001067' spd ..1237 002064' spd ..1724 002661' spd ..2416 003570' spd ..0505 001111' spd ..1240 002021' spd ..1725 002657' spd ..2422 003600' spd ..0506 001133' spd ..1255 002112' spd ..1735 002670' spd ..2427 003601' spd ..0514 001117' spd ..1273 002126' spd ..1743 002674' spd ..2436 003636' spd ..0516 001130' spd ..1274 002131' spd ..1756 002675' spd ..2456 003716' spd ..0530 001200' spd ..1301 002150' spd ..1757 002754' spd ..2457 003721' spd ..0536 001173' spd ..1302 002152' spd ..1760 002714' spd ..2467 003736' spd ..0550 001251' spd ..1310 002152' spd ..1765 002715' spd ..2473 003745' spd ..0556 001212' spd ..1311 002245' spd ..1772 002712' spd ..2500 003746' spd ..0562 001220' spd ..1312 002156' spd ..1773 002713' spd ..2505 003754' spd ..0574 001225' spd ..1327 002173' spd ..1774 002710' spd ..2506 003764' spd ..0602 001233' spd ..1330 002200' spd ..2010 002727' spd ..2516 004014' spd ..0610 001244' spd ..1333 002212' spd ..2011 002730' spd ..2531 004037' spd ..0621 001270' spd ..1340 002244' spd ..2012 002726' spd ..2532 004044' spd ..0627 001260' spd ..1341 002206' spd ..2027 002735' spd ..2536 004054' spd ..0637 001265' spd ..1354 002212' spd ..2030 002751' spd ..2543 004057' spd ..0647 001343' spd ..1355 002244' spd ..2040 003002' spd ..2544 004060' spd ..0655 001307' spd ..1356 002236' spd ..2050 003007' spd ..2552 004072' spd ..0657 001302' spd ..1367 002242' spd ..2062 003024' spd ..2556 004100' spd ..0675 001313' spd ..1402 002261' spd ..2063 003033' spd ..2563 004101' spd ..0703 001320' spd ..1403 002264' spd ..2071 003060' spd ..2564 004112' spd ..0713 001336' spd ..1413 002324' spd ..2072 003061' spd ..2572 004107' spd ..0721 001327' spd ..1460 002334' spd ..2100 003072' spd ..2577 004112' spd ..0722 001334' spd ..1461 002336' spd ..2101 003074' spd ..2603 004132' spd ..0736 001421' spd ..1462 002354' spd ..2112 003125' spd ..2610 004133' spd ..0741 001371' spd ..1474 002372' spd ..2121 003135' spd ..2616 004163' spd ..0747 001367' spd ..1502 002430' spd ..2130 003147' spd ..2617 004164' spd ..0750 001370' spd ..1515 002431' spd ..2137 003155' spd ..2630 004302' spd ..0751 001402' spd ..1516 002452' spd ..2141 003164' spd ..2635 004303' spd ..0761 001412' spd ..1523 002442' spd ..2154 003164' spd ..2642 004252' spd ..0776 001451' spd ..1524 002452' spd ..2156 003207' spd ..2653 004266' spd ..1003 001506' spd ..1532 002464' spd ..2163 003215' spd ..2661 004272' spd ..1010 001471' spd ..1550 002466' spd ..2171 003221' spd ..2670 004340' spd ..1015 001474' spd ..1551 002521' spd ..2175 003264' spd ..2702 004363' spd ..1030 001531' spd ..1556 002477' spd ..2211 003276' spd ..2744 004503' spd ..1035 001533' spd ..1557 002520' spd ..2234 003336' spd ..2745 004504' spd ..1050 001573' spd ..1567 002500' spd ..2253 003417' spd ..2752 004525' spd ..1051 001575' spd ..1570 002520' spd ..2254 003421' spd ..2762 004532' spd ..1060 001553' spd ..1574 002534' spd ..2255 003416' spd ..2767 004534' spd ..1061 001562' spd ..1612 002537' spd ..2270 003414' spd ..2770 004557' spd k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT CODE ..3002 004603' spd ..3012 004610' spd ..3025 004617' spd ..3033 004643' spd ..3043 004650' spd ..3050 004652' spd ..3057 004702' spd ..3075 004725' spd ..3077 004733' spd ..3111 004756' spd ..3141 005057' spd ..3151 005064' spd ..3167 005125' spd ..3176 005151' spd ..3203 005154' spd ..3204 005156' spd ..3212 005166' spd ..3213 005201' spd ..3220 005201' spd ..3232 005224' spd ..3233 005240' spd ..3245 005254' spd ..3256 005257' spd ..3264 005270' spd ..3265 005274' spd ..3272 005274' spd ..3303 005362' spd ..3304 005365' spd ..3312 005402' spd ..3313 005404' spd ..3321 005411' spd ..CSC 000004 spd ..CSN 000003 spd ..IFT 400001 spd ..JX1 400000 spd ..MX1 070000 300000 spd ..MX2 000000 spd ..PST 000003 spd ..TX1 400000 spd ..TX2 000001 spd .XSTKS 005335' ext k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT TEXT DEFNAM 000000' k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT CONST ALLFLD 000245' int DATA 000000 ext DSCTAB 000130' NRTADR 000000' NRTDEV 000001' NRTNUM 000002' NSPTAB 000016' .DCXMX 000053 spd .SAV1 000000 ext .SAV2 000000 ext .SAV3 000000 ext k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-8 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT ETEXT UNKDEC 001530' k20net - Kermit-20 Network Support MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-9 K20NET MAC 5-May-24 16:57 SYMBOL TABLE FOR PSECT DATA BINFLG 000131' int TTYFLG 002141' int CNFIGD 000030' TTYGTB 002125' CNFMSG 000063' TTYNAM 002143' int FLUSHB 002167' TVTBIN 000026' int FORKLS 000133' int TVTCHK 000025' int FRKBUF 000522' TVTFLG 000024' int FRKPDL 000212' TVTUNK 000027' int HAVNBM 000123' VBICT 002152' int INITED 000116' VBOCT 002153' int INTBUF 000203' VCHRCN 002166' int JOB 000134' VSICT 002154' int MXHL 000014 spd VSIMX 002156' int MYNAME 000042' int VSITC 002155' int MYNODE 000041' int VSOCT 002157' int MYPROM 000057' int VSOMX 002161' int NBICT 002162' int VSOTC 002160' int NDVCHR 002131' int NDVFXP 000044' int NRTBUF 001123' NRTFLG 000130' int NRTOBJ 000145' NRTPRT 000132' NRTROS 000126' int NSICI 002163' int NSIMX 002165' int NSITC 002164' int NTIBLK 000014' int NTIHST 000000' int OASFLG 000135' OLDDIM 000120' OLDJFN 000137' OLDLTS 000125' OLDMOD 000117' OLDNAM 000141' OLDNUM 000140' OLDPAU 000121' OPNDEV 002146' OPNPAR 002151' int OPNSTS 002147' int OSGDEV 000136' PARBUF 001524' PTY1ST 002126' PTYCNT 002127' PTYDEV 002137' int PTYFLG 002133' int PTYGTB 002130' PTYNAM 002134' int PTYTTY 002140' int ROSNPT 000127' int SETLTS 000124' SYSCNT 000045' int SYSMSG 000122' SYSNAM 000046' int SYSVER 000062' TTYDEV 002142' int K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20TIM MAC 29-Apr-24 00:09 All edit 216 except for some 207 code moved 33994 title K20TIM - Kermit (Virtual) Device Timing 33995 subttl All edit 216 except for some 207 code moved 33996 33997 Comment " ; Make gnuEmacs font-rot mode happy 33998 33999 The module provides basic loopback tests on various devices, currently 34000 all virtual. These are called speed tests because the results are 34001 used to validate the calculations for the efficiency rating of the 34002 line in the statistics output. 34003 34004 Other routines concerned with timing and load average may be found 34005 here. 34006 34007 Loopback tests could be provided for a physical line, but this would 34008 require taking the line out of service and fitting it with a loopback 34009 connector. For now, it is assumed that the baud rate is both 34010 correctly reported and used. 34011 34012 Please read the following VERY carefully: 34013 34014 1) The reported speed can vary WILDLY depending on other system 34015 activity and is easily peturbed for no readily apparent 34016 reason. 34017 34018 2) The speed itself is only reporting how fast the monitor is 34019 shuttling data around and has no basis in any physical 34020 transport, media or reality. 34021 34022 3) Changing the various mode, byte sizes and record lengths of 34023 the connection can produce speed changes, but these are of 34024 little pratical use other than determining what might be the 34025 most effective connection configuration. 34026 34027 4) Be particularly wary of the byte size for essentially 34028 meaningless results. It's largely here for DECnet testing 34029 and to see what the pseudo-terminal device driver might be 34030 stripping. 34031 34032 5) While it is possible to time intervals to 100 kHz (I.E., DK10) 34033 resolution, it is fundamentally impossible to accurately 34034 correlate such intervals with the time of day. This is 34035 because Tops-20 keeps the time of day as an 18 bit fixed point 34036 fraction, which works out to a 'Time of Day' tick being 34037 approximately 329.58858646932 milliseconds. 34038 34039 However, there is no way to tell when Tops-20 will advance 34040 this because the last system set time (TADIDT) as calculated 34041 STAD% is not available nor is the millisecond uptime counter 34042 that is used to calculate it. The problem is made worse 34043 because there is thus no public correlation between HPTIM%, 34044 either. 34045 34046 The problem really can't be resolved without a change to 34047 Tops-20 to make TADIDT available and to store the elapsed 34048 millisecond clock that was used to do the calculation. K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-1 K20TIM MAC 29-Apr-24 00:09 All edit 216 except for some 207 code moved 34049 34050 This is not a problem for commands that display elapsed time, 34051 such as CLEAR. It is a problem for logging where using HPTIM% 34052 can occasionally produce the effect of time going backwards. 34053 " 34054 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20TIM MAC 29-Apr-24 00:09 Preliminaries 34055 subttl Preliminaries 34056 34057 search monsym,macsym,cmd,k20unv 34058 search dcam ; Double compare macros 34059 cmdacs ^ ; Clean up p1-p4 definitions 34060 34061 sall ; Tidy listing 34062 .directive flblst ; We don't need to see all the ASCIZ bytes... 34063 34064 remark common parsing external data and usage 34065 34066 extern pars1 ; Contains address of .TIME 34067 extern pars2 ; Parsed device id 34068 extern pars3 ; OPENF% mode 34069 extern pars4 ; OPENF% byte size 34070 extern pars5 ; Buffer size (RECORD-LENGTH) 34071 34072 remark ; Various support routines 34073 extern ascdev ; Turns a device number into ASCII text 34074 extern %%jser ; JSYS error handler 34075 extern %%smsg ; smsg macro support 34076 extern BOUTI% ;[216] BOUT% Internal 34077 extern symout ; Get symbolic name and offset of an address 34078 remark $TIME ; Is found in k20dsp and invokes the timing routines 34079 34080 remark ; Various external variables 34081 extern crlf ; Carriage return line feed sequence 34082 34083 remark ; Some constants 34084 34085 000511 456000 msiday==^d86400000 ; Milliseconds in a day 34086 100276 770000 dkday==msiday*^d100 ; 100 DK10 ticks per millisecond 34087 000001 000000 todtic==^d262144 ; TOD ticks in a day 34088 34089 .psect code/ronly ; Don't allow stores!! 34090 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20TIM MAC 29-Apr-24 00:09 TIME command parse table 34091 subttl TIME command parse table 34092 34093 remark ; Common Names of devices we can test 34094 34095 000000'02 000000 000000 %table(timtab) ; Begin a keyword table 34096 000001'02 000000# 777777 %key2 , -1 ; Copy another device's baud 34097 000000'03 143 157 160 171 000 34098 000002'02 000000# 600015 %key2 , .dvdes!.dvnul ; Idiomatic for NUL: 34099 000001'03 144 141 164 141 055 34100 000003'02 000000# 600022 %keyf3 , .dvdes!.dvdcn, cm%inv ; Allows escape recognition 34101 000003'03 002000 000001 34102 000004'03 104 103 116 000 000 34103 000004'02 000000# 600022 %key2 , .dvdes!.dvdcn ; Means either SRV: or DCN: 34104 000005'03 104 105 103 156 145 34105 000005'02 000000# 777777 %keyf3 , -1, cm%inv ; When Tom gets sleepy 34106 000007'03 002000 000001 34107 000010'03 144 165 160 154 151 34108 000006'02 000000# 000010' %keyf3 , %NUL, cm%inv!cm%abr ; Prefer NUL over NRT 34109 000012'03 002000 000005 34110 000013'03 156 000 000 000 000 34111 000007'02 000000# 600022 %keyf3 , .dvdes!.dvdcn, cm%inv ; Sleepy Tom types this 34112 000014'03 002000 000001 34113 000015'03 116 122 124 000 000 34114 000010'02 000000# 600015 %nul: %keyf3 , .dvdes!.dvnul, cm%inv ; Allows escape recognition 34115 000016'03 002000 000001 34116 000017'03 116 125 114 000 000 34117 000011'02 000000# 000013' %keyf3 , %pipe, cm%inv!cm%abr ; Prefer pipe over PIP: 34118 000020'03 002000 000005 34119 000021'03 160 151 000 000 000 34120 000012'02 000000# 600403 %keyf3 , .dvdes!.dvpip, cm%inv ; Allows escape recognition 34121 000022'03 002000 000001 34122 000023'03 120 111 120 000 000 34123 000013'02 000000# 600403 %pipe: %key2 , .dvdes!.dvpip ; Idiomatic for PIP: 34124 000024'03 160 151 160 145 000 34125 000014'02 000000# 600013 %key2 , .dvdes!.dvpty ; Idiotmatic for PTY: 34126 000025'03 160 163 145 165 144 34127 000015'02 000000# 600013 %keyf3 , .dvdes!.dvpty, cm%inv ; Don't specify device number 34128 000031'03 002000 000001 34129 000032'03 120 124 131 000 000 34130 000016'02 000000# 000020' %keyf3 , %reus, cm%inv!cm%abr ; Prefer re-use over reuse 34131 000033'03 002000 000005 34132 000034'03 162 000 000 000 000 34133 000017'02 000000# 000020' %keyf3 , %reus, cm%inv!cm%abr ; Prefer re-use over reuse 34134 000035'03 002000 000005 34135 000036'03 162 145 000 000 000 34136 000020'02 000000# 777777 %reus: %keyf3 , -1, cm%inv ; Previous dumb name for copy 34137 000037'03 002000 000001 34138 000040'03 162 145 055 165 163 34139 000021'02 000000# 777777 %keyf3 , -1, cm%inv ; Ditto 34140 000042'03 002000 000001 34141 000043'03 162 145 165 163 145 34142 000022'02 000000# 600023 %keyf3 , .dvdes!.dvsrv, cm%inv ; Allows escape recognition 34143 000045'03 002000 000001 34144 000046'03 123 122 126 000 000 34145 000000'02 000022 000022 %tbend K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20TIM MAC 29-Apr-24 00:09 TIME command parse table 34146 cleans(<%nul,%pipe,%reus>) ; Pitch working symbols 34147 34148 chgsec(code,const) ;;Chained FDB's go into CONST area 34149 000023'02 000004 000026' timfdb: flddb. .cmkey,,timtab,,,timfd1 34150 000024'02 000000 000000' 34151 000025'02 44 07 0 00 000351' 34152 000026'02 016004 000000 timfd1: flddb. .cmdev,,, 34153 000027'02 000000 000000 34154 000030'02 44 07 0 00 000355' 34155 retsec ;;Restore psect assumptions 34156 cleans() ;;Toss working symbol 34157 34158 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20TIM MAC 29-Apr-24 00:09 TIME (device) command parsing 34159 subttl TIME (device) command parsing 34160 34161 000000'01 .time: intern .time ; Invoked by top level parser 34162 000000'01 265 16 0 00 003446' saveac ; Just in case 34163 000001'01 200 16 0 00 000000# guide (virtual speed of) 34164 000002'01 260 17 0 00 000000* 34165 000031'02 000000000000# 34166 000000'04 166 151 162 164 165 34167 34168 000003'01 477 01 0 00 000002 setob t1, t2 ; Cons up some talisman 34169 000004'01 124 01 0 00 000000* dmovem t1, pars2 ; No device nor OPENF% mode parsed 34170 000005'01 124 01 0 00 000000* dmovem t1, pars4 ; No OPENF% byte size 34171 000006'01 202 01 0 00 000000# movem t1, timdev ; Device being timed 34172 34173 000007'01 201 01 0 00 000000# movei t1, timfdb ; Parse a device as a keyword or something real 34174 000010'01 260 17 0 00 000000* call rfield ; Try to get something 34175 000011'01 135 04 0 00 003454' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get parse function taken 34176 34177 000012'01 302 04 0 00 000000 caie t4, .cmkey ; Did a nice name? 34178 000013'01 254 00 0 00 000020' ifskp. ; Yep, that's not very difficult 34179 000014'01 524 02 0 02 000000 hrlo t2, (t2) ; Turn semantic action into a device designator 34180 000015'01 316 02 0 00 003455' camn t2, [-1] ; Wants to use a device's results elsewhere? 34181 000016'01 254 00 0 00 000125' callret .copy ; Yes, do that 34182 000017'01 201 04 0 00 000016 movei t4, .cmdev ; Otherwise, say we parsed a device 34183 000020'01 endif. ; And take the device case 34184 34185 000020'01 302 04 0 00 000016 caie t4, .cmdev ; Explicitly specified the device? 34186 000021'01 254 00 0 00 000040' ifskp. ; Yes, that's not much harder 34187 000022'01 554 01 0 00 000002 hlrz t1, t2 ; Pick up bare device designator 34188 000023'01 620 01 0 00 600000 txz t1, .dvdes ; Shut off the universal device code 34189 000024'01 202 01 0 00 000004* movem t1, pars2 ; Finally save just the device type number 34190 34191 000025'01 306 01 0 00 000013 cain t1, .dvpty ; Pseudo-terminal? 34192 000026'01 254 00 0 00 000052' callret parpty ; Yes, maybe parse its switch modifiers 34193 000027'01 306 01 0 00 000403 cain t1, .dvpip ; Pipe device? 34194 000030'01 254 00 0 00 000054' callret parpip ; Yes, maybe parse its switch modifiers 34195 000031'01 306 01 0 00 000015 cain t1, .dvnul ; NULL (or NIL) device? 34196 000032'01 254 00 0 00 000056' callret parnul ; Yes, maybe parse its bytesize modifier 34197 000033'01 302 01 0 00 000023 caie t1, .dvsrv ; DECnet passive component? 34198 000034'01 306 01 0 00 000022 cain t1, .dvdcn ; or DECnet active component 34199 000035'01 254 00 0 00 000060' callret pardcn ; Yes, maybe parse its switch modifiers 34200 ; None of the above, so nothing special 34201 000036'01 260 17 0 00 000000* confrm ; Tie off the line 34202 000037'01 263 17 0 00 000000 ret ; And done 34203 000040'01 endif. ; End case .cmdev parse item 34204 34205 000040'01 broken: remark ; Otherwise, we are deeply confused 34206 000040'01 200 01 0 00 000000# emsg() ; Begin the blat 34207 000041'01 104 00 0 00 000313 34208 000032'02 000000000000# 34209 000004'04 111 156 166 141 154 34210 000042'01 201 01 0 00 000101 movei t1, .priou ; Continue blatting on the terminal 34211 000043'01 200 02 0 00 000004 move t2, t4 ; Loaded the parsed function 34212 000044'01 201 03 0 00 000010 movei t3, fld(^d8,no%rdx) ;Function codes are octal 34213 000045'01 104 00 0 00 000224 NOUT% ; Tell us that, it may be of use K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4-1 K20TIM MAC 29-Apr-24 00:09 TIME (device) command parsing 34214 000046'01 320 12 0 00 000047' erjmpr .+1 ; Ignore error, we're trying hard enough 34215 34216 000047'01 561 01 0 00 000000* hrroi t1, crlf ; Tie off the blat 34217 000050'01 104 00 0 00 000076 PSOUT% 34218 000051'01 263 17 0 00 000000 ret ; And go no further 34219 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20TIM MAC 29-Apr-24 00:09 Device secondary parse tables and function descriptor blocks 34220 subttl Device secondary parse tables and function descriptor blocks 34221 34222 remark Various switches for each device 34223 34224 000033'02 000000 000000 %table(nulswi) ; General device switch table 34225 000034'02 000000# 000000# %key2 ,parbyt ;Parse byte size 34226 000047'03 142 171 164 145 163 34227 000033'02 000001 000001 %tbend 34228 34229 000035'02 000000 000000 %table(devswi) ; General device switch table 34230 000036'02 000000# 000000# %key2 ,parbyt ;Parse byte size 34231 000051'03 142 171 164 145 163 34232 000037'02 000000# 000000# %key2 ,parmod ; Parse mode 34233 000053'03 155 157 144 145 072 34234 000035'02 000002 000002 %tbend 34235 34236 000040'02 000000 000000 %table(pipswi) ; Begin a special switch table for pipes 34237 000041'02 000000# 000000# %key2 ,parbyt ;Parse byte size 34238 000055'03 142 171 164 145 163 34239 000042'02 000000# 000000# %key2 ,parmod ; Parse mode 34240 000057'03 155 157 144 145 072 34241 000043'02 000000# 000000# %key2 ,parecl 34242 000061'03 162 145 143 157 162 34243 000040'02 000003 000003 %tbend 34244 34245 remark Switches applicable to potentiall all devices 34246 34247 000044'02 000000 000000 %table(modkey) ; N.B., Not all devices support all modes!! 34248 000045'02 000000# 000017 %keyf3 ,.GSDMP, cm%inv ;N.B., No device here supports dump mode 34249 000064'03 002000 000001 34250 000065'03 144 165 155 160 000 34251 000046'02 000000# 000047' %keyf3 , %imag, cm%abr!cm%inv 34252 000066'03 002000 000005 34253 000067'03 151 000 000 000 000 34254 000047'02 000000# 000010 %imag: %key2 , .GSIMG 34255 000070'03 151 155 141 147 145 34256 000050'02 000000# 000001 %keyf3 ,.GSSMB, cm%inv 34257 000072'03 002000 000001 34258 000073'03 151 156 164 145 162 34259 000051'02 000000# 000000 %key2 ,.GSNRM 34260 000076'03 156 157 162 155 141 34261 000052'02 000000# 000001 %key2 , .GSSMB 34262 000100'03 163 155 141 154 154 34263 000044'02 000006 000006 %tbend 34264 cleans(<%imag>) ;;Clean working symbol out of MACRO tables 34265 34266 chgsec(code,const) ;;Chained FDB's are in CONST, not code 34267 000053'02 010004 000056' parfdb: flddb. .cmcfm,,,,,parfd1 34268 000054'02 000000 000000 34269 000055'02 44 07 0 00 000365' 34270 000056'02 003000 000000 parfd1: flddb. .cmswi,,devswi, ;; or OPENF% mode modifiers 34271 000057'02 000000 000035' 34272 34273 000060'02 010004 000063' pipfdb: flddb. .cmcfm,,,,,pipfd1 34274 000061'02 000000 000000 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5-1 K20TIM MAC 29-Apr-24 00:09 Device secondary parse tables and function descriptor blocks 34275 000062'02 44 07 0 00 000376' 34276 000063'02 003000 000000 pipfd1: flddb. .cmswi,,pipswi ;; or OPENF% mode and GTJFN% modifiers 34277 000064'02 000000 000040' 34278 34279 000065'02 010004 000070' nilfdb: flddb. .cmcfm,,,,,nilfd1 34280 000066'02 000000 000000 34281 000067'02 44 07 0 00 000405' 34282 000070'02 003000 000000 nilfd1: flddb. .cmswi,,nulswi, ;; NIL was the original TENEX name for NUL: 34283 000071'02 000000 000033' 34284 34285 000072'02 010004 000075' dcnfdb: flddb. .cmcfm,,,,,dcnfd1 34286 000073'02 000000 000000 34287 000074'02 44 07 0 00 000415' 34288 000075'02 003000 000000 dcnfd1: flddb. .cmswi,,devswi, ;; or OPENF% mode and GTJFN% modifiers 34289 000076'02 000000 000035' 34290 34291 34292 retsec ;;Back to code .psect 34293 cleans() 34294 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20TIM MAC 29-Apr-24 00:09 Device secondary (switch) parsing 34295 subttl Device secondary (switch) parsing 34296 34297 000052'01 201 05 0 00 000000# parpty: movei q1, parfdb ; Handle case of pseudo terminal 34298 000053'01 254 00 0 00 000062' callret parswi ; Now parse for PTY:'s switches 34299 34300 000054'01 201 05 0 00 000000# parpip: movei q1, pipfdb ; Handle pipe device 34301 000055'01 254 00 0 00 000062' callret parswi ; Now parse for PIP:'s switches 34302 34303 000056'01 201 05 0 00 000000# parnul: movei q1, nilfdb ; Handle NUL: (or NIL) device 34304 000057'01 254 00 0 00 000062' callret parswi ; Now parse for NUL:'s switches 34305 34306 000060'01 201 05 0 00 000000# pardcn: movei q1, dcnfdb ; Handle DECnet (SRV:/DCN:) device 34307 000061'01 254 00 0 00 000062' callret parswi ; Now parse for DCN:'s switch 34308 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20TIM MAC 29-Apr-24 00:09 Common secondary switch parsing 34309 subttl Common secondary switch parsing 34310 34311 000062'01 parswi: do. ; Enter loop logical context 34312 000062'01 200 01 0 00 000005 move t1, q1 ; Load the requested parse FDB 34313 000063'01 260 17 0 00 000010* call rfield ; Go parse something 34314 000064'01 135 04 0 00 003454' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get parse function taken 34315 000065'01 306 04 0 00 000010 cain t4, .cmcfm ; Confirmed? 34316 000066'01 263 17 0 00 000000 ret ; They did, we're done 34317 000067'01 550 01 0 02 000000 hrrz t1, (t2) ; Otherwise, we have a switch to do 34318 000070'01 260 17 0 01 000000 call (t1) ; So Pick up switch parsed and call it 34319 000071'01 600 00 0 00 000000 nop ; Ignore any skip/non-skip (none currently skip) 34320 000072'01 254 00 0 00 000062' loop. ; Go get some more switches until confirmed 34321 000073'01 enddo. ; End loop lexical context 34322 34323 remark Here to handle BYTESIZE, MODE and RECORD-LENGTH switches 34324 34325 000073'01 parbyt: remark Parse file byte size 34326 000073'01 201 01 0 00 003462' movei t1, [flddb. .cmnum,,^d10,] 34327 000074'01 260 17 0 00 000063* call rfield ; Get a number 34328 000075'01 327 02 0 00 000101' ifle. t2 ; Gubbish? 34329 000076'01 200 01 0 00 000000# emsg 34330 000077'01 104 00 0 00 000313 34331 000077'02 000000000000# 34332 000013'04 111 154 154 157 147 34333 000100'01 254 00 0 00 000000* jrst cmder1 ; Complain and allow command retry. 34334 000101'01 endif. 34335 000101'01 307 02 0 00 000044 caig t2,^d36 ; Being overly bullish? 34336 000102'01 254 00 0 00 000106' ifskp. ; Then it isn't a DIGITAL computer... 34337 000103'01 200 01 0 00 000000# emsg 34338 000104'01 104 00 0 00 000313 34339 000100'02 000000000000# 34340 000025'04 124 150 145 040 120 34341 000105'01 254 00 0 00 000100* jrst cmder1 ; Complain and allow command retry. 34342 000106'01 endif. 34343 000106'01 202 02 0 00 000005* movem t2, pars4 ; Store byte size for OPENF% 34344 000107'01 263 17 0 00 000000 ret ; Get more switches 34345 34346 000110'01 parmod: remark Parse file mode 34347 000110'01 201 01 0 00 003471' movei t1, [flddb. .cmkey,,modkey,] 34348 000111'01 260 17 0 00 000074* call rfield ; Get a keyword 34349 000112'01 550 01 0 02 000000 hrrz t1, (t2) ; Turn semantic action into a mode value 34350 000113'01 202 01 0 00 000000* movem t1, pars3 ; Store OPENF% mode 34351 000114'01 263 17 0 00 000000 ret ; Get more switches 34352 34353 000115'01 parecl: remark Parse RECORD-LENGTH attrbute 34354 000115'01 201 01 0 00 003500' movei t1, [flddb. .cmnum,,^d10,] 34355 000116'01 260 17 0 00 000111* call rfield ; Get a number 34356 000117'01 327 02 0 00 000123' ifle. t2 ; Gubbish? 34357 000120'01 200 01 0 00 000000# emsg 34358 000121'01 104 00 0 00 000313 34359 000101'02 000000000000# 34360 000042'04 111 154 154 157 147 34361 000122'01 254 00 0 00 000105* jrst cmder1 ; Complain and allow command retry. 34362 000123'01 endif. 34363 000123'01 202 02 0 00 000000* movem t2, pars5 ; Store monitor buffer size (RECORD-LENGTH) K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7-1 K20TIM MAC 29-Apr-24 00:09 Common secondary switch parsing 34364 000124'01 263 17 0 00 000000 ret ; Get more switches 34365 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20TIM MAC 29-Apr-24 00:09 Copy one device's speed test over another's 34366 subttl Copy one device's speed test over another's 34367 34368 ; Useful because inter-fork pseudo-terminal speed is FAR slower than 34369 ; inter-job speed, resulting in efficiency percentages in the 34370 ; quadruple digit range. 34371 34372 remark ; Common Names of device tests we can copy 34373 34374 000102'02 000000 000000 %table(coptab) ; Begin a keyword table 34375 000103'02 000000# 600015 %key2 , .dvdes!.dvnul ; Idiomatic for NUL: 34376 000102'03 144 141 164 141 055 34377 000104'02 000000# 600022 %keyf3 , .dvdes!.dvdcn, cm%inv ; Allows escape recognition 34378 000104'03 002000 000001 34379 000105'03 104 103 116 000 000 34380 000105'02 000000# 600022 %key2 , .dvdes!.dvdcn ; Means either SRV: or DCN: 34381 000106'03 104 105 103 156 145 34382 000106'02 000000# 000110' %keyf3 , %nul1, cm%inv!cm%abr ; Prefer NUL over NRT 34383 000110'03 002000 000005 34384 000111'03 156 000 000 000 000 34385 000107'02 000000# 600022 %keyf3 , .dvdes!.dvdcn, cm%inv ; Sleepy Tom types this 34386 000112'03 002000 000001 34387 000113'03 116 122 124 000 000 34388 000110'02 000000# 600015 %nul1: %keyf3 , .dvdes!.dvnul, cm%inv ; Allows escape recognition 34389 000114'03 002000 000001 34390 000115'03 116 125 114 000 000 34391 000111'02 000000# 000113' %keyf3 , %pip1, cm%inv!cm%abr ; Prefer pipe over PIP: 34392 000116'03 002000 000005 34393 000117'03 160 151 000 000 000 34394 000112'02 000000# 600403 %keyf3 , .dvdes!.dvpip, cm%inv ; Allows escape recognition 34395 000120'03 002000 000001 34396 000121'03 120 111 120 000 000 34397 000113'02 000000# 600403 %pip1: %key2 , .dvdes!.dvpip ; Idiomatic for PIP: 34398 000122'03 160 151 160 145 000 34399 000114'02 000000# 600013 %key2 , .dvdes!.dvpty ; Idiotmatic for PTY: 34400 000123'03 160 163 145 165 144 34401 000115'02 000000# 600013 %keyf3 , .dvdes!.dvpty, cm%inv ; Allows escape recognition 34402 000127'03 002000 000001 34403 000130'03 120 124 131 000 000 34404 000116'02 000000# 600023 %keyf3 , .dvdes!.dvsrv, cm%inv ; Allows escape recognition 34405 000131'03 002000 000001 34406 000132'03 123 122 126 000 000 34407 000102'02 000014 000014 %tbend 34408 34409 cleans(<%nul1,%pip1>) ; Toss working symbols 34410 34411 chgsec(code,const) ;;Chained FDB's go into const 34412 000117'02 000004 000122' cpffdb: flddb. .cmkey,,coptab,,,cpffd1 34413 000120'02 000000 000102' 34414 000121'02 44 07 0 00 000424' 34415 000122'02 016004 000000 cpffd1: flddb. .cmdev,,, 34416 000123'02 000000 000000 34417 000124'02 44 07 0 00 000355' 34418 34419 000125'02 000004 000130' cptfdb: flddb. .cmkey,,coptab,,,cptfd1 34420 000126'02 000000 000102' K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-1 K20TIM MAC 29-Apr-24 00:09 Copy one device's speed test over another's 34421 000127'02 44 07 0 00 000432' 34422 000130'02 016004 000000 cptfd1: flddb. .cmdev,,, 34423 000131'02 000000 000000 34424 000132'02 44 07 0 00 000355' 34425 retsec ;;Return to code .psect 34426 34427 cleans() ;;Punt the working symbols 34428 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20TIM MAC 29-Apr-24 00:09 TIME COPY command parsing 34429 subttl TIME COPY command parsing 34430 34431 000125'01 265 16 0 00 003503' .copy: saveac ; Wants another AC 34432 000126'01 200 16 0 00 000000# guide (a previous timing test result for) 34433 000127'01 260 17 0 00 000002* 34434 000133'02 000000000000# 34435 000055'04 141 040 160 162 145 34436 remark t5, q1 ; Note aliased, assumed saved 34437 34438 000130'01 201 01 0 00 000000# movei t1, cpffdb ; Copy-From FDB 34439 000131'01 260 17 0 00 000116* call rfield ; Try to get something 34440 000132'01 135 04 0 00 003454' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get parse function taken 34441 34442 000133'01 302 04 0 00 000000 caie t4, .cmkey ; Did an idiomatic name? 34443 000134'01 254 00 0 00 000137' ifskp. ; Yep, that's not very difficult 34444 000135'01 524 02 0 02 000000 hrlo t2, (t2) ; Turn semantic action into a device designator 34445 000136'01 201 04 0 00 000016 movei t4, .cmdev ; Say we parsed a device 34446 000137'01 endif. ; And take the device case 34447 34448 000137'01 302 04 0 00 000016 caie t4, .cmdev ; If not a device at this point, 34449 000140'01 254 00 0 00 000040' jrst broken ; ...we are deeply broken... 34450 34451 000141'01 554 01 0 00 000002 hlrz t1, t2 ; Pick up bare device designator 34452 000142'01 620 01 0 00 600000 txz t1, .dvdes ; Shut off the universal device code 34453 000143'01 200 05 0 00 000001 move q1, t1 ; Save just the 'source' device type number 34454 34455 000144'01 200 16 0 00 000000# guide (to another device) 34456 000145'01 260 17 0 00 000127* 34457 000134'02 000000000000# 34458 000064'04 164 157 040 141 156 34459 34460 000146'01 201 01 0 00 000000# movei t1, cptfdb ; Copy-To FDB 34461 000147'01 260 17 0 00 000131* call rfield ; Try to get something 34462 000150'01 135 04 0 00 003454' ldb t4, [pointr (.cmfnp(t3),cm%fnc)] ; Get parse function taken 34463 34464 000151'01 302 04 0 00 000000 caie t4, .cmkey ; Did an idomatic name? 34465 000152'01 254 00 0 00 000155' ifskp. ; Indeed; transmorgrify 34466 000153'01 524 02 0 02 000000 hrlo t2, (t2) ; Turn semantic action into a device designator 34467 000154'01 201 04 0 00 000016 movei t4, .cmdev ; Say we parsed a device 34468 000155'01 endif. ; And take the device case 34469 34470 000155'01 302 04 0 00 000016 caie t4, .cmdev ; If not a device at this point, we are 34471 000156'01 254 00 0 00 000040' jrst broken ; deeply broken... 34472 34473 000157'01 554 06 0 00 000002 hlrz q2, t2 ; Pick up bare device designator 34474 000160'01 620 06 0 00 600000 txz q2, .dvdes ; Shut off the universal device code 34475 000161'01 312 05 0 00 000006 came q1, q2 ; Are we trying to reuse ourself? 34476 000162'01 254 00 0 00 000174' ifskp. ; Yes, don't let's be silly 34477 000163'01 200 01 0 00 000000# emsg 34478 000164'01 104 00 0 00 000313 34479 000135'02 000000000000# 34480 000070'04 122 145 144 165 156 34481 000165'01 200 01 0 00 000005 move t1, q1 ; Load device number 34482 000166'01 260 17 0 00 000000* call ascdev ; Turn into a string 34483 000167'01 104 00 0 00 000076 PSOUT% ; Type it K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-1 K20TIM MAC 29-Apr-24 00:09 TIME COPY command parsing 34484 txmsg <'s timing test result onto itself 34485 000170'01 200 01 0 00 000000# > 34486 000171'01 104 00 0 00 000076 34487 000172'01 320 12 0 00 000173' 34488 000136'02 000000000000# 34489 000074'04 047 163 040 164 151 34490 34491 000173'01 254 00 0 00 000122* jrst cmder1 ; Complain and allow command retry. 34492 000174'01 endif. 34493 000174'01 260 17 0 00 000036* confrm ; Tie off the line 34494 remark ; Fall through to execute the code 34495 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20TIM MAC 29-Apr-24 00:09 Re-use semantic action, not called since only one keyword 34496 subttl Re-use semantic action, not called since only one keyword 34497 34498 extern pvbaud ; PTY: virtual baud rate 34499 extern pibaud ; PIP: virtual baud rate 34500 extern nlbaud ; NUL: virtual baud rate 34501 extern dnbaud ; DCN:/SRV: pair virtual baud rate 34502 34503 000175'01 $copy: remark ; Check source tests 34504 000175'01 477 03 0 00 000004 setob t3, t4 ; Assume we don't know either 34505 000176'01 306 05 0 00 000013 cain q1, .dvpty ; Pseudo-terminal? 34506 000177'01 201 03 0 00 000000* movei t3, pvbaud ; Address of test results 34507 000200'01 306 05 0 00 000403 cain q1, .dvpip ; Pipe device? 34508 000201'01 201 03 0 00 000000* movei t3, pibaud ; Address of test results 34509 000202'01 306 05 0 00 000015 cain q1, .dvnul ; NULL (or NIL) device? 34510 000203'01 201 03 0 00 000000* movei t3, nlbaud ; Address of test results 34511 000204'01 302 05 0 00 000023 caie q1, .dvsrv ; DECnet passive component? 34512 000205'01 306 05 0 00 000022 cain q1, .dvdcn ; or DECnet active component 34513 000206'01 201 03 0 00 000000* movei t3, dnbaud ; Yes, has the same test result address 34514 000207'01 321 03 0 00 000244' jumpl t3, $copys ; We don't have a test for this source 34515 34516 remark ; Check destination tests 34517 000210'01 306 06 0 00 000013 cain q2, .dvpty ; Pseudo-terminal? 34518 000211'01 201 04 0 00 000177* movei t4, pvbaud ; Address of test results 34519 000212'01 306 06 0 00 000403 cain q2, .dvpip ; Pipe device? 34520 000213'01 201 04 0 00 000201* movei t4, pibaud ; Address of test results 34521 000214'01 306 06 0 00 000015 cain q2, .dvnul ; NULL (or NIL) device? 34522 000215'01 201 04 0 00 000203* movei t4, nlbaud ; Address of test results 34523 000216'01 302 06 0 00 000023 caie q2, .dvsrv ; DECnet passive component? 34524 000217'01 306 06 0 00 000022 cain q2, .dvdcn ; or DECnet active component 34525 000220'01 201 04 0 00 000206* movei t4, dnbaud ; Yes, has the same test result address 34526 000221'01 321 04 0 00 000246' jumpl t4, $copyd ; We don't have a test for this destination 34527 34528 000222'01 120 01 0 03 000000 dmove t1, (t3) ; Pick up source test 34529 000223'01 323 01 0 00 000233' jumple t1, $copyn ; No test run 34530 000224'01 124 01 0 04 000000 dmovem t1, (t4) ; Overwrite destination results 34531 000225'01 124 01 0 00 000106* dmovem t1, pars4 ; Store for $SHOW 34532 34533 remark ; Turn device numbers back into device 34534 000226'01 524 01 0 00 000005 hrlo t1, q1 ; Reposition source device number 34535 000227'01 661 01 0 00 600000 tlo t1, .dvdes ; Now a device designator 34536 000230'01 200 02 0 00 000006 move t2, q2 ; Load destination device number 34537 000231'01 124 01 0 00 000024* dmovem t1, pars2 ; Store as device designators 34538 34539 000232'01 263 17 0 00 000000 ret ; Return into $SHOW 34540 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20TIM MAC 29-Apr-24 00:09 various error handlers 34541 subttl various error handlers 34542 34543 chgsec(code,text) ;;Text .psect for strings 34544 000133'03 116 157 040 164 151 $copym: asciz "No timing run yet for " 34545 retsec ;;Get back in code .psect 34546 34547 000233'01 $copyn: remark ; Here if no test has been run 34548 000233'01 561 01 0 00 000000# hrroi t1, $copym ; Load common preamble 34549 000234'01 104 00 0 00 000313 ESOUT% ; Begin blat 34550 34551 000235'01 200 01 0 00 000005 move t1, q1 ; Pick up source device number 34552 000236'01 260 17 0 00 000166* call ascdev ; Convert to a string 34553 000237'01 104 00 0 00 000076 PSOUT% ; Type it 34554 34555 000240'01 561 01 0 00 000047* hrroi t1, crlf ; Tie off the line 34556 000241'01 104 00 0 00 000076 PSOUT% 34557 000242'01 476 00 0 00 000231* setom pars2 ; Flag already blatted 34558 000243'01 263 17 0 00 000000 ret ; Return into $SHOW 34559 34560 000244'01 $copys: remark ; Here if source device is unknown 34561 000244'01 202 05 0 00 000242* movem q1, pars2 ; Load the device number 34562 000245'01 263 17 0 00 000000 ret ; Return into $SHOW 34563 34564 000246'01 $copyd: remark ; Here if destination device is unknown 34565 000246'01 202 06 0 00 000244* movem q2, pars2 ; Load the device number 34566 000247'01 263 17 0 00 000000 ret ; Return into $SHOW 34567 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20TIM MAC 29-Apr-24 00:09 Determine PTY Virtual Baud rate 34568 subttl Determine PTY Virtual Baud rate 34569 34570 ; N.B., this code is not intended to provide a definitive answer to 34571 ; ANYTHING because Tops-20 is not a real-time system. Even a speck 34572 ; of system load can wildly peturb the results as well as whatever the 34573 ; current monitor's pseudo-terminal implementation happens to be. 34574 ; 34575 ; Also, the speed of a PTY in an intra-job context (as is done below) 34576 ; appears to be slower than the more typical inter-job example, as 34577 ; used by BATCON and Kermit's pseudo-terminal connection code. 34578 ; 34579 ; This result is therefore best viewed as a number suitable for 34580 ; checkout of the calculations performed in the efficiency code for a 34581 ; physical baud rate, if such a thing is ever seen again. 34582 34583 000250'01 dptybd: intern dptybd ; May be invoked as a test 34584 000250'01 265 16 0 00 003511' saveac ;Holds PTY particulars 34585 remark ; N.B., q4 and p1 are aliases!! 34586 34587 000251'01 403 05 0 00 000006 setzb q1, q2 ; No PTY or terminal JFN 34588 000252'01 403 07 0 00 000010 setzb q3, q4 ; No assigned PTY or TTY device 34589 000253'01 400 12 0 00 000013 setz p2, p3 ; No fork created 34590 34591 000254'01 260 17 0 00 000702' call comput ; Get correct byte pointer and count 34592 000255'01 260 17 0 00 000260' call ptyjfn ; Set JFN's to time a PTY: 34593 000256'01 254 00 0 00 001235' jrst epicom ; If failed, hit the epilogue 34594 000257'01 254 00 0 00 000715' callret tcommn ; Otherwise, hit the common code 34595 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20TIM MAC 29-Apr-24 00:09 Set up a PTY:/TTY: pair for transfer timing 34596 subttl Set up a PTY:/TTY: pair for transfer timing 34597 34598 ; +1/ Couldn't do it 34599 ; +2/ Worked 34600 ; 34601 ; q1/ Open PTY JFN and flags 34602 ; q2/ Open TTY JFN and flags 34603 ; q3/ Assigned PTY device 34604 ; q4/ Assigned TTY device 34605 34606 extern asipty ; Assign a pseudo-terminal 34607 extern ptynam,ttynam ; ASCII names of assigned devices 34608 extern asgflg ; Flag for assigned device 34609 extern asgdev ; Device actually assigned 34610 extern ndvchr ; Double word device characteristics 34611 extern ptytty ; PTY to TTY: line mapping 34612 extern ptyflg ; Using a pseudo-terminal 34613 extern binflg ; Device is in binary (8-bit) mode 34614 34615 000260'01 ptyjfn: remark ;Expects caller to have saved these 34616 remark ; N.B., q4 and p1 are aliases!! 34617 34618 000260'01 402 00 0 00 000000* setzm asgflg ; Force an assignment 34619 000261'01 260 17 0 00 000000* call asipty ; Grab us a PTY 34620 000262'01 263 17 0 00 000000 ret ; or not... 34621 000263'01 200 07 0 00 000002 move q3, t2 ; Store the returned PTY designator 34622 000264'01 505 01 0 00 600012 hrli t1,.dvdes+.dvtty ; Turn returned line into a TTY designator 34623 000265'01 104 00 0 00 000070 ASND% ; Grab associated terminal, too 34624 000266'01 320 12 0 00 000270' %jserr (,r) ; Odd, just got the PTY... 34625 000267'01 254 00 0 00 000273' 34626 000270'01 265 01 0 00 000000* 34627 000271'01 000000000000# 34628 000272'01 254 00 0 00 000000* 34629 000104'04 103 157 165 154 144 34630 000273'01 200 10 0 00 000001 move q4, t1 ; Store assigned terminal's device designator 34631 34632 remark ; PTY takes mode of TTY:, so open that first 34633 dmove t1, [ gj%sht!gj%flg ; Want GTJFN% flags returned 34634 000274'01 120 01 0 00 003525' -1,,ttynam ] ; asipty built this for us 34635 000275'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the PTY's associated TTY 34636 000276'01 320 12 0 00 000300' %jserr (,r) 34637 000277'01 254 00 0 00 000303' 34638 000300'01 265 01 0 00 000270* 34639 000301'01 000000000000# 34640 000302'01 254 00 0 00 000272* 34641 000112'04 103 141 156 047 164 34642 000303'01 200 06 0 00 000001 move q2, t1 ; Store TTY JFN and flags 34643 000304'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags so OPENF% doesn't choke 34644 000305'01 200 02 0 00 003527' movx t2, ; 8-bit bytes 34645 000306'01 335 03 0 00 000113* skipge t3, pars3 ; Load parsed OPENF% mode 34646 000307'01 254 00 0 00 000311' ifskp. ; User specified it, let's use it 34647 000310'01 137 03 0 00 003530' dpb t3, [pointr t2, of%mod] 34648 000311'01 endif. 34649 000311'01 337 04 0 00 000225* skipg t4, pars4 ; Load parsed OPENF% byte size 34650 000312'01 254 00 0 00 000314' ifskp. ; User specified it, let's use it K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13-1 K20TIM MAC 29-Apr-24 00:09 Set up a PTY:/TTY: pair for transfer timing 34651 000313'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34652 000314'01 endif. 34653 000314'01 104 00 0 00 000021 OPENF% ; read-only 34654 000315'01 320 12 0 00 000317' %jserr (,r) 34655 000316'01 254 00 0 00 000322' 34656 000317'01 265 01 0 00 000300* 34657 000320'01 000000000000# 34658 000321'01 254 00 0 00 000302* 34659 000120'04 103 141 156 047 164 34660 34661 dmove t1, [ gj%sht!gj%flg ; Want GTJFN% flags returned 34662 000322'01 120 01 0 00 003532' -1,,ptynam ] ; asipty built this for us 34663 000323'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the PTY 34664 000324'01 320 12 0 00 000326' %jserr (,r) 34665 000325'01 254 00 0 00 000331' 34666 000326'01 265 01 0 00 000317* 34667 000327'01 000000000000# 34668 000330'01 254 00 0 00 000321* 34669 000126'04 103 141 156 047 164 34670 000331'01 200 05 0 00 000001 move q1, t1 ; Store PTY JFN and flags 34671 000332'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags so OPENF% doesn't choke 34672 000333'01 200 02 0 00 003534' movx t2, ; 8-bit bytes 34673 remark of%mod ; PTY itself *ONLY* supports normal mode 34674 000334'01 337 04 0 00 000311* skipg t4, pars4 ; Load parsed OPENF% byte size 34675 000335'01 254 00 0 00 000337' ifskp. ; User specified it, let's use it 34676 000336'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34677 000337'01 endif. 34678 000337'01 104 00 0 00 000021 OPENF% ; normal mode (only one supported), write-only 34679 000340'01 320 12 0 00 000342' %jserr (,r) 34680 000341'01 254 00 0 00 000345' 34681 000342'01 265 01 0 00 000326* 34682 000343'01 000000000000# 34683 000344'01 254 00 0 00 000330* 34684 000136'04 103 141 156 047 164 34685 34686 000345'01 254 00 0 00 000000* retskp ; Return success 34687 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20TIM MAC 29-Apr-24 00:09 Determine PIP: Virtual Baud Rate 34688 subttl Determine PIP: Virtual Baud Rate 34689 34690 ; N.B., this code is not intended to provide a definitive answer to 34691 ; ANYTHING because Tops-20 is not a real-time system. Even a speck 34692 ; of system load can wildly peturb the results as well as whatever the 34693 ; current monitor's pipe implementation happens to be. 34694 ; 34695 ; See dptybd for more extensive commentary 34696 34697 000346'01 dpipbd: intern dpipbd ; May be invoked as a test 34698 000346'01 265 16 0 00 003511' saveac ;Holds pipe particulars 34699 remark ; N.B., q4 and p1 are aliases!! 34700 34701 000347'01 403 05 0 00 000006 setzb q1, q2 ; No source or destination PIP: JFN 34702 000350'01 403 07 0 00 000010 setzb q3, q4 ; No assigned PIP: device 34703 000351'01 400 12 0 00 000013 setz p2, p3 ; No fork created 34704 34705 000352'01 260 17 0 00 000702' call comput ; Get correct byte pointer and count 34706 000353'01 260 17 0 00 000356' call pipjfn ; Set JFN's to time a PIP: device 34707 000354'01 254 00 0 00 001235' jrst epicom ; If failed, hit the epilogue 34708 000355'01 254 00 0 00 000715' callret tcommn ; Worked, hit the common code 34709 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20TIM MAC 29-Apr-24 00:09 Set up a PIP: pair for transfer timing 34710 subttl Set up a PIP: pair for transfer timing 34711 34712 ; +1/ Couldn't do it 34713 ; +2/ Worked 34714 ; 34715 ; q1/ Open write PIP: JFN and flags 34716 ; q2/ Open read PIP: JFN and flags 34717 ; q3/ Zero (no assigned write device) 34718 ; q4/ Zero (assigned read device) 34719 34720 ; N.B., Can't use ";RECORD-SIZE:500" attribute. Broken. 34721 ; Proper format is RECORD-LENGTH 34722 34723 chgsec(code,data) ;;Needs some storage 34724 000000'05 pipnam: block ^d20 ; Space to build name 34725 000024'05 pip2nd: block 4 ; Space for 19 characters, plus nul 34726 retsec ;;Get out of data psect 34727 34728 chgsec(code,text) ;;Put strings into text psect 34729 000140'03 120 111 120 072 056 pip1st: ASCIZ /PIP:.;RECORD-LENGTH:/ ; From PIPE.MAC (N.B., NOT RECORD-SIZE!) 34730 remark 12345678901234567890 ; Four words of storage 34731 retsec ;;Back in code psect 34732 34733 remark pars3 ; OPENF% mode 34734 remark pars4 ; OPENF% byte size 34735 remark pars5 ; Buffer size (RECORD-LENGTH) 34736 34737 000356'01 pipjfn: remark ;Expects caller to have saved these 34738 remark ; N.B., q4 and p1 are aliases!! 34739 34740 remark q1, q2, q3, q4 ; Assumes all zero 34741 34742 000356'01 333 02 0 00 000123* skiple t2, pars5 ; See if we have a record length 34743 000357'01 254 00 0 00 000364' ifskp. ; We don't 34744 000360'01 200 03 0 00 000000# move t3, pip1st ; Pick up first five characters (nice hack, Tom) 34745 000361'01 400 04 0 00 000000 setz t4, ; Tie off with .chnul's 34746 000362'01 124 03 0 00 000000# dmovem t3, pipnam ; Stomp into the file specification 34747 000363'01 254 00 0 00 000401' else. ; Otherwise, wants to specify it 34748 000364'01 120 03 0 00 000000# dmove t3, pip1st ; Get the first ten characters 34749 000365'01 124 03 0 00 000000# dmovem t3, pipnam ; Store them 34750 000366'01 120 03 0 00 000000# dmove t3, pip1st+2 ; Get the second ten characters 34751 000367'01 124 03 0 00 000000# dmovem t3, pipnam+2 ; Store them 34752 000370'01 402 00 0 00 000000# setzm pipnam+4 ; Tie off the string 34753 000371'01 561 01 0 00 000000# hrroi t1, ; Puts the decimal number after the colon 34754 000372'01 201 03 0 00 000012 movei t3, ^d10 ; RECORD-LENGTH number is decimal 34755 000373'01 104 00 0 00 000224 NOUT% ; Tack it on to the end 34756 000374'01 320 12 0 00 000376' %jserr (,r) 34757 000375'01 254 00 0 00 000401' 34758 000376'01 265 01 0 00 000342* 34759 000377'01 000000000000# 34760 000400'01 254 00 0 00 000344* 34761 000146'04 103 141 156 047 164 34762 000401'01 endif. 34763 34764 dmove t1,[gj%sht!gj%flg ; Want GTJFN% flags returned K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-1 K20TIM MAC 29-Apr-24 00:09 Set up a PIP: pair for transfer timing 34765 000401'01 120 01 0 00 003535' -1,,pipnam ] ; PIP:'s odd syntax 34766 000402'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the pipe 34767 000403'01 320 12 0 00 000405' %jserr (,r) 34768 000404'01 254 00 0 00 000410' 34769 000405'01 265 01 0 00 000376* 34770 000406'01 000000000000# 34771 000407'01 254 00 0 00 000400* 34772 000161'04 103 141 156 047 164 34773 000410'01 200 05 0 00 000001 move q1, t1 ; Store first PIP: JFN and flags 34774 34775 000411'01 403 01 0 00 000002 setzb t1, t2 ; Cons up ten .CHNUL's 34776 000412'01 124 01 0 00 000000# dmovem t1, pip2nd+0 ; Whack all the storage 34777 000413'01 124 01 0 00 000000# dmovem t1, pip2nd+2 ; where we'll write more odd syntax 34778 34779 000414'01 561 01 0 00 000000# hrroi t1, pip2nd ; Point to area for JFNS% 34780 000415'01 550 02 0 00 000005 hrrz t2, q1 ; Load our odd first PIP: JFN 34781 dmove t3, [fld(.jsaof,js%dev)!fld(.jsaof,js%nam)!js%paf 34782 000416'01 120 03 0 00 003537' 0 ] ; No strange prefix (whatever that is) 34783 000417'01 104 00 0 00 000030 JFNS% ; Build first part of strange string 34784 000420'01 320 12 0 00 000422' %jserr(,r) 34785 000421'01 254 00 0 00 000425' 34786 000422'01 265 01 0 00 000405* 34787 000423'01 000000000000# 34788 000424'01 254 00 0 00 000407* 34789 000171'04 103 157 165 154 144 34790 000425'01 201 02 0 00 000056 movx t2, "." ; Load a dot 34791 000426'01 136 02 0 00 000001 idpb t2, t1 ; Punctuate the file type 34792 000427'01 550 02 0 00 000005 hrrz t2, q1 ; Load our odd first PIP: JFN 34793 000430'01 205 03 0 00 001000 movx t3, ; File type is the same as the name 34794 000431'01 104 00 0 00 000030 JFNS% ; Build second part of strange string 34795 000432'01 320 12 0 00 000434' %jserr(,r) 34796 000433'01 254 00 0 00 000437' 34797 000434'01 265 01 0 00 000422* 34798 000435'01 000000000000# 34799 000436'01 254 00 0 00 000424* 34800 000205'04 103 157 165 154 144 34801 34802 dmove t1, [ gj%sht!gj%flg ; Want GTJFN% flags returned 34803 000437'01 120 01 0 00 003541' -1,,pip2nd ] ; PIP:'s odd syntax 34804 000440'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the PTY 34805 000441'01 320 12 0 00 000443' %jserr (,r) 34806 000442'01 254 00 0 00 000446' 34807 000443'01 265 01 0 00 000434* 34808 000444'01 000000000000# 34809 000445'01 254 00 0 00 000436* 34810 000221'04 103 141 156 047 164 34811 000446'01 200 06 0 00 000001 move q2, t1 ; Store 2nd PIP: JFN and flags 34812 34813 000447'01 550 01 0 00 000005 hrrz t1, q1 ; Load write JFN without flags 34814 000450'01 200 02 0 00 003534' movx t2, ; 8-bit bytes 34815 000451'01 335 03 0 00 000306* skipge t3, pars3 ; Load parsed OPENF% mode 34816 000452'01 254 00 0 00 000454' ifskp. ; User specified it, let's use it 34817 000453'01 137 03 0 00 003530' dpb t3, [pointr t2, of%mod] 34818 000454'01 endif. 34819 000454'01 337 04 0 00 000334* skipg t4, pars4 ; Load parsed OPENF% byte size K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-2 K20TIM MAC 29-Apr-24 00:09 Set up a PIP: pair for transfer timing 34820 000455'01 254 00 0 00 000457' ifskp. ; User specified it, let's use it 34821 000456'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34822 000457'01 endif. 34823 000457'01 104 00 0 00 000021 OPENF% ; N.B., source JFN is write-only 34824 000460'01 320 12 0 00 000462' %jserr (,r) 34825 000461'01 254 00 0 00 000465' 34826 000462'01 265 01 0 00 000443* 34827 000463'01 000000000000# 34828 000464'01 254 00 0 00 000445* 34829 000231'04 103 141 156 047 164 34830 000465'01 550 01 0 00 000006 hrrz t1, q2 ; Load read JFN without flags 34831 000466'01 200 02 0 00 003543' movx t2, ; 8-bit bytes 34832 000467'01 335 03 0 00 000451* skipge t3, pars3 ; Load parsed OPENF% mode 34833 000470'01 254 00 0 00 000472' ifskp. ; User specified it, let's use it 34834 000471'01 137 03 0 00 003530' dpb t3, [pointr t2, of%mod] 34835 000472'01 endif. 34836 000472'01 337 04 0 00 000454* skipg t4, pars4 ; Load parsed OPENF% byte size 34837 000473'01 254 00 0 00 000475' ifskp. ; User specified it, let's use it 34838 000474'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34839 000475'01 endif. 34840 000475'01 104 00 0 00 000021 OPENF% ; Normal mode, read-only 34841 000476'01 320 12 0 00 000500' %jserr (,r) 34842 000477'01 254 00 0 00 000503' 34843 000500'01 265 01 0 00 000462* 34844 000501'01 000000000000# 34845 000502'01 254 00 0 00 000464* 34846 000240'04 103 141 156 047 164 34847 34848 000503'01 254 00 0 00 000345* retskp ; Return success 34849 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20TIM MAC 29-Apr-24 00:09 Determine SRV: Virtual Baud Rate 34850 subttl Determine SRV: Virtual Baud Rate 34851 34852 ; N.B., this code is not intended to provide a definitive answer to 34853 ; ANYTHING because Tops-20 is not a real-time system. Even a speck 34854 ; of system load can wildly peturb the results as well as whatever the 34855 ; current monitor's DECnet implementation happens to be. 34856 ; 34857 ; It is not going over ANY hardware network interface; traffic is 34858 ; purely inside of Tops-20. 34859 ; 34860 ; See dptybd for more extensive commentary 34861 34862 000504'01 dsrvbd: intern dsrvbd ; May be invoked as a test 34863 000504'01 265 16 0 00 003511' saveac ;Holds DECnet particulars 34864 remark ; N.B., q4 and p1 are aliases!! 34865 34866 000505'01 403 05 0 00 000006 setzb q1, q2 ; No DCN: or SRV: JFN 34867 000506'01 403 07 0 00 000010 setzb q3, q4 ; No assigned DCN: or SRV: device 34868 000507'01 400 12 0 00 000013 setz p2, p3 ; No fork created 34869 34870 000510'01 260 17 0 00 000702' call comput ; Get correct byte pointer and count 34871 000511'01 260 17 0 00 000514' call srvdcn ; Set JFN's to time a DCN:-SRV: device pair 34872 000512'01 254 00 0 00 001235' jrst epicom ; If failed, hit the epilogue 34873 000513'01 254 00 0 00 000715' callret tcommn ; Worked, hit the common code 34874 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20TIM MAC 29-Apr-24 00:09 Acquire a JFN on a DCN:/SRV: pair 34875 subttl Acquire a JFN on a DCN:/SRV: pair 34876 34877 remark Storage area and string components 34878 34879 chgsec(code,text) ;;Put these in program text strings 34880 000145'03 123 122 126 072 056 srvnam: asciz "SRV:.KERMIT-TIMING" ; Task is Kermit Timing service 34881 000151'03 113 145 162 155 151 srvmsg: asciz "Kermit-20: Ready" 34882 000155'03 055 124 101 123 113 dcntsk: asciz "-TASK-KERMIT-TIMING;USER:" 34883 000163'03 073 104 101 124 101 dcndat: asciz ";DATA:" ; Gets HPTIM% ticks as ASCII 34884 retsec ;;Done with read-only text strings 34885 34886 chgsec(code,const) ;;Read-Only pointers are constant data 34887 000137'02 44 07 0 00 000000# srvacc: point 7, srvmsg ; Acknowledgement message 34888 000140'02 000000 000020 srvlen: ^d16 ;;And its length 34889 retsec 34890 34891 chgsec(code,data) ;;Need some writable storage 34892 000030'05 whoami: block 1 ; Currently signed in user number 34893 intern whoami ; START: in k20mit populates this 34894 000031'05 tsktim: block 1 ; HPTIM% value (max 27487790694) 34895 000032'05 dcname: Block ^d20 ; Space for 100 characters 34896 retsec ;;Back to generating executable code 34897 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20TIM MAC 29-Apr-24 00:09 Acquire a JFN on a DCN:/SRV: pair 34898 remark Code to get and open the JFN's 34899 34900 000514'01 srvdcn: remark ; First, must get SRV: JFN 34901 dmove t1, [ gj%sht!gj%flg ; Want GTJFN% flags returned 34902 000514'01 120 01 0 00 003544' -1,,srvnam ] ; 34903 000515'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the passive component 34904 000516'01 320 12 0 00 000520' %jserr (,r) 34905 000517'01 254 00 0 00 000523' 34906 000520'01 265 01 0 00 000500* 34907 000521'01 000000000000# 34908 000522'01 254 00 0 00 000502* 34909 000247'04 103 157 165 154 144 34910 000523'01 200 06 0 00 000001 move q2, t1 ; Store SRV: JFN and flags 34911 000524'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags so OPENF% doesn't choke 34912 000525'01 200 02 0 00 003543' movx t2, ; 8-bit bytes 34913 000526'01 335 03 0 00 000467* skipge t3, pars3 ; Load parsed OPENF% mode 34914 000527'01 254 00 0 00 000531' ifskp. ; User specified it, let's use it 34915 000530'01 137 03 0 00 003530' dpb t3, [pointr t2, of%mod] 34916 000531'01 endif. 34917 000531'01 337 04 0 00 000472* skipg t4, pars4 ; Load parsed OPENF% byte size 34918 000532'01 254 00 0 00 000534' ifskp. ; User specified it, let's use it 34919 000533'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34920 000534'01 endif. 34921 000534'01 104 00 0 00 000021 OPENF% ; normal mode, read-only 34922 000535'01 320 12 0 00 000537' %jserr (,r) 34923 000536'01 254 00 0 00 000542' 34924 000537'01 265 01 0 00 000520* 34925 000540'01 000000000000# 34926 000541'01 254 00 0 00 000522* 34927 000263'04 103 157 165 154 144 34928 34929 000542'01 260 17 0 00 000604' call bldcnt ; Build the (hairy) DCN: task name to SRV: 34930 000543'01 263 17 0 00 000000 ret ; But falled?? 34931 34932 dmove t1, [ gj%sht!gj%flg ; Want GTJFN% flags returned 34933 000544'01 120 01 0 00 003546' -1,,dcname ] ; 34934 000545'01 104 00 0 00 000020 GTJFN% ; Try to get a JFN on the PTY 34935 000546'01 320 12 0 00 000550' %jserr (,r) 34936 000547'01 254 00 0 00 000553' 34937 000550'01 265 01 0 00 000537* 34938 000551'01 000000000000# 34939 000552'01 254 00 0 00 000541* 34940 000275'04 103 157 165 154 144 34941 000553'01 200 05 0 00 000001 move q1, t1 ; Store DCN: JFN and flags 34942 000554'01 621 01 0 00 777777 tlz t1,-1 ; Whack flags so OPENF% doesn't choke 34943 000555'01 200 02 0 00 003534' movx t2, ; 8-bit bytes 34944 000556'01 335 03 0 00 000526* skipge t3, pars3 ; Load parsed OPENF% mode 34945 000557'01 254 00 0 00 000561' ifskp. ; User specified it, let's use it 34946 000560'01 137 03 0 00 003530' dpb t3, [pointr t2, of%mod] 34947 000561'01 endif. 34948 000561'01 337 04 0 00 000531* skipg t4, pars4 ; Load parsed OPENF% byte size 34949 000562'01 254 00 0 00 000564' ifskp. ; User specified it, let's use it 34950 000563'01 137 04 0 00 003531' dpb t4, [pointr t2, of%bsz] 34951 000564'01 endif. 34952 000564'01 104 00 0 00 000021 OPENF% ; normal mode, write-only K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18-1 K20TIM MAC 29-Apr-24 00:09 Acquire a JFN on a DCN:/SRV: pair 34953 000565'01 320 12 0 00 000567' %jserr (,r) 34954 000566'01 254 00 0 00 000572' 34955 000567'01 265 01 0 00 000550* 34956 000570'01 000000000000# 34957 000571'01 254 00 0 00 000552* 34958 000311'04 103 157 165 154 144 34959 34960 000572'01 550 01 0 00 000006 hrrz t1, q2 ; Load server JFN 34961 000573'01 201 02 0 00 000041 movx t2, .mocc ; Explicitly accept the DCN: 34962 000574'01 120 03 0 00 000000# dmove t3, srvacc ; And the acknowledgement message 34963 000575'01 104 00 0 00 000077 MTOPR% ; Finish the connection negotiation 34964 000576'01 320 12 0 00 000600' %jserr (,r) 34965 000577'01 254 00 0 00 000603' 34966 000600'01 265 01 0 00 000567* 34967 000601'01 000000000000# 34968 000602'01 254 00 0 00 000571* 34969 000323'04 103 157 165 154 144 34970 34971 000603'01 254 00 0 00 000503* retskp 34972 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20TIM MAC 29-Apr-24 00:09 Build cooresponding DCN: task name to SRV: 34973 subttl Build cooresponding DCN: task name to SRV: 34974 34975 ; N.B., the DCN string is a little convoluted, but it is generalized 34976 ; enough so that we could run tests between Tops-20 nodes, should we 34977 ; want to try that. 34978 34979 extern myname ; Name of local executor 34980 34981 000604'01 bldcnt: remark Means: BuiLd DCN Text 34982 000604'01 200 01 0 00 003550' move t1, [ BYTE (7) "D", "C", "N", ":", .chnul] 34983 000605'01 202 01 0 00 000000# movem t1, dcname ; Start device portion immediately 34984 000606'01 200 01 0 00 003551' move t1, [ point 7, dcname, 27 ] ; point before the .chnul 34985 34986 remark ; Could drop in /REMOTE:NODE here 34987 000607'01 336 00 0 00 000000* ifmn. myname ; Did we ever figure our local node name out? 34988 000610'01 254 00 0 00 000616' 34989 000611'01 200 02 0 00 003552' move t2, [ point 7,myname ] ; We did, so drop that in 34990 000612'01 do. ; Enter loop context 34991 000612'01 134 03 0 00 000002 ildb t3, t2 ; Pick a byte of the node name 34992 000613'01 322 03 0 00 000616' jumpe t3, endlp. ; Unless we've done all of it 34993 000614'01 136 03 0 00 000001 idpb t3, t1 ; Append to active component device 34994 000615'01 254 00 0 00 000612' loop. ; Get some more, wee!! 34995 000616'01 enddo. ; Exit loop context 34996 000616'01 endif. 34997 34998 000616'01 200 02 0 00 003553' move t2, [ point 7, dcntsk ] 34999 000617'01 do. ; Append the rest of the DECnet task gibberish 35000 000617'01 134 03 0 00 000002 ildb t3, t2 ; Pick a byte of the node name 35001 000620'01 322 03 0 00 000623' jumpe t3, endlp. ; Unless we've done all of it 35002 000621'01 136 03 0 00 000001 idpb t3, t1 ; Append to active component device 35003 000622'01 254 00 0 00 000617' loop. ; Get some more, wee!! 35004 000623'01 enddo. 35005 35006 000623'01 200 02 0 00 000000# move t2, whoami ; Load my user number 35007 000624'01 104 00 0 00 000041 DIRST% ; Tack that on after 35008 000625'01 320 12 0 00 000627' %jserr (,r) 35009 000626'01 254 00 0 00 000632' 35010 000627'01 265 01 0 00 000600* 35011 000630'01 000000000000# 35012 000631'01 254 00 0 00 000602* 35013 000337'04 106 141 151 154 145 35014 35015 000632'01 200 02 0 00 003554' move t2, [ point 7, dcndat ] 35016 000633'01 do. ; Append the ;DATA: attribute 35017 000633'01 134 03 0 00 000002 ildb t3, t2 ; Pick a byte of the node name 35018 000634'01 322 03 0 00 000637' jumpe t3, endlp. ; Unless we've done all of it 35019 000635'01 136 03 0 00 000001 idpb t3, t1 ; Append to active component device 35020 000636'01 254 00 0 00 000633' loop. ; Get some more, wee!! 35021 000637'01 enddo. 35022 35023 000637'01 200 04 0 00 000001 move t4, t1 ; Save output pointer 35024 000640'01 201 01 0 00 000000 movei t1, .HPELP ; Elapsed DK10 ticks since start 35025 000641'01 104 00 0 00 000501 HPTIM% ; Grab it 35026 000642'01 320 12 0 00 000644' %jserr (,r) 35027 000643'01 254 00 0 00 000647' K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-1 K20TIM MAC 29-Apr-24 00:09 Build cooresponding DCN: task name to SRV: 35028 000644'01 265 01 0 00 000627* 35029 000645'01 000000000000# 35030 000646'01 254 00 0 00 000631* 35031 000351'04 125 156 141 142 154 35032 000647'01 202 01 0 00 000000# movem t1, tsktim ; Store as task time (for ;DATA:) 35033 35034 000650'01 200 02 0 00 000001 move t2, t1 ; Position uptime ticks 35035 000651'01 200 01 0 00 000004 move t1, t4 ; Reload output pointer 35036 000652'01 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ; 35037 000653'01 104 00 0 00 000224 NOUT% ; Tack that on 35038 000654'01 320 12 0 00 000656' %jserr (,r) 35039 000655'01 254 00 0 00 000661' 35040 000656'01 265 01 0 00 000644* 35041 000657'01 000000000000# 35042 000660'01 254 00 0 00 000646* 35043 000363'04 125 156 141 142 154 35044 35045 000661'01 254 00 0 00 000603* retskp ; Finally won 35046 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20TIM MAC 29-Apr-24 00:09 Device speed determination storage 35047 subttl Device speed determination storage 35048 35049 .endps code ; Get out of the code .psect 35050 .psect devtim/ronly,devorg; psect for reading and writing for timing 35051 35052 000000'06 devwrt: remark ; Where data will be written from 35053 000000' nulwrt==:devwrt ; Ditto for special case NUL: 35054 000000 $d$=.chnul ; Generated data starts at NUL 35055 000000 $c$=0 ; Rotating check digit starts at zero 35056 xlist ; Don't need silly listing 35057 list ; Turn listing back on 35058 001000 devwrd==.-devwrt ; Device words to write 35059 004000 devchr==devwrd*4 ; Corresponding 8 bit character count 35060 cleans(<$d$,$c$>) ; Chuck worker symbols 35061 35062 ; N.B., The below is a bit of a hack because the page won't exist, which 35063 ; means we can then create it and write it. Heh... 35064 35065 001000'06 devred: block ^d512 ; Where data will be read into 35066 002000'06 devdat: block ^d512 ; Additional data for NUL: timing 35067 003000'06 devda2: block ^d512 ; 2nd part of it 35068 .endps devtim ; End of timing .psect 35069 35070 .psect code ; Get back into code .psect 35071 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20TIM MAC 29-Apr-24 00:09 Device inferior fork timing code and storage 35072 subttl Device inferior fork timing code and storage 35073 35074 chgsec(code,data) ;;Inferior's storage 35075 000056'05 000000 000011 devpdl: devhlt ; Return to our HALTF% 35076 000057'05 block ^d19 ; Rest of inferior's stack 35077 000024 devstg==.-devpdl ; Length of inferior's storage 35078 retsec ; Back in code segment 35079 35080 ; Inferior code is in the AC's because I thought I was going to have a 35081 ; very restricted address space there. This is not possible because 35082 ; of the need to call the timing ending routine and catch its errors. 35083 ; 35084 ; Note, superior does a SOUTR% to force a 'push'; the inferior also 35085 ; does a SINR% because it appears to be SLIGHTLY faster. 35086 35087 000662' devcod=: . ; Inferior's code 35088 000000 phase 0 ; Inferior's program 35089 000000 44 10 0 00 000000# point 8,devred ; ac0/ Where we're reading to 35090 000001 000000 400000 .fhslf ; 1 t1/ This fork 35091 000002 000000 601405 lstrx1 ; 2 t2/ "Process has not encountered any errors" 35092 000003 777777 774000 - ; 3 t3/ length of data being read 35093 000004 000000 000000 0 ; 4 t4/ Stop on .chnul (ignored) 35094 000005 104 00 0 00 000147 devinf: RESET% ; 5 q1/ Inferior start up 35095 000006 320 12 0 00 000011 erjmpr devhlt ; 6 q2/ Handle any error by just stopping 35096 000007 104 00 0 00 000336 SETER% ; 7 q3/ Otherwise flag everything worked 35097 000010 320 12 0 00 000011 erjmpr devhlt ; 10 q4/ Shouldn't ever break ... 35098 000011 104 00 0 00 000170 devhlt: HALTF% ; 11 p2/ Completed initialization 35099 000012 201 01 0 00 000100 movei t1, .priin ; 12 p3/ Set by superior 35100 000013 200 02 0 00 000000 move t2, 0 ; 13 p4/ Load pointer 35101 000014 104 00 0 00 000052 SIN% ; 14 p5/ Do a counted read 35102 000015 320 12 0 00 000011 erjmpr devhlt ; 15 .fp/ Handle the error 35103 000016 254 00 0 00 002050' callret endtim ; 16 cx/ Finish the timing 35104 000017 777755 000000# -^d19,,devpdl ; p/ stack (17) 35105 35106 000702'01 dephase ; Restore normal location counter 35107 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20TIM MAC 29-Apr-24 00:09 Timing common storage 35108 subttl Timing common storage 35109 35110 chgsec(code,data) ;;Writeable storage for data transfer 35111 000102'05 timdev:: block 1 ; Device being timed 35112 000103'05 devacs: block ^d16 ; Timing fork AC's 35113 000123'05 chrptr: block 1 ;*** DO NOT ; Left halfword of section local pointer 35114 000124'05 chrcnt: block 1 ;REORDER ** ; Character count in current byte size 35115 retsec 35116 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20TIM MAC 29-Apr-24 00:09 Computer character pointer and counter construction 35117 subttl Computer character pointer and counter construction 35118 35119 ; Note, PTYLEN is the number of words in a single page and is common 35120 ; for all devices. 35121 35122 000702'01 333 04 0 00 000561* comput: skiple t4, pars4 ; Pick up byte size for SOUTR% 35123 000703'01 254 00 0 00 000706' ifskp. ; Was anything specifed? 35124 dmove t2,[ ; No, use defaults 35125 point 8,0 ; Using 8 bit bits 35126 000704'01 120 02 0 00 003555' - ] ; Number of characters in the single page 35127 000705'01 254 00 0 00 000713' else. ; Otherwise, need to do some coversions 35128 000706'01 120 02 0 00 003557' dmove t2,[exp -1,-^d36] ;Load double negative integer 36 35129 000707'01 234 02 0 00 000004 div t2, t4 ; Calculate bytes per word 35130 000710'01 225 02 0 00 001000 muli t2, ptylen ; Now have total bytes we'll do in t3 35131 000711'01 205 02 0 00 440000 movx t2, ; Set up for an ILDB at bit '36' 35132 000712'01 137 04 0 00 003561' dpb t4, [ pointr t2, sbyte ] ; Drop in the byte size 35133 000713'01 endif. ; End non-standard byte size 35134 35135 000713'01 124 02 0 00 000000# dmovem t2, chrptr ; Store pointer prototype and count 35136 000714'01 263 17 0 00 000000 ret 35137 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35138 subttl Multi-fork timing common code 35139 35140 ; See commentary on timing PTY virtual baud rate. These numbers are 35141 ; only used to validate the granularity of regular transfers 35142 35143 extern frclose ; Force a JFN closed 35144 extern cmprmn ; cmpse in k20ioc 35145 35146 000715'01 tcommn: remark ; Assumes these are saved 35147 remark ; N.B., q4 and p1 are aliases!! 35148 35149 000715'01 400 12 0 00 000000 setz p2, ;[223] No inferior fork yet 35150 000716'01 260 17 0 00 001601' call parset ;[223] Set up parity, if doing parity 35151 000717'01 254 00 0 00 001235' jrst epicom ;[223] Beat it, we've got to fix our tables 35152 35153 000720'01 201 01 0 00 000020 movx t1, ^d16 ; Transferring 16 accumulators 35154 dmove t2, [ devcod ; Source is device code 35155 000721'01 120 02 0 00 003562' devacs ] ; Destination is writable storage 35156 000722'01 123 01 0 00 003564' xblt. t1 ; Transfer so we can modify it 35157 35158 000723'01 201 03 0 00 000000# movei t3, devacs ; Resolve address of writable AC's 35159 000724'01 120 01 0 00 000000# dmove t1, chrptr ; Load byte pointer prototype and count 35160 000725'01 502 01 0 03 000000 hllm t1, 0(t3) ; Tweak byte size and pointer 35161 000726'01 202 02 0 03 000003 movem t2, t3(t3) ; Put the correct count in 35162 35163 remark ; N.B., cr%map makes a real gross page map, sigh. 35164 dmove t1, [ cr%map!cr%acs!cr%st!fld(devinf,cr%pcv) 35165 000727'01 120 01 0 00 003565' devacs ] ; Set AC's to have device inferior code 35166 000730'01 104 00 0 00 000152 CFORK% ; Make me a fork (poof! You're a fork) 35167 000731'01 320 12 0 00 000733' %jserr (,epicom) 35168 000732'01 254 00 0 00 000736' 35169 000733'01 265 01 0 00 000656* 35170 000734'01 000000000000# 35171 000735'01 254 00 0 00 001235' 35172 000375'04 103 157 165 154 144 35173 000736'01 200 12 0 00 000001 move p2, t1 ; store inferior handle 35174 35175 000737'01 200 01 0 00 000012 move t1, p2 ; Load inferior's handle 35176 000740'01 104 00 0 00 000163 WFORK% ; Wait for inferior initialization completion 35177 000741'01 320 12 0 00 000743' %jserr(, epicom) 35178 000742'01 254 00 0 00 000746' 35179 000743'01 265 01 0 00 000733* 35180 000744'01 000000000000# 35181 000745'01 254 00 0 00 001235' 35182 000403'04 125 156 141 142 154 35183 000746'01 104 00 0 00 000012 GETER% ; Find out inferior's last error 35184 000747'01 320 12 0 00 000751' %jserr(, epicom) 35185 000750'01 254 00 0 00 000754' 35186 000751'01 265 01 0 00 000743* 35187 000752'01 000000000000# 35188 000753'01 254 00 0 00 001235' 35189 000416'04 125 156 141 142 154 35190 000754'01 621 02 0 00 777777 tlz t2, -1 ; Stomp silly fork handle 35191 000755'01 306 02 0 00 601405 cain t2, lstrx1 ; Everything's Archie, right? 35192 000756'01 254 00 0 00 000766' ifskp. ; It isn't, so complain K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-1 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35193 000757'01 201 01 0 00 400000 movei t1, .fhslf ; Set our last error to inferior's 35194 000760'01 104 00 0 00 000336 SETER% ; So diagnostic message is more meaningful 35195 000761'01 334 00 0 00 000000 %ermsg(,epicom) 35196 000762'01 254 00 0 00 000766' 35197 000763'01 265 01 0 00 000751* 35198 000764'01 000000000000# 35199 000765'01 254 00 0 00 001235' 35200 000430'04 111 156 146 145 162 35201 000766'01 endif. 35202 35203 remark t1, .fhinf ; Still has the fork handle 35204 000766'01 514 02 0 00 000006 hrlz t2, q2 ; Load PTY's TTY JFN as inferior's primary input 35205 000767'01 541 02 0 00 777777 hrri t2, .cttrm ; But it can still write to our terminal 35206 000770'01 104 00 0 00 000207 SPJFN% ; Set it so SINR% doesn't break 35207 000771'01 320 12 0 00 000773' %jserr(, epicom) 35208 000772'01 254 00 0 00 000776' 35209 000773'01 265 01 0 00 000763* 35210 000774'01 000000000000# 35211 000775'01 254 00 0 00 001235' 35212 000441'04 125 156 141 142 154 35213 000776'01 416 00 0 00 000000# setmm devred ; Create reading page, so not creation time charge 35214 000777'01 661 01 0 00 400000 txo t1, sf%con ; Continuing inferior 35215 001000'01 104 00 0 00 000157 SFORK% ; Get it started in its read 35216 001001'01 320 12 0 00 001003' %jserr(, epicom) 35217 001002'01 254 00 0 00 001006' 35218 001003'01 265 01 0 00 000773* 35219 001004'01 000000000000# 35220 001005'01 254 00 0 00 001235' 35221 000451'04 125 156 141 142 154 35222 35223 001006'01 621 01 0 00 400000 txz t1, sf%con ; Get a clean fork handle 35224 001007'01 201 02 0 00 000000# movei t2, devacs ; Load address of inferior AC block 35225 dmove t3, [ lstrx1 ; What indicates it isn't in SINR%, yet 35226 001010'01 120 03 0 00 003567' ^d20 ] ; Only wait 5 seconds (.25 * 20) 35227 35228 001011'01 do. ; Enter inferior fork check loop context 35229 001011'01 104 00 0 00 000154 FFORK% ; Freeze inferor (so we can read its AC's) 35230 001012'01 320 12 0 00 001014' %jserr (,epicom) 35231 001013'01 254 00 0 00 001017' 35232 001014'01 265 01 0 00 001003* 35233 001015'01 000000000000# 35234 001016'01 254 00 0 00 001235' 35235 000461'04 125 156 141 142 154 35236 001017'01 104 00 0 00 000161 RFACS% ; Read inferior's accumulators 35237 001020'01 320 12 0 00 001022' %jserr (,epicom) 35238 001021'01 254 00 0 00 001025' 35239 001022'01 265 01 0 00 001014* 35240 001023'01 000000000000# 35241 001024'01 254 00 0 00 001235' 35242 000467'04 125 156 141 142 154 35243 001025'01 104 00 0 00 000155 RFORK% ; And resume the fork 35244 001026'01 320 12 0 00 001030' %jserr (,epicom) 35245 001027'01 254 00 0 00 001033' 35246 001030'01 265 01 0 00 001022* 35247 001031'01 000000000000# K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-2 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35248 001032'01 254 00 0 00 001235' 35249 000477'04 125 156 141 142 154 35250 001033'01 312 03 0 02 000002 came t3, t2(t2) ; Not in the SINR% yet? 35251 001034'01 254 00 0 00 001041' exit. ; Finally in the SINR% (or real close!!) 35252 001035'01 201 01 0 00 000372 movei t1, ^d250 ; Wait a bit for it to turn back on 35253 001036'01 104 00 0 00 000167 DISMS% ; And chill out for a bit 35254 001037'01 200 01 0 00 000012 move t1, p2 ; Reload the fork handle 35255 001040'01 367 04 0 00 001011' sojg t4, top. ; Try again (but only so long) 35256 001041'01 enddo. ; Exit loop context 35257 35258 001041'01 326 04 0 00 001047' ife. t4 ; Exhausted the count? 35259 001042'01 334 00 0 00 000000 %ermsg (,epicom) 35260 001043'01 254 00 0 00 001047' 35261 001044'01 265 01 0 00 001030* 35262 001045'01 000000000000# 35263 001046'01 254 00 0 00 001235' 35264 000505'04 124 151 155 145 144 35265 001047'01 endif. ; piffle.... 35266 35267 remark ; Loop appears to be unnecessary for inter-job... 35268 001047'01 260 17 0 00 002033' call statim ; Start timing the transfer 35269 001050'01 120 02 0 00 000000# dmove t2, chrptr ; Load pointer prototype and count 35270 001051'01 541 02 0 00 000000# hrri t2, devwrt ; Where we're writing from 35271 001052'01 332 00 0 00 000000# skipe timpar ;[223] Unless doing parity 35272 001053'01 541 02 0 00 000000# hrri t2, devdat ;[223] OK, so we're doing it with parity bits set 35273 001054'01 201 13 0 00 000031 movei p3, ^d25 ; Only wait so long for buffers to drain 35274 ; Loop is because of limited monitor buffers 35275 001055'01 do. ; Enter loop context 35276 001055'01 550 01 0 00 000005 hrrz t1, q1 ; Load the source JFN (no flags) 35277 001056'01 200 04 0 00 000003 move t4, t3 ; Save a copy of remaining character count 35278 001057'01 104 00 0 00 000532 SOUTR% ; Blammo!! 35279 001060'01 320 12 0 00 001062' ifje. r ; Uh oh, investigate the failure 35280 001061'01 254 00 0 00 001071' 35281 001062'01 306 01 0 00 602423 cain t1, IOX33 ; Inferior couldn't swallow all of it at once? 35282 001063'01 254 00 0 00 001071' anskp. ; Nope; however, we can recover from this 35283 001064'01 334 00 0 00 000000 %ermsg(, epicom) 35284 001065'01 254 00 0 00 001071' 35285 001066'01 265 01 0 00 001044* 35286 001067'01 000000000000# 35287 001070'01 254 00 0 00 001235' 35288 000515'04 125 156 141 142 154 35289 001071'01 endif. ; Carry on if worked or IOX33 35290 001071'01 322 03 0 00 001101' jumpe t3, endlp. ; If done, then leave 35291 001072'01 312 03 0 00 000004 came t3, t4 ; Did it do anything, actually? 35292 001073'01 254 00 0 00 001055' loop. ; Yes, so ready to do some more 35293 001074'01 260 17 0 00 001327' call ckdtwr ; Otherwise, check device write status 35294 001075'01 254 00 0 00 001235' jrst epicom ; Something went wrong or is bad 35295 001076'01 201 01 0 00 000144 movei t1, ^d100 ; Give inferior a chance to run 35296 001077'01 104 00 0 00 000167 DISMS% ; So it can catch its breath 35297 001100'01 367 13 0 00 001055' sojg p3, top. ; And try another drop 35298 001101'01 enddo. ; Exit loop context 35299 35300 001101'01 326 13 0 00 001107' ife. p3 ; Exhausted the count? 35301 001102'01 334 00 0 00 000000 %ermsg (,epicom) 35302 001103'01 254 00 0 00 001107' K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-3 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35303 001104'01 265 01 0 00 001066* 35304 001105'01 000000000000# 35305 001106'01 254 00 0 00 001235' 35306 000526'04 124 151 155 145 144 35307 001107'01 endif. ; piffle.... 35308 35309 remark ; Repeating previous code for better error messages 35310 001107'01 200 01 0 00 000012 move t1, p2 ; Load inferior's handle 35311 001110'01 104 00 0 00 000163 WFORK% ; Wait for inferior SINR% to complete 35312 001111'01 320 12 0 00 001113' %jserr(,epicom) 35313 001112'01 254 00 0 00 001116' 35314 001113'01 265 01 0 00 001104* 35315 001114'01 000000000000# 35316 001115'01 254 00 0 00 001235' 35317 000535'04 125 156 141 142 154 35318 001116'01 104 00 0 00 000012 GETER% ; Find out inferior's last error 35319 001117'01 320 12 0 00 001121' %jserr(,epicom) 35320 001120'01 254 00 0 00 001124' 35321 001121'01 265 01 0 00 001113* 35322 001122'01 000000000000# 35323 001123'01 254 00 0 00 001235' 35324 000547'04 125 156 141 142 154 35325 001124'01 621 02 0 00 777777 tlz t2, -1 ; Stomp silly fork handle 35326 001125'01 306 02 0 00 601405 cain t2, lstrx1 ; Everything's Archie, right? 35327 001126'01 254 00 0 00 001136' ifskp. ; It isn't, so complain 35328 001127'01 201 01 0 00 400000 movei t1, .fhslf ; Set our last error to inferior's 35329 001130'01 104 00 0 00 000336 SETER% ; So diagnostic message is more meaningful 35330 001131'01 334 00 0 00 000000 %ermsg(,epicom) 35331 001132'01 254 00 0 00 001136' 35332 001133'01 265 01 0 00 001121* 35333 001134'01 000000000000# 35334 001135'01 254 00 0 00 001235' 35335 000561'04 111 156 146 145 162 35336 001136'01 endif. 35337 35338 001136'01 260 17 0 00 002133' call elptim ; Compute elapsed transfer time 35339 35340 001137'01 260 17 0 00 001750' call parchk ;[223] Check parity, if doing parity 35341 001140'01 254 00 0 00 001235' jrst epicom ;[223] Skip the rest of it 35342 35343 remark ; Check the data made it over correctly 35344 001141'01 415 16 0 00 001161' block. ; Build a stack frame to preserve registers 35345 001142'01 261 17 0 00 000016 35346 001143'01 332 00 0 00 000000# skipe timpar ;[223] Did we already check the parity? 35347 001144'01 254 00 0 00 000661* retskp ;[223] We did, so if made it here, everything is fine 35348 001145'01 265 16 0 00 003571' saveac ; Need to save these 35349 001146'01 210 01 0 00 000000# movn t1, chrcnt ; Load length of string sent 35350 001147'01 200 04 0 00 000001 move t4, t1 ; Strings are the same length 35351 001150'01 403 03 0 00 000006 setzb t3, q2 ; Section local string pointers 35352 001151'01 200 02 0 00 000000# move t2, chrptr ; Load correct character pointer and size 35353 001152'01 510 05 0 00 000002 hllz q1, t2 ; Both sources are equivalent here 35354 001153'01 541 02 0 00 000000# hrri t2, devwrt ; What we wrote 35355 001154'01 541 05 0 00 000000# hrri q1, devred ; What we read 35356 001155'01 123 01 0 00 000000* extend t1, cmprmn ; See if everything made it through OK 35357 001156'01 263 17 0 00 000000 ret ; Not equal, phooey! K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-4 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35358 001157'01 254 00 0 00 001144* retskp ; Equal!! 35359 001160'01 263 17 0 00 000000 endbk. ; End block 35360 001161'01 254 00 0 00 001164' ifskp. ; Worked 35361 001162'01 600 00 0 00 000000 nop ; No special action, carry on 35362 001163'01 254 00 0 00 001202' else. ; Failed??? 35363 001164'01 200 03 0 00 000001 move t3, t1 ; Save source character count 35364 001165'01 200 06 0 00 000002 move q2, t2 ; Save source character pointer 35365 001166'01 200 01 0 00 000000# emsg () 35366 001167'01 104 00 0 00 000313 35367 000141'02 000000000000# 35368 000571'04 124 151 155 151 156 35369 001170'01 201 01 0 00 000101 movei t1, .priou ; Continue blatting 35370 001171'01 210 02 0 00 000000# movn t2, chrcnt ; Load length of string sent 35371 001172'01 274 02 0 00 000003 sub t2, t3 ; Subtract remaining characters 35372 001173'01 201 03 0 00 000012 movei t3, fld(^d10,no%rdx) 35373 001174'01 104 00 0 00 000224 NOUT% ; Shows what character we croaked on 35374 001175'01 320 12 0 00 001176' erjmpr .+1 35375 001176'01 561 01 0 00 000240* hrroi t1, crlf 35376 001177'01 104 00 0 00 000076 PSOUT% 35377 001200'01 320 12 0 00 001201' erjmpr .+1 35378 001201'01 254 00 0 00 001235' jrst epicom 35379 001202'01 endif. 35380 35381 remark ; Finally get to do some arithmatic!! 35382 001202'01 400 01 0 00 000000 setz t1, ; Load integer high order of character count 35383 001203'01 210 02 0 00 000000# movn t2, chrcnt ; Load load order character count 35384 001204'01 116 01 0 00 003601' dmul t1, [exp 0, ^d100000*^d10 ] ; Scale to bits in microsecond time 35385 001205'01 120 01 0 00 000003 dmove t1, t3 ; Load low order double word 35386 001206'01 260 17 0 00 003301' call dfloat ; Convert to double floating point 35387 001207'01 334 00 0 00 000000 %ermsg (, epicom) 35388 001210'01 254 00 0 00 001214' 35389 001211'01 265 01 0 00 001133* 35390 001212'01 000000000000# 35391 001213'01 254 00 0 00 001235' 35392 000603'04 125 156 141 142 154 35393 001214'01 120 03 0 00 000001 dmove t3, t1 ; Save double floating bit count 35394 35395 001215'01 120 01 0 00 000000# dmove t1, ewallt+.datus ; Load tens of nanoseconds used 35396 001216'01 260 17 0 00 003301' call dfloat ; Convert to double floating point 35397 001217'01 334 00 0 00 000000 %ermsg (, epicom) 35398 001220'01 254 00 0 00 001224' 35399 001221'01 265 01 0 00 001211* 35400 001222'01 000000000000# 35401 001223'01 254 00 0 00 001235' 35402 000612'04 125 156 141 142 154 35403 001224'01 113 03 0 00 000001 dfdv t3, t1 ; Divide bits by ticks 35404 35405 001225'01 415 16 0 00 001232' block. ; Enter block context for another frame 35406 001226'01 261 17 0 00 000016 35407 001227'01 265 16 0 00 003603' saveac ; Save result before the call 35408 001230'01 260 17 0 00 001235' call epicom ; Stomp everything 35409 001231'01 263 17 0 00 000000 endbk. ; Exit block context 35410 35411 001232'01 200 05 0 00 000004 move t5, t4 ; Return virtual baud rate for some device 35412 001233'01 200 04 0 00 000003 move t4, t3 ; Return the high order, too K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-5 K20TIM MAC 29-Apr-24 00:09 Multi-fork timing common code 35413 001234'01 254 00 0 00 001157* retskp ; Return success 35414 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20TIM MAC 29-Apr-24 00:09 Common timing test epilogue code 35415 subttl Common timing test epilogue code 35416 35417 ; N.B., Do not change the order of resource release, below! 35418 ; 35419 ; 1) An open JFN that is in active use via an SPJFN% can not be 35420 ; closed or even force closed, the error being an arcane CLSX2, 35421 ; "File cannot be closed by this process". 35422 ; 35423 ; This is why the SPJFN% is done before any close attempts. 35424 ; (Learned that the hard way...) 35425 ; 35426 ; 2) The SPJFN% is also done before the KFORK% as a caution to the 35427 ; JFN being left in an odd way or the KFORK% failing. 35428 35429 001235'01 336 01 0 00 000012 epicom: skipn t1, p2 ; Did we have a fork? 35430 001236'01 254 00 0 00 001257' ifskp. ; We did, chuck it 35431 001237'01 200 02 0 00 003613' movx t2, <.nulio,,.nulio> ; Truely shut it up 35432 001240'01 104 00 0 00 000207 SPJFN% ; Attempt the muzzling 35433 001241'01 320 12 0 00 001243' ifje. r ; Catch and store error 35434 001242'01 254 00 0 00 001245' 35435 001243'01 200 04 0 00 000001 move t4, t1 ; Store error for debuggers 35436 001244'01 200 01 0 00 000012 move t1, p2 ; Reload the fork handle 35437 001245'01 endif. ; But carry on in either case 35438 001245'01 403 03 0 00 000004 setzb t3, t4 ; Whack JSYS error talismen 35439 001246'01 104 00 0 00 000153 KFORK% ; Try to clobber the inferior 35440 001247'01 320 12 0 00 001251' ifje. r ; Catch and store error 35441 001250'01 254 00 0 00 001256' 35442 001251'01 200 04 0 00 000001 move t4, t1 ; Store error for debuggers 35443 001252'01 200 01 0 00 000012 move t1, p2 ; Reload the fork handle again 35444 001253'01 104 00 0 00 000165 RFRKH% ; At least try to release that 35445 001254'01 254 00 0 00 001256' ifskp. ; There is no joy in mudville 35446 001255'01 200 03 0 00 000001 move t3, t1 ; Store for debuggders 35447 001256'01 endif. ; End case RFRKH% failure handling 35448 001256'01 endif. ; Continue and clean up storage 35449 001256'01 400 12 0 00 000000 setz p2, ; Either way, no more fork 35450 001257'01 endif. 35451 35452 001257'01 336 01 0 00 000006 skipn t1, q2 ; Did we ever have a destination JFN? 35453 001260'01 254 00 0 00 001264' ifskp. ; We did 35454 001261'01 260 17 0 00 000000* call frclose ; Force it closed (see k20sub) 35455 001262'01 600 00 0 00 000000 nop ; Failed somehow 35456 001263'01 400 06 0 00 000000 setz q2, ; Either way, no destination JFN 35457 001264'01 endif. 35458 35459 001264'01 336 01 0 00 000005 skipn t1, q1 ; Did we ever have a source JFN? 35460 001265'01 254 00 0 00 001271' ifskp. ; We did 35461 001266'01 260 17 0 00 001261* call frclose ; Force it closed (see k20sub) 35462 001267'01 600 00 0 00 000000 nop ; Failed somehow 35463 001270'01 400 05 0 00 000000 setz q1, ; Either way, no source JFN 35464 001271'01 endif. 35465 35466 001271'01 474 01 0 00 000000 seto t1, ; Removing pages 35467 dmove t2,[.fhslf,,nulpag+1 ;Whacking dirty pages from address space 35468 001272'01 120 02 0 00 003614' pm%cnt!pm%abt!fld(,pm%cnt) ] 35469 001273'01 104 00 0 00 000056 PMAP% ; Reduce our working set size K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25-1 K20TIM MAC 29-Apr-24 00:09 Common timing test epilogue code 35470 001274'01 320 12 0 00 001276' ifje. r ; Should never happen... 35471 001275'01 254 00 0 00 001277' 35472 001276'01 200 04 0 00 000001 move t4, t1 ; Store error for debuggers 35473 001277'01 endif. 35474 35475 001277'01 336 01 0 00 000010 skipn t1, q4 ; Did we assign the PTY's associated terminal? 35476 001300'01 254 00 0 00 001306' ifskp. ; We did, release it 35477 001301'01 104 00 0 00 000071 RELD% ; Try to punt the TTY 35478 001302'01 320 12 0 00 001304' ifje. r ; Catch and store error 35479 001303'01 254 00 0 00 001305' 35480 001304'01 200 04 0 00 000001 move t4, t1 ; Store error for debuggers 35481 001305'01 endif. ; Carry on! 35482 001305'01 400 10 0 00 000000 setz q4, ; Either way, no assigned terminal 35483 001306'01 endif. 35484 35485 001306'01 336 01 0 00 000007 skipn t1, q3 ; Did we assign a PTY? 35486 001307'01 254 00 0 00 001326' ifskp. ; We did, release it 35487 001310'01 104 00 0 00 000071 RELD% ; Try to punt the PTY 35488 001311'01 320 12 0 00 001313' ifje. r ; Catch and store error 35489 001312'01 254 00 0 00 001314' 35490 001313'01 200 04 0 00 000001 move t4, t1 ; Store error for debuggers 35491 001314'01 endif. ; Continue and clean up storage 35492 001314'01 400 07 0 00 000000 setz q3, ; Either way, no assigned PTY 35493 001315'01 402 00 0 00 000260* setzm asgflg ; Clear device assignment flag 35494 001316'01 402 00 0 00 000000* setzm asgdev ; Clear stored assigned device 35495 001317'01 402 00 0 00 000000* setzm ptytty ; Clear PTY's associated TTY line number 35496 001320'01 402 00 0 00 000000* setzm ptyflg ; Clear pseudo-terminal I/O flag 35497 001321'01 402 00 0 00 000000* setzm binflg ; Clear binary I/O flag 35498 001322'01 403 01 0 00 000002 setzb t1, t2 ; Cons up a zero double word 35499 001323'01 124 01 0 00 000000* dmovem t1, ndvchr ; Whack characteristics double word 35500 001324'01 124 01 0 00 000000* dmovem t1, ttynam ; No ASCII terminal device name 35501 001325'01 124 01 0 00 000000* dmovem t1, ptynam ; No pseudo-terminal device name 35502 001326'01 endif. 35503 35504 001326'01 263 17 0 00 000000 ret ; Phew!! 35505 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20TIM MAC 29-Apr-24 00:09 Device lower fork checking code 35506 subttl Device lower fork checking code 35507 35508 ; Here if the upper fork SOUTR% fails and the byte count is unchanged 35509 35510 define errtxt (t,%t,%et) < ;;Macro to put a string in text section 35511 move t1,%t ;;Local pointer to text 35512 35513 chgsec(code,const) ;;Put pointer to extended text in const section 35514 %t: .px7!%et ;;OWGP to extended section 35515 retsec ;;Restore .PSECT assumptions 35516 35517 chgsec(code,etext) ;;Open non-section zero text 35518 %et: asciz |'t| ;;Deposit text and label text with generated symbol 35519 retsec ;;Restore .PSECT assumptions 35520 cleans(<%t,%et>) ;;Punt generated symbols 35521 >;;errtxt 35522 35523 001327'01 265 16 0 00 003616' ckdtwr: saveac ; Modifies no registers 35524 35525 remark ; First, pull fork information 35526 001330'01 200 01 0 00 000012 move t1, p2 ; Load inferior's handle 35527 001331'01 104 00 0 00 000012 GETER% ; Get its last error 35528 001332'01 320 12 0 00 001334' %jserr(, r) 35529 001333'01 254 00 0 00 001337' 35530 001334'01 265 01 0 00 001221* 35531 001335'01 000000000000# 35532 001336'01 254 00 0 00 000660* 35533 000621'04 125 156 141 142 154 35534 001337'01 621 02 0 00 777777 tlz t2, -1 ; Stomp silly fork handle 35535 001340'01 200 07 0 00 000002 move q3, t2 ; And save the last error 35536 001341'01 200 01 0 00 000012 move t1, p2 ; Load inferior's handle 35537 001342'01 104 00 0 00 000156 RFSTS% ; Return fork status 35538 001343'01 320 12 0 00 001345' %jserr(, r) 35539 001344'01 254 00 0 00 001350' 35540 001345'01 265 01 0 00 001334* 35541 001346'01 000000000000# 35542 001347'01 254 00 0 00 001336* 35543 000630'04 125 156 141 142 154 35544 001350'01 621 02 0 00 777777 tlz t2, -1 ; Stomp any flags 35545 001351'01 120 05 0 00 000001 dmove q1, t1 ; Save the inferior's status and PC 35546 35547 001352'01 135 04 0 00 003634' ldb t4, [pointr. q1, rf%sts] 35548 001353'01 305 04 0 00 000011 caige t4, .rfmax ; Out of range? 35549 001354'01 254 00 0 00 001366' ifskp. ; Must be a new monitor 35550 001355'01 201 01 0 00 400000 movei t1, .fhslf ; Set our last error 35551 001356'01 200 02 0 00 000007 move t2, q3 ; To inferior's for better 35552 001357'01 104 00 0 00 000336 SETER% ; Diagnostic messages 35553 001360'01 320 12 0 00 001361' erjmpr .+1 ; Catch and ignore error 35554 001361'01 334 00 0 00 000000 %ermsg(,r) 35555 001362'01 254 00 0 00 001366' 35556 001363'01 265 01 0 00 001345* 35557 001364'01 000000000000# 35558 001365'01 254 00 0 00 001347* 35559 000640'04 111 156 146 145 162 35560 001366'01 endif. ; But regular handler won't work K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-1 K20TIM MAC 29-Apr-24 00:09 Device lower fork checking code 35561 35562 001366'01 306 07 0 00 601405 cain q3, lstrx1 ; Everything's Archie, right? 35563 001367'01 254 00 0 00 001372' ifskp. ; It isn't, so complain 35564 001370'01 200 01 0 00 000000# errtxt() 35565 000142'02 000000000000# 35566 000650'04 111 156 146 145 162 35567 001371'01 254 00 0 00 001414' callret ckderr ; Return from error type out 35568 001372'01 endif. 35569 35570 001372'01 325 05 0 00 001375' ifxn. q1, rf%frz ; Did it get frozen somehow? 35571 001373'01 200 01 0 00 000000# errtxt() 35572 000143'02 000000000000# 35573 000662'04 111 156 146 145 162 35574 001374'01 254 00 0 00 001414' callret ckderr ; Return from error type out 35575 001375'01 endif. ; Should never happen in the push loop 35576 ; Otherwise, load its status 35577 001375'01 306 04 0 00 000000 cain t4, .rfrun ; Running? 35578 001376'01 254 00 0 00 001234* retskp ; That's OK. I guess... 35579 001377'01 306 04 0 00 000001 cain t4, .rfio ; Doing I/O? 35580 001400'01 254 00 0 00 001376* retskp ; This is expected (what its supposed to be doing) 35581 001401'01 302 04 0 00 000002 caie t4, .rfhlt ; Halted?? 35582 001402'01 254 00 0 00 001413' ifskp. ; That might be OK, actually 35583 001403'01 302 06 0 00 000012 caie q2, devhlt+1 ; Normal halt? 35584 001404'01 254 00 0 00 001411' ifskp. ; Yes, so need to wait for buffers to drain 35585 txmsg <% Inferior timing fork normal termination, waiting on buffers 35586 001405'01 200 01 0 00 000000# > 35587 001406'01 104 00 0 00 000076 35588 001407'01 320 12 0 00 001410' 35589 000144'02 000000000000# 35590 000673'04 045 040 111 156 146 35591 35592 001410'01 254 00 0 00 001400* retskp ; And try again 35593 001411'01 endif. ; Otherwise, a real error 35594 001411'01 200 01 0 00 000000# errtxt() 35595 000145'02 000000000000# 35596 000710'04 111 156 146 145 162 35597 001412'01 254 00 0 00 001414' callret ckderr ; Return from error type out 35598 001413'01 endif. 35599 35600 remark ; Any other status is bad 35601 001413'01 200 01 0 00 000000# errtxt () 35602 000146'02 000000000000# 35603 000720'04 111 156 146 145 162 35604 remark ckderr ; Fall through to error type out 35605 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20TIM MAC 29-Apr-24 00:09 Handle print out of inferior error 35606 subttl Handle print out of inferior error 35607 35608 ; Expects ckptwr register environment except t1 has an error message 35609 35610 001414'01 104 00 0 00 000313 ckderr: ESOUT% ; First, do the blat 35611 001415'01 320 12 0 00 001416' erjmpr .+1 ; Catch and ignore error 35612 001416'01 201 01 0 00 000054 movei t1, "," ; Punctuate first part of error message 35613 001417'01 104 00 0 00 000074 PBOUT% 35614 001420'01 320 12 0 00 001421' erjmpr .+1 ; Catch and ignore error 35615 001421'01 201 01 0 00 000040 movei t1, .chspc ; And space over 35616 001422'01 104 00 0 00 000074 PBOUT% 35617 001423'01 320 12 0 00 001424' erjmpr .+1 ; Catch and ignore error 35618 35619 001424'01 200 01 0 04 001475' move t1,rfstst(t4) ; Load appropriate status text 35620 001425'01 104 00 0 00 000076 PSOUT% ; Type it 35621 001426'01 320 12 0 00 001427' erjmpr .+1 ; Catch and ignore error 35622 35623 001427'01 302 04 0 00 000003 caie t4, .rffpt ; Forced? 35624 001430'01 254 00 0 00 001445' ifskp. ; Then we have some more information 35625 001431'01 200 01 0 00 000000# errtxt (<, channel: >) ;Meaning, the channel number 35626 000147'02 000000000000# 35627 000730'04 054 040 143 150 141 35628 001432'01 104 00 0 00 000076 PSOUT% ; Type that 35629 001433'01 320 12 0 00 001434' erjmpr .+1 ; Catch and ignore error 35630 001434'01 201 01 0 00 000101 movei t1, .priou ; Output to our terminal 35631 001435'01 135 02 0 00 003635' ldb t2, [pointr. q1, rf%sic] ; Load forcing channel 35632 001436'01 201 03 0 00 000012 movei t3, ^d10 ; Which is in base 10 35633 001437'01 104 00 0 00 000224 NOUT% ; Type it 35634 001440'01 334 00 0 00 000000 %ermsg(,r) 35635 001441'01 254 00 0 00 001445' 35636 001442'01 265 01 0 00 001363* 35637 001443'01 000000000000# 35638 001444'01 254 00 0 00 001365* 35639 000733'04 111 156 146 145 162 35640 001445'01 endif. 35641 35642 001445'01 201 01 0 00 000054 movei t1, "," ; Punctuate first part of error message 35643 001446'01 104 00 0 00 000074 PBOUT% 35644 001447'01 320 12 0 00 001450' erjmpr .+1 ; Catch and ignore error 35645 001450'01 201 01 0 00 000040 movei t1, .chspc ; And space over 35646 001451'01 104 00 0 00 000074 PBOUT% 35647 001452'01 320 12 0 00 001453' erjmpr .+1 ; Catch and ignore error 35648 35649 001453'01 200 01 0 00 000101 move t1, .priou ; Going to primary output 35650 001454'01 505 02 0 00 400000 hrli t2, .fhslf ; Have to use ourself for explicit error 35651 001455'01 540 02 0 00 000007 hrr t2, q3 ; Pick up inferior handle 35652 001456'01 400 03 0 00 000000 setz t3, ; No limit to blat 35653 001457'01 104 00 0 00 000011 ERSTR% ; Blat away! 35654 001460'01 320 12 0 00 001462' erjmpr .+2 ; Ignore its strange return 35655 001461'01 320 12 0 00 001462' erjmpr .+1 ; Ignore its stranger return 35656 35657 001462'01 201 01 0 00 000054 movei t1, "," ; Punctuate first part of error message 35658 001463'01 104 00 0 00 000074 PBOUT% 35659 001464'01 320 12 0 00 001465' erjmpr .+1 ; Catch and ignore error 35660 001465'01 201 01 0 00 000040 movei t1, .chspc ; And space over K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27-1 K20TIM MAC 29-Apr-24 00:09 Handle print out of inferior error 35661 001466'01 104 00 0 00 000074 PBOUT% 35662 001467'01 320 12 0 00 001470' erjmpr .+1 ; Catch and ignore error 35663 35664 001470'01 200 01 0 00 000006 move t1, q2 ; Load inferior's captured PC 35665 001471'01 260 17 0 00 000000* call symout ; Symbolic type out of failed location 35666 35667 001472'01 561 01 0 00 001176* hrroi t1, crlf ; Tie off the line 35668 001473'01 104 00 0 00 000076 PSOUT% 35669 35670 001474'01 263 17 0 00 000000 ret ; Always return +1 to superior 35671 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20TIM MAC 29-Apr-24 00:09 Text for fork status codes 35672 subttl Text for fork status codes 35673 35674 remark ; RF%STS (Process Status Code) 35675 001475'01 000000000000# rfstst: eascii (< Runnable>) ; .RFRUN 35676 000741'04 040 122 165 156 156 35677 001476'01 000000000000# eascii (< I/O>) ; .RFIO (Dismissed for I/O) 35678 000743'04 040 111 057 117 000 35679 001477'01 000000000000# eascii (< Halted>) ; .RFHLT 35680 000744'04 040 110 141 154 164 35681 001500'01 000000000000# eascii (< Forced>) ; .RFFPT (Forced process termination) 35682 000746'04 040 106 157 162 143 35683 001501'01 000000000000# eascii (< Waiting>) ; .RFWAT (Waiting for inferior process) 35684 000750'04 040 127 141 151 164 35685 001502'01 000000000000# eascii (< Sleep>) ; .RFSLP 35686 000752'04 040 123 154 145 145 35687 001503'01 000000000000# eascii (< Trapped>) ; .RFTRP (JSYS Trapped) 35688 000754'04 040 124 162 141 160 35689 001504'01 000000000000# eascii (< Address>) ; .RFABK (Address break freeze) 35690 000756'04 040 101 144 144 162 35691 001505'01 000000000000# eascii (< Signal>) ; .RFSIG (Signal JFN freeze) 35692 000760'04 040 123 151 147 156 35693 000011 .rfmax==.rfsig+1 35694 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20TIM MAC 29-Apr-24 00:09 Discover NUL: baud rate 35695 subttl Discover NUL: baud rate 35696 35697 ; Written to merely check calculations code before writing other timers 35698 ; 35699 ; As above, NUL:'s virtual baud rate means very little. 35700 ; 35701 ; Unlike the above, NOTHING reads the SOUTR% because this is 35702 ; (onviously) impossible to do as the data just got dumped. The 35703 ; reason four times the data is written is to work the rate 35704 ; calculations in a different way, stressing them to look for edge 35705 ; cases 35706 ; 35707 ; Therefore, doing parity on NUL: is relatively to moderately...useless. 35708 35709 remark pars4 ; SOUTR% byte size 35710 35711 770000 000000 pbyte==maskb(0,5) ; Position of a byte in a section local pointer 35712 007700 000000 sbyte==maskb(6,11) ; Size of a byte in a section local pointer 35713 35714 001506'01 dnulbd: intern dnulbd ; Invoked by k20dsp 35715 001506'01 477 04 0 00 000005 setob t4, t5 ; Let's assume we can't do anything 35716 dmove t1,[.fhslf,,nulpag ; Source is NUL: page 35717 001507'01 120 01 0 00 003636' .fhslf,,nulpag+1 ] ; Destination is the second page 35718 001510'01 200 03 0 00 003640' movx t3, pm%cnt!pm%rd!fld(nulpgs,pm%rpt) ; Read only 35719 001511'01 104 00 0 00 000056 PMAP% ; Case III, process to process PMAP% 35720 001512'01 320 12 0 00 001514' %jserr (, nulepi) 35721 001513'01 254 00 0 00 001517' 35722 001514'01 265 01 0 00 001442* 35723 001515'01 000000000000# 35724 001516'01 254 00 0 00 001572' 35725 000762'04 125 156 141 142 154 35726 35727 remark ; NUL counts are different 35728 001517'01 333 04 0 00 000702* skiple t4, pars4 ; Pick up byte size for SOUTR% 35729 001520'01 254 00 0 00 001523' ifskp. ; Was anything specifed? 35730 dmove t2,[ ; No, use defaults 35731 point 8,nulwrt ; Where we're writing from 35732 001521'01 120 02 0 00 003641' - ] ; Number of characters in the pages 35733 001522'01 254 00 0 00 001531' else. ; Otherwise, need to do some coversions 35734 001523'01 120 02 0 00 003557' dmove t2,[exp -1,-^d36] ;Load double negative integer 36 35735 001524'01 234 02 0 00 000004 div t2, t4 ; Calculate bytes per word 35736 001525'01 225 02 0 00 004000 muli t2, nullen ; Now have total bytes we'll do in t3 35737 001526'01 205 02 0 00 440000 movx t2, ; Set up for an ILDB at bit '36' 35738 001527'01 137 04 0 00 003561' dpb t4, [ pointr t2, sbyte ] ; Drop in the byte size 35739 001530'01 541 02 0 00 000000# hrri t2, nulwrt ; Finally drop in the address 35740 001531'01 endif. ; End non-standard byte size 35741 35742 001531'01 201 01 0 00 377777 movx t1, .nulio ; Just dumping, maybe really fast 35743 001532'01 210 04 0 00 000003 movn t4, t3 ; Save count used 35744 001533'01 260 17 0 00 002033' call statim ; Start timing the transfer 35745 001534'01 104 00 0 00 000532 SOUTR% ; Bombs away!!! 35746 001535'01 320 12 0 00 001537' %jserr (, nulepi) 35747 001536'01 254 00 0 00 001542' 35748 001537'01 265 01 0 00 001514* 35749 001540'01 000000000000# K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29-1 K20TIM MAC 29-Apr-24 00:09 Discover NUL: baud rate 35750 001541'01 254 00 0 00 001572' 35751 000770'04 125 156 141 142 154 35752 001542'01 260 17 0 00 002050' call endtim ; Finish the timing 35753 35754 001543'01 260 17 0 00 002133' call elptim ; Compute elapsed transfer time 35755 001544'01 400 01 0 00 000000 setz t1, ; Zero high order of characters transferred 35756 001545'01 200 02 0 00 000004 move t2, t4 ; Load low order of characters transferred 35757 001546'01 116 01 0 00 003601' dmul t1, [exp 0, ^d100000*^d10 ] ; Scale to bits in microsecond time 35758 001547'01 120 01 0 00 000003 dmove t1, t3 ; Load low order double word 35759 001550'01 260 17 0 00 003301' call dfloat ; Convert to double floating point 35760 001551'01 334 00 0 00 000000 %ermsg (, nulepi) 35761 001552'01 254 00 0 00 001556' 35762 001553'01 265 01 0 00 001537* 35763 001554'01 000000000000# 35764 001555'01 254 00 0 00 001572' 35765 000775'04 125 156 141 142 154 35766 001556'01 120 03 0 00 000001 dmove t3, t1 ; Save double floating bit count 35767 35768 001557'01 120 01 0 00 000000# dmove t1, ewallt+.datus ; Load tens of nanoseconds used 35769 001560'01 260 17 0 00 003301' call dfloat ; Convert to double floating point 35770 001561'01 334 00 0 00 000000 %ermsg (, nulepi) 35771 001562'01 254 00 0 00 001566' 35772 001563'01 265 01 0 00 001553* 35773 001564'01 000000000000# 35774 001565'01 254 00 0 00 001572' 35775 001003'04 125 156 141 142 154 35776 001566'01 113 03 0 00 000001 dfdv t3, t1 ; Divide bits by ticks 35777 001567'01 120 04 0 00 000003 dmove t4, t3 ; Return in the expected place 35778 001570'01 260 17 0 00 001572' call nulepi ; Call the epilogue 35779 001571'01 254 00 0 00 001410* retskp ; Return success 35780 35781 001572'01 nulepi: remark NUL test epilogue 35782 001572'01 474 01 0 00 000000 seto t1, ; Removing pages 35783 dmove t2,[.fhslf,,nulpag+1 ;Whacking dirty pages from address space 35784 001573'01 120 02 0 00 003643' pm%cnt!pm%abt!fld(nulpgs,pm%rpt) ] ; Read only 35785 001574'01 104 00 0 00 000056 PMAP% ; Reduce our working set size 35786 001575'01 320 12 0 00 001577' ifje. r ; Should never happen... 35787 001576'01 254 00 0 00 001600' 35788 001577'01 200 03 0 00 000001 move t3, t1 ; Store error for debuggers 35789 001600'01 endif. 35790 35791 001600'01 263 17 0 00 000000 ret 35792 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20TIM MAC 29-Apr-24 00:09 Set up for parity checking (if we're doing parity) 35793 subttl Set up for parity checking (if we're doing parity) 35794 35795 ;[223] Begin code insertion 35796 35797 ;N.B., Assumes we're ALWAYS doing 8 bit transfers, which is what 35798 ; Kermit would be sending over the line. However, due to the last 35799 ; four bits of the data being transferred having rotating values, 35800 ; it may be possible to get into the situation here where the byte 35801 ; parity is reported as being fine, but the word comparison can fail. 35802 35803 extern parity, none ; If we're doing any kind of parity 35804 extern genint ; Constructed instruction if generating parity 35805 remark ; If doing parity, ALWAYS sending AND checking it 35806 35807 chgsec(code,data) ;;Needs some writable storage 35808 000125'05 000000 000000 timpar: 0 ; Set if was doing parity 35809 retsec ;;Back in code 35810 35811 001601'01 402 00 0 00 000000# parset: setzm timpar ; Don't assume doing parity 35812 001602'01 200 01 0 00 000000* move t1, parity ; Load parity setting 35813 001603'01 302 01 0 00 000000* caie t1, none ; Not doing any parity? 35814 001604'01 254 00 0 00 001607' ifskp. ; Nope, nothing further to do 35815 001605'01 254 00 0 00 001571* retskp ; so get out of here 35816 001606'01 254 00 0 00 001614' else. ; Otherwise, doing some real work 35817 001607'01 335 01 0 00 000000# skipge t1, timdev ; Load timing device 35818 001610'01 254 00 0 00 001605* retskp ; Unless never got one 35819 001611'01 306 01 0 00 000015 cain t1, .dvnul ; NUL:? 35820 001612'01 254 00 0 00 001610* retskp ; Yeah, no way to read from that, so forget parity 35821 001613'01 476 00 0 00 000000# setom timpar ; Flag we're doing parity 35822 001614'01 endif. 35823 35824 remark ; OK to trash these temporaries 35825 001614'01 265 16 0 00 003645' saveac ; But needs many piggy registers 35826 35827 001615'01 201 01 0 00 004000 movei t1, devchr ; Load number of characters 35828 001616'01 200 04 0 00 000001 move t4, t1 ; destination string is same length 35829 001617'01 201 02 0 00 000000# movei t2, devwrt ; Load address of what will be written 35830 001620'01 201 05 0 00 000000# movei q1, devdat ; Where we'll write the converted data 35831 001621'01 505 02 0 00 441000 hrli t2, (point 8,0) ; Turn source address into a section local point 35832 001622'01 500 05 0 00 000002 hll q1, t2 ; Ditto destination pointer, both being 8 bits 35833 001623'01 403 03 0 00 000006 setzb t3, q2 ; Force pointer to remain section local 35834 001624'01 200 07 0 00 000000* move q3, genint ; Load parity generation instruction 35835 001625'01 400 10 0 00 000000 setz q4, ; Unused fill character will be NUL 35836 001626'01 661 01 0 00 400000 txo t1, S ; Start significance immediately 35837 001627'01 123 01 0 00 000007 extend t1, q3 ; Finally do the conversion 35838 001630'01 320 12 0 00 001444* erjmpr r ;[267] Can die in a batch job, go figure 35839 001631'01 254 00 0 00 001632' callret chkleg ; Check generated parity against legacy parity 35840 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20TIM MAC 29-Apr-24 00:09 Routine to check parity we generated against legacy routines 35841 subttl Routine to check parity we generated against legacy routines 35842 35843 ; +1 If disagreement someplace 35844 ; +2 If complete agreement 35845 35846 extern putc ; Does a small amount of formating 35847 35848 001632'01 chkleg: dmove t2, [ ; Will run legacy routines 35849 point 8, devwrt ; over same string 35850 001632'01 120 02 0 00 003657' point 8, devdat ] ; and compare the results 35851 001633'01 200 07 0 00 000002 move q3, t2 ; Save original string pointer 35852 001634'01 201 06 0 00 004000 movei q2, devchr ; Load number of characters 35853 35854 001635'01 do. ; Enter loop context 35855 001635'01 361 06 0 00 001644' sojl q2, endlp. ; Account for a character pair consumed 35856 001636'01 134 01 0 00 000002 ildb t1, t2 ; Pick up byte from original string 35857 001637'01 260 17 1 00 001602* call @parity ; Compute the correct parity 35858 001640'01 134 04 0 00 000003 ildb t4, t3 ; Pick up byte from MOVST generated string 35859 001641'01 312 01 0 00 000004 came t1, t4 ; The same? 35860 001642'01 254 00 0 00 001644' exit. ; They are not, give up right now 35861 001643'01 254 00 0 00 001635' loop. ; Nose through the rest 35862 001644'01 enddo. ; End loop lexical context 35863 35864 001644'01 321 06 0 00 001612* jumpl q2, RSKP ; Did them all? That's dandy!! 35865 ; Sigh... 35866 001645'01 200 05 0 00 000001 move q1, t1 ; Save legacy parity 35867 001646'01 200 10 0 00 000004 move q4, t4 ; Save MOVST generated parity 35868 001647'01 201 01 0 00 004000 movei t1, devchr ; Load original number of characters 35869 001650'01 274 01 0 00 000006 sub t1, q2 ; Calculate bad byte position 35870 001651'01 200 06 0 00 000001 move q2, t1 ; Save result 35871 001652'01 133 01 0 00 000007 adjbp t1, q3 ; Position to the correct character 35872 001653'01 135 07 0 00 000001 ldb q3, t1 ; And load the character 35873 ; Finally start complaining 35874 001654'01 200 01 0 00 000000# emsg () 35875 001655'01 104 00 0 00 000313 35876 000150'02 000000000000# 35877 001011'04 107 145 156 145 162 35878 001656'01 201 01 0 00 000101 movei t1, .priou ; Still typing on terminal 35879 001657'01 200 02 0 00 000006 move t2, q2 ; Load byte position 35880 001660'01 201 03 0 00 000010 movei t3, ^d8 ; k20ioc table is documented in octal 35881 001661'01 104 00 0 00 000224 NOUT% ; Type it 35882 001662'01 320 12 0 00 001664' %jserr (,) 35883 001663'01 254 00 0 00 001667' 35884 001664'01 265 01 0 00 001563* 35885 001665'01 000000000000# 35886 001666'01 254 00 0 00 001667' 35887 001017'04 125 156 141 142 154 35888 35889 001667'01 200 01 0 00 000000# txmsg (<, legacy: >) 35890 001670'01 104 00 0 00 000076 35891 001671'01 320 12 0 00 001672' 35892 000151'02 000000000000# 35893 001026'04 054 040 154 145 147 35894 001672'01 200 04 0 00 000005 move t4, q1 ; Load what arithmatic calculated 35895 001673'01 201 01 0 00 000060 movei t1, "0" ; Let's assume it was zero K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-1 K20TIM MAC 29-Apr-24 00:09 Routine to check parity we generated against legacy routines 35896 001674'01 622 04 0 00 000200 txze t4, 200 ; Check and strip the parity 35897 001675'01 201 01 0 00 000061 movei t1, "1" ; It's set! 35898 001676'01 104 00 0 00 000074 PBOUT% ; Either way, type it 35899 001677'01 201 01 0 00 000101 movei t1, .priou ; Still typing on terminal 35900 001700'01 200 02 0 00 000004 move t2, t4 ; Load the value, itself 35901 001701'01 200 03 0 00 003661' movx t3, 35902 001702'01 104 00 0 00 000224 NOUT% ; Type it 35903 001703'01 320 12 0 00 001705' %jserr (,) 35904 001704'01 254 00 0 00 001710' 35905 001705'01 265 01 0 00 001664* 35906 001706'01 000000000000# 35907 001707'01 254 00 0 00 001710' 35908 001031'04 125 156 141 142 154 35909 35910 001710'01 200 01 0 00 000000# txmsg (<, table: >) 35911 001711'01 104 00 0 00 000076 35912 001712'01 320 12 0 00 001713' 35913 000152'02 000000000000# 35914 001040'04 054 040 164 141 142 35915 001713'01 200 04 0 00 000010 move t4, q4 ; Load what MOVST looked up 35916 001714'01 201 01 0 00 000060 movei t1, "0" ; Let's assume it was zero 35917 001715'01 622 04 0 00 000200 txze t4, 200 ; Check and strip the parity 35918 001716'01 201 01 0 00 000061 movei t1, "1" ; It's set! 35919 001717'01 104 00 0 00 000074 PBOUT% ; Either way, type it 35920 001720'01 201 01 0 00 000101 movei t1, .priou ; Still typing on terminal 35921 001721'01 200 02 0 00 000004 move t2, t4 ; Load the value, itself 35922 001722'01 200 03 0 00 003661' movx t3, 35923 001723'01 104 00 0 00 000224 NOUT% ; Type it 35924 001724'01 320 12 0 00 001726' %jserr (,) 35925 001725'01 254 00 0 00 001731' 35926 001726'01 265 01 0 00 001705* 35927 001727'01 000000000000# 35928 001730'01 254 00 0 00 001731' 35929 001042'04 125 156 141 142 154 35930 35931 001731'01 200 01 0 00 000000# txmsg (<, character: >) 35932 001732'01 104 00 0 00 000076 35933 001733'01 320 12 0 00 001734' 35934 000153'02 000000000000# 35935 001050'04 054 040 143 150 141 35936 001734'01 400 04 0 00 000000 setz t4, ; Let's assume bit 8 is not up 35937 001735'01 200 01 0 00 000007 move t1, q3 ; Load the character 35938 001736'01 622 01 0 00 000200 txze t1, 200 ; Zero bit 8 and skip if wasn't set 35939 001737'01 474 04 0 00 000000 seto t4, ; Was set... 35940 001740'01 260 17 0 00 000000* call putc ; Type our poor character 35941 001741'01 322 04 0 00 001745' ifn. t4 ; Did it have bit eight up? 35942 001742'01 200 01 0 00 000000# txmsg (<(M)>) ; List that as 'Mark' 35943 001743'01 104 00 0 00 000076 35944 001744'01 320 12 0 00 001745' 35945 000154'02 000000000000# 35946 001053'04 050 115 051 000 000 35947 001745'01 endif. 35948 001745'01 561 01 0 00 001472* hrroi t1, crlf 35949 001746'01 104 00 0 00 000076 PSOUT% 35950 001747'01 263 17 0 00 000000 ret K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-2 K20TIM MAC 29-Apr-24 00:09 Routine to check parity we generated against legacy routines 35951 35952 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20TIM MAC 29-Apr-24 00:09 Check parity (if we're doing parity) 35953 subttl Check parity (if we're doing parity) 35954 35955 ;N.B., Assumes parset has been called and will almost surly *BREAK* otherwise 35956 35957 extern chkint ; Constructed instruction if checking parity 35958 35959 001750'01 336 00 0 00 000000# parchk: skipn timpar ; Did we actually do any parity? 35960 001751'01 254 00 0 00 001644* retskp ; Nope, then say all is well 35961 001752'01 335 01 0 00 000000# skipge t1, timdev ; Load timing device 35962 001753'01 254 00 0 00 001751* retskp ; Unless never got one 35963 001754'01 306 01 0 00 000015 cain t1, .dvnul ; NUL:? 35964 001755'01 254 00 0 00 001753* retskp ; Yeah, no way to read from that, so forget parity 35965 35966 remark ; OK to trash these temporaries 35967 001756'01 265 16 0 00 003645' saveac ; But needs many piggy registers 35968 35969 001757'01 201 01 0 00 004000 movei t1, devchr ; Load number of characters 35970 001760'01 200 04 0 00 000001 move t4, t1 ; destination string is same length 35971 001761'01 201 02 0 00 000000# movei t2, devred ; Source is what the subfork read 35972 001762'01 201 05 0 00 000000# movei q1, devda2 ; destination is seperate; do not update in place 35973 001763'01 505 02 0 00 441000 hrli t2, (point 8,0) ; Turn source address into a section local point 35974 001764'01 500 05 0 00 000002 hll q1, t2 ; Ditto destination pointer, both being 8 bits 35975 001765'01 403 03 0 00 000006 setzb t3, q2 ; Force pointer to remain section local 35976 001766'01 200 07 0 00 000000* move q3, chkint ; Load parity checking instruction 35977 001767'01 400 10 0 00 000000 setz q4, ; Fill character is NUL (yet unused...) 35978 remark t1, N!M ; Shut off Negative and Mark (movei cleared them) 35979 001770'01 661 01 0 00 400000 txo t1, S ; Have to dink the foolish significance bit... 35980 001771'01 123 01 0 00 000007 extend t1, q3 ; Get down to some serious string translating 35981 001772'01 600 00 0 00 000000 nop ; Can't happen 35982 001773'01 627 01 0 00 200000 txzn t1, N ; Bump into any bad parity? 35983 001774'01 254 00 0 00 001755* retskp ; Nope, everything's fin 35984 35985 001775'01 120 07 0 00 000001 dmove q3, t1 ; Save failing character position 35986 001776'01 200 01 0 00 000000# emsg 35987 001777'01 104 00 0 00 000313 35988 000155'02 000000000000# 35989 001054'04 120 141 162 151 164 35990 002000'01 201 01 0 00 000101 movei t1, .priou ; Primary output 35991 dmove t2, [ devchr ; Load number of characters 35992 002001'01 120 02 0 00 003662' ^d10 ] ; Positions are in decimal 35993 002002'01 274 02 0 00 000007 sub t2, q3 ; Subtract remaining to get position 35994 002003'01 104 00 0 00 000224 NOUT% ; Type it 35995 002004'01 320 12 0 00 002006' %jserr(,) 35996 002005'01 254 00 0 00 002011' 35997 002006'01 265 01 0 00 001726* 35998 002007'01 000000000000# 35999 002010'01 254 00 0 00 002011' 36000 001063'04 103 157 165 154 144 36001 36002 002011'01 201 06 0 00 004000 movei q2, devchr ; Load original 36003 002012'01 274 06 0 00 000004 sub q2, t4 ; Calculate amount done 36004 002013'01 323 06 0 00 002032' ifg. q2 ; Did we do anything (or gubbish)? 36005 002014'01 200 01 0 00 000000# txmsg (<, translated: ">) 36006 002015'01 104 00 0 00 000076 36007 002016'01 320 12 0 00 002017' K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-1 K20TIM MAC 29-Apr-24 00:09 Check parity (if we're doing parity) 36008 000156'02 000000000000# 36009 001074'04 054 040 164 162 141 36010 dmove t1, [ .priou ; Still going to primary output 36011 002017'01 120 01 0 00 003664' point 8, devda2 ] ; From beginning of translation buffer 36012 002020'01 210 03 0 00 000006 movn t3, q2 ; Counted transfer 36013 002021'01 104 00 0 00 000053 SOUT% ; and type what we did 36014 002022'01 320 12 0 00 002024' %jserr(,) 36015 002023'01 254 00 0 00 002027' 36016 002024'01 265 01 0 00 002006* 36017 002025'01 000000000000# 36018 002026'01 254 00 0 00 002027' 36019 001100'04 103 157 165 154 144 36020 txmsg (<" 36021 002027'01 200 01 0 00 000000# >) ; Shutting off font-crock mode 36022 002030'01 104 00 0 00 000076 36023 002031'01 320 12 0 00 002032' 36024 000157'02 000000000000# 36025 001110'04 042 015 012 000 000 36026 002032'01 endif. 36027 002032'01 263 17 0 00 000000 ret ; Failure return 36028 36029 ;[223] End code insertion 36030 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20TIM MAC 29-Apr-24 00:09 Transfer timing routines 36031 subttl Transfer timing routines 36032 36033 ;[207] Begin code insertion 36034 36035 ; Historically, Kermit timed transfers using the time of day clock 36036 ; which has approximately 1/3 of second resolution. That's probably 36037 ; fine for dial up or even local terminals where the DH11 would limit 36038 ; you to 9600 baud. The most we could get in 1988 was 19.2Kbd on a 36039 ; local Microvax connecting to CU20B. 36040 ; 36041 ; The pseudo-terminal code can do a megabaud and TCP/IP uploads to 36042 ; ckermit are clearing 500 kilobaud. A short file can get sent in FAR 36043 ; less then a time of day tick. So we read some timers here that have 36044 ; greater resolution. 36045 ; 36046 ; Although it is not currently (2023) necessary to exceed DK10 36047 ; internal clock resolution (10 microseconds, see HPTIM%), a 36048 ; certain amount of anticipatory code has been written to do this, 36049 ; particularly in the area of extended uptimes. 36050 ; 36051 ; For example, Kermit can handle the display of terabaud speeds (see 36052 ; ranger in k20dsp). It should be noted that, with faster hosts, a 36053 ; transfer may get done in less time then the scheduling interval, so 36054 ; such times should be carefully reviewed. 36055 ; 36056 ; Another matter is such resolution with the extended uptimes 36057 ; apparently available with certain version of Tops-20. DEC and PANDA 36058 ; Tops-20 7.x can not handle a millisecond uptime which exceeds a 36059 ; signed 35 bit number. It will crash with an UP2LNG BUGHLT (see 36060 ; APRSRV) after 1 Year, 4 Weeks, 5 Days, 16 Hours, 22 Minutes, 18 36061 ; Seconds and 367 Milliseconds. 36062 36063 ; Given the user load on systems and the hardware technology of the 36064 ; early 1980's, this was about 5 times the maximum uptime (a little 36065 ; over two months) that was ever seen on CU20B. It is easily 36066 ; exceeded on systems with commodity hardware and one or two active 36067 ; users. 36068 ; 36069 ; The XKL (and possibly other) version(s) of Tops-20 return the uptime 36070 ; in a signed double word. The full 70 bit millisecond number will be 36071 ; reported as 37,539,161 Millennia, 7 Centuries, 2 Decades, 9 Years, 8 36072 ; Weeks, 2 Days, 11 Hours, 35 Minutes, 3 Seconds and 423 Milliseconds. 36073 ; 36074 ; Since the current estimate of the age of the universe is 13.7 36075 ; billion years, a thirty seven and a half billion year uptime is 36076 ; probably fine. 36077 ; 36078 ; This code handles running on an XKL monitor (which does not have 36079 ; DECnet support). 36080 ; 36081 ; In 2023, doing a get "NUL:" NUL: when connected to a pseudo- 36082 ; terminal gets an elapsed transfer time of 1.6 milliseconds, so we 36083 ; are already getting pretty close to the microsecond realm. 36084 36085 chgsec(code,data) ;;Declare writable storage K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33-1 K20TIM MAC 29-Apr-24 00:09 Transfer timing routines 36086 36087 remark stdat,etdat,ewallt 36088 36089 xlist ; Save a few trees 36090 list ; Turn the listing back on 36091 36092 retsec 36093 36094 remark Set variables at the beginning of a transfer transfer 36095 36096 002033'01 statim: entry statim ; Allow global use 36097 002033'01 265 16 0 00 003666' saveac ; Don't side effect any accumulators 36098 36099 remark ; Set up initial states of timing blocks 36100 002034'01 415 04 0 00 000000# xmovei t4, etdat ; Resolve address of end time data block 36101 002035'01 260 17 0 00 002042' call zeroit ; Go zero it out 36102 36103 002036'01 415 04 0 00 000000# xmovei t4, ewallt ; Load address of elapsed wall time 36104 002037'01 260 17 0 00 002042' call zeroit ; Go whack that, too 36105 36106 002040'01 415 04 0 00 000000# xmovei t4, stdat ; Resolve address of timing data block 36107 002041'01 254 00 0 00 002052' callret timwrk ; Hit the time worker and return through it 36108 36109 002042'01 zeroit: remark t4,address ; Routine to stomp a time block 36110 002042'01 201 01 0 00 000020 movx t1, dtilen-1 ; Length of remaining structure to whack 36111 002043'01 200 02 0 00 000004 move t2, t4 ; First location to whack 36112 002044'01 201 03 0 02 000001 movei t3, 1(t2) ; Cascading whackage 36113 002045'01 402 00 0 02 000000 setzm (t2) ; Stomp the first word 36114 002046'01 123 01 0 00 003564' xblt. t1 ; Stomp the rest of them 36115 002047'01 263 17 0 00 000000 ret ; Done 36116 36117 remark Set variables at end of transfer 36118 36119 002050'01 endtim: entry endtim ; Allow global use 36120 002050'01 265 16 0 00 003666' saveac ; Don't side effect any accumulator 36121 002051'01 415 04 0 00 000000# xmovei t4, etdat ; Resolve address of timing data block 36122 remark timwrk ; fall through to the time worker 36123 ; (and return through it) 36124 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20TIM MAC 29-Apr-24 00:09 Time storage worker 36125 subttl Time storage worker 36126 36127 ; Call: Expects t4 to have the block address 36128 ; 36129 ; Be aware that all timing variables have gone from a single word to 36130 ; three words and resolution is stored in increasing resolution in 36131 ; order to not break any overlooked older code. 36132 ; 36133 ; The reads are done in the reverse order to keep HPTIM% as accurate 36134 ; as possible. "Accurate" may be debatable; the point of going to 36135 ; microsecond level reads was not accuracy so much as the timings had 36136 ; gone under a TOD tick (approximately 329.58858646932 milliseconds). 36137 ; 36138 ; It was subsequently discovered that some transfers are happening so 36139 ; quickly that they are approaching sub-millisecond levels (I.E., 36140 ; single digit milliseconds), bringing Kermit into the microsecond 36141 ; realm. 36142 ; 36143 ; Negative numbers will flag errors for uptime because these currently 36144 ; will not go negative. Since the time of day is actually unsigned 36145 ; (mostly), this isn't possible, so that is flagged as zero as Tops-20 36146 ; didn't exist in 1858. 36147 ; 36148 ; Note the compatible use of the strange XKL arguments to the TIME% 36149 ; JSYS, lifted from my rewrite of OS/2 UPTIME.MAC. Documentation of 36150 ; arcane TIME% changes from Ralph Gorin of XKL. The full text is 36151 ; STAR:TOPS-20-UPTIME.TXT. 36152 ; 36153 ; Date: Sat, 07 Mar 2009 14:35:18 -0800 36154 ; From: Ralph Gorin 36155 ; To: Thomas DeBellis 36156 ; CC: Tops-20 Wizards 36157 ; Subject: Re: Another Uptime Record 36158 ; In-Reply-To: <49B29F35.4010402@acedsl.com> 36159 ; Message-ID: <49B2F6A6.3040602@xkl.com> 36160 ; 36161 ; ... 36162 ; 36163 ; If AC 1 contains 'TODSEC' then return the uptime in seconds 36164 ; in AC 1, the residue in milliseconds in LH of AC 2 36165 ; and the divisor to convert to seconds (the number 1) 36166 ; in the RH of AC 2. 36167 ; 36168 ; If AC 1 contains 'MSTIME' then return the uptime in milliseconds 36169 ; as a double word in AC 1 and AC 2. 36170 ; 36171 ; For other values of AC 1, the old behavior is preserved. 36172 ; 36173 ; If the uptime has exceeded 2^35 milliseonds, the program gets the 36174 ; TIMEX3 error. This is an encouragement to fix old programs. 36175 ; 36176 ; Note, the code below is not 'perfect' because it will do the wrong 36177 ; thing on an XKL monitor that is up for 1000 milliseconds in the low 36178 ; order register, no matter is what in the high order. As this will 36179 ; 'only' happen for a single millisecond once every 56 Weeks, 5 Days, K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-1 K20TIM MAC 29-Apr-24 00:09 Time storage worker 36180 ; 16 Hours, 22 Minutes, 18 Seconds and 367 Milliseconds, it is 36181 ; expected to be 'relatively' uncommon. 36182 ; 36183 ; It also assumes that the millisecond uptime is stored as a 36 bit 36184 ; unsigned number. This isn't true in 'vanilla' Tops-20; it's a 35 36185 ; bit signed value and should never be negative. A bit of defensive 36186 ; coding for intermediate implementations. 36187 36188 002052'01 timwrk: remark t1,t2,t3 ; Previously saved and available 36189 002052'01 265 16 0 00 003700' saveac ; Will need t1-t4 for the double math 36190 002053'01 200 05 0 00 000004 move q1, t4 ; Save the address so have block of four accumulators 36191 36192 002054'01 403 01 0 00 000002 setzb t1, t2 ; A handy pair of zeros for .HPELP 36193 ; dmove t1, [ .HPELP ; Elapsed DK10 ticks since start 36194 ; 0 ] ; A handy zero 36195 002055'01 104 00 0 00 000501 HPTIM% ; Grab it 36196 002056'01 320 12 0 00 002060' ifje. r ; Failed?? 36197 002057'01 254 00 0 00 002063' 36198 002060'01 560 02 0 00 000001 hrro t2, t1 ; Turn negative to flag error 36199 002061'01 474 01 0 00 000000 seto t1, ; Ditto low order 36200 002062'01 254 00 0 00 002064' else. ; Otherwise worked, 36201 002063'01 250 02 0 00 000001 exch t2, t1 ; so put in low order 36202 002064'01 endif. ; and just use it 36203 002064'01 124 01 0 05 000017 dmovem t1, .datus(q1) ; Store amount or error (and possible flag) 36204 36205 002065'01 120 01 0 00 000000# dmove t1, mstime ; XKL's arcane 'magic' argument (if Toad) 36206 002066'01 104 00 0 00 000014 TIME% ; Get uptime in milliseconds (maybe long) 36207 002067'01 320 12 0 00 002071' ifje. r ; Failed?? 36208 002070'01 254 00 0 00 002074' 36209 002071'01 560 02 0 00 000001 hrro t2, t1 ; Turn negative to flag error 36210 002072'01 474 01 0 00 000000 seto t1, ; Ditto low order 36211 002073'01 254 00 0 00 002102' else. ; Otherwise, some kind of success 36212 002074'01 302 02 0 00 001750 caie t2, ^d1000 ; XKL monitor? 36213 002075'01 254 00 0 00 002102' ifskp. ; No, plain old 'vanilla' 36214 002076'01 200 02 0 00 000001 move t2, t1 ; Put low order in proper place 36215 002077'01 627 02 0 00 400000 tlzn t2,(1b0) ; Test if Negative, fix low order and skip 36216 002100'01 634 01 0 00 000001 tdza t1, t1 ; Positive, zero high order and skip 36217 002101'01 201 01 0 00 000001 movei t1, ^d1 ; Negative, put sign bit in the high order 36218 002102'01 endif. ; Otherwise XKL, so can stay up a lot longer!! 36219 002102'01 endif. ; End TIME% result handling 36220 002102'01 124 01 0 05 000015 dmovem t1, .datms(q1) ; Store error (and possible flag) 36221 36222 002103'01 325 01 0 00 002120' ifl. t1 ; TIME% gronked somehow? 36223 002104'01 104 00 0 00 000227 GTAD% ; Oh well, get time of day 36224 002105'01 320 12 0 00 002107' ifje. r ; Failed?? 36225 002106'01 254 00 0 00 002111' 36226 002107'01 552 01 0 05 000000 hrrzm t1, .dattd(q1) ;Store error and flag it (not 1858!!) 36227 002110'01 254 00 0 00 002117' else. ;Otherwise worked, 36228 002111'01 202 01 0 05 000000 movem t1, .dattd(q1) ; so just use it 36229 002112'01 200 02 0 00 000001 move t2, t1 ; Put low order in proper place 36230 002113'01 627 02 0 00 400000 tlzn t2,(1b0) ; Test if Negative, fix low order and skip 36231 002114'01 634 01 0 00 000001 tdza t1, t1 ; Positive, zero high order and skip 36232 002115'01 201 01 0 00 000001 movei t1, ^d1 ; Negative, put sign bit in the high order 36233 002116'01 124 01 0 05 000001 dmovem t1, .dattl(q1) ;Store signed double word result 36234 002117'01 endif. ; End JSYS result handling K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34-2 K20TIM MAC 29-Apr-24 00:09 Time storage worker 36235 002117'01 263 17 0 00 000000 ret ; Either way, we're done 36236 002120'01 endif. 36237 36238 002120'01 260 17 0 00 002753' call miltod ; Convert millisecond uptime to TOD ticks 36239 002121'01 124 03 0 05 000013 dmovem t3, .datmr(q1) ; Store millisecond remainder 36240 002122'01 124 01 0 05 000001 dmovem t1, .dattl(q1) ; Time of Date (TOD) as signed double 36241 002123'01 322 01 0 00 002125' ifn. t1 ; Any high order? 36242 002124'01 661 02 0 00 400000 tlo t2,(1b0) ; Yes, coerce to low order 36243 002125'01 endif. 36244 002125'01 202 02 0 05 000000 movem t2, .dattd(q1) ; Time of Date (TOD) in unsigned ticks 36245 002126'01 263 17 0 00 000000 ret ; Done, finally 36246 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20TIM MAC 29-Apr-24 00:09 Compute Elapsed Wall Times 36247 subttl Compute Elapsed Wall Times 36248 36249 ; Populates a block with elapsed TOD ticks, milliseconds and HPTIM% 36250 ; ticks (10 ms resolution). 36251 ; 36252 ; Note that the HPTIM% elapsed wall time will wrap at a value of 3 36253 ; Days, 4 Hours, 21 Minutes, 17 Seconds, 906 Milliseconds and 940 36254 ; Microseconds (76:21:17.906.940). This is the basis for the comment 36255 ; of 76 hours in the monitor. Therefore, the greatest possible 36256 ; elapsed high precision time that can be measured is the above. 36257 ; 36258 ; The value for maxhpt is gotten by running the monitor code (MTIME:: 36259 ; in APRSRV.MAC with the maximum value that RDTIME could theoretically 36260 ; return, a double word of .infin (377777,,-1). No known processor 36261 ; would do this and other uptime counters would have wrapped far 36262 ; before we got anywhere near this value. 36263 ; 36264 ; Be aware that the value for maxhpt is in HPTIM% ticks or DK10 units 36265 ; when running on the 100 kHz internal clock. Should you wish to double 36266 ; check this value (say by putting it into UPTIME), then you need to 36267 ; multiply it by 10 decimal to scale it to microseconds. That value 36268 ; will be the double word value 7::377777,,777774. 36269 ; 36270 ; If that situation is detected, then we punt and simulate with an 36271 ; appropriately scaled millisecond value. However, the maximum amount 36272 ; of DK10 time that can be held in a single word is .infin, which 36273 ; works out to 95:26:37.383.670. If that situation is hit, then we 36274 ; stop faking DK10 ticks and just pretend we don't have any more of 36275 ; them. 36276 ; 36277 ; maxmil is the value of maxhpt scaled (from DK10 ticks) to milli- 36278 ; seconds, meaning the value is divided by 100 decimal. I didn't see 36279 ; how to compute these values symbolically as there are some 36280 ; intermediate results which are double words, so I just did 36281 ; everything in DDT and documented here. 36282 ; 36283 ; Note that the order of the calculations matters here because Tops-20 36284 ; rounds up TOD ticks, but we can't because, at a minimum, we are 36285 ; timing at millisecond resolution, which is two decimal orders of 36286 ; magnitude less than a TOD tick. The more common case of DK10 (or 36287 ; microsecond) resolution, is five orders of magnitude less. If we 36288 ; don't handle things ourselves, you can have the case where time 36289 ; appears to be going backwards in a high resolution log file. 36290 ; 36291 ; HPTIM% ticks are stored as signed doubles to allow for future code 36292 ; which can read finer times (see documentation for RDTIME instruction) 36293 36294 002127'01 000000 000000 maxhpt: 0 ; See MTIME in APRSRV 36295 002130'01 314631 463146 314631,,463146 ; N.B., DK10 units (10 us), not usecs! 36296 002131'01 000000 000000 maxmil: 0 ; Maximum HPTIM% in milliseconds 36297 002132'01 002030 446722 2030,,446722 ; maxmil is maxhpt divided by 100 decimal 36298 36299 002133'01 elptim: entry elptim ; Called from K20MIT, results used in K20DSP 36300 002133'01 265 16 0 00 003710' saveac ;Don't side-effect any registers!! 36301 002134'01 415 14 0 00 000000# xmovei p4, ewallt ; Load address of elapsed wall time block K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35-1 K20TIM MAC 29-Apr-24 00:09 Compute Elapsed Wall Times 36302 002135'01 415 13 0 00 000000# xmovei p3, etdat ; Load address of ending time and date block 36303 002136'01 415 12 0 00 000000# xmovei p2, stdat ; Load address of starting time and date block 36304 36305 002137'01 201 01 0 00 000020 movx t1, dtilen-1 ; Length of remaining structure to whack 36306 002140'01 200 02 0 00 000014 move t2, p4 ; First location to whack 36307 002141'01 201 03 0 02 000001 movei t3, 1(t2) ; Cascading whackage 36308 002142'01 476 00 0 02 000000 setom (t2) ; Set first word to ERROR value 36309 002143'01 123 01 0 00 003564' xblt. t1 ; Stomp the rest of them 36310 ; Do milliseconds in case we must fix up 36311 002144'01 415 16 0 00 002166' block. ; Enter block context for better control flow 36312 002145'01 261 17 0 00 000016 36313 002146'01 120 01 0 13 000015 dmove t1, .datms(p3) ; Load ending milliseconds double word 36314 002147'01 120 03 0 12 000015 dmove t3, .datms(p2) ; Load starting milliseconds double word 36315 002150'01 321 01 0 00 001630* jumpl t1, R ; Negative means some kind of failure on TIME% 36316 002151'01 321 03 0 00 002150* jumpl t3, R ; Ditto 36317 002152'01 316 03 0 00 000001 dcamg t3, t1 ; We didn't get anything backwards, did we? 36318 002153'01 254 00 0 00 002157' 36319 002154'01 317 03 0 00 000001 36320 002155'01 254 00 0 00 002160' 36321 002156'01 254 00 0 00 002161' 36322 002157'01 317 04 0 00 000002 36323 002160'01 254 00 0 00 002163' ifskp. ; Well, that's peculiar ... 36324 002161'01 250 01 0 00 000003 exch t1, t3 ; Swap high orders 36325 002162'01 250 02 0 00 000004 exch t2, t4 ; Swap low orders 36326 002163'01 endif. 36327 002163'01 115 01 0 00 000003 dsub t1, t3 ; Calculate elapsed milliseconds (should never wrap) 36328 002164'01 254 00 0 00 001774* retskp ; Success! 36329 002165'01 263 17 0 00 000000 endbk. ; End block context 36330 002166'01 254 00 0 00 002174' ifskp. ; Successful calculation block exit 36331 002167'01 124 01 0 14 000015 dmovem t1, .datms(p4) ; Store millisecond resolution 36332 002170'01 260 17 0 00 002753' call miltod ; Convert to elapsed TOD and remainder milliseconds 36333 002171'01 124 01 0 14 000011 dmovem t1, .datem(p4) ; Save elapsed TOD 36334 002172'01 124 03 0 14 000013 dmovem t3, .datmr(p4) ; Save remainder milliseconds 36335 002173'01 254 00 0 00 002175' else. ; Otherwise, some kind of odd input arguments 36336 002174'01 254 00 0 00 003014' jrst ovrflw ; Complain and punt 36337 002175'01 endif. ; Done elapsed milliseconds 36338 ; Do elapsed HPTIM% ticks 36339 002175'01 415 16 0 00 002236' block. ; Enter block context for better control flow 36340 002176'01 261 17 0 00 000016 36341 002177'01 120 01 0 14 000015 dmove t1, .datms(p4) ; Load millisecond resolution 36342 002200'01 316 01 0 00 002131' dcamg t1, maxmil ; Duration exceeds HPTIM% maximum? 36343 002201'01 254 00 0 00 002205' 36344 002202'01 317 01 0 00 002131' 36345 002203'01 254 00 0 00 002206' 36346 002204'01 254 00 0 00 002207' 36347 002205'01 317 02 0 00 002132' 36348 002206'01 254 00 0 00 002211' ifskp. ; Yes, then fake the HP ticks 36349 002207'01 260 17 0 00 002260' call ms2hp ; Convert milliseconds to equivalent DK10 units 36350 002210'01 254 00 0 00 002164* retskp ; Break out of the block 36351 002211'01 endif. ; End case handling HPTIM% overflow 36352 remark ; Otherwise, can still do DK10 resolution 36353 002211'01 120 01 0 13 000017 dmove t1, .datus(p3) ; Load ending HPTIM% ticks double word 36354 002212'01 120 03 0 12 000017 dmove t3, .datus(p2) ; Load beginning HPTIM% ticks double word 36355 002213'01 321 01 0 00 002151* jumpl t1, R ; Negative means some kind of failure on HPTIM% 36356 002214'01 321 03 0 00 002213* jumpl t3, R ; Ditto K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35-2 K20TIM MAC 29-Apr-24 00:09 Compute Elapsed Wall Times 36357 002215'01 316 03 0 00 000001 dcaml t3, t1 ; Did the HPTIM% count wrap around? 36358 002216'01 254 00 0 00 002222' 36359 002217'01 311 03 0 00 000001 36360 002220'01 254 00 0 00 002223' 36361 002221'01 254 00 0 00 002224' 36362 002222'01 311 04 0 00 000002 36363 002223'01 254 00 0 00 002227' ifskp. ; No, so safe to subtract 36364 002224'01 115 01 0 00 000003 dsub t1, t3 ; Compute elapsed ticks 36365 002225'01 254 00 0 00 002210* retskp ; Get out of here, we're done 36366 002226'01 254 00 0 00 002235' else. ; Otherwise, calculate the wrap gap 36367 002227'01 261 17 0 00 000012 push p, p2 ; Preserve pointer to starting ticks 36368 002230'01 120 11 0 00 002127' dmove p1, maxhpt ; Load MTIME's odd wrap value 36369 002231'01 115 11 0 00 000003 dsub p1, t3 ; Calculate ticks to wrap point 36370 002232'01 114 01 0 00 000011 dadd t1, p1 ; Calculate total elapsed ticks 36371 002233'01 262 17 0 00 000012 pop p, p2 ; Restore pointer to starting ticks 36372 002234'01 254 00 0 00 002225* retskp ; As per non-wrapped case, result is in t2 36373 002235'01 endif. ; End calculating HP tick difference 36374 002235'01 263 17 0 00 000000 endbk. ; End block context 36375 002236'01 254 00 0 00 002244' ifskp. ; Successful calculation block exit 36376 002237'01 124 01 0 14 000017 dmovem t1, .datus(p4) ; Store elapsed HPTIM% ticks 36377 002240'01 260 17 0 00 002302' call etodhp ; Extract the elapsed TOD and HP ticks 36378 002241'01 124 01 0 14 000005 dmovem t1, .dateh(p4) ; Store elapsed TOD ticks, DK10 base 36379 002242'01 124 03 0 14 000007 dmovem t3, .datdk(p4) ; Store remaining DK10 ticks 36380 002243'01 254 00 0 00 002245' else. ; Otherwise, some kind of odd input arguments 36381 002244'01 254 00 0 00 003014' jrst ovrflw ; Complain and punt 36382 002245'01 endif. ; Done elapsed HPTIM% ticks 36383 36384 remark ; Calculate ending TOD 36385 002245'01 120 01 0 12 000015 dmove t1, .datms(p2) ; Load starting uptime 36386 002246'01 114 01 0 14 000015 dadd t1, .datms(p4) ; Add elapsed milliseconds 36387 002247'01 114 01 0 00 000000# dadd t1, bootrm ; Also original boot millisecond remainder 36388 002250'01 260 17 0 00 002753' call miltod ; Calculate proper elapsed TOD 36389 002251'01 124 03 0 14 000003 dmovem t3, .dattr(p4) ; Store remainder milliseconds 36390 002252'01 114 01 0 00 000000# dadd t1, bootdd ; Bring into range of current date and time 36391 002253'01 124 01 0 14 000001 dmovem t1, .dattl(p4) ; Store as unrounded ending time 36392 002254'01 322 01 0 00 002256' ifn. t1 ; Total is 36 bits, signed double? 36393 002255'01 661 02 0 00 400000 tlo t2, (1b0) ; Coerce to 36 bits unsigned single 36394 002256'01 endif. ; End of date far in the future 36395 002256'01 202 02 0 14 000000 movem t2, .dattd(p4) ; Store as unrounded ending time 36396 002257'01 263 17 0 00 000000 ret ; Done, restoring dirty registers 36397 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20TIM MAC 29-Apr-24 00:09 Convert Milliseconds to equivalent DK10 internal clock units 36398 subttl Convert Milliseconds to equivalent DK10 internal clock units 36399 36400 ; Used when HPTIM% result exceeds 95:26:37.383.670 (TOD: 1042499) 36401 ; 36402 ; Call: 36403 ; 36404 ;T1,T2/ millisecond signed double word 36405 ; 36406 ; Return: 36407 ; 36408 ;T1,T2/ Equivalent HP ticks (call value times 100 decimal) 36409 ; 36410 ; N.B., Currently does not do anything useful on overflow, +1 always 36411 36412 002260'01 326 01 0 00 002263' ms2hp: ife. t1 ; Maybe bum the math 36413 002261'01 326 02 0 00 002263' ife. t2 ; Got called with a zero double word? 36414 002262'01 263 17 0 00 000000 ret ; Get out of here, we're done 36415 002263'01 endif. 36416 002263'01 endif. 36417 36418 002263'01 265 16 0 00 003603' saveac ; Maybe somebody might be using these 36419 002264'01 255 17 0 00 002265' jfcl 17,.+1 ; Clear all flags 36420 002265'01 116 01 0 00 003726' dmul t1, [exp 0, ^d100] ; Scale milliseconds up to DK10 units 36421 002266'01 415 16 0 00 002275' block. ; Enter block context for easier control flow 36422 002267'01 261 17 0 00 000016 36423 002270'01 255 17 0 00 002214* jfcl 17, R ; Punt if any kind of oddity 36424 002271'01 326 01 0 00 002270* jumpn t1, R ; Upper high order of 140 bit result? 36425 002272'01 326 02 0 00 002271* jumpn t2, R ; Lower high order of 140 bit result? 36426 002273'01 254 00 0 00 002234* retskp ; No to both, return 70 bit result 36427 002274'01 263 17 0 00 000000 endbk. ; End block contxt 36428 002275'01 254 00 0 00 002300' ifskp. ; In range uptime? 36429 002276'01 120 01 0 00 000003 dmove t1, t3 ; Yes, return that 36430 002277'01 254 00 0 00 002301' else. ; Wow... Big uptime 36431 002300'01 254 00 0 00 003014' callret ovrflw ; Go clip down to 'reasonable' maximum 36432 002301'01 endif. ; End case HPTIM% overflow handling 36433 002301'01 263 17 0 00 000000 ret ; Done HPTIM% fixup 36434 36435 ;[207] End code insertion 36436 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20TIM MAC 29-Apr-24 00:09 Extract TOD ticks from HPTIM% ticks 36437 subttl Extract TOD ticks from HPTIM% ticks 36438 36439 ;[221] Begin code insertion 36440 36441 ; Call: 36442 ; 36443 ; t1/ Elapsed HPTIM% ticks high order 36444 ; t2/ Elapsed HPTIM% ticks low order 36445 ; Return: 36446 ; 36447 ; t1/ Elapsed TOD ticks, high order 36448 ; t2/ Elapsed TOD ticks, low order 36449 ; t3/ Remaining HPTIM% ticks after TOD's are extracted, high order 36450 ; t4/ Remaining HPTIM% ticks after TOD's are extracted, low order 36451 ; 36452 ; Proportion to extract TOD X given DK10 Y is Y:DK10=X:TOD, where TOD 36453 ; is equal to 262,144 and DK10 is equal to 8,640,000,000 (that's eight 36454 ; million, six hundred and fourty thousand). Solving for X gives: 36455 ; 36456 ; X*DK10 = Y*TOD or X = (Y*TOD)/DK10 36457 ; 36458 ; To convert input X TOD ticks to the equivalent Y DK10 ticks, the 36459 ; proportion remains the same, but we solve for Y, instead, viz: 36460 ; 36461 ; X*DK10 = Y*TOD or Y = (X*DK10)/TOD 36462 ; 36463 ; Recall that these fractions are not exact and that there are 36464 ; 32958.98438 DK10 ticks per TOD tick. This can be found by the 36465 ; following code: 36466 ; 36467 ; movx t1, <86400.> ; Numerator is seconds in a day 36468 ; movx t2, <262144.> ; Denominator is TOD tics in a day 36469 ; movx t3, <100000.> ; DK10 ticks in a second 36470 ; fdv t1, t2 ; Gets .3295898438 seconds per TOD tick 36471 ; fmp t1, t3 ; Gets 32958.98438 DK10 ticks per TOD tick 36472 ; 36473 ; Again, this kind of precision is necessary for short messages when 36474 ; doing megabaud communications, a TOD tick being wholly insufficient. 36475 ; It is unknown whether it would be sufficient for the case of short 36476 ; messages when doing gigabaud communications. Time marches on... 36477 ; 36478 ; Assumes signed 72 bit number is ALWAYS positive!! 36479 36480 002302'01 326 01 0 00 002306' etodhp: ife. t1 ; Maybe bum the math 36481 002303'01 326 02 0 00 002306' ife. t2 ; Got called with a zero double word? 36482 002304'01 403 03 0 00 000004 setzb t3, t4 ; Yes, so zero the remainder 36483 002305'01 263 17 0 00 000000 ret ; Get out of here, we're done 36484 002306'01 endif. 36485 002306'01 endif. 36486 36487 002306'01 265 16 0 00 003645' saveac ; Will need some temporary storage 36488 002307'01 120 07 0 00 000001 dmove q3, t1 ; Save the original dividend 36489 36490 002310'01 255 17 0 00 002311' jfcl 17, .+1 ; Clear the flags 36491 002311'01 116 01 0 00 000000# dmul t1, tticdw ; Scale DK10 ticks up by TOD ticks K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37-1 K20TIM MAC 29-Apr-24 00:09 Extract TOD ticks from HPTIM% ticks 36492 002312'01 255 17 0 00 003014' jfcl 17, ovrflw ; Over 140 bits??? 36493 002313'01 326 01 0 00 003014' jumpn t1, ovrflw ; Over 105 bits?? 36494 002314'01 326 02 0 00 003014' jumpn t2, ovrflw ; Over 70 bits? 36495 002315'01 117 01 0 00 000000# ddiv t1, dkdayd ; Strip off remaining DK10 ticks 36496 002316'01 255 17 0 00 003014' jfcl 17, ovrflw ; Catch any odd math strangeness 36497 36498 remark ; Remember, returning remainder; NOT ROUNDING 36499 002317'01 120 03 0 00 000001 dmove t3, t1 ; Load quotient 36500 002320'01 116 03 0 00 000000# dmul t3, dkdayd ; Scale TOD ticks by DK10 ticks 36501 002321'01 255 17 0 00 003014' jfcl 17, ovrflw ; Over 140 bits??? 36502 002322'01 326 03 0 00 003014' jumpn t3, ovrflw ; Over 105 bits?? 36503 002323'01 326 04 0 00 003014' jumpn t4, ovrflw ; Over 70 bits? 36504 002324'01 117 03 0 00 000000# ddiv t3, tticdw ; Strip off remaining TOD ticks 36505 002325'01 255 17 0 00 003014' jfcl 17, ovrflw ; Catch any odd math strangeness 36506 36507 remark q1:q2 ; Should we round? For now, don't 36508 002326'01 316 03 0 00 000007 dcamg t3, q3 ; We didn't get anything backwards, did we? 36509 002327'01 254 00 0 00 002333' 36510 002330'01 317 03 0 00 000007 36511 002331'01 254 00 0 00 002334' 36512 002332'01 254 00 0 00 002335' 36513 002333'01 317 04 0 00 000010 36514 002334'01 254 00 0 00 002337' ifskp. ; That's odd; fix it 36515 002335'01 250 07 0 00 000003 exch q3, t3 ; Swap high order 36516 002336'01 250 10 0 00 000004 exch q4, t4 ; Swap low order 36517 002337'01 endif. 36518 002337'01 115 07 0 00 000003 dsub q3, t3 ; Calculate remaining DK10 ticks 36519 ; remark ; This DSUB should not set flags, but does 36520 ; jfcl 17, ovrflw ; Catch any odd math strangeness 36521 36522 ; dcamle q3,[exp 0,^d32958] ;Remainder should never exceed this 36523 ; jrst ovrflw ; But did 36524 002340'01 120 03 0 00 000007 dmove t3, q3 ; Return remaining DK10 ticks 36525 36526 002341'01 263 17 0 00 000000 ret ; Done 36527 36528 ;[221] End code insertion 36529 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20TIM MAC 29-Apr-24 00:09 Expresses a duration in DK10 units (tens of microseconds) 36530 subttl Expresses a duration in DK10 units (tens of microseconds) 36531 36532 ;[207] Begin code insertion 36533 36534 ; t1/ Output pointer or JFN 36535 ; t2/ Pointer to time structure 36536 36537 002342'01 durtim: entry durtim ; Also called by k20dsp 36538 002342'01 265 16 0 00 003446' saveac ; Used to save a pointer 36539 36540 002343'01 200 05 0 00 000002 move q1, t2 ; Save pointer to structure 36541 002344'01 201 02 0 05 000017 movei t2, .datus(q1) ; Resolve pointer to elapsed DK10 ticks 36542 002345'01 400 03 0 00 000000 setz t3, ;[221] Do not suppress leading seconds 36543 002346'01 260 17 0 00 002370' call ehptim ; Display elapsed HP ticks 36544 002347'01 600 00 0 00 000000 nop ;[221] Ignore +1, it isn't fatal 36545 36546 002350'01 120 03 0 05 000005 dmove t3, .dateh(q1) ;[221] Load elapsed TOD ticks 36547 002351'01 326 03 0 00 002354' ife. t3 ;[221] No high order 36548 002352'01 326 04 0 00 002354' ife. t4 ;[221] and no low order? 36549 002353'01 263 17 0 00 000000 ret ;[221] None; suppress the whole thing 36550 002354'01 endif. ;[221] 36551 002354'01 endif. ;[221] 36552 36553 002354'01 322 03 0 00 002356' ifn. t3 ; Any high order? 36554 002355'01 661 04 0 00 400000 tlo t4,(1b0) ; Yes, coerce to low order 36555 002356'01 endif. 36556 002356'01 322 04 0 00 002367' ifn. t4 ; Got any TOD ticks? 36557 002357'01 120 02 0 00 000000# smsg < (TOD: > 36558 002360'01 260 17 0 00 000000* 36559 000160'02 000000000000# 36560 000161'02 777777 777771 36561 001111'04 040 050 124 117 104 36562 002361'01 200 02 0 00 000004 move t2, t4 ; Load elapsed TOD ticks 36563 002362'01 200 03 0 00 003730' movx t3, ;N.B., Unsigned!! 36564 002363'01 104 00 0 00 000224 NOUT% 36565 002364'01 320 14 0 00 002272* erjmps r 36566 002365'01 120 02 0 00 000000# smsg <)> ; Close off and return 36567 002366'01 260 17 0 00 002360* 36568 000162'02 000000000000# 36569 000163'02 777777 777777 36570 001113'04 051 000 000 000 000 36571 002367'01 endif. 36572 36573 002367'01 263 17 0 00 000000 ret ; Done, restore registers, destroy frame 36574 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20TIM MAC 29-Apr-24 00:09 Display elapsed HP ticks 36575 subttl Display elapsed HP ticks 36576 36577 ; Call: 36578 ; 36579 ; t1/ Output pointer (or .PRIOU) 36580 ; t2/ Pointer to double word of duration in HPTIM% ticks 36581 ; [DK10 Internal 100 Khz resolution, tens of microseconds] 36582 ; t3/ Leading second suppression flag 36583 ; 36584 ; +1/ Something untoward happened ... 36585 ; +2/ Everything's Archie 36586 ; t1/ Updated, if string pointer 36587 36588 002370'01 ehptim: entry ehptim ; Also called by k20par 36589 remark t1 ; It is deadly to touch t1!! 36590 remark ; Assumes these may be smashed 36591 002370'01 265 16 0 00 000000* trvar <,hrs,mins,secs,mils,dk10,lsflag> ;[221] 36592 002371'01 000000 000010 36593 36594 002372'01 202 03 0 15 000010 movem t3, lsflag ;[221] Save leading second flag 36595 002373'01 120 03 0 02 000000 dmove t3, (t2) ;[221] Load the duration (don't overwrite t2, yet) 36596 002374'01 124 03 0 15 000001 dmovem t3, dur ;[221] Save for internal debugging 36597 002375'01 403 03 0 00 000004 setzb t3, t4 ; Cons up some zeros 36598 002376'01 124 03 0 15 000003 dmovem t3, hrs ; Stomp hours and minutes 36599 002377'01 124 03 0 15 000005 dmovem t3, secs ; Stomp seconds and milliseconds 36600 002400'01 402 00 0 15 000007 setzm dk10 ; Stomp tens of microseconds 36601 002401'01 120 02 0 15 000001 dmove t2,dur ;[221] Load the duration double word 36602 ; Let's get down to some arithmatic 36603 002402'01 415 16 0 00 002430' ehpti1: block. ; Enter block context for easier control flow 36604 002403'01 261 17 0 00 000016 36605 002404'01 255 17 0 00 002405' jfcl 17,.+1 ; Clear any flags, just in case 36606 002405'01 235 02 0 00 000144 divi t2, ^d100 ; Strip out DK10 ticks 36607 002406'01 255 10 0 00 002364* jov r ; Stop on overflow 36608 002407'01 250 03 0 15 000007 exch t3, dk10 ; Store DK10 ticks and rezero remainder 36609 002410'01 322 02 0 00 002406* jumpe t2, r ; If no more quotient, then done 36610 002411'01 250 02 0 00 000003 exch t2, t3 ; Zero in high order, quotient in low order 36611 002412'01 235 02 0 00 001750 divi t2, ^d1000 ; Strip out milliseconds 36612 002413'01 255 10 0 00 002410* jov r ; Stop on overflow 36613 002414'01 250 03 0 15 000006 exch t3, mils ; Store milliseconds and rezero quotient 36614 002415'01 322 02 0 00 002413* jumpe t2, r ; If no more quotient, then done 36615 002416'01 250 02 0 00 000003 exch t2, t3 ; Zero in high order, quotient in low order 36616 002417'01 235 02 0 00 000074 divi t2, ^d60 ; Strip out seconds 36617 002420'01 255 10 0 00 002415* jov r ; Stop on overflow 36618 002421'01 250 03 0 15 000005 exch t3, secs ; Store seconds and rezero quotient 36619 002422'01 322 02 0 00 002420* jumpe t2, r ; If no more quotient, then done 36620 002423'01 250 02 0 00 000003 exch t2, t3 ; Zero in high order, quotient in low order 36621 002424'01 235 02 0 00 000074 divi t2, ^d60 ; Strip out minutes 36622 002425'01 202 03 0 15 000004 movem t3, mins ; Store minutes 36623 002426'01 202 02 0 15 000003 movem t2, hrs ; Store hours 36624 002427'01 263 17 0 00 000000 endbk. ; Exit block context 36625 36626 002430'01 337 02 0 15 000003 ehpti2: skipg t2, hrs ; Have any hours? 36627 002431'01 254 00 0 00 002441' ifskp. ; Yes, print as many as there are 36628 002432'01 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) 36629 002433'01 104 00 0 00 000224 NOUT% K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20TIM MAC 29-Apr-24 00:09 Display elapsed HP ticks 36630 002434'01 320 14 0 00 002422* erjmps r 36631 002435'01 201 02 0 00 000072 movei t2, ":" ; Puctuate hours 36632 002436'01 260 17 0 00 000000* call BOUTI% ;[216] 36633 002437'01 474 04 0 00 000000 seto t4, ; Mark hours were printed 36634 002440'01 254 00 0 00 002442' else. ; Otherwise, no hours 36635 002441'01 400 04 0 00 000000 setz t4, ; Mark no hours printed 36636 002442'01 endif. 36637 36638 002442'01 322 04 0 00 002446' ehpti3: ifn. t4 ; Previous? 36639 002443'01 200 02 0 15 000004 move t2, mins ; Yes, MUST print minutes 36640 002444'01 200 03 0 00 003731' movx t3, no%lfl!no%zro!no%ast!fld(^d2,no%col)!fld(^d10,no%rdx) ; In 2 columns 36641 002445'01 254 00 0 00 002451' else. ; Otherwise, nothing previous 36642 002446'01 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) ; So no leading digits 36643 002447'01 332 02 0 15 000004 skipe t2, mins ; Have any minutes? 36644 002450'01 474 04 0 00 000000 seto t4, ; Yes, force a print 36645 002451'01 endif. 36646 36647 002451'01 322 04 0 00 002464' ifn. t4 ; Have to print minutes 36648 002452'01 322 02 0 00 002456' ifn. t2 ; Do we have a number? 36649 002453'01 104 00 0 00 000224 NOUT% ; We do, so print it 36650 002454'01 320 14 0 00 002434* erjmps r ; Catch and suppress error 36651 002455'01 254 00 0 00 002462' else. ; It's zero, so let's bum the NOUT% 36652 002456'01 201 02 0 00 000060 movei t2, "0" ; Load the zero 36653 002457'01 260 17 0 00 002436* call BOUTI% ; Type it 36654 002460'01 603 03 0 00 100000 txne t3,no%lfl ; Not fixed columns? 36655 002461'01 260 17 0 00 002457* call BOUTI% ; No, so type it twice to make "00" 36656 002462'01 endif. ; End case NOUT% execution determination 36657 002462'01 201 02 0 00 000072 movei t2, ":" ; Punctuate minutes 36658 002463'01 260 17 0 00 002461* call BOUTI% ;[216] 36659 002464'01 endif. 36660 36661 002464'01 322 04 0 00 002467' ehpti4: ifn. t4 ; Columnar if did minutes 36662 002465'01 200 03 0 00 003731' movx t3, no%lfl!no%zro!no%ast!fld(^d2,no%col)!fld(^d10,no%rdx) 36663 002466'01 254 00 0 00 002470' else. ; No, so somewhat more free form 36664 002467'01 201 03 0 00 000012 movx t3, fld(^d10,no%rdx) 36665 002470'01 endif. 36666 36667 002470'01 415 16 0 00 002501' block. ;[221] Enter control block for better flow 36668 002471'01 261 17 0 00 000016 36669 002472'01 326 04 0 00 002273* jumpn t4, RSKP ;[221] If printed minutes, MUST print seconds 36670 002473'01 332 00 0 15 000005 skipe secs ;[221] No seconds? 36671 002474'01 254 00 0 00 002472* retskp ;[221] No, if non-zero, must print them 36672 002475'01 336 00 0 15 000010 skipn lsflag ;[221] Got told to suppress the seconds 36673 002476'01 254 00 0 00 002474* retskp ;[221] No, so print them 36674 002477'01 263 17 0 00 000000 ret ;[221] Otherwise, don't 36675 002500'01 263 17 0 00 000000 endbk. ;[221] End control block context 36676 002501'01 254 00 0 00 002513' ifskp. ;[221] +1 means we must print seconds 36677 002502'01 336 02 0 15 000005 skipn t2, secs ; Load and always print seconds 36678 002503'01 254 00 0 00 002507' ifskp. ; Non-zero, so print it 36679 002504'01 104 00 0 00 000224 NOUT% 36680 002505'01 320 14 0 00 002454* erjmps r 36681 002506'01 254 00 0 00 002513' else. ; Otherwise, was zero 36682 002507'01 201 02 0 00 000060 movei t2, "0" ; So bum the NOUT% 36683 002510'01 260 17 0 00 002463* call BOUTI% ;[216] 36684 002511'01 603 03 0 00 150002 txne t3, no%lfl!no%zro!no%ast!fld(^d2,no%col) K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-2 K20TIM MAC 29-Apr-24 00:09 Display elapsed HP ticks 36685 002512'01 260 17 0 00 002510* call BOUTI% ;[216] Have to print another zero if minutes 36686 002513'01 endif. 36687 002513'01 endif. ;[221] End case forced print of seconds 36688 36689 ; N.B., Didn't know how or if to punctuate (tens of) microseconds, so 36690 ; broke them out seperately. It still looked funny, so I simply 36691 ; alide them until I find out what the right thing to do is. 36692 36693 002513'01 200 04 0 15 000006 ehpti5: move t4, mils ; Load milliseconds 36694 002514'01 434 04 0 15 000007 or t4, dk10 ; Or in any dk10 total 36695 002515'01 322 04 0 00 002540' ifn. t4 ; If either is set, then display 36696 002516'01 201 02 0 00 000056 movei t2, "." ; Punctuate milliseconds 36697 002517'01 260 17 0 00 002512* call BOUTI% ;[216] 36698 002520'01 336 02 0 15 000006 skipn t2, mils ; Mils can go up to 999 36699 002521'01 254 00 0 00 002526' ifskp. ; Have a real value, so print it 36700 002522'01 200 03 0 00 003732' movx t3, no%lfl!no%zro!no%ast!fld(^d3,no%col)!fld(^d10,no%rdx) 36701 002523'01 104 00 0 00 000224 NOUT% 36702 002524'01 320 14 0 00 002505* erjmps r 36703 ;;;; movei t2, "." ; Punctuate tens of microseconds 36704 ;;;; call BOUTI% ;[216] 36705 002525'01 254 00 0 00 002530' else. ; Otherwise, was zero 36706 ;;;; smsg <000.> ; So bum the NOUT% and the BOUT% 36707 002526'01 120 02 0 00 000000# smsg <000> ; So bum the NOUT% and the BOUT% 36708 002527'01 260 17 0 00 002366* 36709 000164'02 000000000000# 36710 000165'02 777777 777775 36711 001114'04 060 060 060 000 000 36712 002530'01 endif. 36713 002530'01 336 02 0 15 000007 skipn t2, dk10 ; DK10 can go up to 99 36714 002531'01 254 00 0 00 002536' ifskp. ; Have a real value, so print it 36715 002532'01 200 03 0 00 003731' movx t3, no%lfl!no%zro!no%ast!fld(^d2,no%col)!fld(^d10,no%rdx) 36716 002533'01 104 00 0 00 000224 NOUT% 36717 002534'01 320 14 0 00 002524* erjmps r 36718 ;;;; remark ; Don't fool ourselves into thinking we have true mHz 36719 ;;;; movei t2, "0" ; Show it as hundreds of microseconds 36720 ;;;; call BOUTI% ;[216] 36721 002535'01 254 00 0 00 002540' else. ; Otherwise, was zero 36722 ;;;; smsg <000> ; So bum the NOUT% and the BOUT% 36723 002536'01 120 02 0 00 000000# smsg <00> ; So bum the NOUT% and the BOUT% 36724 002537'01 260 17 0 00 002527* 36725 000166'02 000000000000# 36726 000167'02 777777 777776 36727 001115'04 060 060 000 000 000 36728 002540'01 endif. 36729 002540'01 endif. 36730 002540'01 263 17 0 00 000000 ret ; Don't forget to return!!! 36731 36732 endtv. ; End lexical context transient variables 36733 36734 ;[207] End code insertion 36735 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20TIM MAC 29-Apr-24 00:09 Initialize time variables 36736 subttl Initialize time variables 36737 36738 ; Tops-20 takes the time of day and rounds it to the nearest TOD tick, 36739 ; which is .3295898438, which can easily cause messages to appear to 36740 ; have happened at the same time at high kilobaud and above speeds. 36741 ; 36742 ; Therefore, we never use GTAD% for timing because we can't tell where 36743 ; Tops-20 might have rounded. We use GTAD% precisely once to get the 36744 ; current date and time in internal format. We then use TIME% to get 36745 ; the elapsed milliseconds since system boot and subtract that from 36746 ; from the previous. 36747 ; 36748 ; Note that the math to do this is NOT rounded. The reason for this 36749 ; is to make sure that time doesn't go backwards for higher precision 36750 ; logging. 36751 ; 36752 ; N.B., HPTIM% can not be used because the current interface rounds it 36753 ; every 76 hours. 36754 36755 chgsec(code,const) ; Monitor symbol names are constants 36756 000170'02 55 63 64 51 55 45 mstime: sixbit "MSTIME" ; XKL's arcane 'magic' argument 36757 000171'02 000000 000000 0 ; Used to side-effect T2 36758 retsec ; Return back to original .PSECT 36759 36760 chgsec(code,data) ; Values go in writable storage 36761 000211'05 prgsdt: block 1 ; Program start date and time (unsigned!) 36762 000212'05 prgsdd: block 2 ; Same thing as a signed double word 36763 000214'05 sysums: block 2 ; System uptime in milliseconds on startup 36764 000216'05 bootdt: block 1 ; System boot as unsigned GTAD% word 36765 000217'05 bootdd: block 2 ; Same thing as a signed double word 36766 000221'05 bootrm: block 2 ; Remainder milliseconds in calculation 36767 000223'05 mhptod::block 1 ;[239] ; Set if monitor has high precision time of day 36768 000224'05 ehptod: block 1 ;[239] ; JSYS error when first tried 36769 000225'05 ihptod: block 2 ;[239] ; High precision time of day when started 36770 retsec ; Return back to original .PSECT 36771 36772 002541'01 initim: entry initim ; Called once by START in K20MIT 36773 002541'01 265 16 0 00 003571' saveac ; Used as index and capability word 36774 36775 002542'01 104 00 0 00 000227 GTAD% ; Get current date and time 36776 002543'01 320 12 0 00 002545' ifje. r ; Failed?? 36777 002544'01 254 00 0 00 002560' 36778 002545'01 552 01 0 00 000000# hrrzm t1, prgsdt ; Store error and flag it (not 1858!!) 36779 002546'01 550 01 0 00 000000# hrrz t1, bootdt ; Save single word format (not 1858!!) 36780 002547'01 334 00 0 00 000000 %ermsg (,) 36781 002550'01 254 00 0 00 002554' 36782 002551'01 265 01 0 00 002024* 36783 002552'01 000000000000# 36784 002553'01 254 00 0 00 002554' 36785 001116'04 105 162 162 157 162 36786 002554'01 477 05 0 00 000006 setob q1, q2 ; Flag date and time not set 36787 002555'01 124 05 0 00 000000# dmovem q1, bootdd ; Store boot date and time double word 36788 002556'01 263 17 0 00 000000 ret ; Can't go any further 36789 002557'01 254 00 0 00 002567' else. ; Otherwise worked, 36790 002560'01 202 01 0 00 000000# movem t1, prgsdt ; so just use it K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40-1 K20TIM MAC 29-Apr-24 00:09 Initialize time variables 36791 002561'01 200 02 0 00 000001 move t2, t1 ; Cast to signed long 36792 002562'01 627 02 0 00 400000 tlzn t2,(1b0) ; Test if Negative, fix low order and skip 36793 002563'01 634 01 0 00 000001 tdza t1, t1 ; Positive, zero high order and skip 36794 002564'01 201 01 0 00 000001 movei t1, ^d1 ; Negative, put sign bit in the high order 36795 002565'01 124 01 0 00 000000# dmovem t1, prgsdd ; Store for later inspection 36796 002566'01 120 05 0 00 000001 dmove q1, t1 ; Cache as we are soon to use it 36797 002567'01 endif. 36798 36799 002567'01 120 01 0 00 000000# dmove t1, mstime ; XKL's arcane 'magic' argument (if Toad) 36800 002570'01 104 00 0 00 000014 TIME% ; Get uptime in milliseconds (maybe long) 36801 002571'01 320 12 0 00 002573' ifje. r ; Failed?? 36802 002572'01 254 00 0 00 002603' 36803 002573'01 560 02 0 00 000001 hrro t2, t1 ; Turn negative to flag error 36804 002574'01 474 01 0 00 000000 seto t1, ; Ditto high order 36805 002575'01 334 00 0 00 000000 %ermsg (,) 36806 002576'01 254 00 0 00 002602' 36807 002577'01 265 01 0 00 002551* 36808 002600'01 000000000000# 36809 002601'01 254 00 0 00 002602' 36810 001125'04 105 162 162 157 162 36811 002602'01 254 00 0 00 002611' else. ; Otherwise, some kind of success 36812 002603'01 302 02 0 00 001750 caie t2, ^d1000 ; XKL monitor? 36813 002604'01 254 00 0 00 002611' ifskp. ; No, plain old 'vanilla' 36814 002605'01 200 02 0 00 000001 move t2, t1 ; Put low order in proper place 36815 002606'01 627 02 0 00 400000 tlzn t2,(1b0) ; Test if Negative, fix low order and skip 36816 002607'01 634 01 0 00 000001 tdza t1, t1 ; Positive, zero high order and skip 36817 002610'01 201 01 0 00 000001 movei t1, ^d1 ; Negative, put sign bit in the high order 36818 002611'01 endif. ; And case casting vanilla Tops-20 to double word 36819 002611'01 endif. ; End TIME% result handling 36820 002611'01 124 01 0 00 000000# dmovem t1, sysums ; Either way, store double word millisecond uptime 36821 36822 002612'01 415 16 0 00 002625' block. ; Enter block for better control flow 36823 002613'01 261 17 0 00 000016 36824 002614'01 321 01 0 00 002534* jumpl t1, R ; Only do this if 36825 002615'01 321 02 0 00 002614* jumpl t2, R ; current time is reasonable 36826 002616'01 321 05 0 00 002615* jumpl q1, R ; Only do this if 36827 002617'01 321 06 0 00 002616* jumpl q2, R ; uptime is reasonable 36828 002620'01 260 17 0 00 002655' call initod ; Convert uptime to elapsed TOD uptime 36829 002621'01 115 05 0 00 000001 dsub q1, t1 ; Subtract from current time of day 36830 002622'01 321 05 0 00 002617* jumpl q1, R ; Wrapped?? 36831 002623'01 254 00 0 00 002476* retskp ; Succeed with boot TOD in a signed double word 36832 002624'01 263 17 0 00 000000 endbk. ; Block exit 36833 002625'01 254 00 0 00 002632' ifskp. ; Worked 36834 002626'01 200 01 0 00 000006 move t1, q2 ; Load low order of result 36835 002627'01 322 05 0 00 002631' ifn. q1 ; Any high order? 36836 002630'01 661 01 0 00 400000 tlo t1,(1b0) ; Yes, coerce to low order 36837 002631'01 endif. 36838 002631'01 254 00 0 00 002634' else. ; Something didn't work 36839 002632'01 474 01 0 00 000000 seto t1, ; And no valid time of day 36840 002633'01 477 05 0 00 000006 setob q1, q2 ; Ditto double word 36841 002634'01 endif. 36842 36843 002634'01 124 05 0 00 000000# dmovem q1, bootdd ; Store boot date and time double word 36844 002635'01 202 01 0 00 000000# movem t1, bootdt ; Save single word format 36845 002636'01 124 03 0 00 000000# dmovem t3, bootrm ; And remainder milliseconds K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40-2 K20TIM MAC 29-Apr-24 00:09 Initialize time variables 36846 36847 remark ;[239] Finally see if we can do microsecond TOD 36848 002637'01 201 01 0 00 000004 movei t1,.hptod ;[239] Request high precision time of day 36849 002640'01 104 00 0 00 000501 HPTIM% ;[239] Issue the JSYS to see if it's there 36850 002641'01 320 12 0 00 002643' ifje. r ;[239] Didn't work ... 36851 002642'01 254 00 0 00 002650' 36852 002643'01 202 01 0 00 000000# movem t1, ehptod ;[239] Store the error code, but don't whine about it 36853 002644'01 403 01 0 00 000002 setzb t1, t2 ;[239] Cons up a set of double zeros 36854 002645'01 202 01 0 00 000000# movem t1, mhptod ;[239] Flag that it's not there 36855 002646'01 124 01 0 00 000000# dmovem t1, ihptod ;[239] No high precision time of day 36856 002647'01 254 00 0 00 002654' else. ;[239] Otherwise, monitor has the code and worked! 36857 002650'01 124 01 0 00 000000# dmovem t1, ihptod ;[239] Store initial high precision time of day 36858 002651'01 201 01 0 00 601405 movx t1, LSTRX1 ;[239] "Process has not encountered any errors" 36859 002652'01 202 01 0 00 000000# movem t1,ehptod ;[239] Phoney it up that this worked 36860 002653'01 476 00 0 00 000000# setom mhptod ;[239] Flag that functionality is there 36861 002654'01 endif. ;[239] End case testing for JSYS support 36862 36863 002654'01 263 17 0 00 000000 ret ; Finally done 36864 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20TIM MAC 29-Apr-24 00:09 Initialize Time of Day offset from current uptime 36865 subttl Initialize Time of Day offset from current uptime 36866 36867 ; Like miltod, but doesn't peel off a subsecond first, but rather 36868 ; Returns a remainder if not rounding 36869 ; 36870 ; Calling arguments are the same as are the return values 36871 36872 002655'01 initod: remark ; Almost impossible for this to happen, but... 36873 002655'01 321 01 0 00 003014' jumpl t1, ovrflw ; Sanity check calling arguments 36874 002656'01 321 02 0 00 003014' jumpl t2, ovrflw 36875 002657'01 326 01 0 00 002663' ife. t1 ; Maybe bum the math 36876 002660'01 326 02 0 00 002663' ife. t2 ; Got called with a zero double word? 36877 002661'01 403 03 0 00 000004 setzb t3, t4 ; Yes, so there can't be any remainder 36878 002662'01 263 17 0 00 000000 ret ; Yes, we're done 36879 002663'01 endif. 36880 002663'01 endif. 36881 36882 002663'01 265 16 0 00 003645' saveac ; Intermediate double word results 36883 002664'01 120 07 0 00 000001 dmove q3, t1 ; Save calling milliseconds to extract remainder 36884 002665'01 255 17 0 00 002666' jfcl 17,.+1 ; Clear flags 36885 36886 remark ; Calculate T = (M*262144)/86400000 36887 002666'01 116 01 0 00 000000# dmul t1, tticdw ; Scale milliseconds up by time of day ticks 36888 002667'01 255 17 0 00 003014' jfcl 17, ovrflw ; Over 140 bits??? 36889 002670'01 326 01 0 00 003014' jumpn t1, ovrflw ; Over 105 bits?? 36890 002671'01 326 02 0 00 003014' jumpn t2, ovrflw ; Over 70 bits? 36891 002672'01 117 01 0 00 000000# ddiv t1, msidad ; Then strip off partial TOD 36892 002673'01 255 17 0 00 003014' jfcl 17, ovrflw ; Punt if any kind of funny business 36893 remark ; Don't round because extracting milliseconds 36894 36895 remark ; Now convert TOD quotient back to ms 36896 002674'01 120 03 0 00 000001 dmove t3, t1 ; Load TOD quotient as input 36897 remark 17,ovlflw ; Flags are still clear 36898 36899 remark ; Calculate M = (86400000*T)/262144. 36900 002675'01 116 03 0 00 000000# dmul t3, msidad ; Scale TOD ticks by milliseconds 36901 002676'01 255 17 0 00 003014' jfcl 17, ovrflw ; Over 140 bits??? 36902 002677'01 326 03 0 00 003014' jumpn t3, ovrflw ; Over 105 bits?? 36903 002700'01 326 04 0 00 003014' jumpn t4, ovrflw ; Over 70 bits? 36904 002701'01 117 03 0 00 000000# ddiv t3, tticdw ; Strip off partial milliseconds 36905 002702'01 255 17 0 00 003014' jfcl 17, ovrflw ; Punt if any kind of funny business 36906 36907 002703'01 115 07 0 00 000003 dsub q3, t3 ; Calculate remaining milliseconds 36908 002704'01 321 07 0 00 003014' jumpl q3, ovrflw ; Sanity check arithmatic 36909 002705'01 120 03 0 00 000007 dmove t3, q3 ; Return millisecond remainder 36910 002706'01 263 17 0 00 000000 ret ; Finally done 36911 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20TIM MAC 29-Apr-24 00:09 Fine Grained Time of Day 36912 subttl Fine Grained Time of Day 36913 36914 ; At megabaud (and even high kilobaud) speeds, messages can easily 36915 ; transfer in under the TOD resolution (a single TOD tick being 36916 ; 329.5898438 ms), so a simple subtraction of before and after GTAD%'s 36917 ; really won't work as it will seem as if no time elapsed. 36918 ; 36919 ; Kermit-20 therefore does not use GTAD% difference, but rather uptime 36920 ; (I.E., TIME% a.k.a milliseconds). Can't make DK10 ticks work for 36921 ; elapsed TOD on an unmodified Tops-20 (see above). 36922 ; 36923 ; Expects to smash t1 - t3, others preserved 36924 ; 36925 ; +1/ Unrecoverable error 36926 ; +2/ Worked 36927 36928 002707'01 fintim: entry fintim ; Used in K20PDC, but coded here 36929 002707'01 265 16 0 00 003645' saveac ;[239] Set up a pointer register 36930 36931 002710'01 336 00 0 00 000000# ifmn. mhptod ;[239] Have we got high precision time of day? 36932 002711'01 254 00 0 00 002722' 36933 002712'01 201 01 0 00 000004 movx t1, .hptod ;[239] Yes, let's do DK10 units 36934 002713'01 104 00 0 00 000501 HPTIM% ;[239] Get the data 36935 002714'01 320 16 0 00 002722' annje. ;[239] If failed, then silently don't use it 36936 002715'01 303 01 0 00 303237 caile t1, ^d99999 ;[239] We didn't get gubbish, did we? 36937 002716'01 320 16 0 00 002722' annje. ;[239] A subsecond is never more than 99,999 DK10 ticks! 36938 002717'01 120 06 0 00 000001 dmove q2, t1 ;[239] Store TOD and DK10 subseconds 36939 002720'01 200 10 0 00 003733' movx q4, no%lfl!no%zro!no%ast!fld(^d5,no%col)!fld(^d10,no%rdx) ;[239] 36940 002721'01 254 00 0 00 002740' else. ;[239] Otherwise, don't have it, failed or gubbish 36941 002722'01 260 17 0 00 002050' call endtim ; Get current time of day into ending variables 36942 002723'01 260 17 0 00 002133' call elptim ; Calculated elapsed time in various formats 36943 002724'01 201 05 0 00 000000# movei q1, ewallt ; Pointer to elapsed time structure 36944 002725'01 200 06 0 05 000000 move q2, .dattd(q1) ;[239] Load ending signed time of day (unrounded) 36945 002726'01 120 02 0 05 000003 dmove t2, .dattr(q1) ;[239] Load remainder milliseconds, if any 36946 002727'01 326 02 0 00 002735' ife. t2 ;[239] Zero high order ... 36947 002730'01 326 03 0 00 002733' ife. t3 ;[239] ... and zero low order? 36948 002731'01 400 07 0 00 000000 setz q3, ;[239] None there, so note that 36949 002732'01 254 00 0 00 002734' else. ;[239] Otherwise, nothing to cast 36950 002733'01 200 07 0 00 000003 move q3, t3 ;[239] Can just use signed low order 36951 002734'01 endif. ;[239] End case zero double word 36952 002734'01 254 00 0 00 002737' else. ;[239] Non-zero high order 36953 002735'01 661 03 0 00 400000 tlo t3, (1b0) ;[239] Cast low order to unsigned 36954 002736'01 200 07 0 00 000003 move q3, t3 ;[239] Store unsigned word 36955 002737'01 endif. ;[239] End case remainder checking 36956 002737'01 200 10 0 00 003732' movx q4, no%lfl!no%zro!no%ast!fld(^d3,no%col)!fld(^d10,no%rdx) ;[239] 36957 002740'01 endif. ;[239] End case ms or dk10 units? 36958 36959 002740'01 550 01 0 00 000013 hrrz t1, p3 ; Load the logging file JFN 36960 002741'01 200 02 0 00 000006 move t2, q2 ;[239] Load some kind of time of day 36961 002742'01 400 03 0 00 000000 setz t3, 36962 002743'01 104 00 0 00 000220 ODTIM% ; Put into the log file 36963 002744'01 320 12 0 00 002622* erjmpr r ; Unless couldn't... 36964 36965 002745'01 201 02 0 00 000056 movei t2, "." ; Otherwise, punctuate milliseconds 36966 002746'01 260 17 0 00 002517* call BOUTI% ;[216] K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42-1 K20TIM MAC 29-Apr-24 00:09 Fine Grained Time of Day 36967 36968 002747'01 120 02 0 00 000007 dmove t2, q3 ;[239] Load the remainder milliseconds or DK10 units 36969 002750'01 104 00 0 00 000224 NOUT% ; Gives ".012" or ".012345" 36970 002751'01 320 14 0 00 002744* erjmps r 36971 36972 002752'01 254 00 0 00 002623* retskp ; Done 36973 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20TIM MAC 29-Apr-24 00:09 Convert Milliseconds to Time of Day Ticks 36974 subttl Convert Milliseconds to Time of Day Ticks 36975 36976 ; We have two fixed point fractions, one in TOD ticks in a day and the 36977 ; other in milliseconds in a day. The denominator for the former is 36978 ; 262,144 (2^18) whilst the denominator for the later is 86,400,000 36979 ; (24*60*60*1000). 36980 ; 36981 ; If M is the number of milliseconds (input), and T is the number of 36982 ; TOD ticks (output), then the proportion is M:86400000 = T:262144. 36983 ; Solving for T yields M*262144 = T*86400000 (intermediate) or T = 36984 ; (M*262144)/86400000. 36985 ; 36986 ; To extract the remainder, we simply solve the same equation for a 36987 ; different variable, that is, the input is now TOD or T, thus we 36988 ; have T:262144 = M:86400000, or 262144*M = 86400000*T intermediate, 36989 ; or M = (86400000*T)/262144. We then subtract this new M from the 36990 ; input arguments to yield the integer remainder. 36991 ; 36992 ; Call: 36993 ; 36994 ;t1:t2/ Milliseconds as a signed double word 36995 ; 36996 ; Return: 36997 ; 36998 ;t1:t2/ Cooresponding quantity in Time of Day ticks 36999 ; as a signed double word. 37000 ;t3:t4/ Remainder milliseconds as a signed double. 37001 ; The double is used to speed downstream calculations 37002 ; by avoiding conversions. 37003 ; 37004 ; Caution! 37005 ; 37006 ; Be aware that a Time of Day tick equals 329.5898438 milliseconds. 37007 ; So, this conversion is going to cause a REDUCTION in precision 37008 ; between two and three decimal orders of magnitude (!!) 37009 ; 37010 ; Therefore, all intermediate results should be kept in milliseconds 37011 ; and not TOD ticks. 37012 ; 37013 ; We also do not round because the display is printing the milli- 37014 ; seconds and we don't want time to appear to be going backwards. 37015 ; The remainder milliseconds are returned for possible later use. 37016 37017 chgsec(code,const) ;;Constants do not go in the code .PSECT 37018 000172'02 000000 000000 msidad: ^d0 ; Milliseconds in a day, high order 37019 000173'02 000511 456000 msiday ; Milliseconds in a day, low order 37020 000174'02 000000 000000 ms1000: ^d0 ; High order milliseconds in a second 37021 000175'02 000000 001750 ^d1000 ; Low order millisecond in a second 37022 000176'02 000000 000000 lione: ^d0 ; Long integer one, high order 37023 000177'02 000000 000001 ^d1 ; Long integer one, low order 37024 000200'02 000000 000000 dkdayd: ^d0 ; DK10 ticks in a day, high order 37025 000201'02 100276 770000 dkday ; DK10 ticks in a day, low order 37026 000202'02 000000 000000 tticdw: ^d0 ; TOD ticks in a day as a double word, high order 37027 000203'02 000001 000000 todtic ; TOD ticks in a day as a single word, low order 37028 000204'02 000000 000000 tticd2: ^d0 ; Half previous, high order K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43-1 K20TIM MAC 29-Apr-24 00:09 Convert Milliseconds to Time of Day Ticks 37029 000205'02 000000 400000 ; Half previous, low order 37030 000206'02 377777 777777 clipmx: exp .infin,.infin ; Maximum if we go over 70 bits 37031 retsec ;;Restore .PSECT assumptions 37032 37033 002753'01 321 01 0 00 003014' miltod: jumpl t1, ovrflw ; Sanity check calling arguments 37034 002754'01 321 02 0 00 003014' jumpl t2, ovrflw 37035 002755'01 326 01 0 00 002761' ife. t1 ; Maybe bum the math 37036 002756'01 326 02 0 00 002761' ife. t2 ; Got called with a zero double word? 37037 002757'01 403 03 0 00 000004 setzb t3, t4 ; Yes, so there can't be any remainder 37038 002760'01 263 17 0 00 000000 ret ; Yes, we're done 37039 002761'01 endif. 37040 002761'01 endif. 37041 37042 002761'01 265 16 0 00 003571' saveac ; Intermediate double word results 37043 002762'01 120 05 0 00 000001 dmove q1, t1 ; Save calling milliseconds 37044 002763'01 255 17 0 00 002764' jfcl 17,.+1 ; Clear flags 37045 37046 remark ; First strip off the milliseconds 37047 002764'01 120 03 0 00 000001 dmove t3, t1 ; Cast to a 140 bit intermediate quantity 37048 002765'01 403 01 0 00 000002 setzb t1, t2 ; Nothing in high 70 bits 37049 002766'01 117 01 0 00 000000# ddiv t1, ms1000 ; Strip off anything less than a second 37050 002767'01 255 17 0 00 003014' jfcl 17, ovrflw ; Shouldn't be strange ... 37051 002770'01 120 01 0 00 000005 dmove t1, q1 ; Restore original dividend 37052 002771'01 115 01 0 00 000003 dsub t1, t3 ; Subtract remainder to get to greatest second 37053 002772'01 255 17 0 00 002773' jfcl 17,.+1 ; Clear dsub's strange flags 37054 002773'01 321 01 0 00 003014' jumpl t1, ovrflw ; But double check for any funny business 37055 002774'01 120 05 0 00 000003 dmove q1, t3 ; Save remainder for return 37056 37057 remark ; Calculate T = (M*262144)/86400000 37058 002775'01 116 01 0 00 000000# dmul t1, tticdw ; Scale milliseconds up by time of day ticks 37059 002776'01 255 17 0 00 003014' jfcl 17, ovrflw ; Over 140 bits??? 37060 002777'01 326 01 0 00 003014' jumpn t1, ovrflw ; Over 105 bits?? 37061 003000'01 326 02 0 00 003014' jumpn t2, ovrflw ; Over 70 bits? 37062 003001'01 117 01 0 00 000000# ddiv t1, msidad ; Then strip off partial TOD 37063 003002'01 255 17 0 00 003014' jfcl 17, ovrflw ; Punt if any kind of funny business 37064 003003'01 316 03 0 00 000000# dcaml t3, tticd2 ; Should we round? 37065 003004'01 254 00 0 00 003010' 37066 003005'01 311 03 0 00 000000# 37067 003006'01 254 00 0 00 003011' 37068 003007'01 254 00 0 00 003012' 37069 003010'01 311 04 0 00 000000# 37070 003011'01 114 01 0 00 000000# dadd t1, lione ; Give us an extra tick 37071 37072 remark t1, t2 ; Has TOD ticks 37073 003012'01 120 03 0 00 000005 dmove t3, q1 ; Return millisecond remainder 37074 003013'01 263 17 0 00 000000 ret ; Finally done 37075 37076 003014'01 200 01 0 00 000000# ovrflw: emsg 37077 003015'01 104 00 0 00 000313 37078 000210'02 000000000000# 37079 001133'04 101 162 151 164 150 37080 003016'01 120 01 0 00 000000# dmove t1, clipmx ; Clip down to 'reasonable' maximum 37081 003017'01 263 17 0 00 000000 ret ; Get out of here 37082 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20TIM MAC 29-Apr-24 00:09 Convert Time of Day Ticks to Seconds 37083 subttl Convert Time of Day Ticks to Seconds 37084 37085 ; Do the math right. We have two fixed point fractions, one in TOD 37086 ; ticks in a day and the other in seconds in a day. The denominator 37087 ; for the former is 262,144 (2^18) whilst the denominator for the 37088 ; later is 86,400 (24*60*60). 37089 ; 37090 ; If T is the number of ticks (input) and S is the number seconds 37091 ; (output), then the proportion is T:262144 = S:86400. Solving for 37092 ; S yields S*262144=T*86400 intermediate or S=(T*86400)/262144. 37093 ; 37094 ; It will be noted that a second is a little more than three TOD ticks 37095 ; (3.034074074). So dividing by 3 will get an increasingly wrong 37096 ; answer, the longer a transfer goes. 37097 ; 37098 ; For example, consider 2,560 time of day ticks. Dividing by three 37099 ; yields a quotient of 853 seconds whereas the actual value is closer 37100 ; to 844 seconds, a difference of nine seconds. For a transfer taking 37101 ; over a day and a half, the difference is over 10,000 seconds 37102 ; 37103 ; Note intermediate double word result which is designed to handle 37104 ; dial up transfers that go on over a weekend (some did) 37105 ; 37106 ; Ticks are in t2, t1 is *** SACRED *** 37107 ; 37108 ; The below is about as fast as we can make this because the only 37109 ; math that is being done is the muli. The lsh with halfword moves 37110 ; and the or are faster than the ashc and whatever else we'd have 37111 ; to do. Div works too, but is blindingly slow. 37112 37113 003020'01 todsec: entry todsec ; Keep LINK informed of our location 37114 003020'01 265 16 0 00 003603' saveac ; Intermediate double word results 37115 003021'01 225 02 0 00 250600 muli t2,^d86400 ; Convert to base 86400 37116 003022'01 514 04 0 00 000002 hrlz t4,t2 ; Pick up high order 37117 003023'01 242 04 0 00 777777 lsh t4,-1 ; Strip off the extra sign bit 37118 003024'01 554 02 0 00 000003 hlrz t2,t3 ; Pick up low order of quotient 37119 003025'01 434 02 0 00 000004 or t2,t4 ; Build final quotient 37120 003026'01 621 03 0 00 777777 tlz t3,-1 ; Clear out from the remainder 37121 003027'01 303 03 0 00 124300 caile t3,^d<86400/2> ; Greater than a half second? 37122 003030'01 340 02 0 00 000000 aoj t2, ; Round up a second, then 37123 003031'01 263 17 0 00 000000 ret ; All done! 37124 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20TIM MAC 29-Apr-24 00:09 Previous todsec attempts, both good and bad 37125 subttl Previous todsec attempts, both good and bad 37126 37127 repeat 0,< ; First part works 37128 muli t2,^d86400 ; Convert to base 86400, double word result t2,t3 37129 ashc t2,-^d18 ; Strip out TOD ticks 37130 caile t3,^d<86400/2> ; Greater than a half second? 37131 aoj t2, ; Yes, round up a tick, then 37132 ret 37133 > 37134 repeat 0,< ; This works, but is slow 37135 muli t2,^d86400 ; Convert to base 86400 37136 div t2,[^d262144] ; Strip of TOD ticks 37137 caile t3,^d<86400/2> ; Greater than a half second? 37138 aoj t2, ; Round up a second, then 37139 ret ; All done! 37140 > 37141 37142 repeat 0,< ; This won't work for double length results 37143 hrl t2,t2 ; 'Divide' by 2^18 37144 hlr t2,t3 ; Pick up low order of quotient 37145 tlz t3,-1 ; Clear out from the remainder 37146 > 37147 37148 repeat 0,< ; Won't handle over a day 37149 imuli t2,^d86400 ; Convert to base 86400 37150 hrrz t3,t2 ; Pick up the remainder 37151 hlrz t2,t2 ; Properly position quotient 37152 caile t3,^d<86400/2> ; Greater than a half second? 37153 aoj t2, ; Round up a second, then 37154 ret ; All done! 37155 > K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20TIM MAC 29-Apr-24 00:09 subtract two (unsigned) times of day 37156 subttl subtract two (unsigned) times of day 37157 37158 ; Time of Day in TOD ticks is an ***UNSIGNED*** 36 bit number 37159 ; 37160 ; Therefore, a simple signed 35 bit subtract will eventually not 37161 ; work. Avoid the problem by using signed 70 bit math 37162 ; 37163 ; Returns result in t2, t1 is sacred 37164 37165 003032'01 elapst: entry elapst ; Keep LINK informed of our location 37166 37167 003032'01 265 16 0 00 003734' saveac 37168 003033'01 474 02 0 00 000000 seto t2, ; Assume unlikely case of something wrong 37169 003034'01 200 03 0 00 000000# move t3, etdat ; Load ending TOD 37170 003035'01 603 03 0 00 777777 tlne t3, -1 ; Any kind 37171 003036'01 316 03 0 00 003455' camn t3, [-1] ; of phonkey? 37172 003037'01 263 17 0 00 000000 ret ; Bad, return talisman 37173 003040'01 200 12 0 00 000000# move p2, stdat ; Load starting TOD 37174 003041'01 603 12 0 00 777777 tlne p2, -1 ; Any kind 37175 003042'01 316 12 0 00 003455' camn p2, [-1] ; of phonkey? 37176 003043'01 263 17 0 00 000000 ret ; Bad, return talisman 37177 37178 remark ; TOD is a 36 bit unsigned number!! 37179 003044'01 403 02 0 00 000011 setzb t2, p1 ; Zero high orders 37180 003045'01 623 03 0 00 400000 tlze t3, (1b0) ; Cast unsigned to signed long 37181 003046'01 201 02 0 00 000001 movei t2, ^d1 ; Propagate to high order 37182 003047'01 623 12 0 00 400000 tlze p2, (1b0) ; Cast unsigned to signed long 37183 003050'01 201 11 0 00 000001 movei p1, ^d1 ; Propagate to high order 37184 ; Make sure beginning is before last 37185 003051'01 316 02 0 00 000011 camn t2, p1 ; Compare high order 37186 003052'01 254 00 0 00 003060' ifskp. ; Not equal so just compare high order 37187 003053'01 311 02 0 00 000011 caml t2, p1 ; Is beginning before end? 37188 003054'01 254 00 0 00 003057' ifskp. ; Yep, swap them 37189 003055'01 250 02 0 00 000011 exch t2, p1 ; Swap high order 37190 003056'01 250 03 0 00 000012 exch t3, p2 ; Swap low order 37191 003057'01 endif. 37192 003057'01 254 00 0 00 003064' else. ; Equal, so compare low order 37193 003060'01 311 03 0 00 000012 caml t3, p2 ; Is beginning before end? 37194 003061'01 254 00 0 00 003064' ifskp. ; Yep, swap them 37195 003062'01 250 02 0 00 000011 exch t2, p1 ; Swap high order 37196 003063'01 250 03 0 00 000012 exch t3, p2 ; Swap low order 37197 003064'01 endif. 37198 003064'01 endif. 37199 ; Finally ok to subtract 37200 003064'01 115 02 0 00 000011 dsub t2, p1 ; Do a signed subtract 37201 003065'01 332 00 0 00 000002 skipe t2 ; Signed result of 36 bits? 37202 003066'01 661 03 0 00 400000 tlo t3,(1b0) ; Cast to unsigned 36 bits 37203 37204 003067'01 200 02 0 00 000003 move t2, t3 ; Load low order into return AC 37205 003070'01 263 17 0 00 000000 ret 37206 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20TIM MAC 29-Apr-24 00:09 Calculates character rate with double floating point arithmatic 37207 subttl Calculates character rate with double floating point arithmatic 37208 37209 ; Call: 37210 ; 37211 ; t2/ Pointer to elapsed HPTIM% (DK10) ticks for transfer (double word) 37212 ; t3/ Total characters sent or received 37213 ; 37214 ; Characters are handled as if they were unsigned int's, but currently, 37215 ; they never will be. This is done for future expansion. 37216 ; 37217 ; Returns: 37218 ; 37219 ; +1 - Failed 37220 ; +2 - Success!! 37221 ; t4/ Double floating raw baud rate, high order mantissa 37222 ; t5/ Ditto, low order mantissa 37223 ; 37224 ; Maintains precision by keeping numerator and denominator in fixed 37225 ; point as long as possible with the assumption that a dmul is faster 37226 ; than a dfmp and a ddiv is WAY faster than a dfdv. 37227 ; 37228 ; Since t5 is a lexical alias for q1, assumes q1 has been saved 37229 ; by caller. DON'T BREAK THIS ASSUMPTION! 37230 ; 37231 ; The odd calling conventions are because this used to be passed an 37232 ; unsigned int which did not have enough precision for certain extreme 37233 ; cases. However, because of agressive register scheduling, only a 37234 ; single register was available, so this was changed to a pointer, 37235 ; to a long int, instead. 37236 37237 chgsec(code,const) ;;Constants do not go in the code .PSECT 37238 000211'02 dblscl: intern dblscl ; Also used in k20dsp 37239 000211'02 000000 000000 0 ; Scaling factor between DK10 ticks and seconds 37240 000212'02 000000 303240 ^d100000 ; Low order of same (100000 ticks per second) 37241 retsec ;;Return to regular .PSECT assumptions 37242 37243 chgsec(code,data) ;;Intermediate results, largely used for debugging 37244 000227'05 tickpt: block 1 ; Pointer to HP tick double word (not always .datus!) 37245 000230'05 dbltic: block 2 ; Double INTEGER value that tickpt points to 37246 000232'05 dfltic: block 2 ; Double floating version of same 37247 000234'05 dblchr: block 2 ; Double INTEGER value of unsigned characters (exact) 37248 000236'05 dflchr: block 2 ; Double floating version of same 37249 retsec ;;Return to regular .PSECT assumptions 37250 37251 003071'01 dblcal: entry dblcal ; Used by k20dsp 37252 remark q1, t5 ; Recall this alias 37253 003071'01 265 16 0 00 003746' saveac ; Don't touch output pointer 37254 37255 003072'01 202 02 0 00 000000# movem t2, tickptr ; Save pointer to calling double word DK10 count 37256 37257 remark t3,chars ; Treated as unsigned 36; I.E., never negative 37258 003073'01 400 01 0 00 000000 setz t1, ; Form high order in t1 37259 003074'01 623 03 0 00 400000 tlze t3, (1b0) ; Cast unsigned to signed long 37260 003075'01 201 01 0 00 000001 movei t1, ^d1 ; Propagate to high order 37261 003076'01 200 02 0 00 000003 move t2, t3 ; Position to have double word in t1::t2 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-1 K20TIM MAC 29-Apr-24 00:09 Calculates character rate with double floating point arithmatic 37262 003077'01 124 01 0 00 000000# dmovem t1, dblchr ; Store interim long (double) signed integer 37263 37264 003100'01 200 03 0 00 000000# move t3, tickptr ; Load pointer to DK10 double word 37265 003101'01 120 01 0 03 000000 dmove t1, (t3) ; and then load said double word 37266 003102'01 124 01 0 00 000000# dmovem t1, dbltic ; Store long integer ticks 37267 003103'01 260 17 0 00 003301' call dfloat ; Convert to KL10 double floating point 37268 003104'01 263 17 0 00 000000 ret ; But failed for some reason 37269 003105'01 124 01 0 00 000000# dmovem t1, dfltic ; Store double floating ticks 37270 37271 003106'01 120 01 0 00 000000# dmove t1, dblchr ; Load interim long integer characters 37272 003107'01 403 03 0 00 000004 setzb t3, t4 ; Clear low order 37273 003110'01 116 01 0 00 000000# dmul t1, dblscl ; Scale to DK10 resolution 37274 003111'01 124 03 0 00 000000# dmovem t3, dblchr ; Store final long integer characters 37275 003112'01 120 01 0 00 000003 dmove t1, t3 ; Load scaled double integer for double float 37276 003113'01 260 17 0 00 003301' call dfloat ; Convert to double floating form 37277 003114'01 263 17 0 00 000000 ret ; Failed 37278 003115'01 124 01 0 00 000000# dmovem t1, dflchr ; Store interim double floating characters 37279 37280 003116'01 120 04 0 00 000001 dmove t4, t1 ; Position characters for return 37281 003117'01 113 04 0 00 000000# dfdv t4, dfltic ; Calculate character rate 37282 003120'01 254 00 0 00 002752* retskp ; Finally return successful result 37283 37284 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20TIM MAC 29-Apr-24 00:09 Single word to double integer and double float 37285 subttl Single word to double integer and double float 37286 37287 ; Call: 37288 ; 37289 ; t2/ Unsigned 36 bit integer to be converted to long and double float 37290 ; 37291 ; Result: 37292 ; 37293 ; +1/ Failed 37294 ; +2/ 37295 ; t2/ double floating high order 37296 ; t3/ double floating low order 37297 ; t4/ long integer high order 37298 ; t5/ long integer low order 37299 37300 003121'01 singdf: entry singdf ; Called by display 37301 003121'01 265 16 0 00 003746' saveac ; Save because dfloat will trash it 37302 37303 003122'01 400 01 0 00 000000 setz t1, ; Assume not more than 35 bits 37304 003123'01 623 02 0 00 400000 tlze t2, (1b0) ; Cast unsigned to signed long 37305 003124'01 201 01 0 00 000001 movei t1, ^d1 ; Propagate to high order 37306 003125'01 120 04 0 00 000001 dmove t4, t1 ; Now save the signed long 37307 37308 003126'01 260 17 0 00 003301' call dfloat ; Float signed long 37309 003127'01 263 17 0 00 000000 ret ; Or not... 37310 37311 003130'01 200 03 0 00 000002 move t3, t2 ; Reposition double floating low order 37312 003131'01 200 02 0 00 000001 move t2, t1 ; Reposition double floating high order 37313 003132'01 254 00 0 00 003120* retskp ; Succeed 37314 37315 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20TIM MAC 29-Apr-24 00:09 Schedule, Class and Load storage declarations 37316 subttl Schedule, Class and Load storage declarations 37317 37318 chgsec(code,data) ;;Declare non-global writable storage 37319 000240'05 000000 000000 class: 0 ;[130] My scheduler class. 37320 000241'05 000000 000000 skdflg: 0 ;[130] Nonzero if class scheduler on. 37321 000242'05 skdblk: block .saclu+1 ; Argument block for SKED% jsys. 37322 000251'05 000000 000000 skedx: 0 ;[194] SKED% error count 37323 000252'05 000000 601405 lgetbe: lstrx1 ;[194] Last GETAB% error 37324 000253'05 000000 000000 getabx: 0 ;[194] GETAB% error count 37325 000254'05 000000 601405 lskede: lstrx1 ;[194] Last error from SKED% (none) 37326 000255'05 000000 000000 ksajus: 0 ;[194] Kermit's (floating) job utilization 37327 retsec ;;Back into code 37328 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20TIM MAC 29-Apr-24 00:09 Get Scheduler Class information. 37329 subttl Get Scheduler Class information. 37330 37331 003133'01 gtclas: entry gtclas ; Identfy ourselves for LINK 37332 37333 003133'01 402 00 0 00 000000# setzm class ; Assume we ain't got no class ... (boo) 37334 003134'01 201 01 0 00 000014 movei t1, .skrcv ; Read scheduler status 37335 003135'01 120 02 0 00 003754' dmove t2, [exp t3 , 2] ; Two words, starting at t3 37336 003136'01 201 03 0 00 000002 movei t3, 2 ; Just want 2 words. 37337 003137'01 104 00 0 00 000577 SKED% 37338 003140'01 320 12 0 00 003142' ifje. r ; Catch and ignore error 37339 003141'01 254 00 0 00 003146' 37340 003142'01 202 01 0 00 000000# movem t1, lskede ; Save as last SKED% error 37341 003143'01 350 00 0 00 000000# aos skedx ; Count the error (should be only one) 37342 003144'01 402 00 0 00 000000# setzm skdflg ; Flag that the class scheduler is off 37343 003145'01 263 17 0 00 000000 ret ; Nothing else we can do 37344 003146'01 endif. ; End JSYS error handling 37345 37346 003146'01 603 04 0 00 100000 txne t4, sk%stp ; Class scheduler on? (bit means "stopped") 37347 003147'01 400 04 0 00 000000 setz t4, ; No, then whack all the bits we got back 37348 003150'01 202 04 0 00 000000# movem t4, skdflg ; And save some interesting bits 37349 003151'01 322 04 0 00 002751* jumpe t4, r ; If no scheduler, we're basically done here 37350 37351 ;[130] Scheduler is on, get my scheduler class. 37352 37353 003152'01 104 00 0 00 000013 GJINF% ; Get my job information 37354 003153'01 200 04 0 00 000003 move t4, t3 ; Put my job number in the right place 37355 37356 003154'01 265 16 0 00 000000* anstkv (t2,<.saclu+1>) ; Allocate an anonymous stack variable 37357 003155'01 000000 000007 37358 003156'01 415 02 0 17 777770 37359 remark ; Now fill out the argument block 37360 003157'01 124 03 0 02 000000 dmovem t3, .sacnt(t2) ; Pop them into the block 37361 003160'01 403 03 0 00 000004 setzb t3, t4 ; Cons up a pair of zeros 37362 003161'01 124 03 0 02 000002 dmovem t3, .sajcl(t2) ; Whack job class and job share 37363 003162'01 124 03 0 02 000004 dmovem t3, .sajus(t2) ; Whack job utilization and class share 37364 003163'01 402 00 0 02 000006 setzm .saclu(t2) ; Whack class utilization 37365 37366 003164'01 201 01 0 00 000007 movx t1, .skrjp ; Function code for getting job's class info. 37367 003165'01 104 00 0 00 000577 SKED% ; Cross our fingers 37368 003166'01 320 12 0 00 003170' ifje. r ; Failed?? 37369 003167'01 254 00 0 00 003174' 37370 003170'01 202 01 0 00 000000# movem t1, lskede ; Save as last SKED% error 37371 003171'01 350 00 0 00 000000# aos skedx ; Count the error (should be only one) 37372 003172'01 477 01 0 02 000002 setob t1, .sajcl(t2) ; Set class to -1 as a talisman 37373 003173'01 254 00 0 00 003175' else. ; Otherwise, worked! 37374 003174'01 200 01 0 02 000002 move t1, .sajcl(t2) ; So get a legitimate class 37375 003175'01 endif. ; End JSYS error 'recovery' 37376 37377 003175'01 202 01 0 00 000000# movem t1, class ; Who says I ain't got no class? 37378 003176'01 200 01 0 02 000004 move t1, .sajus(t2) ; Load job utilization because it's cool 37379 003177'01 202 01 0 00 000000# movem t1, ksajus ; Save it in case somebody ever cares 37380 003200'01 263 17 0 00 000000 ret 37381 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20TIM MAC 29-Apr-24 00:09 LDAV -- Get the current load average. 37382 subttl LDAV -- Get the current load average. 37383 37384 ;[130] This routine added as part of edit 130. 37385 ; 37386 ; Takes class scheduling into account. 37387 ; 37388 ; Call with 37389 ; 37390 ; t1/ 0 for 1 minute load average 37391 ; 1 for 5 minute load average 37392 ; 2 for 15 minute load average 37393 ; 37394 ; SKDFLG/ -1 if class scheduler running, 37395 ; 0 if no class scheduler or class scheduler stopped 37396 ; 37397 ; CLASS/ This job's scheduler class. 37398 ; 37399 ; Returns +1 always, with requested load average in t1. 37400 37401 003201'01 ldav: entry ldav ; Inform LINK of our location 37402 003201'01 265 16 0 00 003446' saveac ; Copy of deglitched calling argument 37403 003202'01 301 01 0 00 000000 cail t1, 0 ; Argument in range? 37404 003203'01 303 01 0 00 000002 caile t1, 2 37405 003204'01 400 01 0 00 000000 setz t1, ; Gubbish, silently force to 0. 37406 003205'01 200 05 0 00 000001 move q1, t1 ; Save a copy of it 37407 003206'01 332 00 0 00 000000# skipe skdflg ; Class scheduler on? 37408 003207'01 254 00 0 00 003221' jrst cldav ; Yes, go get class load average 37409 37410 ; No class scheduler or it's off, so use GETAB for system-wide load average 37411 37412 003210'01 514 01 0 00 000005 gldav: hrlz t1, q1 ; Desired load average. 37413 003211'01 270 01 0 00 003756' add t1, [14,,.systa] ; Goes from offset 14 to 16 (see 2.3.2) 37414 003212'01 104 00 0 00 000010 GETAB ; use load avg from SYSTAT monitor table. 37415 003213'01 320 12 0 00 003215' ifje. r ;[194] Catch and ignore error 37416 003214'01 254 00 0 00 003220' 37417 003215'01 202 01 0 00 000000# movem t1, lgetbe ;[194] Save last error 37418 003216'01 350 00 0 00 000000# aos getabx ;[194] Bump GETAB error count 37419 003217'01 205 01 0 00 203400 movx t1, ; Return minimum load in case of any error. 37420 003220'01 endif. ;[194] 37421 003220'01 263 17 0 00 000000 ret ; Otherwise, got some useful 37422 37423 ; Class scheduler on, get load avg for this class from SKED%. 37424 37425 003221'01 335 04 0 00 000000# cldav: skipge t4, class ; This job's scheduler class. 37426 003222'01 254 00 0 00 003210' jrst gldav ; We're in an odd way, fall back to GETAB 37427 37428 003223'01 265 16 0 00 003154* anstkv (t2,<.sa15l+1>) ; Allocate an anonymous stack variable 37429 003224'01 000000 000007 37430 003225'01 415 02 0 17 777770 37431 003226'01 124 03 0 02 000000 dmovem t3, .sacnt(t2) ; Store length and requested class 37432 003227'01 403 03 0 00 000004 setzb t3, t4 ; Cons up a pair of zeros 37433 003230'01 124 03 0 02 000002 dmovem t3, .sashr(t2) ; Whack returned share and use 37434 003231'01 124 03 0 02 000004 dmovem t3, .sa1ml(t2) ; Whack one and five minute load averages 37435 003232'01 402 00 0 02 000006 setzm .sa15l(t2) ; Whack 15 minute load average 37436 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51-1 K20TIM MAC 29-Apr-24 00:09 LDAV -- Get the current load average. 37437 003233'01 201 01 0 00 000003 movei t1, .skrcs ; Function is read class parameters. 37438 003234'01 104 00 0 00 000577 SKED% 37439 003235'01 320 12 0 00 003237' ifje. r ; Catch and ignore error 37440 003236'01 254 00 0 00 003243' 37441 003237'01 202 01 0 00 000000# movem t1, lskede ; Save as last SKED% error 37442 003240'01 350 00 0 00 000000# aos skedx ; Count the error (should be only one) 37443 003241'01 402 00 0 00 000000# setzm skdflg ; Flag that the class scheduler went off 37444 003242'01 254 00 0 00 003210' jrst gldav ; Fall back to GETAB 37445 003243'01 endif. ; End JSYS error handling 37446 37447 003243'01 201 03 0 02 000004 movei t3,.sa1ml(t2) ; Resolve base of load average block 37448 003244'01 270 03 0 00 000005 add t3, q1 ; Add offset to get to the one we want 37449 003245'01 200 01 0 03 000000 move t1, (t3) ; Finally load whatever it is 37450 003246'01 263 17 0 00 000000 ret ; Done 37451 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20TIM MAC 29-Apr-24 00:09 Increase wait time, depending on system load (very clever) 37452 subttl Increase wait time, depending on system load (very clever) 37453 37454 ;[128] Make this a separate routine. 37455 ; 37456 ; ADJTIM -- Adjust timeout interval based on load average (ldav). 37457 ; 37458 ; Timeout = mintim + (ldav-MINLOD)*((MAXTIM-mintim)/MAXLOD) 37459 ; 37460 ; 1) If the load is low, gives the minimum acceptable timeout, mintim. 37461 ; 2) If the load is very high, gives the maximum timeout, MAXTIM. 37462 ; 37463 ; In between, the timeout goes up linearly with given load average. 37464 ; 37465 ; MINLOD, MAXLOD, and MAXTIM are defined as global symbols. 37466 ; 37467 ; Call with: 37468 ; 37469 ; t1/ 1, 5, or 15 minute ldav, 37470 ; (floating point number as returned by ldav) 37471 ; t2/ minimum acceptable timeout (mintim), milliseconds (integer). 37472 ; 37473 ; Returns +1 always, with 37474 ; 37475 ; t2/ adjusted timeout interval, in milliseconds (integer). 37476 ; 37477 ; N.B., 37478 ; 37479 ; Will never return a number larger than MAXTIM. 37480 ; Zero means no time out and is always returned as zero 37481 37482 003247'01 adjtim: entry adjtim ; Inform LINK of our location 37483 003247'01 327 02 0 00 003252' ifle. t2 ;[212] Zero or goofy? 37484 003250'01 400 02 0 00 000000 setz t2, ;[212] Load zero (to never time out) 37485 003251'01 263 17 0 00 000000 ret ;[212] And return that 37486 003252'01 endif. 37487 37488 remark ;[212] Otherwise, have some math to do 37489 003252'01 265 16 0 00 000000* acvar ; Local storage for second argument. 37490 003253'01 202 02 0 00 000005 movem t2, mintim ; Save the minimum for later. 37491 37492 remark (ldav-MINLOD) ;[212] Normalize load to trigger after minlod 37493 003254'01 155 01 0 00 203400 fsbrx t1, ;[194] Adjust load by subtracting the minimum. 37494 003255'01 327 01 0 00 003261' ifle. t1 ;[212] Zero or negative load? 37495 003256'01 200 02 0 00 000005 move t2, mintim ;[212] Then second term has no effect 37496 003257'01 263 17 0 00 000000 ret ;[212] So just return the number, unaltered 37497 003260'01 254 00 0 00 003263' else. ;[212] Otherwise, range check the result 37498 003261'01 311 01 0 00 003757' caxl t1, ;[194] If too big, clamp to maximum 37499 003262'01 205 01 0 00 206620 movx t1, ;[194] It was, so load the maximum 37500 003263'01 endif. 37501 37502 remark (MAXTIM-mintim) ;[212] Range check and correct timeout 37503 003263'01 201 02 0 00 267460 movx t2, maxtim ;[212] Maximum timeout, milliseconds. 37504 003264'01 274 02 0 00 000005 sub t2, mintim ; Less specified timeout interval. 37505 003265'01 327 02 0 00 003271' ifle. t2 ;[212] Efficiency hack, is this not positive? 37506 003266'01 201 02 0 00 267460 movx t2, maxtim ;[212] Clamp result to maximum K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52-1 K20TIM MAC 29-Apr-24 00:09 Increase wait time, depending on system load (very clever) 37507 003267'01 263 17 0 00 000000 ret ;[212] And done 37508 003270'01 254 00 0 00 003272' else. ;[212] Otherwise, 37509 003271'01 127 02 0 00 000002 fltr t2, t2 ;[212] float the result 37510 003272'01 endif. ;[212] End term check 37511 37512 003272'01 175 02 0 00 206620 fdvrx t2, ;[194] Divided by maximum load. 37513 003273'01 164 01 0 00 000002 fmpr t1, t2 ; Multiplied by actual (adjusted) load. 37514 003274'01 126 02 0 00 000001 fixr t2, t1 ; Fixed & rounded. 37515 003275'01 270 02 0 00 000005 add t2, mintim ; Add in requested minimum timeout. 37516 003276'01 303 02 0 00 267460 caile t2, maxtim ;[212] Larger than largest? 37517 003277'01 201 02 0 00 267460 movx t2, maxtim ;[212] Clamp to maximum 37518 37519 003300'01 263 17 0 00 000000 ret ; Return with result in t2. 37520 37521 endav. ;[194] End scope mintim acvar 37522 37523 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20TIM MAC 29-Apr-24 00:09 Tables to support integer to double floating conversion 37524 SUBTTL Tables to support integer to double floating conversion 37525 37526 ;[206] Begin code insertion, selflessly donated from my very 37527 ; own Tops-20 Extended mode FTP Server. "Share and Enjoy" 37528 37529 REMARK Table to see if we can do a simple shift 37530 37531 ; When converting a single word integer to double floating point 37532 ; format, there is no case where we are ever going to have to round. 37533 ; However, in certain instances where the lower part of the word is 37534 ; clear, we can bum the combined (double accumulator) arithmetic shift 37535 ; and get by with a faster single accumulator logical shift. 37536 ; 37537 ; This is accomplished by checking to see if any bits would go from 37538 ; the lower high order word to the upper lower order word with these 37539 ; masks whose indices correspond to the amount of bits we'd need to 37540 ; shift over. 37541 37542 chgsec(code,const) ;;Constants go into CONST area 37543 37544 000213'02 000000 000000 SLSHMK: 0 ; Always positive means we'll skip the first entry 37545 000214'02 000000 000377 ^B11111111 ; 8 ; and will always be at least one 37546 000215'02 000000 000177 ^B1111111 ; 7 ; Means we have to have entire field free 37547 000216'02 000000 000077 ^B111111 ; 6 37548 000217'02 000000 000037 ^B11111 ; 5 37549 000220'02 000000 000017 ^B1111 ; 4 37550 000221'02 000000 000007 ^B111 ; 3 37551 000222'02 000000 000003 ^B11 ; 2 37552 000223'02 000000 000001 ^B1 ; 1 37553 000224'02 000 00 0 00 000000 Z ; 0 ; Should never happen because should have 37554 ; been caught by the rounding logic 37555 37556 REMARK Binary exponent increment 37557 37558 ; The table cooresponds to the simple shift hack, above. In this 37559 ; case, we already have the correct magnitude and simply need to 37560 ; change it based on the amount of the shift. 37561 37562 000225'02 000000 000000 BXPINC: 0 ; Always positive means we'll skip the first entry 37563 000226'02 010000 000000 FLD(^D8,EXPMSK) ; and will always be at least one bit because JFFO 37564 000227'02 007000 000000 FLD(^D7,EXPMSK) ; is always going to count the sign. Thus, having 37565 000230'02 006000 000000 FLD(^D6,EXPMSK) ; one bit set means we would have shifted out an 37566 000231'02 005000 000000 FLD(^D5,EXPMSK) ; entire exponent field 37567 000232'02 004000 000000 FLD(^D4,EXPMSK) 37568 000233'02 003000 000000 FLD(^D3,EXPMSK) 37569 000234'02 002000 000000 FLD(^D2,EXPMSK) 37570 000235'02 001000 000000 FLD(^D1,EXPMSK) 37571 000236'02 000 00 0 00 000000 Z ; Should never happen because should have caught 37572 ; by the rounding decision logic 37573 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20TIM MAC 29-Apr-24 00:09 Tables to support integer to double floating conversion 37574 REMARK Double word binary exponent 37575 37576 ; In this case, the table contains all of the possible exponent values 37577 ; for corresponding shifts when normalizing an integer in the high 37578 ; order word. 37579 37580 000237'02 000000 000000 DWBEXP: 0 ; Ignore the sign bit 37581 000240'02 306000 000000 FLD(^D<35+35+128>,EXPMSK) 37582 000241'02 305000 000000 FLD(^D<34+35+128>,EXPMSK) 37583 000242'02 304000 000000 FLD(^D<33+35+128>,EXPMSK) 37584 000243'02 303000 000000 FLD(^D<32+35+128>,EXPMSK) 37585 000244'02 302000 000000 FLD(^D<31+35+128>,EXPMSK) 37586 000245'02 301000 000000 FLD(^D<30+35+128>,EXPMSK) 37587 000246'02 300000 000000 FLD(^D<29+35+128>,EXPMSK) 37588 000247'02 277000 000000 FLD(^D<28+35+128>,EXPMSK) 37589 000250'02 000 00 0 00 000000 Z ; Should be caught by non-shifting case!!! 37590 000251'02 275000 000000 FLD(^D<26+35+128>,EXPMSK) 37591 000252'02 274000 000000 FLD(^D<25+35+128>,EXPMSK) 37592 000253'02 273000 000000 FLD(^D<24+35+128>,EXPMSK) 37593 000254'02 272000 000000 FLD(^D<23+35+128>,EXPMSK) 37594 000255'02 271000 000000 FLD(^D<22+35+128>,EXPMSK) 37595 000256'02 270000 000000 FLD(^D<21+35+128>,EXPMSK) 37596 000257'02 267000 000000 FLD(^D<20+35+128>,EXPMSK) 37597 000260'02 266000 000000 FLD(^D<19+35+128>,EXPMSK) 37598 000261'02 265000 000000 FLD(^D<18+35+128>,EXPMSK) 37599 000262'02 264000 000000 FLD(^D<17+35+128>,EXPMSK) 37600 000263'02 263000 000000 FLD(^D<16+35+128>,EXPMSK) 37601 000264'02 262000 000000 FLD(^D<15+35+128>,EXPMSK) 37602 000265'02 261000 000000 FLD(^D<14+35+128>,EXPMSK) 37603 000266'02 260000 000000 FLD(^D<13+35+128>,EXPMSK) 37604 000267'02 257000 000000 FLD(^D<12+35+128>,EXPMSK) 37605 000270'02 256000 000000 FLD(^D<11+35+128>,EXPMSK) 37606 000271'02 255000 000000 FLD(^D<10+35+128>,EXPMSK) 37607 000272'02 254000 000000 FLD(^D<09+35+128>,EXPMSK) 37608 000273'02 253000 000000 FLD(^D<08+35+128>,EXPMSK) 37609 000274'02 252000 000000 FLD(^D<07+35+128>,EXPMSK) 37610 000275'02 251000 000000 FLD(^D<06+35+128>,EXPMSK) 37611 000276'02 250000 000000 FLD(^D<05+35+128>,EXPMSK) 37612 000277'02 247000 000000 FLD(^D<04+35+128>,EXPMSK) 37613 000300'02 246000 000000 FLD(^D<03+35+128>,EXPMSK) 37614 000301'02 245000 000000 FLD(^D<02+35+128>,EXPMSK) 37615 000302'02 244000 000000 FLD(^D<01+35+128>,EXPMSK) 37616 000303'02 000 00 0 00 000000 Z ; Indicates a zero upper word which should 37617 ; have already been accounted for 37618 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20TIM MAC 29-Apr-24 00:09 Tables to support integer to double floating conversion 37619 REMARK Double word arithmetic shift normalization 37620 37621 RADIX ^D10 37622 37623 ; N.B., negative shift is the only case where a round operation would be needed 37624 37625 000304'02 000000 000000 DWASHN: 0 ; Ignore the sign bit 37626 000305'02 777777 777770 EXP -8,-7,-6,-5,-4,-3,-2,-1 ; Cases of opening up exponent field 37627 000315'02 000 00 0 00 000000 Z ; Should be caught by non-shifting case!! 37628 000316'02 000000 000001 EXP 1, 2, 3, 4, 5, 6, 7, 8, 9 ; Cases of shifting significance towards 37629 000327'02 000000 000012 EXP 10,11,12,13,14,15,16,17,18,19 ; the exponent field--never any rounding 37630 000341'02 000000 000024 EXP 20,21,22,23,24,25,26 ; Should never exceed 26 shifts 37631 000350'02 000 00 0 00 000000 Z ; Indicates a zero upper word which 37632 ; should have already been accounted for 37633 RADIX ^D8 37634 37635 retsec ;;Restore psect assumptions 37636 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56 K20TIM MAC 29-Apr-24 00:09 Routine to implement double float 37637 SUBTTL Routine to implement double float 37638 37639 ; The routine assumes that the exponent will always be positive (I.E., 37640 ; greater than 128 decimal, 200 octal). This is--by definition-- 37641 ; always true for integers: there will NEVER be fractions, much less 37642 ; values less than 1 other than zero (0) or a negative. 37643 ; 37644 ; It assumes that the number will be positive. If this is not the 37645 ; case, it takes the magitude of the integer and multiplies the 37646 ; eventual result by double floating negative 1. This will slow down 37647 ; the double floatation of negative numbers, but in this program we 37648 ; never produce those. 37649 ; 37650 ; It also doesn't do any rounding. However, rounding would only occur 37651 ; for values that are in excess of 4,611,686,018,427,387,903 37652 ; (approximately 4.5 million trillion). Since the numbers in question 37653 ; are not going to be THAT large, this is not a problem in this 37654 ; program. 37655 ; 37656 ; We're just looking to keep the original number in the fraction (or 37657 ; mantissa) and hence need the additional word of dynamic range 37658 ; 37659 ; N.B., Toad doesn't have dfltr yet it has dgfltr... Why?? 37660 ; 37661 ; Call: 37662 ; 37663 ; T1/ High order double integer 37664 ; T2/ Low order double integer 37665 ; 37666 ; Return: 37667 ; 37668 ; +1 Something failed, T1 and T2 indeterminate 37669 ; +2 Success 37670 ; T1/ High order double floating point (most significant bits of mantissa) 37671 ; T2/ Low order double floating point number 37672 37673 377000 000000 EXPMSK==MASKB(1,8) ; Exponent field mask 37674 37675 003301'01 DFLOAT: ENTRY DFLOAT ; Make available to the world 37676 003301'01 326 01 0 00 003304' IFE. T1 ; No high order. Might be zero ... 37677 003302'01 326 02 0 00 003304' IFE. T2 ; Any low order? 37678 003303'01 263 17 0 00 000000 RET ; No, got passed a zero, so nothing to do 37679 003304'01 ENDIF. ; End case of zero low order 37680 003304'01 ENDIF. ; End case of zero high order 37681 37682 003304'01 265 16 0 00 003760' SAVEAC ; Real work! Will need some scratch storage 37683 003305'01 321 01 0 00 003311' IFGE. T1 ; Something positivishly flavored? 37684 003306'01 120 03 0 00 000001 DMOVE T3,T1 ; Yes, save a copy of the number 37685 003307'01 400 06 0 00 000000 SETZ Q2, ; flag positivity 37686 003310'01 254 00 0 00 003314' ELSE. ; Otherwise make positive and fix later 37687 REMARK DMOVN ; Don't use; floating only, will break on ints 37688 003311'01 403 03 0 00 000004 SETZB T3,T4 ; Make a big fat zero 37689 003312'01 115 03 0 00 000001 DSUB T3,T1 ; Make negative a positive in T3:T4 37690 003313'01 474 06 0 00 000000 SETO Q2, ; Flag negativity 37691 003314'01 ENDIF. ; End case of negative signed double K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-1 K20TIM MAC 29-Apr-24 00:09 Routine to implement double float 37692 37693 003314'01 326 03 0 00 003347' IFE. T3 ; Not really a HUGE number after all? 37694 003315'01 603 04 0 00 377000 TXNE T4,EXPMSK ; Would we have to round???? 37695 003316'01 254 00 0 00 003327' IFSKP. ; No, maybe we can bum the FLTR ... 37696 003317'01 607 04 0 00 000400 TXNN T4,1B9 ; In the range of 67,108,864 to 134,217,727? 37697 003320'01 254 00 0 00 003324' IFSKP. ; Yes, already normalized! 37698 003321'01 205 01 0 00 233000 MOVX T1,FLD(^D<128+27>,EXPMSK) 37699 003322'01 434 01 0 00 000004 IOR T1,T4 ; Cons the exponent and mantissa 37700 003323'01 254 00 0 00 003325' ELSE. ; Otherwise, can use plain old reliable ... 37701 003324'01 127 01 0 00 000004 FLTR T1,T4 ; and float it (slowly) 37702 003325'01 ENDIF. ; Either way, T1 is complete 37703 003325'01 400 02 0 00 000000 SETZ T2, ; There is no low order mantissa 37704 003326'01 254 00 0 00 003346' ELSE. ; Otherwise more than 27 bit mantissa 37705 003327'01 200 01 0 00 000004 MOVE T1,T4 ; Load the integer 37706 003330'01 260 17 0 00 003431' CALL EXPSFT ; Compute shift amount to clear field 37707 003331'01 263 17 0 00 000000 RET ; Oh dear, we're ill, beat it 37708 003332'01 205 01 0 00 233000 MOVX T1,FLD(^D<128+27>,EXPMSK) 37709 003333'01 270 01 0 02 000000# ADD T1,BXPINC(T2) ; Load maximum unrounded and calculate shift 37710 003334'01 612 04 0 02 000000# TDNE T4,SLSHMK(T2) ; Is there enough space for a single shift 37711 003335'01 254 00 0 00 003342' IFSKP. ; Yes, use logical since FASTER than a combined 37712 003336'01 242 04 0 05 000000 LSH T4,(Q1) ; Finally get the bits out of the way 37713 003337'01 434 01 0 00 000004 IOR T1,T4 ; Cons the exponent and mantissa 37714 003340'01 400 02 0 00 000000 SETZ T2, ; And nothing in the low order 37715 003341'01 254 00 0 00 003346' ELSE. ; Otherwise part of mantissa will be in low word 37716 003342'01 250 03 0 00 000004 EXCH T3,T4 ; Bum a word's worth of shifting 37717 003343'01 244 03 0 05 000000 ASHC T3,(Q1) ; Split the fraction across two words 37718 003344'01 434 01 0 00 000003 IOR T1,T3 ; Cons the exponent and high mantissa 37719 003345'01 200 02 0 00 000004 MOVE T2,T4 ; And return the low mantissa 37720 003346'01 ENDIF. ; End case of combined shift decision 37721 003346'01 ENDIF. ; End case of 27 bit (non-rounded) mantissa 37722 003346'01 254 00 0 00 003424' JRST DFLRET ; And return the value 37723 003347'01 ENDIF. ; End case of no high order mantissa 37724 ; Some kind of large number ... 37725 003347'01 326 04 0 00 003402' IFE. T4 ; Maybe no low order mantissa? 37726 003350'01 603 03 0 00 377000 TXNE T3,EXPMSK ; Would we round the high order? 37727 003351'01 254 00 0 00 003363' IFSKP. ; No, maybe we can bum the FLTR ... 37728 003352'01 607 03 0 00 000400 TXNN T3,1B9 ; If between 2,305,843,009,213,693,952 and 37729 003353'01 254 00 0 00 003357' IFSKP. ; 4,611,685,984,067,649,536, already normalized! 37730 003354'01 205 01 0 00 276000 MOVX T1,FLD(^D<128+27+35>,EXPMSK) 37731 003355'01 434 01 0 00 000003 IOR T1,T3 ; Cons the exponent and mantissa 37732 003356'01 254 00 0 00 003361' ELSE. ; Otherwise, can use plain old reliable ... 37733 003357'01 127 01 0 00 000003 FLTR T1,T3 ; and float it (slowly) 37734 003360'01 270 01 0 00 003772' ADDX T1,FLD(^D35,EXPMSK) ; However, it is a lot larger 37735 003361'01 ENDIF. ; Either way, T1 is complete 37736 003361'01 400 02 0 00 000000 SETZ T2, ; There is no low order mantissa 37737 003362'01 254 00 0 00 003401' ELSE. ; Must get some bits out of the exponent field 37738 003363'01 200 01 0 00 000003 MOVE T1,T3 ; Load the (large) integer 37739 003364'01 260 17 0 00 003431' CALL EXPSFT ; Compute shift amount to clear field 37740 003365'01 263 17 0 00 000000 RET ; Oh dear, we're ill, beat it 37741 003366'01 205 01 0 00 276000 MOVX T1,FLD(^D<128+27+35>,EXPMSK) 37742 003367'01 270 01 0 02 000000# ADD T1,BXPINC(T2) ; Load maximum unrounded and calculate shift 37743 003370'01 612 03 0 02 000000# TDNE T3,SLSHMK(T2) ; Is there enough space for a single shift 37744 003371'01 254 00 0 00 003376' IFSKP. ; Yes, use logical since FASTER than a combined 37745 003372'01 242 03 0 05 000000 LSH T3,(Q1) ; Finally get the bits out of the way 37746 003373'01 434 01 0 00 000003 IOR T1,T3 ; Cons the exponent and mantissa K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-2 K20TIM MAC 29-Apr-24 00:09 Routine to implement double float 37747 003374'01 400 02 0 00 000000 SETZ T2, ; And nothing in the low order 37748 003375'01 254 00 0 00 003401' ELSE. ; Otherwise part of mantissa will be in low word 37749 003376'01 244 03 0 05 000000 ASHC T3,(Q1) ; Split the fraction across two words 37750 003377'01 434 01 0 00 000003 IOR T1,T3 ; Cons the exponent and high mantissa 37751 003400'01 200 02 0 00 000004 MOVE T2,T4 ; And return the low mantissa 37752 003401'01 ENDIF. ; End case of combined shift decision 37753 003401'01 ENDIF. ; End case of 27 or less bit high order mantissa 37754 003401'01 254 00 0 00 003424' JRST DFLRET ; and return the value 37755 003402'01 ENDIF. ; End case of no low order mantissa 37756 ; Here if more than 35 significant bits 37757 003402'01 603 03 0 00 377000 TXNE T3,EXPMSK ; If we are between 2,305,843,009,213,693,952 37758 003403'01 254 00 0 00 003412' IFSKP. ; and 4,611,686,018,427,387,903 then the double 37759 003404'01 607 03 0 00 000400 TXNN T3,1B9 ; float will be trivial as the mantissa is already 37760 003405'01 254 00 0 00 003412' ANSKP. ; in the right place, 'normalized' so to speak 37761 003406'01 205 01 0 00 276000 MOVX T1,FLD(^D<128+27+35>,EXPMSK) 37762 003407'01 434 01 0 00 000003 IOR T1,T3 ; Cons the exponent and mantissa 37763 003410'01 200 02 0 00 000004 MOVE T2,T4 ; lower order fraction will not move, either 37764 003411'01 254 00 0 00 003424' JRST DFLRET ; and return the value 37765 003412'01 ENDIF. ; End case of exactly perfect double mantissa 37766 ; Finally have to do some honest work ... 37767 003412'01 332 01 0 00 000003 SKIPE T1,T3 ; Load (and check) the high order of the mantissa 37768 003413'01 243 01 0 00 003415' JFFO T1,.+2 ; Find the first significant bit 37769 003414'01 263 17 0 00 000000 RET ; Broken JFFO, we just checked T3! 37770 003415'01 337 01 0 02 000000# SKIPG T1,DWBEXP(T2) ; Load the appropriate double word binary exponent 37771 003416'01 263 17 0 00 000000 RET ; Probably an errorneous table ... 37772 003417'01 336 05 0 02 000000# SKIPN Q1,DWASHN(T2) ; Load and check the normalization shift 37773 003420'01 263 17 0 00 000000 RET ; Probably an errorneous table ... 37774 003421'01 244 03 0 05 000000 ASHC T3,(Q1) ; Otherwise normalize the double integer 37775 003422'01 434 01 0 00 000003 IOR T1,T3 ; Cons up the exponent and high order mantissa 37776 003423'01 200 02 0 00 000004 MOVE T2,T4 ; Return the properly normalized low order 37777 REMARK DFLRET ; And hit the exit code 37778 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20TIM MAC 29-Apr-24 00:09 Double floating integer conversion support 37779 SUBTTL Double floating integer conversion support 37780 37781 REMARK Common exit, converts number to negative, if necessary 37782 37783 003424'01 305 06 0 00 000000 DFLRET: CAIGE Q2,0 ; If the original was positive, then we're through 37784 003425'01 112 01 0 00 003427' DFMP T1,DFLM1 ; No, (re)negativize our result (slowly) 37785 003426'01 254 00 0 00 003132* RETSKP ; Done 37786 37787 003427'01 576400 000000 DFLM1: EXP <576400,,0>,0 ; -1 DFMP multiplicand is what DFIN% gave us 37788 37789 37790 REMARK Here to compute number of bits to shift out of exponent field 37791 37792 ; Call: 37793 ; 37794 ; T1/ Has a number with bits in the exponent field 37795 ; 37796 ; Return: 37797 ; 37798 ; +1 Something failed, T2 and Q1 indeterminate 37799 ; +2 Success 37800 ; T2/ JFFO results (first set bit) 37801 ; Q1/ Number of bits to shift to clear the field 37802 37803 003431'01 307 01 0 00 000000 EXPSFT: CAIG T1,0 ; Zero or negative? 37804 003432'01 263 17 0 00 000000 RET ; Gronk, got called with junk 37805 003433'01 607 01 0 00 377000 TXNN T1,EXPMSK ; But is there anything to be shifted out? 37806 003434'01 263 17 0 00 000000 RET ; No, we should never have been invoked 37807 003435'01 243 01 0 00 003437' JFFO T1,.+2 ; Now find out how many leading bits 37808 003436'01 263 17 0 00 000000 RET ; Broken JFFO ... 37809 003437'01 301 02 0 00 000011 CAXL T2,1+WID(EXPMSK) ; More bits than the exponent field? 37810 003440'01 263 17 0 00 000000 RET ; Already clear and we shouldn't be here 37811 003441'01 307 02 0 00 000000 CAIG T2,0 ; However, there better be at least the sign bit! 37812 003442'01 263 17 0 00 000000 RET ; Broken JFFO (negative number check) 37813 003443'01 561 05 0 00 777767 MOVX Q1,-<1+WID(EXPMSK)> ;Load maximum possible shift 37814 003444'01 270 05 0 00 000002 ADD Q1,T2 ; And calculate the shift 37815 003445'01 254 00 0 00 003426* RETSKP ; Done! 37816 37817 ;[206] End code insertion. Or transfer. Or graft. Or something... 37818 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20TIM MAC 29-Apr-24 00:09 Calculates rate assuming input mantissas of less tnen 2^27 37819 subttl Calculates rate assuming input mantissas of less tnen 2^27 37820 37821 repeat 0,< ; Vestigial, unused 37822 37823 ; Call: 37824 ; 37825 ; t2/ Elapsed TOD ticks for transfer 37826 ; t3/ Total characters sent or received 37827 ; 37828 ; Returns: 37829 ; 37830 ; t4/ Double floating raw baud rate, high order mantissa 37831 ; t5/ Ditto, low order mantissa 37832 ; 37833 ; N.B., assumes input arguments (t3 and elapsed TOD ticks) 37834 ; do not have more than a 27 bit mantissa. 37835 ; 37836 ; Note refactoring of mathmatical operations to maintain better 37837 ; precision, Also bums a double floating divide (see below), the 37838 ; slowest instruction going. Thanks to Professor Anne for the 37839 ; multiplicative identities. 37840 37841 37842 calr27: fltr t4,t3 ; Float the count 37843 setz t5, ; Whack low order 37844 dfmp t4,[exp 2621440.,0] ;Intermediate bit ticks 37845 fltr t2,t2 ; Float those, too 37846 setz t3, ; Double float, almost (see peffif, sigh) 37847 dfmp t2,[exp 86400.,0] ; Intermediate seconds 37848 dfdv t4,t2 ; Calculates bits per second 37849 ret ; Returns rate in t4,t5 37850 37851 >;;End repeat 0 37852 K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20TIM MAC 29-Apr-24 00:09 Calculates rate assuming input mantissas of less then 2^27 37853 subttl Calculates rate assuming input mantissas of less then 2^27 37854 37855 repeat 0,< ; See numerical analysis, above 37856 37857 ; Call: 37858 ; 37859 ; t2/ Elapsed TOD ticks for transfer 37860 ; t3/ Total characters sent or received 37861 ; 37862 ; Returns: 37863 ; 37864 ; t4/ Double floating raw baud rate, high order mantissa 37865 ; t5/ Ditto, low order mantissa 37866 ; 37867 ; N.B., Assumes input arguments (t3 and elapsed TOD ticks) 37868 ; do not have more than a 27 bit mantissa. 37869 37870 calr27: fltr t4,t3 ; Float the count 37871 setz t5, ; Whack low order 37872 fltr t2,t2 ; Float elapsed ticks 37873 setz t3, ; Double float, almost (see peffif, sigh) 37874 dfmp t2,[exp 86400.,0] ; Convert to characters per second 37875 dfdv t2,[exp 262144.,0] ; Strip off TOD ticks 37876 dfdv t4,t2 ; Calculates characters per second 37877 dfmp t4,[exp 10.,0] ; Convert cps to bps 37878 ret ; Returns rate in t4,t5 37879 37880 >;;End repeat 0 37881 37882 .xcmsy ; Ditch any MACSYM junk 37883 37884 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 003774 FOR CODE PSECT 2 BREAK IS 000440 FOR CONST PSECT 3 BREAK IS 000165 FOR TEXT PSECT 4 BREAK IS 001145 FOR ETEXT PSECT 5 BREAK IS 000256 FOR DATA PSECT 6 BREAK IS 004000 FOR DEVTIM CPU TIME USED 00:01.588 125P CORE USED K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE ASCDEV 000000 ext MTOPR% 104000 000077 int RFRKH% 104000 000165 int .FPAC 000005 spd ASND% 104000 000070 int N 200000 000000 spd RFSTS% 104000 000156 int .GSDMP 000017 sin BOUTI% 000000 ext NO%AST 010000 000000 sin RSKP 000000 ext .GSIMG 000010 sin CALL 260740 000000 NO%COL 000177 000000 sin S 400000 000000 spd .GSNRM 000000 sin CALLRE 254000 000000 spd NO%LFL 100000 000000 sin SETER% 104000 000336 int .GSSMB 000001 sin CFMRTN 000000 ext NO%MAG 400000 000000 sin SF%CON 400000 000000 sin .HPELP 000000 sin CFORK% 104000 000152 int NO%OOV 020000 000000 sin SFORK% 104000 000157 int .HPTOD 000004 sin CM%ABR 000004 sin NO%RDX 777777 sin SIN% 104000 000052 int .INFIN 377777 777777 sin CM%FNC 777000 000000 sin NO%ZRO 040000 000000 sin SK%STP 100000 000000 sin .JSAOF 000001 sin CM%FW 002000 000000 sin NOIRTN 000000 ext SKED% 104000 000577 int .MOCC 000041 sin CM%HPP 000004 000000 sin NOP 600000 000000 sin SOUT% 104000 000053 int .NPAC 000010 spd CM%INV 000001 sin NOUT% 104000 000224 int SOUTR% 104000 000532 int .NULIO 377777 sin CMDER1 000000 ext NULLEN 004000 spd SPJFN% 104000 000207 int .PRIIN 000100 sin CODE 000000 ext NULPAG 000002 spd SYMOUT 000000 ext .PRIOU 000101 sin CONST 000000 ext NULPGS 000003 spd T1 000001 spd .PX7 610001 000000 spd CR%ACS 040000 000000 sin ODTIM% 104000 000220 int T2 000002 spd .RFFPT 000003 sin CR%MAP 400000 000000 sin OF%BSZ 770000 000000 sin T3 000003 spd .RFHLT 000002 sin CR%PCV 777777 sin OF%MOD 007400 000000 sin T4 000004 spd .RFIO 000001 sin CR%ST 020000 000000 sin OF%RD 200000 sin T5 000005 spd .RFRUN 000000 sin CRLF 000000 ext OF%WR 100000 sin TEXT 000000 ext .RFSIG 000010 sin CX 000016 OPENF% 104000 000021 int TIME% 104000 000014 int .SA15L 000006 sin DATA 000000 ext P 000017 TODTIC 000001 000000 spd .SA1ML 000004 sin DEVORG 002000 spd P1 000011 spd WFORK% 104000 000163 int .SAC 000016 DEVTIM 000000 ext P2 000012 spd XMOVEI 415000 000000 int .SACLU 000006 sin DIRST% 104000 000041 int P3 000013 spd %%JSER 000000 ext .SACNT 000000 sin DISMS% 104000 000167 int P4 000014 spd %%SMSG 000000 ext .SAJCL 000002 sin DKDAY 100276 770000 spd P5 000015 spd ..MSK 777777 777777 spd .SAJUS 000004 sin DTILEN 000021 spd PARS1 000000 ext .A16 000016 spd .SASHR 000002 sin ERJMP 320700 000000 int PARS2 000000 ext .CHNUL 000000 sin .SAV1 000000 ext ERJMPR 320500 000000 int PARS3 000000 ext .CHSPC 000040 sin .SAV2 000000 ext ERJMPS 320600 000000 int PARS4 000000 ext .CMCFM 000010 sin .SAV3 000000 ext ERSTR% 104000 000011 int PARS5 000000 ext .CMDEV 000016 sin .SKRCS 000003 sin ESOUT% 104000 000313 int PBOUT% 104000 000074 int .CMFNP 000000 sin .SKRCV 000014 sin ETEXT 000000 ext PM%ABT 000100 000000 sin .CMKEY 000000 sin .SKRJP 000007 sin FFORK% 104000 000154 int PM%CNT 400000 000000 sin .CMNUM 000001 sin .SYSTA 000014 sin GETAB 104000 000010 int PM%RD 100000 000000 sin .CMSWI 000003 sin .XSTKS 000000 ext GETER% 104000 000012 int PM%RPT 777777 sin .CTTRM 777777 sin .XTRST 000000 ext GJ%FLG 000020 000000 sin PMAP% 104000 000056 int .DATDK 000007 spd GJ%SHT 000001 000000 sin PSOUT% 104000 000076 int .DATEH 000005 spd GJINF% 104000 000013 int PTYLEN 001000 spd .DATEM 000011 spd GTAD% 104000 000227 int Q1 000005 spd .DATMR 000013 spd GTJFN% 104000 000020 int Q2 000006 spd .DATMS 000015 spd HALTF% 104000 000170 int Q3 000007 spd .DATTD 000000 spd HPTIM% 104000 000501 int Q4 000010 spd .DATTL 000001 spd IOX33 602423 int Q5 000011 spd .DATTR 000003 spd JFNS% 104000 000030 int R 000000 ext .DATUS 000017 spd JS%DEV 700000 000000 sin RELD% 104000 000071 int .DVDCN 000022 sin JS%NAM 007000 000000 sin RESET% 104000 000147 int .DVDES 600000 sin JS%PAF 000001 sin RET 263740 000000 .DVNUL 000015 sin KFORK% 104000 000153 int RF%FRZ 400000 000000 sin .DVPIP 000403 sin LSTRX1 601405 int RF%SIC 777777 sin .DVPTY 000013 sin MAXLOD 206620 000000 RF%STS 377777 000000 sin .DVSRV 000023 sin MAXTIM 267460 RFACS% 104000 000161 int .DVTTY 000012 sin MINLOD 203400 000000 RFIELD 000000 ext .FHSLF 400000 sin MSIDAY 000511 456000 spd RFORK% 104000 000155 int .FP 000015 spd K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT CODE ADJTIM 003247' ent MILTOD 002753' $MILS 000015 000006 spd ..0650 001256' spd ASCDEV 000236' ext MS2HP 002260' $MINS 000015 000004 spd ..0656 001264' spd ASGDEV 001316' ext MYNAME 003552' ext $MINTI 000005 spd ..0664 001271' spd ASGFLG 001315' ext NDVCHR 001323' ext $SECS 000015 000005 spd ..0673 001277' spd ASIPTY 000261' ext NLBAUD 000215' ext %%JSER 002577' ext ..0701 001306' spd BINFLG 001321' ext NOIRTN 000145' ext %%SMSG 002537' ext ..0710 001305' spd BLDCNT 000604' NONE 001603' ext ...X 000002 spd ..0716 001326' spd BOUTI% 002746' ext NULEPI 001572' ..0034 000020' spd ..0725 001314' spd BROKEN 000040' OVRFLW 003014' ..0042 000040' spd ..0741 001366' spd CFMRTN 000174' ext PARBYT 000073' ..0103 000062' spd ..0751 001372' spd CHKINT 001766' ext PARCHK 001750' ..0104 000073' spd ..0755 001375' spd CHKLEG 001632' PARDCN 000060' ..0105 000101' spd ..0771 001413' spd CKDERR 001414' PARECL 000115' ..0121 000106' spd ..0777 001411' spd CKDTWR 001327' PARITY 001637' ext ..0125 000123' spd ..1013 001445' spd CLDAV 003221' PARMOD 000110' ..0162 000137' spd ..1041 001523' spd CMDER1 000173' ext PARNUL 000056' ..0172 000155' spd ..1042 001531' spd CMPRMN 001155' ext PARPIP 000054' ..0200 000174' spd ..1057 001600' spd COMPUT 000702' PARPTY 000052' ..0220 000311' spd ..1065 001607' spd CRLF 001745' ext PARS2 000246' ext ..0226 000314' spd ..1066 001614' spd DBLCAL 003071' ent PARS3 000556' ext ..0242 000337' spd ..1074 001635' spd DEVCOD 000662' int PARS4 001517' ext ..0253 000364' spd ..1075 001644' spd DEVHLT 000011 PARS5 000356' ext ..0254 000401' spd ..1117 001745' spd DEVINF 000005 PARSET 001601' ..0300 000454' spd ..1134 002032' spd DFLM1 003427' PARSWI 000062' ..0306 000457' spd ..1156 002063' spd DFLOAT 003301' ent PBYTE 770000 000000 spd ..0317 000472' spd ..1157 002064' spd DFLRET 003424' PIBAUD 000213' ext ..0325 000475' spd ..1165 002074' spd DNBAUD 000220' ext PIPJFN 000356' ..0341 000531' spd ..1166 002102' spd DNULBD 001506' int PTYFLG 001320' ext ..0347 000534' spd ..1173 002102' spd DPIPBD 000346' int PTYJFN 000260' ..0363 000561' spd ..1175 002120' spd DPTYBD 000250' int PTYNAM 003533' ext ..0371 000564' spd ..1210 002111' spd DSRVBD 000504' int PTYTTY 001317' ext ..0401 000616' spd ..1211 002117' spd DURTIM 002342' ent PUTC 001740' ext ..0414 000612' spd ..1212 002125' spd EHPTI1 002402' PVBAUD 000211' ext ..0415 000616' spd ..1221 002166' spd EHPTI2 002430' R 003151' ext ..0423 000617' spd ..1222 002157' spd EHPTI3 002442' RFIELD 000147' ext ..0424 000623' spd ..1223 002160' spd EHPTI4 002464' RFSTST 001475' ..0435 000633' spd ..1224 002161' spd EHPTI5 002513' RSKP 003445' ext ..0436 000637' spd ..1231 002163' spd EHPTIM 002370' ent SBYTE 007700 000000 spd ..0451 000706' spd ..1237 002174' spd ELAPST 003032' ent SINGDF 003121' ent ..0452 000713' spd ..1240 002175' spd ELPTIM 002133' ent SRVDCN 000514' ..0470 000766' spd ..1242 002236' spd ENDTIM 002050' ent STATIM 002033' ent ..0507 001011' spd ..1243 002205' spd EPICOM 001235' SYMOUT 001471' ext ..0510 001041' spd ..1244 002206' spd ETODHP 002302' TCOMMN 000715' ..0522 001047' spd ..1245 002207' spd EXPMSK 377000 000000 spd TIMWRK 002052' ..0537 001055' spd ..1252 002211' spd EXPSFT 003431' TODSEC 003020' ent ..0540 001101' spd ..1254 002222' spd FINTIM 002707' ent TTYNAM 003526' ext ..0546 001071' spd ..1255 002223' spd FRCLOS 001266' ext ZEROIT 002042' ..0552 001107' spd ..1256 002224' spd GENINT 001624' ext $COPY 000175' ..0574 001136' spd ..1263 002227' spd GLDAV 003210' $COPYD 000246' ..0601 001161' spd ..1264 002235' spd GTCLAS 003133' ent $COPYN 000233' ..0606 001164' spd ..1271 002244' spd INITIM 002541' ent $COPYS 000244' ..0607 001202' spd ..1272 002245' spd INITOD 002655' $DK10 000015 000007 spd ..0617 001232' spd ..1273 002256' spd LDAV 003201' ent $DUR 000015 000001 spd ..0624 001257' spd ..1301 002263' spd MAXHPT 002127' $HRS 000015 000003 spd ..0633 001245' spd ..1307 002263' spd MAXMIL 002131' $LSFLA 000015 000010 spd ..0642 001256' spd ..1316 002275' spd K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT CODE ..1323 002300' spd ..1656 003060' spd ..1324 002301' spd ..1657 003064' spd ..1325 002306' spd ..1664 003057' spd ..1333 002306' spd ..1672 003064' spd ..1341 002333' spd ..1701 003146' spd ..1342 002334' spd ..1710 003174' spd ..1343 002335' spd ..1711 003175' spd ..1350 002337' spd ..1717 003220' spd ..1352 002354' spd ..1726 003243' spd ..1360 002354' spd ..1730 003252' spd ..1366 002356' spd ..1736 003261' spd ..1374 002367' spd ..1743 003263' spd ..1411 002430' spd ..1744 003271' spd ..1416 002441' spd ..1751 003272' spd ..1417 002442' spd ..1752 003304' spd ..1420 002446' spd ..1760 003304' spd ..1425 002451' spd ..1766 003311' spd ..1426 002464' spd ..1773 003314' spd ..1434 002456' spd ..1774 003347' spd ..1441 002462' spd ..2006 003327' spd ..1442 002467' spd ..2007 003346' spd ..1447 002470' spd ..2014 003324' spd ..1451 002501' spd ..2015 003325' spd ..1456 002513' spd ..2022 003342' spd ..1464 002507' spd ..2023 003346' spd ..1465 002513' spd ..2024 003402' spd ..1466 002540' spd ..2036 003363' spd ..1500 002526' spd ..2037 003401' spd ..1501 002530' spd ..2044 003357' spd ..1511 002536' spd ..2045 003361' spd ..1512 002540' spd ..2052 003376' spd ..1523 002560' spd ..2053 003401' spd ..1524 002567' spd ..2060 003412' spd ..1534 002603' spd ..IFT 000000 spd ..1535 002611' spd ..JX1 400000 000000 spd ..1544 002611' spd ..MX1 777777 777767 spd ..1547 002625' spd ..MX2 000001 spd ..1554 002632' spd ..NV 000011 spd ..1555 002634' spd ..TRR 000010 spd ..1556 002631' spd ..TX1 377000 000000 spd ..1571 002650' spd ..TX2 000001 spd ..1572 002654' spd .COPY 000125' ..1573 002663' spd .RFMAX 000011 spd ..1601 002663' spd .SAV1 003252' ext ..1607 002722' spd .SAV2 000000 ext ..1614 002740' spd .SAV3 000000 ext ..1615 002735' spd .TIME 000000' int ..1622 002737' spd .XSTKS 003223' ext ..1623 002733' spd .XTRST 002370' ext ..1630 002734' spd ..1631 002761' spd ..1637 002761' spd ..1645 003010' spd ..1646 003011' spd ..1647 003012' spd K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT CONST BXPINC 000225' CLIPMX 000206' COPTAB 000102' CPFFDB 000117' CPTFDB 000125' DBLSCL 000211' int DCNFD1 000075' DCNFDB 000072' DEVSWI 000035' DKDAYD 000200' DWASHN 000304' DWBEXP 000237' LIONE 000176' MODKEY 000044' MS1000 000174' MSIDAD 000172' MSTIME 000170' NILFDB 000065' NULSWI 000033' PARFDB 000053' PIPFDB 000060' PIPSWI 000040' SLSHMK 000213' SRVACC 000137' SRVLEN 000140' TIMFDB 000023' TIMTAB 000000' TTICD2 000204' TTICDW 000202' ..XX 016004 000000 spd K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT TEXT DCNDAT 000163' DCNTSK 000155' PIP1ST 000140' SRVMSG 000151' SRVNAM 000145' $COPYM 000133' K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT DATA BOOTDD 000217' BOOTDT 000216' BOOTRM 000221' CHRCNT 000124' CHRPTR 000123' CLASS 000240' DBLCHR 000234' DBLTIC 000230' DCNAME 000032' DEVACS 000103' DEVPDL 000056' DEVSTG 000024 spd DFLCHR 000236' DFLTIC 000232' EHPTOD 000224' ETDAT 000147' EWALLT 000170' int GETABX 000253' IHPTOD 000225' KSAJUS 000255' LGETBE 000252' LSKEDE 000254' MHPTOD 000223' int PIP2ND 000024' PIPNAM 000000' PRGSDD 000212' PRGSDT 000211' SKDBLK 000242' SKDFLG 000241' SKEDX 000251' STDAT 000126' int SYSUMS 000214' TICKPT 000227' TIMDEV 000102' int TIMPAR 000125' TSKTIM 000031' WHOAMI 000030' int K20TIM - Kermit (Virtual) Device Timing MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20TIM MAC 29-Apr-24 00:09 SYMBOL TABLE FOR PSECT DEVTIM DEVCHR 004000 spd DEVDA2 003000' DEVDAT 002000' DEVRED 001000' DEVWRD 001000 spd DEVWRT 000000' NULWRT 000000' sin k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20SRV MAC 9-Aug-24 12:55 Preliminaries 37885 title k20srv - Kermit-20 High Level Server and Associated Local Commands 37886 37887 ; Much of the server code was moved from k20mit to this module as part 37888 ; of Edit 194 to address the issue of a very large single source file 37889 ; that unexpectedly began generating MCRNEC errors. 37890 ; 37891 ; Another goal was to make the server code more robust, easier to 37892 ; maintain and add new features. If an efficiency gain was obvious, 37893 ; then it was taken. 37894 ; 37895 ; One example of robustness was an attempt to combine the semanic 37896 ; action routines of the LOCAL commands with those of the REMOTE 37897 ; commands. This allowed for easier debugging with the understanding 37898 ; that, if something works as a LOCAL command, some amount of 37899 ; confidence could be assumed for at least that part would work as a 37900 ; server command. 37901 ; 37902 ; Thus, the supporting code for the LOCAL and remote commands is also 37903 ; here. One example would be the file deleting and directory code. 37904 37905 subttl Preliminaries 37906 37907 search monsym,macsym,cmd,k20unv ;[194] 37908 cmdacs ^ ;Clean up p1-p4 definitions 37909 37910 sall ; Tidy listing 37911 .directive flblst ; We don't need to see all the ASCIZ bytes... 37912 37913 remark common parsing external data 37914 extern pars1 ; Data from first parse. 37915 extern pars2 ; Data from second parse. 37916 extern pars3 ; Data from third parse. 37917 extern pars4 ; Data from fourth parse. 37918 extern pars5 ;[41] ... 37919 extern pars6 ;[218] 37920 37921 remark ; COMND% storage from CMD 37922 extern cjfnbk ; COMND% GTJFN block (long form) 37923 extern atmbuf ; The ubiquitous atom buffer 37924 extern atmbln ; Its length 37925 37926 remark ; Packet level storage and routines 37927 extern xflg ; Sending with X header (probably will be displayed) 37928 extern gotx ; Flag for "already got an X-packet". 37929 extern gots ; Flag for "already got an S-packet". 37930 extern sinit ; Sends an "S" or "I" (initialize parameters) 37931 extern iflg ; Sending an "I" packet 37932 extern spack ; Send a packet 37933 extern spsiz ; Maximimum size packet to send 37934 extern spar ; Get the arguments from a Send-Init packet. 37935 extern sptot ; Total of sent packets 37936 extern rpack ; Receive a packet 37937 extern rpsiz ; Maximimum size packet to receive 37938 extern $sends ; Entry point of $send for server 37939 extern rpar ; Set arguments we'd like honored k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-1 K20SRV MAC 9-Aug-24 12:55 Preliminaries 37940 extern rptot ; Total of recieved packets 37941 extern rrinit ; Set up various variables for receiving 37942 extern $recvs ; Entry point of $recv for server 37943 extern $recvb ; Alternate entry point in $recv for server 37944 37945 extern nak ; Negative acknowledgde; bounce a packet 37946 extern nnak ; Number of NACK's sent 37947 extern pktnum ; Current packet number 37948 extern strbuf ; String buffer, used to decode data 37949 extern strptr ; Pointer into the above (also used by k20ioc) 37950 extern strbz ; Last address of combined string areas (used to zero) 37951 extern bctone ; Set if doing single character checksum 37952 extern maxdat ; Maximum length of data field 37953 extern pktacs ; Place to save RPACK/SPACK ACs. 37954 37955 remark ; Data flow routines that feed and drain packets 37956 extern source ; Routine that GETCH calls to get data 37957 extern dest ; Routine that PUTCH calls to put data 37958 remark ch ; Current character 37959 extern next ; Next character in stream 37960 37961 remark ; JFN related storage 37962 extern filjfn ; JFN of open file 37963 extern nxtjfn ; Next JFN in wildcarding 37964 extern ndxjfn ; Stepping JFN 37965 extern logjfn ; Log file JFN (if logging) 37966 extern netjfn ; Network or non-controlling TTY JFN 37967 extern ttyjfn ; JFN of local terminal (never the same as TTYJFN) 37968 37969 remark ; File related routines and storage 37970 extern decodf ; Decode a file name 37971 extern typfil ; Display a file's contents on the terminal 37972 extern typnam ; Type a file's name (special casing .nulio) 37973 extern whakfp ; Whack a mapped file page from our address space 37974 extern frclos ; Force a JFN to close 37975 extern isnulj ; Is this JFN some flavor of NUL:? 37976 extern putbuf ; Put a buffer full of data from a packet in a file 37977 extern getbuf ; Get a buffer full of data from a file for a packet 37978 extern datbuf ; Data field of the packet 37979 extern subbp ; 'subtract' two byte pointers 37980 extern filbuf ; Buffer to build a file listing entry in 37981 extern filbfz ; End of buffer marker (address) 37982 extern mxascz ; Crazy long length for moving strings 37983 extern movasc ; Routine to move ASCII bytes quickly (hopefully) 37984 37985 remark ; N.B., the next three must be in order! 37986 extern pagcnt ; .FBBYV, Number of pages in the file and byte size 37987 extern bytcnt ; .FBSIZ and byte count 37988 extern crdate ; .FBCRV and creation date (these 3 must be adjacent!) 37989 37990 remark ; Various interrupt routines and storage 37991 extern ccon ; Enable Control-C handling 37992 extern ccoff ; Shut Control-C handling off 37993 extern caxzof ; Turn file processing interrupts off 37994 extern timeit ; Begin timing an activity k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-2 K20SRV MAC 9-Aug-24 12:55 Preliminaries 37995 extern timoff ; Shut off an asynchronous timer 37996 extern clrcno ; Clear Control-O 37997 extern czseen ; Control-Z seen 37998 37999 remark ; Variables for local/non-local communications 38000 extern ptyflg ; Set if the 'network' is a pseudo-terminal 38001 extern ptytty ; Mapping from PTY number to TTY number 38002 extern ttynum ; Number of controlling terminal 38003 extern speed ; Speed of physical line (if we have one) 38004 extern carier ; Carrier signal if dial up, otherwise, connection status 38005 extern mdmlin ; Set if modem-controlled line (I.E., dialup) 38006 38007 remark ; Low level communications routines and variables 38008 extern inilin ; Initialize the line 38009 extern rrslin ; Reset/Restore the communications line. 38010 extern rrsl2 ; Really reset (don't allow ^C) 38011 extern ttxon ; ^Q a line, if flow control 38012 extern statim ; Start timing (a generic command) 38013 extern delay ; Time to wait in milliseconds before first send 38014 extern odelay ; What it used to be (for saving and restoring) 38015 extern ntimou ; Number of timeouts 38016 extern stimou ; Send timeout interval 38017 extern otimou ; Its previous value, if overriden by transfer 38018 extern numtry ; Number of times we'vre tried sending this packet 38019 extern maxtry ; Maximum number of times to try 38020 extern seolch ; Remote host's End of Line character 38021 38022 remark ; Low level Top-20 monitor buffer management 38023 extern clrbuf ; Clear all characters in Tops-20 buffers 38024 extern clread ; As clrbuf, but lets us see what was in there 38025 38026 remark ; Low level I/O counters 38027 extern vchrcn ;[211] Virtual characters cleared 38028 extern nsici ;[211] Network SIN% count (SIN%'s issued) 38029 extern nsitc ;[211] Network SIN% total characters 38030 extern nsimx ;[211] Network SIN% maximum length 38031 38032 remark ; Server specific routines storage 38033 extern srvflg ; If running as a server 38034 extern local ; Set if we are not remote 38035 extern srvtim ; Server command time out 38036 38037 remark ;[189] Timing routines in K20TIM 38038 extern statim ;[189] Start timing an interval 38039 extern endtim ;[189] Stop timing an interval 38040 extern elptim ;[189] Compute elapsed HPTIM% ticks 38041 38042 remark ; Error and string macro support 38043 extern errptr ; Pointer to error text 38044 extern %%jser ; Handler for %jsErr macro 38045 extern %%krms ; Same as above, but sends to remote Kermit, too 38046 extern %%smsg ; Used to get text from non-zero section 38047 extern %kerms ; Addition messages when in protocol 38048 extern %wtlog ; Write to transaction log 38049 extern scrlft ;[233] Set to -1 to suppress trailing crlf k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1-3 K20SRV MAC 9-Aug-24 12:55 Preliminaries 38050 extern tlgjfn ;[233] Transaction log JFN 38051 extern setlog ; Open debugging log 38052 38053 remark ; Other external variables of interest 38054 extern jobtab ;[220] Our job's GETJI% 38055 extern expung ; Set if expunging files on delete 38056 extern crlf ; Carriage Return/Line Feed 38057 extern mycaps ; Capability vector double word 38058 extern capas ; Enabled process capabilities 38059 extern f$exit ; The exit flag which tells main loop to stop 38060 extern allfld ;[252] ; Punctuated all fields for JFNS% 38061 38062 .psect code/ronly ; Pure code, pure Heaven 38063 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20SRV MAC 9-Aug-24 12:55 Parse tables, used as a kind of table of contents 38064 subttl Parse tables, used as a kind of table of contents 38065 38066 ;N.B., When parsing for .cmtxt and .cmcfm, .cmcfm must come first!!!! 38067 38068 remark Parse table for LOCAL commands 38069 38070 000000'02 000000 000000 %table(loctab,G) ;[220] Used as a kind of table of contents 38071 000001'02 000000# 000004' %keyf3 , %cwd, 38072 000000'03 002000 000005 38073 000001'03 143 000 000 000 000 38074 000002'02 000000# 000000# %keyf4 , .ycwd, $ycwd, cm%inv 38075 000002'03 002000 000001 38076 000003'03 143 144 000 000 000 38077 000004'03 000000# 000000# 38078 000003'02 000000# 000000# %key3 , .ycdup, $ycdup ;[254] 38079 000005'03 143 144 165 160 000 38080 000006'03 000000# 000000# 38081 000004'02 000000# 000000# %cwd: %key3 , .ycwd, $ycwd 38082 000007'03 143 167 144 000 000 38083 000010'03 000000# 000000# 38084 000005'02 000000# 000000# %key3 , .ydele, $ydele 38085 000011'03 144 145 154 145 164 38086 000013'03 000000# 000000# 38087 000006'02 000000# 000000# %key3 , .ydire, $ydire 38088 000014'03 144 151 162 145 143 38089 000016'03 000000# 000000# 38090 000007'02 000000# 000000# %key3 , .ypwd, $ypwd ;[188] ;[194] 38091 000017'03 160 167 144 000 000 38092 000020'03 000000# 000000# 38093 000010'02 000000# 000000# %key3 , .yrun, $yrun 38094 000021'03 162 165 156 000 000 38095 000022'03 000000# 000000# 38096 000011'02 000000# 000000# %key3 , .ydisk, $ydisk ;[194] 38097 000023'03 163 160 141 143 145 38098 000025'03 000000# 000000# 38099 000012'02 000000# 000016' %keyf3 , %lst, 38100 000026'03 002000 000005 38101 000027'03 163 164 000 000 000 38102 000013'02 000000# 000016' %keyf3 , %lst, 38103 000030'03 002000 000005 38104 000031'03 163 164 141 000 000 38105 000014'02 000000# 000016' %keyf3 , %lst, 38106 000032'03 002000 000005 38107 000033'03 163 164 141 164 000 38108 000015'02 000000# 000000# %keyf4 , .stat, $ysrvt, cm%inv 38109 000034'03 002000 000001 38110 000035'03 163 164 141 164 151 38111 000040'03 000000# 000000# 38112 000016'02 000000# 000000# %lst: %key3 , .stat, $ysrvt ;[189] ;[194] 38113 000041'03 163 164 141 164 165 38114 000043'03 000000# 000000# 38115 000017'02 000000# 000000# %key3 , .ytype, $ytype 38116 000044'03 164 171 160 145 000 38117 000045'03 000000# 000000# 38118 000000'02 000017 000017 %tbend k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-1 K20SRV MAC 9-Aug-24 12:55 Parse tables, used as a kind of table of contents 38119 38120 cleans(<%cwd,%lst>) 38121 38122 remark Parse table for REMOTE commands 38123 38124 000020'02 000000 000000 %table(remtab,G) ;[220] Moved here as a kind of table of contents 38125 000021'02 000000# 000000# %keyf4 , .bye, $bye, cm%inv ;[186] Tom can't remember.. 38126 000046'03 002000 000001 38127 000047'03 142 171 145 000 000 38128 000050'03 000000# 000000# 38129 000022'02 000000# 000000# %key3 , .xcdup, $xcdup ;[254] 38130 000051'03 143 144 165 160 000 38131 000052'03 000000# 000000# 38132 000023'02 000000# 000000# %key3 , .xcwd, $xcwd ;[194] 38133 000053'03 143 167 144 000 000 38134 000054'03 000000# 000000# 38135 000024'02 000000# 000000# %key3 , .rmfil, $xdele ;[194] 38136 000055'03 144 145 154 145 164 38137 000057'03 000000# 000000# 38138 000025'02 000000# 000000# %key3 , .rmfil, $xdire ;[194] 38139 000060'03 144 151 162 145 143 38140 000062'03 000000# 000000# 38141 000026'02 000000# 000000# %keyf4 , .xerr, $xerr, cm%inv ;[194] 38142 000063'03 002000 000001 38143 000064'03 145 162 162 157 162 38144 000066'03 000000# 000000# 38145 000027'02 000000# 000000# %keyf4 , .finis, $finis, cm%inv ;[186] Tom can't remember.. 38146 000067'03 002000 000001 38147 000070'03 146 151 156 151 163 38148 000072'03 000000# 000000# 38149 000030'02 000000# 000000# %key3 , .xhelp, $xhelp ;[120] ;[194] 38150 000073'03 150 145 154 160 000 38151 000074'03 000000# 000000# 38152 000031'02 000000# 000000# %key3 , .xhost, $xhost ;[105] 38153 000075'03 150 157 163 164 000 38154 000076'03 000000# 000000# 38155 000032'02 000000# 000000# %key3 , .xpwd, $xpwd ;[188] ;[194] 38156 000077'03 160 167 144 000 000 38157 000100'03 000000# 000000# 38158 ;;;* %key3 , .???, $??? 38159 000033'02 000000# 000000# %key3 , .xdisk, $xdisk ;[194] 38160 000101'03 163 160 141 143 145 38161 000103'03 000000# 000000# 38162 000034'02 000000# 000040' %keyf3 , %rst, 38163 000104'03 002000 000005 38164 000105'03 163 164 000 000 000 38165 000035'02 000000# 000040' %keyf3 , %rst, 38166 000106'03 002000 000005 38167 000107'03 163 164 141 000 000 38168 000036'02 000000# 000040' %keyf3 , %rst, 38169 000110'03 002000 000005 38170 000111'03 163 164 141 164 000 38171 000037'02 000000# 000000# %keyf4 , .xstat, $xstat, cm%inv 38172 000112'03 002000 000001 38173 000113'03 163 164 141 164 151 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2-2 K20SRV MAC 9-Aug-24 12:55 Parse tables, used as a kind of table of contents 38174 000116'03 000000# 000000# 38175 000040'02 000000# 000000# %rst: %key3 , .xstat, $xstat ;[189] ;[194] 38176 000117'03 163 164 141 164 165 38177 000121'03 000000# 000000# 38178 000041'02 000000# 000000# %key3 , .rmfil, $xtype 38179 000122'03 164 171 160 145 000 38180 000123'03 000000# 000000# 38181 000020'02 000021 000021 %tbend 38182 38183 cleans(<%rst>) 38184 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20SRV MAC 9-Aug-24 12:55 BYE command 38185 subttl BYE command 38186 38187 remark Parse the BYE command. 38188 38189 000000'01 .bye: entry .bye ; Can be invoked as top-level by k20par 38190 000000'01 200 16 0 00 000000# guide (to remote server) ; Parse rest of BYE command. 38191 000001'01 260 17 0 00 000000* 38192 000042'02 000000000000# 38193 000000'04 164 157 040 162 145 38194 000002'01 260 17 0 00 000000* confrm 38195 000003'01 263 17 0 00 000000 ret 38196 38197 remark Execute the BYE command. 38198 38199 ; N.B., Uses clread to drain the terminal buffer. However, we are 38200 ; SOUT%'ing raw eight bit data, no parity. Maybe this should be 38201 ; fixed? However, the previous code didn't do parity, either 38202 ; Maybe controlify? 38203 38204 000004'01 $bye: entry $bye ; Can be invoked as top-level by k20par 38205 000004'01 265 16 0 00 006254' saveac ;[211] Needs some additional storage 38206 000005'01 260 17 0 00 000000* call statim ;[189] Start timing so k20pdc doesn't choke 38207 dmove t1, [ ;[220] 38208 point 7, [asciz/L/] ; An "L" for the data field. 38209 000006'01 120 01 0 00 006263' "G" ] ; Packet type is G. 38210 000007'01 260 17 0 00 005134' call srvcmd ;[121] Send the command. 38211 000010'01 254 00 0 00 000050' jrst $byez ; Some error, don't exit. 38212 38213 ;[16] From here to end is part of edit 16. 38214 38215 000011'01 201 05 0 00 000005 movei q1, ^d5 ;[211] ; Waiting a total of 1.25 seconds 38216 000012'01 201 01 0 00 001750 movei t1, ^d1000 ;[211] ; Wait a second right now 38217 000013'01 104 00 0 00 000167 DISMS% 38218 38219 000014'01 do. ;[211] Enter loop context 38220 000014'01 260 17 0 00 000000* call clread ;[211] Get and clear data 38221 000015'01 254 00 0 00 000040' exit. ;[211] Unless there was an error 38222 000016'01 323 01 0 00 000034' ifg. t1 ;[211] Any goodies? 38223 000017'01 350 00 0 00 000000* aos nsici ;[211] Network SIN%'s Issued 38224 000020'01 210 03 0 00 000001 movn t3, t1 ;[211] Set up for counted SOUT% 38225 000021'01 272 03 0 00 000000* addm t3, vchrcn ;[211] Subtract from cleared 38226 000022'01 272 01 0 00 000000* addm t1, nsitc ;[211] And give them to Network SIN% 38227 000023'01 313 01 0 00 000000* camle t1, nsimx ;[211] Smaller than largest? 38228 000024'01 202 01 0 00 000023* movem t1, nsimx ;[211] Nope, have a new largest! 38229 000025'01 201 01 0 00 000101 movei t1, .priou ;[211] This terminal 38230 remark t2, ;[211] Raw 8 bit pointer! 38231 000026'01 104 00 0 00 000053 SOUT% ;[211] Type it 38232 000027'01 320 12 0 00 000031' %jserr (,) ;[211] ?? 38233 000030'01 254 00 0 00 000034' 38234 000031'01 265 01 0 00 000000* 38235 000032'01 000000 000000 38236 000033'01 254 00 0 00 000034' 38237 000034'01 endif. ;[211] End case got some data 38238 000034'01 363 05 0 00 000040' sojle q1, endlp. ;[211] Stop looking if done waiting 38239 000035'01 201 01 0 00 000372 movei t1, ^d250 ; Sleep a little bit k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20SRV MAC 9-Aug-24 12:55 BYE command 38240 000036'01 104 00 0 00 000167 DISMS% 38241 000037'01 254 00 0 00 000014' loop. ;[211] Try again 38242 000040'01 enddo. ;[211] Exit loop lexical context 38243 38244 txmsg < 38245 000040'01 200 01 0 00 000000# ...> ; Maybe there's more, but... 38246 000041'01 104 00 0 00 000076 38247 000042'01 320 12 0 00 000043' 38248 000043'02 000000000000# 38249 000004'04 015 012 056 056 056 38250 000043'01 260 17 0 00 000000* call clrbuf ;[194] can't wait forever for it, 38251 000044'01 600 00 0 00 000000 nop ;[186] ; throw the rest away. 38252 000045'01 476 00 0 00 000000* setom f$exit ;[38] Set exit flag. 38253 000046'01 260 17 0 00 000000* call endtim ;[189] Stop timing 38254 000047'01 260 17 0 00 000000* call elptim ;[189] Compute elapsed time 38255 38256 ; Error exit 38257 38258 000050'01 402 00 0 00 000045* $byez: setzm f$exit ;[70] Don't exit. 38259 000051'01 263 17 0 00 000000 ret ;[70] 38260 38261 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20SRV MAC 9-Aug-24 12:55 CWD command 38262 subttl CWD command 38263 38264 remark [137] LOCAL CWD command parsing. 38265 38266 ; Changed to only parse for a password if it is determined that we 38267 ; can't connect without one. Trying the ACESS% more than once can get 38268 ; the ACJ or monitor delay code involved. 38269 ; 38270 ; N.B., The following COMND% oddity. If you are parsing for .cmdir 38271 ; and .cmdev (as is done below) and if you are connected to one 38272 ; structure and you type only the device name of another structure 38273 ; with the same named directory, then COMND% will actually parse a 38274 ; .cmdir of that directory on the other structure! 38275 38276 define token (c) < ;;[255] Define token 38277 ;;[255] All these literals, yuck... 38278 >;;token ;;[255] 38279 38280 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 38281 000044'02 011004 000047' ycwfdb: flddb. .cmdir,,,,,ycwfd1 38282 000045'02 000000 000000 38283 000046'02 44 07 0 00 000370' 38284 000047'02 016004 000052' ycwfd1: flddb. .cmdev,,,,,ycwfd2 38285 000050'02 000000 000000 38286 000051'02 44 07 0 00 000377' 38287 000052'02 023004 000055' ycwfd2: flddb. .cmtok,,token(<..>),,,ycwfd3 38288 000053'02 440700 000407' 38289 000054'02 44 07 0 00 000410' 38290 000055'02 010004 000000 ycwfd3: flddb. .cmcfm,,,,, ;[220] 38291 000056'02 000000 000000 38292 000057'02 44 07 0 00 000417' 38293 38294 000060'02 010004 000063' ypwfdb: flddb. .cmcfm,,,,,ypwfd1 38295 000061'02 000000 000000 38296 000062'02 44 07 0 00 000427' 38297 000063'02 021004 000066' ypwfd1: flddb. .cmqst,,,,,ypwfd2 38298 000064'02 000000 000000 38299 000065'02 44 07 0 00 000436' 38300 000066'02 017004 000000 ypwfd2: flddb. .cmtxt,,,,, ;[220] 38301 000067'02 000000 000000 38302 000070'02 44 07 0 00 000436' 38303 retsec ;;Get back to wherever we came from 38304 cleans() 38305 38306 000052'01 .ycwd: entry .ycwd ; Invoked from k20par 38307 000052'01 265 16 0 00 006265' saveac ; Save some accumulators for interim parse results 38308 38309 000053'01 200 16 0 00 000000# guide ; Issue guide words. 38310 000054'01 260 17 0 00 000001* 38311 000071'02 000000000000# 38312 000006'04 164 157 040 144 151 38313 000055'01 201 01 0 00 000000# movei t1, ycwfdb ;[220] 38314 000056'01 260 17 0 00 000000* call rfield ; Parse a directory specification. 38315 000057'01 135 03 0 00 006275' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 38316 000060'01 120 06 0 00 000002 dmove q2, t2 ;[220] Save these for downstream parsing k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4-1 K20SRV MAC 9-Aug-24 12:55 CWD command 38317 38318 000061'01 302 07 0 00 000010 caie q3, .cmcfm ; Confirmation? 38319 000062'01 254 00 0 00 000070' ifskp. ; Yes, then use our own logged-in directory 38320 000063'01 200 02 0 00 000000# move t2, .jilno+jobtab ; number, which always works without a password 38321 000064'01 201 03 0 00 000011 movei t3, .cmdir ;[220] Lie and say we parsed a directory 38322 000065'01 124 02 0 00 000000* dmovem t2, pars3 ;[220] Pass to semantic action 38323 000066'01 402 00 0 00 000000* setzm pars5 ;[220] No password string being passed 38324 000067'01 263 17 0 00 000000 ret ; We're done 38325 000070'01 endif. 38326 38327 000070'01 302 07 0 00 000023 caie q3, .cmtok ;[255] Hokey CDUP talisman? 38328 000071'01 254 00 0 00 000101' ifskp. ;[255] Yes, transmogrify into a cdup 38329 000072'01 201 03 0 00 000000# movei t3, cdhack ;[255] Used to tweak different parse stream 38330 000073'01 200 02 0 00 000000* move t2, pars1 ;[255] Load first level parse block address 38331 000074'01 200 01 0 02 000000 move t1, (t2) ;[255] Load the syntax and semantic 38332 000075'01 541 01 0 00 001111' hrri t1, $ycdup ;[255] Override semantic action 38333 000076'01 202 01 0 03 000000 movem t1, (t3) ;[255] Store as a seperate parse block 38334 000077'01 202 03 0 00 000073* movem t3, pars1 ;[255] Override original parse block 38335 000100'01 254 00 0 00 001066' jrst .ycdp1 ;[255] And switch parsing over to cdup 38336 000101'01 endif. ;[255] End case ".." hack 38337 38338 000101'01 302 07 0 00 000016 caie q3, .cmdev ;[220] Parsed a device?? 38339 000102'01 254 00 0 00 000114' ifskp. ;[193] Yes (can't connect to DECtape) 38340 000103'01 200 01 0 00 000006 move t1, q2 ;[220] Let's check it 38341 000104'01 260 17 0 00 000000* call isnulj ;[193] Is it NUL:? 38342 000105'01 254 00 0 00 000114' anskp. ;[193] It isn't, must be some other odd thing 38343 000106'01 200 06 0 00 000001 move q2, t1 ;[220] It is, so remember that 38344 000107'01 260 17 0 00 000002* confrm ;[220] Confirm the line, do not allow .cmqst 38345 000110'01 124 06 0 00 000065* dmovem q2, pars3 ;[220] Pass both to semantic action 38346 000111'01 402 00 0 00 000066* setzm pars5 ;[220] No password string being passed 38347 000112'01 263 17 0 00 000000 ret ;[220] Done, skipping the .cmqst 38348 000113'01 254 00 0 00 000147' else. ;[220] Here if some other device 38349 000114'01 302 07 0 00 000016 caie q3, .cmdev ;[220] Are we here because of phonkey .cmdev? 38350 000115'01 254 00 0 00 000147' anskp. ;[220] No, it's a .cmdir, so that's fine 38351 000116'01 200 01 0 00 000006 move t1, q2 ;[220] Let's see if it can do files 38352 000117'01 260 17 0 00 005474' call isdird ;[220] See if this is a directory device 38353 000120'01 254 00 0 00 000125' ifskp. ;[220] It is, see what kind 38354 000121'01 135 03 0 00 006276' ldb t3,[pointr(t2,dv%typ)] ;[220] Load type 38355 000122'01 302 03 0 00 000000 caie t3, .dvdsk ;[220] Structure? 38356 000123'01 254 00 0 00 000125' anskp. ;[220] Can't connect to DECtape... 38357 000124'01 254 00 0 00 000144' else. ;[220] Not a disk based directory structure 38358 000125'01 200 01 0 00 000000# sxtext(t1,) ;[220] Initial part of error message 38359 000072'02 000000000000# 38360 000011'04 115 141 171 040 156 38361 000126'01 104 00 0 00 000313 ESOUT% ;[220] Begin whining 38362 000127'01 403 03 0 00 000004 setzb t3, t4 ;[220] Clear up some storage 38363 000130'01 561 01 0 00 000003 hrroi t1, t3 ;[220] Writing device name into registers 38364 000131'01 200 02 0 00 000006 move t2, q2 ;[220] Load device 38365 000132'01 104 00 0 00 000121 DEVST% ;[220] Write it 38366 000133'01 320 12 0 00 000135' ifje. r ;[220] Failed?? We just parsed it! 38367 000134'01 254 00 0 00 000137' 38368 000135'01 120 03 0 00 006277' dmove t3, [asciz /(error)/] ;[220] Stomp in something 38369 000136'01 254 00 0 00 000141' else. ;[220] Otherwise, worked 38370 000137'01 201 02 0 00 000072 movei t2, ":" ;[220] Load terminating device punctuation 38371 000140'01 136 02 0 00 000001 idpb t2, t1 ;[220] Take on the end, rest of word is .chnul's k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4-2 K20SRV MAC 9-Aug-24 12:55 CWD command 38372 000141'01 endif. ;[220] End case DEVST% handling 38373 000141'01 561 01 0 00 000003 hrroi t1, t3 ;[220] Point to t3 again 38374 000142'01 104 00 0 00 000076 PSOUT% ;[220] Blat that out, too 38375 000143'01 254 00 0 00 000000* callret cmder1 ;[220] Allow a reparse, however 38376 000144'01 endif. ;[220] End case acceptable directory analysis 38377 000144'01 260 17 0 00 000174' call defdir ;[220] Try to default the directory on the structure 38378 000145'01 254 00 0 00 000143* callret cmder1 ;[220] Couldn't... Allow reparse 38379 000146'01 201 07 0 00 000011 movei q3, .cmdir ;[220] Pretend they typed the directory 38380 000147'01 endif. ;[193] End case parsed a device 38381 38382 remark .cmdir ;[220] At this point, we know the directory exists 38383 000147'01 200 01 0 00 000006 move t1, q2 ;[220] Load the directory in question 38384 000150'01 260 17 0 00 000653' call pwconp ;[220] Do we need a password to get to this? 38385 000151'01 254 00 0 00 000156' ifskp. ;[220] No, so do not parse for a quoted string 38386 000152'01 260 17 0 00 000107* confrm ;[220] Just confirm the command 38387 000153'01 124 06 0 00 000110* dmovem q2, pars3 ;[220] Pass directory and parse type to semantic action 38388 000154'01 402 00 0 00 000111* setzm pars5 ;[220] No password string being passed 38389 000155'01 263 17 0 00 000000 ret ;[220] And we're done 38390 000156'01 endif. ;[220] 38391 38392 remark ;[220] May need a password, so allow a parse for that 38393 000156'01 201 01 0 00 000000# movei t1, ypwfdb ;[220] Allow a password on the same line 38394 000157'01 260 17 0 00 000056* call rfield ;[220] See if they want the password right now 38395 000160'01 135 03 0 00 006275' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 38396 38397 000161'01 302 03 0 00 000010 caie t3, .cmcfm ;[220] Didn't specify anything? 38398 000162'01 254 00 0 00 000166' ifskp. ;[220] Nope, so we're done with the parse 38399 000163'01 124 06 0 00 000153* dmovem q2, pars3 ;[220] Pass directory and parse type to semantic action 38400 000164'01 402 00 0 00 000154* setzm pars5 ;[220] No password string being passed 38401 000165'01 263 17 0 00 000000 ret ;[220] And get out of here 38402 000166'01 endif. ;[220] End case no string parsed 38403 38404 000166'01 260 17 0 00 000152* confrm ; Get confirmation. 38405 000167'01 124 06 0 00 000163* dmovem q2, pars3 ;[220] Pass directory and parse type to semantic action 38406 000170'01 201 01 0 00 000000* movei t1, atmbuf ;[220] Load address of the atom buffer 38407 000171'01 505 01 0 00 440700 hrli t1, () ;[220] Turn into a local pointer 38408 000172'01 202 01 0 00 000164* movem t1, pars5 ;[220] Flag that we are passing in a password 38409 000173'01 263 17 0 00 000000 ret 38410 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20SRV MAC 9-Aug-24 12:55 Vestigial Echoing code 38411 subttl Vestigial Echoing code 38412 38413 comment " ;[220] Removed because it got too hairy on a reparse 38414 ifmn. takdep ;[220] Are we in a take file? 38415 setz q5, ;[220] We are, flag that 38416 else. ;[220] Aren't; so monkey with terminal mode 38417 seto q5, ;[220] Let's assume not in a take file 38418 remark cm%wkf ;[220] Maybe tweak this? 38419 endif. 38420 38421 remark ... 38422 38423 ifn. q5 ;[220] Not in a take file? 38424 skipg t1, ttyjfn ;[220] This terminal 38425 anskp. ;[220] We don't have one, don't do this 38426 RFMOD% ;[220] Pull its mode word 38427 annje. ;[220] Punt the rest if this fails 38428 txz t2, tt%osp ;[220] Clear control-O so prompt comes out 38429 move q5, t2 ;[220] And save it 38430 txz t2, tt%eco ;[220] Turn off echoing. 38431 SFMOD% ;[220] Try doing it ... 38432 annje. ;[220] Punt the rest if this fails 38433 remark ;[220] At this point, echo is off 38434 else. ;[220] Otherwise, q5 is zero or should be 38435 setz q5, ;[220] If here because of error, disallow 38436 endif. ;[220] 38437 38438 remark ... 38439 38440 ifn. q5 ;[220] Hacking terminal modes? 38441 push p, t1 ;[220] Save temporaries around SFMOD% 38442 push p, t2 ;[220] it wants t1 and t2 38443 move t1, ttyjfn ;[220] Load terminal JFN 38444 move t2, q5 ;[220] and whatever we saved 38445 SFMOD% ;[220] Restore TTY to normal echoing. 38446 %jserr (,) ;[220] Carry on 38447 pop p, t2 ;[220] Restore temporaries SFMOD% used 38448 pop p, t1 ;[220] it wanted t1 and t2 38449 endif. ;[220] End case mode detweak 38450 38451 ";;comment k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20SRV MAC 9-Aug-24 12:55 Default a directory on a structure 38452 subttl Default a directory on a structure 38453 38454 ;[220] Begin code insertion 38455 38456 ; Largely unnecessary, as Tops-20 will do this for domestic structures. 38457 38458 000174'01 265 16 0 00 006301' defdir: saveac ; Needs two index registers 38459 000175'01 265 16 0 00 000000* anstkv (q3,dirmxw) ; Place to build the default directory 38460 000176'01 000000 000012 38461 000177'01 415 07 0 17 777765 38462 000200'01 265 16 0 00 000175* anstkv (q4,dirmxw) ; Place to put currently connected directory 38463 000201'01 000000 000012 38464 000202'01 415 10 0 17 777765 38465 38466 000203'01 201 01 0 00 000011 movx t1, ; Length of area in words 38467 000204'01 200 02 0 00 000007 move t2, q3 ; First address in area 38468 000205'01 201 03 0 02 000001 movei t3, 1(t2) ; Doing a cascade xblt 38469 000206'01 402 00 0 02 000000 setzm (t2) ; Zero first word 38470 000207'01 123 01 0 00 006313' xblt. t1 ; Clear the rest of the area 38471 38472 000210'01 560 01 0 00 000007 hrro t1, q3 ; Build Tops-20 pointer to area 38473 000211'01 200 02 0 00 000006 move t2, q2 ; Load device 38474 000212'01 104 00 0 00 000121 DEVST% ; Construct first part of defaulted directory 38475 000213'01 320 12 0 00 000215' %jserr (,r) 38476 000214'01 254 00 0 00 000220' 38477 000215'01 265 01 0 00 000031* 38478 000216'01 000000000000# 38479 000217'01 254 00 0 00 000000* 38480 000015'04 125 156 141 142 154 38481 000220'01 200 11 0 00 000001 move q5, t1 ; Save the final pointer for appending 38482 38483 000221'01 201 01 0 00 000011 movx t1, ; Length of area in words 38484 000222'01 200 02 0 00 000010 move t2, q4 ; First address in area 38485 000223'01 201 03 0 02 000001 movei t3, 1(t2) ; Doing a cascade xblt 38486 000224'01 402 00 0 02 000000 setzm (t2) ; Zero first word 38487 000225'01 123 01 0 00 006313' xblt. t1 ; Clear the rest of the area 38488 38489 000226'01 560 01 0 00 000010 hrro t1, q4 ; Build Tops-20 pointer to area 38490 000227'01 200 02 0 00 000000# move t2, .jidno+jobtab ; Load currently connected directory 38491 000230'01 104 00 0 00 000041 DIRST% ; Render as a string 38492 000231'01 320 12 0 00 000233' %jserr (,r) 38493 000232'01 254 00 0 00 000236' 38494 000233'01 265 01 0 00 000215* 38495 000234'01 000000000000# 38496 000235'01 254 00 0 00 000217* 38497 000027'04 125 156 141 142 154 38498 38499 000236'01 200 02 0 00 000010 move t2, q4 ; Load address of connected directory string 38500 000237'01 505 02 0 00 440700 hrli t2, () ; Turn into a local pointer 38501 38502 000240'01 do. ; Enter loop context to find end of device 38503 000240'01 134 03 0 00 000002 ildb t3, t2 ; Pick up a byte 38504 000241'01 306 03 0 00 000072 cain t3, ":" ; Hit the colon? 38505 000242'01 254 00 0 00 000252' exit. ; We did, break out of the loop 38506 000243'01 326 03 0 00 000251' ife. t3 ; Sanity check k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6-1 K20SRV MAC 9-Aug-24 12:55 Default a directory on a structure 38507 000244'01 334 01 0 00 000000# ermsg% (,r) 38508 000245'01 254 00 0 00 000251' 38509 000246'01 202 01 0 00 000000* 38510 000247'01 104 00 0 00 000313 38511 000250'01 254 00 0 00 000235* 38512 000073'02 000000000000# 38513 000041'04 113 105 122 115 111 38514 38515 000251'01 endif. ; End check 38516 000251'01 254 00 0 00 000240' loop. ; Try next character 38517 000252'01 enddo. ; End loop lexical context 38518 38519 000252'01 200 01 0 00 000011 move t1, q5 ; Load end of device 38520 38521 000253'01 do. ; Enter loop context to copy over the directory 38522 000253'01 136 03 0 00 000001 idpb t3, t1 ; Deposit into new device string 38523 000254'01 306 03 0 00 000076 cain t3, .chrpt ; Hit the right pointy bracket? 38524 000255'01 254 00 0 00 000260' exit. ; We did, so we're done 38525 000256'01 134 03 0 00 000002 ildb t3, t2 ; Pick next byte of source connected directory 38526 000257'01 254 00 0 00 000253' loop. ; Deposit it and get next byte 38527 000260'01 enddo. ; End loop lexical context 38528 38529 000260'01 400 03 0 00 000000 setz t3, ; Cons up a .chnul 38530 000261'01 136 03 0 00 000001 idpb t3, t1 ; Tie off the proposed default directory 38531 ; Now see if it exists.. 38532 000262'01 205 01 0 00 000001 movx t1, rc%emo ; Therefore, exact-match, only 38533 000263'01 560 02 0 00 000007 hrro t2, q3 ; Build Tops-20 pointer to candidate 38534 000264'01 400 03 0 00 000000 setz t3, ; Not doing any stepping, but... 38535 000265'01 104 00 0 00 000553 RCDIR% ; See if it exists 38536 000266'01 320 12 0 00 000270' %jserr (,r) 38537 000267'01 254 00 0 00 000273' 38538 000270'01 265 01 0 00 000233* 38539 000271'01 000000000000# 38540 000272'01 254 00 0 00 000250* 38541 000053'04 106 141 151 154 165 38542 000273'01 607 01 0 00 040000 ifxn. t1, rc%nom ; Doesn't exist? We surely can't connect... 38543 000274'01 254 00 0 00 000303' 38544 000275'01 560 01 0 00 000007 hrro t1, q3 ; Load pointer to our created directory 38545 000276'01 104 00 0 00 000313 ESOUT% ; Begin complaining 38546 000277'01 200 01 0 00 000000# txmsg (< does not exist, so can't be used as a default>) 38547 000300'01 104 00 0 00 000076 38548 000301'01 320 12 0 00 000302' 38549 000074'02 000000000000# 38550 000064'04 040 144 157 145 163 38551 000302'01 263 17 0 00 000000 ret ; Return +1 38552 000303'01 endif. 38553 38554 000303'01 200 06 0 00 000003 move q2, t3 ; Pretend they asked for this 38555 000304'01 254 00 0 00 000000* retskp ; Have a default 38556 38557 ;[220] End code insertion 38558 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20SRV MAC 9-Aug-24 12:55 Update GETJI% information from GJINV% 38559 subttl Update GETJI% information from GJINV% 38560 38561 ;[220] Begin code insertion 38562 38563 000305'01 udjinf: entry udjinf ; Also used by k20mit 38564 000305'01 265 16 0 00 006314' saveac ; Only side-effect storage, not accumulators 38565 38566 000306'01 104 00 0 00 000013 GJINF% ; Faster than GETJI% and always works 38567 remark t1,.jiuno+jobtab ; User number will NEVER change; no SETUID. 38568 000307'01 202 02 0 00 000000# movem t2, .jidno+jobtab ; Connected directory, which CWD changes 38569 remark t3,.jijno+jobtab ; Job number will NEVER change during execution 38570 000310'01 202 04 0 00 000000# movem t4, .jitno+jobtab ; Update current controlling terminal 38571 000311'01 263 17 0 00 000000 ret ; Always works, so return +1, always 38572 38573 ;[220] End code insertion 38574 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20SRV MAC 9-Aug-24 12:55 GETPAS -- Get a password from the terminal or file 38575 subttl GETPAS -- Get a password from the terminal or file 38576 38577 ; Call: 38578 ; 38579 ; t1/ Length of password buffer (in characters) 38580 ; t2/ Pointer to password buffer 38581 ; 38582 ; Return: 38583 ; 38584 ; +1, Some kind of failure 38585 ; +2, Got some text: 38586 ; 38587 ; t1/ Password length (in characters) 38588 ; t2/ Updated to end of password 38589 ; 38590 ; Other accumulators are unmodified 38591 ; 38592 ; Performs the following: 38593 ; 38594 ; If invoked from a TAKE file, reads the password from the file, 38595 ; using end of line as the ending delimiter. 38596 ; 38597 ; Otherwise: 38598 ; 38599 ; 1) Prompts for password, 38600 ; 2) Turns off echoing during typein, 38601 ; 3) Restores echoing 38602 ; 4) Returns with result in buffer 38603 ; 38604 ; smashes t1-t4, others preserved 38605 ; 38606 ; Partially rewritten as part of [194] for better security 38607 38608 ; In TEXT, not ETEXT because brain damaged RDTTY% can not handle the 38609 ; OWGP that PSOUT% has just typed. The RDCBP routine in COMND% only 38610 ; allows OWGP's from a non-zero section. Bogus... 38611 38612 chgsec(code,text) ;[220] Section zero text, sigh... 38613 000124'03 040 120 141 163 163 pwdprm: asciz / Password: / ;[220] Prompt for when requesting passwords 38614 retsec ;[220] Back into mainline code 38615 38616 000312'01 getpas: extern takdep, takjfn ;[194] and of our necessaries 38617 000312'01 327 01 0 00 000320' ifle. t1 ;[194] You're kidding, right? 38618 000313'01 334 01 0 00 000000# ermsg% (,r) ;[194] 38619 000314'01 254 00 0 00 000320' 38620 000315'01 202 01 0 00 000246* 38621 000316'01 104 00 0 00 000313 38622 000317'01 254 00 0 00 000272* 38623 000075'02 000000000000# 38624 000076'04 113 105 122 115 111 38625 38626 000320'01 endif. ;[194] Useless to go further 38627 ;[194] Otherwise, got a positive length 38628 000320'01 265 16 0 00 006326' saveac ;[194] 38629 000321'01 303 01 0 00 000047 caile t1, mxpwlc ;[194] Maximum than Tops-20 will do? k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-1 K20SRV MAC 9-Aug-24 12:55 GETPAS -- Get a password from the terminal or file 38630 000322'01 201 01 0 00 000047 movx t1, mxpwlc ;[194] Yes, clip it down 38631 000323'01 120 05 0 00 000001 dmove q1, t1 ;[194] Save the calling parameters 38632 000324'01 231 01 0 00 000005 idivi t1, ^d5 ;[194] Convert from characters to words 38633 000325'01 322 02 0 00 000327' ifn. t2 ;[194] Any remainder? 38634 000326'01 271 01 0 00 000001 addi t1, ^d1 ;[194] Yes, round up a word 38635 000327'01 endif. ;[194] 38636 000327'01 200 07 0 00 000001 move q3, t1 ;[194] Store final length 38637 000330'01 550 02 0 00 000006 hrrz t2, q2 ;[194] Load word address of password buffer 38638 000331'01 260 17 0 00 000500' call scrubp ;[194] Clobber it, first 38639 38640 000332'01 336 00 0 00 000000* ifmn. takdep ;[194] ;[178] Do specially for TAKE files 38641 000333'01 254 00 0 00 000362' 38642 000334'01 200 01 0 00 000000* move t1, takjfn ; Read line from the TAKE file 38643 000335'01 120 02 0 00 000006 dmove t2, q2 ;[194] Into buffer, clipping maximum 38644 000336'01 201 04 0 00 000012 movei t4, .CHLFD ; terminate on linefeed. 38645 000337'01 104 00 0 00 000052 SIN 38646 000340'01 320 12 0 00 000342' %jserr (,r) ;[194] 38647 000341'01 254 00 0 00 000345' 38648 000342'01 265 01 0 00 000270* 38649 000343'01 000000000000# 38650 000344'01 254 00 0 00 000317* 38651 000113'04 107 145 164 040 160 38652 000345'01 474 01 0 00 000000 seto t1, ;[194] Let's investigate the read 38653 000346'01 133 01 0 00 000002 adjbp t1, t2 ;[194] Decrement the returned byte pointer. 38654 000347'01 135 04 0 00 000001 ldb t4, t1 ;[194] Load the previous character 38655 000350'01 302 04 0 00 000015 caie t4, .chcrt ;[194] Better have been a carriage return 38656 000351'01 263 17 0 00 000000 ret ;[194] It wasn't, so fail the call 38657 000352'01 400 04 0 00 000000 setz t4, ; Write a zero over the terminating CR. 38658 000353'01 137 04 0 00 000001 dpb t4, t1 38659 000354'01 136 04 0 00 000001 idpb t4, t1 ; And linefeed. 38660 000355'01 200 01 0 00 000005 move t1, q1 ;[194] Load original length 38661 000356'01 271 03 0 00 000002 addi t3, ^d2 ;[194] Account for .chcrt and .chlfd we pitched 38662 000357'01 274 01 0 00 000003 sub t1, t3 ;[194] Subtract what we didn't read, yielding length 38663 000360'01 200 02 0 00 000006 move t2, q2 ;[194] ; Return pointer to password. 38664 000361'01 254 00 0 00 000304* retskp ;[194] ;[178] Won!! 38665 000362'01 endif. ;[194] 38666 38667 remark ;[194] Otherwise, user has to type something 38668 000362'01 201 01 0 00 000100 movei t1, .priin ; Get TTY mode word 38669 000363'01 104 00 0 00 000107 RFMOD 38670 000364'01 320 12 0 00 000366' %jserr (,r) ;[194] 38671 000365'01 254 00 0 00 000371' 38672 000366'01 265 01 0 00 000342* 38673 000367'01 000000000000# 38674 000370'01 254 00 0 00 000344* 38675 000124'04 107 145 164 040 160 38676 000371'01 621 02 0 00 400000 txz t2, tt%osp ;[194] Clear control-O so prompt comes out 38677 000372'01 202 02 0 00 000010 movem t2, q4 ;[194] And save it 38678 000373'01 620 02 0 00 004000 txz t2, tt%eco ; Turn off echoing. 38679 000374'01 104 00 0 00 000110 SFMOD 38680 000375'01 320 12 0 00 000377' %jserr (,r) ;[194] 38681 000376'01 254 00 0 00 000402' 38682 000377'01 265 01 0 00 000366* 38683 000400'01 000000000000# 38684 000401'01 254 00 0 00 000370* k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-2 K20SRV MAC 9-Aug-24 12:55 GETPAS -- Get a password from the terminal or file 38685 000136'04 107 145 164 040 160 38686 38687 000402'01 561 01 0 00 000000# hrroi t1, pwdprm ;[194] Issue first prompt. 38688 000403'01 104 00 0 00 000076 PSOUT 38689 000404'01 200 01 0 00 000006 move t1, q2 ;[194] Load pointer to password buffer 38690 000405'01 550 02 0 00 000005 hrrz t2, q1 ;[194] Load length of buffer 38691 000406'01 661 02 0 00 060100 txo t2, rd%bel!rd%crf!rd%sui ;[194] Break on .chcrt or .chlfd, suppress .chcrt 38692 000407'01 561 03 0 00 000000# hrroi t3, pwdprm ;[194] Prompt if ^R typed 38693 000410'01 104 00 0 00 000523 RDTTY 38694 000411'01 320 12 0 00 000413' ifje. r ;[194] Failed?? 38695 000412'01 254 00 0 00 000435' 38696 000413'01 200 04 0 00 000001 move t4, t1 ;[194] Save the error 38697 000414'01 200 01 0 00 000007 move t1, q3 ;[220] Load word length of buffer 38698 000415'01 550 02 0 00 000006 hrrz t2, q2 ;[220] Load word address of password buffer 38699 000416'01 260 17 0 00 000500' call scrubp ;[220] Ditch anything that we might have gotten 38700 000417'01 334 00 0 00 000000 %ermsg (,) ;[194] Begin complaining 38701 000420'01 254 00 0 00 000424' 38702 000421'01 265 01 0 00 000377* 38703 000422'01 000000000000# 38704 000423'01 254 00 0 00 000424' 38705 000146'04 107 145 164 040 160 38706 000424'01 201 01 0 00 000100 movei t1, .priin ;[194] Diddle primary input 38707 000425'01 200 02 0 00 000010 move t2, q4 ;[194] Load original mode word 38708 000426'01 104 00 0 00 000110 SFMOD% ;[194] Restore terminal to original mode 38709 000427'01 320 12 0 00 000431' %jserr (,) ;[194] 38710 000430'01 254 00 0 00 000434' 38711 000431'01 265 01 0 00 000421* 38712 000432'01 000000000000# 38713 000433'01 254 00 0 00 000434' 38714 000155'04 107 145 164 040 160 38715 000434'01 263 17 0 00 000000 ret ;[220] Fail the call 38716 000435'01 endif. ;[194] 38717 38718 000435'01 415 16 0 00 000452' block. ;[194] Get a stack frame 38719 000436'01 261 17 0 00 000016 38720 000437'01 265 16 0 00 006342' saveac ;[194] Preserve these over SFMOD% 38721 000440'01 201 01 0 00 000100 movei t1, .priin ;[194] Diddle primary input 38722 000441'01 200 02 0 00 000010 move t2, q4 ;[194] Load original mode word 38723 000442'01 104 00 0 00 000110 SFMOD ; Restore TTY to normal echoing. 38724 000443'01 320 12 0 00 000445' %jserr (,r) ;[194] 38725 000444'01 254 00 0 00 000450' 38726 000445'01 265 01 0 00 000431* 38727 000446'01 000000000000# 38728 000447'01 254 00 0 00 000401* 38729 000170'04 107 145 164 040 160 38730 000450'01 254 00 0 00 000361* retskp ;[194] Otherwise, worked 38731 000451'01 263 17 0 00 000000 endbk. ;[194] End of block context 38732 000452'01 600 00 0 00 000000 nop ;[220] Ignore error and carry on 38733 38734 000453'01 400 03 0 00 000000 setz t3, ;[194] Cons up a .chnul 38735 000454'01 137 03 0 00 000001 dpb t3, t1 ;[194] ; Write a zero over the terminating linefeed. 38736 000455'01 550 04 0 00 000002 hrrz t4, t2 ;[194] Pick up the remaining length 38737 000456'01 271 04 0 00 000001 addi t4, ^d1 ;[194] Account for linefeed we'll toss 38738 000457'01 274 05 0 00 000004 sub q1, t4 ;[194] Calculate length of password 38739 000460'01 200 06 0 00 000001 move q2, t1 ;[194] Save updated pointer k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8-3 K20SRV MAC 9-Aug-24 12:55 GETPAS -- Get a password from the terminal or file 38740 000461'01 510 04 0 00 000002 hllz t4, t2 ;[169] Remember flag bits that were returned. 38741 000462'01 561 01 0 00 000000* hrroi t1, crlf ;[194] Point to carriage return line feed 38742 000463'01 104 00 0 00 000076 PSOUT% ;[194] ; Echo the crlf that wasn't echoed. 38743 38744 000464'01 603 04 0 00 000040 ifxe. t4, rd%btm ;[194] Too long? 38745 000465'01 254 00 0 00 000476' 38746 000466'01 334 01 0 00 000000# ermsg% (,) ;[194] Complain 38747 000467'01 254 00 0 00 000472' 38748 000470'01 202 01 0 00 000315* 38749 000471'01 104 00 0 00 000313 38750 000076'02 000000000000# 38751 000202'04 113 105 122 115 111 38752 38753 000472'01 200 01 0 00 000007 move t1, q3 ;[220] Load word length of buffer 38754 000473'01 550 02 0 00 000006 hrrz t2, q2 ;[220] Load word address of password buffer 38755 000474'01 260 17 0 00 000500' call scrubp ;[220] Ditch anything that we might have gotten 38756 000475'01 263 17 0 00 000000 ret ;[220] Fail the call 38757 000476'01 endif. ;[194] 38758 38759 000476'01 120 01 0 00 000005 dmove t1, q1 ;[194] Load updated results 38760 000477'01 254 00 0 00 000450* retskp ;[194] And return them 38761 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20SRV MAC 9-Aug-24 12:55 Scrub the password buffer 38762 subttl Scrub the password buffer 38763 38764 ;[194] Begin code insertion 38765 38766 ; Call: 38767 ; 38768 ; t1/ Length of password buffer (in WORDS) 38769 ; t2/ Pointer to password buffer 38770 ; 38771 ; Returns: 38772 ; 38773 ; +1, always 38774 ; Stomps the buffer to all zeros, all AC's preserved 38775 38776 000500'01 323 01 0 00 000447* scrubp: jumple t1, r ; You're kidding, right? 38777 000501'01 265 16 0 00 006314' saveac ; Don't touch anything 38778 000502'01 200 04 0 02 000000 move t4, (t2) ; First of all, does the memory even exist? 38779 000503'01 320 12 0 00 000500* erjmpr r ; Nope, so nothing to scrub 38780 38781 000504'01 302 01 0 00 000001 caie t1, ^d1 ; Is the password really short? 38782 000505'01 254 00 0 00 000510' ifskp. ; Not a great idea, but easy enough to do 38783 000506'01 402 00 0 02 000000 setzm (t2) ; Scrub the buffer 38784 000507'01 263 17 0 00 000000 ret ; And we're done 38785 000510'01 endif. 38786 38787 remark ; Otherwise, doing two or more words 38788 000510'01 403 03 0 00 000004 setzb t3, t4 ; Cons up 10 .chnul's 38789 000511'01 124 03 0 02 000000 dmovem t3, (t2) ; Stomp at least that much 38790 000512'01 307 01 0 00 000002 caig t1, ^d2 ; Wanted to clear more than two words? 38791 000513'01 263 17 0 00 000000 ret ; No, then we're done 38792 38793 000514'01 275 01 0 00 000002 subi t1, ^d2 ; Account for two words cleared 38794 000515'01 415 03 0 02 000002 xmovei t3, 2(t2) ; Skip already cleared words 38795 000516'01 123 01 0 00 006313' xblt. t1 ; Clear the rest of the block 38796 000517'01 263 17 0 00 000000 ret ; Return all nice and tidy 38797 38798 ;[194] End code insertion 38799 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20SRV MAC 9-Aug-24 12:55 Execute the LOCAL CWD command. 38800 subttl Execute the LOCAL CWD command. 38801 38802 ;[171] Rewritten to only prompt for the password when necessary, as 38803 ; the Exec CONNECT command does, and to print the name of the 38804 ; directory connected to. 38805 ; 38806 ; First try to connect with no password. This returns immediately on 38807 ; error. 38808 ; 38809 ; [194] The previous sentence is no longer true; a connection attempt 38810 ; that fails will put the process to sleep so that it can not stay in 38811 ; a loop, trying passwords. Eventually, alerts will come out on the 38812 ; CTY. 38813 ; 38814 ; Thus, we try to guess whether we'll need a password with CHKAC% 38815 38816 000003 acabl==<.acjob+1> ; ACCES% argument block length 38817 38818 000520'01 $ycwd: entry $ycwd ;Invoked from k20par 38819 000520'01 265 16 0 00 006265' saveac ;[194] Used for anonymous stkvars 38820 000521'01 265 16 0 00 000200* anstkv (q1, ) ;[194] Argument block and password 38821 000522'01 000000 000013 38822 000523'01 415 05 0 17 777764 38823 000524'01 415 06 0 05 000003 xmovei q2, (q1) ;[194] Base of password buffer 38824 38825 000525'01 336 01 0 00 000167* skipn t1, pars3 ;[194] Load the directory (if there is one) 38826 000526'01 334 01 0 00 000000# ermsg% (,r) ;[194] 38827 000527'01 254 00 0 00 000533' 38828 000530'01 202 01 0 00 000470* 38829 000531'01 104 00 0 00 000313 38830 000532'01 254 00 0 00 000503* 38831 000077'02 000000000000# 38832 000211'04 113 105 122 115 111 38833 38834 000533'01 302 01 0 00 377777 caie t1, .nulio ;[193] Connecting to NUL:? 38835 000534'01 254 00 0 00 000537' ifskp. ;]193] We are, so do nothing 38836 000535'01 476 00 0 05 000000 setom .acdir(q1) ;[194] And impossible connected directory 38837 000536'01 254 00 0 00 000605' jrst $ycwdz ;[193] Continue as if we did something... 38838 000537'01 endif. ;[193] End NUL: special case 38839 000537'01 200 02 0 00 000000* move t2, pars4 ;[193] Load the parse type 38840 000540'01 306 02 0 00 000016 cain t2, .cmdev ;[193] Not a device, was it?? 38841 000541'01 254 00 0 00 000635' jrst cwdeve ;[193] Go handle a bogus connect device 38842 000542'01 400 02 0 00 000000 setz t2, ;[220] assume no password 38843 000543'01 124 01 0 05 000000 dmovem t1, .acdir(q1) ;[194] Store in block 38844 000544'01 476 00 0 05 000002 setom .acjob(q1) ;[194] Do the connect for this job 38845 38846 000545'01 336 00 0 00 000172* ifmn. pars5 ;[220] Did they already give us a password 38847 000546'01 254 00 0 00 000561' 38848 000547'01 201 01 0 00 000010 movx t1, mxpwlw ;[220] Load length of password buffer 38849 000550'01 550 02 0 00 000545* hrrz t2, pars5 ;[220] Load section local address of where it was parsed 38850 000551'01 200 03 0 00 000006 move t3, q2 ;[220] and the address of the password buffer 38851 000552'01 123 01 0 00 006313' xblt. t1 ;[220] Transfer it 38852 remark ;[220] This is wrong if the password isn't in atmbuf 38853 dmove t1, [ atmbln ;[220] Load length of atom buffer again 38854 000553'01 120 01 0 00 006352' atmbuf ] ;[220] and the address of atom buffer k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-1 K20SRV MAC 9-Aug-24 12:55 Execute the LOCAL CWD command. 38855 000554'01 260 17 0 00 000500' call scrubp ;[220] Scrub any password text out of it 38856 000555'01 550 02 0 00 000006 hrrz t2, q2 ;[220] Load address of password buffer 38857 000556'01 505 02 0 00 440700 hrli t2,() ;[220] Turn into a local pointer 38858 000557'01 202 02 0 05 000001 movem t2, .acpsw(q1) ;[220] Store in access argument block 38859 000560'01 254 00 0 00 000575' jrst $ycwdy ;[220] Skip access check and first attempt 38860 000561'01 endif. ;[220] End case password already specified 38861 38862 000561'01 260 17 0 00 000653' call pwconp ;[194] Can we connect without a password? 38863 000562'01 254 00 0 00 000570' jrst $ycwdx ;[194] No, go get one 38864 000563'01 200 01 0 00 006354' movx t1, ac%con!acabl ;[194] Ask for connect function,,arg block length 38865 000564'01 200 02 0 00 000005 move t2, q1 ;[194] Load address of argument block 38866 000565'01 104 00 0 00 000552 ACCES ; Try to connect. 38867 000566'01 320 12 0 00 000570' erjmpr $ycwdx ; If error, go prompt for password. 38868 000567'01 254 00 0 00 000605' jrst $ycwdz ; Connected OK, exit. 38869 38870 ; Handle error by prompting for password and then trying to connect again. 38871 38872 000570'01 120 01 0 00 006355' $ycwdx: dmove t1, [ exp mxpwlc,] ;[194] Load length and byte size 38873 000571'01 540 02 0 00 000006 hrr t2, q2 ;[194] Now have an ASCII pointer to password buffer 38874 000572'01 202 02 0 05 000001 movem t2, .acpsw(q1) ;[194] Store in access argument block 38875 000573'01 260 17 0 00 000312' call getpas ; Ask for password. 38876 000574'01 263 17 0 00 000000 ret ;[194] Return failure 38877 000575'01 200 01 0 00 006354' $ycwdy: movx t1, ac%con!acabl ;[194] Ask for connect function,,arg block length 38878 000576'01 200 02 0 00 000005 move t2, q1 ;[194] Load address of argument block 38879 000577'01 104 00 0 00 000552 ACCES ;[194] Failure here will trigger a wait 38880 000600'01 320 12 0 00 000602' %jserr (,) ;[194] On failure, whine and continue 38881 000601'01 254 00 0 00 000605' 38882 000602'01 265 01 0 00 000445* 38883 000603'01 000000000000# 38884 000604'01 254 00 0 00 000605' 38885 000225'04 103 127 104 040 146 38886 38887 ; At this point, done either way, whether succeeded or not 38888 38889 000605'01 201 01 0 00 000010 $ycwdz: movx t1, mxpwlw ;[194] Load maximum password length, words 38890 000606'01 200 02 0 00 000006 move t2, q2 ;[194] Load address of password buffer 38891 000607'01 260 17 0 00 000500' call scrubp ;[194] Scrub any password text out of it 38892 38893 000610'01 201 01 0 00 000133 movei t1, "[" ;[194] Begin message 38894 000611'01 104 00 0 00 000074 PBOUT ;[194] 38895 000612'01 104 00 0 00 000013 GJINF% ;[194] Get job information 38896 000613'01 202 02 0 00 000000# movem t2, jobtab+.jidno ;[194] Remember for future reference. 38897 000614'01 312 02 0 05 000000 came t2, .acdir(q1) ;[194] Did we go where we wanted? 38898 000615'01 254 00 0 00 000622' ifskp. ;[194] Yes, advise of such 38899 000616'01 200 01 0 00 000000# txmsg ;[194] Print what we're connected to. 38900 000617'01 104 00 0 00 000076 38901 000620'01 320 12 0 00 000621' 38902 000100'02 000000000000# 38903 000232'04 103 157 156 156 145 38904 000621'01 254 00 0 00 000625' else. ;[194] Otherwise, say nothing happened 38905 000622'01 200 01 0 00 000000# txmsg ;[194] 38906 000623'01 104 00 0 00 000076 38907 000624'01 320 12 0 00 000625' 38908 000101'02 000000000000# 38909 000235'04 122 145 155 141 151 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-2 K20SRV MAC 9-Aug-24 12:55 Execute the LOCAL CWD command. 38910 000625'01 endif. ;[194] 38911 000625'01 201 01 0 00 000101 movei t1, .priou 38912 000626'01 104 00 0 00 000041 DIRST 38913 000627'01 320 12 0 00 000630' erjmpr .+1 ;[194] 38914 000630'01 201 01 0 00 000135 movei t1, "]" 38915 000631'01 104 00 0 00 000074 PBOUT 38916 000632'01 561 01 0 00 000462* hrroi t1, crlf ;[194] Tie off the line 38917 000633'01 104 00 0 00 000076 PSOUT% ;[194] 38918 000634'01 263 17 0 00 000000 ret 38919 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20SRV MAC 9-Aug-24 12:55 Here to handle some bogus connect device 38920 subttl Here to handle some bogus connect device 38921 38922 ; t1/ device designator 38923 ; t2/ parsed function code 38924 38925 000635'01 200 02 0 00 000001 cwdeve: move t2, t1 ;[193] Save device designator 38926 000636'01 403 03 0 00 000004 setzb t3, t4 ;[193] Cons up ten nulls 38927 000637'01 124 03 0 06 000000 dmovem t3, (q2) ;[193] Scrub the buffer 38928 000640'01 561 01 0 06 000000 hrroi t1, (q2) ;[193] Point to buffer 38929 000641'01 104 00 0 00 000121 DEVST% ;[193] Convert devie to a string 38930 000642'01 320 14 0 00 000643' erjmps .+1 ;[193] Catch and suppress error 38931 000643'01 561 01 0 06 000000 hrroi t1, (q2) ;[193] Point to buffer 38932 000644'01 104 00 0 00 000313 ESOUT% ;[194] Begin blatting at user 38933 000645'01 320 12 0 00 000646' erjmpr .+1 ;[194] Catch and ignore error 38934 txmsg <: is not a file structure, so can't connect to it. 38935 000646'01 200 01 0 00 000000# > ;[193] Rest of the blat 38936 000647'01 104 00 0 00 000076 38937 000650'01 320 12 0 00 000651' 38938 000102'02 000000000000# 38939 000242'04 072 040 151 163 040 38940 38941 000651'01 124 03 0 06 000000 dmovem t3,(q2) ;[193] Scrub again 38942 000652'01 263 17 0 00 000000 ret ;[193] Return from failure 38943 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20SRV MAC 9-Aug-24 12:55 Can we do a passwordless connect to a directory? 38944 subttl Can we do a passwordless connect to a directory? 38945 38946 ;[194] Begin code insertion 38947 ; 38948 ; Call: 38949 ; 38950 ; t1/ Directory (number) to connect to 38951 ; 38952 ; Return: 38953 ; 38954 ; +1, t1/ Has a zero if can't connect 38955 ; t2/ Zero if CHKAC% succeed or last error 38956 ; t1/ Has last error code if we failed the CHKAC% 38957 ; 38958 ; +2, t1/ Negative one 38959 ; t2/ Zero 38960 ; 38961 ; Smashes t1-t4 38962 38963 000653'01 265 16 0 00 000521* pwconp: anstkv(t4,<.ckapr+1>) ; Allocate an argument block 38964 000654'01 000000 000006 38965 000655'01 415 04 0 17 777771 38966 38967 000656'01 474 02 0 00 000000 seto t2, ; Request complete file access (everything) 38968 000657'01 124 01 0 04 000004 dmovem t1, .ckaud(t4) ; Store with directory number in argument block 38969 000660'01 200 01 0 00 000000# move t1, jobtab+.jidno ; Load currently connected directory 38970 000661'01 200 02 0 00 000000# move t2, mycaps+1 ; Load my enabled capabilities 38971 000662'01 124 01 0 04 000002 dmovem t1, .ckacd(t4) ; Store in argument block 38972 000663'01 201 01 0 00 000010 movx t1, .ckacn ; Checking for connect access 38973 000664'01 200 02 0 00 000000# move t2, jobtab+.jiuno ; Load my login user number 38974 000665'01 124 01 0 04 000000 dmovem t1, .ckaac(t4) ; Store in argument block 38975 38976 000666'01 201 01 0 00 000006 movx t1, <.ckapr+1> ; Load length of block 38977 000667'01 200 02 0 00 000004 move t2, t4 ; Load address of block 38978 000670'01 104 00 0 00 000521 CHKAC% ; See if we can do anything 38979 000671'01 320 12 0 00 000673' ifje. r ; Failed?? 38980 000672'01 254 00 0 00 000676' 38981 000673'01 200 02 0 00 000001 move t2, t1 ; Return the error 38982 000674'01 400 01 0 00 000000 setz t1, ; Say we can't access it 38983 000675'01 254 00 0 00 000677' else. ; Otherwise, JSYS worked 38984 000676'01 400 02 0 00 000000 setz t2, ; In which case there is no error code 38985 000677'01 endif. 38986 38987 000677'01 322 01 0 00 000532* jumpe t1, r ; If zero, then return +1 38988 000700'01 254 00 0 00 000477* retskp ; Otherwise, won!! 38989 38990 ;[194] End code insertion 38991 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20SRV MAC 9-Aug-24 12:55 REMOTE CWD Parsing 38992 subttl REMOTE CWD Parsing 38993 38994 ;[106] Parsing and execution all for Edit 106 38995 38996 ;N.B., all the extra scrubbing being done here is to try to enhance 38997 ; security by getting rid of any password remnants. 38998 38999 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 39000 000103'02 010004 000106' xcwfdb: flddb. .cmcfm,,,,,xcwfd1 39001 000104'02 000000 000000 39002 000105'02 44 07 0 00 000445' 39003 000106'02 021004 000111' xcwfd1: flddb. .cmqst,,,,,xcwfd2 39004 000107'02 000000 000000 39005 000110'02 44 07 0 00 000455' 39006 000111'02 017004 000000 xcwfd2: flddb. .cmtxt,,,,, 39007 000112'02 000000 000000 39008 000113'02 44 07 0 00 000455' 39009 000114'02 010004 000117' xpwfdb: flddb. .cmcfm,,,,,xpwfd1 39010 000115'02 000000 000000 39011 000116'02 44 07 0 00 000463' 39012 000117'02 021004 000122' xpwfd1: flddb. .cmqst,,,,,xpwfd2 39013 000120'02 000000 000000 39014 000121'02 44 07 0 00 000472' 39015 000122'02 017004 000000 xpwfd2: flddb. .cmtxt,,,,, 39016 000123'02 000000 000000 39017 000124'02 44 07 0 00 000472' 39018 retsec ;;Get back to wherever we came from 39019 cleans() 39020 39021 000701'01 265 16 0 00 006357' .xcwd: saveac ;[220] Necessary for intermediate parse results 39022 39023 remark ;[220] Note, these lengths are for foreign directories 39024 000702'01 120 01 0 00 006371' dmove t1, [exp fdrmxw,dirbuf] 39025 000703'01 260 17 0 00 000500' call scrubp ;[194] Scrub the directory buffer 39026 000704'01 120 01 0 00 006373' dmove t1, [exp fpwmxw,pasbuf] 39027 000705'01 260 17 0 00 000500' call scrubp ;[194] Scrub the password buffer 39028 39029 remark ;[220] First get directory, if specified 39030 000706'01 200 16 0 00 000000# guide ; Issue guide words. 39031 000707'01 260 17 0 00 000054* 39032 000125'02 000000000000# 39033 000255'04 164 157 040 144 151 39034 000710'01 201 01 0 00 000000# movei t1, xcwfdb ;[220] Allow a quote of the remote directory 39035 000711'01 260 17 0 00 000157* call rfield ;[220] Parse something 39036 000712'01 120 05 0 00 000001 dmove q1, t1 ;[220] Store parse results 39037 000713'01 135 07 0 00 006275' ldb q3, [pointr (.cmfnp(t3),cm%fnc)] ;[220] Get function code 39038 000714'01 302 07 0 00 000010 caie q3, .cmcfm ;[241] Was it a bare confirm? 39039 000715'01 254 00 0 00 000721' ifskp. ;[241] Yes, let's not return gubbish 39040 000716'01 120 01 0 00 006375' dmove t1, [exp atmbln,atmbuf] 39041 000717'01 260 17 0 00 000500' call scrubp ;[241] Don't send anything to remote system!! 39042 000720'01 263 17 0 00 000000 ret ;[241] Return, taking default (with no password) 39043 000721'01 endif. ;[241] End case bare confirm 39044 39045 remark ;[220] BUT!! Did they actually type anything?? 39046 000721'01 200 02 0 00 006377' move t2, [point 7, atmbuf] ;[220] Let's see what they did k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13-1 K20SRV MAC 9-Aug-24 12:55 REMOTE CWD Parsing 39047 000722'01 134 01 0 00 000002 ildb t1, t2 ;[220] Pick up the first byte 39048 000723'01 306 01 0 00 000015 cain t1, .chcrt ;[241] Bare carriage return? 39049 000724'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39050 000725'01 306 01 0 00 000012 cain t1, .chlfd ;[241] Bare linefeed? 39051 000726'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39052 000727'01 326 01 0 00 000734' ife. t1 ;[220] They didn't, so still using default area 39053 000730'01 260 17 0 00 000166* confrm ;[220] Line needs to be confirmed, however 39054 000731'01 120 01 0 00 006400' dmove t1, [exp atmbln,atmbuf] 39055 000732'01 260 17 0 00 000500' call scrubp ;[241] Don't send anything to remote system!! 39056 000733'01 263 17 0 00 000000 ret ;[220] We're done; not sending a directory 39057 000734'01 endif. ;[220] or its related password 39058 39059 000734'01 201 01 0 00 000141 movx t1, fdrmxw ;[220] Load maximum length of foreign directory 39060 dmove t2, [ atmbuf ;[220] Source is atom buffer 39061 000735'01 120 02 0 00 006402' dirbuf ] ;[220] Destination is foreign 39062 000736'01 123 01 0 00 006313' xblt. t1 ;[220] Store for semantic action 39063 000737'01 201 01 0 00 000000# movei t1, dirbuf ;[220] Load address of foreign directory 39064 000740'01 505 01 0 00 440700 hrli t1,() ;[220] Turn into a local pointer 39065 000741'01 202 01 0 00 000525* movem t1, pars3 ;[220] Store for semantic action 39066 39067 remark ;[220] Second, get password, one way or another 39068 ;;;; remark shut off echoing here like exec? 39069 000742'01 201 01 0 00 000000# movei t1, xpwfdb ;[220] Allow a quote of the remote directory 39070 000743'01 260 17 0 00 000711* call rfield ;[220] Parse something 39071 000744'01 120 05 0 00 000001 dmove q1, t1 ;[220] Store parse results 39072 000745'01 135 07 0 00 006275' ldb q3, [pointr (.cmfnp(t3),cm%fnc)] ;[220] Get function code 39073 ;;;; remark turn back on, but only if not in take file 39074 39075 000746'01 306 07 0 00 000010 cain q3, .cmcfm ;[220] Was it a confirm? 39076 000747'01 254 00 0 00 000773' jrst .xcwd1 ;[220] It was, so specifying password on next line 39077 39078 remark ;[220] BUT!! Did they type anything?? 39079 000750'01 200 02 0 00 006377' move t2, [point 7, atmbuf] ;[220] Let's see what they did 39080 000751'01 134 01 0 00 000002 ildb t1, t2 ;[220] Pick up the first byte 39081 000752'01 306 01 0 00 000015 cain t1, .chcrt ;[241] Bare carriage return? 39082 000753'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39083 000754'01 306 01 0 00 000012 cain t1, .chlfd ;[241] Bare linefeed? 39084 000755'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39085 000756'01 326 01 0 00 000763' ife. t1 ;[220] Did they do a "" for no password? 39086 000757'01 260 17 0 00 000730* confrm ;[220] They did; still needs to be confirmed 39087 000760'01 120 01 0 00 006404' dmove t1, [exp atmbln,atmbuf] 39088 000761'01 260 17 0 00 000500' call scrubp ;[241] Don't send anything to remote system!! 39089 000762'01 263 17 0 00 000000 ret ;[220] Leave, explicitly not sending a password 39090 000763'01 endif. 39091 39092 remark ;[220] Otherwise, nearly done 39093 000763'01 260 17 0 00 000757* confrm ;[220] Confirm before copying sensitive data 39094 000764'01 201 01 0 00 000141 movx t1, fpwmxw ;[220] Load maximum length of foreign password 39095 dmove t2, [ atmbuf ;[220] Source is atom buffer 39096 000765'01 120 02 0 00 006406' pasbuf ] ;[220] Destination is foreign password 39097 000766'01 123 01 0 00 006313' xblt. t1 ;[220] Store for semantic action 39098 000767'01 201 01 0 00 000000# movei t1, pasbuf ;[220] Load address of foreign password 39099 000770'01 505 01 0 00 440700 hrli t1,() ;[220] Turn into a local pointer 39100 000771'01 202 01 0 00 000537* movem t1, pars4 ;[220] Store for semantic action 39101 000772'01 263 17 0 00 000000 ret ;[220] Successfully completed parse k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13-2 K20SRV MAC 9-Aug-24 12:55 REMOTE CWD Parsing 39102 39103 000773'01 .xcwd1: dmove t1, [ ;[220] No, they did not 39104 mxpwlc ;[220] Maximum password length in characters 39105 000773'01 120 01 0 00 006410' point 7,pasbuf ] ;[220] Point to password buffer 39106 000774'01 260 17 0 00 000312' call getpas ;[220] Ask for a password. 39107 000775'01 254 00 0 00 000145* jrst cmder1 ;[220] Handle like a parse error, do not do semantics 39108 39109 000776'01 200 01 0 00 006412' move t1,[point 7,pasbuf];[241] Point to password buffer 39110 000777'01 134 01 0 00 000002 ildb t1, t2 ;[241] Pick up the first byte 39111 001000'01 306 01 0 00 000015 cain t1, .chcrt ;[241] Bare carriage return? 39112 001001'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39113 001002'01 306 01 0 00 000012 cain t1, .chlfd ;[241] Bare linefeed? 39114 001003'01 400 01 0 00 000000 setz t1, ;[241] Turn into .CHNUL 39115 001004'01 326 01 0 00 001012' ife. t1 ;[241] They didn't, so chuck remnants 39116 001005'01 120 01 0 00 006413' dmove t1, [exp fpwmxw,pasbuf] 39117 001006'01 260 17 0 00 000500' call scrubp ;[241] Chuck any gubbish in password buffer 39118 001007'01 120 01 0 00 006415' dmove t1, [exp atmbln,atmbuf] 39119 001010'01 260 17 0 00 000500' call scrubp ;[241] Sanitize the atom buffer, also 39120 001011'01 263 17 0 00 000000 ret ;[241] We're done; sending a directory 39121 001012'01 endif. ;[220] but not its related password 39122 39123 001012'01 200 01 0 00 006417' move t1,[point 7,pasbuf];[220] Point to password buffer 39124 001013'01 202 01 0 00 000771* movem t1, pars4 ;[220] Save pointer to it. 39125 001014'01 263 17 0 00 000000 ret ;[220] Done 39126 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20SRV MAC 9-Aug-24 12:55 REMOTE CWD Execution 39127 subttl REMOTE CWD Execution 39128 39129 001015'01 $xcwd: extern strbuf, strptr ; Defined in k20mit 39130 001015'01 260 17 0 00 000005* call statim ;[189] Start timing so k20pdc doesn't choke 39131 39132 001016'01 403 01 0 00 000002 setzb t1, t2 ;[220] Cons up some .chnul's 39133 001017'01 124 01 0 00 000000* dmovem t1, strbuf ;[220] Zero out old stuff 39134 001020'01 124 01 0 00 000000# dmovem t1, strbuf+2 ;[220] and a bit more of it 39135 001021'01 200 02 0 00 006420' move t2, [ point 7, strbuf ] ;[220] Point to string buffer 39136 001022'01 202 02 0 00 000000* movem t2, strptr ;[220] Save current location 39137 39138 001023'01 201 04 0 00 000103 movei t4, "C" ; CWD generic command letter 39139 001024'01 136 04 0 00 000002 idpb t4, t2 ;[220] First character of data 39140 001025'01 133 00 0 00 000002 ibp t2 ; Leave room for length. 39141 39142 001026'01 332 01 0 00 000741* skipe t1, pars3 ;[220] But!! Did they specify a directory? 39143 001027'01 254 00 0 00 001036' ifskp. ;[220] They did not, we're done 39144 dmove t3, [ ;[220] Force zero length data area 39145 .chspc ;[220] Space is ASCII for zero length 39146 001030'01 120 03 0 00 006421' point 7,strbuf,13 ] ;[220] Point to second character in packet 39147 001031'01 137 03 0 00 000004 dpb t3, t4 ;[220] Deposit count at head of field. 39148 001032'01 200 01 0 00 001022* move t1, strptr ;[220] Point to beginning of packet (before "C") 39149 001033'01 201 02 0 00 000107 movei t2, "G" ;[220] Packet type is generic 39150 001034'01 254 00 0 00 005406' callret dosrv ;[220] Go send it, handle the reply and return 39151 001035'01 254 00 0 00 001037' else. ;[220] Otherwise, have a directory to copy 39152 001036'01 400 03 0 00 000000 setz t3, ;[220] Initialize counter 39153 001037'01 endif. ;[220] End case default area 39154 39155 001037'01 do. ; Enter loop context to copy directory 39156 001037'01 134 04 0 00 000001 ildb t4, t1 ; Pick up a byte of the directory 39157 001040'01 322 04 0 00 001043' jumpe t4, endlp. ; Stop at the end of the string 39158 001041'01 136 04 0 00 000002 idpb t4, t2 ; Deposit it in string buffer 39159 001042'01 344 03 0 00 001037' aoja t3, top. ; Get some more bytes, weee!! 39160 001043'01 enddo. ; End of loop context 39161 39162 ; Note that lengths here apply to UNPREFIXED values. If a length 39163 ; turns out to be the same as a prefix character, it will be quoted 39164 ; itself. 39165 39166 001043'01 200 04 0 00 006422' move t4, [point 7, strbuf, 13] ; Deposit count at head of field. 39167 001044'01 271 03 0 00 000040 addi t3, 40 ; Make it printable. 39168 001045'01 137 03 0 00 000004 dpb t3, t4 39169 39170 001046'01 336 00 0 00 001013* ifmn. pars4 ; Got a password too? 39171 001047'01 254 00 0 00 001063' 39172 001050'01 202 02 0 00 001032* movem t2, strptr ; Yes. Save current pointer. 39173 001051'01 133 00 0 00 000002 ibp t2 ; Save a place for length of this field. 39174 001052'01 400 03 0 00 000000 setz t3, ; Reset counter for new field. 39175 001053'01 200 01 0 00 001046* move t1, pars4 ; Load pointer to password 39176 001054'01 do. ; Enter loop context to copy that over 39177 001054'01 134 04 0 00 000001 ildb t4, t1 ; Get a character from the password 39178 001055'01 322 04 0 00 001060' jumpe t4, endlp. ; If zero, done. 39179 001056'01 136 04 0 00 000002 idpb t4, t2 ; Append it 39180 001057'01 344 03 0 00 001054' aoja t3, top. ; Count it & loop. 39181 001060'01 enddo. ; End loop context k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14-1 K20SRV MAC 9-Aug-24 12:55 REMOTE CWD Execution 39182 001060'01 136 04 0 00 000002 idpb t4, t2 ; Make it asciz. 39183 001061'01 271 03 0 00 000040 addi t3, 40 ; Make count printable. 39184 001062'01 136 03 0 00 001050* idpb t3, strptr ; Deposit it at head of field. 39185 001063'01 endif. ; End case password supplied 39186 ; Point to completed buffer 39187 dmove t1, [ point 7, strbuf 39188 001063'01 120 01 0 00 006423' "G" ] ; Packet type is H. 39189 001064'01 254 00 0 00 005406' jrst dosrv ; Go send it and handle the reply. 39190 39191 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20SRV MAC 9-Aug-24 12:55 LOCAL CDUP Parsing 39192 subttl LOCAL CDUP Parsing 39193 39194 ;[254] Begin code insertion for Parsing and execution for CDUP 39195 39196 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 39197 000126'02 010004 000000 ycufdb: flddb. .cmcfm,,,,, 39198 000127'02 000000 000000 39199 000130'02 44 07 0 00 000476' 39200 retsec ;;Get back to wherever we came from 39201 39202 001065'01 .ycdup: entry .ycdup ; Invoked by k20par 39203 001065'01 265 16 0 00 006357' saveac ; Necessary for intermediate parse results 39204 39205 001066'01 200 16 0 00 000000# .ycdp1: guide ;[255] parse linkage from CWD 39206 001067'01 260 17 0 00 000707* 39207 000131'02 000000000000# 39208 000260'04 164 157 040 165 160 39209 001070'01 201 01 0 00 000000# movei t1, ycufdb ; Parsing isn't going to be particularly complex .. 39210 001071'01 260 17 0 00 000743* call rfield ; Go parse the confirm 39211 001072'01 120 05 0 00 000001 dmove q1, t1 ; Store the parse results 39212 001073'01 135 07 0 00 006275' ldb q3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code 39213 39214 001074'01 306 07 0 00 000010 cain q3, .cmcfm ; Was it NOT a bare confirm? 39215 001075'01 254 00 0 00 001105' ifskp. ; It wasn't! How did we get that?? 39216 001076'01 561 01 0 00 000170* hrroi t1, atmbuf ; Point to the atom buffer 39217 001077'01 104 00 0 00 000313 ESOUT% ; Start complaining 39218 001100'01 320 12 0 00 000775* erjmpr cmder1 ; Catch a bogon and allow reparse 39219 txmsg < is not a valid CDUP parameter 39220 001101'01 200 01 0 00 000000# > ; Finish up the blat 39221 001102'01 104 00 0 00 000076 39222 001103'01 320 12 0 00 001104' 39223 000132'02 000000000000# 39224 000267'04 040 151 163 040 156 39225 39226 001104'01 254 00 0 00 001100* callret cmder1 ; Allow a reparse, however 39227 001105'01 endif. ; End case highly bogus non-confirm 39228 39229 remark ; Side-effect internal storage in case ^C 39230 001105'01 260 17 0 00 000305' call udjinf ; Get currently connected directory 39231 001106'01 200 02 0 00 000000# move t2, .jidno+jobtab ; Load from side-effected main storage 39232 001107'01 202 02 0 00 001026* movem t2, pars3 ; Pass in to semantic action 39233 001110'01 263 17 0 00 000000 ret ; Otherwise, done 39234 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20SRV MAC 9-Aug-24 12:55 LOCAL CDUP Execution 39235 subttl LOCAL CDUP Execution 39236 39237 001111'01 $ycdup: entry $ycdup ; Invoked by k20par 39238 001111'01 265 16 0 00 006357' saveac ; Need some local fast scratch 39239 001112'01 403 01 0 00 000002 setzb t1, t2 ; Cons up ten NUL's 39240 001113'01 124 01 0 00 000000# dmovem t1, dirbuf ; Give the directory buffer a tiny scrub a dub 39241 001114'01 561 01 0 00 000000# hrroi t1, dirbuf ; Load Tops-20 pointer to directory buffer 39242 001115'01 200 02 0 00 001107* move t2,pars3 ; Load the currently connected directory 39243 001116'01 104 00 0 00 000041 DIRST% ; Translate into a string, checking for oddness 39244 001117'01 320 12 0 00 001121' %jserr (,r) 39245 001120'01 254 00 0 00 001124' 39246 001121'01 265 01 0 00 000602* 39247 001122'01 000000000000# 39248 001123'01 254 00 0 00 000677* 39249 000276'04 103 104 125 120 040 39250 39251 001124'01 200 06 0 00 006425' move q2, [point 7,dirbuf] ;Hardware pointer to directory buffer 39252 001125'01 200 01 0 00 000006 move t1, q2 ; Copy for local usage 39253 001126'01 400 03 0 00 000000 setz t3, ; Last dot we saw 39254 39255 001127'01 do. ; Enter loop context 39256 001127'01 134 02 0 00 000001 ildb t2, t1 ; Pick up a byte 39257 001130'01 322 02 0 00 001136' jumpe t2, endlp. ; Stop if off the end of the string (wierd...) 39258 001131'01 306 02 0 00 000076 cain t2, .chrpt ; At end of directory specification? 39259 001132'01 254 00 0 00 001136' exit. ; Yes, so done with the loop 39260 001133'01 306 02 0 00 000056 cain t2, "." ; Hit a dot?? 39261 001134'01 200 03 0 00 000001 move t3, t1 ; Yes, remember pointer to the last one seen 39262 001135'01 254 00 0 00 001127' loop. ; Grovel to the end of the string 39263 001136'01 enddo. ; Exit loop context 39264 39265 001136'01 326 03 0 00 001150' ife. t3 ; If never saw a dot, at top-level 39266 001137'01 200 01 0 00 000000# txmsg <[Remaining connected to top-level directory > 39267 001140'01 104 00 0 00 000076 39268 001141'01 320 12 0 00 001142' 39269 000133'02 000000000000# 39270 000312'04 133 122 145 155 141 39271 001142'01 200 01 0 00 000006 move t1, q2 ; Load pointer to string 39272 001143'01 104 00 0 00 000076 PSOUT% ; Type it 39273 txmsg <] 39274 001144'01 200 01 0 00 000000# > ; Tie off the line 39275 001145'01 104 00 0 00 000076 39276 001146'01 320 12 0 00 001147' 39277 000134'02 000000000000# 39278 000323'04 135 015 012 000 000 39279 001147'01 263 17 0 00 000000 ret ; Done doing plenty of nothing much... 39280 001150'01 endif. ; End case at top-level 39281 ; Otherwise, change directory specification 39282 001150'01 120 01 0 00 006426' dmove t1, [exp .chrpt,0] ;Load closing punctuation 39283 001151'01 137 01 0 00 000003 dpb t1, t3 ; Stomp the dot with closing punctuation 39284 001152'01 136 02 0 00 000003 idpb t2, t3 ; Close off the string 39285 ; Convert our masterpiece to internal format 39286 001153'01 205 01 0 00 000001 movx t1, rc%emo ; Must match this and only this directory 39287 001154'01 200 02 0 00 000006 move t2, q2 ; Load pointer to munged directory 39288 001155'01 400 03 0 00 000000 setz t3, ; Not doing any stepping 39289 001156'01 104 00 0 00 000553 RCDIR% ; See if we can recognize it k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16-1 K20SRV MAC 9-Aug-24 12:55 LOCAL CDUP Execution 39290 001157'01 607 01 0 00 070000 ifxn. t1, rc%nom!rc%amb!rc%nmd 39291 001160'01 254 00 0 00 001177' 39292 001161'01 200 01 0 00 000006 move t1, q2 ; Load pointer to constructed directory 39293 001162'01 104 00 0 00 000313 ESOUT% ; Start whining 39294 001163'01 320 12 0 00 001123* erjmpr r ; Ignore error and return 39295 001164'01 200 01 0 00 000000# txmsg < was not recognized as a valid directory, > 39296 001165'01 104 00 0 00 000076 39297 001166'01 320 12 0 00 001167' 39298 000135'02 000000000000# 39299 000324'04 040 167 141 163 040 39300 dmove t1, [ .priou ; Continue to type on terminal 39301 001167'01 120 01 0 00 006430' .fhslf,,-1 ] ; This process, last error 39302 001170'01 400 03 0 00 000000 setz t3, ; Let it blat as much as it wants 39303 001171'01 104 00 0 00 000011 ERSTR% ; Display last Tops-20 error 39304 001172'01 320 14 0 00 001174' erjmps .+2 ; Ignore strange return 39305 001173'01 320 14 0 00 001174' erjmps .+1 ; Ignore stranger return 39306 001174'01 561 01 0 00 000632* hrroi t1,crlf ; Tie off the line 39307 001175'01 104 00 0 00 000076 PSOUT% 39308 001176'01 263 17 0 00 000000 ret ; Done, can't connect to it 39309 001177'01 endif. ; End case couldn't recognize the directory 39310 39311 001177'01 200 07 0 00 000003 move q3, t3 ; Store the directory number, just in case 39312 001200'01 200 01 0 00 006354' movx t1, ac%con!3 ; Doing a connect, block is three words long 39313 001201'01 201 02 0 00 000003 movei t2, t3 ; Argument block begins in AC3 39314 001202'01 120 04 0 00 006432' dmove t4, [ exp 0, -1 ] ; No password, this job 39315 001203'01 104 00 0 00 000552 ACCES% ; Try the connect 39316 001204'01 320 12 0 00 001206' %jserr (,r) 39317 001205'01 254 00 0 00 001211' 39318 001206'01 265 01 0 00 001121* 39319 001207'01 000000000000# 39320 001210'01 254 00 0 00 001163* 39321 000335'04 125 156 141 142 154 39322 39323 001211'01 260 17 0 00 000305' call udjinf ; Update currently connected directory 39324 001212'01 200 01 0 00 000000# txmsg <[Connected to > ; Inform us of new location 39325 001213'01 104 00 0 00 000076 39326 001214'01 320 12 0 00 001215' 39327 000136'02 000000000000# 39328 000345'04 133 103 157 156 156 39329 001215'01 200 01 0 00 000006 move t1, q2 ; Point to what we constructed 39330 001216'01 104 00 0 00 000076 PSOUT% ; Type it 39331 txmsg <] 39332 001217'01 200 01 0 00 000000# > ; Tie off the line 39333 001220'01 104 00 0 00 000076 39334 001221'01 320 12 0 00 001222' 39335 000137'02 000000000000# 39336 000350'04 135 015 012 000 000 39337 001222'01 263 17 0 00 000000 ret ; Done 39338 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20SRV MAC 9-Aug-24 12:55 REMOTE CDUP Execution 39339 subttl REMOTE CDUP Execution 39340 39341 remark REMOTE CDUP parsing 39342 39343 001223'01 200 16 0 00 000000# .xcdup: guide 39344 001224'01 260 17 0 00 001067* 39345 000140'02 000000000000# 39346 000351'04 164 157 040 165 160 39347 001225'01 260 17 0 00 000763* confrm ; Very complicated parsing ... 39348 001226'01 263 17 0 00 000000 ret 39349 39350 remark REMOTE PWD execution 39351 39352 001227'01 260 17 0 00 001015* $xcdup: call statim ; Start timing so k20pdc doesn't choke 39353 dmove t1, [ ; ;G command is for CDUP 39354 point 7, [asciz/G/] ; 'G' command for data field. 39355 001230'01 120 01 0 00 006435' "G" ] ; Packet type is G. 39356 001231'01 254 00 0 00 005406' jrst dosrv 39357 39358 ;[254] End code Insertion for Parsing and execution for CDUP 39359 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20SRV MAC 9-Aug-24 12:55 LOCAL DELETE parsing 39360 subttl LOCAL DELETE parsing 39361 39362 chgsec(code,const) ;;Parsing and tables go in constants 39363 000141'02 100120 777775 delbk: gj%old!gj%ifg!gj%flg!.gjall ; Flag bits,,generation number. 39364 000142'02 000100 000101 .priin,,.priou ; COMND i/o. 39365 repeat 6,<0> ; No defaults, except all generations. 39366 000143'02 000000 000000 39367 000144'02 000000 000000 39368 000145'02 000000 000000 39369 000146'02 000000 000000 39370 000147'02 000000 000000 39371 000150'02 000000 000000 39372 000010 delbkl==<.-delbk> ; Length of this GTJFN argument block. 39373 39374 000151'02 006000 000000 ydefdb: flddb. .cmfil 39375 000152'02 000000 000000 39376 retsec 39377 39378 001232'01 .ydele: entry .ydele ; Invoked from k20par 39379 001232'01 200 01 0 00 006437' movx t1, cz%ncl!.fhslf ; Close any nonopen JFNs. 39380 001233'01 104 00 0 00 000034 CLZFF 39381 001234'01 200 16 0 00 000000# guide ; Issue guide words. 39382 001235'01 260 17 0 00 001224* 39383 000153'02 000000000000# 39384 000360'04 146 151 154 145 163 39385 001236'01 200 01 0 00 006440' move t1, [delbk,,cjfnbk] ; Insert our file parsing defaults. 39386 001237'01 251 01 0 00 000000# blt t1, cjfnbk+delbkl 39387 001240'01 201 01 0 00 000000# movei t1, ydefdb 39388 001241'01 260 17 0 00 000000* call cfield 39389 001242'01 202 02 0 00 001115* movem t2, pars3 ; Here's the JFN just parsed. 39390 001243'01 550 01 0 00 000002 hrrz t1,t2 ;[193] Load the JFN, sans flags 39391 001244'01 260 17 0 00 000104* call isnulj ;[193] Is this NUL:? 39392 001245'01 254 00 0 00 001250' ifskp. ;[193] Yes, so let's fix up the parse 39393 001246'01 202 01 0 00 001242* movem t1, pars3 ;[193] Store the .nulio in there 39394 001247'01 200 02 0 00 000001 move t2,t1 ;[193] Leave for anybody downstream 39395 001250'01 endif. ;[193] 39396 001250'01 263 17 0 00 000000 ret 39397 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20SRV MAC 9-Aug-24 12:55 [113] LOCAL DELETE execution 39398 subttl [113] LOCAL DELETE execution 39399 39400 001251'01 $ydele: entry $ydele ; Invoked from k20par 39401 39402 extern ffunc ; File function being performed 39403 001251'01 550 01 0 00 001246* hrrz t1, pars3 ; Load parsed JFN 39404 001252'01 260 17 0 00 005474' call isdird ;[193] Is this a directory device? 39405 001253'01 254 00 0 00 001266' ifskp. ;[193] If worked, proceed 39406 001254'01 201 02 0 00 006004' movei t2, delfil ; Address of delete-file code. 39407 001255'01 202 02 0 00 000000* movem t2, ffunc ; Make it the file function. 39408 001256'01 332 00 0 00 000000* ifme. expung ;[199] Can only speed up the non-expunge case 39409 001257'01 254 00 0 00 001264' 39410 001260'01 200 01 0 00 001251* move t1, pars3 ;[199] Reload the parsed JFN with flags 39411 001261'01 260 17 0 00 005725' call ffjfgd ;[199] Fix file JFN for fast generational delete 39412 001262'01 254 00 0 00 001752' callret $ydir1 ;[199] Failed or exact generation; do each file by hand 39413 001263'01 202 01 0 00 001260* movem t1, pars3 ;[199] Store the updated JFN with flags 39414 001264'01 endif. ;[199] End case not expunging 39415 001264'01 254 00 0 00 001752' callret $ydir1 ; Go do it like a directory. 39416 001265'01 254 00 0 00 001322' else. ;[193] Otherwise, not a directory device (or failed) 39417 001266'01 265 16 0 00 000653* anstkv (t4,^d4) ;[193] Allocate an anonymous stack variable 39418 001267'01 000000 000004 39419 001270'01 415 04 0 17 777773 39420 001271'01 200 02 0 00 000001 move t2, t1 ;[193] Save the device designator 39421 001272'01 560 01 0 00 000004 hrro t1, t4 ;[193] Create pointer to stack space 39422 001273'01 104 00 0 00 000121 DEVST% ;[193] Convert to a string 39423 001274'01 320 12 0 00 001276' ifje. r ;[193] Failed?? 39424 001275'01 254 00 0 00 001301' 39425 001276'01 200 03 0 00 000001 move t3, t1 ;[193] Save error for debugger 39426 001277'01 561 04 0 00 001322' hrroi t4, badevc ;[193] Load a default 39427 001300'01 254 00 0 00 001305' else. ;[193] Otherwise, we have a good device 39428 001301'01 120 02 0 00 006441' dmove t2, [exp ":", .chnul] ;[193] 39429 001302'01 136 02 0 00 000001 idpb t2, t1 ;[193] Punctuate device 39430 001303'01 136 03 0 00 000001 idpb t3, t1 ;[193] Tie off the string 39431 001304'01 661 04 0 00 777777 tlo t4, -1 ;[193] So turn it into a pointer 39432 001305'01 endif. ;[193] End case DEVST% error handling 39433 001305'01 200 01 0 00 000004 move t1, t4 ;[193] Load pointer to something 39434 001306'01 104 00 0 00 000313 ESOUT% ;[193] Start complaining 39435 001307'01 200 01 0 00 000000# txmsg < has no directory to delete files from> ;[193] 39436 001310'01 104 00 0 00 000076 39437 001311'01 320 12 0 00 001312' 39438 000154'02 000000000000# 39439 000362'04 040 150 141 163 040 39440 001312'01 561 01 0 00 001174* hrroi t1, crlf ;[193] Newline 39441 001313'01 104 00 0 00 000076 PSOUT% ;[193] 39442 001314'01 400 01 0 00 000000 setz t1, ;[193] Cons up a zero 39443 001315'01 250 01 0 00 001263* exch t1, pars3 ;[193] Get and clear parsed JFN 39444 001316'01 621 01 0 00 777777 tlz t1, -1 ;[193] Clear any goofy flags 39445 001317'01 104 00 0 00 000023 RLJFN% ;[193] Punt it 39446 001320'01 320 12 0 00 001321' erjmpr .+1 ;[193] Catch and ignore error 39447 001321'01 263 17 0 00 000000 ret ;[193] And get out of here 39448 001322'01 endif. ;[193] End case device check 39449 39450 001322'01 125 156 153 156 157 badevc: asciz "Unknown device" 39451 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20SRV MAC 9-Aug-24 12:55 REMOTE DELETE, DIRECTORY, TYPE parsing 39452 subttl REMOTE DELETE, DIRECTORY, TYPE parsing 39453 39454 chgsec(code,const) ;;Chained FDB's are not in code, they're in const 39455 000155'02 021004 000160' rmffdb: flddb. .cmqst,,,,,rmffd1 39456 000156'02 000000 000000 39457 000157'02 44 07 0 00 000507' 39458 000160'02 017004 000000 rmffd1: flddb. .cmtxt,,,,, 39459 000161'02 000000 000000 39460 000162'02 44 07 0 00 000507' 39461 retsec 39462 cleans() 39463 39464 001325'01 200 16 0 00 000000# .rmfil: guide ; Parse the rest of the command. 39465 001326'01 260 17 0 00 001235* 39466 000163'02 000000000000# 39467 000372'04 162 145 155 157 164 39468 001327'01 201 01 0 00 000000# movei t1, rmffdb ;[220] Allow a quote of the remote file specification 39469 001330'01 260 17 0 00 001241* call cfield 39470 001331'01 263 17 0 00 000000 ret 39471 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20SRV MAC 9-Aug-24 12:55 REMOTE DELETE (Erase) execution 39472 subttl REMOTE DELETE (Erase) execution 39473 39474 001332'01 336 00 0 00 000000* $xdele: ifmn. tlgjfn ;[233] Doing transaction logging? 39475 001333'01 254 00 0 00 001355' 39476 001334'01 415 16 0 00 001355' block. ;[233] Get a stack frame 39477 001335'01 261 17 0 00 000016 39478 001336'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 39479 001337'01 476 00 0 00 000000* setom scrlft ;[233] Suppress the trailing line feed 39480 001340'01 265 01 0 00 000000* wtlog(,) ;[233] 39481 001341'01 000000000000# 39482 001342'01 777777 777743 39483 001343'01 000000 000000 39484 000375'04 122 145 161 165 145 39485 001344'01 200 01 0 00 001332* move t1, tlgjfn ;[233] Put the file name name in the log 39486 001345'01 561 02 0 00 001076* hrroi t2,atmbuf ;[233] It's in the atom buffer 39487 001346'01 403 03 0 00 000004 setzb t3,t4 ;[233] Don't know how long, stop on a NUL 39488 001347'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 39489 001350'01 320 14 0 00 001351' erjmps .+1 ;[233] Catch and suppress error 39490 dmove t2,[ -1,,crlf ;[233] Tops-20 pointer to carriage return line feed 39491 001351'01 120 02 0 00 006443' -2 ] ;[233] Counted SOUT%'s are faster 39492 001352'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 39493 001353'01 320 14 0 00 001354' erjmps .+1 ;[233] Catch and suppress error 39494 001354'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 39495 001355'01 endif. ;[233] 39496 39497 001355'01 260 17 0 00 001227* call statim ;[189] Start timing so k20pdc doesn't choke 39498 001356'01 201 04 0 00 000105 movei t4, "E" ; Generic command is E. 39499 001357'01 254 00 0 00 005362' jrst srvfil 39500 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20SRV MAC 9-Aug-24 12:55 DIRECTORY command 39501 subttl DIRECTORY command 39502 39503 ; Default wildcard filespec fields for .CMFIL: 39504 39505 chgsec(code,const) ;;Tables and fdb's go in const 39506 000164'02 100120 777775 dirbk: gj%old!gj%ifg!gj%flg!.gjall ; Flag bits,,generation number. 39507 000165'02 000100 000101 .priin,,.priou ; COMND i/o. 39508 repeat 2,<0> ; Normal defaults for dev: and gen. 39509 000166'02 000000 000000 39510 000167'02 000000 000000 39511 repeat 2,)> ; *.* for name and type. 39512 000170'02 000000000000# 39513 000403'04 052 000 000 000 000 39514 000171'02 000000000000# 39515 000404'04 052 000 000 000 000 39516 39517 000172'02 000000000000# 0 ; Default protection, 39518 000173'02 000000 000000 0 ; and account. 39519 000010 dirbkl==<.-dirbk> ; Length of this GTJFN argument block. 39520 39521 000174'02 wldfil: remark ;[252] Wild card specification for all files 39522 000174'02 000000 000052 byte (1) 0 (7) .chnul,.chnul,.chnul,.chnul,"*" 39523 000175'02 134522 712472 byte (1) 0 (7) ".","*",".","*",":" 39524 000013 wldmax==^d<<<6+1+1+39+6>/5>+1> ;[252] Maximum size file specific from above 39525 39526 000176'02 010004 000201' ydifdb: flddb. .cmcfm,,,,,ydifd1 39527 000177'02 000000 000000 39528 000200'02 44 07 0 00 000515' 39529 000201'02 011004 000204' ydifd1: flddb. .cmdir,,,,,ydifd2 39530 000202'02 000000 000000 39531 000203'02 44 07 0 00 000526' 39532 000204'02 016004 000207' ydifd2: flddb. .cmdev,,,,,ydifd3 39533 000205'02 000000 000000 39534 000206'02 44 07 0 00 000534' 39535 000207'02 006004 000000 ydifd3: flddb. .cmfil,,,,, 39536 000210'02 000000 000000 39537 000211'02 44 07 0 00 000541' 39538 retsec 39539 cleans() 39540 39541 001360'01 .ydire: entry .ydire ; Invoked from k20par 39542 001360'01 265 16 0 00 006357' saveac ;[252] Needs some registers for things... 39543 001361'01 403 05 0 00 000006 setzb q1, q2 ;[252] Initialize to known values 39544 001362'01 403 07 0 00 000010 setzb q3, q4 ;[252] 39545 39546 001363'01 200 01 0 00 006445' move t1, [dirbk,,cjfnbk] ; Insert our file parsing defaults. 39547 001364'01 251 01 0 00 000000# blt t1, cjfnbk+dirbkl 39548 001365'01 200 01 0 00 006437' movx t1, cz%ncl!.fhslf ; Close any nonopen JFNs. 39549 001366'01 104 00 0 00 000034 CLZFF 39550 001367'01 320 12 0 00 001370' erjmpr .+1 39551 39552 dmove t1, [ .fhslf ;[252] This process 39553 001370'01 120 01 0 00 006446' LSTRX1 ] ;[252] "Process has not encountered any errors" 39554 001371'01 104 00 0 00 000336 SETER% ;[252] Clear last error, if any 39555 001372'01 320 12 0 00 001647' erjmpr ydirer ;[252] System is very ill, go drop dead k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-1 K20SRV MAC 9-Aug-24 12:55 DIRECTORY command 39556 39557 001373'01 200 16 0 00 000000# guide ; Issue guide words. 39558 001374'01 260 17 0 00 001326* 39559 000212'02 000000000000# 39560 000405'04 157 146 040 146 151 39561 001375'01 201 01 0 00 000000# movei t1, ydifdb ;[193] 39562 001376'01 260 17 0 00 001071* call rfield ;[193] Parse for a file, really 39563 001377'01 200 05 0 00 000002 move q1, t2 ;[193] Store whatever we got 39564 001400'01 135 07 0 00 006275' ldb q3, [pointr (.cmfnp(t3),cm%fnc)] ;[193] Get function code. 39565 39566 001401'01 302 07 0 00 000010 caie q3, .cmcfm ;[252] Just confirmed? 39567 001402'01 254 00 0 00 001456' ifskp. ;[252] He did 39568 001403'01 265 16 0 00 001266* anstkv(q4,wldmax) ;[252] Enough space to build the complete specification 39569 001404'01 000000 000013 39570 001405'01 415 10 0 17 777764 39571 001406'01 201 01 0 00 000013 movx t1, wldmax ;[252] Load size of space to zero 39572 001407'01 200 02 0 00 000010 move t2, q4 ;[252] Load address to zero 39573 001410'01 201 03 0 02 000001 movei t3, 1(t2) ;[252] Cascading zero 39574 001411'01 402 00 0 02 000000 setzm (t2) ;[252] Whack the first location 39575 001412'01 373 00 0 00 000001 sosle t1 ;[252] Account for zapped location 39576 001413'01 123 01 0 00 006313' extend t1,[xblt] ;[252] Whack the rest if any left to do 39577 001414'01 104 00 0 00 000013 GJINF% ;[252] Get our current job particulars 39578 001415'01 320 12 0 00 001647' erjmpr ydirer ;[252] Should never fail, but ... 39579 001416'01 560 01 0 00 000010 hrro t1, q4 ;[252] Build a Tops-20 pointer to the stack 39580 001417'01 104 00 0 00 000041 DIRST% ;[252] Turn it into a string 39581 001420'01 320 12 0 00 001647' erjmpr ydirer ;[252] Failed on a valid parse item?? 39582 001421'01 120 02 0 00 000000# dmove t2, wldfil ;[252] Load the file specification 39583 001422'01 242 03 0 00 777771 lsh t3, -^d7 ;[252] Skip the colon as DIRST% already put it there 39584 repeat ^d4,< ;[252] Unroll the loop (easier logic) 39585 idpb t3, t1 ;[252] Deposit a byte of the file specification 39586 lsh t3, -^d7 ;[252] Get the next byte in 39587 >;; repeat ^d4 ;[252] End of first word 39588 001423'01 136 03 0 00 000001 39589 001424'01 242 03 0 00 777771 39590 001425'01 136 03 0 00 000001 39591 001426'01 242 03 0 00 777771 39592 001427'01 136 03 0 00 000001 39593 001430'01 242 03 0 00 777771 39594 001431'01 136 03 0 00 000001 39595 001432'01 242 03 0 00 777771 39596 39597 repeat ^d2,< ;[252] Unroll the loop (easier logic) 39598 idpb t2, t1 ;[252] Deposit a byte of the file specification 39599 lsh t2, -^d7 ;[252] Get the next byte in 39600 >;; repeat ^d2 ;[252] End of second word 39601 001433'01 136 02 0 00 000001 39602 001434'01 242 02 0 00 777771 39603 001435'01 136 02 0 00 000001 39604 001436'01 242 02 0 00 777771 39605 39606 001437'01 200 01 0 00 000000# move t1, dirbk ;[252] Load GTJFN flags 39607 001440'01 560 02 0 00 000010 hrro t2, q4 ;[252] Make a Tops-20 pointer to completed specification 39608 001441'01 104 00 0 00 000020 GTJFN% ;[252] See if Tops-20 will default something nice 39609 001442'01 320 12 0 00 001647' erjmpr ydirer ;[252] Nope, fail the parse 39610 001443'01 200 05 0 00 000001 move q1, t1 ;[252] Replace previously parsed item k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-2 K20SRV MAC 9-Aug-24 12:55 DIRECTORY command 39611 001444'01 603 05 0 00 200000 txne q1, gj%unt ;[251] Compensate for misdocumentation ... 39612 001445'01 661 05 0 00 400000 txo q1, gj%dev ;[251] ... in JSYS_REFERENCE 39613 001446'01 621 01 0 00 777777 tlz t1, -1 ;[252] Stomp the flags so DVCHR% doesn't choke 39614 001447'01 104 00 0 00 000117 DVCHR% ;[252] Find out all about it 39615 001450'01 320 12 0 00 001647' erjmpr ydirer ;[252] How is that possible? We have a valid JFN!! 39616 001451'01 200 06 0 00 000002 move q2, t2 ;[252] Save device characteristics 39617 001452'01 124 05 0 00 001315* dmovem q1, pars3 ;[252] Pass parsed item and characteristics 39618 001453'01 201 07 0 00 000006 movx q3, .cmfil ;[252] Pretend we parsed a file specification 39619 001454'01 202 07 0 00 000550* movem q3, pars5 ;[252] Pass parse type 39620 001455'01 263 17 0 00 000000 ret ;[252] All done! 39621 001456'01 endif. ;[252] End case simple confirm 39622 39623 001456'01 306 07 0 00 000011 cain q3, .cmdir ;[252] A directory will never be NUL: ... 39624 001457'01 254 00 0 00 001474' ifskp. ;[252] Not a directory, go figure it out 39625 001460'01 200 01 0 00 000002 move t1, t2 ;[252] Position for investigation 39626 001461'01 306 07 0 00 000006 cain q3, .cmfil ;[252] A file? (I.E., a JFN?) 39627 001462'01 621 01 0 00 777777 tlz t1, -1 ;[252] Yes, toss the flags 39628 001463'01 260 17 0 00 001244* call isnulj ;[252] Is this some flavor of NUL:? 39629 001464'01 254 00 0 00 001474' ifskp. ;[252] It is, so use the special moniker (.nulio) 39630 001465'01 200 05 0 00 000001 move q1, t1 ;[252] Replace what we got 39631 001466'01 260 17 0 00 001225* confrm ;[252] Tie off the line 39632 001467'01 200 06 0 00 006450' move q2, [dv%out!dv%in!dv%av!fld(.dvnul,dv%typ)!dv%psd!fld(-1,dv%mod)] ;[252] 39633 001470'01 124 05 0 00 001452* dmovem q1, pars3 ;[252] Pass parsed item and characteristics 39634 001471'01 201 07 0 00 000016 movx q3, .cmdev ;[252] Pretend we parsed the raw device 39635 001472'01 202 07 0 00 001454* movem q3, pars5 ;[252] Pass parse type 39636 001473'01 263 17 0 00 000000 ret ;[252] Done 39637 001474'01 endif. ;[252] End case some flavor of NUL: 39638 001474'01 endif. ;[252] End case checking non-directory case of NUL: 39639 39640 001474'01 302 07 0 00 000016 caie q3, .cmdev ;[193] Picked up a device? 39641 001475'01 254 00 0 00 001552' ifskp. ;[193] Yes, let's see if we can work with it 39642 001476'01 200 01 0 00 000005 move t1, q1 ;[252] Load for DVCHR% 39643 001477'01 104 00 0 00 000117 DVCHR% ;[252] Find out all about it 39644 001500'01 320 12 0 00 001647' erjmpr ydirer ;[252] How is that possible? We just parsed it! 39645 001501'01 607 02 0 00 120000 txnn t2,dv%dir!dv%mdd ;[252] File structure (or DECtape)? 39646 001502'01 254 00 0 00 001647' jrst ydirer ;[252] No, then surely can't list it 39647 001503'01 200 06 0 00 000002 move q2, t2 ;[252] Save device characteristics 39648 001504'01 265 16 0 00 001403* anstkv(q4,^d6) ;[252] 29 characters of device name and files 39649 001505'01 000000 000006 39650 001506'01 415 10 0 17 777771 39651 001507'01 403 01 0 00 000002 setzb t1, t2 ;[252] Cons up some zeros 39652 001510'01 124 01 0 10 000000 dmovem t1, ^d0(q4) ;[252] Let's scrub a bit of it 39653 001511'01 124 01 0 10 000002 dmovem t1, ^d2(q4) ;[252] and a bit more 39654 001512'01 124 01 0 10 000004 dmovem t1, ^d4(q4) ;[252] and the rest of it 39655 001513'01 560 01 0 00 000010 hrro t1, q4 ;[193] Create a Tops-20 ASCII pointer 39656 001514'01 200 02 0 00 000005 move t2, q1 ;[252] Load the 39657 001515'01 104 00 0 00 000121 DEVST% ;[193] Turn it into a string (I hope) 39658 001516'01 320 12 0 00 001647' erjmpr ydirer ;[252] Failed on a valid parse item?? 39659 001517'01 120 02 0 00 000000# dmove t2, wldfil ;[252] Load the file specification 39660 repeat ^d5,< ;[252] Unroll the loop (easier logic) 39661 idpb t3, t1 ;[252] Deposit a byte of the file specification 39662 lsh t3, -^d7 ;[252] Get the next byte in 39663 >;; repeat ^d5 ;[252] End of first word 39664 001520'01 136 03 0 00 000001 39665 001521'01 242 03 0 00 777771 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-3 K20SRV MAC 9-Aug-24 12:55 DIRECTORY command 39666 001522'01 136 03 0 00 000001 39667 001523'01 242 03 0 00 777771 39668 001524'01 136 03 0 00 000001 39669 001525'01 242 03 0 00 777771 39670 001526'01 136 03 0 00 000001 39671 001527'01 242 03 0 00 777771 39672 001530'01 136 03 0 00 000001 39673 001531'01 242 03 0 00 777771 39674 39675 repeat ^d2,< ;[252] Unroll the loop (easier logic) 39676 idpb t2, t1 ;[252] Deposit a byte of the file specification 39677 lsh t2, -^d7 ;[252] Get the next byte in 39678 >;; repeat ^d2 ;[252] End of second word 39679 001532'01 136 02 0 00 000001 39680 001533'01 242 02 0 00 777771 39681 001534'01 136 02 0 00 000001 39682 001535'01 242 02 0 00 777771 39683 39684 001536'01 200 01 0 00 000000# move t1, dirbk ;[252] Load GTJFN flags 39685 001537'01 560 02 0 00 000010 hrro t2, q4 ;[252] Make a Tops-20 pointer to completed specification 39686 001540'01 104 00 0 00 000020 GTJFN% ;[252] See if Tops-20 will default something nice 39687 001541'01 320 12 0 00 001647' erjmpr ydirer ;[252] Nope, fail the parse 39688 001542'01 200 05 0 00 000001 move q1, t1 ;[252] Replace previously parsed item 39689 001543'01 603 05 0 00 200000 txne q1, gj%unt ;[251] Compensate for misdocumentation ... 39690 001544'01 661 05 0 00 400000 txo q1, gj%dev ;[251] ... in JSYS_REFERENCE 39691 001545'01 260 17 0 00 001466* confrm ;[252] Tie off the line 39692 001546'01 124 05 0 00 001470* dmovem q1, pars3 ;[252] Pass parsed item and characteristics 39693 001547'01 201 07 0 00 000006 movx q3, .cmfil ;[252] Pretend we parsed a file specification 39694 001550'01 202 07 0 00 001472* movem q3, pars5 ;[252] Pass parse type 39695 001551'01 263 17 0 00 000000 ret ;[252] Done 39696 001552'01 endif. ;[252] End case .cmdev 39697 39698 001552'01 302 07 0 00 000011 caie q3, .cmdir ;[252] Picked up a directory? 39699 001553'01 254 00 0 00 001627' ifskp. ;[252] Yes, let's see if we can work with it 39700 001554'01 265 16 0 00 001504* anstkv(q4,wldmax) ;[252] Enough space to build the complete specification 39701 001555'01 000000 000013 39702 001556'01 415 10 0 17 777764 39703 001557'01 201 01 0 00 000013 movx t1, wldmax ;[252] Load size of space to zero 39704 001560'01 200 02 0 00 000010 move t2, q4 ;[252] Load address to zero 39705 001561'01 201 03 0 02 000001 movei t3, 1(t2) ;[252] Cascading zero 39706 001562'01 402 00 0 02 000000 setzm (t2) ;[252] Whack the first location 39707 001563'01 373 00 0 00 000001 sosle t1 ;[252] Account for zapped location 39708 001564'01 123 01 0 00 006313' extend t1,[xblt] ;[252] Whack the rest if any left to do 39709 001565'01 560 01 0 00 000010 hrro t1, q4 ;[252] Build a Tops-20 pointer to the stack 39710 001566'01 200 02 0 00 000005 move t2, q1 ;[252] Load parsed directory 39711 001567'01 104 00 0 00 000041 DIRST% ;[252] Turn it into a string 39712 001570'01 320 12 0 00 001647' erjmpr ydirer ;[252] Failed on a valid parse item?? 39713 001571'01 120 02 0 00 000000# dmove t2, wldfil ;[252] Load the file specification 39714 001572'01 242 03 0 00 777771 lsh t3, -^d7 ;[252] Skip the colon as DIRST% already put it there 39715 repeat ^d4,< ;[252] Unroll the loop (easier logic) 39716 idpb t3, t1 ;[252] Deposit a byte of the file specification 39717 lsh t3, -^d7 ;[252] Get the next byte in 39718 >;; repeat ^d4 ;[252] End of first word 39719 001573'01 136 03 0 00 000001 39720 001574'01 242 03 0 00 777771 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22-4 K20SRV MAC 9-Aug-24 12:55 DIRECTORY command 39721 001575'01 136 03 0 00 000001 39722 001576'01 242 03 0 00 777771 39723 001577'01 136 03 0 00 000001 39724 001600'01 242 03 0 00 777771 39725 001601'01 136 03 0 00 000001 39726 001602'01 242 03 0 00 777771 39727 39728 repeat ^d2,< ;[252] Unroll the loop (easier logic) 39729 idpb t2, t1 ;[252] Deposit a byte of the file specification 39730 lsh t2, -^d7 ;[252] Get the next byte in 39731 >;; repeat ^d2 ;[252] End of second word 39732 001603'01 136 02 0 00 000001 39733 001604'01 242 02 0 00 777771 39734 001605'01 136 02 0 00 000001 39735 001606'01 242 02 0 00 777771 39736 39737 001607'01 200 01 0 00 000000# move t1, dirbk ;[252] Load GTJFN flags 39738 001610'01 560 02 0 00 000010 hrro t2, q4 ;[252] Make a Tops-20 pointer to completed specification 39739 001611'01 104 00 0 00 000020 GTJFN% ;[252] See if Tops-20 will default something nice 39740 001612'01 320 12 0 00 001647' erjmpr ydirer ;[252] Nope, fail the parse 39741 001613'01 200 05 0 00 000001 move q1, t1 ;[252] Replace previously parsed item 39742 001614'01 603 05 0 00 200000 txne q1, gj%unt ;[251] Compensate for misdocumentation ... 39743 001615'01 661 05 0 00 400000 txo q1, gj%dev ;[251] ... in JSYS_REFERENCE 39744 001616'01 621 01 0 00 777777 tlz t1, -1 ;[252] Stomp the flags so DVCHR% doesn't choke 39745 001617'01 104 00 0 00 000117 DVCHR% ;[252] Find out all about it 39746 001620'01 320 12 0 00 001647' erjmpr ydirer ;[252] How is that possible? We have a valid JFN!! 39747 001621'01 200 06 0 00 000002 move q2, t2 ;[252] Save device characteristics 39748 001622'01 260 17 0 00 001545* confrm ;[252] Tie off the line 39749 001623'01 124 05 0 00 001546* dmovem q1, pars3 ;[252] Pass parsed item and characteristics 39750 001624'01 201 07 0 00 000006 movx q3, .cmfil ;[252] Pretend we parsed a file specification 39751 001625'01 202 07 0 00 001550* movem q3, pars5 ;[252] Pass parse type 39752 001626'01 263 17 0 00 000000 ret ;[252] Done 39753 001627'01 endif. ;[252] End case .cmdev 39754 39755 001627'01 302 07 0 00 000006 caie q3, .cmfil ;[252] Picked up a general file specification 39756 001630'01 254 00 0 00 001643' ifskp. ;[252] Yes, so let's get a bit more information 39757 001631'01 603 05 0 00 200000 txne q1, gj%unt ;[251] Compensate for misdocumentation ... 39758 001632'01 661 05 0 00 400000 txo q1, gj%dev ;[251] ... in JSYS_REFERENCE 39759 001633'01 550 01 0 00 000005 hrrz t1, q1 ;[252] Load the JFN, no flags 39760 001634'01 104 00 0 00 000117 DVCHR% ;[252] Find out all about it 39761 001635'01 320 12 0 00 001647' erjmpr ydirer ;[252] How is that possible? We have a valid JFN!! 39762 001636'01 200 06 0 00 000002 move q2, t2 ;[252] Save device characteristics 39763 001637'01 260 17 0 00 001622* confrm ;[252] Tie off the line 39764 001640'01 124 05 0 00 001623* dmovem q1, pars3 ;[252] Pass parsed item and characteristics 39765 001641'01 202 07 0 00 001625* movem q3, pars5 ;[252] Pass parse type 39766 001642'01 263 17 0 00 000000 ret ;[252] Done 39767 001643'01 endif. ;[252] End case general file 39768 39769 remark ;[252] Parsed something we don't know about... 39770 dmove t1, [ .fhslf ;[252] This process 39771 001643'01 120 01 0 00 006451' COMNX1 ] ;[252] "Invalid COMND function code" 39772 001644'01 104 00 0 00 000336 SETER% ;[252] Phoney up a parse error 39773 001645'01 320 12 0 00 001647' erjmpr ydirer ;[252] Handle an extremely unlikely error 39774 001646'01 254 00 0 00 001647' jrst ydirer ;[252] Otherwise, go lie about internal inconsistency 39775 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20SRV MAC 9-Aug-24 12:55 here on any kind of parse error 39776 subttl here on any kind of parse error 39777 39778 001647'01 561 01 0 00 001345* ydirer: hrroi t1, atmbuf ;[252] Point to unmodified atom buffer 39779 001650'01 104 00 0 00 000313 ESOUT% ;[252] Start complaining 39780 001651'01 320 12 0 00 001652' erjmpr .+1 ;[252] Ignore any error it throws 39781 001652'01 200 01 0 00 000000# txmsg < can not have its directory listed> ;[252] Explanatory blat 39782 001653'01 104 00 0 00 000076 39783 001654'01 320 12 0 00 001655' 39784 000213'02 000000000000# 39785 000407'04 040 143 141 156 040 39786 001655'01 201 01 0 00 400000 movx t1, .fhslf ;[252] This process 39787 001656'01 104 00 0 00 000012 GETER% ;[252] Get the last error 39788 001657'01 320 12 0 00 001661' ifje. r ;[252] Should NEVER fail, but ... 39789 001660'01 254 00 0 00 001664' 39790 001661'01 200 04 0 00 000001 move t4, t1 ;[252] Save error for debuggers 39791 001662'01 201 02 0 00 601405 movx t2, LSTRX1 ;[252] "Process has not encountered any errors" 39792 001663'01 254 00 0 00 001666' else. ;[252] Otherwise, worked 39793 001664'01 400 04 0 00 000000 setz t4, ;[252] Flag no last error 39794 001665'01 621 02 0 00 777777 tlz t2, -1 ;[252] Get rid of silly handle that we already know... 39795 001666'01 endif. ;[252] Must get resolved? 39796 001666'01 306 02 0 00 601405 cain t2, LSTRX1 ;[252] Nothing went wrong, actually? 39797 001667'01 254 00 0 00 001701' ifskp. ;[252] No, so display the last Tops-20 error 39798 001670'01 200 01 0 00 000000# txmsg <: > ;[252] Introduce the Tops-20 error string 39799 001671'01 104 00 0 00 000076 39800 001672'01 320 12 0 00 001673' 39801 000214'02 000000000000# 39802 000416'04 072 040 000 000 000 39803 001673'01 201 01 0 00 000101 movx t1, .priou ;[252] Continue to type on terminal 39804 001674'01 505 02 0 00 400000 hrli t2, .fhslf ;[252] This process 39805 001675'01 400 03 0 00 000000 setz t3, ;[252] Let it blat as much as it wants 39806 001676'01 104 00 0 00 000011 ERSTR% ;[252] Display last Tops-20 error 39807 001677'01 320 14 0 00 001701' erjmps .+2 ;[252] Ignore strange return 39808 001700'01 320 14 0 00 001701' erjmps .+1 ;[252] Ignore stranger return 39809 001701'01 endif. ;[252] End case displaying last Tops-20 error 39810 001701'01 561 01 0 00 001312* hrroi t1, crlf ;[252] Tops-20 pointer to carriage return line feed 39811 001702'01 104 00 0 00 000076 PSOUT% ;[252] Type it 39812 001703'01 320 12 0 00 001704' erjmpr .+1 ;[252] Ignore error, we're trying hard enough... 39813 001704'01 200 01 0 00 006437' movx t1, cz%ncl!.fhslf ;[252] Function is to close any JFN's which are not open 39814 001705'01 104 00 0 00 000034 CLZFF% ;[252] For this fork, only 39815 001706'01 320 12 0 00 001707' erjmpr .+1 ;[252] Ignore the error 39816 001707'01 254 00 0 00 001104* callret cmder1 ;[252] Allow a reparse 39817 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20SRV MAC 9-Aug-24 12:55 LOCAL DIRECTORY command execution [111] 39818 subttl LOCAL DIRECTORY command execution [111] 39819 39820 001710'01 $ydire: entry $ydire ; Invoked from k20par 39821 001710'01 550 01 0 00 001640* hrrz t1, pars3 ; Load parsed JFN 39822 001711'01 260 17 0 00 005474' call isdird ;[193] Is this a directory device? 39823 001712'01 254 00 0 00 001716' ifskp. ;[193] If worked, proceed 39824 001713'01 402 00 0 00 001255* setzm ffunc ; Function is "directory". 39825 001714'01 254 00 0 00 001752' jrst $ydir1 ; Go do the directory 39826 001715'01 254 00 0 00 001752' else. ;[193] Otherwise, not a directory device (or failed) 39827 001716'01 265 16 0 00 001554* anstkv (t4,^d4) ;[193] Allocate an anonymous stack variable 39828 001717'01 000000 000004 39829 001720'01 415 04 0 17 777773 39830 001721'01 200 02 0 00 000001 move t2, t1 ;[193] Reposition the device designator 39831 001722'01 560 01 0 00 000004 hrro t1, t4 ;[193] Create pointer to stack space 39832 001723'01 104 00 0 00 000121 DEVST% ;[193] Convert to a string 39833 001724'01 320 12 0 00 001726' ifje. r ;[193] Failed?? 39834 001725'01 254 00 0 00 001731' 39835 001726'01 200 03 0 00 000001 move t3, t1 ;[193] Save error for debugger 39836 001727'01 561 04 0 00 001322' hrroi t4, badevc ;[193] Load a default 39837 001730'01 254 00 0 00 001735' else. ;[193] Otherwise, we have a good device 39838 001731'01 120 02 0 00 006441' dmove t2, [exp ":", .chnul] ;[193] 39839 001732'01 136 02 0 00 000001 idpb t2, t1 ;[193] Punctuate device 39840 001733'01 136 03 0 00 000001 idpb t3, t1 ;[193] Tie off the string 39841 001734'01 661 04 0 00 777777 tlo t4, -1 ;[193] So turn it into a pointer 39842 001735'01 endif. ;[193] 39843 001735'01 200 01 0 00 000004 move t1, t4 ;[193] Device name 39844 001736'01 104 00 0 00 000313 ESOUT% ;[193] Begin complaining 39845 001737'01 200 01 0 00 000000# txmsg < does not have a directory to list files> ;[193] 39846 001740'01 104 00 0 00 000076 39847 001741'01 320 12 0 00 001742' 39848 000215'02 000000000000# 39849 000417'04 040 144 157 145 163 39850 001742'01 561 01 0 00 001701* hrroi t1, crlf ;[193] Newline 39851 001743'01 104 00 0 00 000076 PSOUT% ;[193] 39852 001744'01 400 01 0 00 000000 setz t1, ;[193] Cons up a zero 39853 001745'01 250 01 0 00 001710* exch t1, pars3 ;[193] Get and clear parsed JFN 39854 001746'01 621 01 0 00 777777 tlz t1, -1 ;[193] Clear any goofy flags 39855 001747'01 104 00 0 00 000023 RLJFN% ;[193] Punt it 39856 001750'01 320 12 0 00 001751' erjmpr .+1 ;[193] Catch and ignore error 39857 001751'01 263 17 0 00 000000 ret ;[193] And get out of here 39858 001752'01 endif. ;[193] End case device check 39859 39860 001752'01 200 02 0 00 001745* $ydir1: move t2, pars3 ; Here's the JFN. 39861 001753'01 402 00 0 00 000000* setzm filjfn ; Make sure no one thinks this is in use. 39862 001754'01 260 17 0 00 001766' call dirhdr ; Do the header first. 39863 39864 ; File-listing loop 39865 39866 001755'01 do. ;[194] Enter loop lexical context 39867 001755'01 260 17 0 00 006144' call dmpbuf ; Get some directory listing. 39868 001756'01 260 17 0 00 002033' call dirlst ; Print it. 39869 001757'01 326 01 0 00 001755' jumpn t1, top. ;[194] Go back for more. 39870 001760'01 enddo. ;[194] Exit loop lexical context 39871 39872 001760'01 263 17 0 00 000000 ret ; Till done. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-1 K20SRV MAC 9-Aug-24 12:55 LOCAL DIRECTORY command execution [111] 39873 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20SRV MAC 9-Aug-24 12:55 Directory Header Set Up 39874 subttl Directory Header Set Up 39875 39876 ; Call: 39877 ; 39878 ; t2/ JFN of files to list. 39879 ; 39880 ; Returns: 39881 ; 39882 ; +1, always. 39883 ; 39884 ; Puts the directory listing header into the server buffer. 39885 ; Initializes buffer pointers, counters, etc. 39886 39887 repeat 0,< ;[250] Don't have this in section zero 39888 hdrtxt: asciz / 39889 Name Pages Bytes(Size) Creation Date 39890 / ;[193] Directory listing header 39891 hdrptr: point 7, hdrtxt ;[193] Pointer to heading text 39892 -^d62 ;[193] Length of text 39893 >;repeat 0 ;[250] 39894 39895 001761'01 472531 435000 nuldev: byte (7) "N","U","L",":",.chnul ;[193] 39896 001762'01 44 07 0 00 001761' nul4:: point 7, nuldev ; Pointer to fixed "NUL:" string 39897 001763'01 777777 777774 -^d4 ; Length 39898 39899 001764'01 000000 000015 crlfch: .chcrt ;[251] Carriage Return 39900 001765'01 000000 000012 .chlfd ;[251] Line Feed 39901 39902 001766'01 202 02 0 00 000000* dirhdr: movem t2, ndxjfn ; Save wildcard bits. 39903 001767'01 552 02 0 00 000000* hrrzm t2, nxtjfn ; Initialize lookahead 39904 001770'01 402 00 0 00 000000# setzm filcnt ; File counter 39905 001771'01 476 00 0 00 000000# setom dirfin ; Initialize directory finished flag to assume error 39906 ; Put the listing in the server buffer. 39907 001772'01 332 00 0 00 001713* ifme. ffunc ; Directory listing? 39908 001773'01 254 00 0 00 002027' 39909 001774'01 550 03 0 00 000002 hrrz t3,t2 ;[193] Pick up just the JFN, no flags 39910 001775'01 302 03 0 00 377777 caie t3, .nulio ;[193] Data sink? 39911 001776'01 254 00 0 00 002005' ifskp. ;[193] Yep, that's easy enough 39912 001777'01 200 01 0 00 006453' move t1, [point 7, srvbuf, 27] ;[193] Points to ":" 39913 002000'01 621 02 0 00 777777 tlz t2, -1 ;[193] Shut off the flags (shouldn't be any) 39914 002001'01 211 03 0 00 000004 movni t3, ^d4 ;[193] What counted SOUT% would have wanted 39915 002002'01 200 04 0 00 001761' move t4, nuldev ;[193] Load device name in ASCII 39916 002003'01 202 04 0 00 000000# movem t4, srvbuf ;[193] Drop right into the buffer 39917 remark SOUT% ;[193] Bum the JSYS 39918 002004'01 254 00 0 00 002026' else. ;[193] Otherwise, put real file name in buffer 39919 002005'01 200 01 0 00 006454' move t1, [point 7, srvbuf] 39920 002006'01 120 03 0 00 000000* dmove t3, allfld ;[252] Everything, no goofy prefix 39921 002007'01 104 00 0 00 000030 JFNS 39922 002010'01 320 14 0 00 002011' erjmps .+1 ;[193] Catch and suppress error 39923 39924 smsg (< 39925 Name Pages Bytes(Size) Creation Date 39926 002011'01 120 02 0 00 000000# >) ;;[250] 39927 002012'01 260 17 0 00 000000* 39928 000216'02 000000000000# k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25-1 K20SRV MAC 9-Aug-24 12:55 Directory Header Set Up 39929 000217'02 777777 777702 39930 000430'04 015 012 116 141 155 39931 39932 39933 repeat 0,< ;[250] 39934 dmove t2, hdrptr ;[193] The standard header 39935 call %%smsg ;[216] Print heading. 39936 ;[216] erjmps +1 ;[194] Catch and suppress error 39937 >;repeat 0 ;[250] 39938 39939 002013'01 200 02 0 00 001766* move t2, ndxjfn ;[251] Load the JFN and bits 39940 002014'01 205 03 0 00 700000 movx t3,gj%dev!gj%unt!gj%dir ;[251] Will resolve if any were wildcarded 39941 002015'01 404 03 0 00 000002 and t3, t2 ;[251] Determine initial wildcard position 39942 002016'01 322 03 0 00 002026' ifn. t3 ;[251] If any set, then emit first position 39943 002017'01 630 02 0 00 000003 tdz t2, t3 ;[251] Stomp those specific wildcard flags 39944 002020'01 120 03 0 00 001764' dmove t3, crlfch ;[251] Seperation sequence 39945 002021'01 136 03 0 00 000001 idpb t3, t1 ;[251] Carriage return 39946 002022'01 136 04 0 00 000001 idpb t4, t1 ;[251] Line feed 39947 dmove t3, [fld(.jsaof,js%dev)!fld(.jsaof,js%dir)!js%paf ;[251] 39948 002023'01 120 03 0 00 006455' 0 ] ;[251] Just punctuated device and directory 39949 002024'01 104 00 0 00 000030 JFNS% ;[251] Indicate resolved location in listing 39950 002025'01 320 14 0 00 002026' erjmps .+1 ;[251] Catch and suppress error 39951 002026'01 endif. ;[251] End case wildcarded directory 39952 002026'01 endif. ;[193] End special case .nulio 39953 002026'01 254 00 0 00 002030' else. ;[193] Otherwise, just reset the buffer pointer 39954 002027'01 200 01 0 00 006457' move t1, [point 7, srvbuf] 39955 002030'01 endif. ;[194] End case file function decision 39956 39957 002030'01 402 00 0 00 000000# setzm dirfin ; No error, so not finished. 39958 002031'01 202 01 0 00 000000# movem t1, srvptr ; Preserve string buffer pointer. 39959 002032'01 263 17 0 00 000000 ret 39960 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20SRV MAC 9-Aug-24 12:55 Directory Listing Display Logic 39961 subttl Directory Listing Display Logic 39962 39963 ; Constructs directory listing text in a chunk of memory starting at 39964 ; SRVBUF and ending at (or slightly after) SRVBZ. Updates SRVPTR. 39965 ; 39966 ; Returns +1 always, with t1/ -1 if we got some data, t1/ 0 if done. 39967 ; 39968 ; Keeps global file counter in FILCNT. 39969 ; 39970 ; Be aware that the routine is doing double duty for ANY file function 39971 ; that might need to be executed over a set of files. 39972 39973 002033'01 400 01 0 00 000000 dirlst: setz t1, 39974 002034'01 332 00 0 00 000000# skipe dirfin ; Finished? 39975 002035'01 263 17 0 00 000000 ret ; Yes. 39976 002036'01 200 01 0 00 000000# move t1, srvptr ; No, there's more to do. 39977 002037'01 120 02 0 00 001764' dmove t2, crlfch ;[251] Load the line break 39978 002040'01 136 02 0 00 000001 idpb t2, t1 ;[194] And issue 39979 002041'01 136 03 0 00 000001 idpb t3, t1 ;[194] it 39980 002042'01 202 01 0 00 000000# movem t1, srvptr ; Save the buffer pointer. 39981 002043'01 260 17 0 00 005525' call gtnfil ; Get next file. 39982 002044'01 254 00 0 00 002165' jrst dirlsz ; If none, done. 39983 002045'01 350 00 0 00 000000# aos filcnt ; Got one, count it. 39984 39985 ;[133] Get detailed size info from FDB. 39986 39987 002046'01 550 02 0 00 000001 hrrz t2, t1 ;[251] Load JFN with no flags 39988 002047'01 200 01 0 00 006460' move t1, [byte (7) .chspc,.chspc,.chspc,.chspc,.chspc] ;[193] 39989 002050'01 202 01 0 00 000000* movem t1, filbuf ;[194] Fill the filename buffer with blanks. 39990 002051'01 200 01 0 00 006461' move t1, [filbuf,,filbuf+1] 39991 002052'01 251 01 0 00 000000# blt t1, filbfz-1 39992 39993 remark ;[193] Always put the file name in 39994 002053'01 302 02 0 00 377777 caie t2, .nulio ;[193] Data sink? 39995 002054'01 254 00 0 00 002061' ifskp. ;[193] Yes, don't do any of the file stuff 39996 002055'01 200 03 0 00 001761' move t3, nuldev ;[193] Just the device name 39997 002056'01 202 03 0 00 002050* movem t3, filbuf ;[193] Store a hardwired name 39998 002057'01 200 01 0 00 006462' move t1, [ point 7, filbuf, 27] ;[193] Where SOUT% would leave it 39999 002060'01 254 00 0 00 002066' else. ;[193] Otherwise, an honest file 40000 002061'01 200 01 0 00 006463' move t1, [point 7, filbuf] ; Now start filling in the fields. 40001 002062'01 200 03 0 00 006464' movx t3, fld(.jsaof,js%nam)!fld(.jsaof,js%typ)!fld(.jsaof,js%gen)!js%tmp!js%paf 40002 002063'01 400 04 0 00 000000 setz t4, ;[193] No goofy prefix 40003 002064'01 104 00 0 00 000030 JFNS 40004 002065'01 320 14 0 00 002165' erjmps dirlsz ;[193] Failed, get out of here 40005 002066'01 endif. ;[193] End special case NUL: 40006 002066'01 202 01 0 00 000000# movem t1, filptr ;[193] Store updated pointer 40007 40008 002067'01 332 00 0 00 001772* ifme. ffunc ; What was the file function? 40009 002070'01 254 00 0 00 002133' 40010 002071'01 260 17 0 00 005632' call filinf ;[200] Pull the file information 40011 002072'01 254 00 0 00 002165' jrst dirlsz ;[200] Or fail the loop 40012 002073'01 302 02 0 00 377777 caie t2, .nulio ;[193] Was it a directory of NUL:? 40013 002074'01 254 00 0 00 002100' ifskp. ;[193] Yes, so go make that up 40014 002075'01 260 17 0 00 002220' call nulist ;[193] Just make up our own entry 40015 002076'01 254 00 0 00 002165' jrst dirlsz ;[193] Failed, get out of here k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-1 K20SRV MAC 9-Aug-24 12:55 Directory Listing Display Logic 40016 002077'01 254 00 0 00 002133' else. ;[193] Otherwise, this is a real file 40017 002100'01 260 17 0 00 002235' call filist ;[193] Construct text for this file 40018 002101'01 254 00 0 00 002165' jrst dirlsz ;[193] Failed, get out of here 40019 002102'01 510 03 0 00 001767* hllz t3, nxtjfn ;[251] Load current file's stepping flags 40020 002103'01 630 03 0 00 006465' andx t3,gn%str!gn%dir ;[251] Trigger on structure or device change 40021 002104'01 322 03 0 00 002133' ifn. t3 ;[251] If either changed, then emit current position 40022 002105'01 120 03 0 00 001764' dmove t3, crlfch ;[251] Seperation sequence 40023 002106'01 136 03 0 00 000001 idpb t3, t1 ;[251] Carriage return 40024 002107'01 136 04 0 00 000001 idpb t4, t1 ;[251] Line feed 40025 002110'01 200 03 0 00 000001 move t3, t1 ;[251] Get a copy of the pointer 40026 002111'01 400 04 0 00 000000 setz t4, ;[251] Cons up a NUL 40027 002112'01 136 04 0 00 000003 idpb t4, t3 ;[251] Tie off string, allowing append 40028 002113'01 415 16 0 00 002126' block. ;[251] Get another stack context for control flow 40029 002114'01 261 17 0 00 000016 40030 002115'01 265 16 0 00 006466' saveac ;[251] Leave whatever JFN is in t2, alone 40031 002116'01 550 02 0 00 002013* hrrz t2, ndxjfn ;[251] Load next JFN in sequence, no flags 40032 002117'01 120 03 0 00 001764' dmove t3, crlfch ;[251] Seperation sequence 40033 002120'01 136 03 0 00 000001 idpb t3, t1 ;[251] Carriage return 40034 002121'01 136 04 0 00 000001 idpb t4, t1 ;[251] Line feed 40035 dmove t3, [fld(.jsaof,js%dev)!fld(.jsaof,js%dir)!js%paf ;[251] 40036 002122'01 120 03 0 00 006455' 0 ] ;[251] Just punctuated device and directory 40037 002123'01 104 00 0 00 000030 JFNS% ;[251] Indicate change in listing 40038 002124'01 320 14 0 00 000700* erjmps rskp ;[251] +2 return, failed 40039 remark ;[251] +1 return, WORKED!! 40040 002125'01 263 17 0 00 000000 endbk. ;[251] End block context, restoring t2 40041 002126'01 254 00 0 00 002133' ifskp. ;[251] +2 failed? 40042 002127'01 200 03 0 00 000001 move t3, t1 ;[251] Get a copy of the pointer 40043 002130'01 400 04 0 00 000000 setz t4, ;[251] Cons up a NUL 40044 002131'01 136 04 0 00 000003 idpb t4, t3 ;[251] Tie off anything we wrote, allowing append 40045 002132'01 254 00 0 00 002165' jrst dirlsz ;[251] Failed the JFNS%, beat it 40046 002133'01 endif. ;[251] End case JFNS% error handling 40047 002133'01 endif. ;[251] End case printing directory on change 40048 002133'01 endif. ;[193] End .nulio special casing 40049 002133'01 endif. ;[193] End case doing a directory 40050 40051 002133'01 202 01 0 00 000000# movem t1, filptr ;[193] Store updated pointer 40052 002134'01 400 03 0 00 000000 setz t3, ; Done with this line, make it asciz. 40053 002135'01 136 03 0 00 000001 idpb t3, t1 40054 40055 ; Copy the result into the server sending buffer. 40056 40057 002136'01 415 16 0 00 002152' block. ;[202] Set up a stack frame 40058 002137'01 261 17 0 00 000016 40059 002140'01 265 16 0 00 006474' saveac ;[202] movst gorges on registers 40060 002141'01 200 05 0 00 000000# move q1, srvptr ;[202] Load server buffer pointer 40061 002142'01 200 02 0 00 006463' move t2, [point 7, filbuf] ;[202] Load source pointer 40062 002143'01 403 03 0 00 000006 setzb t3, q2 ;[202] Force section local pointers 40063 002144'01 200 01 0 00 006506' move t1, [S!mxascz] ;[202] Limit source length, start significance 40064 002145'01 200 04 0 00 006511' movx t4, [mxascz] ;[202] Limit destination length 40065 002146'01 123 01 0 00 000000* extend t1, movasc ;[202] Move characters, doing useless translating 40066 002147'01 600 00 0 00 000000 nop ;[202] Will never +1 because t1 and t4 are equal 40067 002150'01 202 05 0 00 000000# movem q1, srvptr ;[202] Save updated destination pointer 40068 002151'01 263 17 0 00 000000 endbk. ;[202] End of stack frame 40069 40070 ; Still expect to have file jfn in t2 when we get here. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-2 K20SRV MAC 9-Aug-24 12:55 Directory Listing Display Logic 40071 40072 002152'01 336 01 0 00 002067* skipn t1, ffunc ;[199] What is the function? 40073 002153'01 254 00 0 00 002156' ifskp. ;[200] Not doing a directory 40074 remark t2, ;[200] Already has the right JFN 40075 002154'01 500 02 0 00 002116* hll t2, ndxjfn ;[200] Put in the global stepping flags 40076 002155'01 260 17 0 01 000000 call (t1) ;[200] and go do selected function. 40077 002156'01 endif. ;[200] 40078 40079 002156'01 200 01 0 00 000000# move t1, srvptr 40080 002157'01 550 02 0 00 000001 hrrz t2, t1 ; See if buffer full. 40081 002160'01 305 02 0 00 000000# caige t2, srvbz ;[194] Full? 40082 002161'01 254 00 0 00 002164' ifskp. ;[194] It is 40083 002162'01 474 01 0 00 000000 seto t1, ; Return indicating we have data. 40084 002163'01 263 17 0 00 000000 ret 40085 002164'01 endif. ;[194] 40086 002164'01 254 00 0 00 002033' jrst dirlst ; Loop for another file 40087 40088 ; Done, print summary. 40089 40090 002165'01 200 01 0 00 000000# dirlsz: move t1, srvptr ; Get the buffer pointer. 40091 002166'01 201 02 0 00 000040 movei t2, .chspc ;[194] Summary. First a space. 40092 002167'01 104 00 0 00 000051 BOUT 40093 002170'01 200 02 0 00 000000# move t2, filcnt ; Then the number of files. 40094 002171'01 201 03 0 00 000012 movei t3, ^d10 40095 002172'01 104 00 0 00 000224 NOUT 40096 002173'01 320 16 0 00 002174' erjmp .+1 40097 002174'01 376 00 0 00 000000# sosn filcnt ; Do singular or plural right. 40098 002175'01 254 00 0 00 002201' ifskp. ; Was more than one 40099 smsg < files 40100 002176'01 120 02 0 00 000000# > 40101 002177'01 260 17 0 00 002012* 40102 000220'02 000000000000# 40103 000221'02 777777 777770 40104 000445'04 040 146 151 154 145 40105 40106 002200'01 254 00 0 00 002203' else. ; Otherwise, unary case 40107 smsg < file 40108 002201'01 120 02 0 00 000000# > 40109 002202'01 260 17 0 00 002177* 40110 000222'02 000000000000# 40111 000223'02 777777 777771 40112 000447'04 040 146 151 154 145 40113 40114 002203'01 endif. 40115 40116 002203'01 202 01 0 00 000000# movem t1, srvptr ; Save pointer. 40117 002204'01 477 01 0 00 000000# setob t1, dirfin ; Say we're returning data. 40118 remark dirfin ; Set finished flag for next time through. 40119 002205'01 263 17 0 00 000000 ret 40120 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20SRV MAC 9-Aug-24 12:55 NUL: device directory listing 40121 subttl NUL: device directory listing 40122 40123 ;[193] Begin Code Insertion 40124 40125 ; Expects t1 to point to a buffer area to write text 40126 40127 002206'01 011 011 040 040 040 nuldir: asciz / 0 0(7) Now/ 40128 002214'01 000000 000031 nulfil: ^d25 ; Length of phoney directory entry 40129 002215'01 44 07 0 00 002206' point 7, nuldir ; Pointer to our phoney directory entry 40130 40131 002216'01 movchr: intern movchr ; Extended opcode is also used elsewhere 40132 002216'01 016 00 0 00 000000 movslj 0, 0 ; No accumulator; E1 unused 40133 002217'01 000000 000040 .chspc ; Fill with spaces 40134 40135 002220'01 261 17 0 00 000005 nulist: push p, q1 ; Extend gorges on registers 40136 002221'01 261 17 0 00 000006 push p, q2 40137 40138 002222'01 200 05 0 00 000001 move q1, t1 ; Reposition destination 40139 002223'01 120 01 0 00 002214' dmove t1, nulfil ; Load source length and pointer 40140 002224'01 200 04 0 00 000001 move t4, t1 ; Source and destination are the same length 40141 002225'01 400 03 0 00 000006 setz t3, q2 ; Force section local pointers 40142 002226'01 123 01 0 00 002216' extend t1, movchr ; Copy the listing over 40143 002227'01 600 00 0 00 000000 nop ; Will never +1 since t1 == t4 40144 002230'01 200 01 0 00 000005 move t1, q1 ; Return final destination pointer 40145 remark t4, ; t4 is still zero 40146 002231'01 136 04 0 00 000005 idpb t4, q1 ; Tie of the string, allowing append 40147 40148 002232'01 262 17 0 00 000006 pop p, q2 ; Restore registers 40149 002233'01 262 17 0 00 000005 pop p, q1 40150 002234'01 254 00 0 00 002124* retskp ; Return success, pointing to .chnul 40151 40152 ;[193] End Code Insertion 40153 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20SRV MAC 9-Aug-24 12:55 Real directory listing, including file size and creation date. 40154 subttl Real directory listing, including file size and creation date. 40155 40156 ; Call: 40157 ; 40158 ; t1/ Pointer to buffer area 40159 ; 40160 ; Assumes the following are valid: 40161 ; 40162 ; pagcnt/ Number of pages (or blocks) in the file 40163 ; bytcnt/ Count of bytes in the file and byte size 40164 ; crdate/ Creation date and time 40165 ; 40166 ; In other words that filinf has been called. Note that it is a 40167 ; mistake to use this when doing .nulio, even though filinf will 40168 ; put reasonable (yet false) data in. The resulting string will 40169 ; always be the same, so this is special cased. 40170 40171 ;[122] The rest of this routine rewritten to provide nice columnar listing. 40172 40173 002235'01 200 01 0 00 000000# filist: move t1, filptr ;[193] Load current buffer pointer 40174 002236'01 201 03 0 00 000040 movei t3, .chspc ; Put a blank over the null left by JFNS. 40175 002237'01 136 03 0 00 000001 idpb t3, t1 40176 40177 002240'01 550 02 0 00 000001 hrrz t2, t1 ; Get address from updated pointer. 40178 002241'01 301 02 0 00 000000# cail t2, filbuf+4 ; Name stayed within its field? 40179 002242'01 254 00 0 00 002246' ifskp. ;[194] It did 40180 002243'01 200 01 0 00 006512' move t1, [point 7, filbuf+4] ; Yes, advance to next field. 40181 002244'01 200 03 0 00 006513' movx t3, 40182 002245'01 254 00 0 00 002251' else. ;[194] Otherwise, blew through it 40183 002246'01 201 02 0 00 000040 movei t2, .chspc ; No, do free format. 40184 002247'01 136 02 0 00 000001 idpb t2, t1 ; Deposit a blank, advance pointer. 40185 002250'01 201 03 0 00 000012 movei t3, ^d10 ; No fixed-field stuff on page count. 40186 002251'01 endif. ;[194] 40187 40188 ;[133] More detailed info about size: pages, byte count, byte size. 40189 40190 002251'01 550 02 0 00 000000* hrrz t2, pagcnt ; Number of pages in file. 40191 002252'01 104 00 0 00 000224 NOUT 40192 002253'01 320 14 0 00 001210* erjmps r ; Catch and suppress error, returning +1 40193 002254'01 201 03 0 00 000040 movei t3, .chspc ; A blank 40194 002255'01 136 03 0 00 000001 idpb t3, t1 40195 002256'01 200 02 0 00 000000* move t2, bytcnt ; Byte count, free format. 40196 002257'01 201 03 0 00 000012 movei t3, ^d10 40197 002260'01 104 00 0 00 000224 NOUT 40198 002261'01 320 14 0 00 002253* erjmps r ; Catch and suppress error, returning +1 40199 40200 002262'01 135 02 0 00 006514' ldb t2, [pointr (pagcnt,fb%bsz)] ;[200] Load the byte size 40201 002263'01 322 02 0 00 002274' ifn. t2 ;[200] Device may not do byte sizes 40202 002264'01 201 03 0 00 000050 movei t3, "(" ; Byte size, in parens. 40203 002265'01 136 03 0 00 000001 idpb t3, t1 40204 002266'01 201 03 0 00 000012 movei t3, ^d10 40205 002267'01 104 00 0 00 000224 NOUT 40206 002270'01 320 14 0 00 002261* erjmps r ; Catch and suppress error, returning +1 40207 002271'01 201 03 0 00 000051 movei t3, ")" 40208 002272'01 136 03 0 00 000001 idpb t3, t1 ;[133](end) Closing parens. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20SRV MAC 9-Aug-24 12:55 Real directory listing, including file size and creation date. 40209 002273'01 254 00 0 00 002277' else. ;[200] Fix string contiguity 40210 002274'01 200 02 0 00 000001 move t2, t1 ;[200] Get a copy of the pointer 40211 002275'01 201 03 0 00 000040 movei t3, .chspc ;[200] Load a space 40212 002276'01 136 03 0 00 000002 idpb t3, t2 ;[200] Overwrite the .chnul 40213 002277'01 endif. ;[200] 40214 40215 002277'01 301 03 0 00 000000# cail t3, filbuf+11 ;[194] Out of the field? 40216 002300'01 254 00 0 00 002303' ifskp. ;[194] No, that's great! 40217 002301'01 200 01 0 00 006515' move t1, [point 7, filbuf+11] 40218 002302'01 254 00 0 00 002305' else. ;[194] Otherwise, overflowed field 40219 002303'01 201 02 0 00 000040 movei t2, .chspc ; Put in a blank to separate. 40220 002304'01 136 02 0 00 000001 idpb t2, t1 40221 002305'01 endif. 40222 40223 002305'01 336 02 0 00 000000* skipn t2, crdate ;[200] Pick up creation date, if there is one 40224 002306'01 254 00 0 00 002312' ifskp. ;[200] There was, let's type it 40225 002307'01 205 03 0 00 010000 movx t3, ot%4yr ;[200] We're waaaaay past the millenium 40226 002310'01 104 00 0 00 000220 ODTIM% ;[200] Finally display something 40227 002311'01 320 14 0 00 002270* erjmps r ;[200] Catch and suppress error, returning +1 40228 002312'01 endif. ;[200] 40229 002312'01 254 00 0 00 002234* retskp ;[193] Won 40230 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20SRV MAC 9-Aug-24 12:55 REMOTE DIRECTORY execution 40231 subttl REMOTE DIRECTORY execution 40232 40233 002313'01 336 00 0 00 001344* $xdire: ifmn. tlgjfn ;[233] Doing transaction logging? 40234 002314'01 254 00 0 00 002336' 40235 002315'01 415 16 0 00 002336' block. ;[233] Get a stack frame 40236 002316'01 261 17 0 00 000016 40237 002317'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 40238 002320'01 476 00 0 00 001337* setom scrlft ;[233] Don't append the crlf! 40239 002321'01 265 01 0 00 001340* wtlog(,) ;[233] 40240 002322'01 000000000000# 40241 002323'01 777777 777734 40242 002324'01 000000 000000 40243 000451'04 122 145 161 165 145 40244 002325'01 200 01 0 00 002313* move t1, tlgjfn ;[233] Put the directory name in the log 40245 002326'01 561 02 0 00 001647* hrroi t2,atmbuf ;[233] It's in the atom buffer 40246 002327'01 403 03 0 00 000004 setzb t3,t4 ;[233] Don't know how long, stop on a NUL 40247 002330'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 40248 002331'01 320 14 0 00 002332' erjmps .+1 ;[233] Catch and suppress error 40249 dmove t2,[ -1,,crlf ;[233] Tops-20 pointer to carriage return line feed 40250 002332'01 120 02 0 00 006443' -2 ] ;[233] Counted SOUT%'s are faster 40251 002333'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 40252 002334'01 320 14 0 00 002335' erjmps .+1 ;[233] Catch and suppress error 40253 002335'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 40254 002336'01 endif. ;[233] 40255 40256 002336'01 260 17 0 00 001355* call statim ;[189] Start timing so k20pdc doesn't choke 40257 002337'01 201 04 0 00 000104 movei t4, "D" ; Generic command is D. 40258 002340'01 254 00 0 00 005362' jrst srvfil 40259 40260 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20SRV MAC 9-Aug-24 12:55 REMOTE ERROR parsing 40261 subttl REMOTE ERROR parsing 40262 40263 ; This is a SECRET command to send an (optionally) null error packet. Shh!! 40264 40265 chgsec(code,const) ;;Chained fdb's go in const 40266 000224'02 010004 000227' xerfdb: flddb. .cmcfm,,,,,xerfd1 40267 000225'02 000000 000000 40268 000226'02 44 07 0 00 000553' 40269 000227'02 021004 000232' xerfd1: flddb. .cmqst,,,,,xerfd2 40270 000230'02 000000 000000 40271 000231'02 44 07 0 00 000561' 40272 000232'02 017004 000000 xerfd2: flddb. .cmtxt,,,,, 40273 000233'02 000000 000000 40274 000234'02 44 07 0 00 000561' 40275 retsec 40276 cleans() 40277 40278 002341'01 201 01 0 00 000000# .xerr: movei t1, xerfdb ;[220] Allow a quote of the remote file specification 40279 002342'01 260 17 0 00 001376* call rfield ;[220] Try to parse something 40280 002343'01 135 03 0 00 006275' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ;[220] Get function code. 40281 40282 002344'01 306 03 0 00 000010 cain t3, .cmcfm ;[220] Confirm? 40283 002345'01 263 17 0 00 000000 ret ;[220] We're done 40284 40285 002346'01 260 17 0 00 001637* confrm ;[220] Otherwise tie off the line 40286 002347'01 200 01 0 00 006377' move t1,[point 7,atmbuf];[220] Load pointer to complaint department 40287 002350'01 202 01 0 00 001752* movem t1, pars3 ;[220] and ask to ship that off 40288 40289 002351'01 263 17 0 00 000000 ret 40290 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20SRV MAC 9-Aug-24 12:55 REMOTE ERROR semantic action 40291 subttl REMOTE ERROR semantic action 40292 40293 002352'01 265 16 0 00 006254' $xerr: saveac ;[220] Extra register for possible pointer 40294 002353'01 260 17 0 00 002336* call statim ;[189] Start timing so k20pdc doesn't choke 40295 002354'01 336 05 0 00 002350* skipn q1, pars3 ;[220] Wants to send accompanying text 40296 002355'01 254 00 0 00 002365' ifskp. ;[220] Must be really annoyed... 40297 002356'01 400 03 0 00 000000 setz t3, ;[220] Let's assume a bogus parse 40298 002357'01 200 02 0 00 000005 move t2, q1 ;[220] Load the pointer we were passed 40299 002360'01 134 03 0 00 000002 ildb t3, t2 ;[220] Try to get a character 40300 002361'01 320 12 0 00 002362' erjmpr .+1 ;[220] Catch and store error for debuggers 40301 002362'01 306 03 0 00 000000 cain t3, 0 ;[220] Anything there? 40302 002363'01 254 00 0 00 002365' anskp. ;[220] No, so still sending a null packet 40303 002364'01 254 00 0 00 002373' else. ;[220] No pointer, or bad pointer or no data 40304 002365'01 201 01 0 00 000105 movei t1, "E" ; Send an error packet. 40305 002366'01 200 02 0 00 000000* move t2, pktnum ;[220] Packet number must match 40306 002367'01 403 03 0 00 000004 setzb t3, t4 ;[220] Yet no data 40307 002370'01 260 17 0 00 000000* call spack ;[220] Send the packet... 40308 002371'01 600 00 0 00 000000 nop ;[220] ... and ignore the response 40309 002372'01 263 17 0 00 000000 ret ;[220] Done with this trivial case 40310 002373'01 endif. ;[220] End argument check 40311 40312 remark ;[220] Otherwise, stuff some text in 40313 002373'01 403 01 0 00 000002 setzb t1, t2 ;[220] Cons up some .chnul's 40314 002374'01 124 01 0 00 001017* dmovem t1, strbuf ;[220] Zero out old stuff 40315 002375'01 124 01 0 00 000000# dmovem t1, strbuf+2 ;[220] and a bit more of it 40316 002376'01 200 02 0 00 006420' move t2, [ point 7, strbuf ] ;[220] Point to string buffer 40317 002377'01 202 02 0 00 001062* movem t2, strptr ;[220] Save current location 40318 40319 002400'01 200 01 0 00 000005 move t1, q1 ;[220] Load pointer to error text 40320 002401'01 400 03 0 00 000000 setz t3, ;[220] Zero the count 40321 40322 002402'01 do. ; Enter loop context to copy the complaint 40323 002402'01 134 04 0 00 000001 ildb t4, t1 ; Pick up a byte of the wahhh 40324 002403'01 322 04 0 00 002406' jumpe t4, endlp. ; Stop at the end of the string 40325 002404'01 136 04 0 00 000002 idpb t4, t2 ; Deposit it in string buffer 40326 002405'01 344 03 0 00 002402' aoja t3, top. ; Get some more bytes, weee!! 40327 002406'01 enddo. ; End of loop context 40328 40329 002406'01 400 04 0 00 000000 setz t4, ;[220] Cons up a NUL 40330 002407'01 136 04 0 00 000002 idpb t4, t2 ;[220] Tie off string but don't count it 40331 40332 002410'01 201 01 0 00 000105 movei t1, "E" ;[220] Sending an error packet with extra flavoring 40333 002411'01 200 02 0 00 002366* move t2, pktnum ;[220] Packet number must match 40334 remark t3, data count ;[220] Unchanged from do. loop 40335 002412'01 200 04 0 00 002377* move t4, strptr ;[220] Load beginning of data area 40336 002413'01 260 17 0 00 002370* call spack ;[220] Send the packet... 40337 002414'01 600 00 0 00 000000 nop ;[220] ... and ignore the response 40338 002415'01 263 17 0 00 000000 ret ;[220] Done with the semantic action for ERROR 40339 40340 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20SRV MAC 9-Aug-24 12:55 FINISH command 40341 subttl FINISH command 40342 40343 ;[28] The FINISH command is edit 28. 40344 40345 ; Invoked by K20PAR 40346 40347 002416'01 .finis: entry .finis ;[220] 40348 002416'01 200 16 0 00 000000# guide (remote server operation) ; Parse rest of FINISH command. 40349 002417'01 260 17 0 00 001374* 40350 000235'02 000000000000# 40351 000461'04 162 145 155 157 164 40352 002420'01 260 17 0 00 002346* confrm 40353 002421'01 263 17 0 00 000000 ret 40354 40355 remark Execute FINISH command. 40356 40357 002422'01 $finis: entry $finis ;[220] 40358 002422'01 260 17 0 00 002353* call statim ;[189] Start timing so k20pdc doesn't choke 40359 002423'01 200 01 0 00 006517' move t1, [point 7, [asciz/F/]] ; An "F" for the data field. 40360 002424'01 201 02 0 00 000107 movei t2, "G" ; Packet type is G. 40361 002425'01 260 17 0 00 005134' call srvcmd ; Go send the command. 40362 002426'01 600 00 0 00 000000 nop ; Ignore any failure. 40363 002427'01 263 17 0 00 000000 ret ; Done. 40364 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20SRV MAC 9-Aug-24 12:55 REMOTE HELP 40365 subttl REMOTE HELP 40366 40367 remark REMOTE HELP parsing 40368 40369 002430'01 200 16 0 00 000000# .xhelp: guide 40370 002431'01 260 17 0 00 002417* 40371 000236'02 000000000000# 40372 000466'04 146 162 157 155 040 40373 002432'01 260 17 0 00 002420* confrm 40374 002433'01 263 17 0 00 000000 ret 40375 40376 remark REMOTE HELP execution 40377 40378 002434'01 336 00 0 00 002325* $xhelp: ifmn. tlgjfn ;[233] Doing transaction logging? 40379 002435'01 254 00 0 00 002446' 40380 002436'01 415 16 0 00 002446' block. ;[233] Get a stack frame 40381 002437'01 261 17 0 00 000016 40382 002440'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 40383 002441'01 265 01 0 00 002321* wtlog(,) ;[233] 40384 002442'01 000000000000# 40385 002443'01 777777 777741 40386 002444'01 000000 000000 40387 000472'04 122 145 161 165 145 40388 002445'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 40389 002446'01 endif. ;[233] 40390 40391 002446'01 260 17 0 00 002422* call statim ;[189] Start timing so k20pdc doesn't choke 40392 002447'01 260 17 0 00 005331' call sinfo ; Exchange parameters. 40393 002450'01 263 17 0 00 000000 ret ;[133] Failed, give up. 40394 dmove t1, [point 7, [asciz/H/] ; H command for data field. 40395 002451'01 120 01 0 00 006521' "G" ] ; Packet type is G. 40396 002452'01 254 00 0 00 005406' jrst dosrv 40397 40398 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20SRV MAC 9-Aug-24 12:55 REMOTE HOST parsing 40399 subttl REMOTE HOST parsing 40400 40401 chgsec(code,const) ;;Chained fdb's go in const 40402 000237'02 021004 000242' xhofdb: flddb. .cmqst,,,,,xhofd1 40403 000240'02 000000 000000 40404 000241'02 44 07 0 00 000566' 40405 000242'02 017004 000000 xhofd1: flddb. .cmtxt,,,,, 40406 000243'02 000000 000000 40407 000244'02 44 07 0 00 000566' 40408 retsec 40409 cleans() 40410 40411 002453'01 200 16 0 00 000000# .xhost: guide 40412 002454'01 260 17 0 00 002431* 40413 000245'02 000000000000# 40414 000501'04 143 157 155 155 141 40415 002455'01 201 01 0 00 000000# movei t1, xhofdb ;[220] Allow a quote of the remote command 40416 002456'01 260 17 0 00 001330* call cfield 40417 002457'01 263 17 0 00 000000 ret 40418 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20SRV MAC 9-Aug-24 12:55 REMOTE HOST command [105] 40419 subttl REMOTE HOST command [105] 40420 40421 002460'01 336 00 0 00 000332* $xhost: ifmn. takdep ;[176] Allow commands to servers from TAKE file 40422 002461'01 254 00 0 00 002471' 40423 002462'01 336 00 0 00 000000* ifmn. local ; This only works if local Kermit. 40424 002463'01 254 00 0 00 002471' 40425 002464'01 334 01 0 00 000000# ermsg% (,r) 40426 002465'01 254 00 0 00 002471' 40427 002466'01 202 01 0 00 000530* 40428 002467'01 104 00 0 00 000313 40429 002470'01 254 00 0 00 002311* 40430 000246'02 000000000000# 40431 000503'04 113 105 122 115 111 40432 40433 002471'01 endif. ;[194] End case not remote 40434 002471'01 endif. ;[194] End case allowing from take file 40435 40436 002471'01 260 17 0 00 002446* call statim ;[189] Start timing so k20pdc doesn't choke 40437 dmove t1, [point 7, atmbuf ; And move them from here 40438 002472'01 120 01 0 00 006523' point 7, strbuf] ; to here. 40439 40440 002473'01 do. ;[194] Enter loop context 40441 002473'01 134 04 0 00 000001 ildb t4, t1 ; Copy the string. 40442 002474'01 322 04 0 00 002477' jumpe t4, endlp. ;[194] 40443 002475'01 136 04 0 00 000002 idpb t4, t2 40444 002476'01 254 00 0 00 002473' loop. ;[194] 40445 002477'01 enddo. ;[194] 40446 40447 002477'01 200 03 0 00 000000* move t3, seolch ; Terminate it with the host's eol character. 40448 002500'01 136 03 0 00 000002 idpb t3, t2 40449 002501'01 136 04 0 00 000002 idpb t4, t2 ; And a null. 40450 40451 002502'01 260 17 0 00 000000* call ccon ;[169] Enable ^C during this bit. 40452 002503'01 254 00 0 00 000000* jrst ccoff ;[169] Where to go if ^C happens. 40453 002504'01 260 17 0 00 005331' call sinfo ; Exchange params. 40454 002505'01 254 00 0 00 002503* jrst ccoff ;[169] Failed, give up, turn off ^C trap. 40455 002506'01 260 17 0 00 002505* call ccoff ;[169] 40456 002507'01 200 01 0 00 006420' move t1, [point 7, strbuf] ; Point to command. 40457 002510'01 201 02 0 00 000103 movei t2, "C" ; Packet type is C. 40458 002511'01 254 00 0 00 005406' jrst dosrv ; Go send it and handle the reply. 40459 40460 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20SRV MAC 9-Aug-24 12:55 PWD command 40461 subttl PWD command 40462 40463 remark LOCAL PWD (trivial) parsing 40464 40465 002512'01 .ypwd: entry .ypwd 40466 002512'01 200 16 0 00 000000# guide 40467 002513'01 260 17 0 00 002454* 40468 000247'02 000000000000# 40469 000520'04 160 162 151 156 164 40470 002514'01 260 17 0 00 002432* confrm 40471 002515'01 263 17 0 00 000000 ret 40472 40473 remark LOCAL PWD semanic action 40474 40475 002516'01 $ypwd: entry $ypwd 40476 002516'01 561 01 0 00 001742* hrroi t1, crlf ; Offset from prompt 40477 002517'01 104 00 0 00 000076 PSOUT% 40478 002520'01 104 00 0 00 000013 GJINF% ; Get current job information. 40479 002521'01 201 01 0 00 000101 movei t1, .priou ; Type on terminal 40480 remark t2, ; Already has the connected directory 40481 002522'01 104 00 0 00 000041 DIRST% ; Translate into a string 40482 002523'01 320 12 0 00 002525' %jserr (,r) 40483 002524'01 254 00 0 00 002530' 40484 002525'01 265 01 0 00 001206* 40485 002526'01 000000 000000 40486 002527'01 254 00 0 00 002470* 40487 002530'01 561 01 0 00 002516* hrroi t1,crlf ; Tie off the line 40488 002531'01 104 00 0 00 000076 PSOUT% 40489 002532'01 263 17 0 00 000000 ret 40490 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20SRV MAC 9-Aug-24 12:55 REMOTE PWD 40491 subttl REMOTE PWD 40492 40493 ;[188] Begin Code Insertion 40494 40495 remark REMOTE PWD parsing 40496 40497 002533'01 200 16 0 00 000000# .xpwd: guide 40498 002534'01 260 17 0 00 002513* 40499 000250'02 000000000000# 40500 000526'04 160 162 151 156 164 40501 002535'01 260 17 0 00 002514* confrm 40502 002536'01 263 17 0 00 000000 ret 40503 40504 remark REMOTE PWD execution 40505 40506 002537'01 260 17 0 00 002471* $xpwd: call statim ;[189] Start timing so k20pdc doesn't choke 40507 dmove t1, [ 40508 point 7, [asciz/A/] ; 'A' command for data field. 40509 002540'01 120 01 0 00 006526' "G" ] ; Packet type is G. 40510 002541'01 254 00 0 00 005406' jrst dosrv 40511 40512 40513 ;[188] End Code Insertion 40514 40515 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20SRV MAC 9-Aug-24 12:55 LOCAL SPACE 40516 subttl LOCAL SPACE 40517 40518 remark LOCAL SPACE (trivial) parsing 40519 40520 002542'01 .ydisk: entry .ydisk 40521 002542'01 200 16 0 00 000000# guide 40522 002543'01 260 17 0 00 002534* 40523 000251'02 000000000000# 40524 000534'04 165 163 141 147 145 40525 002544'01 260 17 0 00 002535* confrm 40526 002545'01 263 17 0 00 000000 ret 40527 40528 remark LOCAL SPACE semanic action 40529 40530 002546'01 $ydisk: entry $ydisk 40531 002546'01 474 01 0 00 000000 seto t1, ; local disk usage query. 40532 002547'01 104 00 0 00 000305 GTDAL% 40533 002550'01 320 12 0 00 002552' %jserr (,r) 40534 002551'01 254 00 0 00 002555' 40535 002552'01 265 01 0 00 002525* 40536 002553'01 000000 000000 40537 002554'01 254 00 0 00 002527* 40538 002555'01 120 05 0 00 000001 dmove q1, t1 40539 txmsg < 40540 002556'01 200 01 0 00 000000# Quota: > ;[194] 40541 002557'01 104 00 0 00 000076 40542 002560'01 320 12 0 00 002561' 40543 000252'02 000000000000# 40544 000537'04 015 012 040 121 165 40545 40546 002561'01 305 05 0 00 006530' caige q1, [^d100000000] ;[194] Where did this number come from? 40547 002562'01 254 00 0 00 002567' ifskp. ;[194] Really big ... 40548 002563'01 200 01 0 00 000000# txmsg <+Inf> ;[194] 40549 002564'01 104 00 0 00 000076 40550 002565'01 320 12 0 00 002566' 40551 000253'02 000000000000# 40552 000542'04 053 111 156 146 000 40553 002566'01 254 00 0 00 002574' else. ;[194] 40554 002567'01 201 01 0 00 000101 numout q1 40555 002570'01 200 02 0 00 000005 40556 002571'01 201 03 0 00 000012 40557 002572'01 104 00 0 00 000224 40558 002573'01 320 14 0 00 002574' 40559 002574'01 endif. 40560 40561 002574'01 200 01 0 00 000000# txmsg <, used: > 40562 002575'01 104 00 0 00 000076 40563 002576'01 320 12 0 00 002577' 40564 000254'02 000000000000# 40565 000543'04 054 040 165 163 145 40566 002577'01 201 01 0 00 000101 numout q2 40567 002600'01 200 02 0 00 000006 40568 002601'01 201 03 0 00 000012 40569 002602'01 104 00 0 00 000224 40570 002603'01 320 14 0 00 002604' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38-1 K20SRV MAC 9-Aug-24 12:55 LOCAL SPACE 40571 002604'01 200 01 0 00 000000# txmsg < (pages)> 40572 002605'01 104 00 0 00 000076 40573 002606'01 320 12 0 00 002607' 40574 000255'02 000000000000# 40575 000545'04 040 050 160 141 147 40576 002607'01 263 17 0 00 000000 ret 40577 40578 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20SRV MAC 9-Aug-24 12:55 REMOTE SPACE 40579 subttl REMOTE SPACE 40580 40581 remark REMOTE SPACE parsing 40582 40583 002610'01 200 16 0 00 000000# .xdisk: guide 40584 002611'01 260 17 0 00 002543* 40585 000256'02 000000000000# 40586 000547'04 165 163 141 147 145 40587 002612'01 260 17 0 00 002544* confrm 40588 002613'01 263 17 0 00 000000 ret 40589 40590 remark REMOTE SPACE execution 40591 40592 002614'01 260 17 0 00 002537* $xdisk: call statim ;[189] Start timing so k20pdc doesn't choke 40593 dmove t1, [ 40594 point 7, [asciz/U/] ; U command for data field. 40595 002615'01 120 01 0 00 006532' "G" ] ; Packet type is G. 40596 002616'01 254 00 0 00 005406' jrst dosrv 40597 40598 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20SRV MAC 9-Aug-24 12:55 LOCAL STATISTICS 40599 subttl LOCAL STATISTICS 40600 40601 ; Parse rest of STATISTICS command. 40602 40603 002617'01 .stat: entry .stat 40604 002617'01 200 16 0 00 000000# guide 40605 002620'01 260 17 0 00 002611* 40606 000257'02 000000000000# 40607 000552'04 141 142 157 165 164 40608 002621'01 260 17 0 00 002612* confrm 40609 002622'01 263 17 0 00 000000 ret 40610 40611 remark LOCAL STATUS execution 40612 40613 ;[189] All part of edit [189] 40614 40615 002623'01 $ysrvt: entry $ysrvt 40616 extern $srvt,statxt ;[194] Our necessary 40617 002623'01 260 17 0 00 000000* call $srvt ; Format the stuff 40618 002624'01 561 01 0 00 000000* hrroi t1,statxt ; Point to text it built 40619 002625'01 104 00 0 00 000076 PSOUT% ; Print it 40620 002626'01 320 12 0 00 002554* erjmpr r ; Get error, get out of here 40621 002627'01 263 17 0 00 000000 ret ; Get out of here 40622 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20SRV MAC 9-Aug-24 12:55 REMOTE STATUS 40623 subttl REMOTE STATUS 40624 40625 ;[189] Begin Code Insertion 40626 40627 remark REMOTE STATUS parsing 40628 40629 002630'01 200 16 0 00 000000# .xstat: guide 40630 002631'01 260 17 0 00 002620* 40631 000260'02 000000000000# 40632 000557'04 157 146 040 154 141 40633 002632'01 260 17 0 00 002621* confrm 40634 002633'01 263 17 0 00 000000 ret 40635 40636 remark REMOTE STATUS execution 40637 40638 002634'01 336 00 0 00 002434* $xstat: ifmn. tlgjfn ;[233] Doing transaction logging? 40639 002635'01 254 00 0 00 002646' 40640 002636'01 415 16 0 00 002646' block. ;[233] Get a stack frame 40641 002637'01 261 17 0 00 000016 40642 002640'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 40643 002641'01 265 01 0 00 002441* wtlog(,) ;[233] 40644 002642'01 000000000000# 40645 002643'01 777777 777732 40646 002644'01 000000 000000 40647 000563'04 122 145 161 165 145 40648 002645'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 40649 002646'01 endif. ;[233] 40650 40651 002646'01 260 17 0 00 002614* call statim ;[189] Start timing so k20pdc doesn't choke 40652 dmove t1, [ 40653 point 7, [asciz/Q/] ; 'Q' command for data field. 40654 002647'01 120 01 0 00 006535' "G" ] ; Packet type is G. 40655 002650'01 254 00 0 00 005406' jrst dosrv 40656 40657 ;[198] End Code Insertion 40658 40659 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE [143] 40660 subttl LOCAL TYPE [143] 40661 40662 chgsec(code,const) ;;Tables and fdb's go in const 40663 000261'02 100120 000000 typbk: gj%old!gj%ifg!gj%flg ; Flag bits,,most recent generation. 40664 000262'02 000100 000101 .priin,,.priou ; COMND i/o. 40665 repeat 6,<0> ; No defaults, except all generations. 40666 000263'02 000000 000000 40667 000264'02 000000 000000 40668 000265'02 000000 000000 40669 000266'02 000000 000000 40670 000267'02 000000 000000 40671 000270'02 000000 000000 40672 000010 typbkl==<.-typbk> ; Length of this GTJFN argument block. 40673 40674 000271'02 006000 000273' typfdb: flddb. .cmfil,,,,,typfd1 40675 000272'02 000000 000000 40676 000273'02 016001 000000 typfd1: flddb. .cmdev,cm%sdh ;[193] 40677 000274'02 000000 000000 40678 retsec 40679 cleans() 40680 40681 002651'01 .ytype: entry .ytype 40682 002651'01 200 01 0 00 006437' movx t1, cz%ncl!.fhslf ; Close any nonopen JFNs. 40683 002652'01 104 00 0 00 000034 CLZFF 40684 002653'01 320 12 0 00 002654' erjmpr .+1 ;[194] Catch and ignore any odd error 40685 002654'01 200 16 0 00 000000# guide ; Issue guide words. 40686 002655'01 260 17 0 00 002631* 40687 000275'02 000000000000# 40688 000573'04 146 151 154 145 163 40689 40690 002656'01 200 01 0 00 006537' move t1, [typbk,,cjfnbk] ; Insert our file parsing defaults. 40691 002657'01 251 01 0 00 000000# blt t1, cjfnbk+typbkl ; Same as for DELETE. 40692 002660'01 201 01 0 00 000000# movei t1, typfdb ;[193] 40693 002661'01 260 17 0 00 002342* call rfield ;[193] Parse something 40694 002662'01 200 05 0 00 000002 move q1, t2 ;[193] Store whatever we got 40695 002663'01 135 07 0 00 006275' ldb q3, [pointr (.cmfnp(t3),cm%fnc)] ;[193] Get function code. 40696 40697 002664'01 302 07 0 00 000016 caie q3, .cmdev ;[193] Picked up a device? 40698 002665'01 254 00 0 00 002716' ifskp. ;[193] Yes, let's see if we can work with it 40699 002666'01 265 16 0 00 001716* anstkv(t4,^d4) ;[193] 20 characters of device name 40700 002667'01 000000 000004 40701 002670'01 415 04 0 17 777773 40702 002671'01 402 00 0 04 000000 setzm (t4) ;[193] Let's scrub a bit of it 40703 002672'01 560 01 0 00 000004 hrro t1, t4 ;[193] Create a Tops-20 ASCII pointer 40704 002673'01 104 00 0 00 000121 DEVST% ;[193] Turn it into a string (I hope) 40705 002674'01 320 12 0 00 002676' ifje. r ;[193] Failed?? 40706 002675'01 254 00 0 00 002701' 40707 002676'01 200 03 0 00 000001 move t3, t1 ;[193] Save error code for debuggers 40708 002677'01 474 06 0 00 000000 seto q2, ;[193] Cons up an impossible JFN 40709 002700'01 254 00 0 00 002715' else. ;[193] Otherwise, have a string we can maybe use 40710 002701'01 120 02 0 00 006441' dmove t2, [ exp ":", 0] ;[193] Load final characters 40711 002702'01 136 02 0 00 000001 idpb t2, t1 ;[193] Punctuate the device 40712 002703'01 136 03 0 00 000001 idpb t3, t1 ;[193] Tie off the device string 40713 002704'01 205 01 0 00 000021 movx t1, ;[193] Short form, want flags 40714 002705'01 560 02 0 00 000004 hrro t2, t4 ;[193] Recreate a Tops-20 ASCII pointer k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42-1 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE [143] 40715 002706'01 104 00 0 00 000020 GTJFN% ;[193] Try to get a handle 40716 002707'01 320 12 0 00 002711' ifje. r ;[193] Sigh... 40717 002710'01 254 00 0 00 002714' 40718 002711'01 200 03 0 00 000001 move t3, t1 ;[193] Save error code for debuggers 40719 002712'01 474 06 0 00 000000 seto q2, ;[193] Cons up an impossible JFN 40720 002713'01 254 00 0 00 002715' else. ;[193] Otherwise, worked 40721 002714'01 200 06 0 00 000001 move q2, t1 ;[193] Put JFN in a COMND% kind of place 40722 002715'01 endif. ;[193] 40723 002715'01 endif. ;[193] End case of DEVST% handling 40724 002715'01 254 00 0 00 002717' else. ;[193] Otherwise, got a JFN 40725 002716'01 200 06 0 00 000005 move q2, q1 ;[193] Put JFN in a COMND% kind of place 40726 002717'01 endif. ;[193] End case .cmdev transmogrification 40727 40728 002717'01 337 01 0 00 000006 skipg t1, q2 ;[193] Load the JFN, unless we couldn't get one 40729 002720'01 200 01 0 00 000005 move t1, q1 ;[193] Otherwise, load the device 40730 002721'01 200 04 0 00 000001 move t4, t1 ;[193] Save a handy copy 40731 002722'01 260 17 0 00 001463* call isnulj ;[193] Is this NUL:? 40732 002723'01 254 00 0 00 002726' ifskp. ;[193] Yes, so let's fix up the parse 40733 002724'01 200 06 0 00 000001 move q2, t1 ;[193] Store the .nulio in there 40734 002725'01 254 00 0 00 002770' else. ;[193] Otherwise, isn't NUL: 40735 002726'01 200 01 0 00 000004 move t1, t4 ;[193] Load whatever we parsed 40736 002727'01 302 07 0 00 000016 caie q3, .cmdev ;[193] Did we parse a device? 40737 002730'01 254 00 0 00 002733' ifskp. ;[193] We did 40738 002731'01 200 01 0 00 000005 move t1, q1 ;[193] so use that 40739 002732'01 254 00 0 00 002734' else. ;[193] Otherwise, got a JFN 40740 002733'01 621 01 0 00 777777 tlz t1, -1 ;[193] So use that 40741 002734'01 endif. 40742 002734'01 104 00 0 00 000117 DVCHR% ;[198] Let's find out about the device 40743 002735'01 320 12 0 00 002737' %jserr (,r) ;[193] 40744 002736'01 254 00 0 00 002742' 40745 002737'01 265 01 0 00 002552* 40746 002740'01 000000000000# 40747 002741'01 254 00 0 00 002626* 40748 000575'04 124 171 160 145 040 40749 002742'01 135 03 0 00 006276' ldb t3,[pointr t2, dv%typ] ;[193] Pick up the device type 40750 002743'01 306 03 0 00 000000 cain t3, .dvdsk ;[193] Isn't a disk? 40751 002744'01 254 00 0 00 002770' anskp. ;[193] It is, so we're fine 40752 002745'01 200 02 0 00 000001 move t2, t1 ;[193] Load device designator for DEVST% 40753 002746'01 561 01 0 00 000003 hrroi t1, t3 ;[193] String is going in the registers 40754 002747'01 403 03 0 00 000004 setzb t3, t4 ;[193] Get 9 characters of device (only need 6) 40755 002750'01 104 00 0 00 000121 DEVST% ;[193] Get a string representation 40756 002751'01 320 12 0 00 002753' ifje. r ;[193] Pick up and ignore error 40757 002752'01 254 00 0 00 002755' 40758 002753'01 200 02 0 00 000001 move t2, t1 ;[193] Save error code for debuggers 40759 002754'01 120 03 0 00 006540' dmove t3, [asciz /Unknown/] ;[193] Phoney up something 40760 002755'01 endif. ;[193] 40761 002755'01 337 01 0 00 000006 skipg t1, q2 ;[193] Load the JFN 40762 002756'01 254 00 0 00 002762' ifskp. ;[193] If it was a JFN... 40763 002757'01 621 01 0 00 777777 tlz t1, -1 ;[193] Stomp any flags 40764 002760'01 104 00 0 00 000023 RLJFN% ;[193] Toss it 40765 002761'01 320 12 0 00 002762' erjmpr .+1 ;[193] Catch and ignore error 40766 002762'01 endif. ;[193] 40767 002762'01 561 01 0 00 000003 hrroi t1, t3 ;[193] String is coming from registers 40768 002763'01 104 00 0 00 000313 ESOUT% ;[193] Begin complaining 40769 txmsg <: is not a directory structured device k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42-2 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE [143] 40770 002764'01 200 01 0 00 000000# > ;[193] Complete the blat 40771 002765'01 104 00 0 00 000076 40772 002766'01 320 12 0 00 002767' 40773 000276'02 000000000000# 40774 000607'04 072 040 151 163 040 40775 40776 002767'01 254 00 0 00 001707* callret cmder1 ;[193] Allow a reparse 40777 002770'01 endif. ;[193] 40778 40779 002770'01 260 17 0 00 002632* confrm ;[193] Tie off the line 40780 002771'01 202 06 0 00 002354* movem q2, pars3 ; Here's the JFN just parsed. 40781 002772'01 263 17 0 00 000000 ret 40782 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE command execution. 40783 subttl LOCAL TYPE command execution. 40784 40785 002773'01 $ytype: entry $ytype ;[194] Maybe move this? 40786 002773'01 337 01 0 00 002771* skipg t1, pars3 ; Get the JFN. 40787 002774'01 263 17 0 00 000000 ret ; Junk, just don't do anything ... 40788 40789 002775'01 265 16 0 00 006265' saveac ; Save for fast copy of current JFN 40790 002776'01 200 05 0 00 000001 move q1, t1 ; Save the JFN (and its flags) 40791 002777'01 260 17 0 00 002722* call isnulj ; BUT!! Is this JFN open on NUL:? 40792 003000'01 254 00 0 00 003007' ifskp. ; It is, so fix some things up 40793 003001'01 202 01 0 00 001753* movem t1, filjfn ; Let's say .nulio is 'open' 40794 003002'01 202 01 0 00 002102* movem t1, nxtjfn ; And that it is our next JFN 40795 003003'01 202 01 0 00 002154* movem t1, ndxjfn ; Store as our pseudo-stepping JFN 40796 003004'01 502 05 0 00 003003* hllm q1, ndxjfn ; Also store original flags on NUL: 40797 003005'01 550 05 0 00 000001 hrrz q1, t1 ; And over the previous JFN and flags 40798 003006'01 254 00 0 00 003043' else. ; Otherwise, set up for real file stepping. 40799 003007'01 550 01 0 00 000005 hrrz t1, q1 ;[220] Load just the JFN, no flags 40800 003010'01 260 17 0 00 005474' call isdird ;[193] But! Did somebody slip something phonkey in? 40801 003011'01 254 00 0 00 003016' ifskp. ;[193] Nope, this is a directory device 40802 003012'01 202 05 0 00 003004* movem q1, ndxjfn ; Store JFN and flags 40803 003013'01 552 05 0 00 003002* hrrzm q1, nxtjfn ; Just the JFN, no flags 40804 003014'01 402 00 0 00 003001* setzm filjfn ; No file currently open 40805 003015'01 254 00 0 00 003043' else. ;[193] Otherwise, not NUL:, so we can't use this 40806 003016'01 265 16 0 00 002666* anstkv(q2,^d4) ;[193] 20 characters of device name 40807 003017'01 000000 000004 40808 003020'01 415 06 0 17 777773 40809 003021'01 403 03 0 00 000004 setzb t3, t4 ;[193] Cons up some NUL's 40810 003022'01 124 03 0 06 000000 dmovem t3, 0(q2) ;[193] Let's scrub 40811 003023'01 124 03 0 06 000002 dmovem t3, 2(q2) ;[193] a dub dub 40812 003024'01 561 01 0 06 000000 hrroi t1, 0(q2) ;[193] Tops-20 pointer to beginning of buffer 40813 003025'01 550 02 0 00 000005 hrrz t2, q1 ;[193] Load the JFN, sans flags 40814 dmove t3, [fld(.jsaof,js%dev)!js%paf 40815 003026'01 120 03 0 00 006542' 0 ] ;[193] Just the punctuated device, no prefix 40816 003027'01 104 00 0 00 000030 JFNS% ;[193] Convert it 40817 003030'01 320 12 0 00 003032' ifje. r ;[193] Failed?? 40818 003031'01 254 00 0 00 003035' 40819 003032'01 200 02 0 00 000001 move t2, t1 ;[193] Save the error for debuggers 40820 003033'01 120 03 0 00 006544' dmove t3, [ asciz /Unknown:/ ] ;[193] 40821 003034'01 124 03 0 06 000000 dmovem t3, 0(q2) ;[193] Store some kind of message... 40822 003035'01 endif. 40823 003035'01 561 01 0 06 000000 hrroi t1, 0(q2) ;[193] Tops-20 pointer to beginning of buffer 40824 003036'01 104 00 0 00 000313 ESOUT% ;[193] Begin whining 40825 txmsg < is not a directory structured device 40826 003037'01 200 01 0 00 000000# > 40827 003040'01 104 00 0 00 000076 40828 003041'01 320 12 0 00 003042' 40829 000277'02 000000000000# 40830 000620'04 040 151 163 040 156 40831 40832 003042'01 254 00 0 00 003125' jrst $ytypz ;[193] Finally get out of here 40833 003043'01 endif. ;[193] End directory device double check 40834 003043'01 endif. ;[193] End NUL: 'directory' special check 40835 40836 003043'01 260 17 0 00 002502* call ccon ;[169] Allow ^C out of this. 40837 003044'01 254 00 0 00 003122' jrst $ytypy ;[169] Upon ^C, get out of here k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43-1 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE command execution. 40838 40839 003045'01 do. ; Enter loop context 40840 003045'01 260 17 0 00 005525' call gtnfil ; Any more files? 40841 003046'01 254 00 0 00 003122' exit. ; Nope, beat it 40842 003047'01 550 05 0 00 000001 hrrz q1, t1 ; OK, so save what we're doing now 40843 003050'01 260 17 0 00 000000* call clrcno ; Clear Control-O, if set 40844 003051'01 561 01 0 00 002530* hrroi t1, crlf ; Tie off the line 40845 003052'01 104 00 0 00 000076 PSOUT% 40846 003053'01 201 01 0 00 000101 movei t1, .priou ; Going to primary output 40847 003054'01 200 02 0 00 000005 move t2, q1 ; Load the current JFN to do 40848 003055'01 260 17 0 00 000000* call typnam ; Type the file name 40849 003056'01 254 00 0 00 003122' exit. ; Stop processing files on error 40850 003057'01 200 01 0 00 000005 move t1, q1 ; Load JFN 40851 003060'01 302 01 0 00 377777 caie t1, .nulio ;[193] Not actually typing anything? 40852 003061'01 254 00 0 00 003064' ifskp. ;[193] No, so that's easy to set up 40853 003062'01 201 03 0 00 000010 movx t3, ^d8 ;[193] Assume NUL: is always eight bit 40854 003063'01 254 00 0 00 003106' else. ;[193] Otherwise, a real JFN, maybe? 40855 003064'01 200 02 0 00 006546' move t2, [1,,.fbbyv] ;Get bytesize. 40856 003065'01 201 03 0 00 000004 movei t3, t4 40857 003066'01 104 00 0 00 000063 GTFDB 40858 003067'01 320 12 0 00 003071' ifje. r ;[194] Might fail if not disk 40859 003070'01 254 00 0 00 003074' 40860 003071'01 200 03 0 00 000001 move t3, t1 ;[194] Save error code for debugger 40861 003072'01 400 04 0 00 000000 setz t4, ;[194] If failed, say no byte size 40862 003073'01 200 01 0 00 000005 move t1, q1 ;[194] Reload JFN 40863 003074'01 endif. ;[194] 40864 003074'01 200 02 0 00 006547' movx t2, of%rd+fld(7,of%bsz) ; Assume 7-bit mode. 40865 003075'01 135 03 0 00 006550' ldb t3, [pointr (t4,fb%bsz)] ; Extract the bytesize. 40866 003076'01 306 03 0 00 000010 cain t3, ^d8 ; 8 bit? 40867 003077'01 200 02 0 00 006551' movx t2, of%rd+fld(^d8,of%bsz) ; Yes, 8-bit. 40868 003100'01 104 00 0 00 000021 OPENF ; Open the file in appropriate mode. 40869 003101'01 320 12 0 00 003103' %jserr (,endlp.) 40870 003102'01 254 00 0 00 003106' 40871 003103'01 265 01 0 00 002737* 40872 003104'01 000000000000# 40873 003105'01 254 00 0 00 003122' 40874 000630'04 103 157 165 154 144 40875 003106'01 endif. ;[193] End .nulio special casing 40876 003106'01 260 17 0 00 000000* call typfil ; Type the file 40877 003107'01 254 00 0 00 003122' exit. ; If failed, go no further 40878 003110'01 200 01 0 00 000005 move t1, q1 ; Close the file. 40879 003111'01 302 01 0 00 377777 caie t1, .nulio ; Unless there is no need 40880 003112'01 104 00 0 00 000022 CLOSF 40881 003113'01 320 12 0 00 003115' %jserr (,endlp.) 40882 003114'01 254 00 0 00 003120' 40883 003115'01 265 01 0 00 003103* 40884 003116'01 000000000000# 40885 003117'01 254 00 0 00 003122' 40886 000636'04 103 157 165 154 144 40887 003120'01 400 05 0 00 000000 setz q1, ;[194] Done with this file 40888 003121'01 254 00 0 00 003045' loop. ;[194] Do the next file 40889 003122'01 enddo. ;[193] End loop context 40890 40891 003122'01 260 17 0 00 002506* $ytypy: call ccoff ; Turn off ^C 40892 003123'01 260 17 0 00 000000* call whakfp ; Whack any left over pages k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43-2 K20SRV MAC 9-Aug-24 12:55 LOCAL TYPE command execution. 40893 003124'01 600 00 0 00 000000 nop ; Ignore any error 40894 40895 003125'01 322 05 0 00 003130' $ytypz: ifn. q1 ; Any JFN left lying around maybe? 40896 003126'01 200 01 0 00 000005 move t1, q1 ; OK, so load it 40897 003127'01 260 17 0 00 000000* call frclos ; Force it to close 40898 003130'01 endif. 40899 003130'01 263 17 0 00 000000 ret ; No more, done. 40900 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20SRV MAC 9-Aug-24 12:55 REMOTE TYPE command execution. 40901 subttl REMOTE TYPE command execution. 40902 40903 003131'01 $xtype:; entry $xtype 40904 003131'01 336 00 0 00 002634* ifmn. tlgjfn ;[233] Doing transaction logging? 40905 003132'01 254 00 0 00 003154' 40906 003133'01 415 16 0 00 003154' block. ;[233] Get a stack frame 40907 003134'01 261 17 0 00 000016 40908 003135'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 40909 003136'01 476 00 0 00 002320* setom scrlft ;[233] Don't append the crlf! 40910 003137'01 265 01 0 00 002641* wtlog(,) ;[233] 40911 003140'01 000000000000# 40912 003141'01 777777 777744 40913 003142'01 000000 000000 40914 000644'04 122 145 161 165 145 40915 003143'01 200 01 0 00 003131* move t1, tlgjfn ;[233] Put the directory name in the log 40916 003144'01 561 02 0 00 002326* hrroi t2,atmbuf ;[233] It's in the atom buffer 40917 003145'01 403 03 0 00 000004 setzb t3,t4 ;[233] Don't know how long, stop on a NUL 40918 003146'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 40919 003147'01 320 14 0 00 003150' erjmps .+1 ;[233] Catch and suppress error 40920 dmove t2,[ -1,,crlf ;[233] Tops-20 pointer to carriage return line feed 40921 003150'01 120 02 0 00 006443' -2 ] ;[233] Counted SOUT%'s are faster 40922 003151'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 40923 003152'01 320 14 0 00 003153' erjmps .+1 ;[233] Catch and suppress error 40924 003153'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 40925 003154'01 endif. ;[233] 40926 40927 003154'01 260 17 0 00 002646* call statim ;[189] Start timing so k20pdc doesn't choke 40928 003155'01 201 04 0 00 000124 movei t4, "T" ; Generic command is T. 40929 003156'01 254 00 0 00 005362' jrst srvfil 40930 40931 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20SRV MAC 9-Aug-24 12:55 Server Operation 40932 subttl Server Operation 40933 40934 ; GETCOM 40935 ; 40936 ; We come here if we are in server mode. We just wait for a packet of one of 40937 ; the following types: 40938 ; 40939 ; S Send init - just follow the normal path from here 40940 ; R Receive init - like a local "send filespec" 40941 ; I Init (all-purpose exchange of parameters) 40942 ; G Generic command: 40943 ; L Logout - the other side is done, log out this job 40944 ; F Finish - exit from Kermit 40945 ; U Disk Usage query 40946 ; T Type a file 40947 ; etc 40948 ; 40949 ; First, issue a message telling the user what to do. 40950 ; 40951 003157'01 getcom: entry getcom ;[194] Also invoked from k20par 40952 movei t1, [ ;[157] In case line gets XOFF'd while 40953 call ttxon ;[157] typing the message, unstick it, 40954 003157'01 201 01 0 00 006552' jrst getcm2 ] ;[157] and proceed. 40955 003160'01 260 17 0 00 000000* call timeit ;[157] Set the timer. 40956 003161'01 336 00 0 00 002462* ifmn. local ;[174] Local mode? 40957 003162'01 254 00 0 00 003207' 40958 txmsg < 40959 003163'01 200 01 0 00 000000# Entering server mode on TTY> ;[174] Yes, give appropriate message. 40960 003164'01 104 00 0 00 000076 40961 003165'01 320 12 0 00 003166' 40962 000300'02 000000000000# 40963 000652'04 015 012 040 105 156 40964 003166'01 201 01 0 00 000101 numout ttynum, 8 40965 003167'01 200 02 0 00 000000* 40966 003170'01 201 03 0 00 000010 40967 003171'01 104 00 0 00 000224 40968 003172'01 320 14 0 00 003173' 40969 003173'01 337 02 0 00 000000* skipg t2, speed ;[194] Load speed 40970 003174'01 254 00 0 00 003206' ifskp. ;[194] If we have one .. 40971 003175'01 200 01 0 00 000000# txmsg <, > 40972 003176'01 104 00 0 00 000076 40973 003177'01 320 12 0 00 003200' 40974 000301'02 000000000000# 40975 000661'04 054 040 000 000 000 40976 003200'01 201 01 0 00 000101 movei t1, .priou ;[194] 40977 003201'01 201 03 0 00 000012 movei t3, ^d10 ;[194] 40978 003202'01 104 00 0 00 000224 NOUT% 40979 003203'01 200 01 0 00 000000# txmsg < baud> 40980 003204'01 104 00 0 00 000076 40981 003205'01 320 12 0 00 003206' 40982 000302'02 000000000000# 40983 000662'04 040 142 141 165 144 40984 003206'01 endif. ;[194] 40985 003206'01 254 00 0 00 003217' jrst getcmm ;[174] 40986 003207'01 endif. ;[194] k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45-1 K20SRV MAC 9-Aug-24 12:55 Server Operation 40987 40988 txmsg < 40989 003207'01 200 01 0 00 000000# Kermit Server running on > ;[186] 40990 003210'01 104 00 0 00 000076 40991 003211'01 320 12 0 00 003212' 40992 000303'02 000000000000# 40993 000664'04 015 012 040 113 145 40994 003212'01 561 01 0 00 000000* hrroi t1,sysnam## ;[186] Load local node name 40995 003213'01 104 00 0 00 000076 PSOUT% ;[186] Type it, not "DEC-20" 40996 txmsg < host. Please type your escape 40997 sequence to return to your local machine. Shut down the server by 40998 003214'01 200 01 0 00 000000# typing the BYE command to KERMIT on your local machine.> ;[186] 40999 003215'01 104 00 0 00 000076 41000 003216'01 320 12 0 00 003217' 41001 000304'02 000000000000# 41002 000672'04 040 150 157 163 164 41003 41004 41005 41006 getcmm: txmsg < 41007 003217'01 200 01 0 00 000000# > 41008 003220'01 104 00 0 00 000076 41009 003221'01 320 12 0 00 003222' 41010 000305'02 000000000000# 41011 000732'04 015 012 000 000 000 41012 003222'01 260 17 0 00 000000* getcm2: call timoff ;[157] Turn off timer. 41013 003223'01 260 17 0 00 003154* call statim ;[189] Give k20pdc something to not choke on 41014 003224'01 476 00 0 00 000000* setom srvflg ; Flag that we are serving. 41015 003225'01 260 17 0 00 000000* call inilin ; Initialize the line. 41016 003226'01 260 17 0 00 003043* call ccon ; Don't let someone ^C without reseting line. 41017 003227'01 254 00 0 00 003546' jrst xgfin2 ; On control-C, go "finish". 41018 003230'01 403 03 0 00 000004 setzb t3, t4 ; Set default parameters in case we get some 41019 003231'01 124 03 0 00 000000* dmovem t3, delay ;[212] No delay in server mode (gets floating value) 41020 003232'01 260 17 0 00 000000* call spar ; command before first Send-Init or Info. 41021 003233'01 254 00 0 00 003234' jrst xxwait ; Go wait for a command packet. 41022 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20SRV MAC 9-Aug-24 12:55 Server command loop 41023 subttl Server command loop 41024 41025 ; Server commands should always jrst back to here, even upon error, 41026 ; except for those that specify exit from server mode. 41027 41028 003234'01 332 00 0 00 000000* xxwait: skipe mdmlin ;[130] Modem line? 41029 003235'01 332 00 0 00 000000* skipe carier ;[130] Did carrier drop? 41030 003236'01 334 00 0 00 000000 skipa ;[130] No. 41031 003237'01 254 00 0 00 003546' jrst xgfin2 ;[130] Yes, go clean up. 41032 41033 003240'01 476 00 0 00 000000* setom sptot ;[134] Clear packet statistics counters 41034 003241'01 476 00 0 00 000000* setom rptot ;[134] ... 41035 003242'01 402 00 0 00 000000* setzm xflg ; Clear the server "type" flag. 41036 003243'01 402 00 0 00 000000* setzm source ; Ditto for GETCH source. 41037 003244'01 402 00 0 00 000000* setzm dest ; Ditto for PUTCH destination. 41038 003245'01 402 00 0 00 002152* setzm ffunc ; And for file function. 41039 003246'01 120 01 0 00 000000* dmove t1, srvtim ;[212] ; Get the default server packet time out. 41040 003247'01 124 01 0 00 000000* dmovem t1, stimou ;[212] ; Set it so we don't time out as often. 41041 41042 003250'01 do. ;[194] Enter loop context 41043 003250'01 476 00 0 00 000000* setom bctone ;[98] Set this so we use type 1 checksum. 41044 003251'01 402 00 0 00 002411* setzm pktnum ; Initial packet sequence number. 41045 003252'01 260 17 0 00 000000* call rpack ; Get a packet. 41046 003253'01 254 00 0 00 003270' ifskp. ;[194] Worked 41047 003254'01 306 01 0 00 000124 cain t1, "T" ;[194] But!! A TIMER interrupt pseudo packet? 41048 003255'01 254 00 0 00 003270' anskp. ; On timeout, NAK what we're looking for. 41049 003256'01 301 01 0 00 000101 cail t1, "A" ;[150] Packet type in range? 41050 003257'01 303 01 0 00 000132 caile t1, "Z" ;[150] 41051 003260'01 334 00 0 00 000000 kermsg (,xxwait) ;[150] No. 41052 003261'01 254 00 0 00 003266' 41053 003262'01 265 01 0 00 000000* 41054 003263'01 000000 000043 41055 003264'01 000000000000# 41056 003265'01 254 00 0 00 003234' 41057 000733'04 120 141 143 153 145 41058 003266'01 254 00 0 00 003274' exit. ;[194] Otherwise, goo so break out of the loop 41059 003267'01 254 00 0 00 003274' else. ;[194] Some kind of error 41060 003270'01 200 02 0 00 003251* move t2, pktnum ; Load current packet number 41061 003271'01 260 17 0 00 000000* call nak ; NAK that "packet". 41062 003272'01 254 00 0 00 003250' loop. ;[194] Go round again. 41063 003273'01 254 00 0 00 003250' loop. ; (no matter what) 41064 003274'01 endif. ;[194] End packet reception analysis 41065 003274'01 enddo. ;[194] End loop lexical context 41066 41067 ; Got a real command. Restore the normal timeout interval and do the command. 41068 41069 003274'01 202 02 0 00 003270* movem t2, pktnum ; Save packet number. 41070 003275'01 261 17 0 00 000001 push p, t1 ; We can't use any normal AC's here... 41071 003276'01 261 17 0 00 000002 push p, t2 ;[212] Ditto floating display value 41072 003277'01 120 01 0 00 000000* dmove t1, otimou ;[212] Put normal timeout back. 41073 003300'01 124 01 0 00 003247* dmovem t1, stimou ;[212] 41074 003301'01 262 17 0 00 000002 pop p, t2 ;[212] Restore this, too 41075 003302'01 262 17 0 00 000001 pop p, t1 41076 003303'01 275 01 0 00 000101 subi t1, "A" ;[194] Get into range (easier to debug) 41077 003304'01 254 00 1 01 003305' jrst @xxcmd(t1) ;[150] Go do the indicated command. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46-1 K20SRV MAC 9-Aug-24 12:55 Server command loop 41078 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20SRV MAC 9-Aug-24 12:55 Server command loop 41079 41080 ;[150] Server command dispatch table and error message routines. 41081 41082 41083 003305'01 000000 003343' xxcmd: xxinv ; A - Attributes, shouldn't come now 41084 003306'01 000000 003343' xxinv ; B - EOT, shouldn't come now 41085 003307'01 000000 003430' xhost ; C - Host Command 41086 003310'01 000000 003343' xxinv ; D - Data, shouldn't come now 41087 003311'01 000000 003234' xxwait ; E - Error, just ignore 41088 003312'01 000000 003343' xxinv ; F - File header, shouldn't come now 41089 003313'01 000000 003436' xgen ; G - Generic Command 41090 003314'01 000000 003340' xxunk ; H - Undefined 41091 003315'01 000000 003672' xinfo ; I - Info Packet 41092 003316'01 000000 003340' xxunk ; J - Undefined 41093 003317'01 000000 003340' xxunk ; K - Undefined 41094 003320'01 000000 003340' xxunk ; L - Undefined 41095 003321'01 000000 003340' xxunk ; M - Undefined 41096 003322'01 000000 003234' xxwait ; N - NAK, ignore 41097 003323'01 000000 003340' xxunk ; O - Undefined 41098 003324'01 000000 003340' xxunk ; P - Undefined 41099 003325'01 000000 003340' xxunk ; Q - Undefined 41100 003326'01 000000 003374' xrecv ; R - Receive (GET), server sends 41101 003327'01 000000 003356' xsend ; S - Send, server receives 41102 003330'01 000000 003234' xxwait ; T - (Already handled specially above) 41103 003331'01 000000 003340' xxunk ; U - Undefined 41104 003332'01 000000 003340' xxunk ; V - Undefined 41105 003333'01 000000 003340' xxunk ; W - Undefined 41106 003334'01 000000 003343' xxinv ; X - Text Header, shouldn't come now 41107 003335'01 000000 003234' xxwait ; Y - ACK, ignore 41108 003336'01 000000 003343' xxinv ; Z - EOF, shouldn't come now 41109 003337'01 000000 000000 0 ; (superstition) 41110 41111 ; Routine to issue informative error messages. 41112 41113 003340'01 200 04 0 00 006554' xxunk: move t4, [point 7, xxumsg] ; Get "unknown command" message. 41114 003341'01 201 03 0 00 000034 movei t3, xxulen ; And its length 41115 003342'01 254 00 0 00 003345' jrst xxmsg 41116 41117 003343'01 200 04 0 00 006555' xxinv: move t4, [point 7, xxbmsg] ; Get "invalid use of..." message. 41118 003344'01 201 03 0 00 000041 movei t3, xxblen ; And its lentgh. 41119 41120 003345'01 261 17 0 00 000004 xxmsg: push p, t4 ; Save msg pointer. 41121 003346'01 133 00 0 00 000004 ibp t4 ; Point past opening quote. 41122 003347'01 136 01 0 00 000004 idpb t1, t4 ; Deposit the packet type. 41123 003350'01 201 01 0 00 000105 movei t1, "E" ; Send an Error packet. 41124 003351'01 200 02 0 00 003274* move t2, pktnum ; This is the packet number. 41125 003352'01 262 17 0 00 000004 pop p, t4 ; Get original pointer back. 41126 003353'01 260 17 0 00 002413* call spack ; Send the error packet. 41127 003354'01 600 00 0 00 000000 nop 41128 003355'01 254 00 0 00 003234' jrst xxwait ; Go back to command wait. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20SRV MAC 9-Aug-24 12:55 Server command loop 41129 41130 subttl Server commands. 41131 41132 ; Server SEND command (i.e. send to me, I'm the server, I receive the files.) 41133 ; 41134 ; We've just received a Send-Init. 41135 ; 41136 003356'01 402 00 0 00 000000* xsend: setzm numtry ; Packet retry counter. 41137 003357'01 202 02 0 00 003351* movem t2, pktnum ; Synchronize packet numbers. 41138 003360'01 260 17 0 00 003232* call spar ; Get the Send-Init parameters. 41139 003361'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] ;[50] Now send back our own, 41140 003362'01 260 17 0 00 000000* call rpar ; which we put in the data field of our ACK. 41141 003363'01 201 01 0 00 000131 movei t1, "Y" ; Set up the ACK. 41142 003364'01 200 02 0 00 003357* move t2, pktnum ; Packet number. 41143 003365'01 260 17 0 00 003353* call spack ; Send the packet. 41144 003366'01 254 00 0 00 003234' jrst xxwait ;* Give up if we can't.(?) 41145 003367'01 260 17 0 00 000000* call rrinit ;[126] Set things up for receiving. 41146 003370'01 201 11 0 00 000106 movei state, "F" ; Set the state to file send. 41147 003371'01 260 17 0 00 000000* call $recvs ;[42] Go look like we're receiving. 41148 003372'01 600 00 0 00 000000 nop ; 41149 003373'01 254 00 0 00 003234' jrst xxwait ; Get another command when done. 41150 41151 41152 ; Server RECEIVE (or GET) command -- Server sends files. 41153 ; 41154 ; We've just received a Receive-Init packet, containing a filename. 41155 ; (Or a remote TYPE command). T1-T4 contain packet parameters returned 41156 ; by RPACK. 41157 ; 41158 003374'01 200 01 0 00 000004 xrecv: move t1, t4 ;[141] Pointer to encoded filespec. 41159 003375'01 200 02 0 00 000003 move t2, t3 ;[141] Number of characters. 41160 003376'01 260 17 0 00 000000* call decodf ;[141] Decode it. 41161 003377'01 334 00 0 00 000000 kermsg (, xxwait) ;[141] Can't? Give message. 41162 003400'01 254 00 0 00 003405' 41163 003401'01 265 01 0 00 003262* 41164 003402'01 000000 000040 41165 003403'01 000000000000# 41166 003404'01 254 00 0 00 003234' 41167 000740'04 103 141 156 047 164 41168 003405'01 200 02 0 00 000001 move t2, t1 ;[141] Decoded OK, point to decoded filespec. 41169 41170 ; Entry point when filespec already decoded. 41171 41172 003406'01 205 01 0 00 100101 xrecv2: movx t1, gj%sht!gj%old!gj%ifg ; Old file and allow wildcarding. 41173 003407'01 104 00 0 00 000020 GTJFN% ; Get a JFN. 41174 003410'01 320 14 0 00 003412' %jsker (,xxwait) ; Can't, send error packet and loop. 41175 003411'01 254 00 0 00 003415' 41176 003412'01 265 01 0 00 000000* 41177 003413'01 000000 000000 41178 003414'01 254 00 0 00 003234' 41179 003415'01 202 01 0 00 003012* movem t1, ndxjfn ;[111] Got JFN, save wildcard bits here. 41180 003416'01 552 01 0 00 003013* hrrzm t1, nxtjfn ;[111] Initialize file lookahead. 41181 003417'01 260 17 0 00 002777* call isnulj ;[193] Is this the NUL: device? 41182 003420'01 254 00 0 00 003423' ifskp. ;[193] It is, propagate our talisman 41183 003421'01 552 01 0 00 003416* hrrzm t1, nxtjfn ;[193] Re-initialize file lookahead k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48-1 K20SRV MAC 9-Aug-24 12:55 Server commands. 41184 003422'01 552 01 0 00 003415* hrrzm t1, ndxjfn ;[193] Save JFN with whacked wildcard bits 41185 003423'01 endif. ;[193] 41186 41187 003423'01 260 17 0 00 005525' call gtnfil ;[111] Get next (in this case, first) file. 41188 003424'01 600 00 0 00 000000 nop ;[111] Could never fail, right? 41189 003425'01 260 17 0 00 000000* call $sends ; Go send the file(s). 41190 003426'01 600 00 0 00 000000 nop ; (in case it skips for some reason...) 41191 003427'01 254 00 0 00 003234' jrst xxwait ; Go back & get another command. 41192 41193 41194 ; HOST command. 41195 41196 003430'01 334 00 0 00 000000 xhost: kermsg (, xxwait) 41197 003431'01 254 00 0 00 003436' 41198 003432'01 265 01 0 00 003401* 41199 003433'01 000000 000050 41200 003434'01 000000000000# 41201 003435'01 254 00 0 00 003234' 41202 000745'04 110 157 163 164 040 41203 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20SRV MAC 9-Aug-24 12:55 Server commands. 41204 41205 ;[150] Server GENERIC command. Get the subcommand and execute it. 41206 41207 003436'01 134 01 0 00 000004 xgen: ildb t1, t4 ; Get the first character of the data field. 41208 003437'01 301 01 0 00 000101 cail t1, "A" ; Validate. 41209 003440'01 303 01 0 00 000132 caile t1, "Z" 41210 003441'01 334 00 0 00 000000 kermsg (, xxwait) ; Bad. 41211 003442'01 254 00 0 00 003447' 41212 003443'01 265 01 0 00 003432* 41213 003444'01 000000 000047 41214 003445'01 000000000000# 41215 003446'01 254 00 0 00 003234' 41216 000753'04 107 145 156 145 162 41217 41218 003447'01 370 00 0 00 000003 sos t3 ; Command in range, account for it. 41219 003450'01 275 01 0 00 000101 subi t1, "A" ;[194] Command in range, change to table offset 41220 003451'01 306 01 0 00 000121 cain t1, "Q" ;[189] Don't overwrite times on status query!! 41221 003452'01 254 00 1 01 003457' jrst @xxgcmd(t1) ;[194] Dispatch to it. 41222 41223 003453'01 260 17 1 01 003457' call @xxgcmd(t1) ;[189] Go do whatever we're supposed to be doing 41224 003454'01 260 17 0 00 000046* call endtim ;[189] Stop timing 41225 003455'01 260 17 0 00 000047* call elptim ;[189] Compute elapsed time 41226 003456'01 263 17 0 00 000000 ret ;[189] 41227 41228 41229 41230 ;[150] Server generic command dispatch table. 41231 41232 003457'01 000000 004353' xxgcmd: xgpwd ;[188] ; A - PWD 41233 003460'01 000000 003512' xgundf ; B - Undefined 41234 003461'01 000000 003757' xgcwd ; C - CWD 41235 003462'01 000000 004525' xgdir ; D - Directory 41236 003463'01 000000 004656' xgdel ; E - Erase (delete) 41237 003464'01 000000 003520' xgfin ; F - Finish 41238 003465'01 000000 004267' xgcdup ;[254] ; G - CDUP 41239 003466'01 000000 004447' xghelp ; H - Help 41240 003467'01 000000 003515' xgnyi ; I - Login (not yet implemented) 41241 003470'01 000000 003515' xgnyi ; J - Journal control (nyi) 41242 003471'01 000000 003515' xgnyi ; K - Copy (nyi) 41243 003472'01 000000 003562' xglogo ; L - Logout, Bye 41244 003473'01 000000 003515' xgnyi ; M - Short message 41245 003474'01 000000 003512' xgundf ; N - Undef 41246 003475'01 000000 003512' xgundf ; O - Undef 41247 003476'01 000000 003515' xgnyi ; P - Program invocation (nyi) 41248 003477'01 000000 004426' xgstat ; Q - Server status query 41249 003500'01 000000 003515' xgnyi ; R - Rename (nyi) 41250 003501'01 000000 003512' xgundf ; S - Undef 41251 003502'01 000000 003632' xgtype ; T - Type 41252 003503'01 000000 004175' xgdisk ; U - Disk Usage 41253 003504'01 000000 003515' xgnyi ; V - Variable Set/Query 41254 003505'01 000000 003515' xgnyi ; W - Who (Finger) 41255 003506'01 000000 003512' xgundf ; X - Undef 41256 003507'01 000000 003512' xgundf ; Y - Undef 41257 003510'01 000000 003512' xgundf ; Z - Undef 41258 003511'01 000000 000000 0 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49-1 K20SRV MAC 9-Aug-24 12:55 Server commands. 41259 41260 003512'01 200 04 0 00 006557' xgundf: move t4, [point 7, xxgums] ; Issue message for undefined command. 41261 003513'01 201 03 0 00 000037 movei t3, xxguln 41262 003514'01 254 00 0 00 003345' jrst xxmsg 41263 41264 003515'01 200 04 0 00 006560' xgnyi: move t4, [point 7, xxgnms] ; Issue msg for unimplemented command. 41265 003516'01 201 03 0 00 000043 movei t3, xxgnln 41266 003517'01 254 00 0 00 003345' jrst xxmsg k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20SRV MAC 9-Aug-24 12:55 Server commands. 41267 41268 ; Generic commands... 41269 41270 41271 ; FINISH. Shut down the server, but don't log out. 41272 41273 003520'01 201 01 0 00 000131 xgfin: movei t1, "Y" ; Acknowledge packet. 41274 003521'01 403 03 0 00 000004 setzb t3, t4 ; No data. 41275 003522'01 260 17 0 00 003365* call spack ; Send the packet. 41276 003523'01 600 00 0 00 000000 nop ;[56] 41277 003524'01 201 01 0 00 003546' movei t1,xgfin2 ;[186] Where to go on a time out 41278 003525'01 260 17 0 00 003160* call timeit ;[186] Start a timer 41279 003526'01 337 01 0 00 000000* skipg t1, netjfn ;[186] Wait until the packet 41280 003527'01 200 01 0 00 000000* move t1, ttyjfn ;[186] Unless using local terminal 41281 003530'01 336 00 0 00 000000* ifmn. ptyflg ;[186] On a pseudo-terminal? 41282 003531'01 254 00 0 00 003542' 41283 003532'01 200 01 0 00 000000* move t1,ptytty ;[186] Load PTY's associated TTY 41284 003533'01 104 00 0 00 000212 DIBE% ;[186] Wait for it to swallow everything 41285 003534'01 320 12 0 00 003536' %jsErr (,) ;[186] 41286 003535'01 254 00 0 00 003541' 41287 003536'01 265 01 0 00 003115* 41288 003537'01 000000000000# 41289 003540'01 254 00 0 00 003541' 41290 000761'04 103 157 165 154 144 41291 003541'01 254 00 0 00 003544' else. ;[186] Otherwise, do it the ordinary way 41292 003542'01 104 00 0 00 000104 DOBE ;[158] gets all the way out. 41293 003543'01 320 12 0 00 003544' erjmpr .+1 ;[186] Catch and ignore error 41294 003544'01 endif. ;[186] End case waiting for output done 41295 003544'01 260 17 0 00 003222* call timoff ;[186] Shut off the timer 41296 003545'01 476 00 0 00 000050* setom f$exit ;[137] Say we want to go back to command level. 41297 41298 003546'01 260 17 0 00 000000* xgfin2: call rrslin ;[121] Put line back in interactive state. 41299 003547'01 120 01 0 00 000000* dmove t1, odelay ;[194] ;[27] Restore normal delay 41300 003550'01 124 01 0 00 003231* dmovem t1, delay ;[194] ;[27] 41301 003551'01 120 01 0 00 003277* dmove t1, otimou ;[212] ;[27] and timout interval 41302 003552'01 124 01 0 00 003300* dmovem t1, stimou ;[212] ;[27] 41303 003553'01 402 00 0 00 003224* setzm srvflg ;[27] and reset the server flag 41304 003554'01 265 01 0 00 003137* wtlog (,) ;[244] Log the FINISH. 41305 003555'01 000000000000# 41306 003556'01 777777 777761 41307 003557'01 000000 000000 41308 000770'04 106 111 116 111 123 41309 003560'01 260 17 0 00 000000* call clenup## ;[244] Close all logs. 41310 003561'01 263 17 0 00 000000 ret ; Done 41311 41312 ; LOGOUT (or BYE) -- Shut down the server and log out. 41313 41314 003562'01 201 01 0 00 000131 xglogo: movei t1, "Y" ; Acknowledge the command. 41315 003563'01 403 03 0 00 000004 setzb t3, t4 ; No data. 41316 003564'01 260 17 0 00 003522* call spack ; Send the packet. 41317 003565'01 600 00 0 00 000000 nop ; 41318 003566'01 201 01 0 00 003607' movei t1,xglog1 ;[186] Where to go on a time out 41319 003567'01 260 17 0 00 003525* call timeit ;[186] Start a timer 41320 003570'01 337 01 0 00 003526* skipg t1, netjfn ;[186] Wait until the packet 41321 003571'01 200 01 0 00 003527* move t1, ttyjfn ;[186] Unless using local terminal k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50-1 K20SRV MAC 9-Aug-24 12:55 Server commands. 41322 003572'01 336 00 0 00 003530* ifmn. ptyflg ;[186] On a pseudo-terminal? 41323 003573'01 254 00 0 00 003604' 41324 003574'01 200 01 0 00 003532* move t1,ptytty ;[186] Load PTY's associated TTY 41325 003575'01 104 00 0 00 000212 DIBE% ;[186] Wait for it to swallow everything 41326 003576'01 320 12 0 00 003600' %jsErr (,) ;[186] 41327 003577'01 254 00 0 00 003603' 41328 003600'01 265 01 0 00 003536* 41329 003601'01 000000000000# 41330 003602'01 254 00 0 00 003603' 41331 000774'04 103 157 165 154 144 41332 003603'01 254 00 0 00 003606' else. ;[186] Otherwise, do it the ordinary way 41333 003604'01 104 00 0 00 000104 DOBE ;[158] gets all the way out. 41334 003605'01 320 12 0 00 003606' erjmpr .+1 ;[186] Catch and ignore error 41335 003606'01 endif. ;[186] End case waiting for output done 41336 003606'01 260 17 0 00 003544* call timoff ;[186] Shut off the timer 41337 003607'01 260 17 0 00 003546* xglog1: call rrslin ;[186] Restore the line for interactive use. 41338 003610'01 120 01 0 00 003547* dmove t1, odelay ;[194] Restore normal delay 41339 003611'01 124 01 0 00 003550* dmovem t1, delay ;[194] 41340 003612'01 120 01 0 00 003551* dmove t1, otimou ;[212] and timout interval 41341 003613'01 124 01 0 00 003552* dmovem t1, stimou ;[212] 41342 003614'01 402 00 0 00 003553* setzm srvflg ; and reset the server flag. 41343 003615'01 265 01 0 00 003554* wtlog (,) ;[126] Log the BYE. 41344 003616'01 000000000000# 41345 003617'01 777777 777764 41346 003620'01 000000 000000 41347 001003'04 102 131 105 040 122 41348 003621'01 260 17 0 00 003560* call clenup## ;[126] Close all logs. 41349 003622'01 476 00 0 00 003545* setom f$exit ; Just in case we can't logout, set exit flag. 41350 003623'01 474 01 0 00 000000 seto t1, ; -1 = Myself. 41351 003624'01 104 00 0 00 000003 LGOUT% ; Log me out. 41352 003625'01 320 14 0 00 003627' %jsker (,r) ; If this fails, print msg & go back. 41353 003626'01 254 00 0 00 003632' 41354 003627'01 265 01 0 00 003412* 41355 003630'01 000000 000000 41356 003631'01 254 00 0 00 002741* 41357 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20SRV MAC 9-Aug-24 12:55 Server commands. 41358 41359 ; Command to TYPE a file. Just like sending a file, except must send "X" 41360 ; packet instead of file header. 41361 41362 003632'01 260 17 0 00 003725' xgtype: call getarg ; Get the argument. 41363 003633'01 476 00 0 00 003242* setom xflg ; Send file with X header. 41364 003634'01 336 00 0 00 003143* ifmn. tlgjfn ;[233] Doing transaction logging? 41365 003635'01 254 00 0 00 003670' 41366 003636'01 415 16 0 00 003670' block. ;[233] Get a stack frame 41367 003637'01 261 17 0 00 000016 41368 003640'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 41369 003641'01 202 04 0 00 000000# movem t4,tmpjfn ;[233] Save the pointer 41370 003642'01 476 00 0 00 003136* setom scrlft ;[233] Don't append the crlf! 41371 003643'01 265 01 0 00 003615* wtlog(,) ;[233] 41372 003644'01 000000000000# 41373 003645'01 777777 777770 41374 003646'01 000000 000000 41375 001006'04 123 145 156 144 151 41376 003647'01 200 01 0 00 003634* move t1, tlgjfn ;[233] Put the directory name in the log 41377 003650'01 200 02 0 00 000000# move t2,tmpjfn ;[233] Reload the pointer 41378 003651'01 403 03 0 00 000004 setzb t3,t4 ;[233] Don't know how long, stop on a NUL 41379 003652'01 104 00 0 00 000053 SOUT% ;[233] Out it goes! 41380 003653'01 320 14 0 00 003654' erjmps .+1 ;[233] Catch and suppress error 41381 003654'01 402 00 0 00 000000# setzm tmpjfn ;[233] Scrub it, not a JFN anyway 41382 003655'01 120 02 0 00 000000# dxtext (t2,< for local display >) ;[233] 41383 000306'02 000000000000# 41384 000307'02 777777 777755 41385 001010'04 040 146 157 162 040 41386 003656'01 415 16 0 00 003667' block. ;[233] Set up ANOTHER stack context 41387 003657'01 261 17 0 00 000016 41388 003660'01 265 16 0 00 006301' saveac ;[233] Needs plenty registers for intersection jumps 41389 003661'01 254 14 0 00 000007 xsfm q3 ;[233] Get and store current processor flags 41390 003662'01 200 10 0 00 000000* move q4, bigsou## ;[233] Load up inter-section transfer address 41391 003663'01 201 11 0 00 003665' movei q5, .+2 ;[233] And the inter-section return adress 41392 003664'01 254 05 0 00 000007 xjrstf q3 ;[233] and take a giant step! 41393 003665'01 263 17 0 00 000000 ret ;[232] Get out of the block, restoring registers 41394 003666'01 263 17 0 00 000000 endbk. ;[232] End lexical SOUT% block 41395 003667'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 41396 003670'01 endif. ;[233] End case transaction logging 41397 003670'01 200 02 0 00 000004 move t2, t4 ;[141] Point to filespec. 41398 003671'01 254 00 0 00 003406' jrst xrecv2 ;[141] Do like when we get an R packet. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20SRV MAC 9-Aug-24 12:55 Server commands. 41399 41400 ;[58] Init-Info mechanism added as edit 58. 41401 ; 41402 ; Get an "I" parameters packet from the user, record the parameters, and send 41403 ; our own back in return. This exchange is optional, but should take place 41404 ; before any server/user transaction except file transfer, where it is required 41405 ; and always takes place via the Send-Init mechanism. 41406 ; 41407 003672'01 202 02 0 00 003364* xinfo: movem t2, pktnum ; Set the parameters we just got. 41408 003673'01 260 17 0 00 003360* call spar 41409 003674'01 402 00 0 00 003356* setzm numtry 41410 003675'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] Respond with ours. 41411 003676'01 260 17 0 00 003362* call rpar 41412 003677'01 201 01 0 00 000131 movei t1, "Y" 41413 003700'01 200 02 0 00 003672* move t2, pktnum 41414 003701'01 260 17 0 00 003564* call spack 41415 003702'01 600 00 0 00 000000 nop ; If they don't get it, they'll ask again... 41416 003703'01 254 00 0 00 003234' jrst xxwait k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20SRV MAC 9-Aug-24 12:55 Server commands. 41417 41418 ; GTSCH -- Get String Character 41419 ; 41420 ; Alternate GETCH routine for getting a character from an ASCIZ string in 41421 ; memory. Uses global STRPTR for input string. 41422 ; 41423 ; Returns: 41424 ; +1 if no more characters left in string. 41425 ; +2 always, with NEXT containing next character, -1 if no more. 41426 ; 41427 003704'01 gtsch: entry gtsch ;[220] 41428 003704'01 134 01 0 00 002412* ildb t1, strptr ; Get next character. 41429 003705'01 322 01 0 00 003710' jumpe t1, gtschz ; If zero, must be done. 41430 41431 ; Return with character like GETCH. 41432 41433 003706'01 202 01 0 00 000000* gtschx: movem t1, next ; Put result in NEXT, as GETCH does. 41434 003707'01 254 00 0 00 002312* retskp ; Done. 41435 41436 ; "EOF" return, like GETCH 41437 41438 003710'01 400 01 0 00 000000 gtschz: setz t1, 41439 003711'01 476 00 0 00 003706* setom next 41440 003712'01 263 17 0 00 000000 ret k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20SRV MAC 9-Aug-24 12:55 Server commands. 41441 41442 ; PUTSCH 41443 ; 41444 ; Alternate PUTCH routine. Just writes the character to a string in memory. 41445 ; Call with t2/ character to write. 41446 ; 41447 003713'01 putsch: entry putsch ;[220] 41448 003713'01 136 02 0 00 003704* idpb t2, strptr ; Here's the alternate PUTCH routine. 41449 003714'01 254 00 0 00 003707* retskp ; It always succeeds. 41450 41451 41452 ; PUTTCH 41453 ; 41454 ; Another alternate PUTCH routine. Writes the character to the terminal. 41455 ; Call like PUTCH and PUTSCH. 41456 ; 41457 41458 003715'01 puttch: entry puttch ;[220] 41459 003715'01 336 00 0 00 003161* skipn local ;[186] ;[177] But only if local. 41460 003716'01 254 00 0 00 003714* retskp ;[177] ... 41461 003717'01 261 17 0 00 000001 push p, t1 41462 003720'01 201 01 0 00 000101 movei t1, .priou 41463 003721'01 104 00 0 00 000051 BOUT 41464 003722'01 320 16 0 00 003723' erjmp .+1 41465 003723'01 262 17 0 00 000001 pop p, t1 41466 003724'01 254 00 0 00 003716* retskp 41467 41468 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20SRV MAC 9-Aug-24 12:55 Get Argument 41469 subttl Get Argument 41470 41471 ; Does the following: 41472 ; 41473 ; 1) Decodes server command packet 41474 ; 2) Sets up pointers to packet 41475 ; 3) Gets first argument 41476 ; 41477 ; Returns +1 always with: 41478 ; 41479 ; t3/ Length of first argument 41480 ; t4/ pointer to first argument 41481 41482 003725'01 201 01 0 00 003713' getarg: movei t1, putsch ; Address of alternate PUTCH routine. 41483 003726'01 202 01 0 00 003244* movem t1, dest 41484 003727'01 402 00 0 00 002374* setzm strbuf ; Clear decoding area. 41485 003730'01 200 01 0 00 006561' move t1, [strbuf,,strbuf+1] 41486 003731'01 251 01 0 00 000000* blt t1, strbz 41487 003732'01 200 01 0 00 006420' move t1, [point 7, strbuf] ; Where to put the decoded string. 41488 003733'01 202 01 0 00 003713* movem t1, strptr 41489 003734'01 200 01 0 00 000004 move t1, t4 ; Pointer to data to decode. 41490 003735'01 200 02 0 00 000003 move t2, t3 ; Length. 41491 003736'01 260 17 0 00 000000* call putbuf ; Go decode the packet. 41492 003737'01 254 00 0 00 003742' ifskp. ;[194] Worked, that's promising 41493 003740'01 402 00 0 00 003726* setzm dest ; Put PUTCH back to normal. 41494 003741'01 254 00 0 00 003751' else. ;[194] Failed somehow 41495 003742'01 402 00 0 00 003740* setzm dest ;[194] Stomp whatever's driving PUTCH 41496 003743'01 334 00 0 00 000000 kermsg (, xxwait) ;[194] 41497 003744'01 254 00 0 00 003751' 41498 003745'01 265 01 0 00 003443* 41499 003746'01 000000 000046 41500 003747'01 000000000000# 41501 003750'01 254 00 0 00 003234' 41502 001014'04 103 141 156 047 164 41503 003751'01 endif. ;[194] 41504 003751'01 200 04 0 00 006420' move t4, [point 7, strbuf] ; Point to decoded string. 41505 003752'01 134 03 0 00 000004 ildb t3, t4 ; Get CHAR(length) of directory string. 41506 003753'01 305 03 0 00 000040 caige t3, 40 ;[128] If null, no need to convert. 41507 003754'01 201 03 0 00 000040 movei t3, 40 ;[128] This also catches funny cases. 41508 003755'01 275 03 0 00 000040 subi t3, 40 ; UNCHAR of that to make a number. 41509 003756'01 263 17 0 00 000000 ret k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56 K20SRV MAC 9-Aug-24 12:55 Get Argument 41510 41511 ;[107] CWD server command (Connect to directory in DEC-20 parlance). 41512 ; 41513 ; Changes Working Directory, sends new directory name back in ACK, or else 41514 ; error packet if there's a problem. 41515 ; 41516 ; Arrive here with t4 containing pointer to argument string of form 41517 ; 41518 ; where is a single character (offset by CHAR), 41519 ; and t3 containing the length of the string. 41520 ; 41521 ;;;;;;;;;;;;;;;; 41522 ; 41523 ; Issuing the following from VENTI2:: to TOMMYT:: reliably breaks remote K20 41524 ; 41525 ;Remote: 41526 ; 41527 ; @get H:Kermit 41528 ; @start 41529 ; *set TOPS-20 41530 ; *server 41531 ; 41532 ;Local: 41533 ; 41534 ;rem cwd (to directory) "ps:" "" 41535 ;rem dir "*.directory.0" 41536 ;rem cwd "venti:" "" 41537 ; 41538 ; Trying to connect to an unmounted structure breaks this with: 41539 ; KERMIT (1): HALT: Illegal instruction 0 at 301144 41540 ; ?Undefined operation code, 0:00:58.7 41541 ; 41542 ; Also: 41543 ; 41544 ;?Pushdown overflow at 62430 41545 ;;;;;;;;;;;;;;;; 41546 41547 003757'01 260 17 0 00 003725' xgcwd: call getarg ; Get the first argument. 41548 003760'01 327 03 0 00 003770' jumpg t3, xgcwd2 ; If positive, go handle string. 41549 003761'01 322 03 0 00 004133' jumpe t3, xgcwd5 ; If null, go connect back to own directory. 41550 41551 003762'01 334 00 0 00 000000 kermsg (,xxwait) ; Negative length??? 41552 003763'01 254 00 0 00 003770' 41553 003764'01 265 01 0 00 003745* 41554 003765'01 000000 000051 41555 003766'01 000000000000# 41556 003767'01 254 00 0 00 003234' 41557 001022'04 102 141 144 040 154 41558 41559 ; Set up argument block for ACCES 41560 41561 003770'01 200 05 0 00 000004 xgcwd2: move q1, t4 ; Byte pointer to directory string. 41562 003771'01 133 03 0 00 000004 adjbp t3, t4 ; Now point to password. 41563 003772'01 134 04 0 00 000003 ildb t4, t3 ; Get its length. 41564 003773'01 200 06 0 00 000003 move q2, t3 ; Put pointer in ACCES arg block. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-1 K20SRV MAC 9-Aug-24 12:55 Get Argument 41565 003774'01 275 04 0 00 000040 subi t4, 40 ; UNCHAR to make it a number. 41566 003775'01 335 00 0 00 000004 skipge t4 ; Normal kind of number? 41567 003776'01 400 04 0 00 000000 setz t4, ; No, must have fallen off end, so no pswd. 41568 003777'01 400 02 0 00 000000 setz t2, ; Zero the length to make directory asciz. 41569 004000'01 137 02 0 00 000003 dpb t2, t3 ; ... 41570 004001'01 133 04 0 00 000003 adjbp t4, t3 ; Make sure password is asciz. 41571 004002'01 136 02 0 00 000004 idpb t2, t4 41572 41573 ;[255] See if the belief is that Tops-20 is really Unix, Windows, DOS or OS/2 ... 41574 41575 004003'01 415 16 0 00 004017' block. ;[255] Enter block context for better control flow 41576 004004'01 261 17 0 00 000016 41577 004005'01 200 02 0 00 000005 move t2, q1 ;[255] Pick up the pointer 41578 004006'01 134 01 0 00 000002 ildb t1, t2 ;[255] Pick up first byte (might not be on a word) 41579 004007'01 302 01 0 00 000056 caie t1, "." ;[255] First part of talisman? 41580 004010'01 263 17 0 00 000000 ret ;[255] No, so go do it the old fashioned way 41581 004011'01 134 01 0 00 000002 ildb t1, t2 ;[255] Pick up second byte 41582 004012'01 302 01 0 00 000056 caie t1, "." ;[255] Second part of talisman? 41583 004013'01 263 17 0 00 000000 ret ;[255] No, so some kind of gubbish ... 41584 004014'01 134 01 0 00 000002 ildb t1, t2 ;[255] Pick up third byte 41585 004015'01 322 01 0 00 003724* jumpe t1, RSKP ;[255] Should be end of string 41586 004016'01 263 17 0 00 000000 endbk. ;[255] Close out control block 41587 004017'01 254 00 0 00 004021' ifskp. ;[255] Was it ".."? 41588 004020'01 254 00 0 00 004267' jrst xgcdup ;[255] Go pretend we got a CDUP 41589 004021'01 endif. ;[255] Otherwise, proceed 'normally' 41590 41591 ;[193] Check to see what we might be connecting to 41592 41593 004021'01 205 01 0 00 000001 xgcwd3: movx t1, rc%emo ;[193] Exact match only 41594 004022'01 200 02 0 00 000005 move t2, q1 ;[193] Load pointer to the string that got sent 41595 004023'01 400 03 0 00 000000 setz t3, ;[193] Not doing any directory stepping 41596 004024'01 104 00 0 00 000553 RCDIR% ;[193] See if it exists 41597 004025'01 320 12 0 00 004027' ifje. r ;[193] Catch and ignore error 41598 004026'01 254 00 0 00 004064' 41599 004027'01 200 04 0 00 000001 move t4, t1 ;[249] May be of interest to debuggers 41600 004030'01 415 16 0 00 004060' block. ;[249] Enter block context for ease of flow 41601 004031'01 261 17 0 00 000016 41602 004032'01 104 00 0 00 000013 GJINF% ;[249] Get our connected directory 41603 004033'01 320 12 0 00 003631* erjmpr r ;[249] Should be impossible, BUT ... 41604 004034'01 561 01 0 00 000000# hrroi t1, cwdbuf ;[249] Write current connected directory here 41605 remark t2, ;[249] Now has current connected directory 41606 004035'01 104 00 0 00 000041 DIRST% ;[249] Turn into a string 41607 004036'01 320 12 0 00 004033* erjmpr r ;[249] If didn't work, can't do relative 41608 004037'01 135 04 0 00 000001 ldb t4, t1 ;[249] Load closing punctuation 41609 004040'01 201 03 0 00 000056 movx t3, "." ;[249] Load the subdirectory punctuation 41610 004041'01 137 03 0 00 000001 dpb t3, t1 ;[249] Overwrite closing punctuation 41611 004042'01 200 02 0 00 000005 move t2, q1 ;[249] Load pointer to possible relative directory 41612 004043'01 do. ;[249] Enter loop context 41613 004043'01 134 03 0 00 000002 ildb t3, t2 ;[249] Pick up a byte from source (the packet) 41614 004044'01 322 03 0 00 004047' jumpe t3, endlp. ;[249] If NUL, we're done 41615 004045'01 136 03 0 00 000001 idpb t3, t1 ;[249] Append it to punctuated directory 41616 004046'01 254 00 0 00 004043' loop. ;[249] Get some more bytes 41617 004047'01 enddo. ;[249] Exit loop lexical context 41618 004047'01 136 04 0 00 000001 idpb t4, t1 ;[249] Append closing punctuation 41619 004050'01 136 03 0 00 000001 idpb t3, t1 ;[249] Tie off the string k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-2 K20SRV MAC 9-Aug-24 12:55 Get Argument 41620 004051'01 205 01 0 00 000001 movx t1, rc%emo ;[249] Exact match only 41621 004052'01 561 02 0 00 000000# hrroi t2, cwdbuf ;[249] Load pointer to new candidate 41622 004053'01 400 03 0 00 000000 setz t3, ;[249] Not doing any directory stepping 41623 004054'01 104 00 0 00 000553 RCDIR% ;[249] See if that exists 41624 004055'01 320 12 0 00 004036* erjmpr r ;[249] No luck... 41625 004056'01 254 00 0 00 004015* retskp ;[249] Won something 41626 004057'01 263 17 0 00 000000 endbk. ;[249] End block context 41627 004060'01 254 00 0 00 004062' ifskp. ;[249] Successful recovery 41628 remark ;[249] Nothing special to do, carry on 41629 004061'01 254 00 0 00 004064' else. ;[249] Otherwise, wasn't a valid relative directory 41630 004062'01 200 03 0 00 000001 move t3, t1 ;[249] Save any other error 41631 004063'01 205 01 0 00 040000 movx t1, rc%nom ;[193] On any failure, say no match 41632 004064'01 endif. ;[249] End of absolute RCDIR% recovery attempt 41633 004064'01 endif. ;[193] End RCDIR% error handling 41634 41635 004064'01 603 01 0 00 040000 ifxe. t1, rc%nom ;[249] If no match is off, then directory exists 41636 004065'01 254 00 0 00 004070' 41637 004066'01 202 03 0 00 000005 movem t3, q1 ;[249] Stomp in resolved directory number 41638 004067'01 254 00 0 00 004121' jrst xgcwd4 ;[249] Carry on and connect 41639 004070'01 endif. ;[249] End case successful match 41640 41641 004070'01 200 01 0 00 000005 move t1, q1 ;[193] Load pointer to the string that got sent 41642 004071'01 104 00 0 00 000120 STDEV% ;[193] Translate to a device 41643 004072'01 320 14 0 00 004074' %jsker (,xxwait) ;[193] Ship error message back in an error packet. 41644 004073'01 254 00 0 00 004077' 41645 004074'01 265 01 0 00 003627* 41646 004075'01 000000 000000 41647 004076'01 254 00 0 00 003234' 41648 004077'01 200 01 0 00 000002 move t1, t2 ;[193] Load the device designator 41649 004100'01 104 00 0 00 000117 DVCHR% ;[193] Get its characteristics 41650 004101'01 320 14 0 00 004103' %jsker (,xxwait) ;[193] STDEV% just handed it to us... 41651 004102'01 254 00 0 00 004106' 41652 004103'01 265 01 0 00 004074* 41653 004104'01 000000 000000 41654 004105'01 254 00 0 00 003234' 41655 004106'01 135 03 0 00 006276' ldb t3, [pointr t2, dv%typ] ;[193] Pick up the device type 41656 004107'01 306 03 0 00 000015 cain t3, .dvnul ;[193] Want's to do absolutely nothing? 41657 004110'01 254 00 0 00 004146' jrst xgcwdz ;[193] Fine, then don't do anything 41658 dmove t1, [ .fhslf ;[193] Get ready to complain about ourself 41659 004111'01 120 01 0 00 006562' RCDIX3 ] ;[193] Force "Invalid structure name" 41660 004112'01 104 00 0 00 000336 SETER% ;[193] Set last error for this process 41661 004113'01 320 12 0 00 004114' erjmpr .+1 ;[193] Catch and ignore error 41662 004114'01 254 00 0 00 004116' %erker (,xxwait) ;[193] Go blat and leave 41663 004115'01 254 00 0 00 004121' 41664 004116'01 265 01 0 00 004103* 41665 004117'01 000000000000# 41666 004120'01 254 00 0 00 003234' 41667 001031'04 116 157 164 040 141 41668 41669 ; Access the directory. ** Maybe should also mount structure if necessary? 41670 41671 004121'01 200 01 0 00 006354' xgcwd4: move t1, [ac%con!<3>] ; Function is Connect, arg block has 2 words. 41672 004122'01 201 02 0 00 000005 movei t2, q1 ; Address of argument block. 41673 004123'01 474 07 0 00 000000 seto q3, ; Own job. 41674 004124'01 104 00 0 00 000552 ACCES k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56-3 K20SRV MAC 9-Aug-24 12:55 Get Argument 41675 004125'01 320 14 0 00 004127' %jsker (,xxwait) ; Send any error message in error packet. 41676 004126'01 254 00 0 00 004132' 41677 004127'01 265 01 0 00 004116* 41678 004130'01 000000 000000 41679 004131'01 254 00 0 00 003234' 41680 004132'01 254 00 0 00 004146' jrst xgcwdz ; Done connecting, go send ACK. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20SRV MAC 9-Aug-24 12:55 Get Argument 41681 41682 ;...XGCWD, cont'd 41683 41684 41685 ; Come here to connect to own directory. 41686 41687 004133'01 200 05 0 00 000000# xgcwd5: move q1, .jilno+jobtab ;[220] Logged-in directory number. 41688 004134'01 400 06 0 00 000000 setz q2, ; No password needed 41689 004135'01 474 07 0 00 000000 seto q3, ; Own job. 41690 004136'01 201 02 0 00 000005 movei t2, q1 ; Address of arg block. 41691 004137'01 200 01 0 00 006354' move t1, [ac%con!<3>] ; Function is connect. 41692 004140'01 104 00 0 00 000552 ACCES ; Connect to own directory. 41693 004141'01 320 14 0 00 004143' %jsker (,xxwait) 41694 004142'01 254 00 0 00 004146' 41695 004143'01 265 01 0 00 004127* 41696 004144'01 000000 000000 41697 004145'01 254 00 0 00 003234' 41698 ;... k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20SRV MAC 9-Aug-24 12:55 Get Argument 41699 41700 ;...XGCWD, cont'd 41701 41702 41703 ; Done, send back ACK with directory string in it. 41704 41705 004146'01 104 00 0 00 000013 xgcwdz: GJINF 41706 004147'01 200 01 0 00 006420' move t1, [point 7, strbuf] 41707 004150'01 202 01 0 00 003733* movem t1, strptr 41708 004151'01 104 00 0 00 000041 DIRST 41709 004152'01 320 14 0 00 004154' %jsker (,xxwait) 41710 004153'01 254 00 0 00 004157' 41711 004154'01 265 01 0 00 004143* 41712 004155'01 000000 000000 41713 004156'01 254 00 0 00 003234' 41714 41715 004157'01 201 01 0 00 003704' movei t1, gtsch ; Indicate routine to be used for getting 41716 004160'01 202 01 0 00 003243* movem t1, source ; characters. 41717 004161'01 476 00 0 00 003711* setom next ; Set initial condition. 41718 004162'01 200 01 0 00 000000* move t1, maxdat ; Get a buffer full of data. 41719 004163'01 260 17 0 00 000000* call getbuf ; ... 41720 004164'01 326 01 0 00 003234' jumpn t1, xxwait ; 41721 004165'01 402 00 0 00 004160* setzm source ; Put GETCH back to normal. 41722 004166'01 200 03 0 00 000001 move t3, t1 ; Length 41723 004167'01 201 01 0 00 000131 movei t1, "Y" ; Y for Yes (ACK) 41724 004170'01 400 02 0 00 000000 setz t2, ; Packet number 0. 41725 004171'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] Point to string built by getbuf. 41726 004172'01 260 17 0 00 003701* call spack ; Send the ACK. 41727 004173'01 600 00 0 00 000000 nop ; Nothing much we can do here... 41728 004174'01 254 00 0 00 003234' jrst xxwait ; Done. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20SRV MAC 9-Aug-24 12:55 Get Argument 41729 41730 ;[56] Disk USAGE server query added in edit 56. 41731 ; 41732 ; Assumes reply will fit in data field of ACK packet; does not use 41733 ; text header ("X") protocol. Sends as much of reply as will fit. 41734 ; 41735 004175'01 474 01 0 00 000000 xgdisk: seto t1, ; Get disk usage of connected directory. 41736 004176'01 104 00 0 00 000305 GTDAL% 41737 004177'01 320 14 0 00 004201' %jsker ,r 41738 004200'01 254 00 0 00 004204' 41739 004201'01 265 01 0 00 004154* 41740 004202'01 000000000000# 41741 004203'01 254 00 0 00 004055* 41742 001036'04 103 141 156 047 164 41743 004204'01 120 05 0 00 000001 dmove q1, t1 ; Save the numbers in q1,q2. 41744 41745 004205'01 200 01 0 00 006420' move t1, [point 7, strbuf] ;[188] String pointer to data field. 41746 004206'01 202 01 0 00 004150* movem t1, strptr ;[103] 41747 004207'01 120 02 0 00 000000# smsg () ;[188] Inital part of response 41748 004210'01 260 17 0 00 002202* 41749 000310'02 000000000000# 41750 000311'02 777777 777771 41751 001043'04 121 165 157 164 141 41752 41753 004211'01 200 02 0 00 000005 move t2, q1 ; Quota, or "+Inf" 41754 004212'01 305 02 0 00 006530' caige t2, [^d100000000] ;[194] Big? 41755 004213'01 254 00 0 00 004217' ifskp. ;[194] Yep, really big 41756 004214'01 120 02 0 00 000000# smsg (<+Inf>) ;[194] So say that differently 41757 004215'01 260 17 0 00 004210* 41758 000312'02 000000000000# 41759 000313'02 777777 777774 41760 001045'04 053 111 156 146 000 41761 004216'01 254 00 0 00 004222' else. ;[194] Otherwise, comprehensible limit 41762 004217'01 201 03 0 00 000012 movei t3, ^d10 ; in decimal 41763 004220'01 104 00 0 00 000224 NOUT% 41764 004221'01 320 14 0 00 004232' erjmps xgdis2 ;[194] Catch and suppress errpr 41765 004222'01 endif. ;[194] 41766 41767 004222'01 120 02 0 00 000000# smsg (<, used: >) ;[194] How much we're using of it 41768 004223'01 260 17 0 00 004215* 41769 000314'02 000000000000# 41770 000315'02 777777 777770 41771 001046'04 054 040 165 163 145 41772 41773 004224'01 200 02 0 00 000006 move t2, q2 ; Pages used, 41774 004225'01 201 03 0 00 000012 movei t3, ^d10 ; in decimal 41775 004226'01 104 00 0 00 000224 NOUT% 41776 004227'01 320 14 0 00 004232' erjmps xgdis2 ;[194] Catch and suppress error 41777 41778 004230'01 120 02 0 00 000000# smsg (< (pages)>) ; Specify units 41779 004231'01 260 17 0 00 004223* 41780 000316'02 000000000000# 41781 000317'02 777777 777770 41782 001050'04 040 050 160 141 147 41783 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59-1 K20SRV MAC 9-Aug-24 12:55 Get Argument 41784 004232'01 200 02 0 00 004206* xgdis2: move t2, strptr ;[103] Check length 41785 004233'01 250 01 0 00 000002 exch t1, t2 41786 004234'01 260 17 0 00 000000* call subbp 41787 004235'01 334 00 0 00 000000 kermsg (,r) ;[188] 41788 004236'01 254 00 0 00 004243' 41789 004237'01 265 01 0 00 003764* 41790 004240'01 000000 000027 41791 004241'01 000000000000# 41792 004242'01 254 00 0 00 004203* 41793 001052'04 163 165 142 142 160 41794 004243'01 400 04 0 00 000000 setz t4, ;[188] Cons up a .CHNUL 41795 004244'01 136 04 0 00 000002 idpb t4, t2 ; Done constructing string, make it asciz 41796 004245'01 200 05 0 00 000000* move q1, spsiz ; Is the string bigger than max size to send? 41797 004246'01 275 05 0 00 000005 subi q1, 5 41798 004247'01 307 05 0 03 000000 caig q1, (t3) ; (it should always fit). 41799 004250'01 200 03 0 00 000005 move t3, q1 ; Yes, so cut it off at the limit. 41800 ;.. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 60 K20SRV MAC 9-Aug-24 12:55 Get Argument 41801 41802 ;...XGDISK, cont'd 41803 41804 41805 ;[103] Begin Change: Use standard packet filling technique to send this. 41806 41807 004251'01 201 01 0 00 003704' movei t1, gtsch ; Indicate routine to be used for getting 41808 004252'01 202 01 0 00 004165* movem t1, source ; characters. 41809 004253'01 476 00 0 00 004161* setom next ; Set initial condition. 41810 004254'01 200 01 0 00 004162* move t1, maxdat ; Get a buffer full of data. 41811 004255'01 260 17 0 00 004163* call getbuf ; ... 41812 004256'01 326 01 0 00 003234' jumpn t1, xxwait ; 41813 004257'01 200 03 0 00 000001 move t3, t1 ; Set up length. 41814 004260'01 402 00 0 00 004252* setzm source ; Put GETCH back to normal. 41815 41816 ;[103] End Change. Now send the packet. 41817 41818 004261'01 201 01 0 00 000131 xgdisz: movei t1, "Y" ; Formulate the ACK 41819 004262'01 400 02 0 00 000000 setz t2, ; (Packet number should be 0, right?) 41820 004263'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] The data itself 41821 004264'01 260 17 0 00 004172* call spack ; Send it off. 41822 004265'01 600 00 0 00 000000 nop ;* What if it fails? 41823 004266'01 254 00 0 00 003234' jrst xxwait k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61 K20SRV MAC 9-Aug-24 12:55 Get Argument 41824 41825 ; 41826 ;[254] CDUP connects to upper (or superior) directory, responds like PWD 41827 ; 41828 ; N.B., For Unix fans and Windows heros, be aware that the so-called 41829 ; working directory is NOT the same thing on Tops-20! It is the 41830 ; connected directory, which changes your access rights to that 41831 ; directory and possible group memberships. A connected directory 41832 ; is also job wide, not process wide. 41833 ; 41834 ; Uses xgpwd for response 41835 41836 004267'01 265 16 0 00 006357' xgcdup: saveac ; Need some local fast scratch 41837 004270'01 104 00 0 00 000013 GJINF% ; Get current job information. 41838 004271'01 320 14 0 00 004273' %jsker ,r 41839 004272'01 254 00 0 00 004276' 41840 004273'01 265 01 0 00 004201* 41841 004274'01 000000000000# 41842 004275'01 254 00 0 00 004242* 41843 001055'04 103 141 156 047 164 41844 004276'01 200 10 0 00 000002 move q4, t2 ; Save currently connected directory 41845 41846 004277'01 200 06 0 00 006564' move q2, [point 7,dirbuf] ;Hardware pointer to directory buffer 41847 004300'01 200 01 0 00 000006 move t1, q2 ; Copy for local usage 41848 remark t2, ; Already has the connected directory 41849 004301'01 104 00 0 00 000041 DIRST% ; Translate into a string 41850 004302'01 320 14 0 00 004304' %jsker ,r 41851 004303'01 254 00 0 00 004307' 41852 004304'01 265 01 0 00 004273* 41853 004305'01 000000000000# 41854 004306'01 254 00 0 00 004275* 41855 001064'04 103 157 165 154 144 41856 41857 004307'01 200 01 0 00 000006 move t1, q2 ; Copy for local usage 41858 004310'01 400 03 0 00 000000 setz t3, ; Last dot we saw 41859 41860 004311'01 do. ; Enter loop context 41861 004311'01 134 02 0 00 000001 ildb t2, t1 ; Pick up a byte 41862 004312'01 322 02 0 00 004320' jumpe t2, endlp. ; Stop if off the end of the string (wierd...) 41863 004313'01 306 02 0 00 000076 cain t2, .chrpt ; At end of directory specification? 41864 004314'01 254 00 0 00 004320' exit. ; Yes, so done with the loop 41865 004315'01 306 02 0 00 000056 cain t2, "." ; Hit a dot?? 41866 004316'01 200 03 0 00 000001 move t3, t1 ; Yes, remember pointer to the last one seen 41867 004317'01 254 00 0 00 004311' loop. ; Grovel to the end of the string 41868 004320'01 enddo. ; Exit loop context 41869 41870 004320'01 322 03 0 00 004353' jumpe t3, xgpwd ; If never saw a dot, nothing to do 41871 41872 004321'01 120 01 0 00 006426' dmove t1, [exp .chrpt,0] ;Load closing punctuation 41873 004322'01 137 01 0 00 000003 dpb t1, t3 ; Stomp the dot with closing punctuation 41874 004323'01 136 02 0 00 000003 idpb t2, t3 ; Close off the string 41875 ; Convert our masterpiece to internal format 41876 004324'01 205 01 0 00 000001 movx t1, rc%emo ; Must match this and only this directory 41877 004325'01 200 02 0 00 000006 move t2, q2 ; Load pointer to munged directory 41878 004326'01 400 03 0 00 000000 setz t3, ; Not doing any stepping k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61-1 K20SRV MAC 9-Aug-24 12:55 Get Argument 41879 004327'01 104 00 0 00 000553 RCDIR% ; See if we can recognize it 41880 004330'01 607 01 0 00 070000 ifxn. t1, rc%nom!rc%amb!rc%nmd 41881 004331'01 254 00 0 00 004337' 41882 004332'01 254 00 0 00 004334' %erker (,r) 41883 004333'01 254 00 0 00 004337' 41884 004334'01 265 01 0 00 004304* 41885 004335'01 000000000000# 41886 004336'01 254 00 0 00 004306* 41887 001077'04 125 156 141 142 154 41888 004337'01 endif. ; End case couldn't find it 41889 41890 004337'01 200 07 0 00 000003 move q3, t3 ; Store the directory number, just in case 41891 004340'01 200 01 0 00 006354' movx t1, ac%con!3 ; Doing a connect, block is three words long 41892 004341'01 201 02 0 00 000003 movei t2, t3 ; Argument block begins in AC3 41893 004342'01 120 04 0 00 006432' dmove t4, [ exp 0, -1 ] ; No password, this job 41894 004343'01 104 00 0 00 000552 ACCES% ; Try the connect 41895 004344'01 320 14 0 00 004346' %jsker (,r) 41896 004345'01 254 00 0 00 004351' 41897 004346'01 265 01 0 00 004334* 41898 004347'01 000000000000# 41899 004350'01 254 00 0 00 004336* 41900 001114'04 125 156 141 142 154 41901 41902 004351'01 260 17 0 00 000305' call udjinf ; Update currently connected directory 41903 004352'01 254 00 0 00 004353' callret xgpwd ; Respond exactly like xgpwd 41904 41905 ;[254] End Code Insertion k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62 K20SRV MAC 9-Aug-24 12:55 Get Argument 41906 41907 ; 41908 ;[188] PWD server query; prints working directory. 41909 ; 41910 ; Assumes reply will fit in data field of ACK packet; does not use 41911 ; text header ("X") protocol. Sends as much of reply as will fit. 41912 ; 41913 ; N.B., For Unix fans and Windows heros, be aware that the so-called 41914 ; working directory is NOT the same thing on Tops-20! It is the 41915 ; connected directory, which changes your access rights to that 41916 ; directory and possible group memberships. A connected directory 41917 ; is also job wide, not process wide. 41918 ; 41919 ; Looks remarkably like xgdisk... 41920 41921 004353'01 104 00 0 00 000013 xgpwd: GJINF% ; Get current job information. 41922 004354'01 320 14 0 00 004356' %jsker ,r 41923 004355'01 254 00 0 00 004361' 41924 004356'01 265 01 0 00 004346* 41925 004357'01 000000000000# 41926 004360'01 254 00 0 00 004350* 41927 001124'04 103 141 156 047 164 41928 004361'01 200 01 0 00 006420' move t1, [point 7, strbuf] ; String pointer to data field. 41929 004362'01 202 01 0 00 004232* movem t1, strptr ; Also for packetizer 41930 remark t2, ; Already has the connected directory 41931 004363'01 104 00 0 00 000041 DIRST% ; Translate into a string 41932 004364'01 320 14 0 00 004366' %jsker ,r 41933 004365'01 254 00 0 00 004371' 41934 004366'01 265 01 0 00 004356* 41935 004367'01 000000000000# 41936 004370'01 254 00 0 00 004360* 41937 001133'04 103 157 165 154 144 41938 41939 remark ^D<6+1+1+39+1=48> ;Maximum directory string length 41940 41941 004371'01 200 02 0 00 004362* move t2, strptr ; Check the length in case of 'micropacket' 41942 004372'01 250 01 0 00 000002 exch t1, t2 ; Beginning pointer in t1, final in t2 41943 004373'01 260 17 0 00 004234* call subbp ; Subtract to get length 41944 004374'01 334 00 0 00 000000 kermsg (,r) ;Really unlikely, see above 41945 004375'01 254 00 0 00 004402' 41946 004376'01 265 01 0 00 004237* 41947 004377'01 000000 000027 41948 004400'01 000000000000# 41949 004401'01 254 00 0 00 004370* 41950 001146'04 163 165 142 142 160 41951 41952 004402'01 400 04 0 00 000000 setz t4, ; Cons up a .CHNUL 41953 004403'01 136 04 0 00 000002 idpb t4, t2 ; Tie off the string 41954 004404'01 200 05 0 00 004245* move q1, spsiz ; Is the string bigger than max size to send? 41955 004405'01 275 05 0 00 000005 subi q1, 5 41956 004406'01 307 05 0 03 000000 caig q1, (t3) ; (it should always fit). 41957 004407'01 200 03 0 00 000005 move t3, q1 ; Yes, so cut it off at the limit. 41958 41959 004410'01 201 01 0 00 003704' movei t1, gtsch ; Indicate routine to be used for getting 41960 004411'01 202 01 0 00 004260* movem t1, source ; characters. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62-1 K20SRV MAC 9-Aug-24 12:55 Get Argument 41961 004412'01 476 00 0 00 004253* setom next ; Set initial condition. 41962 004413'01 200 01 0 00 004254* move t1, maxdat ; Get a buffer full of data. 41963 004414'01 260 17 0 00 004255* call getbuf ; ... 41964 004415'01 326 01 0 00 003234' jumpn t1, xxwait ; 41965 004416'01 200 03 0 00 000001 move t3, t1 ; Set up length. 41966 004417'01 402 00 0 00 004411* setzm source ; Put GETCH back to normal. 41967 ; Now send the packet. 41968 004420'01 201 01 0 00 000131 movei t1, "Y" ; Formulate the ACK 41969 004421'01 400 02 0 00 000000 setz t2, ; (Packet number should be 0, right?) 41970 004422'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] The data itself 41971 004423'01 260 17 0 00 004264* call spack ; Send it off. 41972 004424'01 600 00 0 00 000000 nop ;* What if it fails? 41973 004425'01 254 00 0 00 003234' jrst xxwait 41974 41975 ;[188] End Code Insertion k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63 K20SRV MAC 9-Aug-24 12:55 Get Argument 41976 41977 ; Define 30 bit one word global ASCII pointer to another section 41978 41979 extern hlpntr ;[194] One word global ASCII pointer 41980 extern srvhlp ;[194] In k20hlp in section one 41981 41982 000000000000# xhlptr==hlpntr!srvhlp ;[194] Forces LINK to do a polish fix up 41983 41984 004426'01 336 00 0 00 003647* xgstat:ifmn. tlgjfn ;[233] Doing transaction logging? 41985 004427'01 254 00 0 00 004441' 41986 004430'01 415 16 0 00 004441' block. ;[233] Get a stack frame 41987 004431'01 261 17 0 00 000016 41988 004432'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 41989 004433'01 476 00 0 00 003642* setom scrlft ;[233] Suppress the trailing carriage return 41990 004434'01 265 01 0 00 003643* wtlog(,) ;[233] 41991 004435'01 000000000000# 41992 004436'01 777777 777735 41993 004437'01 000000 000000 41994 001151'04 123 145 156 144 151 41995 004440'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 41996 004441'01 endif. ;[233] 41997 41998 004441'01 260 17 0 00 002623* call $srvt ;[189] Build the text in a buffer 41999 004442'01 400 02 0 00 000000 setz t2, ;[189] Cons up a .chnul 42000 004443'01 136 02 0 00 000001 idpb t2,t1 ;[189] Tied off the 'string' 42001 004444'01 136 02 0 00 000001 idpb t2,t1 ;[189] Tie it off some more ... 42002 004445'01 200 01 0 00 006565' move t1,[point 7,statxt];[233] Load pointer to constructed text 42003 004446'01 254 00 0 00 004463' jrst xghel1 ;[233] Join common code 42004 42005 004447'01 336 00 0 00 004426* xghelp: ifmn. tlgjfn ;[233] Doing transaction logging? 42006 004450'01 254 00 0 00 004462' 42007 004451'01 415 16 0 00 004462' block. ;[233] Get a stack frame 42008 004452'01 261 17 0 00 000016 42009 004453'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 42010 004454'01 476 00 0 00 004433* setom scrlft ;[233] Suppress the trailing carriage return 42011 004455'01 265 01 0 00 004434* wtlog(,) ;[233] 42012 004456'01 000000000000# 42013 004457'01 777777 777744 42014 004460'01 000000 000000 42015 001161'04 123 145 156 144 151 42016 004461'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 42017 004462'01 endif. ;[233] 42018 004462'01 200 01 0 00 006566' move t1, [ xhlptr ] ;[194] Load pointer to general remote help text 42019 42020 004463'01 xghel1: remark ;[233] Common link 42021 004463'01 202 01 0 00 004371* movem t1, strptr ; Put pointer here, where 42022 004464'01 201 01 0 00 003704' movei t1, gtsch ; routine for getting chars from a string 42023 004465'01 202 01 0 00 004417* movem t1, source ; can find it. 42024 004466'01 476 00 0 00 004412* setom next ; Init char lookahead 42025 004467'01 476 00 0 00 003633* setom xflg ; Send with X rather than F header. 42026 004470'01 260 17 0 00 003425* call $sends ; Go send the text like a file 42027 004471'01 600 00 0 00 000000 nop 42028 004472'01 402 00 0 00 004465* setzm source ;[121] Put send source back to normal. 42029 004473'01 254 00 0 00 003234' jrst xxwait k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 64 K20SRV MAC 9-Aug-24 12:55 Get Argument 42030 42031 ;[116] DIRECTORY server command. 42032 42033 ; DIRCH 42034 ; 42035 ; Alternate GETCH routine for getting characters from a directory listing 42036 ; in a memory buffer, and for refilling the buffer when it gets empty. 42037 ; 42038 004474'01 dirch: entry dirch ;[186] 42039 004474'01 134 01 0 00 000000# ildb t1, getptr ; Get character. 42040 004475'01 332 00 0 00 000001 skipe t1 ; Null? 42041 004476'01 254 00 0 00 004506' jrst dirchx ; No, return the character. 42042 42043 ; No characters in buffer, try to refill. 42044 42045 004477'01 260 17 0 00 006144' dirch2: call dmpbuf ; If so, reset the buffer pointers, etc. 42046 004500'01 260 17 0 00 002033' call dirlst ; And try to fill the listing buffer again. 42047 004501'01 322 01 0 00 004510' jumpe t1, dirchz ; No more, done. 42048 004502'01 200 01 0 00 006567' move t1, [point 7, srvbuf] ; Get new listing buffer pointer. 42049 004503'01 202 01 0 00 000000# movem t1, getptr ; Save it for getting characters. 42050 004504'01 134 01 0 00 000000# ildb t1, getptr ; Get first character of new buffer. 42051 004505'01 322 01 0 00 004510' jumpe t1, dirchz ; This shouldn't happen... 42052 42053 ; Return with character like GETCH. 42054 42055 004506'01 202 01 0 00 004466* dirchx: movem t1, next 42056 004507'01 254 00 0 00 004056* retskp 42057 42058 ; "EOF" return, like GETCH. 42059 42060 004510'01 400 01 0 00 000000 dirchz: setz t1, 42061 004511'01 476 00 0 00 004506* setom next 42062 004512'01 263 17 0 00 000000 ret 42063 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65 K20SRV MAC 9-Aug-24 12:55 XGDIR - Server provides directory listing. 42064 subttl XGDIR - Server provides directory listing. 42065 42066 004513'01 100100 777775 sdirb2: gj%old!gj%ifg!.gjall ;[191] Flags,,All generations. 42067 004514'01 377777 377777 .nulio,,.nulio ;[191] No i/o. 42068 repeat <^d8>,<0> ;[191] No defaults; nothing 42069 004515'01 000000 000000 42070 004516'01 000000 000000 42071 004517'01 000000 000000 42072 004520'01 000000 000000 42073 004521'01 000000 000000 42074 004522'01 000000 000000 42075 004523'01 000000 000000 42076 004524'01 000000 000000 42077 42078 ;[190] Prologue rewritten to not store in (write-protected!) code .psect 42079 42080 004525'01 260 17 0 00 003725' xgdir: call getarg ; Get the first (& only) argument 42081 004526'01 327 03 0 00 004550' jumpg t3, xgdir2 ; Got something, go do it. 42082 004527'01 326 03 0 00 004542' ife. t3 ;[190] Got nothing, default the directory 42083 004530'01 265 16 0 00 003016* anstkv(t4,^d4) ;[190] Create an anonymous stkvar 42084 004531'01 000000 000004 42085 004532'01 415 04 0 17 777773 42086 004533'01 120 01 0 00 006570' dmove t1,[ exp ascii "*.*.*", 0 ] ;[190] Load default file spec 42087 004534'01 124 01 0 04 000000 dmovem t1,0(t4) ;[190] Stomp into buffer 42088 004535'01 403 01 0 00 000002 setzb t1,t2 ;[190] Cons up ten .CHNUL's 42089 004536'01 124 01 0 04 000002 dmovem t1,2(t4) ;[190] Stomp rest of buffer 42090 004537'01 201 03 0 00 000005 movei t3,^d5 ;[190] Five characters long 42091 004540'01 505 04 0 00 440700 hrli t4,(point 7,) ;[190] Now have an ASCII pointer 42092 004541'01 254 00 0 00 004550' jrst xgdir2 ;[190] Go get a file specification 42093 004542'01 endif. ;[190] End case defaulting directory 42094 42095 004542'01 334 00 0 00 000000 kermsg (,xxwait) ; Got junk. 42096 004543'01 254 00 0 00 004550' 42097 004544'01 265 01 0 00 004376* 42098 004545'01 000000 000060 42099 004546'01 000000000000# 42100 004547'01 254 00 0 00 003234' 42101 001167'04 102 141 144 040 154 42102 42103 ; Get JFN on the string we got, supply normal defaults like Exec does. 42104 42105 004550'01 200 02 0 00 000004 xgdir2: move t2, t4 ; Point to filespec 42106 004551'01 133 03 0 00 000004 adjbp t3, t4 ; Make it asciz 42107 004552'01 400 04 0 00 000000 setz t4, 42108 004553'01 136 04 0 00 000003 idpb t4, t3 42109 004554'01 200 04 0 00 000002 move t4, t2 ;[191] Save the string pointer 42110 004555'01 201 01 0 00 004632' movei t1, sdirbk ; JFN block containing flags & defaults. 42111 004556'01 104 00 0 00 000020 GTJFN ; Do long form GTJFN. 42112 004557'01 320 12 0 00 004561' ifje. r ;[191] Catch error 42113 004560'01 254 00 0 00 004577' 42114 004561'01 302 01 0 00 600114 caie t1, GJFX32 ;[191] No files matched? 42115 004562'01 254 00 0 00 004564' %erker (,xxwait) ;[191] No, just send the error 42116 004563'01 254 00 0 00 004567' 42117 004564'01 265 01 0 00 004366* 42118 004565'01 000000 000000 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65-1 K20SRV MAC 9-Aug-24 12:55 XGDIR - Server provides directory listing. 42119 004566'01 254 00 0 00 003234' 42120 004567'01 201 01 0 00 004513' movei t1, sdirb2 ;[191] Try not defaulting anything 42121 004570'01 200 02 0 00 000004 move t2, t4 ;[191] Restore the string pointer 42122 004571'01 104 00 0 00 000020 GTJFN% ;[191] Attempt another long form GTJFN. 42123 004572'01 320 14 0 00 004574' %jsker (,xxwait) ;[191] No such luck, just give up 42124 004573'01 254 00 0 00 004577' 42125 004574'01 265 01 0 00 004564* 42126 004575'01 000000 000000 42127 004576'01 254 00 0 00 003234' 42128 004577'01 endif. ;[191] End GTJFN% recovery 42129 004577'01 260 17 0 00 003417* call isnulj ;[191] Gave us NUL:? 42130 004600'01 600 00 0 00 000000 nop ;[191] Didn't, that's fine. 42131 remark t1, .nulio ;[191] Did, that's fine, too. 42132 42133 004601'01 336 00 0 00 004447* ifmn. tlgjfn ;[233] Doing transaction logging? 42134 004602'01 254 00 0 00 004616' 42135 004603'01 415 16 0 00 004616' block. ;[233] Get a stack frame 42136 004604'01 261 17 0 00 000016 42137 004605'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 42138 004606'01 552 01 0 00 000000# hrrzm t1,tmpjfn ;[233] Give it how %wtlog wants it .. 42139 004607'01 476 00 0 00 004454* setom scrlft ;[233] Suppress the trailing carriage return 42140 004610'01 265 01 0 00 004455* wtlog(,tmpjfn) ;[233] Sigh... 42141 004611'01 000000000000# 42142 004612'01 777777 777736 42143 004613'01 000000000000# 42144 001177'04 123 145 156 144 151 42145 004614'01 402 00 0 00 000000# setzm tmpjfn ;[233] Stomp it, done. 42146 004615'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 42147 004616'01 endif. ;[233] 42148 42149 004616'01 200 02 0 00 000001 move t2, t1 ; Construct heading in string buffer. 42150 004617'01 402 00 0 00 003245* setzm ffunc ; Function is "directory". 42151 004620'01 260 17 0 00 001766' call dirhdr 42152 004621'01 200 01 0 00 006572' move t1, [point 7, srvbuf] ; Point to beginning of text buffer. 42153 004622'01 202 01 0 00 000000# movem t1, getptr ; This is where we'll get characters from. 42154 004623'01 201 01 0 00 004474' movei t1, dirch ; And this routine will do the getting. 42155 004624'01 202 01 0 00 004472* movem t1, source ; ... 42156 004625'01 476 00 0 00 004511* setom next ; Initialize character lookahead. 42157 004626'01 476 00 0 00 004467* setom xflg ; This produces some desired effects... 42158 004627'01 260 17 0 00 004470* call $sends ; Go send the listing like it's a file. 42159 004630'01 600 00 0 00 000000 nop ; Ignore any skipping... 42160 004631'01 254 00 0 00 003234' jrst xxwait 42161 42162 004632'01 100100 777775 sdirbk: gj%old!gj%ifg!.gjall ; Flags,,All generations. 42163 004633'01 377777 377777 .nulio,,.nulio ; No i/o. 42164 repeat <2>,<0> ; Default device and directory. 42165 004634'01 000000 000000 42166 004635'01 000000 000000 42167 repeat <2>,)> ;Default name is "*.*" 42168 004636'01 000000000000# 42169 001206'04 052 000 000 000 000 42170 004637'01 000000000000# 42171 001207'04 052 000 000 000 000 42172 42173 repeat <4>,<0> ; Nothing special for the rest. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65-2 K20SRV MAC 9-Aug-24 12:55 XGDIR - Server provides directory listing. 42174 004640'01 000000 000000 42175 004641'01 000000 000000 42176 004642'01 000000 000000 42177 004643'01 000000 000000 42178 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66 K20SRV MAC 9-Aug-24 12:55 XGDEL - Server provides file deletion [118] 42179 subttl XGDEL - Server provides file deletion [118] 42180 42181 004644'01 100100 777775 sdelbk: gj%old!gj%ifg!.gjall ; Flags,,All generations. 42182 004645'01 377777 377777 .nulio,,.nulio ; No i/o. 42183 repeat <^d8>,<0> ; No other defaults. 42184 004646'01 000000 000000 42185 004647'01 000000 000000 42186 004650'01 000000 000000 42187 004651'01 000000 000000 42188 004652'01 000000 000000 42189 004653'01 000000 000000 42190 004654'01 000000 000000 42191 004655'01 000000 000000 42192 42193 42194 004656'01 260 17 0 00 003725' xgdel: call getarg ; Get the first (& only) argument 42195 004657'01 327 03 0 00 004666' jumpg t3, xgdel2 ; Got something, go do it. 42196 42197 004660'01 334 00 0 00 000000 kermsg (,xxwait) 42198 004661'01 254 00 0 00 004666' 42199 004662'01 265 01 0 00 004544* 42200 004663'01 000000 000051 42201 004664'01 000000000000# 42202 004665'01 254 00 0 00 003234' 42203 001210'04 116 157 040 146 151 42204 42205 ; Get JFN on the string we got, supply normal defaults like Exec does. 42206 42207 004666'01 200 02 0 00 000004 xgdel2: move t2, t4 ; Point to filespec 42208 004667'01 133 03 0 00 000004 adjbp t3, t4 ; Make it asciz 42209 004670'01 400 04 0 00 000000 setz t4, 42210 004671'01 136 04 0 00 000003 idpb t4, t3 42211 004672'01 201 01 0 00 004644' movei t1, sdelbk ; JFN block containing flags & defaults. 42212 004673'01 104 00 0 00 000020 GTJFN ; Do long form GTJFN. 42213 004674'01 320 14 0 00 004676' %jsker (,xxwait) ; Send error packet if we can't. 42214 004675'01 254 00 0 00 004701' 42215 004676'01 265 01 0 00 004574* 42216 004677'01 000000 000000 42217 004700'01 254 00 0 00 003234' 42218 004701'01 260 17 0 00 004577* call isnulj ;[191] Gave us NUL: 42219 004702'01 600 00 0 00 000000 nop ;[191] Didn't, that's fine. 42220 42221 004703'01 336 00 0 00 004601* ifmn. tlgjfn ;[233] Doing transaction logging? 42222 004704'01 254 00 0 00 004720' 42223 004705'01 415 16 0 00 004720' block. ;[233] Get a stack frame 42224 004706'01 261 17 0 00 000016 42225 004707'01 265 16 0 00 006314' saveac ;[233] Save even the temporaries 42226 004710'01 552 01 0 00 000000# hrrzm t1,tmpjfn ;[233] Give it how %wtlog wants it .. 42227 004711'01 476 00 0 00 004607* setom scrlft ;[233] Suppress the trailing carriage return 42228 004712'01 265 01 0 00 004610* wtlog(,tmpjfn) ;[233] Sigh... 42229 004713'01 000000000000# 42230 004714'01 777777 777767 42231 004715'01 000000000000# 42232 001217'04 104 145 154 145 164 42233 004716'01 402 00 0 00 000000# setzm tmpjfn ;[233] Stomp it, done. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66-1 K20SRV MAC 9-Aug-24 12:55 XGDEL - Server provides file deletion [118] 42234 004717'01 263 17 0 00 000000 endbk. ;[233] Release stack frame, restoring AC's 42235 004720'01 endif. ;[233] 42236 42237 remark t1, .nulio ;[191] Is, that's fine, too. 42238 004720'01 200 02 0 00 000001 move t2, t1 ; Construct heading in string buffer. 42239 004721'01 201 01 0 00 006004' movei t1, delfil ;[194] ; Routine for deleting a file. 42240 004722'01 202 01 0 00 004617* movem t1, ffunc ; Make it the file function. 42241 004723'01 260 17 0 00 001766' call dirhdr ; Start things off. 42242 004724'01 200 01 0 00 006573' move t1, [point 7, srvbuf] ; Point to beginning of text buffer. 42243 004725'01 202 01 0 00 000000# movem t1, getptr ; This is where we'll get characters from. 42244 004726'01 201 01 0 00 004474' movei t1, dirch ; And this routine will do the getting. 42245 004727'01 202 01 0 00 004624* movem t1, source ; ... 42246 004730'01 476 00 0 00 004625* setom next ; Initialize character lookahead. 42247 004731'01 476 00 0 00 004626* setom xflg ; This produces some desired effects... 42248 004732'01 260 17 0 00 004627* call $sends ; Go send the listing like it's a file. 42249 004733'01 600 00 0 00 000000 nop ; Ignore any skipping... 42250 004734'01 254 00 0 00 003234' jrst xxwait 42251 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67 K20SRV MAC 9-Aug-24 12:55 LOCAL RUN command parsing 42252 subttl LOCAL RUN command parsing 42253 42254 ; JFN block for RUN command. 42255 42256 chgsec(code,const) ;;Tables and chained fdb's go in const 42257 000320'02 100120 000000 runbk: gj%old!gj%ifg!gj%flg ; Flag bits,,most recent generation. 42258 000321'02 000100 000101 .priin,,.priou ; COMND i/o. 42259 repeat 3,<0> ; No defaults, except 42260 000322'02 000000 000000 42261 000323'02 000000 000000 42262 000324'02 000000 000000 42263 000325'02 000000000000# cascii() ; file type. 42264 001221'04 105 130 105 000 000 42265 repeat 2,<0> ; No defaults, except 42266 000326'02 000000 000000 42267 000327'02 000000 000000 42268 000010 runbkl==<.-runbk> ; Length of this GTJFN argument block. 42269 42270 000330'02 006000 000000 yrufdb: flddb. .cmfil 42271 000331'02 000000 000000 42272 000332'02 006004 000335' yrrfdb: flddb. .cmfil,,,,,yrrfd1 42273 000333'02 000000 000000 42274 000334'02 44 07 0 00 000577' 42275 000335'02 010004 000000 yrrfd1: flddb. .cmcfm,,,,, 42276 000336'02 000000 000000 42277 000337'02 44 07 0 00 000604' 42278 retsec 42279 cleans() 42280 42281 ; Parse local RUN command. 42282 42283 004735'01 .yrun: entry .yrun ; Can be invoked as top-level by k20par 42284 004735'01 200 01 0 00 006437' movx t1, cz%ncl!.fhslf ; Close any nonopen JFNs. 42285 004736'01 104 00 0 00 000034 CLZFF 42286 004737'01 200 16 0 00 000000# guide ; Issue guide word. 42287 004740'01 260 17 0 00 002655* 42288 000340'02 000000000000# 42289 001222'04 146 151 154 145 000 42290 004741'01 200 01 0 00 006574' move t1, [runbk,,cjfnbk] ; Insert our file parsing defaults. 42291 004742'01 251 01 0 00 000000# blt t1, cjfnbk+runbkl ; Same as for DELETE. 42292 004743'01 201 01 0 00 000000# movei t1, yrufdb 42293 004744'01 332 00 0 00 000000# skipe rufork ; Already have a fork? 42294 004745'01 201 01 0 00 000000# movei t1, yrrfdb ; Yes, let them rerun it. 42295 004746'01 260 17 0 00 002661* call rfield ; Parse an existing file specification. 42296 004747'01 135 03 0 00 006275' ldb t3, [pointr (.cmfnp(t3),cm%fnc)] ; Get function code. 42297 004750'01 302 03 0 00 000010 caie t3, .cmcfm ;[194] Confirmation? 42298 004751'01 254 00 0 00 004754' ifskp. ;[194] It is 42299 004752'01 476 00 0 00 002773* setom pars3 ; Yes, set "jfn" to -1. 42300 004753'01 263 17 0 00 000000 ret 42301 004754'01 endif. ;[194] 42302 42303 004754'01 265 16 0 00 006357' saveac ;[220] Will need some extra registers 42304 004755'01 550 05 0 00 000002 hrrz q1, t2 ;[220] Save the JFN 42305 004756'01 510 06 0 00 000002 hllz q2, t2 ;[220] Save the flags 42306 004757'01 550 01 0 00 000002 hrrz t1, t2 ;[220] Load the JFN without the flags k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-1 K20SRV MAC 9-Aug-24 12:55 LOCAL RUN command parsing 42307 004760'01 260 17 0 00 005474' call isdird ;[220] Only run files from structures 42308 004761'01 254 00 0 00 004772' ifskp. ;[220] It is 42309 004762'01 120 07 0 00 000001 dmove q3, t1 ;[220] Save device information 42310 004763'01 260 17 0 00 002770* confrm ; Get confirmation 42311 004764'01 135 03 0 00 006276' ldb t3,[pointr(t2,dv%typ)] ;[220] Pick up device type 42312 004765'01 306 03 0 00 000015 cain t3, .dvnul ;[220] NUL:? 42313 004766'01 201 05 0 00 377777 movei q1, .nulio ;[220] Yes, JFN has already been tossed 42314 004767'01 202 05 0 00 004752* movem q1, pars3 ;[220] Save some kind of JFN 42315 004770'01 124 07 0 00 001053* dmovem q3, pars4 ;[220] Also device information, if useful 42316 004771'01 263 17 0 00 000000 ret ;[220] Done 42317 004772'01 endif. ;[220] 42318 ;[220] Otherwise, start whining 42319 004772'01 200 01 0 00 000000# emsg 42320 004773'01 104 00 0 00 000313 42321 000341'02 000000000000# 42322 001223'04 103 141 156 047 164 42323 004774'01 201 01 0 00 000101 movei t1, .priou ;[220] Contine on terminal 42324 004775'01 200 02 0 00 000005 move t2, q1 ;[220] Load the JFN, no flags 42325 004776'01 403 03 0 00 000004 setzb t3, t4 ;[220] Standard formating, no goofy prefix 42326 004777'01 104 00 0 00 000030 JFNS% ;[220] Type it 42327 005000'01 320 12 0 00 005002' %jserr(,) ;[220] Odd, but carry on 42328 005001'01 254 00 0 00 005005' 42329 005002'01 265 01 0 00 003600* 42330 005003'01 000000000000# 42331 005004'01 254 00 0 00 005005' 42332 001230'04 125 156 141 142 154 42333 005005'01 200 01 0 00 000005 move t1, q1 ;[220] Get the JFN 42334 005006'01 104 00 0 00 000023 RLJFN% ;[220] Toss it 42335 005007'01 320 12 0 00 005011' %jserr(,) ;[220] Odd, but carry on 42336 005010'01 254 00 0 00 005014' 42337 005011'01 265 01 0 00 005002* 42338 005012'01 000000000000# 42339 005013'01 254 00 0 00 005014' 42340 001237'04 125 156 141 142 154 42341 005014'01 254 00 0 00 002767* callret cmder1 ;[220] Allow a reparse (^H) 42342 42343 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68 K20SRV MAC 9-Aug-24 12:55 LOCAL RUN command executon 42344 subttl LOCAL RUN command executon 42345 42346 ; Execute local RUN command. 42347 42348 ;[220] Begin code insertion 42349 chgsec(code,const) ; Code to run from registers 42350 000342'02 nulprg: remark ; Pretend we did a GET% into just the AC's 42351 000000 phase 0 ; Runs in accumulators 42352 000000 000000 601405 LSTRX1 ;ac0 No last error 42353 000001 000000 000000 0 ;t1 Argument to PSOUT% 42354 000002 000000 000000 0 ;t2 Argument to SETER% 42355 000003 104 00 0 00 000147 nulent: RESET% ;t3 Reset the world 42356 000004 320 12 0 00 000014 erjmpr nulend ;t4 It *CAN* fail, actually.. 42357 000005 201 01 0 00 400000 movei t1,.fhslf ;q1 This process 42358 000006 200 02 0 00 000000 move t2, f ;q2 No last error (RESET% leaves it in an odd way) 42359 000007 104 00 0 00 000336 SETER% ;q3 Set it 42360 000010 320 12 0 00 000014 erjmpr nulend ;p1 Or not 42361 000011 561 01 0 00 000016 hrroi t1,nulmsg ;p2 Load Tops-20 pointer to text message 42362 000012 104 00 0 00 000076 PSOUT% ;p3 Type it 42363 000013 320 12 0 00 000014 erjmpr nulend ;p4 Or not 42364 000014 104 00 0 00 000170 nulend: HALTF% ;p5 Stop 42365 000015 254 00 0 00 000003 jrst nulent ;p6 Or do it again 42366 000016 472531 435100 nulmsg: BYTE (7) "N","U","L",":",.chspc ;cx 42367 000017 476261 505000 BYTE (7) "O","K",.chcrt,.chlfd,.chnul ;p 42368 000362'02 dephase ; Done with our little NUL: program 42369 retsec ; Restore .psect's 42370 ;[220] End code insertion 42371 42372 005015'01 $yrun: entry $yrun ;[194] 42373 005015'01 337 00 0 00 004767* skipg pars3 ; Re-run current fork? 42374 005016'01 254 00 0 00 005110' jrst $yrun2 ; Yes, do do that. 42375 42376 005017'01 333 01 0 00 000000# skiple t1, rufork ; No, do we have a current fork to kill? 42377 005020'01 104 00 0 00 000153 KFORK ; Yes, try to kill it. 42378 005021'01 320 12 0 00 005023' %jserr (,r) ;[194] 42379 005022'01 254 00 0 00 005026' 42380 005023'01 265 01 0 00 005011* 42381 005024'01 000000000000# 42382 005025'01 254 00 0 00 004401* 42383 001247'04 103 141 156 047 164 42384 005026'01 403 01 0 00 000002 setzb t1, t2 ; Take care of capabilities below. 42385 005027'01 104 00 0 00 000152 CFORK ; Make a fork. 42386 005030'01 320 12 0 00 005032' %jserr (,r); 42387 005031'01 254 00 0 00 005035' 42388 005032'01 265 01 0 00 005023* 42389 005033'01 000000000000# 42390 005034'01 254 00 0 00 005025* 42391 001256'04 103 141 156 047 164 42392 005035'01 202 01 0 00 000000# movem t1, rufork ; Remember the fork handle. 42393 005036'01 200 04 0 00 000001 move t4, t1 ;[220] Keep the handle handy 42394 005037'01 336 02 0 00 000000* skipn t2, capas ;[169] Get our capabilities. 42395 005040'01 200 02 0 00 000000# move t2, mycaps+1 ;[187] Use start up enabled caps, instead 42396 005041'01 630 02 0 00 006575' andx t2,badmsk ;[186] Don't turn on unsafe bits 42397 005042'01 621 02 0 00 040000 txz t2, sc%log ;[169] Do not allow inferior to log us out 42398 005043'01 661 02 0 00 200000 txo t2, sc%gtb ;[169] but with GETAB capability (for Exec), k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-1 K20SRV MAC 9-Aug-24 12:55 LOCAL RUN command executon 42399 005044'01 200 03 0 00 000002 move t3, t2 ;[169] Enable what we've set 42400 005045'01 104 00 0 00 000151 EPCAP ;[169] ... 42401 005046'01 320 14 0 00 005047' erjmps .+1 ;[194] ... 42402 005047'01 517 00 0 00 000001 hrlzs t1 ; Move handle into left half. 42403 005050'01 540 01 0 00 005015* hrr t1, pars3 ; JFN in right half. 42404 005051'01 550 03 0 00 000001 hrrz t3, t1 ;[220] Save a copy of the JFN 42405 005052'01 400 02 0 00 000000 setz t2, ;[220] Nothing special. 42406 005053'01 302 03 0 00 377777 caie t3, .nulio ;[220] NUL:? 42407 005054'01 254 00 0 00 005077' ifskp. ;[220] Just give up here 42408 005055'01 200 01 0 00 000004 move t1, t4 ;[220] Inferior fork handle 42409 005056'01 201 02 0 00 000000# movei t2, nulprg ;[220] NUL: program 42410 005057'01 104 00 0 00 000160 SFACS% ;[220] Set the registers 42411 005060'01 320 12 0 00 005062' %jserr (,r) ;[220] ?? 42412 005061'01 254 00 0 00 005065' 42413 005062'01 265 01 0 00 005032* 42414 005063'01 000000000000# 42415 005064'01 254 00 0 00 005034* 42416 001263'04 103 157 165 154 144 42417 005065'01 200 02 0 00 006576' move t2, [1,,nulent] ;[220] Load NUL:'s 'start address' 42418 005066'01 104 00 0 00 000204 SEVEC% ;[220] Set the entry vector 42419 005067'01 477 02 0 00 000003 setob t2, t3 ;[220] Don't fault in PA1050 42420 005070'01 104 00 0 00 000301 SCVEC% ;[220] Shut off UUO simulation 42421 005071'01 320 12 0 00 005073' %jserr (,) ;[220] Odd, but continue 42422 005072'01 254 00 0 00 005076' 42423 005073'01 265 01 0 00 005062* 42424 005074'01 000000000000# 42425 005075'01 254 00 0 00 005076' 42426 001272'04 103 157 165 154 144 42427 remark ;[220] Fall through to $yrun2 42428 005076'01 254 00 0 00 005110' else. ;[220] Otherwise, it's a real file 42429 005077'01 104 00 0 00 000200 GET ; Get the file to run. 42430 005100'01 320 12 0 00 005102' %jserr (,r) 42431 005101'01 254 00 0 00 005105' 42432 005102'01 265 01 0 00 005073* 42433 005103'01 000000000000# 42434 005104'01 254 00 0 00 005064* 42435 001301'04 103 141 156 047 164 42436 005105'01 550 01 0 00 005050* hrrz t1, pars3 ; Got the file, now can release its JFN. 42437 005106'01 104 00 0 00 000023 RLJFN 42438 005107'01 320 12 0 00 005110' erjmpr .+1 ;[220] Catch and ignore error 42439 005110'01 endif. ;[220] 42440 42441 ; Can come straight here to re-run current fork. 42442 42443 005110'01 337 01 0 00 000000# $yrun2: skipg t1, rufork ; Get fork handle. 42444 005111'01 334 01 0 00 000000# ermsg% (,r) ; Make sure it's ok. 42445 005112'01 254 00 0 00 005116' 42446 005113'01 202 01 0 00 002466* 42447 005114'01 104 00 0 00 000313 42448 005115'01 254 00 0 00 005104* 42449 000362'02 000000000000# 42450 001306'04 113 105 122 115 111 42451 42452 005116'01 400 02 0 00 000000 setz t2, ; Primary start address. 42453 005117'01 104 00 0 00 000201 SFRKV ; Start it up. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68-2 K20SRV MAC 9-Aug-24 12:55 LOCAL RUN command executon 42454 005120'01 320 12 0 00 005122' %jserr (,r) 42455 005121'01 254 00 0 00 005125' 42456 005122'01 265 01 0 00 005102* 42457 005123'01 000000000000# 42458 005124'01 254 00 0 00 005115* 42459 001314'04 103 141 156 047 164 42460 005125'01 104 00 0 00 000163 WFORK ; wait for the fork to halt. 42461 005126'01 320 12 0 00 005130' %jserr (,r) 42462 005127'01 254 00 0 00 005133' 42463 005130'01 265 01 0 00 005122* 42464 005131'01 000000000000# 42465 005132'01 254 00 0 00 005124* 42466 001321'04 103 141 156 047 164 42467 42468 005133'01 263 17 0 00 000000 ret 42469 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69 K20SRV MAC 9-Aug-24 12:55 SRVCMD - Routine to send a command to a server. 42470 subttl SRVCMD - Routine to send a command to a server. 42471 ; 42472 ; Call with: 42473 ; 42474 ; t1/ Byte pointer to string. 42475 ; First character is Generic Command, subsequent chars are arguments. 42476 ; t2/ Packet type, e.g. "G" for Generic, "C" for Host Command. 42477 ; 42478 ; Returns: 42479 ; 42480 ; +1 if reply was not received successfully. 42481 ; +2 If we got a good response, with 42482 ; t1/ packet type of response, "Y", "X", or "S". 42483 ; PKTACS/ Block of 4 words containing the data returned by RPACK. 42484 ; 42485 ; If packet was ACK containing data, this routine prints it. 42486 42487 005134'01 332 00 0 00 002460* srvcmd: skipe takdep ;[176] Allow commands to servers from TAKE file 42488 005135'01 254 00 0 00 005136' jrst srvxx 42489 005136'01 265 16 0 00 006265' srvxx: saveac ; Preserve these work registers. 42490 005137'01 120 05 0 00 000001 dmove q1, t1 ; Copy arguments into them. 42491 005140'01 336 00 0 00 003715* skipn local ;[177] Local Kermit? 42492 005141'01 260 17 0 00 003225* call inilin ;[177] No, set TTY: up for packets. 42493 005142'01 402 00 0 00 003674* setzm numtry ; Reset retry counter. 42494 005143'01 402 00 0 00 000000* setzm nnak ; Init some statistics counters 42495 005144'01 402 00 0 00 000000* setzm ntimou ; ... 42496 005145'01 476 00 0 00 003250* setom bctone ; Force 1-char checksum. 42497 005146'01 260 17 0 00 000043* call clrbuf ;[194] Clear out any stacked-up NAKs 42498 005147'01 600 00 0 00 000000 nop ;[186] Ignore any errors 42499 005150'01 260 17 0 00 003223* call statim ; Start timing (so k20pdc works) 42500 005151'01 260 17 0 00 003226* call ccon ; Let them ^C out gracefully 42501 005152'01 254 00 0 00 005267' jrst srvcmx ; and go here if they do. 42502 42503 005153'01 260 17 0 00 000000* call setlog ; Set up any debugging log. 42504 005154'01 600 00 0 00 000000 nop 42505 42506 ; Put the command into the data field of the packet, using the normal 42507 ; packet-filling technique, prefixing, etc. 42508 42509 005155'01 402 00 0 00 000000* setzm datbuf ;[190] ; Zero the buffer. 42510 42511 005156'01 201 01 0 00 003704' srvcma: movei t1, gtsch ; Indicate routine to be used for getting 42512 005157'01 202 01 0 00 004727* movem t1, source ; characters. 42513 005160'01 202 05 0 00 004463* movem q1, strptr ; And where it should get them from. 42514 005161'01 476 00 0 00 004730* setom next ; Set initial condition. 42515 005162'01 200 01 0 00 004413* move t1, maxdat ; Get a buffer full of data. 42516 005163'01 260 17 0 00 004414* call getbuf ; ... 42517 005164'01 326 01 0 00 005267' jumpn t1, srvcmx ; Clean up if this fails. 42518 005165'01 402 00 0 00 005157* setzm source ; Got it, so put GETCH back to normal. 42519 42520 005166'01 202 01 0 00 000000# movem t1, gclen ; Save length. 42521 005167'01 326 01 0 00 005175' jumpn t1, srvcm2 ; Proceed if we got any. 42522 42523 005170'01 334 01 0 00 000000# ermsg% (, srvcmx) ; Do this otherwise. 42524 005171'01 254 00 0 00 005175' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69-1 K20SRV MAC 9-Aug-24 12:55 SRVCMD - Routine to send a command to a server. 42525 005172'01 202 01 0 00 005113* 42526 005173'01 104 00 0 00 000313 42527 005174'01 254 00 0 00 005267' 42528 000363'02 000000000000# 42529 001326'04 113 105 122 115 111 42530 42531 42532 ; Top of try-again loop. 42533 42534 005175'01 200 05 0 00 005142* srvcm2: move q1, numtry ; Too many tries? 42535 005176'01 311 05 0 00 000000* caml q1, maxtry 42536 005177'01 334 01 0 00 000000# ermsg% (,srvcmx) 42537 005200'01 254 00 0 00 005204' 42538 005201'01 202 01 0 00 005172* 42539 005202'01 104 00 0 00 000313 42540 005203'01 254 00 0 00 005267' 42541 000364'02 000000000000# 42542 001337'04 113 105 122 115 111 42543 42544 005204'01 350 00 0 00 005175* aos numtry ; Not too many, count this try. 42545 005205'01 200 01 0 00 000006 move t1, q2 ; Packet type. 42546 005206'01 400 02 0 00 000000 setz t2, ; Make the packet number zero. 42547 005207'01 200 03 0 00 000000# move t3, gclen ; Length of data. 42548 005210'01 200 04 0 00 006556' move t4, [point 8, datbuf] ;[190] Point to data buffer. 42549 005211'01 260 17 0 00 004423* call spack ; Send it off. 42550 005212'01 254 00 1 01 006577' jrst @[exp srvcm2, srvcmx](t1) ; Handle nonfatal & fatal failures. 42551 005213'01 402 00 0 00 000000* setzm gotx ; Assume it'll be an ACK. 42552 005214'01 260 17 0 00 003252* call rpack ; Look for response. 42553 005215'01 334 01 0 00 000000# ermsg% (,srvcm2) 42554 005216'01 254 00 0 00 005222' 42555 005217'01 202 01 0 00 005201* 42556 005220'01 104 00 0 00 000313 42557 005221'01 254 00 0 00 005175' 42558 000365'02 000000000000# 42559 001353'04 113 105 122 115 111 42560 42561 42562 005222'01 302 01 0 00 000130 caie t1, "X" ; X or Y? 42563 005223'01 306 01 0 00 000131 cain t1, "Y" 42564 005224'01 254 00 0 00 005307' jrst srvcmz ; Good. 42565 42566 005225'01 302 01 0 00 000123 caie t1, "S" ; S or I? 42567 005226'01 306 01 0 00 000111 cain t1, "I" 42568 005227'01 254 00 0 00 005307' jrst srvcmz ; That's ok too. 42569 42570 005230'01 302 01 0 00 000105 caie t1, "E" ; Error packet? 42571 005231'01 254 00 0 00 005241' ifskp. ;[186] Yes, let's see about squawking 42572 005232'01 336 00 0 00 005140* skipn local ;[186] Local? 42573 005233'01 254 00 0 00 005267' jrst srvcmx ;[186] No, this will always mess up 42574 005234'01 200 01 0 00 000000# emsg ;[186] Yes, print it. 42575 005235'01 104 00 0 00 000313 42576 000366'02 000000000000# 42577 001361'04 122 145 155 157 164 42578 005236'01 200 01 0 00 000004 move t1, t4 ; Get pointer to it, 42579 005237'01 104 00 0 00 000076 PSOUT% ; and print it. k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69-2 K20SRV MAC 9-Aug-24 12:55 SRVCMD - Routine to send a command to a server. 42580 005240'01 254 00 0 00 005267' jrst srvcmx ;[70] 42581 005241'01 endif. ;[186] End error pack 42582 42583 005241'01 302 01 0 00 000116 caie t1, "N" ; NAK? 42584 005242'01 306 01 0 00 000124 cain t1, "T" ; Or Timeout? 42585 005243'01 254 00 0 00 005175' jrst srvcm2 ; One of those, go try again. 42586 42587 005244'01 336 00 0 00 005232* skipn local ;[233] Local? 42588 005245'01 254 00 0 00 005267' jrst srvcmx ;[235] Nothing to display on 42589 remark ;[235] Tell us the offending packet and punt 42590 005246'01 200 02 0 00 000001 move t2,t1 ;[235] Save the offending character 42591 005247'01 561 01 0 00 006601' hrroi t1,[ asciz /Invalid response from server: '/] ;[235] 42592 005250'01 104 00 0 00 000313 ESOUT% ;[235] Begin blat 42593 005251'01 320 12 0 00 005252' erjmpr .+1 ;[235] Catch and ignore any error 42594 005252'01 200 01 0 00 000002 move t1,t2 ;[235] Get the character back 42595 005253'01 104 00 0 00 000074 PBOUT% ;[235] Type it 42596 005254'01 320 12 0 00 005255' erjmpr .+1 ;[235] Catch and ignore any error 42597 005255'01 561 01 0 00 006610' hrroi t1,[asciz /' (/] ;[235] And seperate the rest 42598 005256'01 104 00 0 00 000076 PSOUT% ;[235] Type that 42599 005257'01 320 12 0 00 005260' erjmpr .+1 ;[235] Catch and ignore any error 42600 005260'01 201 01 0 00 000101 movei t1,.priou ;[235] Still going to primary output 42601 005261'01 201 03 0 00 000010 movei t3,^d8 ;[235] ASCII characters are base 8 here 42602 005262'01 104 00 0 00 000224 NOUT% ;[235] Type it 42603 005263'01 320 12 0 00 005264' erjmpr .+1 ;[235] Catch and ignore any error 42604 hrroi t1,[asciz /) 42605 005264'01 561 01 0 00 006611' /] ;[235] Close off the line 42606 005265'01 104 00 0 00 000076 PSOUT% ;[235] Type that 42607 005266'01 320 12 0 00 005267' erjmpr .+1 ;[235] Catch and ignore any error 42608 remark srvcmx ;[235] Falls through 42609 42610 ; Exit point for any kind of error, failure, or interruption 42611 42612 005267'01 260 17 0 00 003122* srvcmx: call ccoff ; Turn off ^C trap. 42613 005270'01 260 17 0 00 000000* call caxzof ; Turn these interrupts off too. 42614 005271'01 260 17 0 00 003454* call endtim ;[189] Stop timing 42615 005272'01 260 17 0 00 003455* call elptim ;[189] Compute elapsed time 42616 005273'01 337 01 0 00 003014* skipg t1, filjfn ;[193] Any file left open? 42617 005274'01 254 00 0 00 005302' ifskp. ;[193] Apparently, try to close it. 42618 005275'01 621 01 0 00 777777 tlz t1,-1 ;[193] Ditch any flags 42619 005276'01 302 01 0 00 377777 caie t1, .nulio ;[193] No need to close since never opened 42620 005277'01 104 00 0 00 000022 CLOSF 42621 005300'01 320 12 0 00 005301' erjmpr .+1 ;[193] Catch and ignore error 42622 005301'01 402 00 0 00 005273* setzm filjfn ;[193] Whatever it was, it's closed now! 42623 005302'01 endif. ;[193](end) 42624 005302'01 336 00 0 00 005244* skipn local ;[177] Put controlling TTY back to normal 42625 005303'01 260 17 0 00 000000* call rrsl2 ;[177] ... (entry point to reslin) 42626 005304'01 402 00 0 00 005165* setzm source ; Put things back to normal. 42627 005305'01 474 01 0 00 000000 seto t1, ; Indicate no good response was received. 42628 005306'01 263 17 0 00 000000 ret ; Return +1. 42629 42630 42631 ; Exit here when response received successfully. 42632 42633 005307'01 124 01 0 00 000000* srvcmz: dmovem t1, pktacs ;[112] Save the ACs returned in RPACK 42634 005310'01 124 03 0 00 000000# dmovem t3, pktacs+2 ;[112] ... k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69-3 K20SRV MAC 9-Aug-24 12:55 SRVCMD - Routine to send a command to a server. 42635 005311'01 202 02 0 00 003700* movem t2, pktnum ; Synchronize packet numbers. 42636 005312'01 302 01 0 00 000131 caie t1, "Y" ;[194] Was the reply an ACK? 42637 005313'01 254 00 0 00 005324' ifskp. ;[194] It was 42638 005314'01 337 02 0 00 000003 skipg t2, t3 ;[144] Yes, any characters? 42639 005315'01 254 00 0 00 005324' anskp. ;[194] No. 42640 005316'01 201 01 0 00 003715' movei t1, puttch ;[144] Routine to display decoded characters. 42641 005317'01 202 01 0 00 003742* movem t1, dest ;[144] ... 42642 005320'01 200 01 0 00 000004 move t1, t4 ;[144] Pointer to data buffer. 42643 005321'01 260 17 0 00 003736* call putbuf ;[144] Go decode it. 42644 005322'01 600 00 0 00 000000 nop ;[144] 42645 005323'01 402 00 0 00 005317* setzm dest ;[144] 42646 005324'01 endif. ;[194] 42647 005324'01 200 01 0 00 005307* move t1, pktacs ;[112] Get packet type back. 42648 005325'01 260 17 0 00 005267* call ccoff ; Turn off ^C trap. 42649 005326'01 336 00 0 00 005302* skipn local ;[177] Put controlling TTY back to normal 42650 005327'01 260 17 0 00 005303* call rrsl2 ;[177] ... (entry point to reslin) 42651 005330'01 254 00 0 00 004507* retskp ; Done. 42652 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70 K20SRV MAC 9-Aug-24 12:55 SINFO Sends Iniatialization Packet 42653 subttl SINFO Sends Iniatialization Packet 42654 42655 ;[58] SINFO added as part of edit 58. 42656 ; 42657 ; Call this routine before sending any server command which has a 42658 ; nontrivial response. For instance, it should be called before 42659 ; requesting a remote directory listing, but need not be called before 42660 ; sending a CWD command, which normally responds with a simple ACK. 42661 ; 42662 ; Action: Sends an info packet with our own parameters, waits for 42663 ; ACK with other side's. Uses packet number 0, does not increment the 42664 ; packet number. If other side doesn't know about I packets, this 42665 ; routine returns as if a an ACK was received containing all default 42666 ; values. 42667 ; 42668 ; Returns: 42669 ; +1 on failure, maximum tries exceeded. 42670 ; +2 on "success" getting a reply, even if it was an error packet, 42671 ; with other sides parameters set. 42672 42673 005331'01 sinfo: entry sinfo 42674 005331'01 265 16 0 00 006612' saveac ;[128] Save these. 42675 005332'01 402 00 0 00 005204* setzm numtry ; Give it a try, 42676 005333'01 402 00 0 00 005311* setzm pktnum ; starting out with a clean slate. 42677 005334'01 476 00 0 00 005145* setom bctone ;[98] Use 1-char checksum. 42678 42679 005335'01 260 17 0 00 005146* call clrbuf ;[194] Clear out any piled up NAKs. 42680 005336'01 600 00 0 00 000000 nop ;[186] Ignore any errors 42681 005337'01 260 17 0 00 005153* call setlog ; Set up any debugging log. 42682 005340'01 600 00 0 00 000000 nop 42683 005341'01 201 11 0 00 000123 movei state, "S" ;[133] This will be a little state switcher. 42684 42685 005342'01 201 01 0 00 000111 sinfo2: movei t1, "I" ;[100][133] Packet type. 42686 005343'01 476 00 0 00 000000* setom iflg ;[100] Say we're doing I, not S. 42687 005344'01 260 17 0 00 000000* call sinit ;[100] Let SINIT send it & get reply. 42688 005345'01 302 01 0 00 000105 caie t1, "E" ;[194] Other side doesn't know I packet? 42689 005346'01 254 00 0 00 005352' ifskp. ;[194] Strangely, no 42690 005347'01 403 03 0 00 000004 setzb t3, t4 ;[133] Then set defaults this way. 42691 005350'01 260 17 0 00 003673* call spar ;[133] Sets our parameters 42692 005351'01 254 00 0 00 005360' jrst sinfoz ;[133] And return successfully. 42693 005352'01 endif. ;[194] 42694 42695 ;[133] Keep going if it doesn't get thru the first time. 42696 42697 005352'01 306 11 0 00 000106 cain state, "F" ; Switched into F state? 42698 005353'01 254 00 0 00 005360' jrst sinfoz ; Yes, so I was ACK'd, done. 42699 005354'01 306 11 0 00 000123 cain state, "S" ; Still in S state? 42700 005355'01 254 00 0 00 005342' jrst sinfo2 ; So go round again. 42701 42702 005356'01 402 00 0 00 005343* sinfox: setzm iflg ; Must have exceeded retry limit. 42703 005357'01 263 17 0 00 000000 ret ; Fail. 42704 42705 005360'01 402 00 0 00 005356* sinfoz: setzm iflg ;[100] Done with sending I packet. 42706 005361'01 254 00 0 00 005330* retskp 42707 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70-1 K20SRV MAC 9-Aug-24 12:55 SINFO Sends Iniatialization Packet 42708 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71 K20SRV MAC 9-Aug-24 12:55 SRVFIL 42709 subttl SRVFIL 42710 ; 42711 ; Common code to construct a generic one-field command. 42712 ; Generic command is single character in t4. Argument is in ATMBUF. 42713 ; Puts a 1-character length field at the beginning. 42714 ; 42715 005362'01 260 17 0 00 005331' srvfil: call sinfo ;[128] Exchange parameters with I packet. 42716 005363'01 263 17 0 00 000000 ret ;[133] Failed, give up. 42717 42718 005364'01 402 00 0 00 000000# setzm srvbuf ;[194] Zero out old stuff 42719 005365'01 200 01 0 00 006622' move t1, [srvbuf,,srvbuf+1] ;[194] The whole buffer 42720 005366'01 251 01 0 00 000000# blt t1, srvbzz ;[194] Not just two words ... 42721 dmove t1, [ point 7, atmbuf ;[194] Copy directory name from here 42722 005367'01 120 01 0 00 006523' point 7, strbuf ] ;[194] to there 42723 42724 005370'01 136 04 0 00 000002 idpb t4, t2 ; Deposit generic command. 42725 005371'01 133 00 0 00 000002 ibp t2 ; Leave a space 42726 005372'01 400 03 0 00 000000 setz t3, ; Initialize counter 42727 42728 005373'01 do. ;[194] Enter loop context 42729 005373'01 134 04 0 00 000001 ildb t4, t1 ; Get next one. 42730 005374'01 136 04 0 00 000002 idpb t4, t2 ; Deposit this one. 42731 005375'01 322 04 0 00 005377' jumpe t4, endlp. ;[194] Stop on a .chnul 42732 005376'01 344 03 0 00 005373' aoja t3, top. ;[194] Otherwise, count it & loop. 42733 005377'01 enddo. ;[194] Exit loop context 42734 42735 ;* jumpe t3, [ ; Make sure there was at least one character. 42736 ;* txmsg 42737 ;* ret ] 42738 42739 005377'01 200 01 0 00 000003 srvfi3: move t1, t3 ; Length 42740 005400'01 271 01 0 00 000040 addi t1, 40 ; CHAR of that. 42741 005401'01 200 02 0 00 006422' move t2, [point 7, strbuf, 13] ; Deposit count at head of field. 42742 005402'01 137 01 0 00 000002 dpb t1, t2 42743 005403'01 200 01 0 00 006420' move t1, [point 7, strbuf] ; Point to generic command. 42744 005404'01 201 02 0 00 000107 movei t2, "G" ; Packet type is G. 42745 005405'01 254 00 0 00 005406' jrst dosrv ; Go do it. 42746 42747 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72 K20SRV MAC 9-Aug-24 12:55 DOSRV - Wrapper for SRVCMD 42748 subttl DOSRV - Wrapper for SRVCMD 42749 42750 ; Call this exactly like SRVCMD. 42751 ; 42752 ; Send a command to a server and dispatch appropriately depending on the reply. 42753 ; 42754 005406'01 dosrv: entry dosrv ;[220] 42755 005406'01 402 00 0 00 005213* setzm gotx ; Clear flags: "got X packet", 42756 005407'01 402 00 0 00 000000* setzm gots ; "got S packet". 42757 005410'01 260 17 0 00 005134' call srvcmd ; Send a generic command. 42758 005411'01 263 17 0 00 000000 ret ; Didn't get good response. 42759 005412'01 306 01 0 00 000131 cain t1, "Y" ; Was it an ACK? 42760 005413'01 263 17 0 00 000000 ret ; Yes, so we're done. 42761 42762 ; Come here if we're about to receive a multipacket reply. 42763 42764 005414'01 302 01 0 00 000130 caie t1, "X" ; Text header? 42765 005415'01 254 00 0 00 005462' jrst dosrv3 ; No 42766 42767 005416'01 476 00 0 00 005406* setom gotx ; Yup, flag that we already got it. 42768 005417'01 201 11 0 00 000106 movei state, "F" ; State state to file receive. 42769 005420'01 336 00 0 00 000003 skipn t3 ;[173](begin) Any contents? 42770 005421'01 254 00 0 00 000000* jrst $recvb ; No. 42771 42772 remark ;[220] Squeeze out leading and trailing CRLF's 42773 005422'01 415 16 0 00 005461' block. ;[220] Yes, create a frame to print them 42774 005423'01 261 17 0 00 000016 42775 005424'01 265 16 0 00 006314' saveac ;[220] Save in flight temporaries (particularly t1) 42776 005425'01 200 04 0 00 000000# move t4, pktacs+3 ;[220] Load pointer text 42777 005426'01 200 03 0 00 000004 move t3, t4 ;[220] Keep a copy handy 42778 42779 005427'01 134 01 0 00 000004 ildb t1, t4 ;[220] Pick up a character 42780 005430'01 302 01 0 00 000015 caie t1, .chcrt ;[220] A carriage return? 42781 005431'01 254 00 0 00 005436' ifskp. ;[220] It is, let's see if followed by a line feed 42782 005432'01 134 01 0 00 000004 ildb t1, t4 ;[220] Pick up another character 42783 005433'01 302 01 0 00 000012 caie t1, .chlfd ;[220] A line feed?? 42784 005434'01 254 00 0 00 005436' anskp. ;[220] No, so must advance the carriage 42785 remark ;[220] Fall out and skip the crlf 42786 005435'01 254 00 0 00 005441' else. ;[220] Need to get to a clean line 42787 005436'01 561 01 0 00 003051* hrroi t1, crlf 42788 005437'01 104 00 0 00 000076 PSOUT% 42789 005440'01 320 12 0 00 005132* erjmpr r ;[220] If fails, break out of the block, +1 42790 005441'01 endif. ;[220] Either way, ready to see something 42791 42792 005441'01 200 01 0 00 000003 move t1, t3 ;[220] Load original pointer 42793 005442'01 104 00 0 00 000076 PSOUT% ;[220] Type whatever we got handed 42794 005443'01 320 12 0 00 005440* erjmpr r ;[220] Or not... 42795 42796 005444'01 211 04 0 00 777776 movni t4, -2 ;[220] Done printing, so back the 42797 005445'01 133 04 0 00 000001 adjbp t4, t1 ;[220] pointer up so we can have a look 42798 005446'01 134 01 0 00 000004 ildb t1, t4 ;[220] Pick up a character 42799 005447'01 302 01 0 00 000015 caie t1, .chcrt ;[220] A carriage return? 42800 005450'01 254 00 0 00 005455' ifskp. ;[220] It is, let's see if followed by a line feed 42801 005451'01 134 01 0 00 000004 ildb t1, t4 ;[220] Pick up another character 42802 005452'01 302 01 0 00 000012 caie t1, .chlfd ;[220] A line feed?? k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72-1 K20SRV MAC 9-Aug-24 12:55 DOSRV - Wrapper for SRVCMD 42803 005453'01 254 00 0 00 005455' anskp. ;[220] No, so must advance the carriage 42804 remark ;[220] Fall out and skip the crlf 42805 005454'01 254 00 0 00 005460' else. ;[220] Need to get to a clean line 42806 005455'01 561 01 0 00 005436* hrroi t1, crlf 42807 005456'01 104 00 0 00 000076 PSOUT% 42808 005457'01 320 12 0 00 005443* erjmpr r ;[220] If fails, break out of the block, +1 42809 005460'01 endif. ;[220] Either way, ready to see something 42810 remark ;[220] Fall out of the block 42811 005460'01 263 17 0 00 000000 endbk. ;[220] End block context 42812 005461'01 254 00 0 00 005421* jrst $recvb ; Go receive whatever is coming. 42813 42814 005462'01 302 01 0 00 000123 dosrv3: caie t1, "S" ;[194] Or Send-Init? 42815 005463'01 254 00 0 00 005467' ifskp. ;[194] Got it 42816 005464'01 476 00 0 00 005407* setom gots ; Yes, flag that we already got it. 42817 005465'01 201 11 0 00 000122 movei state, "R" ; Set state to receive init. 42818 005466'01 254 00 0 00 005461* jrst $recvb ; Go receive what's coming. 42819 005467'01 endif. ;[194] 42820 42821 005467'01 334 01 0 00 000000# ermsg% (,r) 42822 005470'01 254 00 0 00 005474' 42823 005471'01 202 01 0 00 005217* 42824 005472'01 104 00 0 00 000313 42825 005473'01 254 00 0 00 005457* 42826 000367'02 000000000000# 42827 001365'04 113 105 122 115 111 42828 42829 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73 K20SRV MAC 9-Aug-24 12:55 Is this a directory device? 42830 subttl Is this a directory device? 42831 42832 ;[193] Begin code insertion 42833 ; 42834 ; Call: 42835 ; 42836 ; t1/ JFN to test, NO FLAGS! 42837 ; 42838 ; Returns: 42839 ; 42840 ; +1, Not a directory based device 42841 ; N.B., t1 and t2 may be invalid if DVCHR% failed! 42842 ; 42843 ; +2, Something we can use as a directory 42844 ; 42845 ; t1/ device designator 42846 ; t2/ device characteristics word 42847 ; 42848 ; All other accumulators are preserved 42849 ; 42850 ; NUL: and .nulio directories are expected to be simulated by calling routine 42851 42852 005474'01 isdird: entry isdird ; Called by k20par and maybe k20dsp 42853 005474'01 260 17 0 00 004701* call isnulj ; Is this some kind of NUL: or .nulio? 42854 005475'01 254 00 0 00 005500' ifskp. ; It is, so just say yes 42855 dmove t1, [ .dvdes!.dvnul,,-1 ; NUL: has no units 42856 005476'01 120 01 0 00 006623' dv%out!dv%in!dv%av!fld(.dvnul,dv%typ)!dv%psd!fld(-1,dv%mod) ] 42857 005477'01 254 00 0 00 005361* retskp ; Insist that it is a directory device 42858 005500'01 endif. ; Done with the easy case 42859 ; Have to do some work... 42860 005500'01 265 16 0 00 006612' saveac ; Don't touch the other accumulators 42861 005501'01 104 00 0 00 000117 DVCHR% ; Get device characteristics 42862 005502'01 320 12 0 00 005504' ifje. r ; Fail and retrieve error 42863 005503'01 254 00 0 00 005510' 42864 005504'01 200 04 0 00 000001 move t4, t1 ; Store the error 42865 005505'01 477 01 0 00 000002 setob t1, t2 ; Cons up some real junk 42866 005506'01 400 03 0 00 000000 setz t3, ; This value should never happen 42867 005507'01 254 00 0 00 005511' else. ; Otherwise, worked 42868 005510'01 400 04 0 00 000000 setz t4, ; Flag that DVCHR% worked 42869 005511'01 endif. ; End case DVCHR% failure recovery 42870 ; Finally pick up the device type 42871 005511'01 135 03 0 00 006276' ldb t3,[pointr(t2,dv%typ)] 42872 005512'01 306 03 0 00 000015 cain t3, .dvnul ; NUL:? 42873 005513'01 254 00 0 00 005477* retskp ; Can always delete or list that (simulated) 42874 005514'01 306 03 0 00 000000 cain t3, .dvdsk ; Structure? 42875 005515'01 254 00 0 00 005513* retskp ; Yes, that has directories and files 42876 005516'01 306 03 0 00 000003 cain t3, .dvdta ; Eh? DECtape?? 42877 005517'01 254 00 0 00 005515* retskp ; Who put that back in? 42878 ; None of the above, try general case 42879 005520'01 326 04 0 00 005524' ife. t4 ; Did the DVCHR% work? 42880 005521'01 607 02 0 00 100000 txnn t2, dv%dir ; It did, so does the device have directories? 42881 005522'01 254 00 0 00 005524' anskp. ; No, so can't return true 42882 005523'01 254 00 0 00 005517* retskp ; Something new with a directory should work 42883 005524'01 endif. ; Otherwise, they are out of luck 42884 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-1 K20SRV MAC 9-Aug-24 12:55 Is this a directory device? 42885 005524'01 263 17 0 00 000000 ret ; Return doesn't have directories 42886 42887 ;[194] End code insertion 42888 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74 K20SRV MAC 9-Aug-24 12:55 GTNFIL - Get next file from wild file specification. 42889 subttl GTNFIL - Get next file from wild file specification. 42890 42891 ; Call: 42892 ; 42893 ; filjfn/ Current JFN, possibly one of many 42894 ; nxtjfn/ Next JFN in sequence (1-file lookahead) 42895 ; ndxjfn/ Flags associated with stepping to next specification 42896 ; 42897 ; Returns: 42898 ; 42899 ; +1 t1/ 0 (indicating no more) 42900 ; +2 t1/ JFN of next file 42901 ; 42902 ;[111] Rewritten to do 1-file lookahead as part of edit 111. 42903 ; 42904 ;[194] Partial rewrite to simulate NUL: stepping and also to always 42905 ; return zero on plus 1 return, as per specification 42906 42907 005525'01 gtnfil: entry gtnfil ; Also used by k20mit 42908 005525'01 337 01 0 00 005301* skipg t1, filjfn ;[193] Release the JFN of the previous file. 42909 005526'01 254 00 0 00 005534' ifskp. ;[193] If we have one ... 42910 005527'01 621 01 0 00 777777 tlz t1, -1 ;[252] Stomp any flags, just in case 42911 005530'01 306 01 0 00 377777 cain t1, .nulio ;[193] But!! Is this the sink? 42912 005531'01 254 00 0 00 005534' anskp. ;[193] Yes, no need to release it 42913 005532'01 104 00 0 00 000023 RLJFN 42914 005533'01 320 12 0 00 005534' erjmpr .+1 ;[193] Catch and ignore error 42915 005534'01 endif. ;[193] End case releasing JFN 42916 005534'01 402 00 0 00 005525* setzm filjfn 42917 42918 ; Check to see if we really want to or can get the next file. 42919 42920 005535'01 400 01 0 00 000000 setz t1, ; Assume no more files. 42921 005536'01 336 00 0 00 000000* skipn czseen ;[59] If CTRL-Z seen, then get no more files. 42922 005537'01 336 01 0 00 003421* skipn t1, nxtjfn ; No CTRL-Z. Get next JFN. 42923 005540'01 263 17 0 00 000000 ret ; None, so we're done. 42924 42925 ; Make a separate JFN for the file so that wildcard stepping won't be 42926 ; wiped out by anything we do to it, like deleting it, renaming it, etc. 42927 42928 005541'01 550 02 0 00 000001 hrrz t2, t1 ; Get the filename string. 42929 005542'01 561 01 0 00 003727* hrroi t1, strbuf 42930 005543'01 306 02 0 00 377777 cain t2, .nulio ;[193] Data sink? 42931 005544'01 254 00 0 00 005555' ifskp. ;[193] No, do it the regular way 42932 005545'01 120 03 0 00 002006* dmove t3, allfld ;[252] dev:name.typ.gen 42933 005546'01 104 00 0 00 000030 JFNS 42934 005547'01 320 12 0 00 005603' erjmpr gtnerr ;[194] Bag the whole thing if failed 42935 005550'01 205 01 0 00 100001 movx t1, gj%old!gj%sht ;Get a new JFN on it. 42936 005551'01 561 02 0 00 005542* hrroi t2, strbuf 42937 005552'01 104 00 0 00 000020 GTJFN 42938 005553'01 320 12 0 00 005603' erjmpr gtnerr ;[194] Bag the whole thing if failed 42939 005554'01 254 00 0 00 005561' else. ;[193] Otherwise, NUL: 42940 dmove t2 , [ BYTE (7) "N","U","L",":", 0 42941 005555'01 120 02 0 00 006625' 0 ] ;[193] 42942 005556'01 124 02 0 00 005551* dmovem t2, strbuf ;[193] Put the file name into the buffer 42943 005557'01 400 04 0 00 000000 setz t4, ;[193] Keep t4 whacked like JFNS k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74-1 K20SRV MAC 9-Aug-24 12:55 GTNFIL - Get next file from wild file specification. 42944 005560'01 201 01 0 00 377777 movei t1, .nulio ;[193] Load sink 42945 005561'01 endif. ;[193] End special case NUL: 42946 42947 005561'01 552 01 0 00 005534* hrrzm t1, filjfn ; Save it here, sans flags, if any 42948 005562'01 402 00 0 00 005556* setzm strbuf ; Scrub the buffer 42949 005563'01 402 00 0 00 000000# setzm strbuf+1 ; Give it a little more scrubby, just in case 42950 42951 ; Get new next JFN. 42952 42953 005564'01 550 01 0 00 005537* hrrz t1, nxtjfn ;[193] Get the JFN again. 42954 005565'01 302 01 0 00 377777 caie t1, .nulio ;[193] Data sink? 42955 005566'01 254 00 0 00 005572' ifskp. ;[193] Yes, so nothing to step 42956 005567'01 402 00 0 00 005564* setzm nxtjfn ;[193] So flag nothing left 42957 005570'01 402 00 0 00 003422* setzm ndxjfn ;[193] Nothing to step to 42958 remark t1, .nulio ;[193] Fall through with .nulio as JFN 42959 005571'01 254 00 0 00 005601' else. ;[193] Otherwise, have something to sep 42960 005572'01 500 01 0 00 005570* hll t1, ndxjfn ; Get wildcard flags into left half. 42961 repeat 0,< ;[252] Unnecessary now that debugging is comeplete 42962 move t2, t1 ;[252] Save the pair 42963 hrroi t1, crlf ;[252] 42964 PSOUT% ;[252] 42965 move t1, t2 ;[252] Restore the pair 42966 call jfnflg## ;[252] Show the flags 42967 txmsg <, > ;[252] Space over 42968 move t1, t2 ;[252] Restore the pair 42969 > ;repeat 0 ;[252] 42970 005573'01 104 00 0 00 000017 GNJFN ; Get the next JFN. 42971 005574'01 320 12 0 00 005576' ifje. r ;[194] Failed 42972 005575'01 254 00 0 00 005600' 42973 005576'01 200 04 0 00 000001 move t4, t1 ;[194] Save error for interested parties 42974 remark t1, ;[194] If no more, then no JFN 42975 005577'01 403 01 0 00 005572* setzb t1, ndxjfn ;[194] Nothing more to step 42976 005600'01 endif. ;[193] End GNJFN% failure handling 42977 005600'01 202 01 0 00 005567* movem t1, nxtjfn ; Save result for next time. 42978 repeat 0,< ;[252] Unnecessary now that debugging is comeplete 42979 txc t1, GJ%GND!GJ%GIV ;[252] GNJFN% clears these, which is fine 42980 call jfnflg## ;[252] Show this one 42981 move t1, nxtjfn ;[252] Restore for downstream 42982 > ;repeat 0 ;[252] 42983 005601'01 endif. ;[193] End .nulio special case 42984 42985 ; Return with current JFN 42986 42987 005601'01 200 01 0 00 005561* move t1, filjfn ; Return JFN of current file in t1. 42988 005602'01 254 00 0 00 005523* retskp ; Return +2 indicating another file was found. 42989 42990 005603'01 200 04 0 00 000001 gtnerr: move t4, t1 ;[194] Save error for debuggers 42991 42992 005604'01 336 00 0 00 005601* ifmn. filjfn ;[194] Any file? 42993 005605'01 254 00 0 00 005612' 42994 005606'01 550 01 0 00 005604* hrrz t1, filjfn ;[194] Load JFN, sans flags 42995 005607'01 260 17 0 00 003127* call frclos ;[194] Force it to close 42996 005610'01 600 00 0 00 000000 nop ;[194] Ignore any error 42997 005611'01 402 00 0 00 005606* setzm filjfn ;[194] Whack the remnants 42998 005612'01 endif. ;[194] k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74-2 K20SRV MAC 9-Aug-24 12:55 GTNFIL - Get next file from wild file specification. 42999 43000 005612'01 336 00 0 00 005600* ifmn. nxtjfn ;[194] Any 'next' JFN left? 43001 005613'01 254 00 0 00 005620' 43002 005614'01 550 01 0 00 005612* hrrz t1, nxtjfn ;[194] Yes, load JFN, sans flags 43003 005615'01 260 17 0 00 005607* call frclos ;[194] Force it to close 43004 005616'01 600 00 0 00 000000 nop ;[194] Ignore any error 43005 005617'01 402 00 0 00 005614* setzm nxtjfn ;[194] Whack the remnants 43006 005620'01 endif. ;[194] 43007 43008 005620'01 336 00 0 00 005577* ifmn. ndxjfn ;[194] Any stepping JFN? 43009 005621'01 254 00 0 00 005626' 43010 005622'01 550 01 0 00 005620* hrrz t1, ndxjfn ;[194] Yes, load the JFN, sans flags 43011 005623'01 260 17 0 00 005615* call frclos ;[194] Force it to close 43012 005624'01 600 00 0 00 000000 nop ;[194] Ignore any error 43013 005625'01 402 00 0 00 005622* setzm ndxjfn ;[194] Nothing to step any more 43014 005626'01 endif. ;[194] 43015 43016 005626'01 400 01 0 00 000000 setz t1, ;[194] No JFN anywhere, anyhow 43017 005627'01 263 17 0 00 000000 ret ;[194] Returns plus one 43018 43019 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 75 K20SRV MAC 9-Aug-24 12:55 Fetch File Information 43020 subttl Fetch File Information 43021 43022 ;[200] Begin Code Insertion 43023 ; 43024 ; Call: 43025 ; 43026 ; t2/ JFN of file to get information for 43027 ; 43028 ; Returns: 43029 ; 43030 ; +1/ Failure, the below are not dependable 43031 ; +2/ Succeed, the below contain 'reasonable' values 43032 ; 43033 ; pagcnt/ Number of pages (or blocks) in the file 43034 ; bytcnt/ Count of bytes in the file and byte size 43035 ; crdate/ Creation date and time 43036 ; 43037 ; N.B., Assumes both that the above variables are contiguous 43038 ; and that they are in the above order! 43039 ; 43040 ; To Do: See if can be coupled with isdird 43041 43042 005630'01 000700 000000 nulfdb: fld(^d7,fb%bsz) ; Pretend ASCII file with no pages 43043 005631'01 000000 000000 0 ; And no bytes 43044 43045 005632'01 filinf: extern pagcnt,crdate ; Size and date storage 43046 005632'01 265 16 0 00 006314' saveac ; Don't destroy calling context 43047 005633'01 553 04 0 00 000002 hrrzs t4, t2 ; Save and strip and flags 43048 005634'01 306 04 0 00 377777 cain t4, .nulio ; OK, is this going to be easy? 43049 005635'01 254 00 0 00 005720' jrst nulinf ; Special cased NUL: is trivial 43050 43051 005636'01 200 01 0 00 000004 move t1, t4 ; Load the JFN 43052 005637'01 104 00 0 00 000117 DVCHR% ; Get the device characteristics 43053 005640'01 320 12 0 00 005642' %jsErr (,r) 43054 005641'01 254 00 0 00 005645' 43055 005642'01 265 01 0 00 005130* 43056 005643'01 000000000000# 43057 005644'01 254 00 0 00 005473* 43058 001400'04 106 151 154 145 040 43059 43060 005645'01 135 03 0 00 006276' ldb t3,[pointr(t2,dv%typ)] ; Load the device type 43061 005646'01 306 03 0 00 000015 cain t3, .dvnul ; An unconverted NUL: device? 43062 005647'01 254 00 0 00 005720' jrst nulinf ; Odd, but handle it 43063 005650'01 302 03 0 00 000000 caie t3, .dvdsk ; Structure? 43064 005651'01 254 00 0 00 005660' ifskp. ; Of course it is 43065 005652'01 200 01 0 00 000004 move t1, t4 ; Restore the JFN 43066 dmove t2, [3,,.fbbyv ; Get size info from FDB (3 words) 43067 005653'01 120 02 0 00 006627' pagcnt] ; Put info in PAGCNT,BYTCNT,CRDATE 43068 005654'01 104 00 0 00 000063 GTFDB% ; which are adjacent in the data area. 43069 005655'01 320 16 0 00 005660' annje. ; Failed, try alternate way 43070 005656'01 254 00 0 00 005602* retskp ; Succeeded 43071 005657'01 254 00 0 00 005720' else. ; Otherwise, use older slower mechanisms 43072 005660'01 200 01 0 00 000004 move t1, t4 ; Restore the JFN 43073 005661'01 104 00 0 00 000036 SIZEF% ; Will work on any directory device 43074 005662'01 320 12 0 00 005664' %jsErr (,r) k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 75-1 K20SRV MAC 9-Aug-24 12:55 Fetch File Information 43075 005663'01 254 00 0 00 005667' 43076 005664'01 265 01 0 00 005642* 43077 005665'01 000000000000# 43078 005666'01 254 00 0 00 005644* 43079 001411'04 106 151 154 145 040 43080 005667'01 250 02 0 00 000003 exch t2,t3 ; Reorder as per above 43081 005670'01 124 02 0 00 002251* dmovem t2, pagcnt ; Store as per GTFDB% 43082 005671'01 265 16 0 00 004530* anstkv (t4,<.rsfet+1>) ;Allocate an anonymous stack variable 43083 005672'01 000000 000007 43084 005673'01 415 04 0 17 777770 43085 005674'01 200 02 0 00 000004 move t2, t4 ; Point to block 43086 005675'01 201 03 0 00 000007 movx t3, <.rsfet+1> ; Length of same 43087 005676'01 104 00 0 00 000533 RFTAD% ; Try it this way 43088 005677'01 320 12 0 00 005701' %jsErr (,r) 43089 005700'01 254 00 0 00 005704' 43090 005701'01 265 01 0 00 005664* 43091 005702'01 000000000000# 43092 005703'01 254 00 0 00 005666* 43093 001423'04 106 151 154 145 040 43094 005704'01 415 16 0 00 005715' block. ; Enter block context for better control flow 43095 005705'01 261 17 0 00 000016 43096 005706'01 332 03 0 04 000001 skipe t3,.rscrv(t4) ; Can we use the obvious file creation date? 43097 005707'01 254 00 0 00 005656* retskp ; Yes, go with that 43098 005710'01 332 03 0 04 000000 skipe t3,.rswrt(t4) ; OK, maybe the last time it was written? 43099 005711'01 254 00 0 00 005707* retskp ; Good enough... 43100 005712'01 332 03 0 04 000003 skipe t3,.rscre(t4) ; No, how about this odd word? 43101 005713'01 254 00 0 00 005711* retskp ; About as good as the previous 43102 remark ; Fall through, +1 43103 005714'01 263 17 0 00 000000 endbk. ; End of block context 43104 005715'01 263 17 0 00 000000 ret ; Failed 43105 005716'01 202 03 0 00 002305* movem t3, crdate ; Store what we decided to use 43106 005717'01 254 00 0 00 005713* retskp ; Return success 43107 005720'01 endif. 43108 43109 remark ; Special case .nulio (and NUL:) 43110 43111 005720'01 120 01 0 00 005630' nulinf: dmove t1,nulfdb ; Phoney up some FDB entries 43112 005721'01 124 01 0 00 005670* dmovem t1, pagcnt ; Store like GTFDB% would 43113 005722'01 104 00 0 00 000227 GTAD% ; Get current time of day 43114 005723'01 202 01 0 00 005716* movem t1, crdate ; NUL: is always created right now 43115 005724'01 254 00 0 00 005717* retskp ; Succeed 43116 43117 ;[200] End Code Insertion 43118 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76 K20SRV MAC 9-Aug-24 12:55 Fix up a file JFN for fast generational delete 43119 subttl Fix up a file JFN for fast generational delete 43120 43121 ;[199] Begin code insertion 43122 43123 ; The following is necessary to leverage the DELNF% JSYS, which will 43124 ; result in far faster deletion of a file with multiple generations. 43125 ; Otherwise, each and every generation must be handled seperately in a 43126 ; loop doing GTJFN%, GNJFN% and DELF%'s 43127 ; 43128 ; Call: 43129 ; 43130 ; t1/ flags,,JFN as returned by .cmfil 43131 ; 43132 ; Assumes the following are true: 43133 ; 43134 ; 1) That the NUL: device has already been special cased to .nulio 43135 ; 2) That we are not being called with resulting .nulio 43136 ; 3) That the device in question supports directories 43137 ; 43138 ; To do: Was this necessary? If doing highest generation, does a 43139 ; negative value for generations to keep work? 43140 43141 111100 000001 fjfnsf==> ; Want everything but the generation 43142 43143 005725'01 607 01 0 00 010000 ffjfgd: jxe t1, gj%ver, r ; Nothing to do if didn't wildcard the version 43144 005726'01 254 00 0 00 005703* 43145 005727'01 607 01 0 00 004000 ifxn. t1, gj%uhv ; Already doing highest generation? 43146 005730'01 254 00 0 00 005733' 43147 005731'01 621 01 0 00 010000 txz t1, gj%ver ; Don't step generations 43148 005732'01 254 00 0 00 005724* retskp ; Succeed 43149 005733'01 endif. 43150 43151 005733'01 265 16 0 00 006265' saveac ; Candidate JFN and storage for file name 43152 005734'01 200 05 0 00 000001 move q1, t1 ; Save the JFN and flags 43153 005735'01 265 16 0 00 005671* anstkv (q2,mxfilw) ; Storage to build a new name 43154 005736'01 000000 000034 43155 005737'01 415 06 0 17 777743 43156 43157 005740'01 560 01 0 00 000006 hrro t1, q2 ; Construct Tops-20 ASCII pointer to stack 43158 005741'01 550 02 0 00 000005 hrrz t2, q1 ; Load JFN, sans flags 43159 005742'01 120 03 0 00 006631' dmove t3, [exp fjfnsf,0] ;Fast delete JFNS Flags and no prefix 43160 005743'01 104 00 0 00 000030 JFNS% ; Reconstruct on the stack 43161 005744'01 320 12 0 00 005746' %jsErr (,r) 43162 005745'01 254 00 0 00 005751' 43163 005746'01 265 01 0 00 005701* 43164 005747'01 000000000000# 43165 005750'01 254 00 0 00 005726* 43166 001435'04 125 156 141 142 154 43167 005751'01 120 02 0 00 006633' dmove t2, [exp ".","0"] ; Highest generation and punctuation 43168 005752'01 136 02 0 00 000001 idpb t2, t1 ; Append the generation punctionation 43169 005753'01 136 03 0 00 000001 idpb t3, t1 ; Append the highest generation moniker 43170 005754'01 136 04 0 00 000001 idpb t4, t1 ; Tie off the string 43171 ; Load GTJFN% flag bits,,generation number. 43172 005755'01 205 01 0 00 100120 movx t1, gj%old!gj%ifg!gj%flg!fld(.rhalf,.gjdef) 43173 005756'01 560 02 0 00 000006 hrro t2, q2 ; Construct Tops-20 ASCII pointer to stack k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76-1 K20SRV MAC 9-Aug-24 12:55 Fix up a file JFN for fast generational delete 43174 005757'01 104 00 0 00 000020 GTJFN% ; Get a brand new JFN on file group 43175 005760'01 320 12 0 00 005762' %jsErr (,r) 43176 005761'01 254 00 0 00 005765' 43177 005762'01 265 01 0 00 005746* 43178 005763'01 000000000000# 43179 005764'01 254 00 0 00 005750* 43180 001445'04 125 156 141 142 154 43181 43182 005765'01 500 01 0 00 000005 hll t1, q1 ; Load just the calling flags 43183 005766'01 621 01 0 00 013000 txz t1, gj%ver!gj%nhv!gj%ulv ; Shut off wildcarded lowest and next highest 43184 005767'01 661 01 0 00 004000 txo t1, gj%uhv ; Force highest generation, always 43185 005770'01 250 01 0 00 000005 exch t1, q1 ; Swap with old flags,,JFN 43186 43187 005771'01 621 01 0 00 777777 tlz t1, -1 ; Toss its flags 43188 005772'01 104 00 0 00 000023 RLJFN% ; Toss the JFN 43189 005773'01 320 12 0 00 005775' ifje. r ; Failed?? 43190 005774'01 254 00 0 00 006001' 43191 005775'01 306 01 0 00 600152 cain t1, desx3 ; Wait, did it disappear?? 43192 005776'01 254 00 0 00 006001' anskp. ; Odd, but that's really fine 43193 005777'01 200 02 0 00 000001 move t2, t1 ; Otherwise, save the error carry on 43194 006000'01 254 00 0 00 006002' else. ; Otherwise, worked!! 43195 006001'01 400 02 0 00 000000 setz t2, ; Signal no error 43196 006002'01 endif. ; Worst case, we drag an extra JFN around 43197 43198 006002'01 200 01 0 00 000005 move t1, q1 ; Load updated flags and new JFN 43199 006003'01 254 00 0 00 005732* retskp ; Finally return success 43200 43201 ;[199] End code insertion 43202 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 77 K20SRV MAC 9-Aug-24 12:55 Routine to delete a file [118] 43203 subttl Routine to delete a file [118] 43204 43205 extern expung ; Auto expunge flag 43206 43207 ; [199] Partially adapted from EFTPST. 43208 43209 ; Call: 43210 ; 43211 ; t2/ flags,,JFN 43212 ; 43213 ; The flags are the stepping flags for a wildcarded JFN and may 43214 ; NOT be associated with the JFN in question. gj%uhv is checked 43215 ; to see if the original file specification wildcarded the 43216 ; version number. If this is the case and expunge is not on, 43217 ; then DELNF% will be used for a substantial performance increase. 43218 ; 43219 ; Returns: +1, always 43220 ; 43221 ; The JFN is not released (see below) in order to allow the driving 43222 ; loop to release it. Otherwise, in a multi-forking environment, you 43223 ; can get into the situation that the JFN is released here and another 43224 ; fork is then picked to run which issues a GTJFN%. If the same JFN 43225 ; is given, then when driver code resumes, it may wind up releasing 43226 ; somebody else's JFN!! 43227 ; 43228 ; N.B., The "remark t1, df%nrj" is used to acknowledge a documentation 43229 ; 'bug' that claims that the DELNF% JSYS will release the JFN unless 43230 ; this bit is set. No, it doesn't. 43231 ; 43232 ; DELNF% does not handle the bit: it NEVER releases JFNs because 43233 ; there is no code to do this. So, we pretend to set it even though 43234 ; DELNF% does not look at it, never has looked at it and never will 43235 ; look at it. 43236 ; 43237 ; This behavior has been consistent from TENEX days. The problem is 43238 ; a Tops-20 Monitor Calls Manual documentation defect which has 43239 ; existed since version 3A. 43240 43241 006004'01 550 01 0 00 000002 delfil: hrrz t1, t2 ;[193] Load the JFN, sans flags 43242 43243 006005'01 302 01 0 00 377777 caie t1, .nulio ;[193] Data sink? 43244 006006'01 254 00 0 00 006011' ifskp. ;[193] Yep, that's pretty easy 43245 006007'01 474 04 0 00 000000 seto t4, ;[199] Flag a phoney delete 43246 006010'01 254 00 0 00 006031' jrst delepi ;[199] And hit the epilogue 43247 006011'01 endif. ;[199] End .nulio special case 43248 43249 remark ;[199] Otherwise, deleting something for real 43250 006011'01 332 00 0 00 001256* ifme. expung ;[143] Not expunging automatically? 43251 006012'01 254 00 0 00 006025' 43252 006013'01 607 02 0 00 004000 txnn t2, gj%uhv ;[199] Yes. Doing all of them? 43253 006014'01 254 00 0 00 006025' anskp. ;[199] No, then don't whack all of them 43254 remark t1, df%nrj ;[199] No flags being used (see above) 43255 006015'01 400 02 0 00 000000 setz t2, ;[199] Don't keep ANY generations 43256 006016'01 104 00 0 00 000317 DELNF% ;[199] Chuck all of them; boom! 43257 006017'01 320 12 0 00 006067' erjmpr delerr ;[199] But didn't ... k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 77-1 K20SRV MAC 9-Aug-24 12:55 Routine to delete a file [118] 43258 006020'01 553 04 0 00 000002 hrrzs t4, t2 ;[199] Remember number deleted 43259 006021'01 275 02 0 00 000001 subi t2, ^d1 ;[199] Account for assumed single file 43260 006022'01 323 02 0 00 006024' ifg. t2 ;[199] Two or more? 43261 006023'01 272 02 0 00 000000# addm t2, filcnt ;[199] Bump the file count with remainder 43262 006024'01 endif. ;[199] 43263 006024'01 254 00 0 00 006031' else. ;[199] Otherwise, just do this single file 43264 006025'01 505 01 0 00 600000 hrli t1, (df%nrj!df%exp) ;[143] Yes, set the bit 43265 006026'01 104 00 0 00 000026 DELF ; Try to delete it. 43266 006027'01 320 12 0 00 006067' erjmpr delerr ;[199] But couldn't 43267 006030'01 400 04 0 00 000000 setz t4, ;[199] Flag special singular case 43268 006031'01 endif. ;[199] End case expunge optimization 43269 remark t4, delepi ;[199] Falls through to epilogue with t4 set 43270 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 78 K20SRV MAC 9-Aug-24 12:55 Delete epilogue code comments on file operation 43271 subttl Delete epilogue code comments on file operation 43272 43273 ; Expects t4 to have a file count or a negative talisman 43274 43275 006031'01 200 01 0 00 000000# delepi: move t1, srvptr ;[199] Build confirmation message. 43276 006032'01 303 04 0 00 000001 caile t4, ^d1 ;[193] A single file or something odd 43277 006033'01 254 00 0 00 006047' ifskp. ;[193] Yes, that's easy enough 43278 006034'01 200 02 0 00 000000# move t2, delfa ;[199] Load singular file delete acknowledge 43279 006035'01 136 02 0 00 000001 idpb t2, t1 ;[199] Append first character 43280 repeat ^d4, < ;[199] And the other four 43281 lsh t2, -^d7 ;[199] Shift next character into place 43282 idpb t2, t1 ;[199] Append it 43283 > ;[199] End loop unroll 43284 006036'01 242 02 0 00 777771 43285 006037'01 136 02 0 00 000001 43286 006040'01 242 02 0 00 777771 43287 006041'01 136 02 0 00 000001 43288 006042'01 242 02 0 00 777771 43289 006043'01 136 02 0 00 000001 43290 006044'01 242 02 0 00 777771 43291 006045'01 136 02 0 00 000001 43292 43293 006046'01 254 00 0 00 006063' else. ;[199] Otherwise, DELNF% cleaned up a bunch 43294 006047'01 120 02 0 00 006635' dmove t2, [ exp ",", .chspc ] ;[199] Comma space over 43295 006050'01 136 02 0 00 000001 idpb t2, t1 ;[199] append the comma 43296 006051'01 136 03 0 00 000001 idpb t3, t1 ;[199] and the space 43297 006052'01 200 02 0 00 000004 move t2, t4 ;[199] Pick up the number done 43298 006053'01 201 03 0 00 000012 movei t3, ^d10 ;[199] Generations are base 10 43299 006054'01 104 00 0 00 000224 NOUT% ;[199] Convert and append 43300 006055'01 320 12 0 00 006057' %jsErr (,) ;[199] 43301 006056'01 254 00 0 00 006062' 43302 006057'01 265 01 0 00 005762* 43303 006060'01 000000000000# 43304 006061'01 254 00 0 00 006062' 43305 001460'04 103 157 165 154 144 43306 006062'01 260 17 0 00 006113' call apptxt ;[199] Append clarifying text 43307 006063'01 endif. ;[199] 43308 43309 006063'01 202 01 0 00 000000# movem t1, srvptr ; Update the string pointer. 43310 006064'01 400 02 0 00 000000 setz t2, ;[199] Cons up a .chnul 43311 006065'01 136 02 0 00 000001 idpb t2, t1 ;[199] Keep it ASCIZ 43312 006066'01 263 17 0 00 000000 ret ; Done 43313 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 79 K20SRV MAC 9-Aug-24 12:55 Handle some kind of delete error 43314 subttl Handle some kind of delete error 43315 43316 ; Expects to be called with an erjmpr or similar (NOT ercalr or pushj!) 43317 43318 006067'01 370 00 0 00 000000# delerr: sos filcnt ; "Uncount" this file, it wasn't deleted. 43319 006070'01 200 04 0 00 000001 move t4, t1 ;[199] Pass error back, if wanted 43320 006071'01 661 04 0 00 777777 tlo t4, -1 ;[199] And flag it was an error 43321 006072'01 200 01 0 00 000000# move t1, srvptr ;[199] Error, record the message 43322 006073'01 120 02 0 00 006637' dmove t2, [ exp ":", .chspc] ;[199] Load punctuation 43323 006074'01 136 02 0 00 000001 idpb t2, t1 ;[199] Append it 43324 006075'01 136 03 0 00 000001 idpb t3, t1 ;[199] 43325 006076'01 505 02 0 00 400000 hrli t2,.fhslf ;[199] This fork (LH) 43326 006077'01 540 02 0 00 000004 hrr t2, t4 ;[199] Load 'calling' error 43327 006100'01 400 03 0 00 000000 setz t3, ;[199] No limit (maybe bad idea?) 43328 006101'01 104 00 0 00 000011 ERSTR 43329 006102'01 320 14 0 00 006104' erjmps .+2 ;[199] Ignore strange return 43330 006103'01 320 14 0 00 006104' erjmps .+1 ;[199] Ignore stranger return 43331 006104'01 120 02 0 00 001764' dmove t2, crlfch ;[251] Load line terminators 43332 006105'01 136 02 0 00 000001 idpb t2, t1 ;[199] Tie off 43333 006106'01 136 03 0 00 000001 idpb t3, t1 ;[199] the line ... 43334 006107'01 202 01 0 00 000000# movem t1, srvptr ;[199] Update the pointer 43335 006110'01 400 02 0 00 000000 setz t2, ;[199] Cons up a .chnul 43336 006111'01 136 02 0 00 000001 idpb t2, t1 ;[199] Keep it ASCIZ 43337 006112'01 263 17 0 00 000000 ret ;[199] Done with blat 43338 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 80 K20SRV MAC 9-Aug-24 12:55 ASCII text to efficiently append in arcane ways 43339 subttl ASCII text to efficiently append in arcane ways 43340 43341 ;[199] Begin code insertion 43342 43343 chgsec(code,text) ;;Text goes in section zero text 43344 000127'03 delfa: remark " [OK] " ; delete file acknowlege 43345 000127'03 273134 766640 byte (1) 0 (7) "]", "K", "O", "[", .chspc 43346 43347 000130'03 gentxt: remark " generations" ; Inflection will always be plural 43348 000130'03 313566 271640 byte (1) 0 (7) "e", "n", "e", "g", .chspc 43349 000131'03 337517 230362 byte (1) 0 (7) "o", "i", "t", "a", "r" 43350 000132'03 000000 034756 byte (1) 0 (7) .chnul, .chnul, .chnul, "s", "n" 43351 retsec ;;Back to generating code 43352 43353 ; To do: The unrolled right justified ASCIZ ", generations" text can 43354 ; be stored with 24 instructions. At what point would the MOVSLJ 43355 ; begin to outperform this? I dislike using SOUT% to shuttle 43356 ; characters. Ditto NOUT% for numbers... 43357 43358 006113'01 apptxt: remark t1, ; Expects a valid pointer in t1 43359 006113'01 200 02 0 00 000000# move t2, gentxt ; Load first part of explanatory text 43360 006114'01 136 02 0 00 000001 idpb t2, t1 ; Append first character 43361 repeat ^d4, < ; And the other four 43362 lsh t2, -^d7 ; Shift the next character into place 43363 idpb t2, t1 ; Append it 43364 > ; End loop unroll 43365 006115'01 242 02 0 00 777771 43366 006116'01 136 02 0 00 000001 43367 006117'01 242 02 0 00 777771 43368 006120'01 136 02 0 00 000001 43369 006121'01 242 02 0 00 777771 43370 006122'01 136 02 0 00 000001 43371 006123'01 242 02 0 00 777771 43372 006124'01 136 02 0 00 000001 43373 43374 006125'01 200 02 0 00 000000# move t2, gentxt+1 ; Load next part of explanatory text 43375 006126'01 136 02 0 00 000001 idpb t2, t1 ; Append first character 43376 repeat ^d4, < ; And the other four 43377 lsh t2, -^d7 ; Shift next next character into place 43378 idpb t2, t1 ; Append it 43379 > ; End loop unroll 43380 006127'01 242 02 0 00 777771 43381 006130'01 136 02 0 00 000001 43382 006131'01 242 02 0 00 777771 43383 006132'01 136 02 0 00 000001 43384 006133'01 242 02 0 00 777771 43385 006134'01 136 02 0 00 000001 43386 006135'01 242 02 0 00 777771 43387 006136'01 136 02 0 00 000001 43388 43389 006137'01 200 02 0 00 000000# move t2, gentxt+2 ; Load final part of explanatory text 43390 006140'01 136 02 0 00 000001 idpb t2, t1 ; Append first character 43391 006141'01 242 02 0 00 777771 lsh t2, -^d7 ; Shift the final character into place 43392 006142'01 136 02 0 00 000001 idpb t2, t1 ; Append it 43393 006143'01 263 17 0 00 000000 ret ; Done k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 80-1 K20SRV MAC 9-Aug-24 12:55 ASCII text to efficiently append in arcane ways 43394 43395 ;[199] End code insertion 43396 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81 K20SRV MAC 9-Aug-24 12:55 DMPBUF - Dump the buffer [115] 43397 subttl DMPBUF - Dump the buffer [115] 43398 43399 ;[215] Begin code insertion (moved from k20mit) 43400 ; 43401 ; 43402 ; Call with SRVPTR/ current pointer (to end of string to be dumped) 43403 ; Returns +1 with t1/ new pointer. Uses t2. 43404 ; 43405 ; Dumps the buffer starting from SRVBUF thru present position, 43406 ; resets pointer SRVPTR to beginning of SRVBUF. 43407 ; 43408 ; Certain headers are hardcoded and need no termination. These are all 43409 ; up in section 1 and are referenced by one word global ASCII pointers. 43410 43411 006144'01 dmpbuf: entry dmpbuf ;[194] Also used from k20dsp 43412 006144'01 200 01 0 00 000000# move t1, srvptr ; Get current pointer. 43413 006145'01 200 03 0 00 000001 move t3, t1 ;[215] Save a copy here, just in case 43414 006146'01 200 04 0 00 000001 move t4, t1 ;[215] And another copy over here 43415 43416 006147'01 474 02 0 00 000000 seto t2, ;[215] Just in case first fetch fails 43417 006150'01 135 02 0 00 000004 ldb t2, t4 ;[215] Pick up current byte 43418 006151'01 320 12 0 00 006176' erjmpr dmpbfe ;[215] Handle an addressing error 43419 006152'01 322 02 0 00 006162' jumpe t2, dmpbf2 ;[215] Already tied off, nothing to do 43420 006153'01 474 02 0 00 000000 seto t2, ;[215] Just in case 2nd fetch fails 43421 006154'01 134 02 0 00 000004 ildb t2, t4 ;[215] No, how about the NEXT byte, then? 43422 006155'01 320 12 0 00 006176' erjmpr dmpbfe ;[215] Handle an addressing error 43423 006156'01 322 02 0 00 006162' jumpe t2, dmpbf2 ;[215] Already tied off, nothing to do 43424 43425 006157'01 403 02 0 00 000004 dmpbf1: setzb t2, t4 ;[215] Have to tie it off, then 43426 006160'01 136 04 0 00 000003 idpb t4, t3 ;[215] Make sure string is asciz. 43427 006161'01 320 12 0 00 006176' erjmpr dmpbfe ;[215] Failed?? 43428 43429 006162'01 200 01 0 00 006641' dmpbf2: move t1, [point 7, srvbuf] ; Point to buffer 43430 006163'01 202 01 0 00 000000# movem t1, srvptr ; Save new pointer. 43431 43432 006164'01 332 00 0 00 003614* ifme. srvflg ;[194] Am I not a server? 43433 006165'01 254 00 0 00 006171' 43434 006166'01 336 00 0 00 000000# skipn srvbuf ;[194] No, but is there anything to type? 43435 006167'01 254 00 0 00 006171' anskp. ;[194] No, so bum the JSYS 43436 006170'01 104 00 0 00 000076 PSOUT ; If not, print it. 43437 006171'01 endif. ;[194] 43438 43439 006171'01 402 00 0 00 000000# dmpbf3: setzm srvbuf ; Clear it. 43440 006172'01 200 01 0 00 006642' move t1, [srvbuf,,srvbuf+1] 43441 006173'01 251 01 0 00 000000# blt t1, srvbzz 43442 006174'01 200 01 0 00 000000# move t1, srvptr ; Return pointer in t1. 43443 006175'01 263 17 0 00 000000 ret 43444 43445 ; Here on some addressing error. If t2 is negative, then we failed 43446 ; on the read. If it is zero, then we failed on the write. 43447 43448 006176'01 dmpbfe: remark ;[215] Here if an addressing error 43449 006176'01 305 02 0 00 000000 caige t2, 0 ;[215] Failed the read? 43450 006177'01 334 00 0 00 000000 %ermsg (,dmpbe3) ;[215] 43451 006200'01 254 00 0 00 006204' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81-1 K20SRV MAC 9-Aug-24 12:55 DMPBUF - Dump the buffer [115] 43452 006201'01 265 01 0 00 006057* 43453 006202'01 000000000000# 43454 006203'01 254 00 0 00 006251' 43455 001471'04 144 155 160 142 165 43456 43457 006204'01 200 04 0 00 000001 move t4, t1 ;[215] Get error number out of the way 43458 006205'01 302 04 0 00 601775 caie t4, ILLX02 ;[215] Write-protected page, then? 43459 006206'01 334 00 0 00 000000 %ermsg (,dmpbe3) ;[215] 43460 006207'01 254 00 0 00 006213' 43461 006210'01 265 01 0 00 006201* 43462 006211'01 000000000000# 43463 006212'01 254 00 0 00 006251' 43464 001504'04 144 155 160 142 165 43465 006213'01 554 01 0 00 000003 hlrz t1, t3 ;[215] Pick up the pointer position portion 43466 006214'01 200 02 0 00 000001 move t2, t1 ;[215] Make a copy so can examine both parts 43467 006215'01 405 01 0 00 770000 andi t1, 770000 ;[215] Shut off the section 43468 006216'01 405 02 0 00 007777 andi t2, 007777 ;[215] Keep just the section 43469 ;[215] First check just the pointer 43470 remark ;[215] There will be only six possible positions 43471 006217'01 306 01 0 00 610000 cain t1, (.p0736) ;[215] Starting position? 43472 006220'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43473 006221'01 306 01 0 00 620000 cain t1, (.p0706) ;[215] First byte? 43474 006222'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43475 006223'01 306 01 0 00 630000 cain t1, (.p0713) ;[215] Second byte? 43476 006224'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43477 006225'01 306 01 0 00 640000 cain t1, (.p0720) ;[215] Third byte? 43478 006226'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43479 006227'01 306 01 0 00 650000 cain t1, (.p0727) ;[215] Fourth byte? 43480 006230'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43481 006231'01 306 01 0 00 660000 cain t1, (.p0734) ;[215] Fifth byte? 43482 006232'01 254 00 0 00 006240' jrst dmpbe1 ;[215] Yep, OK 43483 43484 006233'01 334 00 0 00 000000 %ermsg (,dmpbe3) ;[215] 43485 006234'01 254 00 0 00 006240' 43486 006235'01 265 01 0 00 006210* 43487 006236'01 000000000000# 43488 006237'01 254 00 0 00 006251' 43489 001516'04 144 155 160 142 165 43490 43491 006240'01 dmpbe1: remark ;[215] Here if thought to be a valid OWG ASCII ptr 43492 006240'01 302 02 0 00 000001 caie t2, extsec ;[215] In extended text psect? 43493 006241'01 334 00 0 00 000000 %ermsg (,dmpbe3) ;[215] 43494 006242'01 254 00 0 00 006246' 43495 006243'01 265 01 0 00 006235* 43496 006244'01 000000000000# 43497 006245'01 254 00 0 00 006251' 43498 001527'04 144 155 160 142 165 43499 43500 006246'01 dmpbe2: remark ;[215] Terminated string or a write error we can handle 43501 006246'01 200 01 0 00 000003 move t1, t3 ;[215] Reload original pointer 43502 006247'01 133 00 0 00 000001 ibp t1 ;[215] Pretend the idpb worked 43503 006250'01 254 00 0 00 006162' jrst dmpbf2 ;[215] Carry on 43504 43505 006251'01 dmpbe3: remark ;[215] Here on error recovery failure 43506 006251'01 200 01 0 00 006643' move t1, [point 7, srvbuf] ;[215] Just reset k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81-2 K20SRV MAC 9-Aug-24 12:55 DMPBUF - Dump the buffer [115] 43507 006252'01 202 01 0 00 000000# movem t1, srvptr ;[215] the bufer pointer 43508 006253'01 254 00 0 00 006171' jrst dmpbf3 ;[215] And stomp the buffer 43509 43510 43511 ;[215] End code insertion 43512 43513 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 82 K20SRV MAC 9-Aug-24 12:55 Close out Code 43514 subttl Close out Code 43515 43516 xlist ; Shut off the listing 43517 list ; Turn the listing back on 43518 43519 .endps code 43520 k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page 83 K20SRV MAC 9-Aug-24 12:55 Impure data area 43521 subttl Impure data area 43522 43523 .psect data 43524 43525 000000'05 cdhack: block 1 ;[255] Used to transmogrify ".." into CDUP 43526 000001'05 tmpjfn: block 1 ;[233] Used for directory/name logging 43527 000002'05 dirbuf: block fdrmxw ;[220] Maximum size foreign directory 43528 000143'05 pasbuf: block fpwmxw ;[220] Maximum size foreign password 43529 000304'05 44 07 0 00 000000* filptr: point 7, filbuf ; Pointer to file buffer text 43530 43531 000305'05 000000 000000 filcnt: 0 ;[194] ; File counter for directory listings. 43532 000306'05 000000 000000 dirfin: 0 ;[194] ; Flag for directory listing finished. 43533 43534 000307'05 000000 000000 gclen: 0 ; Generic command data field length. 43535 000310'05 000000 000000 rufork: 0 ; Fork number for LOCAL RUN program fork. 43536 43537 ;[220] These all get the "x" overwritten 43538 43539 ;To do, they get the X overwritten sometimes... 43540 43541 000311'05 042 170 042 040 055 xxbmsg: asciz/"x" - Not valid as server command/ ; Another. 43542 000041 xxblen==^d33 ;[220] ; Number of characters in xxbmsg. 43543 000320'05 042 170 042 040 055 xxgnms: asciz/"x" - Unimplemented generic command/ 43544 000043 xxgnln==^d35 ;[220] 43545 000330'05 042 170 042 040 055 xxgums: asciz/"x" - Undefined generic command/ 43546 000037 xxguln==^d31 ;[220] 43547 000337'05 042 170 042 040 055 xxumsg: asciz/"x" - Unknown server command/ ; Server message (fill in the x) 43548 000034 xxulen==^d28 ;[220] ; Number of characters in xxumsg. 43549 43550 remark Buffer space 43551 43552 000345'05 000000 000000 getptr: 0 ;[220] ; Pointer for emptying... 43553 000346'05 000000 000000 srvptr: 0 ;[194] ; And pointer for filling... 43554 000347'05 srvbuf: xlist ;[194] ;[187] Save the trees!! 43555 list ;[187] 43556 43557 001347'05 srvbz: xlist ;[194] ;[187] 43558 list ;[187] 43559 001447'05 000000 000000 srvbzz: 0 ;[220] ;[215] Where the padding ends. 43560 001450'05 cwdbuf: block dirmxw ;[249] ; Area to construct a directory in 43561 .endps data 43562 43563 end NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 006644 FOR CODE PSECT 2 BREAK IS 000615 FOR CONST PSECT 3 BREAK IS 000133 FOR TEXT PSECT 4 BREAK IS 001542 FOR ETEXT PSECT 5 BREAK IS 001462 FOR DATA CPU TIME USED 00:01.884 135P CORE USED k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE AC%CON 400000 000000 sin DIRMXW 000012 spd GNJFN 104000 000017 int NSITC 000000 ext ACCES 104000 000552 int DIRST 104000 000041 int GOTS 000000 ext NTIMOU 000000 ext ACCES% 104000 000552 int DIRST% 104000 000041 int GOTX 000000 ext NUMTRY 000000 ext ALLFLD 000000 ext DISMS% 104000 000167 int GTAD% 104000 000227 int NXTJFN 000000 ext ATMBLN 000000 ext DOBE 104000 000104 int GTDAL% 104000 000305 int ODELAY 000000 ext ATMBUF 000000 ext DV%AV 010000 000000 sin GTFDB 104000 000063 int ODTIM% 104000 000220 int BADMSK 113777 176377 spd DV%DIR 100000 000000 sin GTFDB% 104000 000063 int OF%BSZ 770000 000000 sin BCTONE 000000 ext DV%IN 200000 000000 sin GTJFN 104000 000020 int OF%RD 200000 sin BOUT 104000 000051 int DV%MDD 020000 000000 sin GTJFN% 104000 000020 int OPENF 104000 000021 int BYTCNT 000000 ext DV%MOD 177777 sin HALTF% 104000 000170 int OT%4YR 010000 000000 sin CALL 260740 000000 DV%OUT 400000 000000 sin IFLG 000000 ext OTIMOU 000000 ext CALLRE 254000 000000 spd DV%PSD 400000 sin ILLX02 601775 int P 000017 CAPAS 000000 ext DV%TYP 000777 000000 sin INILIN 000000 ext P1 000011 spd CARIER 000000 ext DVCHR% 104000 000117 int ISNULJ 000000 ext P2 000012 spd CAXZOF 000000 ext ELPTIM 000000 ext JFNS 104000 000030 int P3 000013 spd CCOFF 000000 ext ENDTIM 000000 ext JFNS% 104000 000030 int P4 000014 spd CCON 000000 ext EPCAP 104000 000151 int JOBTAB 000000 ext P5 000015 spd CFIELD 000000 ext ERJMP 320700 000000 int JS%DEV 700000 000000 sin PAGCNT 000000 ext CFMRTN 000000 ext ERJMPR 320500 000000 int JS%DIR 070000 000000 sin PARS1 000000 ext CFORK 104000 000152 int ERJMPS 320600 000000 int JS%GEN 000070 000000 sin PARS2 000000 ext CHKAC% 104000 000521 int ERRPTR 000000 ext JS%NAM 007000 000000 sin PARS3 000000 ext CJFNBK 000000 ext ERSTR 104000 000011 int JS%PAF 000001 sin PARS4 000000 ext CLOSF 104000 000022 int ERSTR% 104000 000011 int JS%SPC 111110 000001 sin PARS5 000000 ext CLRBUF 000000 ext ESOUT% 104000 000313 int JS%TMP 040000 sin PARS6 000000 ext CLRCNO 000000 ext ETEXT 000000 ext JS%TYP 000700 000000 sin PBOUT 104000 000074 int CLREAD 000000 ext EXPUNG 000000 ext KFORK 104000 000153 int PBOUT% 104000 000074 int CLZFF 104000 000034 int EXTSEC 000001 spd LGOUT% 104000 000003 int PKTACS 000000 ext CLZFF% 104000 000034 int F 000000 spd LOCAL 000000 ext PKTNUM 000000 ext CM%ABR 000004 sin F$EXIT 000000 ext LOGJFN 000000 ext PSOUT 104000 000076 int CM%FNC 777000 000000 sin FB%BSZ 007700 000000 sin LSTRX1 601405 int PSOUT% 104000 000076 int CM%FW 002000 000000 sin FDRMXW 000141 spd MAXDAT 000000 ext PTYFLG 000000 ext CM%HPP 000004 000000 sin FILBFZ 000000 ext MAXTRY 000000 ext PTYTTY 000000 ext CM%INV 000001 sin FILBUF 000000 ext MDMLIN 000000 ext PUTBUF 000000 ext CM%SDH 000001 000000 sin FILJFN 000000 ext MOVASC 000000 ext Q1 000005 spd CMDER1 000000 ext FPWMXW 000141 spd MOVSLJ 016000 000000 Q2 000006 spd CODE 000000 ext FRCLOS 000000 ext MXASCZ 000000 ext Q3 000007 spd COMNX1 601257 int GET 104000 000200 int MXFILW 000034 spd Q4 000010 spd CONST 000000 ext GETBUF 000000 ext MXPWLC 000047 spd Q5 000011 spd CRDATE 000000 ext GETER% 104000 000012 int MXPWLW 000010 spd R 000000 ext CRLF 000000 ext GJ%DEV 400000 000000 sin MYCAPS 000000 ext RC%AMB 020000 000000 sin CX 000016 GJ%DIR 100000 000000 sin NAK 000000 ext RC%EMO 000001 000000 sin CZ%NCL 040000 000000 sin GJ%FLG 000020 000000 sin NDXJFN 000000 ext RC%NMD 010000 000000 sin CZSEEN 000000 ext GJ%IFG 000100 000000 sin NETJFN 000000 ext RC%NOM 040000 000000 sin DATA 000000 ext GJ%NHV 002000 000000 sin NEXT 000000 ext RCDIR% 104000 000553 int DATBUF 000000 ext GJ%OLD 100000 000000 sin NNAK 000000 ext RCDIX3 601400 int DECODF 000000 ext GJ%SHT 000001 000000 sin NO%AST 010000 000000 sin RD%BEL 040000 000000 sin DELAY 000000 ext GJ%UHV 004000 000000 sin NO%COL 000177 000000 sin RD%BTM 000040 000000 sin DELF 104000 000026 int GJ%ULV 001000 000000 sin NO%LFL 100000 000000 sin RD%CRF 020000 000000 sin DELNF% 104000 000317 int GJ%UNT 200000 000000 sin NO%RDX 777777 sin RD%SUI 000100 000000 sin DEST 000000 ext GJ%VER 010000 000000 sin NOIRTN 000000 ext RDTTY 104000 000523 int DESX3 600152 int GJFX32 600114 int NOP 600000 000000 sin RESET% 104000 000147 int DEVST% 104000 000121 int GJINF 104000 000013 int NOUT 104000 000224 int RET 263740 000000 DF%EXP 200000 000000 sin GJINF% 104000 000013 int NOUT% 104000 000224 int RFIELD 000000 ext DF%NRJ 400000 000000 sin GN%DIR 000010 000000 sin NSICI 000000 ext RFMOD 104000 000107 int DIBE% 104000 000212 int GN%STR 000020 000000 sin NSIMX 000000 ext RFTAD% 104000 000533 int k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE RLJFN 104000 000023 int TTYNUM 000000 ext .P0713 630000 000000 sin RLJFN% 104000 000023 int TYPFIL 000000 ext .P0720 640000 000000 sin RPACK 000000 ext TYPNAM 000000 ext .P0727 650000 000000 sin RPAR 000000 ext VCHRCN 000000 ext .P0734 660000 000000 sin RPSIZ 000000 ext WFORK 104000 000163 int .P0736 610000 000000 sin RPTOT 000000 ext WHAKFP 000000 ext .PRIIN 000100 sin RRINIT 000000 ext XFLG 000000 ext .PRIOU 000101 sin RRSL2 000000 ext XJRSTF 254240 000000 int .PX7 610001 000000 spd RRSLIN 000000 ext XMOVEI 415000 000000 int .RHALF 777777 sin RSKP 000000 ext XSFM 254600 000000 int .RSCRE 000003 sin S 400000 000000 spd $RECVB 000000 ext .RSCRV 000001 sin SC%GTB 200000 000000 sin $RECVS 000000 ext .RSFET 000006 sin SC%LOG 040000 000000 sin $SENDS 000000 ext .RSWRT 000000 sin SCRLFT 000000 ext %%JSER 000000 ext .SAC 000016 SCVEC% 104000 000301 int %%KRMS 000000 ext .XSTKS 000000 ext SEOLCH 000000 ext %%SMSG 000000 ext SETER% 104000 000336 int %KERMS 000000 ext SETLOG 000000 ext %WTLOG 000000 ext SEVEC% 104000 000204 int .A16 000016 spd SFACS% 104000 000160 int .ACDIR 000000 sin SFMOD 104000 000110 int .ACJOB 000002 sin SFMOD% 104000 000110 int .ACPSW 000001 sin SFRKV 104000 000201 int .CHCRT 000015 sin SIN 104000 000052 int .CHLFD 000012 sin SINIT 000000 ext .CHNUL 000000 sin SIZEF% 104000 000036 int .CHRPT 000076 spd SOURCE 000000 ext .CHSPC 000040 sin SOUT% 104000 000053 int .CKAAC 000000 sin SPACK 000000 ext .CKACD 000002 sin SPAR 000000 ext .CKACN 000010 sin SPEED 000000 ext .CKAPR 000005 sin SPSIZ 000000 ext .CKAUD 000004 sin SPTOT 000000 ext .CMCFM 000010 sin SRVFLG 000000 ext .CMDEV 000016 sin SRVTIM 000000 ext .CMDIR 000011 sin STATE 000011 spd .CMFIL 000006 sin STATIM 000000 ext .CMFNP 000000 sin STDEV% 104000 000120 int .CMQST 000021 sin STIMOU 000000 ext .CMTOK 000023 sin STRBUF 000000 ext .CMTXT 000017 sin STRBZ 000000 ext .DVDES 600000 sin STRPTR 000000 ext .DVDSK 000000 sin SUBBP 000000 ext .DVDTA 000003 sin T1 000001 spd .DVNUL 000015 sin T2 000002 spd .FBBYV 000011 sin T3 000003 spd .FHSLF 400000 sin T4 000004 spd .GJALL 777775 sin TEXT 000000 ext .GJDEF 000000 sin TIMEIT 000000 ext .JIDNO 000003 sin TIMOFF 000000 ext .JILNO 000017 sin TLGJFN 000000 ext .JITNO 000001 sin TT%ECO 004000 sin .JIUNO 000002 sin TT%OSP 400000 000000 sin .JSAOF 000001 sin TTXON 000000 ext .NULIO 377777 sin TTYJFN 000000 ext .P0706 620000 000000 sin k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT CODE ACABL 000003 spd EXPUNG 006011' ext NUMTRY 005332' ext STATIM 005150' ext ALLFLD 005545' ext F$EXIT 003622' ext NXTJFN 005617' ext STATXT 006565' ext APPTXT 006113' FFJFGD 005725' ODELAY 003610' ext STIMOU 003613' ext ATMBLN 000000 ext FFUNC 004722' ext OTIMOU 003612' ext STRBUF 006524' ext ATMBUF 006523' ext FILBFZ 000000 ext PAGCNT 005721' ext STRBZ 003731' ext BADEVC 001322' FILBUF 006463' ext PARS1 000077' ext STRPTR 005160' ext BCTONE 005334' ext FILINF 005632' PARS3 005105' ext SUBBP 004373' ext BIGSOU 003662' ext FILIST 002235' PARS4 004770' ext SYSNAM 003212' ext BYTCNT 002256' ext FILJFN 005611' ext PARS5 001641' ext TAKDEP 005134' ext CAPAS 005037' ext FJFNSF 111100 000001 spd PKTACS 005324' ext TAKJFN 000334' ext CARIER 003235' ext FRCLOS 005623' ext PKTNUM 005333' ext TIMEIT 003567' ext CAXZOF 005270' ext GETARG 003725' PTYFLG 003572' ext TIMOFF 003606' ext CCOFF 005325' ext GETBUF 005163' ext PTYTTY 003574' ext TLGJFN 004703' ext CCON 005151' ext GETCM2 003222' PUTBUF 005321' ext TTXON 006552' ext CFIELD 002456' ext GETCMM 003217' PUTSCH 003713' ent TTYJFN 003571' ext CFMRTN 004763' ext GETCOM 003157' ent PUTTCH 003715' ent TTYNUM 003167' ext CJFNBK 006574' ext GETPAS 000312' PWCONP 000653' TYPFIL 003106' ext CLENUP 003621' ext GOTS 005464' ext R 005764' ext TYPNAM 003055' ext CLRBUF 005335' ext GOTX 005416' ext RFIELD 004746' ext UDJINF 000305' ent CLRCNO 003050' ext GTNERR 005603' RPACK 005214' ext VCHRCN 000021' ext CLREAD 000014' ext GTNFIL 005525' ent RPAR 003676' ext WHAKFP 003123' ext CMDER1 005014' ext GTSCH 003704' ent RPTOT 003241' ext XFLG 004731' ext CRDATE 005723' ext GTSCHX 003706' RRINIT 003367' ext XGCDUP 004267' CRLF 006443' ext GTSCHZ 003710' RRSL2 005327' ext XGCWD 003757' CRLFCH 001764' HLPNTR 000000 ext RRSLIN 003607' ext XGCWD2 003770' CWDEVE 000635' IFLG 005360' ext RSKP 006003' ext XGCWD3 004021' CZSEEN 005536' ext INILIN 005141' ext SCRLFT 004711' ext XGCWD4 004121' DATBUF 006556' ext ISDIRD 005474' ent SCRUBP 000500' XGCWD5 004133' DECODF 003376' ext ISNULJ 005474' ext SDELBK 004644' XGCWDZ 004146' DEFDIR 000174' JOBTAB 000000 ext SDIRB2 004513' XGDEL 004656' DELAY 003611' ext LOCAL 005326' ext SDIRBK 004632' XGDEL2 004666' DELEPI 006031' MAXDAT 005162' ext SEOLCH 002477' ext XGDIR 004525' DELERR 006067' MAXTRY 005176' ext SETLOG 005337' ext XGDIR2 004550' DELFIL 006004' MDMLIN 003234' ext SINFO 005331' ent XGDIS2 004232' DEST 005323' ext MOVASC 002146' ext SINFO2 005342' XGDISK 004175' DIRCH 004474' ent MOVCHR 002216' int SINFOX 005356' XGDISZ 004261' DIRCH2 004477' MXASCZ 000000 ext SINFOZ 005360' XGEN 003436' DIRCHX 004506' MYCAPS 000000 ext SINIT 005344' ext XGFIN 003520' DIRCHZ 004510' NAK 003271' ext SOURCE 005304' ext XGFIN2 003546' DIRHDR 001766' NDXJFN 005625' ext SPACK 005211' ext XGHEL1 004463' DIRLST 002033' NETJFN 003570' ext SPAR 005350' ext XGHELP 004447' DIRLSZ 002165' NEXT 005161' ext SPEED 003173' ext XGLOG1 003607' DMPBE1 006240' NNAK 005143' ext SPSIZ 004404' ext XGLOGO 003562' DMPBE2 006246' NOIRTN 004740' ext SPTOT 003240' ext XGNYI 003515' DMPBE3 006251' NSICI 000017' ext SRVCM2 005175' XGPWD 004353' DMPBF1 006157' NSIMX 000024' ext SRVCMA 005156' XGSTAT 004426' DMPBF2 006162' NSITC 000022' ext SRVCMD 005134' XGTYPE 003632' DMPBF3 006171' NTIMOU 005144' ext SRVCMX 005267' XGUNDF 003512' DMPBFE 006176' NUL4 001762' int SRVCMZ 005307' XHLPTR 000000000000# pol DMPBUF 006144' ent NULDEV 001761' SRVFI3 005377' XHOST 003430' DOSRV 005406' ent NULDIR 002206' SRVFIL 005362' XINFO 003672' DOSRV3 005462' NULFDB 005630' SRVFLG 006164' ext XRECV 003374' ELPTIM 005272' ext NULFIL 002214' SRVHLP 000000 ext XRECV2 003406' ENDTIM 005271' ext NULINF 005720' SRVTIM 003246' ext XSEND 003356' ERRPTR 005471' ext NULIST 002220' SRVXX 005136' XXCMD 003305' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT CODE XXGCMD 003457' ..0166 000141' spd ..0727 001716' spd ..1327 002733' spd XXINV 003343' ..0173 000156' spd ..0730 001752' spd ..1330 002734' spd XXMSG 003345' ..0201 000166' spd ..0736 001731' spd ..1341 002755' spd XXUNK 003340' ..0216 000240' spd ..0737 001735' spd ..1347 002762' spd XXWAIT 003234' ..0217 000252' spd ..0747 001755' spd ..1357 003007' spd YDIRER 001647' ..0220 000251' spd ..0750 001760' spd ..1360 003043' spd $BYE 000004' ent ..0236 000253' spd ..0751 002027' spd ..1365 003016' spd $BYEZ 000050' ..0237 000260' spd ..0756 002030' spd ..1366 003043' spd $FINIS 002422' ent ..0243 000303' spd ..0763 002005' spd ..1374 003035' spd $RECVB 005466' ext ..0253 000320' spd ..0764 002026' spd ..1405 003045' spd $RECVS 003371' ext ..0264 000327' spd ..0770 002026' spd ..1406 003122' spd $SENDS 004732' ext ..0272 000362' spd ..1002 002061' spd ..1413 003064' spd $SRVT 004441' ext ..0316 000435' spd ..1003 002066' spd ..1414 003106' spd $XCDUP 001227' ..0326 000452' spd ..1004 002133' spd ..1422 003074' spd $XCWD 001015' ..0332 000476' spd ..1016 002100' spd ..1432 003130' spd $XDELE 001332' ..0347 000510' spd ..1017 002133' spd ..1440 003154' spd $XDIRE 002313' ..0360 000537' spd ..1020 002133' spd ..1447 003154' spd $XDISK 002614' ..0362 000561' spd ..1027 002126' spd ..1452 003207' spd $XERR 002352' ..0377 000622' spd ..1034 002133' spd ..1466 003206' spd $XHELP 002434' ..0400 000625' spd ..1037 002152' spd ..1507 003250' spd $XHOST 002460' ..0414 000676' spd ..1044 002156' spd ..1510 003274' spd $XPWD 002537' ..0415 000677' spd ..1052 002164' spd ..1515 003270' spd $XSTAT 002634' ..0424 000721' spd ..1060 002201' spd ..1516 003274' spd $XTYPE 003131' ..0426 000734' spd ..1061 002203' spd ..1534 003423' spd $YCDUP 001111' ent ..0434 000763' spd ..1074 002246' spd ..1544 003542' spd $YCWD 000520' ent ..0442 001012' spd ..1075 002251' spd ..1551 003544' spd $YCWDX 000570' ..0454 001036' spd ..1076 002274' spd ..1557 003604' spd $YCWDY 000575' ..0455 001037' spd ..1103 002277' spd ..1564 003606' spd $YCWDZ 000605' ..0463 001037' spd ..1110 002303' spd ..1575 003670' spd $YDELE 001251' ent ..0464 001043' spd ..1111 002305' spd ..1604 003670' spd $YDIR1 001752' ..0465 001063' spd ..1116 002312' spd ..1613 003667' spd $YDIRE 001710' ent ..0500 001054' spd ..1120 002336' spd ..1620 003742' spd $YDISK 002546' ent ..0501 001060' spd ..1127 002336' spd ..1621 003751' spd $YPWD 002516' ent ..0510 001105' spd ..1136 002365' spd ..1631 004017' spd $YRUN 005015' ent ..0524 001127' spd ..1137 002373' spd ..1636 004021' spd $YRUN2 005110' ..0525 001136' spd ..1145 002402' spd ..1645 004064' spd $YSRVT 002623' ent ..0526 001150' spd ..1146 002406' spd ..1650 004060' spd $YTYPE 002773' ent ..0540 001177' spd ..1153 002446' spd ..1656 004043' spd $YTYPY 003122' ..0567 001250' spd ..1162 002446' spd ..1657 004047' spd $YTYPZ 003125' ..0575 001266' spd ..1167 002471' spd ..1664 004062' spd %%JSER 006243' ext ..0576 001322' spd ..1175 002471' spd ..1665 004064' spd %%KRMS 004676' ext ..0577 001264' spd ..1213 002473' spd ..1666 004070' spd %%SMSG 004231' ext ..0612 001301' spd ..1214 002477' spd ..1730 004217' spd %KERMS 004662' ext ..0613 001305' spd ..1237 002567' spd ..1731 004222' spd %WTLOG 004712' ext ..0620 001355' spd ..1240 002574' spd ..1761 004311' spd ..0107 000014' spd ..0627 001355' spd ..1255 002646' spd ..1762 004320' spd ..0110 000040' spd ..0642 001456' spd ..1264 002646' spd ..1763 004337' spd ..0111 000034' spd ..0650 001474' spd ..1275 002716' spd ..2010 004441' spd ..0132 000070' spd ..0656 001474' spd ..1276 002717' spd ..2017 004441' spd ..0140 000101' spd ..0664 001552' spd ..1304 002701' spd ..2022 004462' spd ..0146 000114' spd ..0672 001627' spd ..1305 002715' spd ..2031 004462' spd ..0147 000147' spd ..0700 001643' spd ..1313 002714' spd ..2034 004542' spd ..0154 000125' spd ..0711 001664' spd ..1314 002715' spd ..2052 004577' spd ..0155 000144' spd ..0712 001666' spd ..1321 002726' spd ..2062 004616' spd ..0165 000137' spd ..0717 001701' spd ..1322 002770' spd ..2071 004616' spd k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT CODE ..2104 004720' spd .XCWD 000701' ..2113 004720' spd .XCWD1 000773' ..2125 004754' spd .XDISK 002610' ..2133 004772' spd .XERR 002341' ..2157 005077' spd .XHELP 002430' ..2160 005110' spd .XHOST 002453' ..2220 005241' spd .XPWD 002533' ..2230 005302' spd .XSTAT 002630' ..2236 005324' spd .XSTKS 005735' ext ..2244 005352' spd .YCDP1 001066' ..2253 005373' spd .YCDUP 001065' ent ..2254 005377' spd .YCWD 000052' ent ..2256 005461' spd .YDELE 001232' ent ..2263 005436' spd .YDIRE 001360' ent ..2264 005441' spd .YDISK 002542' ent ..2271 005455' spd .YPWD 002512' ent ..2272 005460' spd .YRUN 004735' ent ..2277 005467' spd .YTYPE 002651' ent ..2310 005500' spd ..2317 005510' spd ..2320 005511' spd ..2321 005524' spd ..2333 005534' spd ..2341 005555' spd ..2342 005561' spd ..2347 005572' spd ..2350 005601' spd ..2356 005600' spd ..2360 005612' spd ..2366 005620' spd ..2374 005626' spd ..2411 005660' spd ..2412 005720' spd ..2422 005715' spd ..2423 005733' spd ..2444 006001' spd ..2445 006002' spd ..2452 006011' spd ..2454 006025' spd ..2461 006031' spd ..2462 006024' spd ..2474 006047' spd ..2475 006063' spd ..2501 006171' spd ..IFT 004000 000001 spd ..JX1 004000 000000 spd ..MX1 100120 000000 spd ..MX2 000001 spd ..TX1 004000 000000 spd ..TX2 000001 spd .BYE 000000' ent .FINIS 002416' ent .RMFIL 001325' .STAT 002617' ent .XCDUP 001223' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT CONST DELBK 000141' DELBKL 000010 spd DIRBK 000164' DIRBKL 000010 spd LOCTAB 000000' int NULEND 000014 NULENT 000003 NULMSG 000016 NULPRG 000342' REMTAB 000020' int RMFFDB 000155' RUNBK 000320' RUNBKL 000010 spd TYPBK 000261' TYPBKL 000010 spd TYPFDB 000271' WLDFIL 000174' WLDMAX 000013 spd XCWFDB 000103' XERFDB 000224' XHOFDB 000237' XPWFDB 000114' YCUFDB 000126' YCWFDB 000044' YDEFDB 000151' YDIFDB 000176' YPWFDB 000060' YRRFDB 000332' YRUFDB 000330' ..XX 010004 000000 spd k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT TEXT DELFA 000127' GENTXT 000130' PWDPRM 000124' k20srv - Kermit-20 High Level Server and Associated Local Commands MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-8 K20SRV MAC 9-Aug-24 12:55 SYMBOL TABLE FOR PSECT DATA CDHACK 000000' CWDBUF 001450' DIRBUF 000002' DIRFIN 000306' FILBUF 000304' ext FILCNT 000305' FILPTR 000304' GCLEN 000307' GETPTR 000345' PASBUF 000143' RUFORK 000310' SRVBUF 000347' SRVBZ 001347' SRVBZZ 001447' SRVPTR 000346' TMPJFN 000001' XXBLEN 000041 spd XXBMSG 000311' XXGNLN 000043 spd XXGNMS 000320' XXGULN 000037 spd XXGUMS 000330' XXULEN 000034 spd XXUMSG 000337' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20SUB MAC 20-Aug-24 02:18 Preliminaries 43564 title k20sub - Kermit-20 Semantic Action and Support Subroutines 43565 remark Moved to seperate module as part of 194 to address MCRNEC 43566 43567 subttl Preliminaries 43568 43569 search monsym,macsym,k20unv 43570 cmdacs ^ ;Clean up p1-p4 definitions 43571 .xcmsy ^ ;Ditch MACSYM nonsense 43572 43573 sall ; Tidy listing 43574 .directive flblst ; We don't need to see all the ASCIZ bytes... 43575 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20SUB MAC 20-Aug-24 02:18 common parsing external data 43576 subttl common parsing external data 43577 43578 extern pars1 ; Data from first parse. 43579 extern pars2 ; Data from second parse. 43580 extern pars3 ; Data from third parse. 43581 extern pars4 ; Data from fourth parse. 43582 extern pars5 ;[41] ... 43583 43584 remark cmd storage 43585 43586 extern cjfnbk ; Actually in CMD.MAC 43587 extern atmbuf ; Atom buffer, in CMD.MAC 43588 extern sbk ; State Block 43589 43590 remark file related storage 43591 43592 extern filjfn ; Current file 43593 extern nxtjfn ; Next file in sequence 43594 extern ndxjfn ; Stepping JFN (with flags) 43595 extern strbuf ; String buffer (to build things in, Etc.) 43596 43597 remark Terminal and other JFN's 43598 43599 extern ttyjfn ; JFN on local terminal 43600 extern $PRIOU ;[220] Whatever we think primary output should be 43601 extern udjinf ;[220] Updates jobtab for use by this routine 43602 extern tlgjfn ; Transaction log JFN 43603 43604 remark other stuff 43605 43606 extern czseen ; ^Z seen (typed) 43607 extern crlf ; Carriage Return, Linefeed string 43608 extern nul4 ; Pointer to NUL: string and length 43609 extern allfld ;[252] ; Punctuated all fields for JFNS% 43610 extern scrlft ;[233] ; Set to -1 to suppress trailing CRLF in transaction log 43611 extern jobtab ; My job information 43612 43613 extern errptr ; Error message pointer 43614 extern pktnum ;[234] ; Packet number 43615 extern spack ;[234] ; Send a packet 43616 extern spsiz ;[234] ; Sending packet size 43617 extern subbp ;[234] ; 'Subtract' two byte pointers 43618 extern %%krbf ;[234] ; Buffer to construct an error pack 43619 43620 .psect code/ronly ;[190] Don't allow stores 43621 43622 ; To do: Needs a double float (dfltr) 43623 ; 43624 ; Could do the fltr, then extract the exponent and use it to do 43625 ; an ashc on the double word. 43626 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20SUB MAC 20-Aug-24 02:18 Support routines for error handling macros. 43627 subttl Support routines for error handling macros. 43628 43629 ;[234] Moved here from K20MIT.MAC 43630 43631 ; KERMSG -- Send an error message to the KERMIT on the other side in an 43632 ; error packet. Invoked from %JSKER, with T1 pointing at the user-provided 43633 ; prefix (if any), to which the JSYS error message is appended. 43634 ; 43635 ; As part of [194], rewritten to offload most the macro expansion and 43636 ; do more of the work here. Saves some memory by not always duplicating 43637 ; the KERMIT-20: prefix 43638 ; 43639 ; Called 43640 ; 43641 ; jsp t1,%%krms 43642 ; 43643 ; t1 offsets: 43644 ; 43645 ; +0: Address of ASCII text or zero 43646 ; +1: Jump address or zero 43647 ; +2: Return address (implied) 43648 43649 000000'01 blanks: xlist ; We don't need to see all the .chspc's... 43650 list 43651 000030 blankl==<.-blanks> ; Length of blank array 43652 43653 000030'01 000000 000000' krxblt: blanks ; Source block of memory 43654 000031'01 000000000000# %%krbf ; Destination block 43655 000032'01 44 07 0 00 000000* krxptr: point 7, %%krbf ; Pointer to (scrubbed) buffer 43656 43657 000033'01 44 07 0 00 000273' k20ptr: point 7, k20hdr ; Point to header text 43658 000034'01 000000 000013 ^d11 ; Length of header 43659 43660 000035'01 %%krms: entry %%krms ;[213] Declare for the world 43661 000035'01 415 16 0 00 000131' block. ; Enter block context for a stack frame 43662 000036'01 261 17 0 00 000016 43663 000037'01 265 16 0 00 004127' saveac ;Get some registers to enjoy ourselves with 43664 000040'01 200 05 0 00 000001 move q1, t1 ; Save argument/return pointer 43665 43666 000041'01 201 01 0 00 000030 movei t1, blankl ; Set up XBLT block 43667 000042'01 120 02 0 00 000030' dmove t2, krxblt 43668 000043'01 123 01 0 00 004143' xblt. t1 ; Scrub the buffer with blanks 43669 43670 000044'01 200 01 0 00 000032' move t1, krxptr ; Load pointer to scrubbed buffer 43671 000045'01 120 03 0 00 000033' dmove t3,k20ptr ; Load pointer to header text 43672 remark t4,count ; Length of same 43673 000046'01 200 06 0 00 000004 move q2, t4 ; Begin length of message 43674 43675 000047'01 do. ; Enter loop lexical context 43676 000047'01 134 02 0 00 000003 ildb t2, t3 ; Pick up a byte 43677 000050'01 136 02 0 00 000001 idpb t2, t1 ; Deposit it 43678 000051'01 367 04 0 00 000047' sojg t4, top. ; Do all of them 43679 000052'01 enddo. ; Fall out of loop lexical context 43680 43681 000052'01 337 03 0 05 000000 skipg t3,0(q1) ; Load and double check string address k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20SUB MAC 20-Aug-24 02:18 Support routines for error handling macros. 43682 000053'01 254 00 0 00 000065' ifskp. ; Got passed something 43683 000054'01 do. ; and copy the characters over 43684 000054'01 134 02 0 00 000003 ildb t2, t3 ; Get the byte. 43685 000055'01 322 02 0 00 000060' jumpe t2, endlp. ; Exit if a null 43686 000056'01 136 02 0 00 000001 idpb t2, t1 ; Deposit the byte. 43687 000057'01 344 06 0 00 000054' aoja q2, top. ; Loop and increment tally 43688 000060'01 enddo. ; Never falls out; explicit exit 43689 ; Tack on " - " 43690 000060'01 120 02 0 00 004144' dmove t2, [exp .chspc, .chdas] 43691 000061'01 136 02 0 00 000001 idpb t2, t1 ; Append the space 43692 000062'01 136 03 0 00 000001 idpb t3, t1 ; Append the dash 43693 000063'01 136 02 0 00 000001 idpb t2, t1 ; Append the space after that 43694 000064'01 271 06 0 00 000003 addi q2, ^d3 ; Account for three more characters 43695 000065'01 endif. 43696 43697 remark t1, ; Put the Tops-20 error string into the buffer. 43698 000065'01 525 02 0 00 400000 hrloi t2, .fhslf ; Say: this fork ,, last error. 43699 000066'01 210 03 0 00 000000* movn t3, spsiz ; Specify the maximum to send as a negative 43700 000067'01 270 03 0 00 000006 add t3, q2 ; number (don't overflow the buffer) 43701 000070'01 517 00 0 00 000003 hrlzs t3 ;[74] (ERSTR wants -n,,0) 43702 000071'01 325 03 0 00 000102' ifl. t3 ;[50] (don't bother if not negative). 43703 000072'01 104 00 0 00 000011 ERSTR% 43704 000073'01 320 14 0 00 000075' erjmps .+2 ; Ignore its strange return 43705 000074'01 320 14 0 00 000075' erjmps .+1 ; Ignore its stranger return 43706 000075'01 200 02 0 00 000001 move t2, t1 ; Set up to get the new length. 43707 000076'01 200 01 0 00 000032' move t1, krxptr ; Load pointer to partially filled buffer 43708 000077'01 260 17 0 00 000000* call subbp ; Subtract byte pointers. 43709 000100'01 254 00 0 00 000102' anskp. ;[40] If there is an error assume this count. 43710 remark ; Worked, so don't hit the else. 43711 000101'01 254 00 0 00 000103' else. ; Otherwise... 43712 000102'01 200 03 0 00 000006 move t3, q2 ; Don't trust ERSTR% 43713 000103'01 endif. ; End case fence post checking 43714 43715 000103'01 313 03 0 00 000066* camle t3, spsiz ;[40] Longer than we're supposed to send? 43716 000104'01 200 03 0 00 000103* move t3, spsiz ;[40] If so, truncate it. 43717 000105'01 260 17 0 00 000161' call overhd ;[276] Possibly fix up t3 43718 000106'01 200 06 0 00 000003 move q2, t3 ; Save whatever the length is 43719 000107'01 201 01 0 00 000105 movei t1, "E" ; An error packet. 43720 000110'01 200 02 0 00 000000* move t2, pktnum ; Packet number. 43721 000111'01 200 04 0 00 000032' move t4, krxptr ; Load pointer to finished buffer 43722 000112'01 260 17 0 00 000000* call spack ; Send the error packet. 43723 000113'01 600 00 0 00 000000 nop 43724 43725 000114'01 332 00 0 00 000000* ifme. srvflg ;[234] ; If a server, NOT safe to type 43726 000115'01 254 00 0 00 000127' 43727 000116'01 200 01 0 00 000032' move t1, krxptr ; Load pointer to finished buffer 43728 000117'01 200 02 0 00 000006 move t2, q2 ; Load final character count 43729 000120'01 133 02 0 00 000001 adjbp t2, t1 ; Go to end of character string 43730 000121'01 120 03 0 00 004146' dmove t3, [ exp .chcrt, .chlfd ] 43731 000122'01 136 03 0 00 000002 idpb t3, t2 ; Drop in a CR-LF 43732 000123'01 136 04 0 00 000002 idpb t4, t2 43733 000124'01 400 03 0 00 000000 setz t3, ; Cons up a NUL 43734 000125'01 136 03 0 00 000002 idpb t3, t2 ; Tie off the string 43735 000126'01 104 00 0 00 000313 ESOUT% ; Finally whine about our problems 43736 000127'01 endif. ;[234] ; End case local output k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-2 K20SUB MAC 20-Aug-24 02:18 Support routines for error handling macros. 43737 000127'01 200 01 0 05 000001 move t1, 1(q1) ; Now handle some kind of a return 43738 000130'01 263 17 0 00 000000 endbk. ; Restore registers, tear down the stack 43739 43740 000131'01 326 01 0 01 000000 jumpn t1, (t1) ; Go somewhere, if told to 43741 000132'01 104 00 0 00 000170 HALTF% ; Cease execution 43742 000133'01 263 17 0 00 000000 ret ; Try to return to caller if continued k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 4 K20SUB MAC 20-Aug-24 02:18 Support routines for error handling macros. 43743 43744 ; Support for kermsg. Written for maximum reduction of kermsg() macro 43745 ; 43746 ; All part of [194] 43747 43748 000134'01 %kerms: entry %kerms ; Globally available 43749 000134'01 261 17 0 00 000012 push p, p2 ; Save p2 (not aliased) 43750 000135'01 200 12 0 00 000001 move p2, t1 ; Save return and argument address 43751 000136'01 201 01 0 00 000105 movei t1, "E" ; Send an error packet to the other side. 43752 000137'01 200 02 0 00 000110* move t2, pktnum ; Packet number. 43753 000140'01 120 03 0 12 000000 dmove t3, (p2) ; Pick up count and text address 43754 000141'01 260 17 0 00 000161' call overhd ;[276] ; Don't overflow the error packet 43755 000142'01 202 04 0 00 000000* movem t4, errptr ; Save pointer to error msg for status. 43756 000143'01 260 17 0 00 000112* call spack ; Send the error packet. 43757 000144'01 600 00 0 00 000000 nop 43758 000145'01 336 00 0 00 000114* ifmn. srvflg ;[234] ; If local, safe to type 43759 000146'01 254 00 0 00 000155' 43760 000147'01 561 01 0 00 000273' hrroi t1, k20hdr ; Load start of message 43761 000150'01 104 00 0 00 000313 ESOUT% ;[187] ; Begin whining 43762 000151'01 200 01 0 12 000001 move t1, 1(p2);[202] ; Same message 43763 000152'01 104 00 0 00 000076 PSOUT% ; Type that, too 43764 000153'01 561 01 0 00 000000* hrroi t1, crlf ; Tie off the line 43765 000154'01 104 00 0 00 000076 PSOUT% 43766 000155'01 endif. ;[234] ; End case local output 43767 000155'01 200 01 0 00 000012 move t1, p2 ; Restore calling t1 43768 000156'01 262 17 0 00 000012 pop p, p2 ; Restore p2 43769 000157'01 271 01 0 00 000002 addi t1,^d2 ; Skip past both arguments 43770 000160'01 254 00 0 01 000000 jrst (t1) ; Finally done 43771 43772 ;[234] End move from K20MIT.MAC 43773 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 5 K20SUB MAC 20-Aug-24 02:18 overhd -- Returns expected overhead characters in a packet 43774 subttl overhd -- Returns expected overhead characters in a packet 43775 43776 ;[276] Begin code insertion 43777 ; 43778 ; Used to support error reporting. For EXTREMELY small packets, the 43779 ; length of the error text can exceed the size of the packet. Therefore, 43780 ; we calculate the expected overhead for the packet and subtract that 43781 ; from the maximum error text we will allow. 43782 ; 43783 ; If we don't do this, then spack will dutifully detect a packet 43784 ; overflow error and then try to report that with a packet that is 43785 ; still too long and around we'll go again until we get a stack 43786 ; overflow. 43787 ; 43788 ; N.B., The routine makes the (perhaps innocent) assumption that 43789 ; NOTHING in the error packet is going to need quoting (such as 43790 ; a control character or an IAC), so we can still wind up 43791 ; crashing. Be careful! 43792 ; 43793 ; Call: 43794 ; 43795 ; t3/ Current packet length 43796 ; 43797 ; Return: 43798 ; 43799 ; t3/ Possibly side effected 43800 43801 extern bctone ; K20MIT: Use type 1 for this packet regardless... 43802 43803 000161'01 265 16 0 00 004150' overhd: saveac ; Don't trash any other accumulator 43804 000162'01 201 01 0 00 000003 movei t1, ^d3 ; SOH+SEQ+TYPE 43805 000163'01 303 03 0 00 000136 caile t3, ^d94 ; Long packet? 43806 000164'01 271 01 0 00 000001 addi t1, ^d1 ; Requires an extra character overhead 43807 000165'01 332 00 0 00 000000* skipe bctone ; Forcing single-character checksum (like for an error)? 43808 000166'01 354 00 0 00 000001 aosa t1 ; Yes, then always use type 1. 43809 000167'01 270 01 0 00 000000* add t1, bctu ; Otherwise add the block check length. 43810 000170'01 200 02 0 00 000104* move t2, spsiz ; Load the maximum packet size 43811 000171'01 274 02 0 00 000003 sub t2, t3 ; Subtract off the size of the current packet 43812 000172'01 274 02 0 00 000001 sub t2, t1 ; and also our expected overhead 43813 000173'01 325 02 0 00 000175' ifl. t2 ; Will we overflow the packet? 43814 000174'01 274 03 0 00 000001 sub t3, t1 ; We will, so clip it down further 43815 000175'01 endif. ; Otherwise, should be safe to send 43816 000175'01 263 17 0 00 000000 ret ; Cross our fingers and hope for the best 43817 43818 ;[276] End code insertion 43819 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 6 K20SUB MAC 20-Aug-24 02:18 Macro support routines 43820 subttl Macro support routines 43821 43822 ; JSERR0 synchronizes with terminal i/o in progress before typing the 43823 ; JSYS error message. 43824 ; 43825 ; JSMSG0 just types the JSYS error message. 43826 ; 43827 ; These names where changed in order to not conflict with routines of the 43828 ; same name in MACSYM (MACREL). Also removed CFIBF% and DOBE% as part of 43829 ; edit 187 as ESOUT% does this. 43830 ; 43831 ; No macro should EVER invoke these directly 43832 43833 000176'01 561 01 0 00 004160' kserr0: tmsg < - > ; Type a dash. 43834 000177'01 104 00 0 00 000076 43835 43836 000200'01 ksmsg0: remark ; Alternate entry 43837 000200'01 201 01 0 00 000101 movei t1,.priou 43838 000201'01 525 02 0 00 400000 hrloi t2,.fhslf ; This fork ,, last error. 43839 000202'01 400 03 0 00 000000 setz t3, 43840 000203'01 104 00 0 00 000011 ERSTR% 43841 000204'01 320 12 0 00 000206' erjmpr .+2 43842 000205'01 320 12 0 00 000206' erjmpr .+1 43843 000206'01 263 17 0 00 000000 ret 43844 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7 K20SUB MAC 20-Aug-24 02:18 Support for wtlog 43845 subttl Support for wtlog 43846 43847 ;[194] Begin Code Insertion 43848 43849 ; Rewritten for maximum reduction of expansion wtlog() macro 43850 43851 000207'01 %wtlog: entry %wtlog ; Globally available 43852 000207'01 260 17 0 00 000212' call %wtlgf ; Set up a logging frame 43853 000210'01 271 01 0 00 000003 addi t1, ^d3 ; Skip past the three arguments 43854 000211'01 254 00 0 01 000000 jrst (t1) ; Finally done 43855 ;[233] Needs plenty registers for intersection transfers 43856 000212'01 265 16 0 00 004161' %wtlgf: saveac ;[233] 43857 000213'01 621 01 0 00 777700 txz t1, klflgs ; Don't mess up addressing 43858 000214'01 200 05 0 00 000001 move q1, t1 ;[233] Save arguments accumulator 43859 000215'01 337 01 0 00 000000* skipg t1, tlgjfn ; Is the transaction log open? 43860 000216'01 263 17 0 00 000000 ret ; Nope, so nothing to do 43861 43862 ;;;; 43863 ;;;; cain t1, .nulio ;[193] Not really going to do anything? 43864 ;;;; ret ;[193] Fine, then don't really do anything 43865 43866 000217'01 474 02 0 00 000000 seto t2, ; Start with time stamp, current date/time. 43867 000220'01 205 03 0 00 400000 movx t3, ot%nda ; No date in stream 43868 000221'01 104 00 0 00 000220 ODTIM% 43869 000222'01 320 14 0 00 000223' erjmps .+1 ; Catch and suppress errors 43870 000223'01 201 02 0 00 000072 movei t2, ":" 43871 000224'01 104 00 0 00 000051 BOUT% 43872 000225'01 320 14 0 00 000226' erjmps .+1 43873 000226'01 201 02 0 00 000040 movei t2, .chspc 43874 000227'01 104 00 0 00 000051 BOUT% 43875 000230'01 320 14 0 00 000231' erjmps .+1 43876 43877 000231'01 120 02 0 05 000000 dmove t2, 0(t5) ; Load string pointer and length 43878 000232'01 322 02 0 00 000244' ifn. t2 ;[216] Load string and (negative) count 43879 000233'01 301 03 0 00 000000 cail t3,0 ;[216] Better be a negative number 43880 000234'01 254 00 0 00 000244' anskp. ;[216] But wasn't 43881 000235'01 254 14 0 00 000007 xsfm q3 ;[233] Get and store current processor flags 43882 000236'01 200 10 0 00 000000# move q4, bigsou ;[233] Load up inter-section transfer address 43883 000237'01 201 11 0 00 000241' movei q5, .+2 ;[233] And the inter-section return adress 43884 000240'01 254 05 0 00 000007 xjrstf q3 ;[233] and take a giant step! 43885 000241'01 201 02 0 00 000040 movei t2, .chspc 43886 000242'01 104 00 0 00 000051 BOUT% 43887 000243'01 320 14 0 00 000244' erjmps .+1 43888 000244'01 endif. 43889 43890 000244'01 337 03 0 05 000002 skipg t3, 2(t5) ;[216] Load a JFN, maybe 43891 000245'01 254 00 0 00 000264' ifskp. ; Some kind of an address 43892 000246'01 337 02 0 03 000000 skipg t2, (t3) ; Pick up the actual JFN 43893 000247'01 254 00 0 00 000264' anskp. ; Unless not holding one 43894 000250'01 302 02 0 00 377777 caie t2, .nulio ; Dumping it? 43895 000251'01 254 00 0 00 000256' ifskp. ; That's easy! 43896 000252'01 120 02 0 00 000000* dmove t2, nul4 ; Constant string and length 43897 000253'01 104 00 0 00 000053 SOUT% 43898 000254'01 320 14 0 00 000255' erjmps .+1 43899 000255'01 254 00 0 00 000261' else. ; Otherwise, it's a real file k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 7-1 K20SUB MAC 20-Aug-24 02:18 Support for wtlog 43900 000256'01 120 03 0 00 000000* dmove t3, allfld ; Type the entire specification 43901 000257'01 104 00 0 00 000030 JFNS% 43902 000260'01 320 14 0 00 000261' erjmps .+1 ; Catch and suppress error 43903 000261'01 endif. ; End NUL: special case 43904 000261'01 201 02 0 00 000040 movei t2, .chspc ;[233] 43905 000262'01 104 00 0 00 000051 BOUT% ;[233] 43906 000263'01 320 14 0 00 000264' erjmps .+1 ;[233] 43907 000264'01 endif. ; End case JFN handling 43908 43909 000264'01 356 00 0 00 000000* aosn scrlft ;[233] ; Wants to suppress trailing CRLF in transaction log? 43910 000265'01 263 17 0 00 000000 ret ;[233] ; Yes, so we're done 43911 43912 000266'01 561 02 0 00 000153* hrroi t2, crlf 43913 000267'01 120 03 0 00 004201' dmove t3,[ exp -2, 0] 43914 000270'01 104 00 0 00 000053 SOUT% 43915 000271'01 320 14 0 00 000272' erjmps .+1 43916 000272'01 263 17 0 00 000000 ret 43917 43918 ;[194] End Code Insertion 43919 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 8 K20SUB MAC 20-Aug-24 02:18 Support for %jserr. 43920 subttl Support for %jserr. 43921 43922 ;[194] Begin Code Insertion 43923 43924 ; Rewritten for maximum reduction of %jserr() macro 43925 ; 43926 ; N.B., If not given a label, the previous version of the macro would 43927 ; do a HALTF% allowing a continue. However, no code existed any 43928 ; longer which leveraged this functionality. It has been 43929 ; removed an replaced with returning +1 if no label is given as 43930 ; passing a +1 to the current macro will do the wrong thing 43931 43932 000273'01 k20hdr: intern k20hdr ; Used by other error routines in k20mit 43933 000273'01 113 105 122 115 111 asciz |KERMIT-20: | ; Start of any error message 43934 43935 000276'01 %%jser: entry %%jser ; Used in other parts of Kermit Planet 43936 000276'01 415 16 0 00 000327' block. ; Enter block context (build stack frame) 43937 000277'01 261 17 0 00 000016 43938 000300'01 265 16 0 00 004203' saveac ; Save a bunch of accumulators 43939 000301'01 621 01 0 00 777700 txz t1, klflgs ; Don't mess up addressing 43940 000302'01 200 12 0 00 000001 move p2,t1 ; Save return accumulator 43941 000303'01 561 01 0 00 000273' hrroi t1, k20hdr ; Load pointer to first part of error 43942 000304'01 104 00 0 00 000313 ESOUT% ;[187] Begin whining, compliantly 43943 000305'01 320 12 0 00 000306' erjmpr .+1 ; Catch and ignore error 43944 000306'01 336 01 0 12 000000 skipn t1, 0(p2) ; Pick up the text pointer 43945 000307'01 254 00 0 00 000314' ifskp. ; That is, if there is one 43946 000310'01 104 00 0 00 000076 PSOUT% ; Give us that bit of news... 43947 000311'01 320 12 0 00 000312' erjmpr .+1 ; Catch and ignore error 43948 000312'01 260 17 0 00 000176' call kserr0 ; Put JSYS error after dash, 43949 000313'01 254 00 0 00 000315' else. ; Otherwise, no need for the dash 43950 000314'01 260 17 0 00 000200' call ksmsg0 ; so right after "?KERMIT-20: " 43951 000315'01 endif. ; End case, auxiliary message 43952 000315'01 561 01 0 00 004217' tmsg < at: > ; Say where it happened. 43953 000316'01 104 00 0 00 000076 43954 000317'01 201 01 0 12 777775 movei t1, -3(p2) ; Calculate address of failing JSYS 43955 000320'01 621 01 0 00 777700 txz t1, klflgs ; Flags aren't part of the address 43956 000321'01 260 17 0 00 004067' call symout ; Type it symbolically 43957 000322'01 561 01 0 00 000266* hrroi t1,crlf ; And a trailing CR-LF. 43958 000323'01 104 00 0 00 000076 PSOUT% 43959 000324'01 320 12 0 00 000325' erjmpr .+1 ; Catch and ignore error 43960 000325'01 200 01 0 12 000001 move t1, 1(p2) ; Load a jump (or return) address 43961 000326'01 263 17 0 00 000000 endbk. ; Exit block context 43962 ; Tears down the stack frame 43963 000327'01 254 00 0 01 000000 jrst (t1) ; Go someplace and do something 43964 43965 .endps code ; Get out of section zero 43966 43967 ;[194] End Code Insertion 43968 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9 K20SUB MAC 20-Aug-24 02:18 %%smsg documentation and extended section code 43969 subttl %%smsg documentation and extended section code 43970 43971 ;[216] Begin code insertion 43972 ; 43973 ; SOUT% has a bug in certain cases when being passed OWGP's. Like other 43974 ; JSYi, OWGP's work fine for I/O. However, if you use SOUT% to move a 43975 ; string, then SOUT% will occasionally do the wrong thing. Fix by 43976 ; checking here if we have a JFN and, if so, doing the I/O. Otherwise 43977 ; we use MOVSLJ (which is faster than using SOUT% to move data, 43978 ; anyway) 43979 ; 43980 ; Read that last sentence again: incredibly, ALL of the hair with an 43981 ; inter-section call to do the MOVSLJ is FAR faster than the SOUT%! 43982 ; Read it again, it's whaaay faster. 43983 ; 43984 ; Of course, MOVSLJ has its own quirks... You would think that you 43985 ; could use a OWGP that references section zero while executing in any 43986 ; section (such as section zero). I mean it works for IPB, ADJBP, 43987 ; ILDB and IDPB, so what's the problem? MOVSLJ will *NOT* honor a 43988 ; section zero OWGP when executed in section zero! The non-section 43989 ; OWGP increments just fine and both counts decrement, but the section 43990 ; zero pointer is untouched... 43991 ; 43992 ; So we stick with local section zero pointers as the destination, 43993 ; always, hand cast to double pointers and then do an inter-section 43994 ; transfer so that the MOVSLJ will execute in a non-zero section. 43995 ; This is necessary because double word pointers are not honored by 43996 ; ANY code executing in section zero. 43997 ; 43998 ; Actually, SOUT% only works with non-section OWGP's when the output is 43999 ; the terminal. Output to the disk is garbled, but not consistently. 44000 ; So it has to do an inter-section call, too. Bug appears to be BYTBLT 44001 ; in the monitor that is not considering OWGP's from section zero. 44002 ; 44003 ; And, of course, BOUT% doesn't honor *ANY* kind of a OWGP in section 44004 ; zero. EVER... 44005 ; 44006 ; Entry: 44007 ; 44008 ; t1/ String pointer or I/O designator 44009 ; Any string pointer in t1 is expected to be a 44010 ; LOCAL string pointer in section zero space. 44011 ; t2/ ASCII OWGP to Extended Text .PSECT, always 44012 ; t3/ Negative length of string for faster SOUT%'s 44013 ; (If used) 44014 ; 44015 ; Returns: 44016 ; 44017 ; +1 always 44018 ; 44019 ; t1/ Updated, if local pointer 44020 ; t2/ Updated 44021 ; t3/ 0 44022 ; 44023 ; Strings are NUL terminated and ready for append k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 9-1 K20SUB MAC 20-Aug-24 02:18 %%smsg documentation and extended section code 44024 44025 .psect ecode/ronly ; movslj MUST be executed in a non-zero section!!! 44026 000000'02 016 00 0 00 000000 movmsg: movslj 0,0 ; Extended opcode 44027 000001'02 000000 000000 .chnul ; Fill character (never used) 44028 44029 000002'02 123 01 0 00 000000' extmov: extend t1, movmsg ; Copy the data 44030 000003'02 600 00 0 00 000000 nop ; Ignore non-skip (should never happen) 44031 000004'02 200 10 0 00 000011 move q4, q5 ; Load return address 44032 000005'02 254 05 0 00 000007 xjrstf q3 ; Return back downstairs, restore flags 44033 44034 000006'02 104 00 0 00 000053 extsou: SOUT% ; SOUT% from section 1 44035 000007'02 320 14 0 00 000010' erjmps .+1 ; Catch and suppress error 44036 000010'02 200 10 0 00 000011 move q4, q5 ; Load return address 44037 000011'02 254 05 0 00 000007 xjrstf q3 ; Return back downstairs, restoring flags 44038 .endps ecode ; Out of extended code 44039 44040 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10 K20SUB MAC 20-Aug-24 02:18 %%smsg documentation and extended section code 44041 subttl %%smsg documentation and extended section code 44042 44043 ; See above; arguments are expected to be suitable for a counted SOUT% 44044 44045 .psect const ; Constant pointers go in const 44046 000000'03 000001 000000# giant: extsec,,extmov ; 30 bit address of movslj 44047 000001'03 bigsou: entry bigsou ;[233] Allows k20mit to use 44048 000001'03 000001 000000# extsec,,extsou ; 30 bit address of SOUT% 44049 .endps const ; Close off constants 44050 44051 .psect code ; Back in section zero code 44052 44053 000330'01 %%smsg: entry %%smsg ; World callable 44054 44055 remark ; A minor efficiency hack 44056 000330'01 312 03 0 00 004221' came t3, [-1] ; Is this one dinky byte? 44057 000331'01 254 00 0 00 000340' ifskp. ; Then don't need all the baloney below 44058 000332'01 200 03 0 00 000002 move t3, t2 ; Get a copy of the source pointer 44059 000333'01 134 02 0 00 000003 ildb t2, t3 ; Load that single byte for BOUT% 44060 000334'01 260 17 0 00 000376' call BOUTI% ; Go put it somewhere 44061 000335'01 200 02 0 00 000003 move t2, t3 ; Restore updated source pointer 44062 000336'01 400 03 0 00 000000 setz t3, ; Stomp so looks like a return from SOUT% 44063 000337'01 263 17 0 00 000000 ret ; We're done 44064 000340'01 endif. 44065 44066 remark ; Otherwise, a multi-byte call 44067 000340'01 603 01 0 00 777777 tlne t1, -1 ; JFN will never have any flags 44068 000341'01 254 00 0 00 000350' ifskp. ; It's a JFN 44069 000342'01 265 16 0 00 004222' saveac ; Save linkage registers 44070 000343'01 254 14 0 00 000007 xsfm q3 ; Get and store the flags 44071 000344'01 200 10 0 00 000000# move q4, bigsou ; Load up inter-section transfer address 44072 000345'01 201 11 0 00 000347' movei q5, .+2 ; And the inter-section return adress 44073 000346'01 254 05 0 00 000007 xjrstf q3 ; Take a giant step 44074 000347'01 263 17 0 00 000000 ret ; Return, restoring registers 44075 000350'01 endif. ; End I/O case 44076 44077 remark ; See above; all this hair is faster than a SOUT% 44078 000350'01 265 16 0 00 004234' saveac ; Needs oinky registers 44079 000351'01 210 04 0 00 000003 movn t4, t3 ; movslj wants a positive length 44080 remark ; Cast local section zero to global long 44081 000352'01 510 05 0 00 000001 hllz q1, t1 ; Load destination pointer portion 44082 000353'01 661 05 0 00 000040 txo q1, GP%2WB ; Set the double word pointer bit 44083 000354'01 550 06 0 00 000001 hrrz q2, t1 ; Load address portion (section zero!!!) 44084 000355'01 200 01 0 00 000004 move t1, t4 ; Source length is the same 44085 remark t2, 0 ; Load source pointer (already there) 44086 000356'01 400 03 0 00 000000 setz t3, ; Single word source (OWGP) 44087 44088 000357'01 254 14 0 00 000007 xsfm q3 ; Get and store the flags 44089 000360'01 200 10 0 00 000000# move q4, giant ; Load up inter-section transfer address 44090 000361'01 201 11 0 00 000363' movei q5, %%sms1 ; And the inter-section return adress 44091 000362'01 254 05 0 00 000007 xjrstf q3 ; Take a giant step 44092 44093 000363'01 %%sms1: remark ; Our return address 44094 000363'01 260 17 0 00 003704' call d2sgpc ; Convert double source to single 44095 000364'01 600 00 0 00 000000 nop ; Ignore error; it will never happen here k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 10-1 K20SUB MAC 20-Aug-24 02:18 %%smsg documentation and extended section code 44096 000365'01 200 10 0 00 000001 move q4, t1 ; Store source single pointer 44097 remark ; Hand cast destination to section zero local 44098 000366'01 510 01 0 00 000005 hllz t1, q1 ; Pick up source pointer portion 44099 000367'01 621 01 0 00 000040 txz t1, GP%2WB ; Stomp the source double word pointer bit 44100 000370'01 540 01 0 00 000006 hrr t1, q2 ; Put in the section zero address and that's that 44101 000371'01 200 02 0 00 000010 move t2, q4 ; Load single source pointer 44102 44103 000372'01 200 04 0 00 000001 move t4, t1 ; Load a copy of the final destination 44104 000373'01 400 03 0 00 000000 setz t3, ; Return a zero count 44105 000374'01 136 03 0 00 000004 idpb t3, t4 ; Tie off the string, allow append 44106 44107 000375'01 263 17 0 00 000000 ret ; Phew!! Finally done 44108 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 11 K20SUB MAC 20-Aug-24 02:18 BOUT Internal 44109 subttl BOUT Internal 44110 44111 ; Just like BOUT% except doesn't die on a OWGP to a non-zero section. 44112 ; Doing the ildb bums a JSYS, anyway, so that's not the end of the world 44113 ; 44114 ; t1/ Destination designator 44115 ; t2/ Byte to be output, right-justified 44116 44117 000376'01 BOUTI%: entry BOUTI% ; World callible 44118 000376'01 603 01 0 00 777777 tlne t1, -1 ; Writing to a JFN, per chance? 44119 000377'01 254 00 0 00 000403' ifskp. ; Yes, BOUT% is safe 44120 000400'01 104 00 0 00 000051 BOUT% ; So do it 44121 000401'01 320 14 0 00 000000* erjmps r ; Failed?? Catch and suppress error 44122 000402'01 254 00 0 00 000414' else. ; Otherwise, assume some kind of pointer 44123 000403'01 136 02 0 00 000001 idpb t2, t1 ; So just deposit it 44124 000404'01 320 14 0 00 000405' erjmps .+1 ; Failed?? Catch and suppress error 44125 000405'01 261 17 0 00 000001 push p, t1 ; Save the byte pointer 44126 000406'01 261 17 0 00 000002 push p, t2 ; Save the byte 44127 000407'01 400 02 0 00 000000 setz t2, ; Cons up a NUL 44128 000410'01 136 02 0 00 000001 idpb t2, t1 ; Tie off string, allowing append 44129 000411'01 320 12 0 00 000412' erjmpr .+1 ; Failed?? Catch and ignore error (for debugging) 44130 000412'01 262 17 0 00 000002 pop p, t2 ; Restore the byte 44131 000413'01 262 17 0 00 000001 pop p, t1 ; Restore the byte pointer 44132 000414'01 endif. ; End JSYS/ilpb decision 44133 000414'01 263 17 0 00 000000 ret 44134 44135 ;[216] End code insertion 44136 44137 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12 K20SUB MAC 20-Aug-24 02:18 Is this a JFN on NUL: or its equivalent? 44138 subttl Is this a JFN on NUL: or its equivalent? 44139 44140 ; Determines whether JFN is actually NUL:, and, if so replaces it 44141 ; with .NULIO, a special pseudo-JFN that is both recognized by 44142 ; Tops-20 and used internally as a talisman. 44143 ; 44144 ; Call: 44145 ; 44146 ; t1/ Candidate JFN (or device) 44147 ; 44148 ; Returns, 44149 ; 44150 ; +1/ t1 unmodified 44151 ; +2/ t1 contains .nulio, JFN released (if JFN given) 44152 44153 000415'01 isnulj: entry isnulj ; Keep LINK informed of our location 44154 44155 000415'01 312 01 0 00 004250' came t1, [.dvdes!.dvnul,,-1] ; Typed device directly? 44156 000416'01 254 00 0 00 000422' ifskp. ; We did, so just go with that 44157 000417'01 201 01 0 00 377777 movei t1, .nulio ; Stomp into .nulio, no flags 44158 000420'01 254 00 0 00 000000* retskp ; We're done 44159 000421'01 254 00 0 00 000424' else. ; Otherwise, have to figure it out 44160 000422'01 265 16 0 00 004127' saveac ; Don't trash anything except maybe t1 44161 000423'01 200 05 0 00 000001 move q1, t1 ; Save the JFN with any flags 44162 000424'01 endif. ; .nulio might have flags, actually 44163 44164 000424'01 550 02 0 00 000001 hrrz t2, t1 ; Let's just look at the JFN alone 44165 000425'01 322 02 0 00 000541' jumpe t2, notnul ; Ignore any gubbish 44166 000426'01 306 02 0 00 377777 cain t2, .nulio ; Is some joker trying to get cute? 44167 000427'01 254 00 0 00 000536' jrst yesnul ; It's already NUL: ... 44168 ; Try to weed out some wise guys... 44169 000430'01 306 01 0 00 000100 cain t1, .priin ; Primary Input? 44170 000431'01 254 00 0 00 000541' jrst notnul ; It isn't the NUL: device 44171 000432'01 306 01 0 00 000101 cain t1, .priou ; Primary Output? 44172 000433'01 254 00 0 00 000541' jrst notnul ; It isn't the NUL: device 44173 000434'01 306 01 0 00 777777 cain t1, .cttrm ; Controlling terminal? 44174 000435'01 254 00 0 00 000541' jrst notnul ; It isn't the NUL: device 44175 000436'01 306 01 0 00 677777 cain t1, .sigio ; Signal JFN? 44176 000437'01 254 00 0 00 000541' jrst notnul ; It isn't the NUL: device 44177 ; First see if the argument is a device 44178 000440'01 104 00 0 00 000117 DVCHR% ; Get the characteristics of device 44179 000441'01 320 12 0 00 000443' ifje. r ; Broke on JFN with flags 44180 000442'01 254 00 0 00 000446' 44181 000443'01 200 04 0 00 000001 move t4, t1 ; Save for the curious 44182 000444'01 474 06 0 00 000000 seto q2, ; Flag failed (bogus characteristics) 44183 000445'01 254 00 0 00 000447' else. ; Otherwise, it did work 44184 000446'01 200 06 0 00 000002 move q2, t2 ; Save device characteristics word 44185 000447'01 endif. 44186 ; Now see if a file 44187 000447'01 550 01 0 00 000005 hrrz t1, q1 ; Load JFN, sans flags 44188 000450'01 104 00 0 00 000024 GTSTS% ; Get JFN status 44189 000451'01 320 12 0 00 000453' ifje. r ; Failed?? 44190 000452'01 254 00 0 00 000455' 44191 000453'01 474 04 0 00 000000 seto t4, ; Say it sure isn't a JFN 44192 000454'01 254 00 0 00 000456' else. ; Worked, save the status bits k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-1 K20SUB MAC 20-Aug-24 02:18 Is this a JFN on NUL: or its equivalent? 44193 000455'01 200 04 0 00 000002 move t4, t2 ; Save the status bits for the moment 44194 000456'01 endif. 44195 44196 000456'01 415 16 0 00 000465' block. ; Enter block context for better control flow 44197 000457'01 261 17 0 00 000016 44198 000460'01 316 04 0 00 004221' camn t4, [-1] ; GTSTS% blow up? 44199 000461'01 254 00 0 00 000420* retskp ; It did, so no JFN 44200 000462'01 607 04 0 00 000200 txnn t4, gs%nam ; Is this bound to anything? 44201 000463'01 254 00 0 00 000461* retskp ; No, so no JFN 44202 000464'01 263 17 0 00 000000 endbk. ; Fall out of block context 44203 000465'01 254 00 0 00 000474' ifskp. ; Skips if no apparent JFN 44204 000466'01 316 06 0 00 004221' camn q2,[-1] ; Did DVCHR% not work, either? 44205 000467'01 254 00 0 00 000541' jrst notnul ; Didn't, so assume not NUL: 44206 000470'01 135 03 0 00 004251' ldb t3, [pointr q2, dv%typ] ; Pick up the device type 44207 000471'01 302 03 0 00 000015 caie t3, .dvnul ; Wants to just lose data? 44208 000472'01 254 00 0 00 000541' jrst notnul ; Not NUL:, so don't touch it 44209 000473'01 254 00 0 00 000536' jrst yesnul ; It is the NUL: device, but not a JFN 44210 000474'01 endif. 44211 ; Looks like a live JFN 44212 000474'01 550 01 0 00 000005 hrrz t1, q1 ; Try looking at it 44213 000475'01 104 00 0 00 000117 DVCHR% ; Get the characteristics of device 44214 000476'01 320 12 0 00 000541' erjmpr notnul ; GTSTS% just told us it was good... 44215 ; Now see if a file 44216 000477'01 135 03 0 00 004252' ldb t3, [pointr t2, dv%typ] ; Pick up the device type 44217 000500'01 316 06 0 00 004221' camn q2, [-1] ; Did the first DVCHR% fail? 44218 000501'01 254 00 0 00 000507' ifskp. ; No, it worked 44219 000502'01 135 01 0 00 004252' ldb t1, [pointr t2, dv%typ] ; Pick up the device type 44220 000503'01 316 01 0 00 000003 camn t1, t3 ; Are these NOT the same? 44221 000504'01 254 00 0 00 000507' anskp. ; They are, proceed 44222 000505'01 200 03 0 00 000001 move t3, t1 ; They aren't, prefer device 44223 000506'01 400 04 0 00 000000 setz t4, ; Say not open nor bound 44224 000507'01 endif. 44225 44226 000507'01 302 03 0 00 000015 caie t3, .dvnul ; Wants to just lose data? 44227 000510'01 254 00 0 00 000541' jrst notnul ; Not NUL:, so don't touch it 44228 ; It is, so replace the JFN 44229 000511'01 325 04 0 00 000531' ifxn. t4, gs%opn ; Is this thing open? 44230 000512'01 550 01 0 00 000005 hrrz t1, q1 ; Reload JFN, sans flags 44231 000513'01 400 02 0 00 000000 setz t2, ; Let's assume this works... 44232 000514'01 104 00 0 00 000022 CLOSF% ; Politely try to close it 44233 000515'01 320 12 0 00 000517' ifje. r ; Catch and ignore JSYS error 44234 000516'01 254 00 0 00 000520' 44235 000517'01 474 02 0 00 000000 seto t2, ; Flag it didn't want to go away 44236 000520'01 endif. ; End case trying a normal close 44237 000520'01 322 02 0 00 000536' jumpe t2, yesnul ; If it worked, then it's time to leave 44238 000521'01 550 01 0 00 000005 hrrz t1, q1 ; Reload JFN, sans flags 44239 000522'01 661 01 0 00 004000 txo t1, cz%abt ; In this case, try to clobber it 44240 000523'01 400 02 0 00 000000 setz t2, ; Let's assume that works... 44241 000524'01 104 00 0 00 000022 CLOSF% ; Try to close it, rudely 44242 000525'01 320 12 0 00 000527' ifje. r ; Catch and ignore JSYS error 44243 000526'01 254 00 0 00 000530' 44244 000527'01 474 02 0 00 000000 seto t2, ; I guess we must have sticky JFN syndrome 44245 000530'01 endif. ; End case trying a normal close 44246 000530'01 322 02 0 00 000536' jumpe t2, yesnul ; If it worked, then it's time to leave 44247 000531'01 endif. ; Otherwise, fall through and try something else k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 12-2 K20SUB MAC 20-Aug-24 02:18 Is this a JFN on NUL: or its equivalent? 44248 ; Here if not open or we are desperate 44249 000531'01 607 04 0 00 000200 ifxn. t4, gs%nam ; Was it ever bound? 44250 000532'01 254 00 0 00 000536' 44251 000533'01 550 01 0 00 000005 hrrz t1, q1 ; Reload JFN, sans flags 44252 000534'01 104 00 0 00 000023 RLJFN% ; Just toss it 44253 000535'01 320 12 0 00 000536' erjmpr .+1 ; Retrieve and ignore the error 44254 remark yesnul ; Falls through 44255 000536'01 endif. 44256 44257 000536'01 yesnul: remark ; Here if NUL; (JFN already released) 44258 000536'01 201 01 0 00 377777 movei t1, .nulio ; Load our talisman 44259 000537'01 500 01 0 00 000005 hll t1, q1 ; Load any flags, although now phoney 44260 000540'01 254 00 0 00 000463* retskp ; Won!! 44261 44262 000541'01 notnul: remark ; Here if not NUL: or some kooky error 44263 000541'01 200 01 0 00 000005 move t1, q1 ; Restore the calling argument 44264 000542'01 263 17 0 00 000000 ret ; Return +1 44265 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 13 K20SUB MAC 20-Aug-24 02:18 Set up Command State Block to parse from JFN in t1. 44266 subttl Set up Command State Block to parse from JFN in t1. 44267 44268 000543'01 setcsb: entry setcsb 44269 000543'01 337 00 0 00 000001 skipg t1 ; Make sure there's a real JFN. 44270 000544'01 201 01 0 00 000100 movei t1, .priin ; If not, revert. 44271 000545'01 506 01 0 00 000000# hrlm t1, sbk+.cmioj ; Put the input JFN into the CSB. 44272 000546'01 201 02 0 00 000101 movei t2, .priou ; Assume JFN is primary input. 44273 000547'01 302 01 0 00 000100 caie t1, .priin ; Is it? 44274 000550'01 201 02 0 00 377777 movx t2, .nulio ; No, it's a file, so nullify COMND output. 44275 000551'01 542 02 0 00 000000# hrrm t2, sbk+.cmioj ; Put output JFN in CSB. 44276 000552'01 263 17 0 00 000000 ret 44277 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14 K20SUB MAC 20-Aug-24 02:18 Initialize Fork Capability vector 44278 subttl Initialize Fork Capability vector 44279 44280 ; Can't just blanket enable capabilities, an ACJ might get grumpy... 44281 ; 44282 ; Adapted from SETND2 (SETNOD rewrite) 44283 ; 44284 ; Note: checking for SC%GTB is almost certainly unnecessary as it is 44285 ; unheard of for it NOT to be on and we don't even have to enable it 44286 ; as merely having it is enough. That's good because the EXEC does 44287 ; not enable it. 44288 ; 44289 ; However, the code was fun to write and you never know when you're 44290 ; going to get hit with some fascist system manager's idea of security. 44291 ; 44292 ; Note, historically, Kermit did not change the top-level fork's 44293 ; capability vector. In particular, if something 'dangerous' (like 44294 ; Wheel or Operator) was on, it was left on. This tries to follow 44295 ; that. 44296 44297 ; Trashes t1-t4 44298 44299 000553'01 inicap: entry inicap ; Inform Link of our location 44300 extern mycaps,capas,bigboy ;and of our necessaries 44301 000553'01 265 16 0 00 004253' saveac ;[252] Needed to propagate sc%whl/sc%opr 44302 44303 000554'01 403 02 0 00 000003 setzb t2, t3 ; Cons up a null capability vector 44304 000555'01 124 02 0 00 000000* dmovem t2, mycaps ; Assume we have nothing and that we are nobody 44305 000556'01 124 02 0 00 000000* dmovem t2, capas ; special (also intentionally whacks BIGBOY) 44306 000557'01 201 01 0 00 400000 movei t1, .fhslf ; This fork 44307 000560'01 104 00 0 00 000150 RPCAP% ; Get our capabilities 44308 000561'01 320 12 0 00 000401* erjmpr r ; Give up right now; can't do anything more 44309 44310 remark t2, capas ;[187] Let other code handle this 44311 000562'01 200 04 0 00 000003 move t4, t3 ; Save a copy of what's on 44312 000563'01 200 05 0 00 000003 move q1, t3 ;[252] Another copy here, too 44313 remark t2, badmsk ; t2 is ignored by EPCAP% for .fhslf 44314 000564'01 630 03 0 00 004261' tdz t3, [badmsk] ; Shut off some things that get us into trouble 44315 ; Turn on a few things 44316 000565'01 602 02 0 00 001000 txne t2, sc%dna ; Do we have DECnet access? 44317 000566'01 660 03 0 00 001000 txo t3, sc%dna ; Yes, turn it on in case ACJ desires it 44318 000567'01 603 02 0 00 200000 txne t2, sc%gtb ; Do we have GETAB%? 44319 000570'01 661 03 0 00 200000 txo t3, sc%gtb ; Yes, flag other code 44320 000571'01 603 02 0 00 400000 txne t2, sc%ctc ; Do we have ^C? 44321 000572'01 661 03 0 00 400000 txo t3, sc%ctc ; Yes, flag other code 44322 44323 000573'01 405 05 0 00 600000 andx q1, sc%whl!sc%opr ;[252] Isolate some dangerous bits 44324 000574'01 322 05 0 00 000577' ifn. q1 ;[252] Could we hurt anybody? 44325 000575'01 476 00 0 00 000000* setom bigboy ;[252] Yep, flag that we are one of the BIG BOYS 44326 000576'01 434 03 0 00 000005 or t3, q1 ;[252] And keep them turned on 44327 000577'01 endif. ;[252] 44328 44329 000577'01 124 02 0 00 000555* dmovem t2, mycaps ; Store current capability vector 44330 000600'01 316 03 0 00 000004 camn t3, t4 ; Anything to change, actually? 44331 000601'01 263 17 0 00 000000 ret ; Nope, bum a few JSYi 44332 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 14-1 K20SUB MAC 20-Aug-24 02:18 Initialize Fork Capability vector 44333 000602'01 104 00 0 00 000151 EPCAP% ; Diddle the capabiliy vector 44334 000603'01 320 12 0 00 000605' ifje. r ; Failed?? 44335 000604'01 254 00 0 00 000607' 44336 000605'01 200 04 0 00 000001 move t4, t1 ; Save error code for debuggers, otherwise ignore 44337 000606'01 201 01 0 00 400000 movei t1, .fhslf ; Reload fork handle 44338 000607'01 endif. ; End case error handling 44339 ; See if fascist ACJ changed anything 44340 000607'01 104 00 0 00 000150 RPCAP% ; Get the resulting capability vector 44341 000610'01 320 12 0 00 000561* erjmpr r ; Sigh... 44342 000611'01 202 03 0 00 000000# movem t3, mycaps+1 ; Update final capability vector 44343 44344 repeat 0,< ;[252] Remove now that debugging is done 44345 txmsg (Avl: ) ;[252] Showing available 44346 move t1, t2 ;[252] Load them 44347 call infcap ;[252] Show them 44348 hrroi t1, crlf ;[252] 44349 PSOUT% ;[252] 44350 txmsg (On: ) ;[252] Showing what's on 44351 move t1, t3 ;[252] Load those 44352 call infcap ;[252] Show them 44353 hrroi t1, crlf ;[252] 44354 PSOUT% ;[252] 44355 > ;repeat 0 ;[252] 44356 000612'01 263 17 0 00 000000 ret ; Finally done 44357 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15 K20SUB MAC 20-Aug-24 02:18 Determine what kind of argument we have 44358 subttl Determine what kind of argument we have 44359 44360 ; Call: 44361 ; 44362 ; t1/ The handle we're trying to puzzle out 44363 ; 44364 ; Return: 44365 ; 44366 ; +1, Couldn't fathom it 44367 ; +2, Figured it out 44368 ; 44369 ; t1/ Appropriate flag set 44370 44371 000613'01 302 01 0 00 777777 argtyp: caie t1, .cttrm ; Called with controlling terminal? 44372 000614'01 254 00 0 00 000617' ifskp. ; That's easy enough 44373 000615'01 205 01 0 00 200000 movx t1, ts%ctm ; Set the controlling terminal flag 44374 000616'01 254 00 0 00 000540* retskp ; Success 44375 000617'01 endif. 44376 44377 000617'01 302 01 0 00 000101 caie t1, .priou ; Called with primary output? 44378 000620'01 254 00 0 00 000623' ifskp. ; That's easy enough 44379 000621'01 205 01 0 00 100000 movx t1, ts%pro ; Set the primary output flag 44380 000622'01 254 00 0 00 000616* retskp ; Success 44381 000623'01 endif. 44382 44383 000623'01 265 16 0 00 004262' saveac ; For calling argument and stack variable 44384 000624'01 200 05 0 00 000001 move q1, t1 ; Save the calling argument 44385 44386 000625'01 620 01 0 00 200000 txz t1, fh%epn ; Shut off extended page number flag 44387 000626'01 302 01 0 00 400000 caie t1, .fhslf ; Called with this fork? 44388 000627'01 254 00 0 00 000632' ifskp. ; That's easy, too 44389 000630'01 205 01 0 00 042000 movx t1, ts%frk!ts%efh ;Set the fork handle flag, explicitly supplied 44390 000631'01 254 00 0 00 000622* retskp ; Success 44391 000632'01 endif. 44392 ; Let's try a little harder 44393 000632'01 265 16 0 00 000000* anstkv (q2, <.rfsfl+1>) ; Allocate stack space for call 44394 000633'01 000000 000005 44395 000634'01 415 06 0 17 777772 44396 000635'01 201 03 0 00 000005 movx t3, <.rfsfl+1> ; Length of RFSTS% block 44397 000636'01 202 03 0 06 000000 movem t3, .rfcnt(q2) ; Store it in block 44398 44399 000637'01 515 01 0 00 400000 hrlzi t1, (rf%lng) ; Using long form 44400 000640'01 540 01 0 00 000005 hrr t1, q1 ; Load original argument (whatever it was) 44401 000641'01 200 02 0 00 000006 move t2, q2 ; Load pointer to block 44402 000642'01 200 03 0 00 000001 move t3, t1 ; Save a copy of JSYS argument 44403 000643'01 104 00 0 00 000156 RFSTS% ; Try to find out status 44404 000644'01 320 12 0 00 000645' erjmpr .+1 ; Side effect t1 with error code 44405 000645'01 312 01 0 00 000003 came t1, t3 ; But!! Did t1 change?? 44406 000646'01 254 00 0 00 000651' ifskp. ; No, so the call succeeded 44407 000647'01 205 01 0 00 042000 movx t1, ts%frk!ts%efh ;Set the fork handle flag, explicitly supplied 44408 000650'01 254 00 0 00 000631* retskp ; Success 44409 000651'01 endif. 44410 44411 000651'01 550 01 0 00 000005 hrrz t1, q1 ; Reload the calling argument 44412 000652'01 104 00 0 00 000024 GTSTS% ; Get the JFN's status k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 15-1 K20SUB MAC 20-Aug-24 02:18 Determine what kind of argument we have 44413 000653'01 320 12 0 00 000655' ifje. r ; If it was a JFN... 44414 000654'01 254 00 0 00 000660' 44415 000655'01 200 03 0 00 000001 move t3, t1 ; Save error for debuggers 44416 000656'01 400 02 0 00 000000 setz t2, ; Clear gs%nam 44417 remark ; Fall out to try device 44418 000657'01 254 00 0 00 000664' else. ; Otherwise, worked 44419 000660'01 607 02 0 00 000200 ifxn. t2, gs%nam ; A bound JFN? 44420 000661'01 254 00 0 00 000664' 44421 000662'01 205 01 0 00 020000 movx t1, ts%jfn ; Yes, set the JFN flag 44422 000663'01 254 00 0 00 000650* retskp ; Success 44423 000664'01 endif. ; End case a real JFN 44424 remark ; Otherwise, fall through to try device 44425 000664'01 endif. 44426 44427 000664'01 200 01 0 00 000005 move t1, q1 ; Reload the calling argument 44428 000665'01 104 00 0 00 000117 DVCHR% ; See if we got a device handle, maybe 44429 000666'01 320 12 0 00 000670' ifje. r ; Failed?? 44430 000667'01 254 00 0 00 000673' 44431 000670'01 200 02 0 00 000001 move t2, t1 ; Save error code for debuggers 44432 000671'01 400 01 0 00 000000 setz t1, ; Return no flags at all 44433 remark ; Fall out to try something else (like what??) 44434 000672'01 254 00 0 00 000675' else. ; Otherwise, worked 44435 000673'01 205 01 0 00 010000 movx t1, ts%dev ; Set the device handle flag 44436 000674'01 254 00 0 00 000663* retskp ; Success 44437 000675'01 endif. 44438 44439 000675'01 263 17 0 00 000000 ret ; Can't figure out what else to try, so fail 44440 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 16 K20SUB MAC 20-Aug-24 02:18 set and unset terminal for binary output 44441 subttl set and unset terminal for binary output 44442 44443 ; Put TTY in binary mode for output only. Still allows normal input, 44444 ; ^C trapping, etc. 44445 44446 000676'01 ttyob: entry ttyob ; Used by k20ioc 44447 000676'01 201 01 0 00 000101 movei t1, .priou ; Get CCOC words 44448 000677'01 104 00 0 00 000112 RFCOC 44449 000700'01 124 02 0 00 000000# dmovem t2, myccoc ; Save em. 44450 dmove t2,[525252525252 ;[194] Make all characters output 44451 000701'01 120 02 0 00 004272' 525252525000] ;[194] with no translation. 44452 000702'01 104 00 0 00 000113 SFCOC 44453 000703'01 201 02 0 00 000044 movei t2, .morxo ; Get tty pause-end-of-page status. 44454 000704'01 104 00 0 00 000077 MTOPR% 44455 000705'01 320 12 0 00 000707' %jserr (,) 44456 000706'01 254 00 0 00 000712' 44457 000707'01 265 01 0 00 000276' 44458 000710'01 000000 000000 44459 000711'01 254 00 0 00 000712' 44460 000712'01 202 03 0 00 000000# movem t3, ttpau ; Save it. 44461 dmove t2, [ .moxof ; Set the terminal pause on command 44462 000713'01 120 02 0 00 004274' .mooff ] ; to no pause on command 44463 000714'01 104 00 0 00 000077 MTOPR% 44464 000715'01 320 12 0 00 000717' %jserr (,) 44465 000716'01 254 00 0 00 000722' 44466 000717'01 265 01 0 00 000276' 44467 000720'01 000000 000000 44468 000721'01 254 00 0 00 000722' 44469 000722'01 263 17 0 00 000000 ret 44470 44471 44472 ; Restore TTY output to condition before TTYOB was called. 44473 44474 000723'01 ttyou: entry ttyou ; Used by k20ioc 44475 000723'01 201 01 0 00 000101 movei t1, .priou ; Restore normal tty output. 44476 000724'01 120 02 0 00 000000# dmove t2, myccoc 44477 000725'01 104 00 0 00 000113 SFCOC 44478 000726'01 320 12 0 00 000730' %jserr (,) 44479 000727'01 254 00 0 00 000733' 44480 000730'01 265 01 0 00 000276' 44481 000731'01 000000 000000 44482 000732'01 254 00 0 00 000733' 44483 000733'01 201 02 0 00 000043 movei t2, .moxof ; Set terminal pause on command 44484 000734'01 200 03 0 00 000000# move t3, ttpau ; to what it used to be. 44485 000735'01 104 00 0 00 000077 MTOPR% 44486 000736'01 320 12 0 00 000740' %jserr (,) 44487 000737'01 254 00 0 00 000743' 44488 000740'01 265 01 0 00 000276' 44489 000741'01 000000 000000 44490 000742'01 254 00 0 00 000743' 44491 000743'01 263 17 0 00 000000 ret 44492 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17 K20SUB MAC 20-Aug-24 02:18 Save Terminal Characteristics (see following) 44493 subttl Save Terminal Characteristics (see following) 44494 44495 ; Call: 44496 ; 44497 ; t1/ JFN or device or fork handle 44498 ; t2/ Pointer to storage area 44499 ; 44500 ; Return: 44501 ; 44502 ; +1, Not a terminal device or some other significant error 44503 ; +2, Complete Success 44504 ; t3/ Interesting discovery flags 44505 ; 44506 ; Storage will contain as much terminal information as could be 44507 ; reasonably captured. 44508 ; 44509 ; Partially inspired by routines in PA1050 (PAT) which handle setting 44510 ; 'free' CRLF. Called at program startup and also when using another 44511 ; terminal line when running in 'local' mode. 44512 ; 44513 ; 44514 ; N.B., *MUST* be called after INICAP so we can see if we have SC%CTC!! 44515 ; 44516 ; To Do: Maybe check if .priou is .dvpip and don't do this? 44517 44518 000744'01 savtty: entry savtty ; Called from k20mit 44519 000744'01 265 16 0 00 004276' saveac ; Used for loop control and terminal references 44520 000745'01 120 07 0 00 000001 dmove q3, t1 ; Save calling arguments 44521 44522 000746'01 205 03 0 00 400000 movx t3, ts%err ; Assume some kind of failure 44523 000747'01 202 03 0 10 000000 movem t3, $tsflg(q4) ; Store in block 44524 000750'01 202 01 0 10 000001 movem t1, $tsarg(q4) ; Saving calling argument 44525 000751'01 201 03 0 00 601405 movx t3, lstrx1 ; However, we don't have any errors, YET 44526 000752'01 202 03 0 10 000002 movem t3, $tserr(q4) ; So don't assume 44527 000753'01 260 17 0 00 000613' call argtyp ; Determine argument type 44528 000754'01 263 17 0 00 000000 ret ; Failed, don't know what it is 44529 44530 000755'01 437 01 0 10 000000 orb t1, $tsflg(q4) ; Save and use the determined type 44531 000756'01 200 05 0 00 000001 move q1, t1 ; Also keep current flags in a fast place 44532 44533 000757'01 607 05 0 00 100000 ifxn. q1, ts%pro ; Was this primary output? 44534 000760'01 254 00 0 00 000763' 44535 000761'01 661 05 0 00 040000 txo q1, ts%frk ; Yes, so turn it into a fork handle 44536 000762'01 201 07 0 00 400000 movei q3, .fhslf ; Stomp argument to this process 44537 000763'01 endif. 44538 44539 000763'01 607 05 0 00 040000 ifxn. q1, ts%frk ; Fork (or implied fork)? 44540 000764'01 254 00 0 00 000777' 44541 000765'01 200 01 0 00 000007 move t1, q3 ; Yes, load it 44542 000766'01 104 00 0 00 000206 GPJFN% ; Find out primary JFN's 44543 000767'01 320 12 0 00 000771' ifje. r ; Failed?? 44544 000770'01 254 00 0 00 000775' 44545 000771'01 202 01 0 10 000002 movem t1, $tserr(q4) ;Store the error number 44546 000772'01 474 02 0 00 000000 seto t2, ; Force .cttrm 44547 000773'01 200 03 0 00 000001 move t3, t1 ; Reposition the error k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-1 K20SUB MAC 20-Aug-24 02:18 Save Terminal Characteristics (see following) 44548 000774'01 254 00 0 00 000776' else. ; Otherwise, there is no error 44549 000775'01 400 03 0 00 000000 setz t3, ; So state as much 44550 000776'01 endif. ; and carry on 44551 000776'01 254 00 0 00 001001' else. ; Otherwise, not using .priou 44552 000777'01 200 02 0 00 000007 move t2, q3 ; Pretend this is .priou 44553 001000'01 201 03 0 00 601405 movx t3, lstrx1 ; And flag no error differently 44554 001001'01 endif. 44555 001001'01 124 02 0 10 000003 dmovem t2, $gpjfn(q4) ; Store appropriately 44556 44557 001002'01 607 05 0 00 010000 ifxn. q1, ts%dev ; Already had a device designator 44558 001003'01 254 00 0 00 001006' 44559 001004'01 200 01 0 00 000007 move t1, q3 ; Yes, use it 44560 001005'01 254 00 0 00 001007' else. ; Otherwise, maybe GPJFN% got something 44561 001006'01 550 01 0 00 000002 hrrz t1, t2 ; Have a look at whatever the primary is 44562 001007'01 endif. 44563 001007'01 104 00 0 00 000117 DVCHR% ; Get the device characteristics 44564 001010'01 320 12 0 00 001012' ifje. r ; Failed?? 44565 001011'01 254 00 0 00 001017' 44566 001012'01 202 01 0 10 000002 movem t1, $tserr(q4) ; Store the error number 44567 001013'01 200 04 0 00 000001 move t4, t1 ; And also for failure specifics 44568 001014'01 400 01 0 00 000000 setz t1, ; Phoney up an impossible designator 44569 001015'01 477 02 0 00 000003 setob t2, t3 ; Yield impossible results 44570 001016'01 254 00 0 00 001020' else. ; Otherwise, worked 44571 001017'01 400 04 0 00 000000 setz t4, ; Therefore, flag this 44572 001020'01 endif. 44573 001020'01 124 01 0 10 000005 dmovem t1, $dvchr(q4) ; Save results 44574 001021'01 124 03 0 10 000007 dmovem t3, $dvchr+2(q4) ; All of them and error (if any) 44575 001022'01 326 04 0 00 000610* jumpn t4, r ; Can't go any further if failed 44576 ; Otherwise, investigate results 44577 001023'01 135 04 0 00 004252' ldb t4,[pointr t2, dv%typ] ; Pick up the device type 44578 001024'01 302 04 0 00 000012 caie t4, .dvtty ; Ok, is this a terminal? 44579 001025'01 263 17 0 00 000000 ret ; No, the rest makes no sense 44580 001026'01 302 01 0 00 777777 caie t1, .cttrm ; Controlling terminal? 44581 001027'01 254 00 0 00 001033' ifskp. ; Yes, let's fix that up 44582 001030'01 200 01 0 00 000003 move t1, t3 ; Load the device type and line number 44583 001031'01 661 01 0 00 600000 txo t1, (.dvdes) ; Turn on the designator bit 44584 001032'01 202 01 0 10 000005 movem t1, $dvchr(q4) ; Replace saved device designator 44585 001033'01 endif. 44586 001033'01 200 06 0 00 000001 move q2, t1 ; Save device in a fast place 44587 44588 remark t1, ; Finally has terminal device 44589 001034'01 104 00 0 00 000112 RFCOC% ; Get the control word 44590 001035'01 320 12 0 00 001037' ifje. r ; Catch and ignore error 44591 001036'01 254 00 0 00 001044' 44592 001037'01 202 01 0 10 000013 movem t1, $ctcoc+2(q4) ;Save the error 44593 001040'01 202 01 0 10 000002 movem t1, $tserr(q4) ; Store the error here, too 44594 001041'01 477 02 0 00 000003 setob t2, t3 ; Fine, no control character output control 44595 001042'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44596 001043'01 254 00 0 00 001045' else. ; Otherwise worked, which is good 44597 001044'01 402 00 0 10 000013 setzm $ctcoc+2(q4) ; Flag no error 44598 001045'01 endif. 44599 001045'01 124 02 0 10 000011 dmovem t2, $ctcoc(q4) ; Store controlling terminal's COC's 44600 44601 001046'01 104 00 0 00 000107 RFMOD% ; Get the JFN mode word 44602 001047'01 320 12 0 00 001051' ifje. r ; Catch and ignore error k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-2 K20SUB MAC 20-Aug-24 02:18 Save Terminal Characteristics (see following) 44603 001050'01 254 00 0 00 001056' 44604 001051'01 202 01 0 10 000002 movem t1, $tserr(q4) ; Store the error number 44605 001052'01 474 02 0 00 000000 seto t2, ; Fine, no mode word 44606 001053'01 200 03 0 00 000001 move t3, t1 ; Reposition error 44607 001054'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44608 001055'01 254 00 0 00 001060' else. ; Otherwise, worked 44609 001056'01 621 02 0 00 400000 txz t2, tt%osp ; Clear Control-O 44610 001057'01 400 03 0 00 000000 setz t3, ; Flag no error 44611 001060'01 endif. 44612 001060'01 124 02 0 10 000014 dmovem t2, $ctmod(q4) ; Store controlling terminal's mode word and error 44613 44614 001061'01 201 05 0 00 000006 movei q1, mtoprl ; Load MTOPR% table length 44615 44616 001062'01 do. ; Enter loop context 44617 001062'01 554 02 0 05 001203' hlrz t2, mtoprt(q1) ; Load function to perform 44618 001063'01 104 00 0 00 000077 MTOPR% ; Read the value 44619 001064'01 320 12 0 00 001066' ifje. r ; Catch and ignore error 44620 001065'01 254 00 0 00 001073' 44621 001066'01 202 01 0 10 000002 movem t1, $tserr(q4) ;Store the error number 44622 001067'01 474 03 0 00 000000 seto t3, ; Fine, no value 44623 001070'01 200 04 0 00 000001 move t4, t1 ; Save for debugger 44624 001071'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44625 001072'01 254 00 0 00 001074' else. ; Otherwise, worked 44626 001073'01 400 04 0 00 000000 setz t4, ; Flag no error 44627 001074'01 endif. 44628 001074'01 550 02 0 05 001203' hrrz t2, mtoprt(q1) ; Load location to store 44629 001075'01 270 02 0 00 000010 add t2, q4 ; Calculate correct address in structure 44630 001076'01 124 03 0 02 000000 dmovem t3, (t2) ; store it somewhere 44631 001077'01 365 05 0 00 001062' sojge q1, top. ; Get the next one 44632 001100'01 enddo. ; Exit loop context 44633 44634 001100'01 201 04 0 00 000004 movx t4, <0,,4> ; Load block header word 44635 001101'01 202 04 0 10 000034 movem t4, $morbm(q4) ; Initialize block 44636 remark t1, ; Still has correct designator 44637 001102'01 201 02 0 00 000037 movx t2, .morbm ; Function is to read break mask 44638 001103'01 201 03 0 10 000034 movei t3, $morbm(q4) ; Resolve address of break mask block 44639 001104'01 104 00 0 00 000077 MTOPR% ; Read the value 44640 001105'01 320 12 0 00 001107' ifje. r ; Catch and ignore error 44641 001106'01 254 00 0 00 001117' 44642 001107'01 200 04 0 00 000001 move t4, t1 ; Save for debugger 44643 001110'01 202 01 0 10 000002 movem t1, $tserr(q4) ; Store the error number 44644 001111'01 477 02 0 00 000003 setob t2, t3 ; Fine, no break mask.. 44645 001112'01 124 02 0 10 000034 dmovem t2, $morbm(q4) ; Stomp header and first break word 44646 001113'01 124 02 0 10 000036 dmovem t2, $morbm+2(q4) ;Stomp second and third break word 44647 001114'01 124 03 0 10 000040 dmovem t3, $morbm+4(q4) ;Stomp fourth break word, store error 44648 001115'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44649 001116'01 254 00 0 00 001120' else. ; Otherwise, worked 44650 001117'01 402 00 0 10 000041 setzm $morbm+5(q4) ; Flag no error 44651 001120'01 endif. 44652 ; Finally set large dimension flags 44653 001120'01 120 02 0 10 000016 dmove t2, $morlw(q4) ; Load the terminal width 44654 001121'01 326 03 0 00 001126' ife. t3 ; Was there any error? 44655 001122'01 307 02 0 00 000177 caig t2, ^d127 ; Exceeded seven bits? 44656 001123'01 254 00 0 00 001126' anskp. ; No, STPAR% will work 44657 001124'01 205 03 0 00 000400 movx t3, ts%lgw ; Load large width flag k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-3 K20SUB MAC 20-Aug-24 02:18 Save Terminal Characteristics (see following) 44658 001125'01 436 03 0 10 000000 orm t3, $tsflg(q4) ; Record in the flags word 44659 001126'01 endif. 44660 44661 001126'01 120 02 0 10 000020 dmove t2, $morll(q4) ; Load terminal length 44662 001127'01 326 03 0 00 001134' ife. t3 ; Was there any error? 44663 001130'01 307 02 0 00 000177 caig t2, ^d127 ; Exceeded seven bits? 44664 001131'01 254 00 0 00 001134' anskp. ; No, STPAR% will work 44665 001132'01 205 03 0 00 000200 movx t3, ts%lgl ; Load large length flag 44666 001133'01 436 03 0 10 000000 orm t3, $tsflg(q4) ; Record in the flags word 44667 001134'01 endif. 44668 44669 001134'01 200 04 0 10 000000 move t4, $tsflg(q4) ; Load the current flags so far 44670 001135'01 607 04 0 00 002000 ifxn. t4, ts%efh ; Did we have an explicit fork handle? 44671 001136'01 254 00 0 00 001141' 44672 001137'01 200 05 0 10 000001 move q1, $tsarg(q4) ; Yes, let's use it 44673 001140'01 254 00 0 00 001142' else. ; Otherwise, assume job wide teriminal interrupts 44674 001141'01 201 05 0 00 777773 movei q1, .fhjob ; And use this magic handle 44675 001142'01 endif. 44676 44677 001142'01 200 03 0 00 000000# move t3, mycaps+1 ; Load ENABLED capabilities 44678 001143'01 325 03 0 00 001147' ifxn. t3, sc%ctc ; Did we have ^C? 44679 001144'01 205 03 0 00 001000 movx t3, ts%ctc ; Load that we had sc%ctc 44680 001145'01 437 03 0 10 000000 orb t3, $tsflg(q4) ; Record in the flags word and keep handy 44681 001146'01 254 00 0 00 001150' else. ; Otherwise, don't have it 44682 001147'01 200 03 0 10 000000 move t3, $tsflg(q4) ; So load what we do have 44683 001150'01 endif. 44684 44685 001150'01 302 05 0 00 777773 caie q1, .fhjob ; Are we doing job wide? 44686 001151'01 254 00 0 00 001155' ifskp. ; Yes, so let's see if that is possible 44687 001152'01 603 03 0 00 001000 txne t3, ts%ctc ; Did we have ^C? 44688 001153'01 254 00 0 00 001155' anskp. ; Yes, so STIW% on this will work 44689 001154'01 201 05 0 00 400000 movei q1, .fhslf ; No; just this fork's terminal interrupt word 44690 001155'01 endif. ; End case .fhjob specified (or assumed) 44691 44692 001155'01 200 01 0 00 000005 move t1, q1 ; Load terminal interrupt word context 44693 001156'01 202 01 0 10 000042 movem t1, $tif(q4) ; Store what we are using 44694 001157'01 302 01 0 00 777773 caie t1, .fhjob ; Entire job? 44695 001160'01 254 00 0 00 001163' ifskp. ; It is, so won't be getting differed word 44696 001161'01 400 03 0 00 000000 setz t3, ; So stomp it 44697 001162'01 254 00 0 00 001164' else. ; Otherwise, this is a specific process 44698 001163'01 661 01 0 00 400000 txo t1, rt%dim ; So get differed word, just for fun 44699 001164'01 endif. 44700 44701 001164'01 104 00 0 00 000173 RTIW% ; Finally read the terminal interrupt word 44702 001165'01 320 12 0 00 001167' ifje. r ; Catch and handle the error 44703 001166'01 254 00 0 00 001173' 44704 001167'01 202 01 0 10 000045 movem t1, $tiw+2(q4) ; Save the error 44705 001170'01 202 01 0 10 000002 movem t1, $tserr(q4) ; Store the error here, too 44706 001171'01 403 02 0 00 000003 setzb t2, t3 ; Let's say nothing is set 44707 001172'01 254 00 0 00 001174' else. ; Otherwise worked, which is good 44708 001173'01 402 00 0 10 000045 setzm $tiw+2(q4) ; Flag no error 44709 001174'01 endif. 44710 001174'01 124 02 0 10 000043 dmovem t2, $tiw(q4) ; Store terminal interrupt word (and maybe diferred) 44711 44712 001175'01 200 01 0 10 000002 move t1, $tserr(q4) ; Load last error encountered k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 17-4 K20SUB MAC 20-Aug-24 02:18 Save Terminal Characteristics (see following) 44713 001176'01 302 01 0 00 601405 caie t1, lstrx1 ; Never had any? 44714 001177'01 263 17 0 00 000000 ret ; Fail the call 44715 44716 001200'01 525 03 0 00 377777 movx t3, ^-ts%err ; Load failure bit complement 44717 001201'01 407 03 0 10 000000 andb t3, $tsflg(q4) ; Shut off in flag word 44718 001202'01 254 00 0 00 000674* retskp ; Complete success 44719 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 18 K20SUB MAC 20-Aug-24 02:18 MTOPR% index to structure offset mapping tables 44720 subttl MTOPR% index to structure offset mapping tables 44721 44722 ; Be aware that each pointer is pointing to a double word which 44723 ; holds the value and any error. This is to keep us from restoring 44724 ; a value which was never properly read in the first place and 44725 ; really messing up a possibly already ill terminal. 44726 ; 44727 ; As these are offsets, they are added to an address, which means 44728 ; that the structure can be in any section. 44729 44730 001203'01 000030 000016 mtoprt: .morlw,,$morlw ; Read line width 44731 001204'01 000032 000020 .morll,,$morll ; Read line length 44732 001205'01 000035 000022 .mornt,,$mornt ; Receive system blat 44733 001206'01 000044 000024 .morxo,,$morxo ; Pause end of page 44734 001207'01 000053 000026 .mopcr,,$mopcr ; Read terminal pause and unpause 44735 001210'01 000054 000030 .mortf,,$mortf ; Read other kinds of blat 44736 001211'01 400001 000032 panda < .morlt,,$morlt > ;;Read TVT bits 44737 000006 mtoprl==.-mtoprt-1 ; Calculate table length 44738 44739 001212'01 000031 000016 mtopst: .moslw,,$morlw ; Set line width 44740 001213'01 000033 000020 .mosll,,$morll ; Set line length 44741 001214'01 000034 000022 .mosnt,,$mornt ; Set system blat acceptance 44742 001215'01 000043 000024 .moxof,,$morxo ; Set pause end of page 44743 001216'01 000052 000026 .mopcs,,$mopcr ; Set terminal pause and unpause 44744 001217'01 000055 000030 .mostf,,$mortf ; Set other kinds of blat 44745 001220'01 400002 000032 panda < .moslt,,$morlt > ;;Set TVT bits 44746 000006 mtopsl==.-mtopst-1 ; Calculate table length 44747 44748 ifn , 44749 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19 K20SUB MAC 20-Aug-24 02:18 Restore Terminal Characteristics 44750 subttl Restore Terminal Characteristics 44751 44752 ; Call: 44753 ; 44754 ; t1/ Takes a pointer to a storage area that was set up by SAVTTY. 44755 ; 44756 ; Restores every parameter that was successfully saved, ignores 44757 ; those that weren't. 44758 ; 44759 ; Return: 44760 ; 44761 ; +1, always 44762 ; 44763 ; t3 has last error, zero if everything restored 44764 ; 44765 ; Terminal characteristics restored or restored mostly. 44766 ; 44767 ; Trashes t1, t2, t3 and t4 44768 ; 44769 ; See above. Do NOT change order of restore because SFMOD%/STPAR% 44770 ; will overwrite the length and width with the wrong things 44771 44772 001221'01 restty: entry restty ; Called from k20mit 44773 001221'01 265 16 0 00 004310' saveac ; Uses plenty more registers... 44774 44775 001222'01 200 05 0 00 000001 move q1, t1 ; Save structure base 44776 001223'01 474 03 0 00 000000 seto t3, ; Assume complete junk 44777 001224'01 332 00 0 05 000010 skipe $dvchr+3(q1) ; Did we ever get a device? 44778 001225'01 263 17 0 00 000000 ret ; No, no way we can restore anything 44779 001226'01 200 06 0 05 000005 move q2, $dvchr(q1) ; Yes, use the device for everything 44780 001227'01 200 01 0 00 000006 move t1, q2 ; Load for JSYi 44781 001230'01 400 07 0 00 000000 setz q3, ; Let's assume everything works 44782 44783 001231'01 332 00 0 05 000013 ifme. $ctcoc+2(q1) ; Did the RFCOC% work 44784 001232'01 254 00 0 00 001241' 44785 001233'01 120 02 0 05 000011 dmove t2, $ctcoc(q1) ; Yes, load controlling terminal's COC's 44786 001234'01 104 00 0 00 000113 SFCOC% ; Put them back 44787 001235'01 320 12 0 00 001237' ifje. r ; Failed?? 44788 001236'01 254 00 0 00 001241' 44789 001237'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44790 001240'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44791 001241'01 endif. ; End case SFCOC% failure handling 44792 001241'01 endif. ; End case SFCOC% restore decision 44793 44794 001241'01 332 00 0 05 000015 ifme. $ctmod+1(q1) ; Did RFMOD% work? 44795 001242'01 254 00 0 00 001256' 44796 001243'01 200 02 0 05 000014 move t2, $ctmod(q1) ; Yes, load those bits 44797 001244'01 104 00 0 00 000110 SFMOD% ; Set 'program related' bits 44798 001245'01 320 12 0 00 001247' ifje. r ; Failed?? 44799 001246'01 254 00 0 00 001251' 44800 001247'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44801 001250'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44802 001251'01 endif. ; End SFMOD% error handling 44803 001251'01 104 00 0 00 000217 STPAR% ; Set 'mechanical' bits 44804 001252'01 320 12 0 00 001254' ifje. r ; Failed?? k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 19-1 K20SUB MAC 20-Aug-24 02:18 Restore Terminal Characteristics 44805 001253'01 254 00 0 00 001256' 44806 001254'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44807 001255'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44808 001256'01 endif. ; End STPAR% error handling 44809 001256'01 endif. ; End mode word restore decision 44810 44811 001256'01 201 10 0 00 000006 movei q4, mtopsl ; Load MTOPR% table length 44812 44813 001257'01 do. ; Enter loop context 44814 001257'01 550 11 0 10 001212' hrrz p1, mtopst(q4) ; Load pointer to stored value offset 44815 001260'01 270 11 0 00 000005 add p1, q1 ; Add in base of table 44816 001261'01 120 03 0 11 000000 dmove t3, (p1) ; Load value and error condition 44817 001262'01 326 04 0 00 001271' ife. t4 ; If no error, then try setting 44818 001263'01 554 02 0 10 001212' hlrz t2, mtopst(q4) ; Load this value's MTOPR% set index 44819 001264'01 104 00 0 00 000077 MTOPR% ; Try setting the value 44820 001265'01 320 12 0 00 001267' ifje. r ; Failed?? 44821 001266'01 254 00 0 00 001271' 44822 001267'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44823 001270'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44824 001271'01 endif. ; End MTOPR% error handling 44825 001271'01 endif. ; End MTOPR% restore decision 44826 001271'01 365 10 0 00 001257' sojge q4, top. ; Get the next one 44827 001272'01 enddo. ; Exit loop context 44828 44829 001272'01 332 00 0 05 000041 ifme. $morbm+5(q1) ; Did the read mask work? 44830 001273'01 254 00 0 00 001303' 44831 001274'01 201 02 0 00 000040 movx t2, .mosbm ; Function to set break mask 44832 001275'01 201 03 0 05 000034 movei t3, $morbm(q1) ; Address of four word block to load from 44833 001276'01 104 00 0 00 000077 MTOPR% ; Set the value 44834 001277'01 320 12 0 00 001301' ifje. r ; Failed?? 44835 001300'01 254 00 0 00 001303' 44836 001301'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44837 001302'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44838 001303'01 endif. ; End case MTOPR% failure handling 44839 001303'01 endif. ; End case break mask restore decision 44840 44841 001303'01 332 00 0 05 000045 ifme. $tiw+2(q1) ; Were we able to get the terminal interrupt word? 44842 001304'01 254 00 0 00 001313' 44843 001305'01 120 01 0 05 000042 dmove t1, $tif(q1) ; Yes, load context and mask 44844 001306'01 104 00 0 00 000174 STIW% ; Restore somebody's terminal interrupt word 44845 001307'01 320 12 0 00 001311' ifje. r ; Failed?? 44846 001310'01 254 00 0 00 001313' 44847 001311'01 200 07 0 00 000001 move q3, t1 ; Remember that something failed 44848 001312'01 200 01 0 00 000006 move t1, q2 ; Reload designator 44849 001313'01 endif. ; End case STIW% failure handling 44850 001313'01 endif. ; End case STIW% decision 44851 44852 001313'01 200 03 0 00 000007 move t3, q3 ; Has any errors 44853 001314'01 263 17 0 00 000000 ret ; Finally get out of here 44854 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 20 K20SUB MAC 20-Aug-24 02:18 Set Up Local Terminal for Kermit usage 44855 subttl Set Up Local Terminal for Kermit usage 44856 44857 001315'01 setty: entry setty ;[220] Invoked by k20mit 44858 001315'01 260 17 0 00 000000* call udjinf ;[220] Get and update current job information 44859 001316'01 335 04 0 00 000000# skipge t4,jobtab+.jitno ;[220] Load and check current terminal number 44860 001317'01 334 01 0 00 000000# ermsg% (,halt) ;[220] 44861 001320'01 254 00 0 00 001324' 44862 001321'01 202 01 0 00 000142* 44863 001322'01 104 00 0 00 000313 44864 001323'01 254 00 0 00 000000* 44865 000002'03 000000000000# 44866 000000'04 113 105 122 115 111 44867 44868 001324'01 202 04 0 00 000000* movem t4, mytty ;[184] stomp in a possible new line 44869 44870 001325'01 200 01 0 00 000004 move t1, t4 ;[186] Pass in possible new terminal line 44871 001326'01 505 01 0 00 600012 hrli t1,.dvdes!.dvtty ;[186] Turn into a device designator 44872 001327'01 201 02 0 00 000000* movei t2, svstt ;[186] Point to saved start up terminal area 44873 001330'01 260 17 0 00 000744' call savtty ;[186] Save terminal characteristics again 44874 001331'01 334 01 0 00 000000# ermsg% (,halt) ;[186] 44875 001332'01 254 00 0 00 001336' 44876 001333'01 202 01 0 00 001321* 44877 001334'01 104 00 0 00 000313 44878 001335'01 254 00 0 00 001323* 44879 000003'03 000000000000# 44880 000016'04 113 105 122 115 111 44881 44882 44883 001336'01 201 02 0 00 001327* movei t2, svstt ;[194] Point to populated structure 44884 001337'01 332 00 0 02 000010 ifme. $dvchr+3(t2) ;[194] Any error? 44885 001340'01 254 00 0 00 001343' 44886 001341'01 200 03 0 02 000005 move t3, $dvchr(t2) ;[194] None, use what DVCHR% got 44887 001342'01 254 00 0 00 001344' else. ;[194] Otherwise, have to use something 44888 001343'01 201 03 0 00 000101 movei t3, .priou ;[194] Maybe old reliable will work 44889 001344'01 endif. ;[194] End case determining controlling device 44890 001344'01 202 03 0 00 000000* movem t3, $PRIOU ;[194] Store and hope for the best 44891 44892 001345'01 260 17 0 00 001355' call lcltty ;[194] Get a JFN on local terminal 44893 001346'01 334 00 0 00 000000 %ermsg (,halt) ;[186] 44894 001347'01 254 00 0 00 001353' 44895 001350'01 265 01 0 00 000276' 44896 001351'01 000000000000# 44897 001352'01 254 00 0 00 001335* 44898 000032'04 125 156 141 142 154 44899 001353'01 202 01 0 00 000000* movem t1, ttyjfn ;[194] Store for downstream use 44900 001354'01 263 17 0 00 000000 ret 44901 44902 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21 K20SUB MAC 20-Aug-24 02:18 Acquire JFN on local terminal 44903 subttl Acquire JFN on local terminal 44904 44905 ; Although has a +1/+2 return, it always returns 44906 ; something, even if it is only .priou or .cttrm 44907 ; 44908 ; t1/ JFN open and ready to use 44909 ; 44910 ; To do: if a pipe, maybe change this and just use it? 44911 ; 44912 ; Also: if we are running as local, then we should close the 44913 ; ttyjfn and replace it with .sigio because we shouldn't 44914 ; be diddling the local terminal. 44915 44916 001355'01 lcltty: extern ttyjfn ; In k20mit 44917 001355'01 265 16 0 00 004253' saveac ; Copy of possible open JFN 44918 44919 001356'01 476 00 0 00 000000# setom lcltte ; Whack the error block to detached job 44920 001357'01 200 01 0 00 004324' move t1, [lcltte,,lcltte+1] 44921 001360'01 251 01 0 00 000000# blt t1, lcltef ; The entire block 44922 44923 001361'01 337 05 0 00 001353* skipg q1, ttyjfn ; First, is there something already available? 44924 001362'01 254 00 0 00 001413' jrst getlcl ; Evidently not; let's get a JFN 44925 44926 001363'01 200 01 0 00 000005 move t1, q1 ; Load it for the JSYS to investigate 44927 001364'01 104 00 0 00 000024 GTSTS% ; Let's have a look see 44928 001365'01 320 12 0 00 001367' ifje. r ; Looks like it's defunct, somehow 44929 001366'01 254 00 0 00 001372' 44930 001367'01 202 01 0 00 000000# movem t1, lcltte ; Store the error 44931 001370'01 200 01 0 00 000005 move t1, q1 ; Reload the JFN (or whatever it was) 44932 001371'01 400 02 0 00 000000 setz t2, ; Whack the status 44933 001372'01 endif. 44934 44935 001372'01 641 02 0 00 400200 txc t2,gs%nam!gs%opn ; Complement the required bits 44936 001373'01 643 02 0 00 400200 txce t2,gs%nam!gs%opn ; Is it any good at and is it open? 44937 001374'01 254 00 0 00 001413' jrst getlcl ; No, then go get a JFN 44938 001375'01 607 02 0 00 000400 ifxn. t2,gs%err ; Any kind of error? 44939 001376'01 254 00 0 00 001412' 44940 001377'01 505 01 0 00 004000 hrli t1, (cz%abt) ; Abort the JFN 44941 001400'01 104 00 0 00 000022 CLOSF% ; Try to junk it 44942 001401'01 320 12 0 00 001403' ifje. r ; Failied?? 44943 001402'01 254 00 0 00 001411' 44944 001403'01 202 01 0 00 000000# movem t1, lcltte+1 ; Store the error 44945 001404'01 200 01 0 00 000005 move t1, q1 ; Reload the JFN (or whatever it was) 44946 001405'01 104 00 0 00 000023 RLJFN% ; Just try to let go of it 44947 001406'01 320 12 0 00 001410' ifje. r ; Failied?? 44948 001407'01 254 00 0 00 001411' 44949 001410'01 202 01 0 00 000000# movem t1, lcltte+2 ;Store the error 44950 001411'01 endif. 44951 001411'01 endif. 44952 001411'01 254 00 0 00 001413' jrst getlcl ; Go get a new JFN 44953 001412'01 endif. 44954 001412'01 254 00 0 00 001202* retskp ; Otherwise, get out of here with a JFN 44955 44956 001413'01 getlcl: extern mytty ; Here to get a JFN on the local line 44957 001413'01 402 00 0 00 001361* setzm ttyjfn ; At this point, no JFN anyhow k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-1 K20SUB MAC 20-Aug-24 02:18 Acquire JFN on local terminal 44958 001414'01 200 03 0 00 001324* move t3, mytty ; Load my terminal number 44959 001415'01 316 03 0 00 004221' camn t3, [-1] ; Detached?? 44960 001416'01 254 00 0 00 001474' jrst lclerr ; Yes, that will never do.. 44961 001417'01 620 03 0 00 400000 txz t3, .ttdes ; Stomp in case somebody left it on 44962 dmove t1, [-1,,lclnam ; HRROI pointer to place to build name 44963 001420'01 120 01 0 00 004325' .dvdes!.dvtty,,0 ] ; Device designator prototype 44964 001421'01 540 02 0 00 000003 hrr t2, t3 ; My current attached terminal 44965 001422'01 202 02 0 00 000000# movem t2, lcldev ; Store it for later 44966 001423'01 104 00 0 00 000121 DEVST% ; Build the device string 44967 001424'01 320 12 0 00 001426' ifje. r ; Failed?? 44968 001425'01 254 00 0 00 001431' 44969 001426'01 202 01 0 00 000000# movem t1, lcltte+3 ; Save the error 44970 001427'01 254 00 0 00 001474' jrst lclerr ; And give error return 44971 001430'01 254 00 0 00 001434' else. ; Otherwise, worked 44972 001431'01 120 02 0 00 004327' dmove t2, [ exp ":", 0] ; Load final characters 44973 001432'01 136 02 0 00 000001 idpb t2, t1 ; Punctuate the device 44974 001433'01 136 03 0 00 000001 idpb t3, t1 ; Tie off the device string 44975 001434'01 endif. 44976 44977 dmove t1, [ gj%sht!gj%flg ; Want flags 44978 001434'01 120 01 0 00 004331' -1,,lclnam ] ; Point to constructed device name 44979 001435'01 104 00 0 00 000020 GTJFN% ; Try to get a handle 44980 001436'01 320 12 0 00 001440' ifje. r ; Can't on our own silly TTY?? 44981 001437'01 254 00 0 00 001451' 44982 001440'01 202 01 0 00 000000# movem t1, lcltte+4 ; Sigh ... 44983 dmove t1, [ASCIZ /TTY:/ ; Try generic case 44984 001441'01 120 01 0 00 004333' 0 ] ; Certainly null terminated 44985 001442'01 124 01 0 00 000000# dmovem t1, lclnam ; Drop that in 44986 dmove t1, [ gj%sht!gj%flg ; Want flags 44987 001443'01 120 01 0 00 004335' -1,,lclnam ] ; Point to constructed device name 44988 001444'01 104 00 0 00 000020 GTJFN% ; Try to get a handle 44989 001445'01 320 12 0 00 001447' ifje. r ; Failed?? 44990 001446'01 254 00 0 00 001451' 44991 001447'01 202 01 0 00 000000# movem t1, lcltte+5 ; Sigh ... 44992 001450'01 254 00 0 00 001474' jrst lclerr ; Go do general error exit 44993 001451'01 endif. ; End failure recovery failing .. 44994 001451'01 endif. ; End GTJFN% failure analysis and recovery 44995 44996 001451'01 552 01 0 00 000000# hrrzm t1, lcljfn ; Store the JFN 44997 001452'01 512 01 0 00 000000# hllzm t1, lclflg ; And the flags 44998 001453'01 621 01 0 00 777777 tlz t1, -1 ; Don't confuse foolish OPENF% with our flags 44999 remark ; See what fld(.gsimg,of%mod) does here 45000 ; movx t2, fld(8,of%bsz)!of%wr!of%rd ; 8-bit bytes, read & write access. 45001 001454'01 200 02 0 00 004337' movx t2, fld(8,of%bsz)!fld(.gsimg,of%mod)!of%wr!of%rd 45002 001455'01 104 00 0 00 000021 OPENF% ; Finally try to open the silly thing 45003 001456'01 320 12 0 00 001460' ifje. r ; Failed?? 45004 001457'01 254 00 0 00 001471' 45005 001460'01 306 01 0 00 600120 cain t1, opnx1 ; But!! Was error "File already open"? 45006 001461'01 254 00 0 00 001471' anskp. ; That's fine, we can live with that 45007 001462'01 202 01 0 00 000000# movem t1, lcltte+6 ; Otherwise, store the error 45008 001463'01 550 01 0 00 000000# hrrz t1, lcljfn ; Load the JFN 45009 001464'01 104 00 0 00 000023 RLJFN% ; Let go of it 45010 001465'01 320 12 0 00 001467' ifje. r ; Failed?? We just got it! 45011 001466'01 254 00 0 00 001470' 45012 001467'01 202 01 0 00 000000# movem t1, lcltte+7 ; Store that on the way out k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 21-2 K20SUB MAC 20-Aug-24 02:18 Acquire JFN on local terminal 45013 001470'01 endif. ; And carry on with OPENF% error 45014 001470'01 254 00 0 00 001474' jrst lclerr ; And give error return 45015 001471'01 endif. ; End OPENF% failure handling 45016 45017 001471'01 260 17 0 00 001477' call gdswrp ;[223] Call Get Device Status Wrapper 45018 001472'01 550 01 0 00 000000# hrrz t1, lcljfn ;[223] Load the JFN 45019 001473'01 254 00 0 00 001412* retskp ; Won!! 45020 45021 001474'01 lclerr: remark ; Here if something broke 45022 001474'01 403 01 0 00 000000# setzb t1, lcljfn ; No JFN 45023 001475'01 402 00 0 00 000000# setzm lclflg ; No flags 45024 001476'01 263 17 0 00 000000 ret ; Nothing further we can do... 45025 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 22 K20SUB MAC 20-Aug-24 02:18 Wrapper for Get Device Status 45026 subttl Wrapper for Get Device Status 45027 45028 ;[223] Begin code insertion 45029 45030 ; Assumes lcljfn is set 45031 45032 remark ; These externals are in k20net and k20ioc 45033 extern gndpar ; Get Network Device Parity 45034 extern none ; No parity being done 45035 extern even ; Doing even parity 45036 extern parpko ; Doing parity only on packets 45037 extern parrck ; Checking parity on receive 45038 45039 001477'01 550 01 0 00 000000# gdswrp: hrrz t1, lcljfn ; Load local terminal JFN in t1 45040 001500'01 500 01 0 00 000000# hll t1, lclflg ; and its flags 45041 001501'01 260 17 0 00 000000* call gndpar ; Get 'Network' Device Status 45042 001502'01 400 02 0 00 000000 setz t2, ; Falled, assume refuses parity, then 45043 001503'01 606 02 0 00 000001 ifxn. t2, gd%par ; 'Tolerates' parity? 45044 001504'01 254 00 0 00 001514' 45045 001505'01 476 00 0 00 000000# setom lclpar ; Yes, normalize that 45046 001506'01 606 02 0 00 000010 ifxn. t2, mo%par ; Was the thing doing parity anyway 45047 001507'01 254 00 0 00 001512' 45048 001510'01 201 03 0 00 000000* movei t3, even ; Tops-20 itself only generates even parity 45049 001511'01 254 00 0 00 001513' else. ; Otherwise, we're not doing parity 45050 001512'01 201 03 0 00 000000* movei t3, none ; so set it to 'none' 45051 001513'01 endif. ; End case propagating parity 45052 001513'01 254 00 0 00 001516' else. ; Otherwise, doesn't do parity 45053 001514'01 402 00 0 00 000000# setzm lclpar ; So whack the variable 45054 001515'01 201 03 0 00 001512* movei t3, none ; And flag elsewhere to 'none' 45055 001516'01 endif. 45056 45057 001516'01 202 03 0 00 000000* movem t3, parity ; So make sure we're following local terminal parity 45058 001517'01 402 00 0 00 000000* setzm parpko ; Doing parity for terminal and packets 45059 001520'01 402 00 0 00 000000* setzm parrck ; But we're not checking it on receive 45060 45061 001521'01 263 17 0 00 000000 ret ; Done 45062 45063 ;[223] End code insertion 45064 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 23 K20SUB MAC 20-Aug-24 02:18 Restore start up terminal parameters 45065 subttl Restore start up terminal parameters 45066 45067 ; Assumes correct terminal parameters to restore are the start up ones 45068 45069 001522'01 fixtty: entry fixtty ; World callable 45070 extern svstt, tiword ; Found in K20MIT 45071 45072 001522'01 201 01 0 00 001336* movei t1, svstt ; Load pointer to start up terminal parameter block 45073 001523'01 260 17 0 00 001221' call restty ; Restore the whole kit and kaboodle 45074 001524'01 322 03 0 00 001531' ifn. t3 ; Anything not restore properly? 45075 001525'01 334 01 0 00 000000# ermsg% 45076 001526'01 254 00 0 00 001531' 45077 001527'01 202 01 0 00 001333* 45078 001530'01 104 00 0 00 000313 45079 000004'03 000000000000# 45080 000042'04 113 105 122 115 111 45081 45082 001531'01 endif. ; End case double checking 45083 001531'01 200 03 0 00 000000# move t3, mycaps+1 ; Load enabled capabilities 45084 001532'01 325 03 0 00 001535' ifxn. t3, sc%ctc ; Do we have control-C capapbility? 45085 001533'01 201 01 0 00 777773 movx t1, .fhjob ; Yes, then can grab ^C job wide 45086 001534'01 254 00 0 00 001536' else. ; Otherwise, can only do it for our fork 45087 001535'01 201 01 0 00 400000 movei t1, .fhslf ; So make it process wide, instead 45088 001536'01 endif. ; What about the inferior? 45089 45090 001536'01 200 02 0 00 000000* move t2, tiword ; Load the terminal interrupt word 45091 001537'01 104 00 0 00 000174 STIW ; and set it 45092 001540'01 320 12 0 00 001542' %jserr (,) 45093 001541'01 254 00 0 00 001545' 45094 001542'01 265 01 0 00 000276' 45095 001543'01 000000000000# 45096 001544'01 254 00 0 00 001545' 45097 000060'04 146 151 170 164 164 45098 001545'01 263 17 0 00 000000 ret 45099 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24 K20SUB MAC 20-Aug-24 02:18 Condition local terminal for use as remote 45100 subttl Condition local terminal for use as remote 45101 45102 ;[151] Set up TTY for linking, and open any logging file. 45103 ; 45104 ;[129] Add TT%DUM 45105 45106 000000 $modof==0 ;[194] Bits we want off 45107 004000 $modof==$modof!tt%eco ;[194] Shutting off echoing 45108 004300 $modof==$modof!tt%dam ;[194] Force binary data mode (whacks field flags) 45109 004314 $modof==$modof!tt%dum ;[194] Force full duplex (whacks field flags) 45110 004334 $modof==$modof!tt%lic ;[194] Do not raise lower case on input 45111 104334 $modof==$modof!tt%wkf ;[194] Don't wakeup on formating control chars 45112 144334 $modof==$modof!tt%wkn ;[194] Don't wakeup on non-formatting control chars 45113 164334 $modof==$modof!tt%wkp ;[194] Don't wakeup on punctuation 45114 174334 $modof==$modof!tt%wka ;[194] Don't wakeup on alphanumerics 45115 000177 174334 $modof==$modof!tt%wid ;[194] Infinite width (0) 45116 037777 174334 $modof==$modof!tt%len ;[194] Infinite length (0) 45117 037777 174374 $modof==$modof!tt%uoc ;[194] Do not indicate upper case 45118 45119 001546'01 037777 174374 modoff: $modof ;[194] Store in code psect 45120 .xcref $modof ;[194] Don't need in cross reference 45121 45122 remark ;[194] Don't translate certain control characters 45123 000000 $modon==0 ;[194] Bits we want on 45124 200000 000000 $modon==$modon!tt%mff ;[194] Mechanical formfeed present 45125 300000 000000 $modon==$modon!tt%tab ;[194] Mechanical tab present 45126 340000 000000 $modon==$modon!tt%lca ;[194] Lower case capabilities present 45127 340000 000002 $modon==$modon!tt%pgm ;[194] Assume doing ^S/^Q 45128 45129 001547'01 340000 000002 modon: $modon ;[194] Store in code psect 45130 .xcref $modon ;[194] Don't need in cross reference 45131 45132 001550'01 ttyini: entry ttyini ;[194] Called from main 45133 extern handsh, flow, halt ;[186] Defined in k20mit 45134 001550'01 336 01 0 00 001413* skipn t1, ttyjfn ;[186] If have a terminal JFN, use it 45135 001551'01 334 00 0 00 000000 %ermsg (,halt) ;[186] 45136 001552'01 254 00 0 00 001556' 45137 001553'01 265 01 0 00 000276' 45138 001554'01 000000000000# 45139 001555'01 254 00 0 00 001352* 45140 000072'04 164 164 171 151 156 45141 001556'01 201 04 0 00 001522* movei t4, svstt ;[186] Point to start up terminal parameter block 45142 001557'01 120 02 0 04 000014 dmove t2, $ctmod(t4) ;[186] Load controlling terminal's mode word and error 45143 001560'01 326 03 0 00 001571' ife. t3 ;[186] Don't have it? 45144 001561'01 104 00 0 00 000107 RFMOD% ;[186] See if we can get it now 45145 001562'01 320 12 0 00 001564' %jserr (,r) ;[186] 45146 001563'01 254 00 0 00 001567' 45147 001564'01 265 01 0 00 000276' 45148 001565'01 000000000000# 45149 001566'01 254 00 0 00 001022* 45150 000104'04 164 164 171 151 156 45151 001567'01 400 03 0 00 000000 setz t3, ;[186] Worked?? Oh well, that's strange, but OK 45152 001570'01 124 02 0 04 000014 dmovem t2, $ctmod(t4) ;[186] Store what SAVTTY should have done 45153 001571'01 endif. ;[186] End case loading mode word 45154 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 24-1 K20SUB MAC 20-Aug-24 02:18 Condition local terminal for use as remote 45155 001571'01 420 02 0 00 001546' andcm t2, modoff ;[194] Shut off what we don't want 45156 001572'01 434 02 0 00 001547' or t2, modon ;[194] Or in what we want on 45157 001573'01 336 00 0 00 000000* skipn handsh ;[155] Doing handshake? 45158 001574'01 336 00 0 00 000000* skipn flow ;[155] Doing flow control? 45159 001575'01 620 02 0 00 000002 txz t2, tt%pgm ; Handshake, or no flow - don't do XON/XOFF. 45160 45161 001576'01 104 00 0 00 000110 SFMOD ; Set the bits 45162 001577'01 320 12 0 00 001601' %jserr (,r) 45163 001600'01 254 00 0 00 001604' 45164 001601'01 265 01 0 00 000276' 45165 001602'01 000000000000# 45166 001603'01 254 00 0 00 001566* 45167 000114'04 164 164 171 151 156 45168 001604'01 104 00 0 00 000217 STPAR ; ...and the other bits... 45169 001605'01 320 12 0 00 001607' %jserr (,r) 45170 001606'01 254 00 0 00 001612' 45171 001607'01 265 01 0 00 000276' 45172 001610'01 000000000000# 45173 001611'01 254 00 0 00 001603* 45174 000124'04 164 164 171 151 156 45175 45176 001612'01 201 01 0 00 777773 movx t1, .fhjob ; Turn off ^C, ^O, ^T interrupts for whole job. 45177 001613'01 200 03 0 00 000000# move t3, mycaps+1 ;[185] Load enabled capabilities 45178 001614'01 607 03 0 00 400000 txnn t3, sc%ctc ; Can only do job wide STIW if we do... 45179 001615'01 201 01 0 00 400000 movei t1, .fhslf ;[185] We don't, so process wide 45180 001616'01 104 00 0 00 000173 RTIW 45181 001617'01 320 12 0 00 001621' %jserr (,r) 45182 001620'01 254 00 0 00 001624' 45183 001621'01 265 01 0 00 000276' 45184 001622'01 000000000000# 45185 001623'01 254 00 0 00 001611* 45186 000135'04 164 164 171 151 156 45187 001624'01 202 02 0 00 001536* movem t2, tiword 45188 45189 001625'01 200 04 0 00 004340' movx t4, <1b<.ticcc>!1b<.ticco>!1b<.ticct>> 45190 001626'01 607 03 0 00 400000 txnn t3, sc%ctc 45191 001627'01 200 04 0 00 004341' movx t4, <1b<.ticco>!1b<.ticct>> 45192 001630'01 630 02 0 00 000004 tdz t2, t4 45193 001631'01 104 00 0 00 000174 STIW 45194 001632'01 320 12 0 00 001634' %jserr (,r) 45195 001633'01 254 00 0 00 001637' 45196 001634'01 265 01 0 00 000276' 45197 001635'01 000000000000# 45198 001636'01 254 00 0 00 001623* 45199 000147'04 164 164 171 151 156 45200 001637'01 263 17 0 00 000000 ret 45201 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25 K20SUB MAC 20-Aug-24 02:18 Force a JFN to close (or try real hard to) 45202 subttl Force a JFN to close (or try real hard to) 45203 45204 ; Call: 45205 ; 45206 ; t1/ JFN to get rid of 45207 ; 45208 ; +1, JFN could not be released 45209 ; t1, t2, t3 have various errors 45210 ; 45211 ; +2, JFN no longer valid 45212 ; 45213 ; This will force just about any kind of JFN to be gotten rid 45214 ; of except for the case of a file that is still mapped. 45215 45216 extern delayf, delay ; Whether we are waiting for anything 45217 45218 001640'01 frclos: entry frclos ; Called from everywhere 45219 001640'01 265 16 0 00 004253' saveac ; Used for a copy of the JFN 45220 001641'01 553 05 0 00 000001 hrrzs q1, t1 ; Save a copy without flags 45221 001642'01 403 02 0 00 000003 setzb t2, t3 ; Let's assume everything is dandy 45222 ; Let's check a few silly cases 45223 001643'01 322 01 0 00 001473* jumpe t1, rskp ; If no JFN, then nothing to do, anyhow 45224 001644'01 306 01 0 00 377777 cain t1, .nulio ; BUT!! Never opened? 45225 001645'01 254 00 0 00 001643* retskp ; That's fine, we're done already 45226 001646'01 306 01 0 00 000101 cain t1, .priou ; How about primary output? 45227 001647'01 254 00 0 00 001645* retskp ; Don't bother closing it as it was never opened 45228 001650'01 306 01 0 00 000100 cain t1, .priin ; Somebody get mixed up? 45229 001651'01 254 00 0 00 001647* retskp ; That's OK, same deal as .priou 45230 001652'01 306 01 0 00 777777 cain t1, .cttrm ; Controlling terminal? 45231 001653'01 254 00 0 00 001651* retskp ; That won't work, either, but it's fine 45232 ; At this point, have to assume a real JFN 45233 001654'01 336 00 0 00 000000* ifmn. delayf ; Use basic delay (if we have one) 45234 001655'01 254 00 0 00 001663' 45235 001656'01 337 02 0 00 000000* skipg t2, delay ; Load and double check milliseconds 45236 001657'01 254 00 0 00 001663' anskp. ; Some kind of gubbish, don't risk it 45237 001660'01 201 01 0 00 001700' movei t1, frclo1 ; If time out, then hit the abort code 45238 001661'01 260 17 0 00 002326' call timeon ; Set the timer 45239 001662'01 550 01 0 00 000005 hrrz t1, q1 ; And reload the JFN 45240 001663'01 endif. ; Either way, hit the CLOSF% 45241 45242 001663'01 104 00 0 00 000022 CLOSF% ; Politely try to close it 45243 001664'01 320 12 0 00 001666' ifje. r ; Catch and store the error 45244 001665'01 254 00 0 00 001674' 45245 001666'01 306 01 0 00 600150 cain t1, desx1 ; Trying to close complete junk? 45246 001667'01 254 00 0 00 001674' anskp. ; Fine, pretend it's closed .. 45247 001670'01 306 01 0 00 600152 cain t1, desx3 ; No JFN anyway? 45248 001671'01 254 00 0 00 001674' anskp. ; That's fine, too; never had anything to do 45249 001672'01 200 02 0 00 000001 move t2, t1 ; Save the error for downstream processing 45250 001673'01 254 00 0 00 001676' else. ; Otherwise it worked 45251 001674'01 260 17 0 00 001716' call frclot ; Clean up any extent timers 45252 001675'01 254 00 0 00 001653* retskp ; and get out of here 45253 001676'01 endif. ; End CLOSF% interpretation 45254 45255 001676'01 306 03 0 00 600160 cain t3, clsx1 ; If error is NOT "File is not open" 45256 001677'01 254 00 0 00 001711' ifskp. ; Then try harder to close it k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 25-1 K20SUB MAC 20-Aug-24 02:18 Force a JFN to close (or try real hard to) 45257 001700'01 550 01 0 00 000005 frclo1: hrrz t1, q1 ; Reload the JFN 45258 001701'01 505 01 0 00 004000 hrli t1,(cz%abt) ; Set the abort bit, clear others 45259 001702'01 104 00 0 00 000022 CLOSF% ; Try to close it, and be rude about it 45260 001703'01 320 12 0 00 001705' ifje. r ; Catch and store error 45261 001704'01 254 00 0 00 001707' 45262 001705'01 200 03 0 00 000001 move t3, t1 ; Move error to 2nd attempt AC 45263 001706'01 254 00 0 00 001711' else. ; Otherwise, being distictly rude about it worked 45264 001707'01 260 17 0 00 001716' call frclot ; Clean up any extent timers 45265 001710'01 254 00 0 00 001675* retskp ; and give a good return 45266 001711'01 endif. ; End case cz%abt analysis 45267 001711'01 endif. ; End case, other than "File is not open" 45268 45269 remark t3, clsx1 ; Might just need to release it 45270 001711'01 550 01 0 00 000005 hrrz t1, q1 ; Load the JFN 45271 001712'01 104 00 0 00 000023 RLJFN% ; So try that 45272 001713'01 320 12 0 00 001716' erjmpr frclot ; Catch error in t1, return +1 from frclot 45273 45274 001714'01 260 17 0 00 001716' call frclot ; Clean up any extent timers 45275 001715'01 254 00 0 00 001710* retskp ; Otherwise, finally won 45276 45277 001716'01 frclot: remark ; Force close timer clean up 45278 001716'01 336 00 0 00 001654* ifmn. delayf ; Did we set a timer? 45279 001717'01 254 00 0 00 001723' 45280 001720'01 337 00 0 00 001656* skipg delay ; Did we *REALLY* set a timer? 45281 001721'01 254 00 0 00 001723' anskp. ; Nope, so that's easy 45282 001722'01 260 17 0 00 002364' call timdel ; Otherwise, whack the timer 45283 001723'01 endif. ; End timer removal decisioning 45284 001723'01 263 17 0 00 000000 ret ; Returns +1, always 45285 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26 K20SUB MAC 20-Aug-24 02:18 file transfer error post processing 45286 subttl file transfer error post processing 45287 45288 ; Come here to close a partially received file. It will be discarded 45289 ; or kept, depending on setting of ABTFIL, i.e. SET INCOMPLETE (FILE 45290 ; DISPOSTION). 45291 45292 001724'01 giveup: entry giveup ;[213] Moved from K20MIT to fix 45293 extern abtfil ;[213] Whether to discard a partial file 45294 extern local ;[213] Set if talking to a Kermit server 45295 45296 001724'01 336 00 0 00 000000* ifmn. abtfil ;[134] Do we discard or keep? ;[194] 45297 001725'01 254 00 0 00 001742' 45298 001726'01 265 01 0 00 000207' wtlog (, filjfn) ;[233] Keep. 45299 001727'01 000000000000# 45300 001730'01 777777 777753 45301 001731'01 000000000000# 45302 000160'04 111 156 143 157 155 45303 001732'01 336 00 0 00 000000* ifmn. local ;[194] If local, safe to type 45304 001733'01 254 00 0 00 001737' 45305 001734'01 200 01 0 00 000000# txmsg <[keeping partial file]> ;[194] 45306 001735'01 104 00 0 00 000076 45307 001736'01 320 12 0 00 001737' 45308 000005'03 000000000000# 45309 000165'04 133 153 145 145 160 45310 001737'01 endif. 45311 001737'01 260 17 0 00 001773' call rdclos ; Go close as much of it as we have. 45312 ; fails through to wtlog, below 45313 001740'01 254 00 0 00 001742' anskp. ;[194] Discard it if we have some problem. 45314 001741'01 263 17 0 00 000000 ret ; Closed partial file OK. 45315 001742'01 endif. ;[194] 45316 45317 001742'01 265 01 0 00 000207' wtlog (,filjfn) ;[233] Discard. 45318 001743'01 000000000000# 45319 001744'01 777777 777746 45320 001745'01 000000000000# 45321 000172'04 111 156 143 157 155 45322 001746'01 336 00 0 00 001732* ifmn. local ;[194] If local, safe to type 45323 001747'01 254 00 0 00 001753' 45324 001750'01 200 01 0 00 000000# txmsg <[discarding]> ;[194] Say what we're up to. 45325 001751'01 104 00 0 00 000076 45326 001752'01 320 12 0 00 001753' 45327 000006'03 000000000000# 45328 000200'04 133 144 151 163 143 45329 001753'01 endif. ;[194] 45330 001753'01 337 00 0 00 000000* ifmg. filjfn ; Real file? 45331 001754'01 254 00 0 00 001771' 45332 001755'01 260 17 0 00 002105' call unmapo ; Go unmap the file 45333 001756'01 600 00 0 00 000000 nop ; Don't worry if we can't. 45334 001757'01 550 01 0 00 001753* hrrz t1, filjfn ; Clear out any junk from left half. 45335 001760'01 306 01 0 00 377777 cain t1, .nulio ;[193] Just tossing it anyway? 45336 001761'01 254 00 0 00 001771' anskp. ;[193] Yes, so nothing to ditch 45337 001762'01 661 01 0 00 004000 txo t1, cz%abt ; Discarding, so cancel the file. 45338 001763'01 104 00 0 00 000022 CLOSF% ; Close it. 45339 001764'01 320 12 0 00 001766' ifje. r ;[194] 45340 001765'01 254 00 0 00 001771' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 26-1 K20SUB MAC 20-Aug-24 02:18 file transfer error post processing 45341 001766'01 550 01 0 00 001757* hrrz t1, filjfn ;[194] On any error, 45342 001767'01 104 00 0 00 000023 RLJFN ; at least try to release the JFN. 45343 001770'01 320 12 0 00 001771' erjmpr .+1 ;[194] Catch and ignore error 45344 001771'01 endif. ;[194] End case CLOSF% recovery (we hope) 45345 001771'01 endif. ;[193] End case actual JFN to close 45346 45347 001771'01 402 00 0 00 001766* setzm filjfn ; Say we have no file. 45348 001772'01 263 17 0 00 000000 ret 45349 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27 K20SUB MAC 20-Aug-24 02:18 Close the output file, update the FDB, etc... 45350 subttl Close the output file, update the FDB, etc... 45351 45352 ; Return +1 on error, +2 on success. 45353 45354 001773'01 rdclos: entry rdclos ;[213] Moved from k20mit 45355 001773'01 265 16 0 00 004262' saveac ;[232] Needs a few extra registers 45356 extern ebtflg ;[213] Set if doing an 8 bit file 45357 extern tbtflg ;[232] Set if forcing a 36 bit file 45358 extern itsfil ;[213] ITS binary format file 45359 45360 001774'01 337 00 0 00 001771* skipg filjfn ;[103] Output was to a real file? 45361 001775'01 254 00 0 00 002103' jrst rdclsz ;[103] No, skip all this. 45362 001776'01 260 17 0 00 002105' call unmapo ; First, clean out the PMAPing page. 45363 001777'01 263 17 0 00 000000 ret ; Oops, failed, pass it along... 45364 45365 ;[232] Calculate values FIRST 45366 45367 002000'01 120 05 0 00 004342' rdclsv: dmove q1,[exp ^d7,^d5] ;[232] Assume ASCII and its packing factor 45368 002001'01 336 00 0 00 000000* skipn itsfil ;[75] ITS binary file? 45369 002002'01 332 00 0 00 000000* skipe ebtflg ; Or eight-bit mode? 45370 002003'01 120 05 0 00 004344' dmove q1,[exp ^d8,^d4];[232] Then load that value 45371 002004'01 332 00 0 00 000000* skipe tbtflg ;[232] Forcing 36 bit mode? 45372 002005'01 120 05 0 00 004346' dmove q1,[exp ^d36,^d5];[232] Assume words and decode factor 45373 45374 002006'01 302 05 0 00 000044 caie q1, ^d36 ;[232] Forcing 36 bit bytes? 45375 002007'01 254 00 0 00 002017' ifskp. ;[232] Yes, tweak that 45376 002010'01 200 03 0 00 000012 move t3, rchr ;[232] Load number of file bytes 45377 002011'01 400 02 0 00 000000 setz t2, ;[232] No high order!!! 45378 002012'01 234 02 0 00 000006 div t2, q2 ;[232] Compute WORDS used 45379 002013'01 302 03 0 00 000000 caie t3, 0 ;[232] Evenly divided? 45380 002014'01 354 06 0 00 000002 aosa q2, t2 ;[232] No, so bump up a word, store and skip 45381 002015'01 200 06 0 00 000002 move q2, t2 ;[232] Otherwise, just store words 45382 002016'01 254 00 0 00 002020' else. ;[232] Otherwise, no calculations needed 45383 002017'01 200 06 0 00 000012 move q2, rchr ;[232] Just load the number of file bytes 45384 002020'01 endif. ;[232] End case 36 bit fix up 45385 45386 ; Now close the file. 45387 45388 002020'01 550 01 0 00 001774* rdclsa: hrrz t1, filjfn ;[193] Get the JFN. 45389 002021'01 306 01 0 00 377777 cain t1, .nulio ;[193] Tossing? 45390 002022'01 254 00 0 00 002050' jrst rdclsc ;[232] Skip all this fdb stuff 45391 002023'01 661 01 0 00 400000 txo t1, co%nrj ;[193] Set flag for not releasing JFN. 45392 002024'01 104 00 0 00 000022 CLOSF% ; Close it. 45393 002025'01 320 14 0 00 002027' %jsker ,r ; Return error. 45394 002026'01 254 00 0 00 002032' 45395 002027'01 265 01 0 00 000035' 45396 002030'01 000000000000# 45397 002031'01 254 00 0 00 001636* 45398 000203'04 103 141 156 047 164 45399 45400 ; Update FDB information with correct byte size and (word) count 45401 45402 002032'01 505 01 0 00 000011 hrli t1, .fbbyv ;[232] Set the byte size, first. 45403 002033'01 540 01 0 00 002020* hrr t1, filjfn 45404 002034'01 660 00 0 00 000001 txo, t1, k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27-1 K20SUB MAC 20-Aug-24 02:18 Close the output file, update the FDB, etc... 45405 002035'01 400000 000000 cf%nud ;[232] Don't update disk yet. 45406 002036'01 205 02 0 00 007700 movx t2, fb%bsz ; Byte size field mask. 45407 002037'01 137 05 0 00 004350' dpb q1,[pointr(t3,fb%bsz)] ;[232] Put in proper place 45408 002040'01 104 00 0 00 000064 CHFDB% 45409 002041'01 320 14 0 00 002042' erjmps .+1 ; Keep going if we get an error. 45410 45411 002042'01 505 01 0 00 000012 hrli t1, .fbsiz ; OK, now fix FDB. Set the number of bytes 45412 002043'01 540 01 0 00 002033* hrr t1, filjfn ; Move in the JFN. 45413 002044'01 474 02 0 00 000000 seto t2, ; Change all bits in the word. 45414 002045'01 200 03 0 00 000006 move t3, q2 ;[232] The number of bytes (or words) in the file. 45415 002046'01 104 00 0 00 000064 CHFDB% ;[232] This time, update the FDB 45416 002047'01 320 14 0 00 002050' erjmps .+1 ; Keep going if we get an error. 45417 45418 ;[126] Take care of any transaction logging. 45419 45420 002050'01 333 00 0 00 002043* rdclsc: skiple filjfn ;[193] Real file? 45421 002051'01 337 01 0 00 000215* skipg t1, tlgjfn ; Transaction log? 45422 002052'01 254 00 0 00 002071' jrst rdclsd ;[232] No, skip this. 45423 45424 002053'01 120 02 0 00 000000# smsg (< Written: >) ; Yes, log this info. 45425 002054'01 260 17 0 00 000330' 45426 000007'03 000000000000# 45427 000010'03 777777 777764 45428 000207'04 040 040 040 127 162 45429 002055'01 200 02 0 00 000006 move t2, q2 ;[232] Load the byte count 45430 002056'01 201 03 0 00 000012 movei t3, ^d10 45431 002057'01 104 00 0 00 000224 NOUT 45432 002060'01 320 14 0 00 002061' erjmps .+1 45433 002061'01 201 02 0 00 000040 movei t2, .chspc ;[194] A space 45434 002062'01 104 00 0 00 000051 BOUT 45435 002063'01 320 14 0 00 002064' erjmps .+1 45436 002064'01 200 02 0 00 000005 move t2, q1 ;[232] Load byte size 45437 002065'01 104 00 0 00 000224 NOUT 45438 002066'01 320 14 0 00 002067' erjmps .+1 45439 smsg (<-bit bytes 45440 002067'01 120 02 0 00 000000# >) 45441 002070'01 260 17 0 00 000330' 45442 000011'03 000000000000# 45443 000012'03 777777 777764 45444 000212'04 055 142 151 164 040 45445 45446 45447 ; Finish closing the output file by releasing its JFN. 45448 45449 002071'01 337 00 0 00 002050* rdclsd: skipg filjfn ;[126] ;[194] 45450 002072'01 254 00 0 00 002077' ifskp. ;[194] File was open 45451 002073'01 265 01 0 00 000207' wtlog (,filjfn) ;[233] Transaction log message. 45452 002074'01 000000000000# 45453 002075'01 777777 777771 45454 002076'01 000000000000# 45455 000215'04 103 154 157 163 145 45456 002077'01 endif. ;[194] 45457 002077'01 550 01 0 00 002071* hrrz t1, filjfn ; Release the JFN. 45458 002100'01 302 01 0 00 377777 caie t1, .nulio ;[193] Nothing to release 45459 002101'01 104 00 0 00 000023 RLJFN% k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 27-2 K20SUB MAC 20-Aug-24 02:18 Close the output file, update the FDB, etc... 45460 002102'01 600 00 0 00 000000 nop 45461 45462 002103'01 402 00 0 00 002077* rdclsz: setzm filjfn ; Say we have no more file. 45463 002104'01 254 00 0 00 001715* retskp 45464 45465 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28 K20SUB MAC 20-Aug-24 02:18 Clean up the file mapping page for an output file. 45466 subttl Clean up the file mapping page for an output file. 45467 45468 ; Returns +1 on failure, +2 on success. 45469 ; On failure, an error packet is sent, which cancels the transfer. 45470 ; 45471 ; Uses t1,t2,t3. 45472 ; 45473 ; Note that unmapping the memory page also makes it disappear. The 45474 ; next write to the page will create a fresh page with all 0's. 45475 ; 45476 ; The trick at the beginning catches the case where the page has 45477 ; already been unmapped because we just filled in the last byte. 45478 ; Since this routine is called both by the page filler (PUTCH) and by 45479 ; the file closer (RDCLOS, to catch a final partial page), we must 45480 ; worry about files that end on a page boundary. 45481 ; 45482 ; Putting an ERJMP after any instruction that references memory will 45483 ; catch "illegal memory read" errors, and will thus prevent us from 45484 ; attempting to unmap a page that has already been unmapped and still 45485 ; has not been written into. 45486 45487 002105'01 unmapo: entry unmapo ;[213] Moved from k20mit 45488 extern pagno ;[213] Present page number in file 45489 45490 002105'01 200 01 0 00 007000 move t1, maporg ;[190] Has the page been used at all? 45491 002106'01 320 14 0 00 002104* erjmps rskp ;[213] No, done. 45492 45493 002107'01 200 01 0 00 004351' movx t1, <.fhslf,,mappag> ; Yes, map them out, our fork,,mapping page 45494 002110'01 514 02 0 00 002103* hrlz t2, filjfn ;[193] file JFN,,... 45495 002111'01 312 02 0 00 004352' came t2,[ (.nulio) ] ;[193] Just dumping it? 45496 002112'01 254 00 0 00 002115' ifskp. ;[193] Yes, so just pitch the memory 45497 002113'01 260 17 0 00 002135' call unmapa ;[213] Unmap and abort 45498 002114'01 254 00 0 00 002106* retskp ;[193] Nothing further to do 45499 002115'01 endif. ;[193] End case cleaning up a NUL: transfer 45500 45501 remark ;[193] Otherwise, had a real file mapped 45502 002115'01 326 12 0 00 002120' ife. rchr ;[213] But!! Did we ever get any data? 45503 002116'01 260 17 0 00 002135' call unmapa ;[213] Unmap and abort 45504 002117'01 254 00 0 00 002114* retskp ;[213] That was easy enough; we're done 45505 002120'01 endif. ;[213] Otherwise, non-zero file 45506 45507 002120'01 540 02 0 00 000000* hrr t2, pagno ; ...page file page number. 45508 002121'01 205 03 0 00 140000 movx t3, pm%rd!pm%wr ; Read and write access. 45509 002122'01 104 00 0 00 000056 PMAP% ; Map it out. 45510 002123'01 320 14 0 00 002125' %jsker (,r) ; Can't - fail. 45511 002124'01 254 00 0 00 002130' 45512 002125'01 265 01 0 00 000035' 45513 002126'01 000000 000000 45514 002127'01 254 00 0 00 002031* 45515 45516 remark ;[193] This isn't really necessary, but.. 45517 002130'01 550 01 0 00 002110* hrrz t1,filjfn ;[193] Load file JFN 45518 002131'01 200 02 0 00 000012 move t2, rchr ;[193] Load current character count 45519 002132'01 104 00 0 00 000027 SFPTR% ;[193] Show for nosey people on SYSDPY 45520 002133'01 320 12 0 00 002134' erjmpr .+1 ;[193] Ignore any error k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 28-1 K20SUB MAC 20-Aug-24 02:18 Clean up the file mapping page for an output file. 45521 002134'01 254 00 0 00 002117* retskp 45522 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 29 K20SUB MAC 20-Aug-24 02:18 Abort an output page 45523 subttl Abort an output page 45524 45525 ; Used to punt a page instead mapping out to disk 45526 ; 45527 ; t1/ fork handle,,page number 45528 ; 45529 ; Typically .fhslf,,file mapping page 45530 ; 45531 ; Returns +1, always 45532 45533 002135'01 unmapa: remark t1, <.fhslf,,mappag> ;[213] Our expectations 45534 002135'01 200 02 0 00 000001 move t2, t1 ;[213] For Case IV, destination is process memory 45535 002136'01 474 01 0 00 000000 seto t1, ;[213] Which we will be whacking 45536 002137'01 400 03 0 00 000000 setz t3, ;[213] No flags, no count 45537 002140'01 104 00 0 00 000056 PMAP% ;[213] Kick the page into oblivion 45538 002141'01 320 14 0 00 002143' %jsker (,r) ;[193] Not promising, but ignore 45539 002142'01 254 00 0 00 002146' 45540 002143'01 265 01 0 00 000035' 45541 002144'01 000000000000# 45542 002145'01 254 00 0 00 002127* 45543 000217'04 103 157 165 154 144 45544 002146'01 263 17 0 00 000000 ret ;[213] And return 45545 45546 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30 K20SUB MAC 20-Aug-24 02:18 Save and restore terminal lengths (a.k.a., heights) and widths. 45547 subttl Save and restore terminal lengths (a.k.a., heights) and widths. 45548 45549 ;[185] Begin code insertion 45550 ;[185] 45551 ;[185] This is necessary because linear dimensions in excess of seven 45552 ;[185] bits (127) can not be stored in the JFN mode word as saved by 45553 ;[185] SFMOD% and restored by STPAR% 45554 ;[185] 45555 ;[185] As these are stored in halfwords, this allows for a maximum of 45556 ;[185] 262,143 for either a width or a length. As this is two decimal 45557 ;[185] orders of magnitude larger than the highest resolution graphics 45558 ;[185] cards (4096 in 2006), we probably don't have to worry about 45559 ;[185] overflowing the field for the next decade or so. None the 45560 ;[185] less, the MTOPR% does return a FULL 36 bit word; so if we ever 45561 ;[185] overflow 18 bits, then we should change this code. 45562 ;[185] 45563 ;[185] Assumes: 45564 ;[185] 45565 ;[185] t1/ Valid terminal JFN (possibly .PRIOU) 45566 ;[185] t2/ Pointer to block to save length and width 45567 ;[185] 45568 ;[185] Preserves the register file and is completely silent about errors. 45569 45570 002147'01 savlnw: entry savlnw ;[183] Globally available 45571 002147'01 265 16 0 00 004353' saveac ;[185] Do not side-effect the register file! 45572 002150'01 120 04 0 00 000001 dmove t4, t1 ;[185] Preserve JFN, dimension block address 45573 ;[185] 45574 002151'01 104 00 0 00 000117 DVCHR% ;[185] What kind of device is this? 45575 002152'01 320 12 0 00 002145* erjmpr r ;[185] it's a bogus device! 45576 002153'01 135 03 0 00 004252' load t3, dv%typ, t2 ;[185] Get device type field 45577 002154'01 302 03 0 00 000012 caie t3, .dvtty ;[185] Is this a terminal? 45578 002155'01 263 17 0 00 000000 ret ;[185] No, better leave it alone 45579 002156'01 200 01 0 00 000004 move t1, t4 ;[185] Restore the JFN 45580 ;[185] Assume infinite (and therefore useless) 45581 002157'01 403 03 0 05 000000 setzb t3, (q1) ;[185] defaults for width and length 45582 002160'01 201 02 0 00 000032 movx t2, .morll ;[185] Return the terminal page length 45583 002161'01 104 00 0 00 000077 MTOPR% ;[185] Which may be over 127 ... 45584 002162'01 320 14 0 00 002164' erjmps .+2 ;[185] Must be a bogus JFN 45585 002163'01 506 03 0 05 000000 hrlm t3, (q1) ;[185] Save length 45586 002164'01 120 02 0 00 004367' dmove t2,[exp .morlw,0] ;[185] Return the terminal page width. 45587 002165'01 104 00 0 00 000077 MTOPR% ;[185] Which may be over 127 ... 45588 002166'01 320 14 0 00 002170' erjmps .+2 ;[185] Must be a bogus JFN 45589 002167'01 542 03 0 05 000000 hrrm t3, (q1) ;[185] Save length 45590 002170'01 263 17 0 00 000000 ret ;[185] Done, restore register file 45591 45592 002171'01 rstlnw: entry rstlnw ;[194] Globally available 45593 002171'01 265 16 0 00 004353' saveac ;[185] Do not side-effect the register file! 45594 002172'01 120 04 0 00 000001 dmove t4, t1 ;[185] Preserve JFN, dimension block address 45595 ;[185] 45596 002173'01 104 00 0 00 000117 DVCHR% ;[185] What kind of device is this? 45597 002174'01 320 12 0 00 002152* erjmpr r ;[185] it's a bogus device! 45598 002175'01 135 03 0 00 004252' load t3, dv%typ, t2 ;[185] Get device type field 45599 002176'01 302 03 0 00 000012 caie t3, .dvtty ;[185] Is this a terminal? 45600 002177'01 263 17 0 00 000000 ret ;[185] No, better leave it alone 45601 002200'01 200 01 0 00 000004 move t1, t4 ;[185] Restore the JFN k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 30-1 K20SUB MAC 20-Aug-24 02:18 Save and restore terminal lengths (a.k.a., heights) and widths. 45602 ;[185] 45603 002201'01 201 02 0 00 000033 movx t2, .mosll ;[185] Set the terminal page length. 45604 002202'01 554 03 0 05 000000 hlrz t3, (q1) ;[185] Load old width 45605 002203'01 302 03 0 00 000000 caie t3, 0 ;[185] Ever get anything? If not, leave 45606 002204'01 104 00 0 00 000077 MTOPR% ;[185] it alone; otherwise restore it 45607 002205'01 320 14 0 00 002206' erjmps .+1 ;[185] Ignore errors, preserve JFN 45608 002206'01 201 02 0 00 000031 movx t2, .moslw ;[185] Set the terminal page width. 45609 002207'01 550 03 0 05 000000 hrrz t3, (q1) ;[185] Load old width 45610 002210'01 302 03 0 00 000000 caie t3, 0 ;[185] Ever get anything? If not, leave 45611 002211'01 104 00 0 00 000077 MTOPR% ;[185] it alone; otherwise restore it 45612 002212'01 320 14 0 00 002213' erjmps .+1 ;[185] Ignore errors, preserve JFN 45613 002213'01 263 17 0 00 000000 ret ;[185] Done, restore register file 45614 45615 ;[185] End code insertion 45616 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31 K20SUB MAC 20-Aug-24 02:18 interrupt storage (pure) 45617 subttl interrupt storage (pure) 45618 45619 extern frtrap ;[186] Is in K20NET 45620 emacro < 45621 extern sitrap ;[203] .sigio check is in K20MAC 45622 > 45623 45624 002214'01 000000000000# levtab: pc1 45625 002215'01 000000000000# pc2 45626 002216'01 000000000000# pc3 45627 45628 000000 chntab: phase 0 45629 000000 000001 002402' tmchan: 1,,tmtrap ;[194] ; Timer trap on channel 0, priority 1. 45630 000001 000001 002747' ccchan: 1,,cctrap ; ^C trap on channel 1, same priority. 45631 000002 000002 002764' cachan: 2,,catrap ; ^A trap on channel 2, lower priority. 45632 000003 000002 003220' cxchan: 2,,cxtrap ; ^X trap on channel 3... 45633 000004 000002 003234' czchan: 2,,cztrap ; ^Z trap .... 4 45634 000005 000002 003245' cmchan: 2,,cmtrap ; ^M trap .... 5 45635 000006 block 1 ; .ICAOV==:6, not trapping arithmetic overflow 45636 000007 block 1 ; .ICFOV==:7, not trapping floating overflow 45637 000010 block 1 ; ^d8, Reserved for Digital 45638 000011 block 1 ; .ICPOV==:9, not trapping PDL overflow 45639 000012 block 1 ; .ICEOF==:10, not trapping End-of-File 45640 000013 block 1 ; .ICDAE==:11, not trapping, Data Error 45641 000014 block 1 ; .ICQTA==:12, not trapping Quota/Disk Exceeded 45642 000015 block 1 ; ^d13, Reserved for Digital 45643 000016 block 1 ; .ICTOD==:14, not trapping Time of Day (not implemented) 45644 000017 block 1 ; .ICILI==:15, not trapping Illegal Instruction 45645 000020 block 1 ; .ICIRD==:16, not trapping Illegal Read 45646 000021 block 1 ; .ICIWR==:17, not trapping Illegal Write 45647 000022 block 1 ; .ICIEX==:18, not trapping Illegal Execute (TENEX only) 45648 emacro < 45649 sigchn: 3,,sitrap ;[203] .ICIFT==:19, multiplexed with .SIGIO 45650 >;;emacro 45651 nmacro < block 1 ; .ICIFT==:19, Inferior Fork Termination 45652 000023 >;;nmacro 45653 000024 block 1 ; .ICMSE==:20, not trapping machine resources exhausted 45654 000025 block 1 ; .ICTRU==:21, not trapping to user (?) 45655 000026 block 1 ; .ICNXP==:22, not trapping nonexistent page referenced 45656 000027 000002 003255' cpchan: 2,,cptrap ; ^P trap on channel 23 45657 000030 000003 000000* frkchn: 3,,frtrap ;[186] Fork interrupt on channel 24 45658 000031 000003 003271' cychan: 3,,cytrap ;[187] ^Y trap on channel 25, level 3 45659 000032 000003 000000* dnchan: 3,,dntrap ;[218] For DECnet connection trap 45660 000033 block ^d36-. 45661 002263'01 dephase 45662 45663 ifn <<.-^d36>-chntab>,< ;;Did we get this right? 45664 printx Channel definitions are wrong 45665 end ;;Just stop and get this fixed 45666 > 45667 intern frkchn ;[186] Used by K20NET 45668 45669 remark bits for certain channels 45670 45671 004000 frkchb==:1b ;[186] Bit for fork channel k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 31-1 K20SUB MAC 20-Aug-24 02:18 interrupt storage (pure) 45672 400000 000000 timchb==:1b ;[186] Bit for TIMER% channel 45673 emacro < 45674 sigchb==:1b ;[203] Bit for macro reparse issues channel 45675 >;;emacro 45676 45677 001000 dnchb==:1b ;[218] Bit for DECnet connection channel 45678 extern dntrap ;[218] DECnet connection handler is in k20net 45679 45680 ;[218] DECnet connect interrupt field (ALL OTHERS MUST BE OFF!!!) 45681 032776 776000 dncfld==:fld(dnchan,mo%cdn)!fld(.mocia,mo%ina)!fld(.mocia,mo%dav) 45682 45683 ;[218] DECnet disconnect interrupt field (EVERYTHING MUST BE OFF!!!) 45684 776776 776000 dndfld==:fld(.mocia,mo%cdn)!fld(.mocia,mo%ina)!fld(.mocia,mo%dav) 45685 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32 K20SUB MAC 20-Aug-24 02:18 timeit -- Creates a TIMER% to pop after an elapsed time 45686 subttl timeit -- Creates a TIMER% to pop after an elapsed time 45687 45688 ; Set a timer. Call with t1/ Address of where to go upon timout. 45689 ; 45690 ;[212] All timeouts are pre-computed to milliseconds; bums the imuli 45691 ; and allows more granular control which is good for testing 45692 ; 45693 ;[218] Can not pass .infin in t2 (with a hrloi t2, 377777, for 45694 ; example) because the math in .TIMBF (just after TIMDL2: in 45695 ; TIMER.MAC) doesn't come out correctly. Use .TIMAL, instead as 45696 ; this will remove all timers. 45697 ; 45698 ; The fact that it removes a job run time limit need not bother 45699 ; Kermit as Kermit never sets this, it is fork unique and is set 45700 ; directly by BATCON on job creation before Kermit is anywhere 45701 ; near in user memory. 45702 ; 45703 ; N.B., Note the order of the TIMER% and AIC% calls 45704 45705 002263'01 400000 000005 alltim: xwd .fhslf, .timal ;[218] Remove ALL timers for this fork 45706 002264'01 000000 000000 0 ;[219] Just in case it wants this 45707 45708 extern adjtim, ldav ; Moved to K20TIM 45709 45710 002265'01 timeit: entry timeit ; Inform LINK of our location and necessaries 45711 extern stimou, intstk, intpc, timerx, curtim 45712 002265'01 337 00 0 00 000000* skipg stimou ;[43] Doing timeouts? 45713 002266'01 263 17 0 00 000000 ret ;[43] No, skip this. 45714 002267'01 262 17 0 00 000002 pop p, t2 ; Get the return address off the stack. 45715 002270'01 202 17 0 00 000000* movem p, intstk ; Save the stack pointer 45716 002271'01 261 17 0 00 000002 push p, t2 ; Put the return address back 45717 002272'01 540 02 0 00 000001 hrr t2, t1 ; Make interrupt PC point to time out addr. 45718 002273'01 202 02 0 00 000000* movem t2, intpc ; Save the PC. 45719 002274'01 120 01 0 00 002263' dmove t1, alltim ;[218] Remove any previous TIMER%'s, FIRST 45720 002275'01 104 00 0 00 000522 TIMER 45721 002276'01 320 12 0 00 002300' ifje. r ;[194] Catch and ignore error 45722 002277'01 254 00 0 00 002302' 45723 002300'01 202 01 0 00 000000# movem t1, ltimde ;[194] Store last timer delete error 45724 002301'01 350 00 0 00 000000* aos timerx ; Count any error. 45725 002302'01 endif. ;[194] 45726 45727 remark ;[218] THEN set the new timer 45728 002302'01 400 01 0 00 000000 setz t1, ;[130] Get 1-minute load average. 45729 002303'01 260 17 0 00 000000* call ldav ;[130] 45730 002304'01 200 02 0 00 002265* move t2, stimou ;[130] Minimum acceptable. 45731 002305'01 260 17 0 00 000000* call adjtim ;[128] Adjust based on load average. 45732 002306'01 202 02 0 00 000000* movem t2, curtim ;[131] Remember this for reporting. 45733 002307'01 200 01 0 00 004371' move t1, [ .fhslf,,.timel ] ; Our process and time from now. 45734 002310'01 201 03 0 00 000000 movx t3, tmchan ;[218] Load timer channel 45735 002311'01 104 00 0 00 000522 TIMER 45736 002312'01 320 12 0 00 002314' ifje. r ;[194] Catch and ignore error 45737 002313'01 254 00 0 00 002317' 45738 002314'01 202 01 0 00 000000# movem t1, ltimcr ;[194] Store last timer creation error 45739 002315'01 350 00 0 00 002301* aos timerx ; If we get an error, count it. 45740 002316'01 254 00 0 00 002325' else. ;[218] Otherwise, worked k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 32-1 K20SUB MAC 20-Aug-24 02:18 timeit -- Creates a TIMER% to pop after an elapsed time 45741 remark ;[218] So safe to turn on the channel 45742 dmove t1, [ .fhslf ;[218] This fork 45743 002317'01 120 01 0 00 004372' timchb ] ;[218] TIMER% channel 45744 002320'01 104 00 0 00 000131 AIC ; Turn the channel on 45745 002321'01 320 12 0 00 002323' ifje. r ;[194] Catch and ignore error 45746 002322'01 254 00 0 00 002325' 45747 002323'01 202 01 0 00 000000# movem t1, laicer ;[194] However, remember it 45748 002324'01 350 00 0 00 000000# aos aicx ;[194] and count it 45749 002325'01 endif. ;[218] 45750 002325'01 endif. ;[194] 45751 45752 002325'01 263 17 0 00 000000 ret 45753 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 33 K20SUB MAC 20-Aug-24 02:18 timeon - Create a TIMER% to pop after an elapsed time 45754 subttl timeon - Create a TIMER% to pop after an elapsed time 45755 45756 ; Set a timer based in input parameter 45757 ; 45758 ; Call: 45759 ; 45760 ; t1/ Address of where to go upon timout. 45761 ; t2/ Time in milliseconds to wait 45762 ; 45763 ; N.B., All timeouts are pre-computed to milliseconds and these are 45764 ; not load average adjusted because that is the responsibility of 45765 ; the caller. The reason for this is, if you are waiting on a 45766 ; network interupt, then the remote system is the major source of 45767 ; delay, not the local one. 45768 ; 45769 ; Note the order of the TIMER% and AIC% calls 45770 45771 002326'01 timeon: entry timeon ; Inform LINK of our location and necessaries 45772 002326'01 200 04 0 00 000002 move t4, t2 ;[218] Let's just get the wait out of the way 45773 002327'01 262 17 0 00 000002 pop p, t2 ; Get the return address off the stack. 45774 002330'01 202 17 0 00 002270* movem p, intstk ; Save the stack pointer 45775 002331'01 261 17 0 00 000002 push p, t2 ; Put the return address back 45776 002332'01 540 02 0 00 000001 hrr t2, t1 ; Make interrupt PC point to time out addr. 45777 002333'01 202 02 0 00 002273* movem t2, intpc ; Save the PC. 45778 002334'01 120 01 0 00 002263' dmove t1, alltim ;[218] Remove any pending timers, FIRST 45779 002335'01 104 00 0 00 000522 TIMER 45780 002336'01 320 12 0 00 002340' ifje. r ;[194] Catch and ignore error 45781 002337'01 254 00 0 00 002342' 45782 002340'01 202 01 0 00 000000# movem t1, ltimde ;[194] Store last timer delete error 45783 002341'01 350 00 0 00 002315* aos timerx ; Count any error. 45784 002342'01 endif. ;[194] 45785 45786 remark ;[218] THEN set the new timer 45787 002342'01 200 01 0 00 004371' move t1, [.fhslf,,.timel] ; Our process and time from now. 45788 002343'01 200 02 0 00 000004 move t2, t4 ;[218] Load hard wall time 45789 002344'01 201 03 0 00 000000 movx t3, tmchan ;[218] Load timer channel 45790 002345'01 104 00 0 00 000522 TIMER% 45791 002346'01 320 12 0 00 002350' ifje. r ;[194] Catch and ignore error 45792 002347'01 254 00 0 00 002353' 45793 002350'01 202 01 0 00 000000# movem t1, ltimcr ;[194] Store last timer creation error 45794 002351'01 350 00 0 00 002341* aos timerx ; If we get an error, count it. 45795 002352'01 254 00 0 00 002361' else. ;[218] Otherwise, worked 45796 remark ;[218] So safe to turn on the channel 45797 dmove t1, [ .fhslf ;[218] This fork 45798 002353'01 120 01 0 00 004372' timchb ] ;[218] TIMER% channel 45799 002354'01 104 00 0 00 000131 AIC% ; Turn the channel on 45800 002355'01 320 12 0 00 002357' ifje. r ;[194] Catch and ignore error 45801 002356'01 254 00 0 00 002361' 45802 002357'01 202 01 0 00 000000# movem t1, laicer ;[194] However, remember it 45803 002360'01 350 00 0 00 000000# aos aicx ;[194] and count it 45804 002361'01 endif. ;[194] 45805 002361'01 endif. ;[194] 45806 45807 002361'01 263 17 0 00 000000 ret 45808 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 34 K20SUB MAC 20-Aug-24 02:18 TIMOFF - Shut off TIMER channel, clear all timers 45809 subttl TIMOFF - Shut off TIMER channel, clear all timers 45810 45811 ; N.B., Note order of DIC% and TIMER%!! 45812 45813 002362'01 timoff: entry timoff ;[194] Identify our location to LINK 45814 002362'01 337 00 0 00 002304* skipg stimou ;[43] Doing timeouts? 45815 002363'01 263 17 0 00 000000 ret ;[43] No, skip this. 45816 45817 002364'01 timdel: entry timdel ;[218] Force a timer delete 45818 002364'01 265 16 0 00 004150' saveac ; Yes, save these ACs. 45819 dmove t1, [ .fhslf ;[218] This fork 45820 002365'01 120 01 0 00 004372' timchb ] ;[218] TIMER% channel 45821 002366'01 104 00 0 00 000133 DIC% ;[194] Shut off before timer can pop! 45822 002367'01 320 12 0 00 002371' ifje. r ;[194] Catch and ignore error 45823 002370'01 254 00 0 00 002373' 45824 002371'01 202 01 0 00 000000# movem t1, ldicer ;[194] However, remember it 45825 002372'01 350 00 0 00 000000# aos dicx ;[194] and count it 45826 002373'01 endif. ;[194] 45827 002373'01 120 01 0 00 002263' dmove t1, alltim ;[218] Whack any and all pending timers 45828 002374'01 104 00 0 00 000522 TIMER 45829 002375'01 320 12 0 00 002377' ifje. r ;[194] Catch and ignore error 45830 002376'01 254 00 0 00 002401' 45831 002377'01 202 01 0 00 000000# movem t1, ltimde ;[194] Store last timer delete error 45832 002400'01 350 00 0 00 002351* aos timerx ; Count any error. 45833 002401'01 endif. ;[194] 45834 45835 002401'01 263 17 0 00 000000 ret 45836 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 35 K20SUB MAC 20-Aug-24 02:18 caltcb -- Calculate TIMER% channel bit 45837 subttl caltcb -- Calculate TIMER% channel bit 45838 45839 repeat 0,< ;[218] 45840 45841 ; Returns the right bit for the timer channel based on the channel 45842 ; number (which is filled in by LINK) in t2, ready for AIC%/DIC% 45843 45844 Replaced: 45845 45846 skipn t2, tmcbit ; Load the TIMER channel bit 45847 call caltcb ; Unless we don't know it, yet 45848 45849 With: 45850 dmove t1, [ .fhslf ;[218] This fork 45851 timchb ] ;[218] TIMER% channel 45852 45853 caltcb: skipe t2, tmcbit ; Did we already do this? 45854 ret ; Yes, get out of here 45855 45856 saveac ; Save any fork handle 45857 move t1, tmcnum ; Pick up TIMER% channel number 45858 move t2, bitnum(t1) ; Convert to a bit, quickly 45859 movem t2, tmcbit ; Save for later reuse 45860 ret ; Finally done 45861 45862 tmcnum: tmchan ; Timer channel number 45863 45864 thisbt==1b0 ; Start out at bit zero for channel 0 45865 45866 bitnum: intern bitnum ; Also used in k20net 45867 xlist ; No need to see all that blat 45868 repeat ^d36, < ;;Iterate through every possible channel 45869 thisbt ;;Drop in this channel's bit 45870 thisbt== ;;Shift over a bit position 45871 > 45872 list ; Turn listing back on 45873 >;[218] 45874 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 36 K20SUB MAC 20-Aug-24 02:18 TMTRAP -- Timer interrupt handler. 45875 subttl TMTRAP -- Timer interrupt handler. 45876 45877 ; N.B., Using a hrli to break out of a JSYS may not a good idea as it 45878 ; blows away all the flags which somebody might want 45879 45880 002402'01 tmtrap: entry tmtrap ; Identify our location for LINK 45881 extern ntimou ; And our additional necessaries 45882 002402'01 261 17 0 00 000001 push p, t1 ; Get a work AC. 45883 002403'01 200 01 0 00 002333* move t1, intpc ; Get the PC we want. 45884 002404'01 661 01 0 00 010000 txo t1, pc%usr ;[194] ;[132] Set user mode to escape from any jsys. 45885 002405'01 202 01 0 00 000000# movem t1, pc1 ; Restore as if we came from there. 45886 002406'01 262 17 0 00 000001 pop p, t1 45887 002407'01 200 17 0 00 002330* move p, intstk ; Pop any junk off the stack. 45888 002410'01 350 00 0 00 000000* aos ntimou ; Count the timeout. 45889 002411'01 104 00 0 00 000136 DEBRK 45890 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 37 K20SUB MAC 20-Aug-24 02:18 Initialize the Priority Interrupt system. 45891 subttl Initialize the Priority Interrupt system. 45892 45893 002412'01 pinit: entry pinit ;[186] Called at start up 45894 dmove t1, [ .fhslf ; This fork. 45895 002412'01 120 01 0 00 004374' levtab,,chntab] ; Say where our tables are. 45896 002413'01 104 00 0 00 000125 SIR% ;[186] Set Interrupt routines 45897 002414'01 320 12 0 00 002416' %jserr(,) ;[186] Or not 45898 002415'01 254 00 0 00 002421' 45899 002416'01 265 01 0 00 000276' 45900 002417'01 000000 000000 45901 002420'01 254 00 0 00 002421' 45902 002421'01 104 00 0 00 000126 EIR% ; Enable the interrupt system. 45903 002422'01 320 12 0 00 002424' %jserr(,) ;[186] Or not 45904 002423'01 254 00 0 00 002427' 45905 002424'01 265 01 0 00 000276' 45906 002425'01 000000 000000 45907 002426'01 254 00 0 00 002427' 45908 002427'01 263 17 0 00 000000 ret 45909 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38 K20SUB MAC 20-Aug-24 02:18 Enable for Control-C trapping 45910 subttl Enable for Control-C trapping 45911 45912 ; Turn Control-C trap on. Sets things up so that ^C will return control 45913 ; to the instruction FOLLOWING the the call to this routine, with the 45914 ; stack fixed up appropriately, e.g. 45915 ; 45916 ; call ccon ; Turn on ^C trap 45917 ; jrst foo ; What to do if ^C is typed. 45918 ; move x, y ; Execute this after the call to CCON. 45919 ; 45920 ; Returns +2 always. 45921 ; 45922 ;[187] Rewritten to work under batch and not do so many RPCAP%'s and EPCAP%'s 45923 45924 000002 $ccn==2 ; Number of ^C's to get out of ^C trap. 45925 45926 002430'01 ccon: entry ccon 45927 extern ccfail ;[187] 45928 45929 002430'01 335 00 0 00 000000* ifmge. ccfail ;[187] Ever tried this? 45930 002431'01 254 00 0 00 002434' 45931 002432'01 200 03 0 00 000556* move t3, capas ;[187] We have, so load what we got 45932 002433'01 254 00 0 00 002473' jrst ccon2 ;[187] And just go use it 45933 002434'01 endif. ;[187] End case first time through 45934 45935 002434'01 332 03 0 00 002432* skipe t3, capas ;[187] Did we ever look? 45936 002435'01 254 00 0 00 002473' jrst ccon2 ;[187] We did, use what we got 45937 45938 002436'01 201 01 0 00 400000 movei t1, .fhslf ; Read current process capabilities. 45939 002437'01 104 00 0 00 000150 RPCAP% ;[187] Let's have a peek at what we have 45940 002440'01 320 14 0 00 002442' ifje. s ;[187] Catch and suppress error 45941 002441'01 254 00 0 00 002443' 45942 002442'01 120 02 0 00 000577* dmove t2, mycaps ;[187] Use what we first got 45943 002443'01 endif. ;[187] And carry on! 45944 45945 002443'01 336 00 0 00 000000# ifmn. ;[187] Batch frob? 45946 002444'01 254 00 0 00 002452' 45947 002445'01 621 03 0 00 400000 txz t3, sc%ctc ;[187] Say we don't have ^C turned on 45948 002446'01 621 02 0 00 400000 txz t2, sc%ctc ;[187] And that we can't get it, either 45949 002447'01 350 00 0 00 002430* aos ccfail ;[187] Flag other code to not try again 45950 002450'01 202 03 0 00 002434* movem t3, capas ;[187] Stomp the process enabled capas 45951 002451'01 254 00 0 00 002473' jrst ccon2 ;[187] Skip the rest of this cruft 45952 002452'01 endif. ;[187] End batch job case 45953 ;[187] Normal timesharing job from here 45954 002452'01 325 02 0 00 002464' ifxn. t2, sc%ctc ;[187] OK, so can we turn it on? 45955 002453'01 321 03 0 00 002464' andxe. t3, sc%ctc ;[187] And is it currently *NOT* on? 45956 002454'01 661 03 0 00 400000 txo t3, sc%ctc ;[187] So try to turn it on 45957 002455'01 104 00 0 00 000151 EPCAP% ;[187] and do the request 45958 002456'01 320 14 0 00 002457' erjmps .+1 ;[187] Catch and suppress error 45959 002457'01 104 00 0 00 000150 RPCAP% ;[187] Read back; monitor may silently ignore 45960 002460'01 320 14 0 00 002462' ifje. s ;[187] Catch and suppress error 45961 002461'01 254 00 0 00 002464' 45962 002462'01 120 02 0 00 002442* dmove t2, mycaps ;[187] Use what we first got 45963 002463'01 621 03 0 00 400000 txz t3, sc%ctc ;[187] Don't chance it being on 45964 002464'01 endif. ;[187] And get on with it k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 38-1 K20SUB MAC 20-Aug-24 02:18 Enable for Control-C trapping 45965 002464'01 endif. ;[187] End case possible enabling attempt 45966 45967 002464'01 202 03 0 00 002450* movem t3, capas ; Save them. 45968 002465'01 321 03 0 00 002473' ifxe. t3, sc%ctc ;[187] Did it NOT come on?? 45969 002466'01 352 00 0 00 002447* aose ccfail ;[187] Only complain one single time 45970 002467'01 254 00 0 00 002473' anskp. ;[187] Already tried 45971 txmsg <% Kermit-20: Can't enable ^C capability--use ^G instead 45972 002470'01 200 01 0 00 000000# > ;[187] Complain and advise 45973 002471'01 104 00 0 00 000076 45974 002472'01 320 12 0 00 002473' 45975 000013'03 000000000000# 45976 000225'04 045 040 113 145 162 45977 45978 002473'01 endif. ;[187] End case post enable analysis 45979 45980 002473'01 201 01 0 00 000002 ccon2: movei t1, $ccn ; Initialize ^C count to this. 45981 002474'01 202 01 0 00 000000# movem t1, ccn 45982 002475'01 202 17 0 00 000000# movem p, psave ;[27] Save stack pointer. 45983 002476'01 200 01 0 17 000000 move t1, (p) ;[27] And what it points to... 45984 002477'01 202 01 0 00 000000# movem t1, psave2 ;[27] 45985 dmove t1, [ .fhslf ;[187] Now, for this fork, 45986 002500'01 120 01 0 00 004376' 1b ] ;[187] activate channel 1 (^C channel) 45987 002501'01 104 00 0 00 000131 AIC ; ... 45988 002502'01 320 12 0 00 002504' %jserr (,) ;[187] 45989 002503'01 254 00 0 00 002507' 45990 002504'01 265 01 0 00 000276' 45991 002505'01 000000000000# 45992 002506'01 254 00 0 00 002507' 45993 000241'04 125 156 141 142 154 45994 002507'01 200 01 0 00 004400' move t1, [.ticcc,,1] ;[187] Let's assume we have ^C. 45995 002510'01 607 03 0 00 400000 txnn t3, sc%ctc ;[187] Unless we don't... 45996 002511'01 505 01 0 00 000007 hrli t1,.ticcg ;[187] Something familiar, ding! 45997 002512'01 556 01 0 00 000000# hlrzm t1, ccichr ;[219] Store whatever we picked 45998 002513'01 104 00 0 00 000137 ATI 45999 002514'01 320 12 0 00 002516' %jserr (,) ;[187] 46000 002515'01 254 00 0 00 002521' 46001 002516'01 265 01 0 00 000276' 46002 002517'01 000000000000# 46003 002520'01 254 00 0 00 002521' 46004 000253'04 125 156 141 142 154 46005 002521'01 254 00 0 00 002134* retskp 46006 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39 K20SUB MAC 20-Aug-24 02:18 Turn Control-C trap off 46007 subttl Turn Control-C trap off 46008 46009 002522'01 ccoff: entry ccoff ;[186] 46010 extern srvflg ;[186] 46011 46012 002522'01 332 00 0 00 000145* skipe srvflg ;[81] Being a server? 46013 002523'01 263 17 0 00 000000 ret ;[81] Yes, so don't turn off the ^C trap. 46014 46015 ; Entry point for REALLY turning it off, even if server. 46016 46017 002524'01 ccoff2: entry ccoff2 ;[186] 46018 002524'01 265 16 0 00 004401' saveac ; Save these. 46019 002525'01 402 00 0 00 000000# setzm ccn ; Put ^C count back to 0. 46020 dmove t1, [ .fhslf ;[186] This fork. 46021 002526'01 120 01 0 00 004376' 1b ] ;[186] Deactivate channel 1. 46022 002527'01 104 00 0 00 000133 DIC 46023 002530'01 320 12 0 00 002532' %jserr (,) ;[187] 46024 002531'01 254 00 0 00 002535' 46025 002532'01 265 01 0 00 000276' 46026 002533'01 000000000000# 46027 002534'01 254 00 0 00 002535' 46028 000265'04 125 156 141 142 154 46029 46030 remark ;[219] Take the character off the channel 46031 002535'01 200 01 0 00 000000# move t1, ccichr ;[219] Load the interrupt character we used 46032 002536'01 104 00 0 00 000140 DTI ;[219] Pull it 46033 002537'01 320 12 0 00 002541' %jserr (,) ;[187] 46034 002540'01 254 00 0 00 002544' 46035 002541'01 265 01 0 00 000276' 46036 002542'01 000000000000# 46037 002543'01 254 00 0 00 002544' 46038 000277'04 125 156 141 142 154 46039 46040 002544'01 200 04 0 00 002464* ccoff3: move t4, capas ; Get capabilities. 46041 002545'01 200 01 0 00 004413' move t1, [rt%dim!.fhjob] ;[219] This job, both masks 46042 002546'01 607 04 0 00 400000 txnn t4, sc%ctc ;[219] But!! Could we have set job wide? 46043 002547'01 200 01 0 00 004414' move t1, [rt%dim!.fhslf] ;[219] This process, both masks 46044 002550'01 104 00 0 00 000173 RTIW% ;[187] Get the current interrupt mask 46045 002551'01 320 12 0 00 002553' %jserr (, r) ;[187] 46046 002552'01 254 00 0 00 002556' 46047 002553'01 265 01 0 00 000276' 46048 002554'01 000000000000# 46049 002555'01 254 00 0 00 002174* 46050 000311'04 125 156 141 142 154 46051 46052 002556'01 325 04 0 00 002562' ifxn. t4, sc%ctc ;[187] Did we have ^C? 46053 002557'01 621 02 0 00 040000 txz t2, 1b<.chcnc> ; for ^C... (^C = ASCII 3 = bit 3) 46054 002560'01 621 03 0 00 040000 txz t3, 1b<.chcnc> ;[219] Differed ^C 46055 002561'01 254 00 0 00 002564' else. ;[187] No, so must be on ^G 46056 002562'01 621 02 0 00 002000 txz t2, 1b<.chbel> ;[187] for ^G... (^G = ASCII 7 = bit 7) 46057 002563'01 621 03 0 00 002000 txz t3, 1b<.chbel> ;[219] Differed ^G 46058 002564'01 endif. ;[187] Finally have something to set 46059 002564'01 104 00 0 00 000174 STIW% ;[187] Finally fix up the interrupt mask 46060 002565'01 320 12 0 00 002567' %jserr (, r) ;[187] 46061 002566'01 254 00 0 00 002572' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 39-1 K20SUB MAC 20-Aug-24 02:18 Turn Control-C trap off 46062 002567'01 265 01 0 00 000276' 46063 002570'01 000000000000# 46064 002571'01 254 00 0 00 002555* 46065 000322'04 125 156 141 142 154 46066 002572'01 263 17 0 00 000000 ret 46067 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 40 K20SUB MAC 20-Aug-24 02:18 Turn on ^A, ^X, and ^Z interrupts 46068 subttl Turn on ^A, ^X, and ^Z interrupts 46069 46070 ;[59] ^A, ^X, and ^Z interrupt control added as part of edit 59. 46071 46072 002573'01 caxzon: entry caxzon ;[186] 46073 extern caseen, cxseen ;[186] 46074 46075 002573'01 402 00 0 00 000000* setzm cxseen ; Say we haven't seen a ^X yet, 46076 002574'01 402 00 0 00 000000* setzm czseen ; nor a ^Z. 46077 002575'01 402 00 0 00 000000* setzm caseen ; ... 46078 002576'01 336 00 0 00 001746* skipn local ; Only do this if local! 46079 002577'01 263 17 0 00 000000 ret 46080 dmove t1, [ .fhslf ;[194] This fork. 46081 002600'01 120 01 0 00 004415' 1b!1b!1b] ;[194] Turn on the channels. 46082 002601'01 104 00 0 00 000131 AIC% 46083 002602'01 200 01 0 00 004417' move t1, [.ticca,,cachan] ; Put ^A on its channel. 46084 002603'01 104 00 0 00 000137 ATI% 46085 002604'01 200 01 0 00 004420' move t1, [.ticcx,,cxchan] ; Put ^X on its channel. 46086 002605'01 104 00 0 00 000137 ATI% 46087 002606'01 200 01 0 00 004421' move t1, [.ticcz,,czchan] ; And ^Z on its. 46088 002607'01 104 00 0 00 000137 ATI% 46089 002610'01 263 17 0 00 000000 ret 46090 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 41 K20SUB MAC 20-Aug-24 02:18 Turn ^M, ^P interrupts on 46091 subttl Turn ^M, ^P interrupts on 46092 46093 002611'01 cmpon: entry cmpon ;[186] 46094 extern cmseen ;[186] 46095 extern cpseen ;[186] 46096 46097 dmove t1, [ .fhslf ;[194] This fork. 46098 002611'01 120 01 0 00 004422' 1b!1b ] ;[194] These channels. 46099 002612'01 104 00 0 00 000131 AIC ; Activate interrupt system. 46100 002613'01 200 01 0 00 004424' move t1, [.ticcm,,cmchan] ; Assign ^M to this channel. 46101 002614'01 104 00 0 00 000137 ATI 46102 002615'01 402 00 0 00 000000* setzm cmseen 46103 002616'01 200 01 0 00 004425' move t1, [.ticcp,,cpchan] ; Assign ^P to this one. 46104 002617'01 104 00 0 00 000137 ATI 46105 002620'01 402 00 0 00 000000* setzm cpseen 46106 002621'01 263 17 0 00 000000 ret 46107 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 42 K20SUB MAC 20-Aug-24 02:18 Turn ^Y interrupts on 46108 subttl Turn ^Y interrupts on 46109 46110 ;[211] All clrbuf enhancements 46111 46112 002622'01 cyon: entry cyon ; World callable 46113 46114 002622'01 402 00 0 00 000000# setzm cyseen ; Haven't seen a Control-Y, yet 46115 dmove t1, [ .fhslf ; This fork and 46116 002623'01 120 01 0 00 004426' 1b ] ; this channel 46117 002624'01 104 00 0 00 000131 AIC% ; Activate interrupt channel 46118 002625'01 320 12 0 00 002627' %jserr (,r) ; Failed it 46119 002626'01 254 00 0 00 002632' 46120 002627'01 265 01 0 00 000276' 46121 002630'01 000000 000000 46122 002631'01 254 00 0 00 002571* 46123 002632'01 200 01 0 00 004430' move t1, [.ticcy,,cychan] 46124 002633'01 104 00 0 00 000137 ATI% ; Assign ^Y to this channel. 46125 002634'01 320 12 0 00 002636' %jserr (,r) ; Failed that 46126 002635'01 254 00 0 00 002641' 46127 002636'01 265 01 0 00 000276' 46128 002637'01 000000 000000 46129 002640'01 254 00 0 00 002631* 46130 46131 002641'01 254 00 0 00 002521* retskp ; Return success 46132 46133 ;[211] End clrbuf enhancement 46134 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 43 K20SUB MAC 20-Aug-24 02:18 Turn off ^A,^X,^Z interrupts 46135 subttl Turn off ^A,^X,^Z interrupts 46136 46137 002642'01 caxzof: entry caxzof ;[186] 46138 46139 002642'01 402 00 0 00 002573* setzm cxseen ; Turn off the flags 46140 002643'01 402 00 0 00 002574* setzm czseen ; ... 46141 002644'01 402 00 0 00 002575* setzm caseen ; ... 46142 002645'01 336 00 0 00 002576* skipn local ; Nothing to do if remote, the interrupts 46143 002646'01 263 17 0 00 000000 ret ; weren't on anyway. 46144 46145 dmove t1, [ .fhslf ;[186] Turn off ^A,^X,^Z traps. 46146 002647'01 120 01 0 00 004415' 1b!1b!1b ] ;[186] Turn off these channels. 46147 002650'01 104 00 0 00 000133 DIC% ; ... 46148 46149 002651'01 201 01 0 00 000001 movx t1, .ticca ;[219] Pull ^A 46150 002652'01 104 00 0 00 000140 DTI% 46151 002653'01 201 01 0 00 000030 movx t1, .ticcx ;[219] Pull ^X 46152 002654'01 104 00 0 00 000140 DTI% 46153 002655'01 201 01 0 00 000032 movx t1, .ticcz ;[219] Pull ^Z 46154 002656'01 104 00 0 00 000140 DTI% 46155 46156 002657'01 200 01 0 00 004414' move t1, [rt%dim!.fhslf] ;[219] This process, both masks 46157 002660'01 104 00 0 00 000173 RTIW% ; Fix up the interrupt mask for ^A,^X,^Z 46158 002661'01 630 02 0 00 004431' txz t2, <1b<.chcna>!1b<.chcnx>!1b<.chcnz>> ;[194] 46159 002662'01 630 03 0 00 004431' txz t3, <1b<.chcna>!1b<.chcnx>!1b<.chcnz>> ;[194] 46160 002663'01 104 00 0 00 000174 STIW% ; ... 46161 002664'01 320 12 0 00 002666' %jserr (,) 46162 002665'01 254 00 0 00 002671' 46163 002666'01 265 01 0 00 000276' 46164 002667'01 000000 000000 46165 002670'01 254 00 0 00 002671' 46166 002671'01 263 17 0 00 000000 ret 46167 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 44 K20SUB MAC 20-Aug-24 02:18 Turn ^M, ^P interrupts off 46168 subttl Turn ^M, ^P interrupts off 46169 46170 002672'01 cmpoff: entry cmpoff ;[186] 46171 46172 dmove t1, [ .fhslf ; Turn off ^M trap. 46173 002672'01 120 01 0 00 004422' 1b!1b ] ; Turn off channels. 46174 002673'01 104 00 0 00 000133 DIC ; ... 46175 46176 002674'01 402 00 0 00 002615* setzm cmseen ;[219] Indicate that there will 46177 002675'01 402 00 0 00 002620* setzm cpseen ;[219] be no more of these 46178 46179 002676'01 201 01 0 00 000015 movx t1, .ticcm ;[219] Pull ^M 46180 002677'01 104 00 0 00 000140 DTI 46181 002700'01 201 01 0 00 000020 movx t1, .ticcp ;[219] Pull ^P 46182 002701'01 104 00 0 00 000140 DTI 46183 46184 002702'01 200 01 0 00 004414' move t1, [rt%dim!.fhslf] ;[219] This process, both masks 46185 002703'01 104 00 0 00 000173 RTIW ; Fix up the terminal interrupt mask 46186 002704'01 621 02 0 00 000022 txz t2, <1b<.chcrt>!1b<.chcnp>> ;[194] for ^M, ^P 46187 002705'01 621 03 0 00 000022 txz t3, <1b<.chcrt>!1b<.chcnp>> ;[219] Differed ^M, ^P 46188 002706'01 104 00 0 00 000174 STIW 46189 002707'01 320 12 0 00 002711' %jserr (,) 46190 002710'01 254 00 0 00 002714' 46191 002711'01 265 01 0 00 000276' 46192 002712'01 000000 000000 46193 002713'01 254 00 0 00 002714' 46194 002714'01 263 17 0 00 000000 ret 46195 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 45 K20SUB MAC 20-Aug-24 02:18 Turn ^Y interrupt off 46196 subttl Turn ^Y interrupt off 46197 46198 ;[211] Begin clrbuf enhancement 46199 46200 002715'01 cyoff: entry cyoff ; Make globally available (to k20par) 46201 46202 dmove t1, [ .fhslf ; This process 46203 002715'01 120 01 0 00 004426' 1b ] ; The Control-Y channel 46204 002716'01 104 00 0 00 000133 DIC% ; Disable its interrupt channel 46205 002717'01 320 12 0 00 002721' %jserr(,) ; Or not, but carry on 46206 002720'01 254 00 0 00 002724' 46207 002721'01 265 01 0 00 000276' 46208 002722'01 000000 000000 46209 002723'01 254 00 0 00 002724' 46210 46211 002724'01 402 00 0 00 000000# setzm cyseen ; Indicate that there will be no more ^Y's 46212 46213 002725'01 201 01 0 00 000031 movx t1, .ticcy ;[219] Pull ^Y 46214 002726'01 104 00 0 00 000140 DTI% ;[219] Deactivate Terminal Interrupt 46215 46216 002727'01 200 01 0 00 004414' move t1, [rt%dim!.fhslf] ;This process, both masks 46217 002730'01 104 00 0 00 000173 RTIW% ; Read our entire terminal interrupt word 46218 002731'01 320 12 0 00 002733' %jserr(,r) ; Or not... Go no further 46219 002732'01 254 00 0 00 002736' 46220 002733'01 265 01 0 00 000276' 46221 002734'01 000000 000000 46222 002735'01 254 00 0 00 002640* 46223 002736'01 620 02 0 00 002000 txz t2, 1b<.chcny> ; Turn off control-Y from immediate mask 46224 002737'01 620 03 0 00 002000 txz t3, 1b<.chcny> ; Turn off control-Y from differred mask 46225 46226 002740'01 104 00 0 00 000174 STIW% ; Finally get the mask cleared up 46227 002741'01 320 12 0 00 002743' %jserr (,) ; Or not... 46228 002742'01 254 00 0 00 002746' 46229 002743'01 265 01 0 00 000276' 46230 002744'01 000000 000000 46231 002745'01 254 00 0 00 002746' 46232 002746'01 263 17 0 00 000000 ret 46233 46234 ;[211] End clrbuf enhancement 46235 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 46 K20SUB MAC 20-Aug-24 02:18 Control-C trap handler 46236 subttl Control-C trap handler 46237 46238 002747'01 373 00 0 00 000000# cctrap: sosle ccn ; Count the ^C's. 46239 002750'01 104 00 0 00 000136 DEBRK% ; If they haven't typed enough, just resume. 46240 002751'01 260 17 0 00 002362' call timoff ; Turn off any timer. 46241 txmsg <^C 46242 002752'01 200 01 0 00 000000# > ;[186] 46243 002753'01 104 00 0 00 000076 46244 002754'01 320 12 0 00 002755' 46245 000014'03 000000000000# 46246 000333'04 136 103 015 012 000 46247 002755'01 200 17 0 00 000000# move p, psave ;[27] Make sure stack pointer is right. 46248 002756'01 200 01 0 00 000000# move t1, psave2 ;[27] And stack top. 46249 002757'01 202 01 0 17 000000 movem t1, (p) ;[27] 46250 002760'01 661 01 0 00 010000 txo t1, pc%usr ;[187] Don't whack the other flags 46251 002761'01 202 01 0 00 000000# movem t1, pc1 ; Put this place into our PC. 46252 002762'01 262 17 0 00 000001 pop p, t1 ;[80] Don't need it on the stack any more. 46253 002763'01 104 00 0 00 000136 DEBRK% ; Resume where stack pointer points. 46254 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47 K20SUB MAC 20-Aug-24 02:18 Control-A trap handler 46255 subttl Control-A trap handler 46256 46257 ;[61] Give brief progress report at terminal. 46258 46259 002764'01 catrap: remark ;[186] Lots of status variables in k20mit 46260 extern bctu, bytsiz, rcving, ebqflg 46261 extern rptflg, rptot, rtchr, sptot, stchr 46262 extern pagcnt, files, nnak 46263 46264 002764'01 261 17 0 00 000001 push p, t1 ; Save all ACs we might use. 46265 002765'01 261 17 0 00 000002 push p, t2 46266 002766'01 261 17 0 00 000003 push p, t3 46267 002767'01 336 00 0 00 000000* skipn rcving ; Sending or receiving a file? 46268 002770'01 254 00 0 00 003123' jrst catrp1 ; No. 46269 002771'01 201 01 0 00 000101 movei t1, .priou ; Say the filename 46270 002772'01 337 00 0 00 002767* ifmg. rcving 46271 002773'01 254 00 0 00 002777' 46272 smsg (<^A 46273 002774'01 120 02 0 00 000000# Sending >) ; Yes, one... 46274 002775'01 260 17 0 00 000330' 46275 000015'03 000000000000# 46276 000016'03 777777 777763 46277 000334'04 136 101 015 012 040 46278 002776'01 254 00 0 00 003001' else. 46279 smsg (<^A 46280 002777'01 120 02 0 00 000000# Receiving >) ; ...or the other. 46281 003000'01 260 17 0 00 000330' 46282 000017'03 000000000000# 46283 000020'03 777777 777761 46284 000337'04 136 101 015 012 040 46285 003001'01 endif. 46286 003001'01 201 01 0 00 000101 movei t1, .priou ; Say the filename 46287 003002'01 337 02 0 00 002130* skipg t2, filjfn ;[193] Have file JFN? 46288 003003'01 254 00 0 00 003015' ifskp. ;[193] Yeah, try to say something about it 46289 003004'01 302 02 0 00 377777 caie t2, .nulio ;[193] Dumping it? 46290 003005'01 254 00 0 00 003012' ifskp. ;[193] That's easy! 46291 003006'01 120 02 0 00 000252* dmove t2, nul4 ;[252] Always same name 46292 003007'01 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 46293 003010'01 320 14 0 00 003011' erjmps .+1 ;[193] 46294 003011'01 254 00 0 00 003015' else. ;[193] Otherwise, do it for real 46295 003012'01 400 03 0 00 000004 setz t3, t4 ;[194] 46296 003013'01 104 00 0 00 000030 JFNS% 46297 003014'01 320 14 0 00 003015' erjmps .+1 ;[193] 46298 003015'01 endif. ;[193] End NUL: special case 46299 003015'01 endif. ;[193] End case file JFN handling 46300 003015'01 200 01 0 00 000000# txmsg <, file bytesize > ; File bytesize 46301 003016'01 104 00 0 00 000076 46302 003017'01 320 12 0 00 003020' 46303 000021'03 000000000000# 46304 000343'04 054 040 146 151 154 46305 003020'01 201 01 0 00 000101 numout bytsiz ;[194] Sets t1 to .priou 46306 003021'01 200 02 0 00 000000* 46307 003022'01 201 03 0 00 000012 46308 003023'01 104 00 0 00 000224 46309 003024'01 320 14 0 00 003025' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-1 K20SUB MAC 20-Aug-24 02:18 Control-A trap handler 46310 003025'01 335 00 0 00 002772* ifmge. rcving ; I/O bytesize, only if sending 46311 003026'01 254 00 0 00 003041' 46312 003027'01 120 02 0 00 000000# dxtext (t2,<, i/o bytesize >) ;[194] 46313 000022'03 000000000000# 46314 000023'03 777777 777761 46315 000347'04 054 040 151 057 157 46316 003030'01 104 00 0 00 000053 SOUT% ;[193] Counted SOUT% is faster 46317 003031'01 320 14 0 00 003032' erjmps .+1 ;[193] 46318 003032'01 201 02 0 00 000007 movei t2, ^d7 ;[194] 46319 003033'01 336 00 0 00 002001* skipn itsfil ;[75] 46320 003034'01 332 00 0 00 002002* skipe ebtflg 46321 003035'01 201 02 0 00 000010 movei t2, ^d8 ;[194] (!!) 46322 003036'01 201 03 0 00 000012 movei t3, ^d10 ;[194] 46323 003037'01 104 00 0 00 000224 NOUT% ;[194] 46324 003040'01 320 14 0 00 003041' erjmps .+1 ;[194] 46325 003041'01 endif. ;[194] 46326 003041'01 561 01 0 00 000322* hrroi t1,crlf ;[194] 46327 003042'01 104 00 0 00 000076 PSOUT% ;[194] 46328 003043'01 336 00 0 00 003033* ifmn. itsfil ;[75] 46329 003044'01 254 00 0 00 003050' 46330 003045'01 200 01 0 00 000000# txmsg < (ITS binary)> ;[75] 46331 003046'01 104 00 0 00 000076 46332 003047'01 320 12 0 00 003050' 46333 000024'03 000000000000# 46334 000353'04 040 050 111 124 123 46335 003050'01 endif. 46336 003050'01 336 00 0 00 000000* ifmn. ebqflg ;[88] 46337 003051'01 254 00 0 00 003055' 46338 003052'01 200 01 0 00 000000# txmsg < (8th-bit prefixing)> ;[88] 46339 003053'01 104 00 0 00 000076 46340 003054'01 320 12 0 00 003055' 46341 000025'03 000000000000# 46342 000356'04 040 050 070 164 150 46343 003055'01 endif. 46344 003055'01 336 00 0 00 000000* ifmn. rptflg ;[92] 46345 003056'01 254 00 0 00 003062' 46346 003057'01 200 01 0 00 000000# txmsg < (compression)> ;[92] 46347 003060'01 104 00 0 00 000076 46348 003061'01 320 12 0 00 003062' 46349 000026'03 000000000000# 46350 000363'04 040 050 143 157 155 46351 003062'01 endif. 46352 46353 003062'01 200 01 0 00 000000# txmsg < (block check type > ;[98] 46354 003063'01 104 00 0 00 000076 46355 003064'01 320 12 0 00 003065' 46356 000027'03 000000000000# 46357 000366'04 040 050 142 154 157 46358 003065'01 201 01 0 00 000101 numout bctu ;[98] 46359 003066'01 200 02 0 00 000167* 46360 003067'01 201 03 0 00 000012 46361 003070'01 104 00 0 00 000224 46362 003071'01 320 14 0 00 003072' 46363 003072'01 201 01 0 00 000051 movei t1, ")" ;[98] 46364 003073'01 104 00 0 00 000074 PBOUT ;[98] k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-2 K20SUB MAC 20-Aug-24 02:18 Control-A trap handler 46365 003074'01 337 02 0 00 003002* skipg t2, filjfn ;[193] Have file JFN? 46366 003075'01 254 00 0 00 003123' ifskp. ;[193] Yeah, don't lets say something silly 46367 003076'01 306 02 0 00 377777 cain t2, .nulio ;[193] Are we dumping it? 46368 003077'01 254 00 0 00 003123' anskp. ;[193] We are, so bag this because not PMAP%ing anything 46369 txmsg < 46370 003100'01 200 01 0 00 000000# At page > ; What page we're at. 46371 003101'01 104 00 0 00 000076 46372 003102'01 320 12 0 00 003103' 46373 000030'03 000000000000# 46374 000372'04 015 012 040 101 164 46375 003103'01 200 02 0 00 002120* move t2, pagno 46376 003104'01 350 00 0 00 000002 aos t2 46377 003105'01 201 01 0 00 000101 movei t1, .priou ;[194] 46378 003106'01 201 03 0 00 000012 movei T3, ^d10 ;[194] 46379 003107'01 104 00 0 00 000224 NOUT% 46380 003110'01 320 14 0 00 003111' erjmps .+1 ;[253] Ignore the error so we don't skip 46381 003111'01 335 00 0 00 003025* ifmge. rcving ;[194] Out of how many 46382 003112'01 254 00 0 00 003123' 46383 003113'01 200 01 0 00 000000# txmsg < of > ; (which we know only if we're sending) 46384 003114'01 104 00 0 00 000076 46385 003115'01 320 12 0 00 003116' 46386 000031'03 000000000000# 46387 000375'04 040 157 146 040 000 46388 003116'01 201 01 0 00 000101 numout pagcnt 46389 003117'01 200 02 0 00 000000* 46390 003120'01 201 03 0 00 000012 46391 003121'01 104 00 0 00 000224 46392 003122'01 320 14 0 00 003123' 46393 003123'01 endif. ;[194] 46394 003123'01 endif. ;[194] End case of a file that isn't NUL: 46395 46396 catrp1: txmsg < 46397 003123'01 200 01 0 00 000000# Files: > ; Say how many files, 46398 003124'01 104 00 0 00 000076 46399 003125'01 320 12 0 00 003126' 46400 000032'03 000000000000# 46401 000376'04 015 012 040 106 151 46402 003126'01 201 01 0 00 000101 numout files 46403 003127'01 200 02 0 00 000000* 46404 003130'01 201 03 0 00 000012 46405 003131'01 104 00 0 00 000224 46406 003132'01 320 14 0 00 003133' 46407 003133'01 200 01 0 00 000000# txmsg <, packets: > ; packets, 46408 003134'01 104 00 0 00 000076 46409 003135'01 320 12 0 00 003136' 46410 000033'03 000000000000# 46411 000401'04 054 040 160 141 143 46412 003136'01 337 00 0 00 003111* ifmg. rcving ;[194] Positive means sending ... 46413 003137'01 254 00 0 00 003146' 46414 003140'01 201 01 0 00 000101 numout sptot ;[194] 46415 003141'01 200 02 0 00 000000* 46416 003142'01 201 03 0 00 000012 46417 003143'01 104 00 0 00 000224 46418 003144'01 320 14 0 00 003145' 46419 003145'01 254 00 0 00 003153' else. ;[194] k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-3 K20SUB MAC 20-Aug-24 02:18 Control-A trap handler 46420 003146'01 201 01 0 00 000101 numout rptot ;[194] 46421 003147'01 200 02 0 00 000000* 46422 003150'01 201 03 0 00 000012 46423 003151'01 104 00 0 00 000224 46424 003152'01 320 14 0 00 003153' 46425 003153'01 endif. ;[194] 46426 003153'01 200 01 0 00 000000# txmsg <, chars: > ; characters, 46427 003154'01 104 00 0 00 000076 46428 003155'01 320 12 0 00 003156' 46429 000034'03 000000000000# 46430 000404'04 054 040 143 150 141 46431 46432 003156'01 337 00 0 00 003136* ifmg. rcving ;[194] Positive means sending .... 46433 003157'01 254 00 0 00 003163' 46434 003160'01 200 02 0 00 000000* move t2, stchr 46435 003161'01 270 02 0 00 000013 add t2, schr 46436 003162'01 254 00 0 00 003165' else. ;[194] Otherwise, receiving 46437 003163'01 200 02 0 00 000000* move t2, rtchr 46438 003164'01 270 02 0 00 000012 add t2, rchr 46439 003165'01 endif. ;[194] 46440 003165'01 201 01 0 00 000101 movei t1, .priou ;[194] 46441 003166'01 201 03 0 00 000012 movei t3, ^d10 ;[194] 46442 003167'01 104 00 0 00 000224 NOUT% ;[194] 46443 003170'01 320 14 0 00 003171' erjmps .+1 ;[253] Catch and suppress error so we can skip 46444 txmsg < 46445 003171'01 200 01 0 00 000000# NAKs: > ; NAKS & timeouts. 46446 003172'01 104 00 0 00 000076 46447 003173'01 320 12 0 00 003174' 46448 000035'03 000000000000# 46449 000406'04 015 012 040 116 101 46450 003174'01 201 01 0 00 000101 numout nnak 46451 003175'01 200 02 0 00 000000* 46452 003176'01 201 03 0 00 000012 46453 003177'01 104 00 0 00 000224 46454 003200'01 320 14 0 00 003201' 46455 003201'01 200 01 0 00 000000# txmsg <, timeouts: > 46456 003202'01 104 00 0 00 000076 46457 003203'01 320 12 0 00 003204' 46458 000036'03 000000000000# 46459 000410'04 054 040 164 151 155 46460 003204'01 201 01 0 00 000101 numout ntimou 46461 003205'01 200 02 0 00 002410* 46462 003206'01 201 03 0 00 000012 46463 003207'01 104 00 0 00 000224 46464 003210'01 320 14 0 00 003211' 46465 txmsg < 46466 003211'01 200 01 0 00 000000# > ; End up with a CRLF 46467 003212'01 104 00 0 00 000076 46468 003213'01 320 12 0 00 003214' 46469 000037'03 000000000000# 46470 000413'04 015 012 000 000 000 46471 46472 003214'01 262 17 0 00 000003 pop p, t3 ; Restore ACs. 46473 003215'01 262 17 0 00 000002 pop p, t2 46474 003216'01 262 17 0 00 000001 pop p, t1 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 47-4 K20SUB MAC 20-Aug-24 02:18 Control-A trap handler 46475 46476 003217'01 104 00 0 00 000136 DEBRK% ; Resume. 46477 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 48 K20SUB MAC 20-Aug-24 02:18 Control-X trap handler 46478 subttl Control-X trap handler 46479 46480 ;[59] 46481 46482 003220'01 cxtrap: extern source, dirch ;[186] 46483 46484 003220'01 476 00 0 00 002642* setom cxseen ; Just set the flag & echo the character. 46485 003221'01 261 17 0 00 000001 push p, t1 46486 003222'01 261 17 0 00 000002 push p, t2 46487 003223'01 200 01 0 00 000000* move t1, source ;[140] What's the source of our data? 46488 003224'01 306 01 0 00 000000* cain t1, dirch ;[140] Is it a directory listing? 46489 003225'01 476 00 0 00 002643* setom czseen ;[140] If so, set C-Z flag, too. 46490 003226'01 200 01 0 00 000000# txmsg <^X// > 46491 003227'01 104 00 0 00 000076 46492 003230'01 320 12 0 00 003231' 46493 000040'03 000000000000# 46494 000414'04 136 130 057 057 040 46495 003231'01 262 17 0 00 000002 pop p, t2 46496 003232'01 262 17 0 00 000001 pop p, t1 46497 003233'01 104 00 0 00 000136 DEBRK% 46498 46499 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 49 K20SUB MAC 20-Aug-24 02:18 Control-Z trap handler 46500 subttl Control-Z trap handler 46501 46502 ;[59] 46503 46504 003234'01 476 00 0 00 003225* cztrap: setom czseen ; Just set the flag & echo the character. 46505 003235'01 261 17 0 00 000001 push p, t1 46506 003236'01 261 17 0 00 000002 push p, t2 46507 003237'01 200 01 0 00 000000# txmsg <^Z// > 46508 003240'01 104 00 0 00 000076 46509 003241'01 320 12 0 00 003242' 46510 000041'03 000000000000# 46511 000416'04 136 132 057 057 040 46512 003242'01 262 17 0 00 000002 pop p, t2 46513 003243'01 262 17 0 00 000001 pop p, t1 46514 003244'01 104 00 0 00 000136 DEBRK 46515 46516 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 50 K20SUB MAC 20-Aug-24 02:18 Control-M and -P trap handlers 46517 subttl Control-M and -P trap handlers 46518 46519 ;[165] 46520 46521 003245'01 cmtrap: extern cmseen, cmloc ;[186] 46522 46523 003245'01 476 00 0 00 002674* setom cmseen ; Set ^M flag 46524 003246'01 261 17 0 00 000001 push p, t1 ; Echo CRLF 46525 003247'01 261 17 0 00 000002 push p, t2 46526 txmsg < 46527 003250'01 200 01 0 00 000000# > 46528 003251'01 104 00 0 00 000076 46529 003252'01 320 12 0 00 003253' 46530 000042'03 000000000000# 46531 000420'04 015 012 000 000 000 46532 003253'01 200 01 0 00 000000* move t1, cmloc ; Get place to resume. 46533 003254'01 254 00 0 00 003264' jrst cmptr2 46534 46535 46536 003255'01 cptrap: extern cpseen ;[186] 46537 extern cploc 46538 46539 003255'01 476 00 0 00 002675* setom cpseen ; Set ^P flag 46540 003256'01 261 17 0 00 000001 push p, t1 ; Echo ^P 46541 003257'01 261 17 0 00 000002 push p, t2 46542 txmsg < 46543 003260'01 200 01 0 00 000000# ^P> 46544 003261'01 104 00 0 00 000076 46545 003262'01 320 12 0 00 003263' 46546 000043'03 000000000000# 46547 000421'04 015 012 136 120 000 46548 003263'01 200 01 0 00 000000* move t1, cploc ; Get place to resume. 46549 46550 003264'01 661 01 0 00 010000 cmptr2: txo t1, pc%usr ;[187] Get into user mode 46551 003265'01 202 01 0 00 000000# movem t1, pc2 ; Resume at desired PC. 46552 003266'01 262 17 0 00 000002 pop p, t2 46553 003267'01 262 17 0 00 000001 pop p, t1 46554 003270'01 104 00 0 00 000136 DEBRK 46555 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 51 K20SUB MAC 20-Aug-24 02:18 Control-Y interrupt handler 46556 subttl Control-Y interrupt handler 46557 46558 ;[211] All part of clrbuf changes 46559 ;[218] Not anymore!! 46560 46561 chgsec(code,data) ; Need some storage 46562 000000'05 cyseen: intern cyseen ; Global for k20par and k20net 46563 000000'05 block 1 ; Needs the storage... 46564 retsec ; Back to generating code 46565 46566 extern $clrbs ; Reported location of loop sleep (DISMS%) 46567 extern $waitj ;[218] Reported location of DECnet connection wait 46568 46569 003271'01 261 17 0 00 000001 cytrap: push p, t1 ; Save an accumulator 46570 003272'01 261 17 0 00 000016 push p, cx ; Save for frame building 46571 003273'01 550 01 0 00 000000# hrrz t1, pc3 ; Pick up our interrupted location (no flags) 46572 46573 003274'01 415 16 0 00 003303' block. ; Enter block context for better control flow 46574 003275'01 261 17 0 00 000016 46575 003276'01 306 01 0 00 000000* cain t1, $clrbs ; In the buffer clear sleep? 46576 003277'01 254 00 0 00 002641* retskp ; Yes, go dink his PC 46577 003300'01 306 01 0 00 000000* cain t1, $waitj ;[218] In the DECnet connection wait? 46578 003301'01 254 00 0 00 003277* retskp ;[218] Yes, dink that PC, too 46579 003302'01 263 17 0 00 000000 endbk. ; End of block context 46580 003303'01 254 00 0 00 003307' ifskp. ;[218] A known break location!! 46581 003304'01 500 01 0 00 000000# hll t1, pc3 ; Pick up interrupted flags 46582 003305'01 661 01 0 00 010000 txo t1, pc%usr ; Get into user mode 46583 003306'01 202 01 0 00 000000# movem t1, pc3 ; Change DEBRK% action 46584 003307'01 endif. ; That's all, really 46585 46586 003307'01 262 17 0 00 000016 pop p, cx ; Restore frame pointer 46587 003310'01 262 17 0 00 000001 pop p, t1 ; Restore temporary 46588 003311'01 350 00 0 00 000000# aos cyseen ; Set ^Y flag 46589 003312'01 104 00 0 00 000136 DEBRK% 46590 46591 ;[211] End clrbuf changes 46592 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 52 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46593 subttl String convert from eight bit to controlified 7 bit 46594 46595 ;[209] Begin code insertion 46596 46597 ; Like echo, except uses VASTLY less JSYS calls and CPU time. 46598 ; However, because we're doing eight bit bytes, the table driven MOVST 46599 ; approach uses vastly more memory. That's fine for modern usage, 46600 ; which has over 30 times the memory for a few hobbiest users. 46601 ; 46602 ; Parity bits are completely stripped, if you want parity, you must 46603 ; check this, beforehand. 46604 46605 ; Define a macro to do random character substitutions 46606 46607 define cncsub(chr1,sub1,chr2,sub2,tab,%org) < 46608 ifb ,< ;;Don't put things in bad places 46609 printx ?Must have a table to store character pair 46610 end ;;Switch to pass 2 46611 > 46612 %org==. ;;Remember where we are 46613 .xcref %org ;;Don't want in CREF, yuck! 46614 suppress %org ;;Generate symbol value largely useless 46615 reloc tab+<<&177>_-1> ;;Gets us to the correct halfword pair 46616 xwd sub1,sub2 ;;Emit the appropriate pair 46617 reloc %org ;;Get back to where we were 46618 .xcref %org ;;Stay out of my cross reference! 46619 if2 < purge %org > ;;Don't need after pass two, either 46620 >;;cncsub 46621 46622 chgsec(code,const) ; Put translate table in the constants psect 46623 46624 remark ; And on to define our piggy tables 46625 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 53 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46626 remark Control Character stop table, first half 46627 46628 000000 %cncha==.chnul ; Control character; starts out at .CHNUL 46629 suppress %cncha ; Don't need in symbol table listing 46630 .xcref %cncha ; Nor in cross reference 46631 46632 000044'03 cnrtab: remark ; Appropriately trigger on control chars 46633 000044' %tborg==. ; Mark beginning of table 46634 suppress %tborg ; Don't need in symbol table listing 46635 .xcref %tborg ; Nor in cross reference 46636 46637 xlist ; Don't need to see this blat 46638 list ; Restart the blather 46639 46640 000144' %eocnr==. ; Remember end of control table 46641 suppress %eocnr ; Don't need in symbol table listing 46642 .xcref %eocnr ; Nor in cross reference 46643 46644 000044'03 reloc %tborg ; Get back to the beginning of the table 46645 .xcref %tborg ; Keep off cross reference 46646 46647 xlist ; Any control character will stop us 46648 list ; Restart the blather 46649 46650 remark ; Have to special case rubout 46651 000143'03 000176 500177 cncsub("~","~",.chdel,,cnrtab) 46652 46653 000144'03 reloc %eocnr ; Get to end of first part 46654 .xcref %eocnr ; Nor in cross reference 46655 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 54 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46656 remark Control Character stop table, second half 46657 46658 000144'03 cnrt2:! remark ; Have to repeat for the eight bit part... 46659 .xcref cnrt2 ; Not used, so don't cross reference it 46660 suppress cnrt2 ; Surely not needed on the symbol table 46661 000144' %tborg==. ; Mark beginning of table 46662 .xcref %tborg ; Nor in cross reference 46663 46664 xlist ; Don't need to see this blat 46665 list ; Restart the blather 46666 46667 000244' %eocnr==. ; Remember end of second part of control table 46668 .xcref %eocnr ; Nor in cross reference 46669 46670 000144'03 reloc %tborg ; Get back to the beginning of the table 46671 xlist ; Save the trees!!! 46672 list ;;Turn listing back on 46673 46674 remark ; Have to special case rubout 46675 000243'03 000176 500177 cncsub("~","~",.chdel,,cnrt2) 46676 46677 000244'03 reloc %eocnr ; Get to back to end of table 46678 .xcref %eocnr ; Keep temporary off the cross-reference 46679 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 55 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46680 remark Control Character substitution table, first half 46681 46682 ; The translate table assumes that exactly a SINGLE character is 46683 ; to be translated and that this is only a control character. 46684 46685 000244'03 crsubt: remark ; Control character substitution table 46686 000244' %tborg==. ; Mark beginning of table 46687 .xcref %tborg ; Keep off cross reference 46688 46689 xlist ; Don't need to see this blat 46690 list ; Restart the blather 46691 46692 000344' %eocnr==. ; Remember end of control table 46693 .xcref %eocnr ; Nor in cross reference 46694 000244'03 reloc %tborg ; Get back to the beginning of the table 46695 .xcref %eocnr ; Keep off cross reference 46696 46697 000244'03 000100 000101 xwd "@","A" ; .chnul goes to ^@, .chcna goes to ^A 46698 xlist ; End of string on .CHNUL, expand others 46699 list 46700 46701 remark ; A few conventions 46702 000261'03 000132 000044 cncsub(.chcnz,"Z",.chesc,"$",crsubt) 46703 000343'03 500176 000077 cncsub("~",,.chdel,"?",crsubt) 46704 46705 000344'03 reloc %eocnr ; Get to end of first part 46706 .xcref %eocnr ; Nor in cross reference 46707 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 56 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46708 remark Control Character expansion table, second half 46709 46710 000344'03 crsu2:! remark ; Used for eight bits, ignores parity 46711 .xcref crsu2 ; Not used, so don't cross reference it 46712 suppress crsu2 ; Surely not needed on the symbol table 46713 000344' %tborg==. ; Mark beginning of table 46714 .xcref %tborg ; Nor in cross reference 46715 46716 xlist ; Don't need to see this blat 46717 list ; Restart the blather 46718 46719 000444' %eocnr==. ; Remember end of control table 46720 .xcref %eocnr ; Nor in cross reference 46721 000344'03 reloc %tborg ; Get back to the beginning of the table 46722 .xcref %eocnr ; Keep off cross reference 46723 46724 000344'03 000100 000101 xwd "@","A" ; .chnul goes to ^@, .chcna goes to ^A 46725 xlist ; End of string on .CHNUL, expand others 46726 list 46727 46728 remark ; A few conventions 46729 000361'03 000132 000044 cncsub(.chcnz,"Z",.chesc,"$",crsu2) 46730 000443'03 500176 000077 cncsub("~",,.chdel,"?",crsu2) 46731 46732 000444'03 reloc %eocnr ; Get to back to end of table 46733 .xcref %eocnr ; Keep temporary off the cross-reference 46734 46735 remark After 2nd pass, purge tempories 46736 if2 < purge %cncha,%eocnr, %tborg 46737 purge cnrt2, crsu2> 46738 retsec ; Get out of the constants section 46739 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46740 remark Actual code to convert the string 46741 46742 ; Call: 46743 ; 46744 ; t1/ length of string to convert 46745 ; t2/ point 8, somewhere ; String of eight bit characters to convert 46746 ; 46747 ; Return: 46748 ; 46749 ; +1/ Something got ill 46750 ; +2/ Success! String completely converted (or as much of it as we could) 46751 ; 46752 ; t1/ Remaining length ; How much is left of source string 46753 ; t2/ point 7, somewhere else ; Converted controlified string 46754 ; t3/ negative length ; Ready for SOUT% 46755 ; t4/ point 8, updated ; Where we stopped in the source string 46756 46757 000454 trnchr==^d300 ; Can handle this many characters at once 46758 46759 chgsec(code,data) ; Need some storage for buffers, etc. 46760 000001'05 trnbuf: intern trnbuf ;[221] Let k20pdc see it, too 46761 000001'05 block +1 ; Space for 7 bit characters 46762 retsec ; Re-open executable code 46763 46764 003313'01 015 00 0 00 000000# c87mov: movst 0,cnrtab ; Actual extend instruction being executed 46765 003314'01 000000 000000 .chnul ; Fill character is end of string 46766 46767 003315'01 s8ccv7: entry s8ccv7 ; String eight controlified convert to seven 46768 003315'01 327 01 0 00 003321' ifle. t1 ; Gubbish? 46769 003316'01 200 04 0 00 000002 move t4 ,t2 ; Return whatever they gave us 46770 003317'01 403 02 0 00 000003 setzb t2, t3 ; Then say there is nothing to SOUT% 46771 003320'01 263 17 0 00 000000 ret ; Fail the call 46772 003321'01 endif. 46773 46774 003321'01 265 16 0 00 004262' saveac ; Save more piggy registers 46775 remark q2 aliases t5 ; So t5 must be saved 46776 46777 remark t1, t2 ; Already have source length and pointer 46778 dmove t4, [ trnchr ; Load maximum length of destination 46779 003322'01 120 04 0 00 004432' point 7, trnbuf ] ; Point to destination 46780 003323'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 46781 003324'01 621 01 0 00 700000 txz t1, S!N!M ; Whack translation flags 46782 46783 003325'01 do. ; Enter loop context 46784 003325'01 661 01 0 00 400000 txo t1, S ; Set significance flag (start translating) 46785 003326'01 123 01 0 00 003313' extend t1, c87mov ; Move the string, testing for control chars 46786 003327'01 320 12 0 00 003331' %jserr (, r) ; Pass any machine error back up 46787 003330'01 254 00 0 00 003334' 46788 003331'01 265 01 0 00 000276' 46789 003332'01 000000000000# 46790 003333'01 254 00 0 00 002735* 46791 000422'04 115 117 126 123 124 46792 003334'01 623 01 0 00 200000 txze t1, N ; Bumped into a control character? 46793 003335'01 254 00 0 00 003345' ifskp. ; We did not; exhausted source? 46794 003336'01 621 01 0 00 700000 txz t1, S!N!M ; Clear all the flags k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 57-1 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46795 003337'01 323 01 0 00 003353' jumple t1, endlp. ; No more source? We're done 46796 003340'01 334 00 0 00 000000 %ermsg (,r) 46797 003341'01 254 00 0 00 003345' 46798 003342'01 265 01 0 00 000276' 46799 003343'01 000000000000# 46800 003344'01 254 00 0 00 003333* 46801 000425'04 103 157 156 164 162 46802 003345'01 endif. ; Otherwise, we DID hit a control character 46803 003345'01 323 04 0 00 003353' jumple t4, endlp. ; Done if no more destination 46804 003346'01 621 01 0 00 700000 txz t1, S!N!M ; Clear all the flags 46805 003347'01 260 17 0 00 003362' call cnchar ; Otherwise, process a control character 46806 003350'01 263 17 0 00 000000 ret ; Failed, just stop right now 46807 003351'01 323 04 0 00 003353' jumple t4, endlp. ; Done if no more destination space 46808 003352'01 327 01 0 00 003325' jumpg t1, top. ; Keep translating characters until no more 46809 003353'01 enddo. ; Exit loop lexical context 46810 46811 remark t1, ; Still has remaining source length 46812 003353'01 200 03 0 00 000004 move t3, t4 ; Load remaining destination 46813 003354'01 275 03 0 00 000454 subi t3, trnchr ; Calculate negative destination length 46814 003355'01 200 04 0 00 000002 move t4, t2 ; Updated source pointer is here 46815 003356'01 200 02 0 00 004434' move t2, [ point 7, trnbuf ] ; Point to destination 46816 003357'01 254 00 0 00 003301* retskp ; Successful return 46817 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46818 remark Convert control character to ASCII equivalent 46819 46820 ; Assumes s8ccv7 register context and is intmately linked with it 46821 ; 46822 ; t1/ Remaining length of source string 46823 ; t2/ point 8, to current location in source string 46824 ; t3/ Address portion of 30 double word pointer, MUST be zero 46825 ; t4/ Remaining length of destination string 46826 ; q1/ point 7, to current location in destination string 46827 ; q2/ Address portion of 30 double word pointer, MUST be zero 46828 ; 46829 ; Note a subtle difference between this and the escchr routine, which 46830 ; is used to implement C backslash expansion and translation. In that 46831 ; case, the backslash is skipped and the character afterwards is 46832 ; translated (or converted into a number). 46833 ; 46834 ; The enclosing MOVST is now pointing AFTER the control character and 46835 ; has updated the source remaining total to account for the fact that 46836 ; it has been consumed. However, no such thing happens to the 46837 ; destination pointer and count because nothing was ever deposited. 46838 ; 46839 ; Thus some fix-up is necessary prior to excuting the MOVST below so 46840 ; that the correct character is fetched. Similarly, the source 46841 ; counter should NOT be fixed while the destination counter MUST be 46842 ; fixed. 46843 ; 46844 ; It's the kind of edge case that you really have to single step 46845 ; through to see what the machine is actually doing... 46846 ; 46847 ; For the two cases which involve an expansion, no fix up is 46848 ; necessary, because we're skipping the control character and 46849 ; depositing fixed strings. 46850 46851 003360'01 015 00 0 00 000000# chngch: movst 0,crsubt ; Actual extend instruction being executed 46852 003361'01 000000 000000 .chnul ; Fill character is end of string 46853 46854 003362'01 265 16 0 00 004435' cnchar: saveac ; Some extra scratch for calculations 46855 003363'01 135 07 0 00 000002 ldb q3, t2 ; Load character that stopped us 46856 003364'01 306 07 0 00 000015 cain q3, .chcrt ; Carriage return? 46857 003365'01 254 00 0 00 003440' callret schcrt ; Hit special carriage return expansion 46858 003366'01 306 07 0 00 000012 cain q3, .chlfd ; Line feed? 46859 003367'01 254 00 0 00 003475' callret schlfd ; Hit special line feed expansion 46860 46861 003370'01 201 07 0 00 000136 movei q3, "^" ; Load circumflex character 46862 003371'01 136 07 0 00 000005 idpb q3, q1 ; Deposit in destination 46863 003372'01 363 04 0 00 003344* sojle t4, r ; Account for it and return if full 46864 46865 003373'01 621 01 0 00 700000 txz t1, N!M!S ; Stomp flags so math and EXTEND work 46866 003374'01 200 07 0 00 000001 move q3, t1 ; Save source length over extend 46867 003375'01 200 10 0 00 000004 move q4, t4 ; Ditto destination length 46868 46869 003376'01 474 01 0 00 000000 seto t1, ; Have to back up the source pointer to 46870 003377'01 133 01 0 00 000002 adjbp t1, t2 ; BEFORE the offending control character 46871 003400'01 200 02 0 00 000001 move t2, t1 ; Use updated pointer as new source pointer 46872 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 58-1 K20SUB MAC 20-Aug-24 02:18 String convert from eight bit to controlified 7 bit 46873 003401'01 200 01 0 00 004371' move t1,[ S!<^d1> ] ; Only looking at a SINGLE character of source 46874 003402'01 201 04 0 00 000001 movei t4,^d1 ; Don't allow any foolish filling... 46875 003403'01 123 01 0 00 003360' extend t1, chngch ; Change this SINGLE character 46876 003404'01 320 12 0 00 003406' %jserr (, r) ; Pass error up 46877 003405'01 254 00 0 00 003411' 46878 003406'01 265 01 0 00 000276' 46879 003407'01 000000000000# 46880 003410'01 254 00 0 00 003372* 46881 000440'04 103 157 156 164 162 46882 46883 003411'01 607 01 0 00 200000 ifxn. t1, N ; Invalid control character?? 46884 003412'01 254 00 0 00 003424' 46885 003413'01 200 01 0 00 000000# emsg 46886 003414'01 104 00 0 00 000313 46887 000444'03 000000000000# 46888 000447'04 111 154 154 145 147 46889 003415'01 135 01 0 00 000002 ldb t1, t2 ; Pick up what didn't work 46890 003416'01 104 00 0 00 000074 PBOUT% ; Show us 46891 003417'01 561 01 0 00 003041* hrroi t1, crlf ; Load end of line 46892 003420'01 104 00 0 00 000076 PSOUT% ; Print it 46893 003421'01 200 01 0 00 000007 move t1, q3 ; Restore unaltered source length 46894 003422'01 200 04 0 00 000010 move t4, q4 ; Restore unaltered destination length 46895 003423'01 263 17 0 00 000000 ret ; Failure return 46896 003424'01 endif. 46897 46898 003424'01 200 01 0 00 000007 move t1, q3 ; Restore source count, which is already correct 46899 003425'01 375 04 0 00 000010 sosge t4, q4 ; Fix destination count for character deposited 46900 003426'01 263 17 0 00 000000 ret ; Ran out of buffer space 46901 003427'01 254 00 0 00 003357* retskp ; Won!! 46902 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 59 K20SUB MAC 20-Aug-24 02:18 Special Control Character logic 46903 subttl Special Control Character logic 46904 46905 ; Expands carriage return and line feed so we 46906 ; don't overprint or get yucky wrap arounds 46907 ; 46908 ; Both assume: 46909 ; 46910 ; cnchar working context 46911 ; 46912 ; t1/ Remaining length of source string 46913 ; t2/ point 8, to current location in source string 46914 ; t3/ Address portion of 30 double word pointer, MUST be zero 46915 ; t4/ Remaining length of destination string 46916 ; q1/ point 7, to current location in destination string 46917 ; q2/ Address portion of 30 double word pointer, MUST be zero 46918 ; 46919 ; The idea is that the user sees something like ^M 46920 ; ^J splitting lines. Repeated Control-J's are not 46921 ; as graceful, but this is just for buffer review 46922 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 60 K20SUB MAC 20-Aug-24 02:18 Carriage expansion 46923 subttl Carriage expansion 46924 46925 ; Carriage Return puts the control character at END of expansion 46926 46927 003430'01 572321 500000 crtexp: byte (7) "^", "M", .chcrt, .chnul, .chnul 46928 003431'01 572321 505000 byte (7) "^", "M", .chcrt, .chlfd, .chnul 46929 46930 003432'01 000000 000003 crtptr: ^d3 ; String is three bytes long 46931 003433'01 44 07 0 00 003430' point 7, crtexp ; Point to expansion text 46932 003434'01 000000 000004 crtptl: ^d4 ; String is four bytes long 46933 003435'01 44 07 0 00 003431' point 7, crtexp+1 ; Point to text with line feed 46934 46935 003436'01 016 00 0 00 000000 movcrt: movslj 0, 0 ; No accumulator; E1 unused 46936 003437'01 000000 000000 .chnul ; Fill with nul's 46937 46938 003440'01 schcrt: remark q3, q4 ; Already saved by cnchar 46939 003440'01 265 16 0 00 004445' saveac ; Needs another register 46940 46941 003441'01 120 07 0 00 000001 dmove q3, t1 ; Save current source 46942 003442'01 323 07 0 00 003452' ifg. q3 ; Any remaining input? 46943 003443'01 134 01 0 00 000002 ildb t1, t2 ; Yes, pick up the next character 46944 003444'01 302 01 0 00 000012 caie t1, .chlfd ; A line feed?? 46945 003445'01 254 00 0 00 003450' ifskp. ; It is, so will be handled by schlfd 46946 003446'01 120 01 0 00 003432' dmove t1, crtptr ; Load expansion length and pointer 46947 003447'01 254 00 0 00 003451' else. ; Otherwise, drop in a line feed, too 46948 003450'01 120 01 0 00 003434' dmove t1, crtptl ; Load expansion length and pointer 46949 003451'01 endif. ; End case overwrite checking 46950 003451'01 254 00 0 00 003453' else. ; Otherwise, Carriage Return was last character 46951 003452'01 120 01 0 00 003434' dmove t1, crtptl ; So assume no line feed 46952 003453'01 endif. ; End case input buffer checking 46953 46954 003453'01 274 04 0 00 000001 sub t4, t1 ; Subtract from remaining 46955 003454'01 323 04 0 00 003410* jumple t4, r ; Fail if overflowed the beffer 46956 ; Otherwise, safe to move 46957 003455'01 200 11 0 00 000004 move q5, t4 ; Preserve the new length 46958 003456'01 200 04 0 00 000001 move t4, t1 ; Same as source, so no fill 46959 003457'01 123 01 0 00 003436' extend t1, movcrt ; Copy it all over, wee!! 46960 003460'01 320 12 0 00 003462' %jserr (,r) ;?? 46961 003461'01 254 00 0 00 003465' 46962 003462'01 265 01 0 00 000276' 46963 003463'01 000000000000# 46964 003464'01 254 00 0 00 003454* 46965 000455'04 125 156 141 142 154 46966 003465'01 120 01 0 00 000007 dmove t1, q3 ; Restore source 46967 003466'01 200 04 0 00 000011 move t4, q5 ; Restore fixed length 46968 003467'01 254 00 0 00 003427* retskp ; Return, successfully expanded 46969 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 61 K20SUB MAC 20-Aug-24 02:18 Line feed expansion 46970 subttl Line feed expansion 46971 46972 ; Line feed expansion puts the control character BEFORE expansion 46973 46974 003470'01 052751 200000 lfdexp: byte (7) .chlfd, "^", "J", .chnul, .chnul 46975 003471'01 000000 000003 lfdptr: ^d3 ; String is three bytes long 46976 003472'01 44 07 0 00 003470' point 7, lfdexp ; Point to expansion text 46977 003473'01 016 00 0 00 000000 movlfd: movslj 0, 0 ; No accumulator; E1 unused 46978 003474'01 000000 000040 .chspc ; Fill with spaces 46979 46980 003475'01 schlfd: remark q3, q4 ; Already saved by cnchar 46981 003475'01 265 16 0 00 004445' saveac ; Needs another register 46982 46983 003476'01 120 07 0 00 000001 dmove q3, t1 ; Save current source 46984 003477'01 120 01 0 00 003471' dmove t1, lfdptr ; Load expansion length and pointer 46985 003500'01 274 04 0 00 000001 sub t4, t1 ; Subtract from remaining 46986 003501'01 323 04 0 00 003464* jumple t4, r ; Fail if overflowed the beffer 46987 ; Otherwise, safe to move 46988 003502'01 200 11 0 00 000004 move q5, t4 ; Preserve the new length 46989 003503'01 200 04 0 00 000001 move t4, t1 ; Same as source, so no fill 46990 003504'01 123 01 0 00 003473' extend t1, movlfd ; Copy it all over, wee!! 46991 003505'01 320 12 0 00 003507' %jserr (,r) ;?? 46992 003506'01 254 00 0 00 003512' 46993 003507'01 265 01 0 00 000276' 46994 003510'01 000000000000# 46995 003511'01 254 00 0 00 003501* 46996 000464'04 125 156 141 142 154 46997 003512'01 120 01 0 00 000007 dmove t1, q3 ; Restore source 46998 003513'01 200 04 0 00 000011 move t4, q5 ; Restore fixed length 46999 003514'01 254 00 0 00 003467* retskp ; Success 47000 47001 ;[209] End code insertion 47002 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 62 K20SUB MAC 20-Aug-24 02:18 String copy measurement, 9:10pm Thursday, 21 July 2022 47003 subttl String copy measurement, 9:10pm Thursday, 21 July 2022 47004 47005 remark Delimma: What is the fastest way to copy strings? 47006 47007 ; A question had sometimes come up for debate as to whether the string 47008 ; instructions gave any real speed up, the concern being whether the 47009 ; set up cost of conditioning the register file and restoring it was 47010 ; worth using them. 47011 ; 47012 ; Three cases were set up, the first being a typical ildb/idpb loop 47013 ; with the second being a use of movst to move the string until a nul 47014 ; was detected. The third was a mixture; the keywords being moved 47015 ; with a loop and the macro expansions being moved with the movst. 47016 ; This was expected to be have the best performance as macro names 47017 ; (I.E., keywords) are typically not very long. 47018 ; 47019 ; 11 macros were defined, using a total of 80 characters of macro name 47020 ; space and 1365 characters of macro text space. The results are 47021 ; suprising: 47022 ; 47023 ; Case Elapsed CPU All 47024 ; 1 1.360 1.320 times 47025 ; *2 .340 .320 are in 47026 ; 3 1.020 .980 milliseconds 47027 ; 47028 ; By a considerable margin, using solely the movst won. This is why 47029 ; it is used exclusively in the macro garbage collector. Going 47030 ; forward, other cases may be identified in Kermit where it can be 47031 ; used. 47032 ; 47033 ; Older programs which use SOUT% to transfer strings would no doubt 47034 ; benefit substantially. 47035 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 63 K20SUB MAC 20-Aug-24 02:18 Table to move an ASCIZ string 47036 subttl Table to move an ASCIZ string 47037 47038 chgsec(code,const) ; Get into the constants segment 47039 47040 000002 %azchr==.chcnb ; Table starts at Control-B 47041 suppress %azchr ; Don't need in symbol table listing 47042 .xcref %azchr ; Nor in cross reference 47043 47044 000445'03 100000 000001 asztab: xwd eoscod!.chnul, .chcna ; Only stops on a NUL 47045 xlist ; Don't need to see this blat 47046 list ; Restart the blather 47047 47048 if2 < purge %azchr > ; Temporary not needed after 2nd pass 47049 retsec ; Get out of the constants section, into code 47050 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 64 K20SUB MAC 20-Aug-24 02:18 Move an ASCIZ string 47051 subttl Move an ASCIZ string 47052 47053 ; Call: 47054 ; 47055 ; t1/ Source BP (assumed section local) 47056 ; t2/ Destination BP (assumed section local) 47057 ; 47058 ; Return: 47059 ; 47060 ; +1/ Always, but may complain 47061 ; 47062 ; t1/ Updated source pointer 47063 ; t2/ Updated destination pointer 47064 ; t3/ Length of string 47065 ; 47066 ; CAUTION: 47067 ; 47068 ; Like an ildb/idpb loop, this will overwrite all memory if you let it. 47069 ; Make CERTAIN that your strings are NUL terminated!!! 47070 47071 003515'01 movasc: intern movasc ; Also used by k20srv 47072 003515'01 015 00 0 00 000000# movst 0,asztab ; Move characters until hit a NUL 47073 003516'01 000000 000000 .chnul ; Fill character 47074 47075 024000 mxascz==:MAXBUF ; A bizarre length (or ... ?) 47076 47077 003517'01 asczcp: entry asczcp ; Called by everybody 47078 remark ; Assumes can use these 47079 003517'01 261 17 0 00 000005 push p, q1 ; Piggy MOVST gorges on registers 47080 003520'01 261 17 0 00 000006 push p, q2 47081 47082 003521'01 200 05 0 00 000002 move q1, t2 ; Reposition destination for movst 47083 003522'01 200 02 0 00 000001 move t2, t1 ; Reposition source for movst 47084 003523'01 403 03 0 00 000006 setzb t3, q2 ; Force section local pointers 47085 003524'01 200 01 0 00 004453' movx t1, ; Limit source length, start significance 47086 003525'01 201 04 0 00 024000 movx t4, mxascz ; Limit destination length 47087 003526'01 123 01 0 00 003515' extend t1, movasc ; Move characters, doing useless translating 47088 003527'01 600 00 0 00 000000 nop ; Will never +1 because t1 and t4 are equal 47089 003530'01 133 00 0 00 000002 ibp t2 ; Account for .CHNUL in source 47090 003531'01 200 01 0 00 000002 move t1, t2 ; Return updated source pointer 47091 003532'01 136 06 0 00 000005 idpb q2, q1 ; Deposit a NUL at the end 47092 003533'01 200 02 0 00 000005 move t2, q1 ; Return updated destination pointer 47093 003534'01 201 03 0 00 024001 movx t3, ; Account for extra NUL byte 47094 003535'01 274 03 0 00 000004 sub t3, t4 ; Calculate length 47095 47096 003536'01 262 17 0 00 000006 pop p, q2 ; Restore registers and beat it 47097 003537'01 262 17 0 00 000005 pop p, q1 47098 003540'01 263 17 0 00 000000 ret 47099 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 65 K20SUB MAC 20-Aug-24 02:18 Historic MOVSTU Move string, uppercasing any lowercase letters. 47100 subttl Historic MOVSTU Move string, uppercasing any lowercase letters. 47101 47102 ;[245] Begin code removal 47103 47104 ; Eats any leading whitespace. 47105 ; Call with t1/ source pointer 47106 ; t2/ destination pointer 47107 ; Returns with t1, t2 updated, t3/ character count, t4/ 0. 47108 47109 repeat 0,< 47110 remark ; Replaced with an EXTEND instruction 47111 movstu: entry movstu 47112 seto t3, ; Counter, started at -1. 47113 47114 movstx: ildb t4, t1 ; Get a character. 47115 jumpn t3, movsty ; Have we got at least one nonwhitespace? 47116 caie t4, 40 ; No, is this a blank? 47117 cain t4, 11 ; or a tab? 47118 jrst movstx ; One of those, skip it. 47119 movsty: cail t4, "a" ; Convert to upper case if necessary. 47120 caile t4, "z" 47121 skipa 47122 trz t4, 40 47123 idpb t4, t2 ; Copy it. 47124 aos t3 ; Count it. 47125 jumpn t4, movstx ; Everything up to & including the first null. 47126 ret 47127 >;;repeat 0 47128 47129 ;[245] End code removal 47130 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 66 K20SUB MAC 20-Aug-24 02:18 Translation table for MOVST to UPPERcase 47131 subttl Translation table for MOVST to UPPERcase 47132 47133 ;[245] Begin table insertion 47134 47135 chgsec(code,const) ; Translate tables go in constants area 47136 47137 ; Just skips whitespace. Also, can handle 8 bit pointers, but doesn't 47138 ; do anything with a character past .chdel (177). 47139 47140 500002 %ascuh=trmcod!.chcnb ; ASCII values start at Control-B 47141 47142 000545'03 100000 500001 chrshs: xwd eoscod,trmcod!.chcna ; NUL is end of string, ^A is allowed 47143 remark ; Everything terminates, except space and tab 47144 xlist ; Don't need to see all this junk 47145 list ; Restart the blather 47146 000745' %eotuh=. ; Remember end of table 47147 47148 000551'03 reloc chrshs+<<.chbsp>_-1> ; Get to backspace, horizontal tab pair 47149 000551'03 500010 000011 xwd trmcod!.chbsp,.chtab ; Tab does NOT terminate (nor set 'N') 47150 000565'03 reloc chrshs+<<.chspc>_-1> ; Get to space, exclamation point pair 47151 000565'03 000040 500041 xwd .chspc,trmcod!"!" ; Space does NOT terminate (nor set 'N') 47152 47153 000745'03 reloc %eotuh ; Get back to end of table 47154 cleans(<%ascuh,%eotuh>) ; Don't need these temporary symbols 47155 47156 remark Character table just UPPERcases characters, stopping on EOS 47157 47158 000002 %ascus=.chcnb ; ASCII values start at Control-B 47159 47160 000745'03 100000 000001 chrmut: xwd eoscod,.chcna ; NUL is end of string, ^A is allowed 47161 xlist ; Don't need to see all this junk 47162 list ; Restart the blather 47163 001145' %eotup==. ; Remember end of table 47164 47165 remark ; Get to lower case section 47166 001025'03 reloc chrmut+<<"`">_-1> ; Gets us to the corrct halfword pair 47167 001025'03 000140 000101 xwd "`","A" ; Convert lowercase a to UPPERcase A 47168 000102 %ascus="B" ; Starting at lowercase b 47169 xlist ; Don't need to see all this junk 47170 list ; Restart the blather 47171 001042'03 000132 000173 xwd "Z",173 ; Last letter and Left brace 47172 47173 001145'03 reloc %eotup ; Get back to end of table 47174 47175 001145'03 015 00 0 00 000545' chrshe: movst 0, chrshs ; Skip white, but stop on NUL 47176 001146'03 000000 000000 .chnul ; Fill character is end of string 47177 47178 001147'03 015 00 0 00 000745' chrmup: movst 0, chrmut ; Translate table to UPPERcase 47179 001150'03 000000 000000 .chnul ; Fill character is end of string 47180 47181 cleans(<%ascus,%eotup>) ; Don't need these temporary symbols 47182 retsec ; Return to code section 47183 47184 ;[245] End table insertion 47185 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67 K20SUB MAC 20-Aug-24 02:18 Move string, UPPERcasing any lowercase letters 47186 subttl Move string, UPPERcasing any lowercase letters 47187 47188 ;[245] Begin code insertion 47189 47190 ; Call: 47191 ; 47192 ; t1/ Source ASCII pointer 47193 ; t2/ Destination ASCII pointer 47194 ; 47195 ; Return: +1, always 47196 ; 47197 ; t1/ Updated source ASCII pointer 47198 ; t2/ Updated destination ASCII pointer 47199 ; t3/ Length of destination string, minus any initial whitespace 47200 ; t4/ Zero 47201 ; 47202 ; N.B., Munches initial horizontal white space (.chtab, .chspc) 47203 ; Stops on end of string, a .chnul 47204 47205 003541'01 movstu: entry movstu ; Used in K20MIT, checked in K20PAR 47206 003541'01 265 16 0 00 004276' saveac ; Piggy MOVST wants plenty registers 47207 003542'01 201 07 0 00 024000 movx q3, MAXBUF ; Load maximum length we'll do 47208 003543'01 200 05 0 00 000002 move q1, t2 ; Load destination pointer 47209 003544'01 200 02 0 00 000001 move t2, t1 ; Load source pointer 47210 003545'01 403 03 0 00 000006 setzb t3, q2 ; No non-section zero pointers 47211 003546'01 200 01 0 00 000007 move t1, q3 ; String length 47212 003547'01 200 04 0 00 000001 move t4, t1 ; Assume equal length strings 47213 47214 remark ^-S ; Do NOT set 'S'--NOT translating!! 47215 003550'01 123 01 0 00 000000# extend t1, chrshe ; Use auto-magic and skip horizontal space until EOS 47216 003551'01 600 00 0 00 000000 nop ; Don't need to know about skip/non-skip 47217 47218 003552'01 603 01 0 00 200000 ifxe. t1, N ; Didn't terminate with a non-whitespace? 47219 003553'01 254 00 0 00 003561' 47220 003554'01 621 01 0 00 700000 txz t1, S!N!M ; Nope, so stomp the flags 47221 remark N.B., It doesn't matter if t1 is non-zero, string was all whitespace 47222 003555'01 200 01 0 00 000002 move t1, t2 ; Return updated source 47223 003556'01 200 02 0 00 000005 move t2, q1 ; Return destination, which did not change 47224 003557'01 403 03 0 00 000004 setzb t3, t4 ; No length 47225 003560'01 263 17 0 00 000000 ret ; Done squeezing entire string dry 47226 003561'01 endif. ; End case entire string was white space 47227 47228 003561'01 621 01 0 00 700000 txz t1, S!N!M ; Shut off all flags 47229 003562'01 350 10 0 00 000001 aos q4, t1 ; Store character count BEFORE terminator 47230 003563'01 200 03 0 00 000002 move t3, t2 ; Make a copy of the source pointer 47231 003564'01 474 02 0 00 000000 seto t2, ; Direction is backwards 47232 003565'01 133 02 0 00 000003 adjbp t2, t3 ; Back it up by one BEFORE terminator 47233 003566'01 400 03 0 00 000000 setz t3, ; Maintain in-section local pointer 47234 47235 003567'01 661 01 0 00 400000 txo t1, S ; Start translating 47236 003570'01 123 01 0 00 000000# extend t1, chrmup ; Use auto-magic to munch and UPPERcase! 47237 003571'01 600 00 0 00 000000 nop ; Should always skip, since no TRMCOD 47238 47239 003572'01 200 01 0 00 000002 move t1, t2 ; Load final source pointer 47240 003573'01 200 02 0 00 000005 move t2, q1 ; Load final destination pointer k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 67-1 K20SUB MAC 20-Aug-24 02:18 Move string, UPPERcasing any lowercase letters 47241 003574'01 200 03 0 00 000007 move t3, q3 ; Load original length 47242 003575'01 274 03 0 00 000004 sub t3, t4 ; Subtract stopping destination length 47243 003576'01 400 04 0 00 000000 setz t4, ; Returns zero in t4 47244 003577'01 136 04 0 00 000002 idpb t4, t2 ; Deposit NUL in destination string 47245 003600'01 271 03 0 00 000001 addi t3, ^d1 ; Account for it in length 47246 003601'01 263 17 0 00 000000 ret ; Done 47247 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 68 K20SUB MAC 20-Aug-24 02:18 Translation tables for Counted MOVST to UPPERcase 47248 subttl Translation tables for Counted MOVST to UPPERcase 47249 47250 ;[245] Begin table insertion 47251 47252 chgsec(code,const) ; Translate tables go in constants area 47253 47254 remark First table just skips the horizontal space 47255 47256 ; Similar to chrmut, but does not munch NUL's, it just skips 47257 ; whitespace. Also, expects 8 bit pointers, but doesn't do anything 47258 ; with a character past .chdel (177) 47259 47260 500000 %ascuw=trmcod!.chnul ; ASCII values start at NUL 47261 47262 001151'03 chrsws: remark ; Everything terminates, except space and tab 47263 xlist ; Don't need to see all this junk 47264 list ; Restart the blather 47265 001351' %eotuw=. ; Remember end of table 47266 47267 001155'03 reloc chrsws+<<.chbsp>_-1> ; Get to backspace, horizontal tab pair 47268 001155'03 500010 000011 xwd trmcod!.chbsp,.chtab ; Tab does NOT terminate (nor set 'N') 47269 001171'03 reloc chrsws+<<.chspc>_-1> ; Get to space, exclamation point pair 47270 001171'03 000040 500041 xwd .chspc,trmcod!"!" ; Space does NOT terminate (nor set 'N') 47271 47272 001351'03 reloc %eotuw ; Get back to end of table 47273 cleans(<%ascuw,%eotuw>) ; Don't need these temporary symbols 47274 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 69 K20SUB MAC 20-Aug-24 02:18 Translation tables for Counted MOVST to UPPERcase 47275 remark Second table does the UPPERcasing, but does not munch NUL's 47276 47277 ; Only uppercases the 26 lowercase letters: a, b, c, d, e, f, g, h, i, 47278 ; j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y and z. Other 47279 ; characters are left strictly alone. 47280 47281 000000 %ascuc=.chnul ; ASCII values start at NUL (nothing stops it) 47282 47283 001351'03 chrcut: remark ; Table to only uppercase, not NUL's 47284 xlist ; Don't need to see all this junk 47285 list ; Restart the blather 47286 001551' %eotuc==. ; Remember end of table 47287 47288 remark ; Get to lower case section 47289 001431'03 reloc chrcut+<<"`">_-1> ; Gets us to the corrct halfword pair 47290 001431'03 000140 000101 xwd "`","A" ; Convert lowercase a to UPPERcase A 47291 000102 %ascuc="B" ; Starting at lowercase b 47292 xlist ; Don't need to see all this junk 47293 list ; Restart the blather 47294 001446'03 000132 000173 xwd "Z",173 ; Last letter and Left brace 47295 47296 001551'03 reloc %eotuc ; Get back to end of table 47297 cleans(<%ascuc,%eotuc>) ; Don't need these temporary symbols 47298 47299 001551'03 015 00 0 00 001151' chrcsw: movst 0,chrsws ; Translate table to skip initial white space 47300 001552'03 000000 000000 .chnul ; Fill character is end of string 47301 47302 001553'03 015 00 0 00 001351' chrcup: movst 0,chrcut ; Translate table to UPPERcase 47303 001554'03 000000 000000 .chnul ; Fill character is end of string 47304 47305 retsec ; Return to code section 47306 47307 ;[245] End table insertion 47308 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70 K20SUB MAC 20-Aug-24 02:18 Counted Move string, uppercasing any lowercase letters. 47309 subttl Counted Move string, uppercasing any lowercase letters. 47310 47311 ;[245] Begin code insertion 47312 47313 ; Call: 47314 ; 47315 ; t1/ Source ASCII pointer 47316 ; t2/ Destination ASCII pointer 47317 ; t3/ Count of source string bytes (not including trailing NUL) 47318 ; 47319 ; Return: +1, always 47320 ; 47321 ; t1/ Updated source ASCII pointer 47322 ; t2/ Updated destination ASCII pointer 47323 ; t3/ Length of final string, minus any initial whitespace 47324 ; t4/ Length of source string (which can be used as an internal check) 47325 ; 47326 ; N.B., Munches initial horizontal white space (.chtab, .chspc) 47327 ; Stops when source string count goes to zero and does NOT 47328 ; squeeze out NUL's. Do not include a trailing NUL in the 47329 ; count unless you want it there! 47330 ; 47331 ; After reviewing the tables above, understand that it is a TERRIBLE 47332 ; idea to call this routine after you have put parity on a string. 47333 47334 003602'01 movsuc: entry movsuc ; Used in K20PAR (to check out K20MIT) 47335 003602'01 265 16 0 00 004276' saveac ; Piggy MOVST wants plenty registers 47336 003603'01 200 07 0 00 000003 move q3, t3 ; Preserve length of source string 47337 003604'01 200 05 0 00 000002 move q1, t2 ; Load destination pointer 47338 003605'01 200 02 0 00 000001 move t2, t1 ; Load source pointer 47339 003606'01 403 03 0 00 000006 setzb t3, q2 ; No non-section zero pointers 47340 003607'01 200 01 0 00 000007 move t1, q3 ; Load source length 47341 003610'01 200 04 0 00 000001 move t4, t1 ; Destination will never be longer 47342 47343 remark ^-S ; Do NOT set 'S'--NOT translating!! 47344 003611'01 123 01 0 00 000000# extend t1, chrcsw ; First, skip all the whitespace 47345 003612'01 600 00 0 00 000000 nop ; May never skip since should always trmcod 47346 47347 003613'01 603 01 0 00 200000 ifxe. t1, N ; BUT!! Wasn't it force terminate?? 47348 003614'01 254 00 0 00 003622' 47349 003615'01 200 01 0 00 000002 move t1, t2 ; Return (updated) source string pointer 47350 003616'01 200 02 0 00 000005 move t2, q1 ; Return (unmodified) destination string pointer 47351 003617'01 400 03 0 00 000000 setz t3, ; Final string has no length 47352 003620'01 200 04 0 00 000007 move t4, q3 ; Return (unchanged) original length 47353 003621'01 263 17 0 00 000000 ret ; That was easy enough 47354 003622'01 endif. ; Otherwise, hit non-whitespace 47355 47356 003622'01 621 01 0 00 700000 txz t1, S!N!M ; Shut off all flags 47357 003623'01 350 10 0 00 000001 aos q4, t1 ; Store character count BEFORE terminator 47358 003624'01 200 03 0 00 000002 move t3, t2 ; Make a copy of the source pointer 47359 003625'01 474 02 0 00 000000 seto t2, ; Direction is backwards 47360 003626'01 133 02 0 00 000003 adjbp t2, t3 ; Back it up by one BEFORE terminator 47361 003627'01 400 03 0 00 000000 setz t3, ; Maintain in-section local pointer 47362 47363 003630'01 661 01 0 00 400000 txo t1, S ; Start translating k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 70-1 K20SUB MAC 20-Aug-24 02:18 Counted Move string, uppercasing any lowercase letters. 47364 003631'01 123 01 0 00 000000# extend t1, chrcup ; Use auto-magic to munch and uppercase! 47365 003632'01 600 00 0 00 000000 nop ; Should always skip, since no TRMCOD 47366 47367 003633'01 200 01 0 00 000002 move t1, t2 ; Load final source pointer 47368 003634'01 200 06 0 00 000007 move q2, q3 ; Load original length 47369 003635'01 274 06 0 00 000010 sub q2, q4 ; Calculate how many we skipped 47370 003636'01 200 03 0 00 000007 move t3, q3 ; Load original length 47371 003637'01 274 03 0 00 000006 sub t3, q2 ; Calculate final length of destination string 47372 47373 003640'01 210 02 0 00 000006 movn t2, q2 ; Load characters we skipped (but going backwards) 47374 003641'01 133 02 0 00 000005 adjbp t2, q1 ; Back up to the end of that (shrunken) string) 47375 003642'01 200 04 0 00 000007 move t4, q3 ; Source string length didn't change 47376 003643'01 263 17 0 00 000000 ret ; Done 47377 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 71 K20SUB MAC 20-Aug-24 02:18 Historic IAC code removed from k20mit 47378 subttl Historic IAC code removed from k20mit 47379 47380 ;[247] Begin code removal 47381 47382 repeat 0,< ;;Copied here out of k20mit 47383 move t2, [point 8, sndpkt] ; Yes, must double any IACs. 47384 move t3, [point 8, tvtbuf] ; Copy data field to this place. 47385 spak6a: ildb t1, t2 ; Byte loop. Get one. 47386 jumpe t1, spak6b ; Done? 47387 idpb t1, t3 ; No, copy it. 47388 cain t1, iac ; IAC? 47389 idpb t1, t3 ; Yes, copy it again. 47390 jrst spak6a ; Till done. 47391 spak6b: setz t1, ; Done, make result asciz. 47392 idpb t1, t3 ; ... 47393 move q1, t3 ;[223] Save last pointer 47394 move t2, [point 8, tvtbuf] ; Point to result. 47395 >;;repeat 0 47396 47397 ;[247] End code removal 47398 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 72 K20SUB MAC 20-Aug-24 02:18 iaciac Translation tables 47399 subttl iaciac Translation tables 47400 47401 ;[247] Begin table insertion 47402 47403 ; Background: 47404 ; 47405 ; Telnet uses a special 8-bit character to indicate that the next byte 47406 ; in the terminal stream should be interpreted as a command. This 47407 ; character is known as the IAC character and is octal 377, hex FF and 47408 ; decimal 256. 47409 ; 47410 ; When Kermit-20 is sending binary data, it is possible that a 47411 ; legitimate 377 can be seen in the data stream. Further, a delete or 47412 ; rubout character (octal 177) sent with even parity will also occur. 47413 ; This latter case is perhaps unlikely as TVT transport does not 47414 ; support parity. 47415 ; 47416 ; In either case, the IAC must quoted (meaning doubled) in order to be 47417 ; transmitted properly. This cannot happen with a DECnet NRT 47418 ; transport as signaling is done out-of-band. 47419 ; 47420 ; Kermit-20 previously looped through each packet to determine whether 47421 ; IAC doubling was necessary. Rewriting it to use the EXTEND MOVST 47422 ; instruction is part of ongoing loop elimination and replacement, 47423 ; another example being found [245], above. 47424 47425 chgsec(code,const) ; Translate tables go in constants area 47426 47427 000000 %iachr==.chnul ; 8 bit values start at NUL 47428 47429 001555'03 iactab: xlist ; Save some trees 47430 list ; Turn the blather back on 47431 47432 001755' %eotia==. ; Mark end of table 47433 47434 000177 %eotio==>_-1 ; Calculate offset of IAC pair 47435 001754'03 reloc iactab+%eotio ; Get there in translate table 47436 001754'03 000376 500377 xwd 376,trmcod!iac ; Stop if we hit an IAC 47437 47438 001755'03 reloc %eotia ; Get back to end of table 47439 47440 001755'03 015 00 0 00 001555' chriac: movst 0,iactab ; Stop on an IAC 47441 001756'03 000000 000000 .chnul ; Fill character is end of string 47442 47443 cleans(<%iachr,%eotia,%eotio>) ; Don't need these temporary symbols 47444 retsec ; Return to code section 47445 47446 ;[247] End table insertion 47447 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73 K20SUB MAC 20-Aug-24 02:18 iaciac Double Interprete As a Command character 47448 subttl iaciac Double Interprete As a Command character 47449 47450 ;[247] Begin code insertion 47451 47452 ; Call: 47453 ; 47454 ; t1/ Source length 47455 ; t2/ Source 8 bit pointer 47456 ; t3/ Destination 8 bit pointer 47457 ; 47458 ; Return: 47459 ; 47460 ; +1, some error 47461 ; 47462 ; T1/ -1 indicates that t2 and t3 pointed to the same string 47463 ; 47464 ; +2, Following registers updated 47465 ; 47466 ; t1/ Length of source string 47467 ; t2/ Updated 47468 ; t3/ Updated 47469 ; t4/ Length of destination string 47470 ; 47471 ; N.B., Because an IAC will be doubled, if T2 and T3 point to the same 47472 ; string, the following character will be TRASHED wth the second 47473 ; IAC. Therefore, DO NOT DO THIS. iaciac will give a fail return 47474 ; with a -1 if it detects this situation. 47475 47476 003644'01 iaciac: entry iaciac ; Called by spak in k20mit and $echo in k20par 47477 003644'01 312 02 0 00 000003 came t2, t3 ; We're not going to overwrite, are we? 47478 003645'01 254 00 0 00 003651' ifskp. ; That's not any good ... 47479 003646'01 474 01 0 00 000000 seto t1, ; Flag the problem 47480 003647'01 263 17 0 00 000000 ret ; Give error return 47481 003650'01 254 00 0 00 003654' else. ; Otherwise, let's get started 47482 003651'01 265 16 0 00 004454' saveac 47483 003652'01 200 11 0 00 000001 move p1, t1 ; Save original source length 47484 003653'01 400 12 0 00 000000 setz p2, ; Zero count of doubles 47485 003654'01 endif. ; End case initial check 47486 47487 remark t2, ; Already has proper source pointer 47488 003654'01 200 05 0 00 000003 move q1, t3 ; Set up destination pointer 47489 003655'01 403 03 0 00 000006 setzb t3, q2 ; Section local pointers 47490 003656'01 200 04 0 00 000001 move t4, t1 ; Load source length 47491 003657'01 242 04 0 00 000001 lsh t4, ^d1 ; Maximum is double the entire string of IAC's... 47492 003660'01 201 07 0 00 000377 movx q3, IAC ; Handy IAC for doubling 47493 003661'01 621 01 0 00 300000 txz t1, N!M ; Turn off status bits 47494 47495 003662'01 do. ; Enter loop lexical context 47496 003662'01 661 01 0 00 400000 txo t1, S ; Start translating immediately 47497 003663'01 123 01 0 00 000000# extend t1, chriac ; Start looking for an IAC 47498 003664'01 600 00 0 00 000000 nop ; Don't care about premature ending 47499 003665'01 607 01 0 00 200000 ifxn. t1, N ; Hit an IAC?? 47500 003666'01 254 00 0 00 003673' 47501 003667'01 136 07 0 00 000005 idpb q3, q1 ; Yes, drop it in 47502 003670'01 136 07 0 00 000005 idpb q3, q1 ; ...Twice... k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 73-1 K20SUB MAC 20-Aug-24 02:18 iaciac Double Interprete As a Command character 47503 003671'01 271 12 0 00 000001 addi p2, ^d1 ; And count an extra character 47504 003672'01 275 04 0 00 000002 subi t4, ^d2 ; Account for two bytes used 47505 003673'01 endif. ; End case of premature termination 47506 003673'01 621 01 0 00 700000 txz t1, S!N!M ; Shut off all MOVST bits for length check 47507 003674'01 323 01 0 00 003677' jumple t1, endlp. ; Break out of loop if source exhausted 47508 003675'01 323 04 0 00 003677' jumple t4, endlp. ; Break out of loop if destination exhausted 47509 003676'01 254 00 0 00 003662' loop. ; Otherwise, more to do 47510 003677'01 enddo. ; End of loop lexical context 47511 47512 003677'01 200 01 0 00 000011 move t1, p1 ; Load source length 47513 remark t2, ; Return updated source pointer 47514 003700'01 200 03 0 00 000005 move t3, q1 ; Return updated destination pointer 47515 003701'01 200 04 0 00 000011 move t4, p1 ; Load source length 47516 003702'01 270 04 0 00 000012 add t4, p2 ; Add in doubled IAC's to get destination 47517 003703'01 254 00 0 00 003514* retskp ; Finally done 47518 47519 ;[247] End code insertion 47520 47521 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 74 K20SUB MAC 20-Aug-24 02:18 Various extended addressing bits 47522 SUBTTL Various extended addressing bits 47523 47524 ;[216] This is all lifted from the Extended Mode FTP Server I wrote --Tom 47525 47526 REMARK Some other stuff which perhaps should have it into MACSYM? 47527 47528 777700 000000 GP%2PF==MASKB(0,11) ; Double word pointer field 47529 770000 000000 GP%2PB==MASKB(0,5) ; Double word pointer position of byte 47530 007700 000000 GP%2SB==MASKB(6,11) ; Double word pointer size of byte 47531 000040 000000 GP%2WB==1B12 ; Double word pointer signal bit 47532 000037 777777 GP%2RS==MASKB(13,35) ; Double word reserved field 47533 377777 777777 GP%2AD==MASKB(1,35) ; Double word 30 bit address, including 47534 ; Indirect bit, index fields 47535 770000 000000 GP%1PF==MASKB(0,5) ; Single word pointer field 47536 007777 777777 GP%1AD==MASKB(6,35) ; Single word FLAT 30 bit address 47537 47538 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 75 K20SUB MAC 20-Aug-24 02:18 Double word to single word routine 47539 subttl Double word to single word routine 47540 47541 ; T2/ Double word pointer to convert 47542 ; T3/ 47543 ; 47544 ; +1 Bogus double word P&S fields 47545 ; +2 Success, coverted single word pointer in T1 47546 ; 47547 ; To do: What happends to the XMOVEI if the address pointer is bogus? 47548 ; (Bits 1 and 2 not [1|0] or [0|1] or non-zero data in reserved 47549 ; bits 2 through 12 in local indirect words) 47550 ; Is there a faster way to do this translation? 47551 47552 003704'01 627 02 0 00 000040 D2SGPC: TXZN T2,GP%2WB ; First things first, check and stomp 47553 003705'01 263 17 0 00 000000 RET ; the double word pointer bit. 47554 003706'01 630 02 0 00 004470' ANDX T2,GP%2PF ; Mask off any reserved or user sillyness 47555 003707'01 201 01 0 00 000031 MOVX T1,%OWMAX-1 ; Start at the end of the table 47556 003710'01 DO. ; Check to see if these are valid P&S 47557 003710'01 316 02 0 01 000000# CAMN T2,OW2DW(T1) ; fields for a one word global pointer 47558 003711'01 254 00 0 00 003713' EXIT. ; Found it! 47559 003712'01 365 01 0 00 003710' SOJGE T1,TOP. ; Get to next table entry 47560 003713'01 ENDDO. ; Until checked beginning 47561 003713'01 305 01 0 00 000000 CAIGE T1,0 ; Did we find a valid entry? 47562 003714'01 263 17 0 00 000000 RET ; Nope, can't do the conversion 47563 003715'01 271 01 0 00 000045 ADDI T1,^D37 ; Offset into proper single word P&S field 47564 003716'01 241 01 0 00 000036 ROT T1,<^D35-POS(GP%1PF)> ;Position to single word P&S field, saving 47565 003717'01 612 01 0 00 004471' TXNE T1,GP%1AD ; possible field overflow. And any junk? 47566 003720'01 263 17 0 00 000000 RET ; Yes, probably a bogus table offset 47567 remark ; Resolve any local or global indirection (impossible) 47568 003721'01 434 01 0 00 000003 IOR T1,T3 ; Load the 30 bit address into the one word 47569 003722'01 254 00 0 00 003703* RETSKP ; global pointer 47570 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 76 K20SUB MAC 20-Aug-24 02:18 One Word to Double word byte pointer translation table 47571 SUBTTL One Word to Double word byte pointer translation table 47572 47573 ; The table is copied from Page 2-85 in the User Operations section of 47574 ; the PDP-10 1982 Processor Reference Manual. Note that there is a 47575 ; documentation error for entry 40; it is listed as 28 and should be 18. 47576 47577 chgsec(code,const) ; Pointer table is considered constant data 47578 47579 001757'03 440600 000000 OW2DW: ; 37 Legal P&S ; 6 Bit Pointers 47580 001760'03 360600 000000 ; 38 Legal P&S 47581 001761'03 300600 000000 ; 39 Legal P&S 47582 001762'03 220600 000000 ; 40 Legal P&S 47583 001763'03 140600 000000 ; 41 Legal P&S 47584 001764'03 060600 000000 ; 42 Legal P&S 47585 001765'03 000600 000000 ; 43 Legal P&S 47586 001766'03 441000 000000 ; 44 Legal P&S ; 8 Bit Pointers 47587 001767'03 341000 000000 ; 45 Legal P&S 47588 001770'03 241000 000000 ; 46 Legal P&S 47589 001771'03 141000 000000 ; 47 Legal P&S 47590 001772'03 041000 000000 ; 48 Legal P&S 47591 001773'03 440700 000000 ; 49 Legal P&S ; 7 Bit Pointers 47592 001774'03 350700 000000 ; 50 Legal P&S 47593 001775'03 260700 000000 ; 51 Legal P&S 47594 001776'03 170700 000000 ; 52 Legal P&S 47595 001777'03 100700 000000 ; 53 Legal P&S 47596 002000'03 010700 000000 ; 54 Legal P&S 47597 002001'03 441100 000000 ; 55 Legal P&S ; 9 Bit Pointers 47598 002002'03 331100 000000 ; 56 Legal P&S 47599 002003'03 221100 000000 ; 57 Legal P&S 47600 002004'03 111100 000000 ; 58 Legal P&S 47601 002005'03 001100 000000 ; 59 Legal P&S 47602 002006'03 442200 000000 ; 60 Legal P&S ; 18 Bit Pointers 47603 002007'03 222200 000000 ; 61 Legal P&S 47604 002010'03 002200 000000 ; 62 Legal P&S 47605 000032 %OWMAX==.-OW2DW ; One Word Maximum byte pointer magic number 47606 .xcref %OWMAX ; Don't need this temporary in the cross reference 47607 suppress %OWMAX ; Don't need this temporary in the symbol listing 47608 47609 IFN <%OWMAX-<^D62-^D37+1>>,^_ 47610 <.fatal Illegal number of one word to double word pointer fields> 47611 47612 if2 < purge %OWMAX > ; Not needed after pass two 47613 retsec ; Restore .psect's 47614 47615 ;[216] End code insertion 47616 47617 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 77 K20SUB MAC 20-Aug-24 02:18 CRC Routines 47618 subttl CRC Routines 47619 47620 ;[66] CRC calculation 47621 ; 47622 ; This routine will calculate the CRC for a string, using the 47623 ; CRC-CCITT polynomial. 47624 ; 47625 ; The string should be the fields of the packet between but not including 47626 ; the and the block check, which is treated as a string of bits with 47627 ; the low order bit of the first character first and the high order bit of the 47628 ; last character last -- this is how the bits arrive on the transmission line. 47629 ; The bit string is divided by the polynomial 47630 ; 47631 ; x^16+x^12+x^5+1 47632 ; 47633 ; The initial value of the CRC is 0. The result is the remainder of this 47634 ; division, used as-is (i.e. not complemented). 47635 ; 47636 ; Contributed by Nick Bush, Stevens Institute of Technology. 47637 ; 47638 ; Call with 47639 ; t1/ length of string 47640 ; t2/ 8-bit byte pointer to string 47641 ; Returns +1 always, with t1/ 16-bit CRC, t2 unchanged. 47642 ; 47643 ; AC usage: 47644 ; t1/ Accumulated CRC 47645 ; q4/ Remaining length 47646 ; q3/ Byte pointer to string 47647 ; q2/ temp 47648 ; q1/ temp 47649 47650 003723'01 crcclc: entry crcclc ; Identify our location for LINK 47651 extern parity,none ; Inform of our necessary 47652 003723'01 265 16 0 00 004472' saveac ; Save q1-q4, and t2. 47653 003724'01 120 07 0 00 000001 dmove q3,t1 ; Get arguments. 47654 003725'01 400 01 0 00 000000 setz t1, ; Initial CRC is 0. 47655 003726'01 200 02 0 00 001516* move t2, parity ;[136] Get parity. 47656 47657 003727'01 do. ;[194] Enter loop context 47658 003727'01 134 05 0 00 000010 ildb q1, q4 ; Get a character. 47659 003730'01 302 02 0 00 001515* caie t2, none ;[136] Parity = NONE? 47660 003731'01 405 05 0 00 000177 andi q1, ^o177 ;[136] No, doing parity, strip parity bit. 47661 003732'01 431 05 0 01 000000 xori q1, (t1) ; Add in with current CRC. 47662 003733'01 135 06 0 00 004506' ldb q2, [point 4,q1,31] ;Get high 4 bits. 47663 003734'01 405 05 0 00 000017 andi q1, ^o17 ; AND low 4 bits. 47664 003735'01 200 05 0 05 000000# move q1, crctb2(q1) ; Get low portion of CRC factor. 47665 003736'01 430 05 0 06 000000# xor q1, crctab(q2) ; Plus high portion. 47666 003737'01 242 01 0 00 777770 lsh t1, -^d8 ; Shift off a byte from previous CRC. 47667 003740'01 430 01 0 00 000005 xor t1, q1 ; Add in new value. 47668 003741'01 367 07 0 00 003727' sojg q3, top. ; Loop for all characters. 47669 003742'01 enddo. ;[194] Fall out of loop context 47670 47671 003742'01 263 17 0 00 000000 ret ; Done, return +1 with CRC in t1. 47672 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 78 K20SUB MAC 20-Aug-24 02:18 Data tables for CRC-CCITT generation 47673 subttl Data tables for CRC-CCITT generation 47674 47675 chgsec(code,const) ;[208] Table goes in constants section 47676 47677 002011'03 000000 000000 crctab: oct 0 47678 002012'03 000000 010201 oct 10201 47679 002013'03 000000 020402 oct 20402 47680 002014'03 000000 030603 oct 30603 47681 002015'03 000000 041004 oct 41004 47682 002016'03 000000 051205 oct 51205 47683 002017'03 000000 061406 oct 61406 47684 002020'03 000000 071607 oct 71607 47685 002021'03 000000 102010 oct 102010 47686 002022'03 000000 112211 oct 112211 47687 002023'03 000000 122412 oct 122412 47688 002024'03 000000 132613 oct 132613 47689 002025'03 000000 143014 oct 143014 47690 002026'03 000000 153215 oct 153215 47691 002027'03 000000 163416 oct 163416 47692 002030'03 000000 173617 oct 173617 47693 47694 002031'03 000000 000000 crctb2: oct 0 47695 002032'03 000000 010611 oct 10611 47696 002033'03 000000 021422 oct 21422 47697 002034'03 000000 031233 oct 31233 47698 002035'03 000000 043044 oct 43044 47699 002036'03 000000 053655 oct 53655 47700 002037'03 000000 062466 oct 62466 47701 002040'03 000000 072277 oct 72277 47702 002041'03 000000 106110 oct 106110 47703 002042'03 000000 116701 oct 116701 47704 002043'03 000000 127532 oct 127532 47705 002044'03 000000 137323 oct 137323 47706 002045'03 000000 145154 oct 145154 47707 002046'03 000000 155745 oct 155745 47708 002047'03 000000 164576 oct 164576 47709 002050'03 000000 174367 oct 174367 47710 retsec ;[208] Re-open executable code 47711 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 79 K20SUB MAC 20-Aug-24 02:18 setgrd - set up guard pages for stacks, etc. 47712 subttl setgrd - set up guard pages for stacks, etc. 47713 47714 ; Lifted from Extended Mode FTP server I wrote, EFTPSA. 47715 ; 47716 ; A guard page is a no-access page, call it 'explode-on-use'. 47717 47718 .endps code ; End code psect 47719 .psect data ; Need some local storage 47720 47721 000076'05 000000 000000 myccoc: 0 ;[161] CCOC words for my tty. 47722 000077'05 000000 000000 0 ;[161] (two of them) 47723 000100'05 000000 000000 ttpau: 0 ;[161] Controlling TTY's pause chars. 47724 47725 000101'05 000000 000000 grdpg2: 0 ; Guard page in memory 47726 000102'05 000000 000000 grdadr: 0 ; Address of same 47727 000103'05 000000 000000 grdhan: 0 ; File handle of guard page 47728 000104'05 000000 000000 grdmap::0 ;[263] ; Process handle of guard page 47729 .endps data ; Done with writable storage 47730 47731 .psect datend/ronly,112000 ; Mark the end of the data .psect 47732 000000'06 datgrd: block ^d512 ; So we can drop in a guard page 47733 .endps datend ; Yet doesn't store anything 47734 47735 .psect const ; Table of addresses goes in constants 47736 002051'03 000000 006000 guardp: macgp1 ; Macro guard page 1 (before mapping window) 47737 002052'03 000000 010000 macgp2 ; Second guard page is after file mapping window 47738 002053'03 000000 020000 macgp3 ; Third guard page is after macro storage 47739 002054'03 000000 030000 macgp4 ; Fourth guard page is after garbage collection 47740 emacro < ; Only if I've finished the macro editor ... 47741 macgp5 ; Fifth guard page is after macro editing 47742 >;;emacro 47743 002055'03 000000000000# datgrd ; Put a guard page here, too 47744 002056'03 777777 777777 -1 ; Note list MUST end in -1!! 47745 .endps const ; End of constants 47746 .psect code ; Reopen code psect 47747 47748 003743'01 setgrd: entry setgrd ; Called at start up 47749 003743'01 265 16 0 00 004262' saveac ; Save some scratch registers 47750 003744'01 260 17 0 00 003765' call fepage ; Go find an illegal page 47751 003745'01 263 17 0 00 000000 ret ; But couldn't ... 47752 003746'01 124 01 0 00 000000# dmovem t1, grdpg2 ; Record as guard page double word 47753 003747'01 202 03 0 00 000000# movem t3, grdhan ; Save the file page handle, also 47754 003750'01 550 05 0 00 000001 hrrz q1, t1 ; Load the in-memory guard page 47755 003751'01 505 05 0 00 600000 hrli q1, .fhslf!fh%epn ; Convert to extended page handle in this fork 47756 003752'01 202 05 0 00 000000# movem q1, grdmap ; Save as a guard page mapping 47757 003753'01 415 06 0 00 000000# xmovei q2, guardp ; Load the address of guard page list 47758 47759 003754'01 do. ; Loop, setting up guard pages 47760 003754'01 335 02 0 06 000000 skipge t2, (q2) ; Pick up the guard page address 47761 003755'01 263 17 0 00 000000 ret ; Done, leave 47762 remark Case III: ; Mapping One Process's Pages to Another Process 47763 003756'01 242 02 0 00 777767 adr2pg t2, ; Convert address to page 47764 003757'01 505 02 0 00 600000 hrli t2, .fhslf!fh%epn ; page handle for this process 47765 003760'01 200 01 0 00 000005 move t1, q1 ; Load our base guard page handle 47766 003761'01 205 03 0 00 000200 movx t3, pm%epn ; Going into a non-zero section k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 79-1 K20SUB MAC 20-Aug-24 02:18 setgrd - set up guard pages for stacks, etc. 47767 003762'01 104 00 0 00 000056 PMAP% ; Finally map in a bogus page 47768 003763'01 320 12 0 00 003764' erjmpr .+1 ; Catch and ignore error 47769 003764'01 344 06 0 00 003754' aoja q2, top. ; Loop for another guard page 47770 003765'01 enddo. ; End of loop lexical context 47771 47772 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 80 K20SUB MAC 20-Aug-24 02:18 FEPAGE - Find an illegal page to map 47773 SUBTTL FEPAGE - Find an illegal page to map 47774 47775 ; Original code lifted from Tops-20 Extended Mode FTP server. 47776 ; 47777 ; Creates a page in the page map that is illegal to reference in *ANY* 47778 ; way, including reading. Does this by first finding a page in our 47779 ; address space that contains a page from our executable and then 47780 ; mapping in a page that file that is known not to exist and cannot be 47781 ; created. 47782 ; 47783 ; I call it an 'Explode-on-Use' page. 47784 ; 47785 47786 ; A guard page is created by mapping in a non-existant page that is 47787 ; past the end of our executable file. The executable file has the 47788 ; following properties: it is not extendable while mapped nor is it 47789 ; copy-on-write. Thus, a write to this file page will fail because 47790 ; the .EXE is locked. A read will fail because the page must be 47791 ; created in order to be read. Since it isn't writable to begin with, 47792 ; it can't be created. 47793 ; 47794 ; See R.E. Gorin, "Introduction to DECSYSTEM-20 Assembly Language 47795 ; Programming", page 443, footnote 3 for further details. Thanks to 47796 ; MRC for suggesting this approach. 47797 ; 47798 ; Returns: 47799 ; 47800 ; T1/ Page number of guard page 47801 ; T2/ 30 bit address of guard page 47802 ; T3/ File window handle of guard page (JFN,,Page number) 47803 ; 47804 ; Note: Maybe I ought to use XRMAP% below in case I have to shuttle 47805 ; through a lot of pages. In practice, however, I rarely have to 47806 ; process more than one page, so it didn't seem worth it and therefore 47807 ; I used a simple RMAP% instead. 47808 ; 47809 ; To do: MRC said that for certain size executable, this code won't 47810 ; work. Check for that size here and do something intelligent 47811 ; if so. Or gronk. 47812 47813 003765'01 265 16 0 00 004507' fepage: saveac ; Needs some registers 47814 003766'01 201 14 0 00 000031 movx p4, ^d25 ; Don't look through more than this many pages 47815 003767'01 415 13 0 00 003767' xmovei p3, . ; Load current executable address 47816 003770'01 242 13 0 00 777767 adr2pg p3, ; Convert address to page which we don't 47817 ; look at because DDT is probably there 47818 003771'01 fndpag: do. ; Now find a page with our JFN in it 47819 003771'01 363 14 0 00 003511* sojle p4, R ; Did this too many times? Return +1 47820 003772'01 350 01 0 00 000013 aos t1, p3 ; Increment and load page number 47821 003773'01 505 01 0 00 600000 hrli t1,.fhslf!fh%epn ; Looking at this fork 47822 003774'01 104 00 0 00 000057 RPACS% ; Find out the access 47823 003775'01 320 12 0 00 003771' erjmpr top. ; Couldn't, go to next page 47824 003776'01 607 02 0 00 010000 txnn t2, pa%pex ; Does the page exist? 47825 003777'01 254 00 0 00 003771' loop. ; No, go look for another one 47826 004000'01 603 02 0 00 000200 txne t2, pa%prv ; Is the page private? 47827 004001'01 254 00 0 00 003771' loop. ; Yes, we need one with a JFN in it k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 80-1 K20SUB MAC 20-Aug-24 02:18 FEPAGE - Find an illegal page to map 47828 004002'01 104 00 0 00 000061 rmap% ; Get a handle on the page 47829 004003'01 320 12 0 00 003771' erjmpr top. ; Gronked, go on to next page 47830 004004'01 607 02 0 00 010000 txnn t2, pa%pex ; Sanity Check: does the page still exist? 47831 004005'01 254 00 0 00 003771' loop. ; No, go look for another one 47832 004006'01 554 01 0 00 000001 hlrz t1, t1 ; Load just the process/file designator 47833 004007'01 306 01 0 00 400000 cain t1, .fhslf ; Quick check, this isn't our own process, is it? 47834 004010'01 254 00 0 00 003771' loop. ; Yah, it is, so worthless; bum the GTSTS% 47835 004011'01 104 00 0 00 000024 GTSTS% ; Otherwise, see if we can use this? 47836 004012'01 320 12 0 00 003771' erjmpr top. ; No JFN, so just go to the next page 47837 004013'01 607 02 0 00 000200 txnn t2, gs%nam ; Is anything in there a JFN? 47838 004014'01 254 00 0 00 003771' loop. ; No, not safe to use 47839 004015'01 607 02 0 00 400000 txnn t2, gs%opn ; Is the file open? 47840 004016'01 254 00 0 00 003771' loop. ; No, won't be able to PMAP% it 47841 004017'01 603 02 0 00 100000 txne t2, gs%wrf ; Better not be for write 47842 004020'01 254 00 0 00 003771' loop. ; It is, will self-create, then 47843 004021'01 607 02 0 00 020000 txnn t2, gs%rnd ; Open for non-append access? 47844 004022'01 254 00 0 00 003771' loop. ; No, will extend then 47845 remark ; If we get here, we fall out of the loop 47846 004023'01 enddo. ; End of loop context 47847 ; Otherwise, we have a safe page to use 47848 004023'01 553 13 0 00 000001 hrrzs p3, t1 ; Save a nice JFN 47849 004024'01 104 00 0 00 000036 SIZEF% ; Get the number of pages in the file 47850 004025'01 320 12 0 00 003771' erjmpr fndpag ; Can't, so keep looking 47851 004026'01 540 01 0 00 000013 hrr t1, p3 ; Load our executable JFN 47852 004027'01 504 01 0 00 000003 hrl t1, t3 ; Start REAL NEAR the end of the file 47853 004030'01 104 00 0 00 000031 FFFFP% ; Find the first unused (free) file page 47854 004031'01 320 12 0 00 003771' erjmpr fndpag ; Can't, so keep looking 47855 004032'01 316 01 0 00 004221' camn t1, [-1] ; None?? 47856 004033'01 254 00 0 00 003771' jrst fndpag ; No, continue the journey 47857 47858 remark ; Otherwise, have a guard page from the file!! 47859 004034'01 200 12 0 00 000001 move p2, t1 ; Save as source designator 47860 47861 remark Case I: ; Mapping File Pages to a Process 47862 004035'01 514 01 0 00 000013 hrlz t1, p3 ; JFN of executable file in the left half 47863 004036'01 540 01 0 00 000012 hrr t1, p2 ; Page number of executable file 47864 dmove t2,[.fhslf!fh%epn,,grdpag ; Fork and page handle 47865 004037'01 120 02 0 00 004521' pm%epn] ; going into any section 47866 004040'01 104 00 0 00 000056 PMAP% ; Finally map in a bogus page 47867 004041'01 320 12 0 00 003771' erjmpr fndpag ; Gronked, try the old way 47868 004042'01 550 04 0 00 000002 hrrz t4, t2 ; Load the page we mapped 47869 004043'01 242 04 0 00 000011 pg2adr t4, ; Convert to address 47870 004044'01 200 01 1 00 000004 move t1, @t4 ; The moment of truth, this should fail 47871 004045'01 320 12 0 00 004047' ifje. r ; Well, did it? 47872 004046'01 254 00 0 00 004055' 47873 remark ; All is well, return the data 47874 004047'01 514 03 0 00 000013 hrlz t3, p3 ; Load executable file JFN 47875 004050'01 540 03 0 00 000012 hrr t3, p2 ; Load the file page number of the guard page 47876 004051'01 550 01 0 00 000002 hrrz t1, t2 ; Load page number of guard page in memory 47877 004052'01 200 02 0 00 000004 move t2, t4 ; Load the address of the guard page in memory 47878 004053'01 254 00 0 00 003722* retskp ; And return success 47879 004054'01 254 00 0 00 004056' else. ; ?? 47880 004055'01 254 00 0 00 003771' jrst fndpag ; Try some more 47881 004056'01 endif. 47882 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81 K20SUB MAC 20-Aug-24 02:18 Break out various flags from JFN flags 47883 subttl Break out various flags from JFN flags 47884 47885 ;[252] Begin code insertion 47886 ; 47887 ; Used when debugging results of COMND% functions .CMINI, .CMOFI, and 47888 ; .CMFIL, GTJFN% (with GJ%FLG) and GNJFN%. Written to help debug 47889 ; directory listing logic when doing a wildarded (DSK*:) listing. 47890 ; 47891 repeat 0,< ;[252] Unnecessary now that debugging is done 47892 ; 47893 ; Call: 47894 ; 47895 ; t1/ JFN and flags 47896 ; 47897 ; From monsym.mac: 47898 ; 47899 ;Flags returned by GTJFN% and GNJFN% 47900 ; 47901 ;GTJFN% flags returned 47902 remark GJ%DEV 1B0 Asterisk was given for device 47903 remark GJ%UNT 1B1 Asterisk was given for unit 47904 remark GJ%DIR 1B2 Asterisk was given for directory 47905 remark GJ%NAM 1B3 Asterisk was given for name 47906 remark GJ%EXT 1B4 Asterisk was given for extension 47907 remark GJ%VER 1B5 Asterisk was given for generation 47908 remark GJ%UHV 1B6 Use highest generation 47909 remark GJ%NHV 1B7 Use next higher generation 47910 remark GJ%ULV 1B8 Use lowest generation 47911 remark GJ%PRO 1B9 Protection attribute (;P) given 47912 remark GJ%ACT 1B10 Account attribute (;A) given 47913 remark GJ%TFS 1B11 Temporary file attribute (;T) given 47914 remark GJ%GND 1B12 Complement of GJ%DEL on call 47915 remark GJ%NOD 1B13 Node name was given 47916 ;GNJFN% flags returned 47917 remark GN%STR 1B13 Structure changed 47918 remark GN%DIR 1B14 Directory changed 47919 remark GN%NAM 1B15 Name changed 47920 remark GN%EXT 1B16 Extension changed 47921 ;GTJFN 47922 remark GJ%GIV 1B17 Complement of G1%IIV 47923 47924 ; Note that the bit conflict between GJ%NOD and GN%STR is ignored as 47925 ; Kermit does not use GTJFN% to parse for a node name, but rather 47926 ; COMND%'s .CMNOD function. 47927 47928 jfnflg: entry jfnflg ; Globalize entry 47929 jumpe t1, r ; Ignore if nothing there ... 47930 skipe local ; Only if NOT local 47931 ret ; Don't junk up the remote connection... 47932 saveac 47933 47934 hrrz q2, t1 ; Load just the new JFN 47935 hllz q1, t1 ; Looking at just the stepping flags 47936 caie q2, .nulio ; Just dumping it? 47937 ifskp. ; Yes, set up other flags k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81-1 K20SUB MAC 20-Aug-24 02:18 Break out various flags from JFN flags 47938 movx q3, GS%NAM ; Just say that it's bound 47939 else. ; Otherwise, have a look at the JFN's health 47940 tlz t1, -1 ; Stomp any flags so GTSTS% doesn't choke 47941 GTSTS% ; Now see if we can use this. 47942 ifje. r ; Might fail... 47943 move t3, t1 ; Save the error 47944 setz q3, ; Force gs%nam off 47945 else. ; Otherwise, it worked 47946 move q3, t2 ; Save those flags 47947 endif. ; End case GTSTS% handling 47948 endif. ; End case .nulio special handling 47949 47950 ifxe. q3, GS%NAM ; Is this a valid JFN? 47951 txmsg <(Invalid) > ; Yes, say so 47952 ret ; Nothing else to do 47953 endif. 47954 ; Otherwise, start breaking out bits 47955 ifxn. q1, GJ%DEV ; Device wildcarded? 47956 txmsg ; Yes, say so 47957 endif. 47958 ifxn. q1, GJ%UNT ; Unit wildcarded? 47959 txmsg ; Yes, say so 47960 endif. 47961 ifxn. q1, GJ%DIR ; Directory wildcarded? 47962 txmsg ; Yes, say so 47963 endif. 47964 ifxn. q1, GJ%NAM ; File name wildcarded? 47965 txmsg ; Yes, say so 47966 endif. 47967 ifxn. q1, GJ%EXT ; Extension wildcarded? 47968 txmsg ; Yes, say so 47969 endif. 47970 ifxn. q1, GJ%VER ; Version wildcarded? 47971 txmsg ; Yes, say so 47972 endif. 47973 ; Generation specification 47974 ifxn. q1, GJ%UHV ; Use highest generation? 47975 txmsg ; Yes, say so 47976 endif. 47977 ifxn. q1, GJ%NHV ; Next highest generation? 47978 txmsg ; Yes, say so 47979 endif. 47980 ifxn. q1, GJ%ULV ; Lowest generation? 47981 txmsg ; Yes, say so 47982 endif. 47983 ; Other attributes 47984 ifxn. q1, GJ%PRO ; Protection attribute given? 47985 txmsg <;P > ; Yes, say so 47986 endif. 47987 ifxn. q1, GJ%ACT ; Account attribute given? 47988 txmsg <;A > ; Yes, say so 47989 endif. 47990 ifxn. q1, GJ%TFS ; Temporary attribute given? 47991 txmsg <;T > ; Yes, say so 47992 endif. k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 81-2 K20SUB MAC 20-Aug-24 02:18 Break out various flags from JFN flags 47993 ifxE. q1, GJ%GND ; Got a deleted file? (Complement of GJ%DEL) 47994 txmsg ; Yes, say so 47995 endif. 47996 ifxE. q1, GJ%GIV ; Got an Invisible file? (complement of GN%IIN) 47997 txmsg ; Yes, say so 47998 endif. 47999 ; GNJFN%'s stepping flags 48000 ifxn. q1, GN%STR ; Structure changed? 48001 txmsg ; Yes, say so 48002 endif. 48003 ifxn. q1, GN%DIR ; Directory changed? 48004 txmsg ; Yes, say so 48005 endif. 48006 ifxn. q1, GN%NAM ; Name changed? 48007 txmsg ; Yes, say so 48008 endif. 48009 ifxn. q1, GN%EXT ; Extension changed? 48010 txmsg ; Yes, say so 48011 endif. 48012 ; GTSTS% flags 48013 ifxn. q3, GS%OPN ; Is the file open? 48014 txmsg ; Yes, say so 48015 endif. 48016 ifxn. q3, GS%WRF ; Open for write? 48017 txmsg ; Yes, say so 48018 endif. 48019 48020 movei t1, .priou ; Always typing on terminal 48021 caie q2, .nulio ; Dumping it? 48022 ifskp. ; That's easy! 48023 dmove t2, nul4 ; Constant string and length 48024 setz t4, ; In case anybody looks ... 48025 SOUT% ; Type it 48026 erjmpr .+1 ; Catch and ignore error 48027 else. ; Otherwise, an actual JFN to type 48028 move t2, q2 ; Load the JFN 48029 dmove t3, allfld ; dev:name.typ.gen 48030 JFNS% ; Let's see what the complete file is 48031 ifje. r ; Catch the error 48032 move t4, t1 ; Save error for debuggers 48033 move t2, t1 ; Store the error 48034 hrli t2, .fhslf ; This process 48035 setz t3, ; Indefinite blating 48036 movei t1, .priou ; Type on terminal 48037 ERSTR% ; Blat 48038 erjmpr .+2 ; Ignore strange return 48039 erjmpr .+1 ; Ignore stranger return 48040 endif. ; End case JFNS% error handling 48041 endif. ; End case NUL: special casing 48042 ret ; Done 48043 48044 > ;repeat 0 ;[252] 48045 48046 ;[252] End code insertion 48047 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 82 K20SUB MAC 20-Aug-24 02:18 ASCII capability list 48048 subttl ASCII capability list 48049 48050 ;[252] Begin code insertion 48051 ; 48052 ; Lifted and adapted from eftpss.mac (Extended Mode FTP server Site Specific code) 48053 ; 48054 ; N.B. Depends on three character capabilities! 48055 48056 repeat 0,< ;[252] Unnecessary now that debugging is done 48057 48058 remark Table of Capabilities and their abbreviations 48059 48060 captab: asciz /ctc/ ; SC%CTC==:1B0 Control-C 48061 asciz /gtb/ ; SC%GTB==:1B1 GETAB% 48062 asciz /mmn/ ; SC%MMN==:1B2 Map monitor 48063 asciz /log/ ; SC%LOG==:1B3 Logging functions 48064 asciz /mpp/ ; SC%MPP==:1B4 Map privileged pages 48065 asciz /sdv/ ; SC%SDV==:1B5 Special devices 48066 asciz /sct/ ; SC%SCT==:1B6 Assign TTY as controlling for fork (SCTTY%) 48067 0 ; Unknown 1B7 Capability 48068 0 ; Unknown 1B8 Capability 48069 asciz /sup/ ; SC%SUP==:1B9 Superior access 48070 0 ; Unknown 1B10 Capability 48071 0 ; Unknown 1B11 Capability 48072 0 ; Unknown 1B12 Capability 48073 0 ; Unknown 1B13 Capability 48074 0 ; Unknown 1B14 Capability 48075 0 ; Unknown 1B15 Capability 48076 0 ; Unknown 1B16 Capability 48077 asciz /frz/ ; SC%FRZ==:1B17 Freeze on terminating conditions 48078 asciz /whl/ ; SC%WHL==:1B18 Wheel 48079 asciz /opr/ ; SC%OPR==:1B19 Operator 48080 asciz /cnf/ ; SC%CNF==:1B20 Confidential Information Access 48081 asciz /mnt/ ; SC%MNT==:1B21 Maintenance 48082 asciz /ipc/ ; SC%IPC==:1B22 IPCF 48083 asciz /enq/ ; SC%ENQ==:1B23 ENQ/DEQ 48084 asciz /nwz/ ; SC%NWZ==:1B24 NET wizard (ASNSQ%, ETC.) 48085 asciz /nas/ ; SC%NAS==:1B25 Network Absolute Socket Privilege 48086 asciz /dna/ ; SC%DNA==:1B26 DECnet access allowed 48087 asciz /ana/ ; SC%ANA==:1B27 ARPAnet access allowed (Internet) 48088 asciz /sem/ ; SC%SEM==:1B28 Semi-Opr 48089 asciz /mea/ ; SC%MEA==:1B29 Mini-Exec Access Allowed ;[T198] 48090 0 ; Unknown 1B30 Capability 48091 0 ; Unknown 1B31 Capability 48092 0 ; Unknown 1B32 Capability 48093 0 ; Unknown 1B33 Capability 48094 0 ; Unknown 1B34 Capability 48095 asciz /adm/ ; SC%ADM==:1B35 PANDA Administrator 48096 capend:! 48097 48098 ifn , 48099 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 83 K20SUB MAC 20-Aug-24 02:18 ASCII capability list 48100 subttl Capability display code 48101 48102 ; t1/ 36 bit capability word 48103 48104 infcap: entry infcap ; Used in k20srv 48105 saveac 48106 skipe q1, t1 ; Save and check 48107 ifskp. ; None? 48108 txmsg <(None) > ; That's easy! 48109 ret ; All done! 48110 endif. 48111 ; Allocate some anonymous stack space 48112 anstkv (q4, <^D<<<2*80>/5>+1>>) 48113 move t1, q4 ; Load the address of the scratch stack space 48114 txo t1, .p07 ; Turn into ASCII OWGP in case non-zero section 48115 setzb t2, t3 ; Zero capability name registers 48116 setz t4, q3 ; Zero the bit holder and loop counter 48117 48118 do. 48119 jumpe q1, endlp. ; Anything left to do? 48120 lshc t4,^d1 ; Pick off a capability bit from q1 48121 ifxn. t4, 1b35 ; If it was set, display it if known 48122 move t3, captab(q3) ; Pick up the capability abbreviation 48123 cain t3, 0 ; Is it defined? 48124 call capcon ; No, phoney something up 48125 call depcap ; Display it 48126 endif. ; Otherwise, remember that it wasn't 48127 caige q3, ^d36 ; Are we still playing with a full DEC? 48128 aoja q3, top. ; Go get another bit 48129 enddo. 48130 48131 setz t4, ; Cons up a NUL 48132 move t3, t1 ; Get a copy of the point 48133 idpb q1, t3 ; Terminate the string, allowing append 48134 48135 move t1, q4 ; Load the address of the scratch stack space again 48136 txo t1, .p07 ; Turn into ASCII OWGP in case non-zero section 48137 PSOUT% ; Finally type something 48138 ret 48139 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 84 K20SUB MAC 20-Aug-24 02:18 ASCII capability list 48140 subttl Capability display support code 48141 48142 REMARK Cons up a capability abbreviation 48143 48144 capcon: skipge t2, q3 ; Load the current capability counter 48145 ret ; Better just not do anything 48146 caile t2, ^D35 ; Should NEVER be a capability larger than 35!! 48147 ret ; Just don't proceed 48148 idivi t2, ^d10 ; Extract the ones digit to T3 48149 lsh t2, <1+<^d3*^d7>> ; Shift tens digit over to second byte of word 48150 lsh t3, <1+<^d2*^D7>> ; Shift ones digit over to third byte of word 48151 add t3, [asciz /u00/] ; Unknown capability base 48152 add t3, t2 ; Don't forget the one's digit! 48153 RET ; Return the ASCII capability abbreviation 48154 48155 REMARK Special purpose routine to drop in the capability abbreviation 48156 48157 depcap: lshc t2, ^d7 ; Shift in and deposit three bytes 48158 idpb t2, t1 48159 lshc t2, ^d7 48160 idpb t2, t1 48161 lshc t2, ^D7 48162 idpb t2, t1 48163 movx t2, .chspc ; Space delimiter 48164 idpb t2, t1 48165 ret 48166 48167 > ;repeat 0 ;[252] 48168 48169 ;[252] End code insertion 48170 48171 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 85 K20SUB MAC 20-Aug-24 02:18 fndvec Find and record the symbol table vector 48172 subttl fndvec Find and record the symbol table vector 48173 48174 ; The EXEC shouldn't need this for things like ^T, yet it does... 48175 ; 48176 ; We don't need to do a PDVOP% to find our program data vector 48177 ; address because we are giving it its own .PSECT and therefore 48178 ; are setting the address ourselves 48179 ; 48180 ; We can't have LINK do this because LINK won't write .JBSYM when 48181 ; doing PDV's. 48182 ; 48183 ; Adapted from SETNOD rewrite (SETND2) 48184 ; 48185 ; N.B., While the code will properly find a symbol table in any 48186 ; section, it won't work unless it is run in a non-zero section. 48187 ; Since Kermit is effectively a section zero program with some ASCII 48188 ; data being accessed via one word global pointers, the symbol table 48189 ; and the symbol table vector must also be in section zero. 48190 48191 remark [233] 11:47am Saturday, 31 December 2022 48192 48193 ; The above isn't true, of course, we could use two 18 one word global 48194 ; pointers to fetch and OR two half words or jump into a non-zero 48195 ; section to get the data (see fetch and efetch, below). The problem 48196 ; is that this would have involved some non-obvious modifications to 48197 ; the below and the symbol table lookup routine which I didn't see 48198 ; the value of doing as opposed to finishing the NRT functionality. 48199 ; 48200 ; At the time, I didn't realize that although LINK isn't going to do 48201 ; what we want, there is nothing stopping us from using MACRO itself 48202 ; to deposit values in fixed locations in the 'low segement' area. 48203 ; See the end of this module for a bunch of loc statements, not all of 48204 ; which may be absolutely necessary, strictly speaking. 48205 ; 48206 ; The point was to maintain reverse compatibility with any PA1050 48207 ; based programs or other archaic Tops-20 oddities that hadn't been 48208 ; been upgraded to PDV's (as in, just about all of them), one in 48209 ; particular being the EXEC. 48210 ; 48211 ; The EXEC was modified in edit [T255] to the EXECP.MAC module to 48212 ; handle a 'modern' symbol table vector, which could be in a non-zero 48213 ; section. 48214 48215 ; See commentary below for new version of EXEC [T255] which can handle 48216 ; a modern symbol table vector. This gets the parts of it we want for 48217 ; later. 48218 48219 ifndef .jbsym, <.jbsym==116> ; Low segment symbol table pointer (old style) 48220 ifndef .jbsa , <.jbsa==120> ; Program start address 48221 ifndef .jbff , <.jbff==121> ; Program first free location 48222 ifndef .jbren, <.jbren==124> ; Low segment reenter word 48223 ifndef .jbver, <.jbver==137> ; Low segment version word 48224 48225 004056'01 fndvec: entry fndvec ; Called on start up 48226 remark ; Expects full run of temporaries k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 85-1 K20SUB MAC 20-Aug-24 02:18 fndvec Find and record the symbol table vector 48227 004056'01 265 16 0 00 004262' saveac ; But follow the rules, anyway 48228 004057'01 402 00 0 00 000000# setzm glbsym ; Clear global symbol table flag 48229 004060'01 403 01 0 00 000002 setzb t1, t2 ; Cons up some more zeros 48230 004061'01 124 01 0 00 000000# dmovem t1, symvec ; Stomp symbol vector and defined symbol table 48231 48232 remark ; N.B., DEPENDs on 'low segment' hand crafting, below 48233 004062'01 336 05 0 00 000116 skipn q1,.jbsym ; Nothing there? 48234 004063'01 263 17 0 00 000000 ret ; Nope, that's easy! (but useless) 48235 48236 004064'01 254 05 0 00 004065' xjrstf .+1 ; Go 'upstairs' to grab the value 48237 004065'01 010000 000000 pc%usr ; Don't try to break out of user mode 48238 004066'01 000001 000000# extsec,,fndve1 ; 'long jump' to extended mode operation 48239 .endps code ; Finish execution of section zero code 48240 48241 .psect ecode ; Resuming execution in extended code section 48242 48243 remark Caution ; The stack is ONLY valid in section zero!! 48244 48245 000012'02 fndve1: remark ; N.B., All the indirect addressing is a little slower 48246 000012'02 476 00 1 00 000130' setom @[0,,glbsym] ; Let's assume it's global (which it should be) 48247 000013'02 627 05 0 00 400000 txzn q1, 1b0 ; Just check if it's local (which it shouldn't be) 48248 000014'02 254 00 0 00 000016' ifskp. ; That's strange, but we can fix that up 48249 000015'02 501 05 0 00 000015' xhlli q1,. ; Stomp in the section number 48250 remark @[0,,glbsym] ; So it's still global (heh...) 48251 000016'02 endif. ; 48252 000016'02 202 05 1 00 000131' movem q1, @[0,,symvec] ; Store as symbol table VECTOR 48253 48254 000017'02 336 06 1 00 000005 skipn q2, @q1 ; Pull the vector length (first location) 48255 000020'02 254 00 0 00 000050' jrst fndver ; If we have one... 48256 48257 remark ; Otherwise, there is SOMETHING in there 48258 000021'02 325 06 0 00 000026' ifl. q2 ; Old style symbol table? (shouldn't be up here..) 48259 000022'02 202 06 1 00 000132' movem q2, @[0,,kjbsym] ;That's easy; just use it 48260 000023'02 254 05 0 00 000024' xjrstf .+1 ; And go 'downstairs' to return to caller 48261 000024'02 010000 000000 pc%usr ; Don't try to break out of user mode 48262 000025'02 000000000000# rskp ; Give +2 return 48263 000026'02 endif. ; End case old symbol table pointer in a strange place 48264 48265 remark ; New style symbol table vector! Grovel through it 48266 000026'02 363 06 0 00 000050' sojle q2, fndver ; But!! If nothing is in there, it's all over 48267 000027'02 415 05 0 05 000001 xmovei q1, 1(q1) ; Load address of first subtable 48268 000030'02 do. ; Enter loop context 48269 000030'02 120 01 0 05 000000 dmove t1, .stdat(q1) ; Load ST%TYP and ST%LEN and .STPTR 48270 000031'02 135 03 0 00 000133' ldb t3,[pointr (t1,st%typ)] ; Load table type 48271 000032'02 135 04 0 00 000134' ldb t4,[pointr (t1,st%len)] ; Load table length 48272 000033'02 302 03 0 00 000001 caie t3, .r50d ; Is the type a defined symbol table?? 48273 000034'02 254 00 0 00 000045' ifskp. ; Yes! It is!! 48274 000035'02 323 04 0 00 000045' andg. t4 ; But!! Does it contain any symbols? 48275 000036'02 210 03 0 00 000004 movn t3, t4 ; Load negative of length 48276 000037'02 514 01 0 00 000003 hrlz t1, t3 ; Assumes table is not greater than a section 48277 000040'02 540 01 0 00 000002 hrr t1, t2 ; Now have base of subtable 48278 000041'02 202 01 1 00 000135' movem t1,@[0,,kjbsym] ;Save for symbol table routine 48279 000042'02 254 05 0 00 000043' xjrstf .+1 ; And go 'downstairs' to return to caller 48280 000043'02 010000 000000 pc%usr ; Don't try to break out of user mode 48281 000044'02 000000000000# rskp ; Give +2 return k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 85-2 K20SUB MAC 20-Aug-24 02:18 fndvec Find and record the symbol table vector 48282 000045'02 endif. ; End case defined symbol table 48283 000045'02 415 05 0 05 000003 xmovei q1, .stsiz(q1) ; Load address of next subtable 48284 000046'02 275 06 0 00 000003 subi q2, .stsiz ; Account for words used in symbol block 48285 000047'02 327 06 0 00 000030' jumpg q2, top. ; Look some more, if anything left 48286 000050'02 enddo. ; End of loop context 48287 48288 remark ; If fell through, then never found symbol table 48289 ; Which is an error 48290 48291 000050'02 fndver: remark ; Here on any kind of error 48292 000050'02 402 00 1 00 000136' setzm @[0,,.jbsym] ; .jbsym is gubbish, so stop paying attention 48293 000051'02 402 00 1 00 000137' setzm @[0,,symvec] ; Stomp the symbol table vector too, it's bogus 48294 000052'02 254 05 0 00 000053' xjrstf .+1 ; And go 'downstairs' to return to caller 48295 000053'02 010000 000000 pc%usr ; Don't try to break out of user mode 48296 000054'02 000000000000# r ; Give +1 return 48297 48298 .endps ecode ; Get out of extended code 48299 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 86 K20SUB MAC 20-Aug-24 02:18 Magical symbol table lookup routine 48300 SUBTTL Magical symbol table lookup routine 48301 48302 ; For details, read "Introduction to DECSYSTEM-20 Assembly Language 48303 ; Programming", by Ralph Gorin, published by Digital Press, 1981. 48304 ; 48305 ; Called with desired symbol in T1 48306 48307 .psect code ; Starts out in section zero 48308 48309 004067'01 symout: entry symout ; Declare to the world 48310 004067'01 265 16 0 00 004523' saveac 48311 48312 004070'01 200 06 0 00 000001 move q2, t1 ; Save the desired symbol 48313 004071'01 403 03 0 00 000005 setzb t3 ,q1 ; no current program name or best symbol 48314 004072'01 200 04 0 00 000000# move t4, kjbsym ; Load (fixed to old style symbol table pointer 48315 004073'01 254 05 0 00 004074' xjrstf .+1 ; Go 'upstairs' to symbolically print the value 48316 004074'01 010000 000000 pc%usr ; Don't try to break out of user mode 48317 004075'01 000001 000000# extsec,,symou1 ; 'long jump' to extended mode operation 48318 .endps code ; Finish execution of section zero code 48319 48320 .psect ecode ; Resuming execution in extended code section 48321 48322 remark Caution ; The stack is ONLY valid in section zero!! 48323 48324 000055'02 322 04 0 00 000120' symou1: jumpe t4, plsoff ; Unless we don't have a symbol table 48325 000056'02 574 01 0 00 000004 hlre t1, t4 ; Convert halfword length to fullword 48326 000057'02 274 04 0 00 000001 sub t4, t1 ; -count,,ending address +1 48327 ; And hit search loop 48328 000060'02 do. ; Load this symbol's type 48329 000060'02 135 01 0 00 000140' ldb t1,[point 4,-2(t4),3] 48330 000061'02 322 01 0 00 000076' ifn. t1 ; program names are not relevant 48331 000062'02 303 01 0 00 000002 caile t1, ^o2 ; 0=prog name, 1=global, 2=local 48332 000063'02 254 00 0 00 000076' anskp. ; So skip this symbol 48333 000064'02 200 01 0 04 777777 move t1, -1(t4) ; Load value associated with the symbol 48334 000065'02 312 01 0 00 000006 came t1, q2 ; Is this an exact match, per chance? 48335 000066'02 254 00 0 00 000071' ifskp. ; It is, so no need for an offset 48336 000067'02 200 05 0 00 000004 move q1, t4 ; Just select it 48337 000070'02 254 00 0 00 000100' exit. ; And get out of the loop 48338 000071'02 endif. 48339 000071'02 311 01 0 00 000006 caml t1, q2 ; Is the value before the value sought? 48340 000072'02 254 00 0 00 000076' anskp. ; No, so can't use (would be a negative offset) 48341 000073'02 332 02 0 00 000005 skipe t2, q1 ; Otherwise get the best one so far (if there is one) 48342 000074'02 311 01 0 02 777777 caml t1, -1(t2) ; compare to previous best 48343 000075'02 200 05 0 00 000004 move q1, t4 ; current symbol is best match so far 48344 000076'02 endif. ; End case symbol selection 48345 000076'02 270 04 0 00 000141' add t4, [2000000-2] ; Add 2 in the left, sub 2 in the right 48346 000077'02 321 04 0 00 000060' jumpl t4,top. ; Loop unless control count is exhausted 48347 000100'02 enddo. 48348 48349 000100'02 322 05 0 00 000120' ifn. q1 ; Did we have anything that could help? 48350 000101'02 200 02 0 00 000006 move t2, q2 ; Yes, get desired value 48351 000102'02 274 02 0 05 777777 sub t2, -1(q1) ; Less symbol's value = offset 48352 000103'02 301 02 0 00 000200 cail t2, 200 ; Is the offset small enough to be conceptually useful? 48353 000104'02 254 00 0 00 000120' anskp. ; No, we can't count that high in our head 48354 000105'02 200 01 0 05 777776 move t1, -2(q1) ; Load RADIX50 symbol name k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 86-1 K20SUB MAC 20-Aug-24 02:18 Magical symbol table lookup routine 48355 000106'02 621 01 0 00 740000 txz t1, ; Clear the symbols' flags 48356 000107'02 do. ; Build us a return address 48357 000107'02 254 14 0 00 000007 xsfm q3 ; Save processor flags 48358 000110'02 415 10 0 00 000114' xmovei q4,endlp. ; Load end of this pseudo-loop (return address) 48359 000111'02 254 05 0 00 000112' xjrstf .+1 ; Go 'downstairs' to use the stack 48360 000112'02 010000 000000 pc%usr ; Don't try to break out of user mode 48361 000113'02 000000 000000# 0,,sqztyo ; 'long jump' to section zero to print symbol name 48362 000114'02 enddo. ; End of this strange call linkage 48363 000114'02 274 06 0 05 777777 sub q2, -1(q1) ; Value we wanted less this symbol's value 48364 000115'02 322 06 0 00 000125' jumpe q2, plsof1 ; If no offset, don't print "+0" 48365 000116'02 201 01 0 00 000053 movei t1, "+" ; Append a plus sign to the output line 48366 000117'02 104 00 0 00 000074 pbout% 48367 000120'02 endif. 48368 48369 000120'02 201 01 0 00 000101 plsoff: movei t1, .priou ; and copy numeric offset to output 48370 000121'02 200 02 0 00 000006 move t2, Q2 ; Load offset from symbol 48371 000122'02 201 03 0 00 000010 movei t3, ^d8 ; Addresses are in octal... 48372 000123'02 104 00 0 00 000224 NOUT% 48373 000124'02 320 12 0 00 000125' erjmpr plsof1 ; Catch and ignore error 48374 000125'02 254 05 0 00 000126' plsof1: xjrstf .+1 ; And go 'downstairs' to return to caller 48375 000126'02 010000 000000 pc%usr ; Don't try to break out of user mode 48376 000127'02 000000000000# r ; Give +1 return 48377 48378 .endps ecode ; Done with non-zero section execution 48379 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 87 K20SUB MAC 20-Aug-24 02:18 recursively convert a 32-bit quantity in T1 from squoze to ASCII 48380 subttl recursively convert a 32-bit quantity in T1 from squoze to ASCII 48381 48382 .psect code ; Needs to be in section zero to use the stack 48383 48384 remark Caution ; Called with inter-section hand crafted JSP-type linkage 48385 48386 ; Call: 48387 ; 48388 ; t1/ SQUOZE word 48389 ; q3/ Processor flags to restore 48390 ; q4/ 30 bit return address 48391 48392 004076'01 261 17 0 00 004111' sqztyo: push p,sqztyr ; Push inter-section return address 48393 004077'01 265 16 0 00 004541' saveac ; Save t2, just in case 48394 48395 004100'01 231 01 0 00 000050 sqzty1: idivi t1, 50 ; divide by 50 to extract a Radix-50 'digit' 48396 004101'01 261 17 0 00 000002 push p, t2 ; save remainder, a Radix-50 character 48397 004102'01 332 00 0 00 000001 skipe t1 ; if T1 is now zero, unwind the stack 48398 004103'01 260 17 0 00 004100' call sqzty1 ; call self again, reducing t1 by an another 'digit' 48399 48400 remark ; If we fall through, then it's type to unwind 48401 004104'01 262 17 0 00 000001 pop p, t1 ; Get characters back in reverse order 48402 004105'01 133 01 0 00 004113' adjbp t1, rdx50c ; Index to the correct character 48403 004106'01 135 01 0 00 000001 ldb t1, t1 ; convert squoze code to ASCII 48404 004107'01 104 00 0 00 000074 pbout% ; Type it 48405 004110'01 263 17 0 00 000000 ret ; Continue unwinding, finally 'returning' below 48406 48407 004111'01 254 00 0 00 004112' sqztyr: jrst .+1 ; This pushed jrst goes to the xjrstf 48408 004112'01 254 05 0 00 000007 xjrstf q3 ; Transfer back to non-section zero caller 48409 48410 004113'01 35 07 0 00 004114' rdx50c: point 7,.+1,6 ; Points to the first character in the string (the space) 48411 004114'01 040 060 061 062 063 ascii " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.$%" 48412 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 88 K20SUB MAC 20-Aug-24 02:18 fetch a word from extended address space 48413 subttl fetch a word from extended address space 48414 48415 ;[223] Begin code insertion 48416 48417 ; Call: 48418 ; 48419 ; t1/ Extended address to fetch 48420 ; 48421 ; Return: 48422 ; 48423 ; t1/ Updated in all cases 48424 ; 48425 ; +1/ Possible error code 48426 ; +2/ Value at specified location 48427 48428 repeat 0,< ; Actually turned out to be unnecessary ... 48429 fetch: saveac ; Save a scratch register 48430 xjrstf .+1 ; Go 'upstairs' to grab the value 48431 pc%usr ; Don't try to break out of user mode 48432 extsec,,efetch ; 'long jump' to extended mode operation 48433 48434 .endps code ; Get out of section zero 48435 .psect ecode ; and into non-zero section 48436 48437 efetch: move t2, @t1 ; Grab whatever we've been pointed at 48438 erjmpr fetche ; Unless it was gubbish 48439 48440 move t1, t2 ; Return value in t1 48441 xjrstf .+1 ; Go 'downstairs' to return to caller 48442 pc%usr ; Don't try to break out of user mode 48443 rskp ; Give +2 return 48444 48445 fetche: remark ; Here on addressing error from move 48446 xjrstf .+1 ; Go 'downstairs' to return to caller 48447 pc%usr ; Don't try to break out of user mode 48448 r ; Give +1 return 48449 48450 .endps ecode ; Get out of extended code 48451 .psect code ; And back into section zero code 48452 >;repeat 0 ; End removal 48453 48454 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 89 K20SUB MAC 20-Aug-24 02:18 Kermit Entry Vector and Version 48455 subttl Kermit Entry Vector and Version 48456 48457 ;[197] Moved here to support symbol table fix up, yet some still in k20mit 48458 48459 ; Used to help LINK build version word 48460 48461 extern $verno ; Major version number. 48462 extern $mnver ; Minor version number (minimum: 1). 48463 extern $edno ; Edit number increases independent of version. 48464 extern $who ; Who edited, 0=Columbia. 48465 48466 ; Used to help LINK to build entry vector 48467 48468 extern start ; Regular entry 48469 extern reen ; 'Re-enter' address 48470 48471 ; 'Modern' Tops-20 entry vector 48472 48473 004124'01 254 00 0 00 000000* kermit: jrst start ; Start entry. 48474 004125'01 254 00 0 00 000000* jrst reen ; Re-entry. 48475 k20ver==:FLD($who,VI%WHO)!FLD($verno,VI%MAJ)!FLD($mnver,VI%MIN)!^_ 48476 000000000000# FLD($edno,VI%EDN)!VI%DEC ;;[184] Want decimal version numbers 48477 004126'01 000000000000# k20ver ;[190] 48478 000003 evlen==.-kermit ; Mark for k20mit end statement 48479 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 90 K20SUB MAC 20-Aug-24 02:18 Closing Code particulars 48480 subttl Closing Code particulars 48481 48482 xlist ; Save the trees!! 48483 list ; Resume listing 48484 48485 .endps code ; Close the code .psect 48486 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 91 K20SUB MAC 20-Aug-24 02:18 Data storage, not in global scope 48487 subttl Data storage, not in global scope 48488 48489 .psect data ; Writable 48490 repeat 0,< ;[218] 48491 tmcbit: 0 ;[194] Time channel bit 48492 > ;[218] 48493 000105'05 000000 000000 ccichr: 0 ;[219] Control-C Interrupt Character (we used) 48494 48495 000106'05 000000 000000 aicx: 0 ;[194] Count of AIC% failures 48496 000107'05 000000 601405 laicer: lstrx1 ;[194] Last AIC% error (no error) 48497 000110'05 000000 601405 ltimcr: lstrx1 ;[194] Last TIMER% creation (.timel) error 48498 000111'05 000000 000000 dicx: 0 ;[194] Count of DIC% errors 48499 000112'05 000000 601405 ldicer: lstrx1 ;[194] Last DIC% error (no error) 48500 000113'05 000000 601405 ltimde: lstrx1 ;[194] Last .TIMBF (delete) error 48501 48502 000114'05 000000 000000 glbsym: 0 ;[197] If global (should never be) 48503 000115'05 000000 000000 symvec: 0 ;[197] Address of symbol table vector 48504 000116'05 000000 000000 kjbsym: 0 ;[197] Kermit's defined symbol table 48505 48506 repeat 0,< ;[197] Only used for linked debugging 48507 ddtf:: 0 ;[197] Debugger present flag 48508 >;repeat 0 ;[197] 48509 000117'05 lcltte: block 10 ; Last errors encounter by LCLTTY 48510 000127'05 lcltef: remark ; Final location to whack 48511 000127'05 lcldev: block 1 ; Device we're going to try 48512 000130'05 lclnam: block 4 ; Space for constructed terminal 48513 000134'05 lcljfn: block 1 ; JFN we got 48514 000135'05 lclflg: block 1 ; Associated flags (which we don't use) 48515 000136'05 lclpar::block 1 ;[223] Local terminal parity 'toleration' 48516 48517 000137'05 000000 000000 ccn: 0 ;[187] Number of ^C's typed. 48518 000140'05 000000 000000 psave: 0 ; Stack pointer for ^C interrupt. 48519 000141'05 000000 000000 psave2: 0 ; Stack top for ^C interrupt. 48520 000142'05 000000 000000 tsave: 0 ;[132] Same as above, but for timer interrupts. 48521 000143'05 000000 000000 tsave2: 0 ;[132] ... 48522 000144'05 000000 000000 pc1: 0 ;[196] Interrupt PC storage, levels 1, 48523 000145'05 000000 000000 pc2: 0 ; 2, 48524 000146'05 000000 000000 pc3:: 0 ; and 3. 48525 48526 000147'05 605457 664562 'plover' ; Talsiman to see if stomped 48527 .endps data 48528 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 92 K20SUB MAC 20-Aug-24 02:18 Misc. utility .PSECT's 48529 subttl Misc. utility .PSECT's 48530 48531 remark File Mapping Page 48532 .psect filepg,maporg ; File mapping window 48533 000000'07 block maplen ; Reserves a page 48534 .endps ; Allows LINK time checking 48535 48536 remark Guard pages for files and macros 48537 48538 .psect guard/ronly,grdorg ; Declare detonate-on-use page 48539 .endps ; Nothing in it until runtime 48540 48541 .psect guard1/ronly,macgp1 48542 000000'11 007071 727271 'xyzzy' ; Force a magic page... 48543 000001'11 block ^d511 ; Keep LINK up to date on size 48544 .endps guard1 48545 48546 .psect guard2/ronly,macgp2 48547 000000'12 006054 654750 'plugh' ; Force another magic page... 48548 000001'12 block ^d511 ; Keep LINK up to date on size 48549 .endps guard2 48550 48551 .psect guard3/ronly,macgp3 48552 000000'13 605457 664562 'plover' ; Force another magic page... 48553 000001'13 block ^d511 ; Keep LINK up to date on size 48554 .endps guard3 48555 48556 .psect guard4/ronly,macgp4 48557 000000'14 005465 555763 'lumos' ; Force another magic page... 48558 000001'14 block ^d511 ; Keep LINK up to date on size 48559 .endps guard4 48560 48561 emacro < 48562 .psect guard5/ronly,macgp5 48563 'nox' ; Force another magic page... 48564 block ^d511 ; Keep LINK up to date on size 48565 .endps guard5 48566 >;;emacro 48567 48568 remark Symbol table .PSECT 48569 .text "/symseg:psect:symbol" ; Tell LINK where to put the goodies 48570 .psect symbol/ronly,symorg ; Write-Protected symbols 48571 .endps symbol ; Close out the PSECT 48572 48573 remark Seperate patch area .PSECT, otherwise it will be read-only 48574 .text "/patchsize:0" ; Tell LINK not to allocate a patch area 48575 .psect patch,patorg ; Patch area 48576 000000'16 PAT..:: block patlen ; Override LINK 48577 .endps patch ; Close out the PSECT 48578 48579 remark Reserve pages for in-section DDT so code doesn't bump into it 48580 .psect ddt/ronly,700000 ; If DDT is in section 0 48581 000000'17 block 777777-700000+1 ; Reserve last 64 pages 48582 .endps ddt 48583 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 93 K20SUB MAC 20-Aug-24 02:18 PDV setup and location 48584 subttl PDV setup and location 48585 48586 ; This is the Program Data Vector .PSECT. We don't write anything 48587 ; directly in there; we pass switchs to have LINK fill it in for us 48588 48589 .text "/pvblock:psect:pdv" ; Put program PDV's in the PDV .PSECT 48590 .psect pdv/ronly,pdvorg ; Write-Protected PDV! 48591 .endps pdv ; Close out the PSECT 48592 48593 ; Macro to resolve symbols into values for stupid LINK. 48594 ; Note, this must be last or the macro will produce X errors 48595 ; because the symbols haven't been seen yet. Maybe see 48596 ; what IF2 would do if we want to move this around. 48597 48598 define defpdv (name,data) < 48599 .text "/pvdata:'name':#'data" 48600 >;define defpdv 48601 48602 ; Note, although the monitor knows about the reenter address 48603 ; (the PDV offset is .PVREE), LINK doesn't. Sigh... 48604 48605 .text '/pvdata:name:"K20MIT"' ;;Different from save name 48606 defpdv start,\kermit ; Kermit start address 48607 ; defpdv reentr,\reen ; Kermit reenter address (obsolete) 48608 ; remark ; Have to set this in LINK 48609 ; defpdv version,\k20ver ; Kermit version word 48610 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 94 K20SUB MAC 20-Aug-24 02:18 'Low segment' fix ups 48611 SUBTTL 'Low segment' fix ups 48612 48613 ;[227] Begin code insertion 48614 48615 ;[T255] Build page zero by hand since EXEC can now handle a symbol 48616 ; table in a non-zero section, but LINK doesn't quite set everything 48617 ; up correctly. 48618 ; 48619 ; A multi-section program can get complicated enough so that LINK 48620 ; can't fill in values in the 'low segment' with the 'appropriate' 48621 ; values. The problem is certain programs which don't use PDV's to 48622 ; find this stuff out, the first being an enhanced GLXLIB and the 48623 ; other being the EXEC, which may not be able to tell which PDV to 48624 ; use. 48625 ; 48626 ; Therefore, we issue the /NOINITIAL /NOJOBDAT switches *first* to 48627 ; keep LINK from getting it wrong and poke the values in ourselves, 48628 ; here. See JOBDAT for additional information. 48629 48630 033000 kjbffl== ; Kermit's first free location is after the patch area 48631 48632 ; N.B., This LOC/RELOC Hackery *MUST* take place in the outer-most .PSECT!!!! 48633 48634 000116 loc .jbsym ; Get to symbol table pointer 48635 000116 000001 400000 symorg ; The EXEC can now handle a symbol table vector!! 48636 000120 loc .jbsa ; Get to job start address 48637 000120 033000 000000# xwd kjbffl,kermit ; Note, odd left half 48638 000121 loc .jbff ; Get to first free location 48639 000121 000000 033000 kjbffl ; End defined writable storage 48640 000124 loc .jbren ; The Reenter address 48641 000124 000000000000# reen ; This is all in Kermit's entry vector, actually... 48642 000137 loc .jbver ; Get to the version word 48643 000137 000000000000# k20ver ; Drop Kermit's version in 48644 48645 000000'00 reloc ; Get back ... someplace ... 48646 48647 ;[227] End code insertion 48648 48649 000003 004124' end evlen,,kermit ;[197] Had to get moved here, sigh... NO ERRORS DETECTED PROGRAM BREAK IS 000000 PSECT 1 BREAK IS 004552 FOR CODE PSECT 2 BREAK IS 000142 FOR ECODE PSECT 3 BREAK IS 002057 FOR CONST PSECT 4 BREAK IS 000472 FOR ETEXT PSECT 5 BREAK IS 000150 FOR DATA PSECT 6 BREAK IS 001000 FOR DATEND PSECT 7 BREAK IS 001000 FOR FILEPG PSECT 10 BREAK IS 000000 FOR GUARD PSECT 11 BREAK IS 001000 FOR GUARD1 PSECT 12 BREAK IS 001000 FOR GUARD2 PSECT 13 BREAK IS 001000 FOR GUARD3 PSECT 14 BREAK IS 001000 FOR GUARD4 k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page 94-1 K20SUB MAC 20-Aug-24 02:18 'Low segment' fix ups PSECT 15 BREAK IS 000000 FOR SYMBOL PSECT 16 BREAK IS 002000 FOR PATCH PSECT 17 BREAK IS 100000 FOR DDT PSECT 20 BREAK IS 000000 FOR PDV CPU TIME USED 00:01.974 127P CORE USED k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-1 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE AIC 104000 000131 int GJ%SHT 000001 000000 sin P 000017 SC%CTC 400000 000000 sin AIC% 104000 000131 int GPJFN% 104000 000206 int P1 000011 spd SC%DNA 001000 sin ALLFLD 000000 ext GRDORG 033000 spd P2 000012 spd SC%GTB 200000 000000 sin ATI 104000 000137 int GRDPAG 000033 spd P3 000013 spd SC%OPR 200000 sin ATI% 104000 000137 int GS%ERR 000400 000000 sin P4 000014 spd SC%WHL 400000 sin ATMBUF 000000 ext GS%NAM 000200 000000 sin P5 000015 spd SCHR 000013 spd BADMSK 113777 176377 spd GS%OPN 400000 000000 sin PA%PEX 010000 000000 sin SCRLFT 000000 ext BOUT 104000 000051 int GS%RND 020000 000000 sin PA%PRV 000200 000000 sin SFCOC 104000 000113 int BOUT% 104000 000051 int GS%WRF 100000 000000 sin PANDAS 000001 sin SFCOC% 104000 000113 int CALL 260740 000000 GTJFN% 104000 000020 int PARS1 000000 ext SFMOD 104000 000110 int CALLRE 254000 000000 spd GTSTS% 104000 000024 int PARS2 000000 ext SFMOD% 104000 000110 int CF%NUD 400000 000000 sin GUARD 000000 ext PARS3 000000 ext SFPTR% 104000 000027 int CHFDB% 104000 000064 int GUARD1 000000 ext PARS4 000000 ext SIR% 104000 000125 int CJFNBK 000000 ext GUARD2 000000 ext PARS5 000000 ext SIZEF% 104000 000036 int CLOSF% 104000 000022 int GUARD3 000000 ext PATCH 000000 ext SOUT% 104000 000053 int CLSX1 600160 int GUARD4 000000 ext PATLEN 002000 spd SPACK 000000 ext CO%NRJ 400000 000000 sin HALTF% 104000 000170 int PATORG 031000 spd SPSIZ 000000 ext CODE 000000 ext IAC 000377 spd PBOUT 104000 000074 int ST%LEN 007777 777777 spd CONST 000000 ext JFNS% 104000 000030 int PBOUT% 104000 000074 int ST%TYP 770000 000000 spd CRLF 000000 ext JOBTAB 000000 ext PC%USR 010000 000000 sin STIW 104000 000174 int CX 000016 KJBFFL 033000 spd PDV 000000 ext STIW% 104000 000174 int CZ%ABT 004000 000000 sin KLFLGS 777700 000000 spd PDVORG 572000 spd STPAR 104000 000217 int CZSEEN 000000 ext LSTRX1 601405 int PGSHFT 000011 sin STPAR% 104000 000217 int DATA 000000 ext M 100000 000000 spd PKTNUM 000000 ext STRBUF 000000 ext DATEND 000000 ext MACGP1 006000 spd PM%EPN 000200 000000 sin SUBBP 000000 ext DDT 000000 ext MACGP2 010000 spd PM%RD 100000 000000 sin SYMBOL 000000 ext DEBRK 104000 000136 int MACGP3 020000 spd PM%WR 040000 000000 sin SYMORG 000001 400000 spd DEBRK% 104000 000136 int MACGP4 030000 spd PMAP% 104000 000056 int T1 000001 spd DESX1 600150 int MAPLEN 001000 spd PSOUT 104000 000076 int T2 000002 spd DESX3 600152 int MAPORG 007000 spd PSOUT% 104000 000076 int T3 000003 spd DEVST% 104000 000121 int MAPPAG 000007 spd Q1 000005 spd T4 000004 spd DIC 104000 000133 int MAXBUF 024000 spd Q2 000006 spd T5 000005 spd DIC% 104000 000133 int MAXPKT 000140 spd Q3 000007 spd TIMER 104000 000522 int DTI 104000 000140 int MO%CDN 777000 000000 sin Q4 000010 spd TIMER% 104000 000522 int DTI% 104000 000140 int MO%DAV 777000 sin Q5 000011 spd TLGJFN 000000 ext DV%TYP 000777 000000 sin MO%INA 000777 000000 sin R 000000 ext TRMCOD 500000 spd DVCHR% 104000 000117 int MO%PAR 000010 sin RCHR 000012 spd TS%CTC 001000 000000 spd ECODE 000000 ext MOVSLJ 016000 000000 REEN 000000 ext TS%CTM 200000 000000 spd EIR% 104000 000126 int MOVST 015000 000000 RET 263740 000000 TS%DEV 010000 000000 spd EOSCOD 100000 spd MTOPR% 104000 000077 int RF%LNG 400000 000000 sin TS%EFH 002000 000000 spd EPCAP% 104000 000151 int N 200000 000000 spd RFCOC 104000 000112 int TS%ERR 400000 000000 spd ERJMPR 320500 000000 int NDXJFN 000000 ext RFCOC% 104000 000112 int TS%FRK 040000 000000 spd ERJMPS 320600 000000 int NOP 600000 000000 sin RFMOD% 104000 000107 int TS%JFN 020000 000000 spd ERRPTR 000000 ext NOUT 104000 000224 int RFSTS% 104000 000156 int TS%LGL 000200 000000 spd ERSTR% 104000 000011 int NOUT% 104000 000224 int RLJFN 104000 000023 int TS%LGW 000400 000000 spd ESOUT% 104000 000313 int NUL4 000000 ext RLJFN% 104000 000023 int TS%PRO 100000 000000 spd ETEXT 000000 ext NXTJFN 000000 ext RMAP% 104000 000061 int TT%DAM 000300 sin EXTSEC 000001 spd ODTIM% 104000 000220 int RPACS% 104000 000057 int TT%DUM 000014 sin FB%BSZ 007700 000000 sin OF%BSZ 770000 000000 sin RPCAP% 104000 000150 int TT%ECO 004000 sin FFFFP% 104000 000031 int OF%MOD 007400 000000 sin RSKP 000000 ext TT%LCA 040000 000000 sin FH%EPN 200000 sin OF%RD 200000 sin RT%DIM 400000 000000 sin TT%LEN 037600 000000 sin FILEPG 000000 ext OF%WR 100000 sin RTIW 104000 000173 int TT%LIC 000020 sin FILJFN 000000 ext OPENF% 104000 000021 int RTIW% 104000 000173 int TT%MFF 200000 000000 sin GD%PAR 000001 sin OPNX1 600120 int S 400000 000000 spd TT%OSP 400000 000000 sin GJ%FLG 000020 000000 sin OT%NDA 400000 000000 sin SBK 000000 ext TT%PGM 000002 sin k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-2 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE TT%TAB 100000 000000 sin .CHTAB 000011 sin .TICCY 000031 sin TT%UOC 000040 sin .CMIOJ 000001 sin .TICCZ 000032 sin TT%WID 000177 000000 sin .CTTRM 777777 sin .TIMAL 000005 sin TT%WKA 010000 sin .DVDES 600000 sin .TIMEL 000001 sin TT%WKF 100000 sin .DVNUL 000015 sin .TTDES 400000 sin TT%WKN 040000 sin .DVTTY 000012 sin .XSTKS 000000 ext TT%WKP 020000 sin .FBBYV 000011 sin TTYJFN 000000 ext .FBSIZ 000012 sin UDJINF 000000 ext .FHJOB 777773 sin VI%DEC 400000 sin .FHSLF 400000 sin VI%EDN 377777 sin .FP 000015 spd VI%MAJ 077700 000000 sin .FPAC 000005 spd VI%MIN 000077 000000 sin .GSIMG 000010 sin VI%WHO 700000 000000 sin .JIBAT 000011 sin XHLLI 501000 000000 int .JITNO 000001 sin XJRSTF 254240 000000 int .MOCIA 000776 sin XMOVEI 415000 000000 int .MOOFF 000000 sin XSFM 254600 000000 int .MOPCR 000053 sin $CTCOC 000011 .MOPCS 000052 sin $CTMOD 000014 .MORBM 000037 sin $DVCHR 000005 .MORLL 000032 sin $GPJFN 000003 .MORLT 400001 sin $MOPCR 000026 .MORLW 000030 sin $MORBM 000034 .MORNT 000035 sin $MORLL 000020 .MORTF 000054 sin $MORLT 000032 .MORXO 000044 sin $MORLW 000016 .MOSBM 000040 sin $MORNT 000022 .MOSLL 000033 sin $MORTF 000030 .MOSLT 400002 sin $MORXO 000024 .MOSLW 000031 sin $PRIOU 000000 ext .MOSNT 000034 sin $TIF 000042 .MOSTF 000055 sin $TIW 000043 .MOXOF 000043 sin $TSARG 000001 .NULIO 377777 sin $TSERR 000002 .PRIIN 000100 sin $TSFLG 000000 .PRIOU 000101 sin %%KRBF 000000 ext .PX7 610001 000000 spd ..MSK 777777 777777 spd .R50D 000001 spd .A16 000016 spd .RFCNT 000000 sin .AC1 000001 spd .RFSFL 000004 sin .CHBEL 000007 sin .SAC 000016 .CHBSP 000010 sin .SAV1 000000 ext .CHCNA 000001 sin .SAV2 000000 ext .CHCNB 000002 sin .SAV3 000000 ext .CHCNC 000003 sin .SIGIO 677777 sin .CHCNP 000020 sin .STDAT 000000 spd .CHCNX 000030 sin .STSIZ 000003 spd .CHCNY 000031 sin .TICCA 000001 sin .CHCNZ 000032 sin .TICCC 000003 sin .CHCRT 000015 sin .TICCG 000007 sin .CHDAS 000055 sin .TICCM 000015 sin .CHDEL 000177 sin .TICCO 000017 sin .CHLFD 000012 sin .TICCP 000020 sin .CHNUL 000000 sin .TICCT 000024 sin .CHSPC 000040 sin .TICCX 000030 sin k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-3 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT CODE ABTFIL 001724' ext CYTRAP 003271' KERMIT 004124' S8CCV7 003315' ent ADJTIM 002305' ext CZCHAN 000004 KRXBLT 000030' SAVLNW 002147' ent ALLFLD 000256' ext CZSEEN 003234' ext KRXPTR 000032' SAVTTY 000744' ent ALLTIM 002263' CZTRAP 003234' KSERR0 000176' SBK 000000 ext ARGTYP 000613' D2SGPC 003704' KSMSG0 000200' SCHCRT 003440' ASCZCP 003517' ent DELAY 001720' ext LCLERR 001474' SCHLFD 003475' BCTONE 000165' ext DELAYF 001716' ext LCLTTY 001355' SCRLFT 000264' ext BCTU 003066' ext DIRCH 003224' ext LDAV 002303' ext SETCSB 000543' ent BIGBOY 000575' ext DNCFLD 032776 776000 sin LEVTAB 002214' SETGRD 003743' ent BLANKL 000030 spd DNCHAN 000032 LFDEXP 003470' SETTY 001315' ent BLANKS 000000' DNCHB 001000 sin LFDPTR 003471' SOURCE 003223' ext BOUTI% 000376' ent DNDFLD 776776 776000 sin LOCAL 002645' ext SPACK 000143' ext BYTSIZ 003021' ext DNTRAP 002251' ext MODOFF 001546' SPSIZ 000170' ext C87MOV 003313' EBQFLG 003050' ext MODON 001547' SPTOT 003141' ext CACHAN 000002 EBTFLG 003034' ext MOVASC 003515' int SQZTY1 004100' CAPAS 002544' ext ERRPTR 001527' ext MOVCRT 003436' SQZTYO 004076' CASEEN 002644' ext EVEN 001510' ext MOVLFD 003473' SQZTYR 004111' CATRAP 002764' EVLEN 000003 spd MOVSTU 003541' ent SRVFLG 002522' ext CATRP1 003123' FEPAGE 003765' MOVSUC 003602' ent START 004124' ext CAXZOF 002642' ent FILES 003127' ext MTOPRL 000006 spd STCHR 003160' ext CAXZON 002573' ent FILJFN 003074' ext MTOPRT 001203' STIMOU 002362' ext CCCHAN 000001 FIXTTY 001522' ent MTOPSL 000006 spd SUBBP 000077' ext CCFAIL 002466' ext FLOW 001574' ext MTOPST 001212' SVSTT 001556' ext CCOFF 002522' ent FNDPAG 003771' MXASCZ 024000 sin SYMOUT 004067' ent CCOFF2 002524' ent FNDVEC 004056' ent MYCAPS 002462' ext TBTFLG 002004' ext CCOFF3 002544' FRCLO1 001700' MYTTY 001414' ext TIMCHB 400000 000000 sin CCON 002430' ent FRCLOS 001640' ent NNAK 003175' ext TIMDEL 002364' ent CCON2 002473' FRCLOT 001716' NONE 003730' ext TIMEIT 002265' ent CCTRAP 002747' FRKCHB 004000 sin NOTNUL 000541' TIMEON 002326' ent CHNGCH 003360' FRKCHN 000030 int NTIMOU 003205' ext TIMERX 002400' ext CHNTAB 002217' FRTRAP 002247' ext NUL4 003006' ext TIMOFF 002362' ent CMCHAN 000005 GDSWRP 001477' OVERHD 000161' TIWORD 001624' ext CMLOC 003253' ext GETLCL 001413' PAGCNT 003117' ext TLGJFN 002051' ext CMPOFF 002672' ent GIVEUP 001724' ent PAGNO 003103' ext TMCHAN 000000 CMPON 002611' ent GNDPAR 001501' ext PARITY 003726' ext TMTRAP 002402' ent CMPTR2 003264' GP%1AD 007777 777777 spd PARPKO 001517' ext TRNCHR 000454 spd CMSEEN 003245' ext GP%1PF 770000 000000 spd PARRCK 001520' ext TTYINI 001550' ent CMTRAP 003245' GP%2AD 377777 777777 spd PINIT 002412' ent TTYJFN 001550' ext CNCHAR 003362' GP%2PB 770000 000000 spd PKTNUM 000137' ext TTYOB 000676' ent CPCHAN 000027 GP%2PF 777700 000000 spd R 003771' ext TTYOU 000723' ent CPLOC 003263' ext GP%2RS 000037 777777 spd RCVING 003156' ext UDJINF 001315' ext CPSEEN 003255' ext GP%2SB 007700 000000 spd RDCLOS 001773' ent UNMAPA 002135' CPTRAP 003255' GP%2WB 000040 000000 spd RDCLSA 002020' UNMAPO 002105' ent CRCCLC 003723' ent HALT 001555' ext RDCLSC 002050' YESNUL 000536' CRLF 003417' ext HANDSH 001573' ext RDCLSD 002071' $CCN 000002 spd CRTEXP 003430' IACIAC 003644' ent RDCLSV 002000' $CLRBS 003276' ext CRTPTL 003434' INICAP 000553' ent RDCLSZ 002103' $EDNO 000000 ext CRTPTR 003432' INTPC 002403' ext RDX50C 004113' $MNVER 000000 ext CURTIM 002306' ext INTSTK 002407' ext REEN 004125' ext $MODOF 037777 174374 spd CXCHAN 000003 ISNULJ 000415' ent RESTTY 001221' ent $MODON 340000 000002 spd CXSEEN 003220' ext ITSFIL 003043' ext RPTFLG 003055' ext $PRIOU 001344' ext CXTRAP 003220' JOBTAB 000000 ext RPTOT 003147' ext $VERNO 000000 ext CYCHAN 000031 K20HDR 000273' int RSKP 004053' ext $WAITJ 003300' ext CYOFF 002715' ent K20PTR 000033' RSTLNW 002171' ent $WHO 000000 ext CYON 002622' ent K20VER 000000000000# pol RTCHR 003163' ext %%JSER 000276' ent k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-4 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT CODE %%KRBF 000032' ext ..0347 001001' spd ..0760 001516' spd ..1576 003163' spd %%KRMS 000035' ent ..0355 000775' spd ..0761 001512' spd ..1603 003165' spd %%SMS1 000363' ..0356 000776' spd ..0766 001513' spd ..1623 003303' spd %%SMSG 000330' ent ..0357 001006' spd ..0767 001531' spd ..1630 003307' spd %KERMS 000134' ent ..0364 001007' spd ..1000 001535' spd ..1640 003321' spd %WTLGF 000212' ..0372 001017' spd ..1005 001536' spd ..1653 003325' spd %WTLOG 000207' ent ..0373 001020' spd ..1013 001571' spd ..1654 003353' spd ..0002 000131' spd ..0400 001033' spd ..1040 001663' spd ..1664 003345' spd ..0010 000047' spd ..0407 001044' spd ..1053 001674' spd ..1673 003424' spd ..0011 000052' spd ..0410 001045' spd ..1054 001676' spd ..1703 003452' spd ..0016 000065' spd ..0416 001056' spd ..1061 001711' spd ..1710 003453' spd ..0025 000054' spd ..0417 001060' spd ..1070 001707' spd ..1715 003450' spd ..0026 000060' spd ..0425 001062' spd ..1071 001711' spd ..1716 003451' spd ..0027 000102' spd ..0426 001100' spd ..1072 001723' spd ..1725 003561' spd ..0034 000103' spd ..0434 001073' spd ..1100 001742' spd ..1733 003622' spd ..0035 000127' spd ..0435 001074' spd ..1110 001737' spd ..1745 003651' spd ..0043 000155' spd ..0443 001117' spd ..1122 001753' spd ..1746 003654' spd ..0051 000175' spd ..0444 001120' spd ..1132 001771' spd ..1754 003662' spd ..0057 000244' spd ..0445 001126' spd ..1145 001771' spd ..1755 003677' spd ..0071 000264' spd ..0453 001134' spd ..1153 002017' spd ..1756 003673' spd ..0077 000256' spd ..0461 001141' spd ..1154 002020' spd ..1771 003710' spd ..0100 000261' spd ..0466 001142' spd ..1172 002077' spd ..1772 003713' spd ..0102 000327' spd ..0467 001147' spd ..1202 002115' spd ..2000 003727' spd ..0107 000314' spd ..0474 001150' spd ..1204 002120' spd ..2001 003742' spd ..0110 000315' spd ..0501 001155' spd ..1225 002302' spd ..2007 003754' spd ..0115 000340' spd ..0507 001163' spd ..1234 002317' spd ..2010 003765' spd ..0123 000350' spd ..0510 001164' spd ..1235 002325' spd ..2016 003771' spd ..0131 000403' spd ..0516 001173' spd ..1243 002325' spd ..2017 004023' spd ..0132 000414' spd ..0517 001174' spd ..1252 002342' spd ..2025 004055' spd ..0137 000422' spd ..0520 001241' spd ..1261 002353' spd ..2026 004056' spd ..0140 000424' spd ..0533 001241' spd ..1262 002361' spd ..CSC 000004 spd ..0146 000446' spd ..0535 001256' spd ..1270 002361' spd ..CSN 000003 spd ..0147 000447' spd ..0550 001251' spd ..1277 002373' spd ..IFT 200000 000001 spd ..0155 000455' spd ..0557 001256' spd ..1306 002401' spd ..JX1 200000 000000 spd ..0156 000456' spd ..0566 001257' spd ..1316 002434' spd ..MX1 000031 spd ..0160 000465' spd ..0567 001272' spd ..1331 002443' spd ..MX2 000001 spd ..0165 000474' spd ..0570 001271' spd ..1333 002452' spd ..PST 000003 spd ..0173 000507' spd ..0603 001271' spd ..1341 002464' spd .JBFF 000121 spd ..0175 000531' spd ..0605 001303' spd ..1354 002464' spd .JBREN 000124 spd ..0210 000520' spd ..0620 001303' spd ..1356 002473' spd .JBSA 000120 spd ..0217 000530' spd ..0622 001313' spd ..1405 002562' spd .JBSYM 000116 spd ..0221 000536' spd ..0635 001313' spd ..1412 002564' spd .JBVER 000137 spd ..0227 000577' spd ..0645 001343' spd ..1445 002777' spd .XSTKS 000632' ext ..0242 000607' spd ..0652 001344' spd ..1452 003001' spd ..0250 000617' spd ..0662 001372' spd ..1465 003015' spd ..0256 000623' spd ..0664 001412' spd ..1473 003012' spd ..0264 000632' spd ..0677 001411' spd ..1474 003015' spd ..0272 000651' spd ..0706 001411' spd ..1477 003041' spd ..0301 000660' spd ..0715 001431' spd ..1510 003050' spd ..0302 000664' spd ..0716 001434' spd ..1520 003055' spd ..0303 000664' spd ..0724 001451' spd ..1530 003062' spd ..0316 000673' spd ..0733 001451' spd ..1546 003123' spd ..0317 000675' spd ..0742 001471' spd ..1552 003123' spd ..0334 000763' spd ..0751 001470' spd ..1566 003146' spd ..0342 000777' spd ..0753 001514' spd ..1573 003153' spd k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-5 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT ECODE EXTMOV 000002' EXTSOU 000006' FNDVE1 000012' FNDVER 000050' MOVMSG 000000' PLSOF1 000125' PLSOFF 000120' R 000000 ext RSKP 000000 ext SYMOU1 000055' ..2033 000016' spd ..2035 000026' spd ..2050 000030' spd ..2051 000050' spd ..2056 000045' spd ..2065 000060' spd ..2066 000100' spd ..2067 000076' spd ..2101 000071' spd ..2103 000120' spd ..2116 000107' spd ..2117 000114' spd ..TX1 740000 000000 spd ..TX2 000001 spd k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-6 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT CONST ASZTAB 000445' BIGSOU 000001' ent CHRCSW 001551' CHRCUP 001553' CHRCUT 001351' CHRIAC 001755' CHRMUP 001147' CHRMUT 000745' CHRSHE 001145' CHRSHS 000545' CHRSWS 001151' CNRTAB 000044' CRCTAB 002011' CRCTB2 002031' CRSUBT 000244' GIANT 000000' GUARDP 002051' IACTAB 001555' OW2DW 001757' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-7 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT DATA AICX 000106' CCICHR 000105' CCN 000137' CYSEEN 000000' int DICX 000111' GLBSYM 000114' GRDADR 000102' GRDHAN 000103' GRDMAP 000104' int GRDPG2 000101' KJBSYM 000116' LAICER 000107' LCLDEV 000127' LCLFLG 000135' LCLJFN 000134' LCLNAM 000130' LCLPAR 000136' int LCLTEF 000127' LCLTTE 000117' LDICER 000112' LTIMCR 000110' LTIMDE 000113' MYCCOC 000076' PC1 000144' PC2 000145' PC3 000146' int PSAVE 000140' PSAVE2 000141' SYMVEC 000115' TRNBUF 000001' int TSAVE 000142' TSAVE2 000143' TTPAU 000100' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-8 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT DATEND DATGRD 000000' k20sub - Kermit-20 Semantic Action and Support Subroutines MACRO %53B(1254)-4 01:18 1-Sep-24 Page S-9 K20SUB MAC 20-Aug-24 02:18 SYMBOL TABLE FOR PSECT PATCH PAT.. 000000' int k20hlp - Kermit-20 Help Text MACRO %53B(1254)-4 01:18 1-Sep-24 Page 1 K20HLP MAC 31-Aug-24 21:25 Help Text. ;[18] Lengthy help messages added in edit [18]. 48650 title k20hlp - Kermit-20 Help Text 48651 subttl Help Text. ;[18] Lengthy help messages added in edit [18]. 48652 48653 search monsym,k20unv ; Wants parsing and Kermit .PSECT definitions 48654 cmdacs ^ ; Clean up p1-p4 definitions 48655 48656 sall ; Tidy listing 48657 .directive flblst ; We don't need to see all the ASCIZ bytes... 48658 k20hlp - Kermit-20 Help Text MACRO %53B(1254)-4 01:18 1-Sep-24 Page 2 K20HLP MAC 31-Aug-24 21:25 Notes and Cautions 48659 subttl Notes and Cautions 48660 48661 remark Virtual address space decisions 48662 48663 ; The vast majority of the help text (over 32 pages of ASCII data) has 48664 ; been moved out of section 0 into section 1. This is to free up some 48665 ; virtual address space in section 0. 48666 ; 48667 ; However, it also has the benefit of a smaller working set size as 48668 ; the help text is typically seldom referenced. This will make Kermit 48669 ; more likely to be selected to run and cause less impact to Tops-20. 48670 ; 48671 ; Perhaps more significant is the fact that such a layout uses less 48672 ; cache space. This will result in faster performance on both the 48673 ; MCA25 and other implementations with cache memories, including the 48674 ; cache on systems hosting simulators. 48675 48676 remark Virtual address space cautions 48677 48678 ; Be aware that the help semantic action routine ($help in k20par) 48679 ; uses an address calculation to determine whether the result of the 48680 ; parse is either a macro whose text needs displaying or a simple text 48681 ; to just type. 48682 ; 48683 ; This is almost a hack in a single section program where there can be 48684 ; no issue of in-section address aliasing. It can get you into real 48685 ; trouble if you are using multiple sections. Thus, care must be 48686 ; taken to ensure that the in-section addresses of the macro table and 48687 ; help text do NOT conflict. 48688 ; 48689 ; See the calculations for hlporg in k20unv.mac for further details. 48690 k20hlp - Kermit-20 Help Text MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3 K20HLP MAC 31-Aug-24 21:25 Table of help commands 48691 subttl Table of help commands 48692 48693 .psect code/ronly ; %key macros will put text in the text .psect 48694 48695 000000'02 000000 000000 %table(hlptab,G) ;[194] ;[18] 48696 000001'02 000000# 000000# %key2 <36-bit-bytes>,h36bb ;[232] 48697 000000'03 063 066 055 142 151 48698 000002'02 000000# 000000# %key2 ,hbye 48699 000003'03 142 171 145 000 000 48700 000003'02 000000# 000000# %key2 ,hcescp 48701 000004'03 103 055 145 163 143 48702 000004'02 000000# 000000# %key2 ,hcaptu ;[230] 48703 000010'03 143 141 160 164 165 48704 000005'02 000000# 000000# %key2 ,hcdup ;[254] 48705 000012'03 143 144 165 160 000 48706 000006'02 000000# 000000# %key2 ,hclear 48707 000013'03 143 154 145 141 162 48708 000007'02 000000# 000000# %key2 ,hclose 48709 000015'03 143 154 157 163 145 48710 000010'02 000000# 000000# %key2 ,hconne 48711 000017'03 143 157 156 156 145 48712 000011'02 000000# 000000# %key2 ,hcchar 48713 000021'03 143 157 156 164 162 48714 000012'02 000000# 000000# %key2 ,hcwd 48715 000025'03 143 167 144 000 000 48716 000013'02 000000# 000000# %key2 ,hdebug ;[239] 48717 000026'03 144 145 142 165 147 48718 000014'02 000000# 000000# %key2 ,hdefin 48719 000030'03 144 145 146 151 156 48720 000015'02 000000# 000000# %key2 ,hdele 48721 000032'03 144 145 154 145 164 48722 000016'02 000000# 000000# %key2 ,hdire 48723 000034'03 144 151 162 145 143 48724 000017'02 000000# 000000# %key2 ,hecho 48725 000036'03 145 143 150 157 000 48726 000020'02 000000# 000000# %key2 ,hexit 48727 000037'03 145 170 151 164 000 48728 000021'02 000000# 000000# %key2 ,hfinis 48729 000040'03 146 151 156 151 163 48730 000022'02 000000# 000000# %key2 ,hget 48731 000042'03 147 145 164 000 000 48732 000023'02 000000# 000000# %key2 ,hhelp 48733 000043'03 150 145 154 160 000 48734 000024'02 000000# 000000# %key2 ,hinput 48735 000044'03 151 156 160 165 164 48736 000025'02 000000# 000000# %key2 ,hkermi 48737 000046'03 113 145 162 155 151 48738 000026'02 000000# 000000# %key2 ,hline 48739 000050'03 154 151 156 145 000 48740 000027'02 000000# 000000# %key2 ,hlocal 48741 000051'03 154 157 143 141 154 48742 000030'02 000000# 000000# %key2 ,hlog 48743 000053'03 154 157 147 000 000 48744 000031'02 000000# 000000# %key2 ,houtpu 48745 000054'03 157 165 164 160 165 k20hlp - Kermit-20 Help Text MACRO %53B(1254)-4 01:18 1-Sep-24 Page 3-1 K20HLP MAC 31-Aug-24 21:25 Table of help commands 48746 000032'02 000000# 000000# %key2 ,hparit 48747 000056'03 160 141 162 151 164 48748 000033'02 000000# 000000# %key2 ,hpause 48749 000060'03 160 141 165 163 145 48750 000034'02 000000# 000000# %key2 ,hpromp 48751 000062'03 160 162 157 155 160 48752 000035'02 000000# 000000# %key2 ,hpush 48753 000064'03 160 165 163 150 000 48754 000036'02 000000# 000000# %key2 ,hpwd 48755 000065'03 160 167 144 000 000 48756 000037'02 000000# 000000# %key2 ,hquit 48757 000066'03 161 165 151 164 000 48758 000040'02 000000# 000000# %key2 , hsquo 48759 000067'03 161 165 157 164 145 48760 000041'02 000000# 000000# %key2 ,hrecei 48761 000073'03 162 145 143 145 151 48762 000042'02 000000# 000000# %key2 ,hremot 48763 000075'03 162 145 155 157 164 48764 000043'02 000000# 000000# %key2 ,hretur ;[237] 48765 000077'03 162 145 164 165 162 48766 000044'02 000000# 000000# %key2 ,hrun 48767 000101'03 162 165 156 000 000 48768 000045'02 000000# 000000# %key2 ,hsend 48769 000102'03 163 145 156 144 000 48770 000046'02 000000# 000000# %key2 ,hserve 48771 000103'03 163 145 162 166 145 48772 000047'02 000000# 000000# %key2 ,hset 48773 000105'03 163 145 164 000 000 48774 000050'02 000000# 000000# %key2 ,hshow 48775 000106'03 163 150 157 167 000 48776 000051'02 000000# 000000# %key2 ,hspace 48777 000107'03 163 160 141 143 145 48778 000052'02 000000# 000000# %key2 ,hstatu 48779 000111'03 163 164 141 164 151 48780 000053'02 000000# 000000# %key2 ,hstatl 48781 000114'03 163 164 141 164 165 48782 000054'02 000000# 000000# %key2 ,htake 48783 000116'03 164 141 153 145 000 48784 000055'02 000000# 000000# %key2