home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / test / pdp11 / krtcmd.mac < prev    next >
Text File  |  1996-10-17  |  86KB  |  2,005 lines

  1.     .title    KRTCMD    Kermit-11 main loop, commands calling O:1 or APR4
  2.  
  3.     .macro    krt.id    RLS=X04    ,VER=64    ,PAT=51    ,LASTED=<11-Sep-96>
  4.     .ident    "'RLS'.'VER'"
  5.  
  6. .iif ndf RSTS    RT11=1            ; /E64/
  7.  
  8. .if df    RT11                ; /E64/
  9.     .ASECT
  10. .=110
  11.     .rad50    "'RLS'"
  12.     .word    'VER'.
  13.     .iif ne    'PAT'.    .word    'PAT'.
  14.     .word    -1
  15. .endc    ;RT11                ; /E64/
  16.     .psect    $pdata
  17. sho.ve:    .ascii    "'RLS'.'VER'"    ; /62/ added to keep the parity memory vector
  18.     .iif ne    'PAT'.    .ascii    "-'PAT'" ; /62/ from blowing up SHOW VERSION
  19.     .asciz    "  Last edit: 'LASTED'"<cr><lf>    ; max string length = ln$max
  20.     .even
  21.     .endm    krt.id
  22.  
  23.     krt.id            ; /62/ stuff the above in..
  24.  
  25.  
  26. ;    Brian Nelson  01-Dec-83  13:19:14
  27. ;
  28. ;    Change Software, Toledo, Ohio
  29. ;    University of Toledo, Toledo, Ohio
  30. ;
  31. ;    Copyright 1983 Change Software, Inc.
  32. ;
  33. ;    Edits:
  34.  
  35. ; /E64/    X04.64-49  10-May-1996  by John Santos
  36. ;
  37. ;  KRTCMD - Make it work on RSTS/E.
  38.  
  39. ; /63/    Y03.63-48  19-Feb-1996  by Billy Youdelman
  40. ;
  41. ;  KRTCMD - convert "-" to "_" in getcm0
  42. ;        move most of SHO VER here so the server can call it too..
  43. ;        call INCSTA on ^C abort of file xfr so stats don't blow up
  44. ;
  45. ;  Other modules' updates are not yet added here.
  46.  
  47.  
  48. ; /62/    V03.62-8  27-Jul-1993  by Billy Youdelman
  49. ;
  50. ;  This edit is mostly bug fixes for V03.61, and some enhancements, as below:
  51. ;
  52. ;  KRTAIL - add automatic 50Hz clock rate detection and support for watching
  53. ;        more than 34. lines, just in case..
  54. ;
  55. ;  KRTATR - add 25% to rec'd length for text files from non RT-11/TSX systems
  56. ;
  57. ;  KRTCM1 - make type append a LF to CR if CR not followed by one
  58. ;        hose hi bit and type anyway for VT100 and below in c$type
  59. ;
  60. ;  KRTCON - correct comments to indicate r3 is not preserved between tasks
  61. ;        fixed error handling for suspend/enable CONSOLE logging
  62. ;        added handling for logfile errors
  63. ;        move senbrk here
  64. ;        speed up keyboard input processing at high data rates
  65. ;
  66. ;  KRTCVT - increase size of fixfil stack buffer to SVID limit
  67. ;
  68. ;  KRTDAT - use erbfsiz to size errtxt buffer
  69. ;        add pkrate buffer
  70. ;
  71. ;  KRTDEB - use erbfsiz to size errtxt buffer
  72. ;
  73. ;  KRTDIA - add support for call back modems, SET DIAL/PHONE [NO]ANSWER
  74. ;
  75. ;        add a one-tick pacing delay in DODIAL's loop at 50$ (when modem
  76. ;        doesn't echo commands) to match what was done for echoing modems
  77. ;
  78. ;        fix SHO MODEM for changes to SET DIAL [NO]ECHO and [NO]INIT-ONCE
  79. ;        add initiate-prompt, dial-ack, confirm-ack, [no]binary-response
  80. ;
  81. ;        added x.result (default "Hayes" xmode) and time.settle defaults,
  82. ;        and in "Hayes" and Telebit modem definitions
  83. ;
  84. ;        if DCD is high when exiting program, hang up modem
  85. ;        add support for 38.4kb
  86. ;        add Telebit T3000 modem definitions
  87. ;
  88. ;        double the settle-time value for the wait after dropping DTR,
  89. ;        as some modems (like the T3000) need more time to recover
  90. ;
  91. ;  KRTDIR - reorganized and substantially sped up
  92. ;        added .csispc comma delimiter parsing
  93. ;        fixed wildcard "%" match to no longer match on blanks
  94. ;        moved buffil here, has to be if not in root for getcr0 @sdodir..
  95. ;        make hd$fir=:6 so badly initted disks don't crash DIR
  96. ;
  97. ;  KRTDSP - leave comm handler chans open after assigning it as the link dev
  98. ;
  99. ;  KRTEDI - add bells: up arrow when nothing saved yet, down arrow at end
  100. ;
  101. ;  KRTERR - add error message for logfile problems
  102. ;
  103. ;  KRTHLP - fix a few very small typos and errors
  104. ;        expand and enhance help text for SET DIAL, particularly commands
  105. ;        add dummy file name for HPRINT via RT-11 V5.2/TSX V6.0 LP/LS
  106. ;        display all subtopic text when wildcarding through nested text
  107. ;
  108. ;  KRTINI - dump FILLOG, as PRINTM now does this
  109. ;        provide for logfile errors
  110. ;        add current-block-pointer/size-of file to ^A stats display
  111. ;
  112. ;        check packet length in dskdmp, don't trap to 4 writing past end
  113. ;        of buffer due to line noise and/or modems retraining
  114. ;
  115. ;        major cleanup and maintenance update
  116. ;
  117. ;  KRTLNK - move krtstd back to apr6 as apr1 was over the edge..
  118. ;        fixed virtual segment 1 size in non-EIS version
  119. ;
  120. ;  KRTMAC - move dispatch macro to KRTSER
  121. ;        move erbfsiz here from KRTPAK
  122. ;        condense logging (debug) modes
  123. ;        increase efficiency of incm64 macro
  124. ;        increase MAXLNG (long-packet size) to 1920.
  125. ;        reduce MAXLNG to 520. for NONEIS assembly, so pgm loads under FB..
  126. ;        ditto for ALSIZE (phone # buffer) and LN$CNT (SL # of lines saved)
  127. ;
  128. ;  KRTOSI - test for indirect command file running program, for error handling
  129. ;        dump unused BUFDEF stuff
  130. ;        add Jim Whitlock's VBGEXE fetch pointer fixes
  131. ;
  132. ;  KRTPAK - move erbfsiz to KRTMAC
  133. ;        patch PRINTM to also write to a logfile, when same is in use
  134. ;        add logfile error handler and provide for logfile errors
  135. ;        write error messages to logfile
  136. ;        include file spec in getnxt error messages
  137. ;        add individual packet exchange duration timer, for debugging
  138. ;        make BUFFIL limit test max-0 (was max-4), allows bigger packets
  139. ;        don't log bogus data for timout
  140. ;        make ERROR send an error packet, use PRINTM elsewhere
  141. ;        don't modify SET time-out value
  142. ;        add/enforce SET SEND PACKET-LEN limit
  143. ;        move bufpak to KRTSER, no one else uses it
  144. ;        move buffil to KRTSEN, ditto..
  145. ;        move bufemp to KRTREC
  146. ;        add passed buffer length to rpack$
  147. ;
  148. ;  KRTREC - dump FILLOG, as PRINTM now does this
  149. ;        use log$packets for state logging
  150. ;        provide for logfile errors
  151. ;        modify to not NAK unknown packets (noise)
  152. ;        display any possible contents of "X" packet, for Unix and C-Kermit
  153. ;
  154. ;  KRTRMS - save created (.enter) file size in sizeof entry in data table
  155. ;        make filtyp entry in same global
  156. ;        reset SET FILE CREATE-SIZE on successful file open
  157. ;        moved LOGFIL name buffer here
  158. ;        dropped NONAME.TMP for a nfs .enter, return "bad file name" error
  159. ;        move most of ccast to mainline code in KRTCMD.MAC
  160. ;        moved GETREC here, so HELP via PF2 can't ever crash..
  161. ;
  162. ;  KRTSEN - dump FILLOG, as PRINTM now does this
  163. ;        use log$packets for state logging
  164. ;        provide for logfile errors
  165. ;        modified to wait thru bad ack packets, noise, etc..
  166. ;        recpkt buffer back to normal size, now passes same to rpack
  167. ;
  168. ;  KRTSER - allow server to talk through the comm handler too..
  169. ;        move dispatch macro here
  170. ;        add newline in log file at each new process
  171. ;
  172. ;  KRTSHO - added SHO BAUD, DTR, DUPLEX, END-OF-LINE, FLOW-CONTROL, HOME, LD:,
  173. ;        LOCAL-ECHO, LOGF, LONG-PACKETS, RANDOM, RECEIVE, SEED, SEND, SPEED
  174. ;        cleanup, condense logging (debug) modes display
  175. ;        display current-block-number and size-of logfile in SHO DEBUG
  176. ;        conform to major sinit stuff update in KRTINI.MAC
  177. ;        include last number dialed in SH PHONE
  178. ;        add SHOW CL, EOF
  179. ;
  180. ;  KRTST0 - add support for call back modems, SET DIAL/PHONE [NO]ANSWER
  181. ;        report file size (blocks free) when opening a log file
  182. ;        set binary flag instead of close/reopen file for raw I/O debug
  183. ;        fix typo causing a new logfile of same name not to get opened
  184. ;        combine FILE, STATE and PACKET into one DEBUG mode (ON)
  185. ;        redo SET DIAL ECHO and INIT-ONCE as [NO]ECHO and [NO]INIT-ONCE
  186. ;        SET SETTLE-TIME is now SET DIAL SETTLE-TIME
  187. ;        drop SET HAND XON, as RT-11 and TSX eat same..
  188. ;        drop SET DIAL INFO, as any undefined message defaults to it
  189. ;
  190. ;        rename SET DIAL PROMPT to WAKE-ACK, add BLIND, PULSE, TONE,
  191. ;        DIAL-ACK, INITIATE-PROMPT, CONFIRM-ACK, [NO]BINARY-RESPONSE
  192. ;
  193. ;  KRTST1 - moved BREAK, CREATE-SIZE and [NO]VOLUME-VERIFY here ..
  194. ;        conform sinit-related SETs to major update of KRTINI.MAC
  195. ;        move SET TIME-OUT to SET RECEIVE TIME-OUT and SET SEND TIME-OUT
  196. ;        add SET CONSOLE PRIORITY for KM/XC/XL under TSX
  197. ;        add SET FLOW-CONTROL to support RTS/CTS and KM handler
  198. ;
  199. ;  KRTUTL - modify asctim to output ticks
  200. ;        restored optional time value pointer
  201. ;        move various items here from root to save space
  202. ;
  203. ;  KRTXL  - corrected suggested XL BUFSIZ to 256.
  204. ;        keep XL open even for XM, to accommodate RT-11 V5.6
  205. ;        add support for KM handler
  206. ;        add version testing to support RT-11 V4
  207. ;        add DCDTST for status during file transfers
  208. ;        skip .ABTIO for XC/XL under ALL RT-11 V5.6 monitors
  209. ;        to avoid hang/race/?
  210. ;
  211. ;  All other modules are unmodified except for possible corrections to
  212. ;  typographical errors in the comments or such that their object code
  213. ;  remains essentially unchanged.
  214.  
  215.  
  216. ;  /BBS/  V03.61  3-Dec-1991  by Billy Youdelman
  217. ;
  218. ;  The following work was done primarily to support the use of Kermit-11 on
  219. ;  a public bulletin board system under TSX-Plus, and then expanded to make
  220. ;  a reliable, general purpose comm program.  Numerous bugs have been fixed
  221. ;  and several new routines added.  Some are RT-11/TSX-Plus specific, all are
  222. ;  described below.  For a more in-depth discussion of what's been done, see
  223. ;  KRT.DOC Appendix A.  Modifications are slugged /BBS/ in the source files.
  224. ;
  225. ;  NOTE that all files previously named K11*.* have been renamed KRT*.* and
  226. ;  in some cases names have been slightly altered, ie: K11TSX.DOC = KRT.DOC,
  227. ;  to avoid any conflict with the existing Kermit-11.  These files are NOT
  228. ;  interchangeable with those of Kermit-11 T3.60 et.al.
  229. ;
  230. ;  RT-11 multi-term support and some other things are pulled to keep the size
  231. ;  reasonable.  You must use a handler, or the controlling terminal line, to
  232. ;  talk to the outside world.  This version is for use with TSX-Plus V6.2 or
  233. ;  above, though most of it runs under TSX V6.0.  It shouldn't be any worse
  234. ;  than the "stock" Kermit-11 T3.60 with RT-11.  Debugging was done on TSX
  235. ;  V6.4, under which it has been thoroughly tested and is extremely reliable.
  236. ;
  237. ;  IMPORTANT NOTE:  While effort has been made to follow the style and format
  238. ;  in which Kermit was written, as in the case of modifying TYPE by the use of
  239. ;  standard calls (getc, putc) available across all operating systems, there
  240. ;  are other instances (such as MOUNT) using emts existing only in TSX+ which
  241. ;  will not be available elsewhere, even under RT-11.  A few new calls have
  242. ;  been added to the op system independent modules, & supporting routines to
  243. ;  the RT-11 modules.  Using some of these mods under other operating systems
  244. ;  will require similar additions to their specific support modules.
  245. ;
  246. ;  Please refer to KRT.DOC for installation instructions, then to Kermit's
  247. ;  on-line help (which is quite extensive) for operational details.
  248. ;
  249. ;
  250. ;            S p e c i f i c   M o d i f i c a t i o n s
  251. ;            ---------------   -------------------------
  252. ;
  253. ;  KRTASM - Created KRTASM.NON, assembles Kermit modules for a non-EIS CPU
  254. ;
  255. ;  KRTATR - modified rx.cdt,sn.cdt to do the "#" date/time attribute
  256. ;        hosed unused stuff, added rx.pro,sn.pro for protected file attr
  257. ;
  258. ;        added support for date/time/prot file attributes
  259. ;        patched open, close, I/O data table to support it..
  260. ;
  261. ;        modified w$attr to send all attributes in a single packet
  262. ;        rx.xle result in at$len no longer overwritten by rx.len
  263. ;        added send exact file length in bytes
  264. ;        call binary files "BINARY" not "IMAGE" so MS-Kermit is happy
  265. ;
  266. ;  KRTCM1 - c$type defaults to .LST, error handling improved, does wildcards
  267. ;        also sped up, types any size record, binary file filtering added
  268. ;
  269. ;        c$set - error handling fixed
  270. ;        c$who, c$pwd, c$cls, c$clx, c$xmodem added..
  271. ;        c$take parses file name, checks for/disallows wildcards, etc.
  272. ;        c$conn - disallow connect to TT (since one is there already..)
  273. ;        mount/dismount logical disks command interface, calls TSX emts
  274. ;        added RT-11 style assign default device, for DK only
  275. ;        remote disk_usage passes optional device argument
  276. ;        made default take file type ".COM"
  277. ;        reinit modem when exiting if DTR dropped during CONNECT
  278. ;        added SET CLn LINE x support for TSX-Plus, see HELP SET CL
  279. ;        added search path for take files
  280. ;        move sho$line here, added modem type, TSX line # and DCD status
  281. ;        added call to c$idle in c$exit to reset modem on exit to monitor
  282. ;        c$set now does multiple args, separated by commas
  283. ;
  284. ;  KRTCMD - dumped ttysav/ttyset from opentt - these killed single char
  285. ;        input under TSX, thus things like the ^A stats didn't work.
  286. ;        t.ttysav is now part of the init at start-up, then ttyrst is
  287. ;        called as needed.  ttyini no longer turns things on which
  288. ;        ttysav would have to turn off.  also, with 6 char labels,
  289. ;        %.ttysav = %.ttyset = the same thing under the present system
  290. ;        of dispatching I/O with "%." prefixing routine names..
  291. ;
  292. ;        xmode flag used to clean up xreply display by suppressing packet
  293. ;        log display when either side's blo <>1 forces a send file init
  294. ;
  295. ;        send file asfile error handling improved, get file asfile now
  296. ;        shares some of the above code.  one may GET/SEND [DEV:]FILE DEV:
  297. ;        to send/receive a single file to/on a device other than the
  298. ;        default.  wildcards are otherwise not allowed whilst renaming.
  299. ;
  300. ;        readcmd now displays prompt and input strings for getmcr
  301. ;        also enables take file echo if/after krt.ini has run
  302. ;        and will allow ";" and "!" comment delimiters anywhere in
  303. ;        a line in a command file, not just the first column..
  304. ;
  305. ;        modified getcm0's response to "?" argument to dump commands
  306. ;        in 4 columns across the screen ala VMS help
  307. ;
  308. ;        ^C handler in KRTRMS modified, thus cctrap here is unneeded..
  309. ;        CONNECT automatically if FINISH succeeds..
  310. ;        ring the bell at the end of RECEIVE, so one will know it's done.
  311. ;        fixed GET/SEND file asfile to handle node names
  312. ;        patched to accept "@COMMAND" for take file, ala RT-11
  313. ;        fixed init/take file error handling in readcmd
  314. ;        add a "BUG" command ala C-Kermit
  315. ;        GET/SEND now handle multiple file names delimited by commas
  316. ;        use DEC method of version numbering
  317. ;
  318. ;  KRTCON - this module has been extensively modified and will now run fine
  319. ;        under any monitor including SJ if it's built with timer support
  320. ;
  321. ;        pulled RT-11 multi-terminal and sj monitor w/o twait stuff..
  322. ;
  323. ;        set/reset a list of "activation" chars under TSX which
  324. ;        allows non-printing chars input at the terminal, such as ^O,
  325. ;        to be passed to the remote system during the connect mode
  326. ;
  327. ;        display handler speed (fixed for 19.2k too) when connecting
  328. ;        display escape sequence when entering CONNECT
  329. ;        disallow typing TSX lead-in char to TT when running under TSX
  330. ;        allow suppression of sign-on text, for use with krttra
  331. ;        skip TT input routine once done flag is set
  332. ;        TT input now uses con8bit ala TT output
  333. ;        added MILNET option to wakeup (XON) MILNET TACs
  334. ;        added send a control char via esc_char "^x" ala VTCOM
  335. ;        added esc_char "Z" command to hose/refresh handler
  336. ;
  337. ;  KRTCVT - added useful RT-11/TSX+ binary file types
  338. ;        modified chkext to handle file types of less than 3 chars
  339. ;        fixfil - parse a device name in filespec, fixed termination bug
  340. ;        namcvt now catches unix "/" and pc "\" directory delimiters
  341. ;        fixed namcvt to not output a "." on a null file name input
  342. ;
  343. ;  KRTDAT - added a general use buffer, some flags and variables
  344. ;        SL editor insert mode default is set on here in edists
  345. ;
  346. ;  KRTDEB - added new variables to data displayable with EXAMINE
  347. ;        display ascii chars when dumping byte values
  348. ;        fixed error handling
  349. ;        fixed addressing bug in pint (displays word values)
  350. ;
  351. ;  KRTDIA - set$mo now won't write bad modem name into modem: and will try
  352. ;        to init (killing auto-answer) when set if a line and speed have
  353. ;        been set first
  354. ;
  355. ;        if DIAL/REDIAL succeeds jump to CONNECT automatically
  356. ;        set linksts when dialing so ^C abort will catch correct ttname
  357. ;        findmodem now does not try to process an empty string in modem:
  358. ;        added c$idle, call to reset modem to idle (answer) mode
  359. ;        findmodem/findnumber will match on partial input string
  360. ;        added %X format effector for Hayes extended response modes
  361. ;        added Telebit T2500 modem definitions
  362. ;
  363. ;        redial loop moved to c$dial, runs faster without initializing
  364. ;        the modem's lun every pass thru the loop, reduces cpu usage too
  365. ;
  366. ;        load buffer with defmsg after displaying RING, to not overwrite
  367. ;        the default message with call status stuff
  368. ;
  369. ;        if DIAL can't translate an alias, say so then die (instead of
  370. ;        prompting to continue with an empty number buffer)
  371. ;
  372. ;        added xredial flag word, for keeping return path straight when
  373. ;        connecting after a successful REDIAL. flag also used to speed up
  374. ;        redial process for modems which define init.once by not initting
  375. ;        before every retry.  init.once was added to support all this..
  376. ;
  377. ;        while waiting for a response after dialing modem, check for
  378. ;        input from keyboard, allowing an easy abort
  379. ;
  380. ;        .default patched to get/set handler speed from modem response,
  381. ;        old speed is saved and restored, unless set different after..
  382. ;        Hayes definition completed and moved to it.  this also renders
  383. ;        Hayes responses displayable via SHO MODEM.
  384. ;
  385. ;        diatmo from SET DIAL TIME-OUT gets written into dial.time(r4)
  386. ;        when either c$dial or sho$dial is called.  it's now usable with
  387. ;        any modem type (not just user-defined) by setting the modem's
  388. ;        internal timer to the max (ATS7=255 etc) then letting Kermit's
  389. ;        timer take action first.
  390. ;
  391. ;        modified waitfor to test for keyboard input, allowing a "strike
  392. ;        any char" abort during dialing, now including the init string.
  393. ;        DTR is dropped to ensure the modem will actually abort the call.
  394. ;
  395. ;        SHO MODEM expanded to display everything
  396. ;        result msgs must match from 1st byte to avoid embedded strings
  397. ;        save modem init status to drop unnecessary inits
  398. ;        SET MODEM now inits same, if a line (and speed) have been set
  399. ;        echo everything from modem (if it echoes) during DIAL
  400. ;        add CONNECT/nnnn for Hayes to alter DTE speed w/TSX and CL
  401. ;
  402. ;        add Concord Data Systems 224 Auto-dial modem and make dialer echo
  403. ;        modem output byte by byte so "..." call progress stuff is echo'd
  404. ;
  405. ;        moved SET DTR code here, and reinit modem after DTR drop if one
  406. ;        was on-line before it
  407. ;
  408. ;  KRTDIR - this module has been extensively modified, please refer to it..
  409. ;        add TSX+ create time, date slug, prot status, summary lines, etc
  410. ;        corrected bugs in error handling
  411. ;        added d$cvtnum for file sizes/sums larger than 32767.
  412. ;        "DK" now uses defdir, not op system DK, needs fparse in krtrms
  413. ;        ascdat patched for RT-11 V5.5, now also used for cvtdat
  414. ;        add dirflg to control embedded blanks in file name
  415. ;        getnth used to reread until context=diridx, now context saves it
  416. ;        added summary only flag, for use with SPACE and REM SPACE
  417. ;        force USR to re-read dir segment, allowing one to swap floppies
  418. ;
  419. ;  KRTDSP - this module has been extensively modified
  420. ;
  421. ;        moved kbread here, one copy is sufficient, cleaned up also
  422. ;        streamlined jsw/nowait/single_char modes/setting/resetting/etc
  423. ;        added writ1char routine - writes a single character to TT
  424. ;        add entry for inqdtr, only works with CL handler
  425. ;        assdev patched for new mapxl in krtxl
  426. ;        made packet buffer length = $ALLSIZ to match checkpacket buffer
  427. ;        ttyrst - resume TSX window processing, as after packets, connect
  428. ;        added cl.dump to clean up when exiting/modifying a CL line
  429. ;        inqbuf patched to use MAXLNG for TSX+, MAXPAK for RT-11
  430. ;        added inqcd
  431. ;
  432. ;        moved binread here so CONNECT can share it and XL can be left
  433. ;        open under TSX and RT-11SJ where there is no hope of closing it
  434. ;
  435. ;        I/O is now dispatched this way:
  436. ;         1) if via the controlling terminal line, use routines in KRTERM
  437. ;        regardless of operating system.  that is, the t.tty... calls
  438. ;         2) if via a handler, use routines in KRTXL.  that is, the
  439. ;         x.tty... calls for CL, XC or XL
  440. ;         3) RT-11 multi-terminal I/O has been pulled
  441. ;
  442. ;        moved set$line here, patched to reset modem to idle state and
  443. ;        release a TSX CL line after SET LINE TT if same was acquired
  444. ;        within Kermit
  445. ;
  446. ;        set$line won't write bad device to ttname
  447. ;        SET LINE TT now reverts to the remote mode
  448. ;
  449. ;  KRTEDI - up/dn arrow command scrolling fixed
  450. ;        command dispatch table patched for VT-100 keypad (KED equivs)
  451. ;        dup cmds now not saved even when < max cmds are currently stored
  452. ;        extend keypad for adv, bkup, word, char, line, delete, undelete
  453. ;        added check for SS3 for VT-220 keypad
  454. ;        cleaned up various odds and ends..
  455. ;        WARNING:  If LN$MAX is made greater than 127. fix sxt stuff here
  456. ;
  457. ;  KRTERM - this module has been extensively modified, please refer to it
  458. ;        added SET TT XON (TSX) emt to t.ttxon, uses tsxsav for lnum
  459. ;        add dummy routines for inqdtr, inqcd
  460. ;        ttyini - suspend TSX window processing, as in connect, packets
  461. ;        added support for vlflag under TSX+ to ttyini
  462. ;
  463. ;        drop TSX hi eff term mode and declare a list of activation chars
  464. ;        instead, allowing single char input (so packets can be longer
  465. ;        than TSX's internal I/O buffers) whilst offing ^B, ^T, ^W, etc
  466. ;        so line noise doesn't trigger various annoying things as when
  467. ;        using the server via TT, also allows passing to remote when in
  468. ;        the connect mode
  469. ;
  470. ;  KRTERR - moved error message prefix routine here from KRTPAK
  471. ;        moved all system error messages here, from various modules
  472. ;
  473. ;  KRTHLP - kill extra LF after listing subtopics
  474. ;        hfind - fixed wildcarding when no subtopics exist for a topic
  475. ;        help text file updated to reflect mods/additions/omissions
  476. ;        hindex - display sped up, prompting after it now uses full text,
  477. ;        also handles topic names greater than 18 bytes ala VMS help
  478. ;        added fake RMS stuff for RT-11/TSX, and did a general cleanup..
  479. ;        path for KRTHLP.HLP is now HLP, KRT, SY and DK
  480. ;        modified to check for correct copy of KRTHLP.HLP
  481. ;        on topic error nest in as far as possible instead of to the top
  482. ;        added HPRINT, dumps help text to LP
  483. ;
  484. ;  KRTINI - prompt set to KRT
  485. ;
  486. ;        call to an .INI file now tries INI, KRT then DK and finally
  487. ;        SY.  take file echo is disabled if krt.ini is found, then
  488. ;        enabled when the init file is closed (in readcmd, in krtcmd)
  489. ;        name of init file (if found) is displayed while reading same..
  490. ;
  491. ;        recdsp table fixed to call recvt1 (instead of senvt1 .. ) for
  492. ;        terminals >VT100
  493. ;
  494. ;        added warning message when 8-bit quoting is first forced on and
  495. ;        init stuff in fixchk so the need for 8-bit quoting is tested on
  496. ;        each xfr, thus one need not exit/restart Kermit to turn it off
  497. ;
  498. ;        packet length display in log files now accommodates four digit
  499. ;        numbers, as the max. packet is now 1024. bytes
  500. ;
  501. ;        allow debugging to TT even with no disk file open..
  502. ;        reset parity found tho set NONE warning before each transaction
  503. ;        fixed warning messages for unsupported/disabled long packets
  504. ;        dkname used to home, here it's init'd to physical DK at start-up
  505. ;
  506. ;  KRTLNK - segments have been combined where possible to reduce memory and
  507. ;        mapping requirements
  508. ;
  509. ;  KRTMAC - modified message macro to call .newline instead of saving CR/LF
  510. ;        and null for each new line, knocking 1042. bytes off the size
  511. ;        of this version..  also changed ".print" emulation to wrtall,
  512. ;        for a similar savings in compiled program size.
  513. ;
  514. ;        dump raw I/O logging from log$al (SET DEB ALL) - too confusing
  515. ;        also pulled log$rp out and made it a completely separate item..
  516. ;
  517. ;        added a couple upper case macros
  518. ;
  519. ;  KRTNHD - made divide macro double precision
  520. ;
  521. ;  KRTPAK - added lun.ld == 12 for TSX logical disk support
  522. ;        added lun.at == 5 for file attributes support
  523. ;        prefixing error messages with the prompt string moved to KRTERR
  524. ;        waitsoh - ^Z abort changed to ^C abort, thus not killing the pgm
  525. ;
  526. ;        spack$ packet length test fixed to determine the true length of
  527. ;        a packet near or equal to 94 bytes when long packets are used.
  528. ;        it was possible to generate a "normal" packet with an out-of-
  529. ;        range LENGTH character (using all eight bits) when reaching the
  530. ;        the EOF produced a last packet in a long packet series close to
  531. ;        94 bytes, as the routine filling the packet data input buffer
  532. ;        is still looking for enough to make a long packet, with no
  533. ;        consideration for the added SEQ and TYP bytes nor the checksum
  534. ;        size (up to three more bytes with CRC block checking)..
  535. ;
  536. ;        rpakst patched to hose link device whenever the "T" (time-out)
  537. ;        packet count is incremented, or when a NAK xxx NAK series
  538. ;        (indicating resonating packets) occurs.  this is very helpful
  539. ;        when telephone line noise crashes/hangs the handler..
  540. ;
  541. ;        space padding between elements of an error message moved from
  542. ;        error: to the err msgs themselves as printm doesn't do it, and
  543. ;        it's too confusing otherwise..
  544. ;
  545. ;        incsta patched to compensate for crossing midnight, as long as
  546. ;        there's less than 24 hours between calls to it, thus 32-bit
  547. ;        time data from incsta are thought to be sufficient here
  548. ;        note: the display routine in krtsho limits max to 18.2 hours..
  549. ;
  550. ;        patched bufemp to not output the lead-in char to TT under TSX
  551. ;
  552. ;        moved RPACK debug stuff to rawio: as when it was in rpakrd: it
  553. ;        missed the SOH, which is handled by waitsoh: (both call rawio)..
  554. ;        also cleaned up display at the EOL and added display of TIMOUTs
  555. ;
  556. ;        fixed non-init'd repeat count reg bug in bufunpack
  557. ;
  558. ;  KRTREC - rfil.x: put "Remote server response:" here so it displays even
  559. ;        when blo <>1.  also set image=binary here so typing 8-bit
  560. ;        files doesn't die on checksum error when clrpar hoses hi bits
  561. ;
  562. ;        rfil.f: check asname here (instead of rfil.d), also fixed so
  563. ;        VMS filespecs longer than 66. bytes don't write past end of the
  564. ;        scratch buffer.  also namcvt strips VMS node::dev:[dir] here..
  565. ;
  566. ;        kill debug to TT if not running as a local Kermit
  567. ;        add support for INCOMPLETE-FILE-DISPOSITION
  568. ;
  569. ;  KRTRMS - iswild modified to catch implicit wildcarding
  570. ;        error mapping tables augmented to accommodate new routines
  571. ;        .rctrlo added to file close routine
  572. ;        chkdev added, used for bbs device access restriction
  573. ;        limits: (activation char list for TSX) lives here, also vlflag
  574. ;        added prewind routine to fake RMS stuff when reading help text
  575. ;        add er$dev at end of faterr: table to catch non-init'd lookup
  576. ;
  577. ;        suspend: patched to wait in one tick increments, allowing ^C to
  578. ;        abort - also now uses clkflg to accommodate 50 or 60 Hz..
  579. ;
  580. ;        fixed fparse handling of device name, also disallow a leading
  581. ;        comma in the arg string, as this will do a nfs lookup..
  582. ;
  583. ;        ccast - now does trouble-free aborts from anywhere you'd need it
  584. ;        when talking to the handler or when something is running which
  585. ;        if aborted would leave virtual addressing in a mess, the bell
  586. ;        will be rung acknowledging the abort, at which point it's best
  587. ;        to wait for the program to do it, which it will as soon as it
  588. ;        can.  further ^C's will ring the bell up to CC$MAX times, then
  589. ;        a complete abort and return to the main command line via .spcps
  590. ;        occurs.  if necessary an error packet will be sent, however this
  591. ;        may not be as effective as using ^E, which waits for the packet
  592. ;        in progress to complete first..
  593. ;
  594. ;        added getmcr routine to get arg(s) from KMON passed to chain
  595. ;        area when Kermit is started.  owing to the way RT-11/TSX+ parse
  596. ;        the "@" (causes KMON to try to open the file and read the
  597. ;        first line of it into the command buffer, including the chain
  598. ;        area) the syntax "KERMIT @TAKEFILE" is not usable under RT/TSX.
  599. ;        "KERMIT TAKE TAKEFILE" is a poor but functional substitute..
  600. ;        any other command and args may be passed, ie; .kermit dial tommy
  601. ;
  602. ;        add fixwild, translates "?" to "%" in file names
  603. ;        fixed error handling in file close routine
  604. ;        added getdk, gets physical name of "DK"
  605. ;
  606. ;        moved direr$ here, moved error messages from various modules to
  607. ;        krterr, and added calls to them via direrr..
  608. ;
  609. ;  KRTSJ  - link command file to build minimum memory version of this
  610. ;        program.  KRT.SAV is disk overlaid, uses 51kb..
  611. ;
  612. ;  KRTOSI - "pic" code dumped
  613. ;        if TSX, line number saved in tsxsav during init, for t.ttxon
  614. ;        store clock rate (50/60 Hz) in clkflg, use elsewhere for timers
  615. ;        add init for TSX activation char list
  616. ;        call assdev when PRO-350 tries to automatically assign CL or XC
  617. ;        .SERR is set here and then left on forever..
  618. ;        VT200 now sets con8bit
  619. ;        cleaned up init code
  620. ;        increase ALSIZE to 1024. (user-defined modem and ph numb buffer)
  621. ;        under RT-11 display memory free for handlers at sign-on
  622. ;
  623. ;  KRTSEN - increased size of recpkt buffer to $allsiz to avoid writing past
  624. ;        eob (causing trap to 4 in rpack$ which crashes the program) when
  625. ;        packets are out of sync and a long packet arrives where an ack
  626. ;        is expected, or line noise "extends" otherwise ok data..
  627. ;
  628. ;        kill debug to TT if not running as a local Kermit
  629. ;        modified to (w/KRTATR) send all attributes in a single packet
  630. ;        ensure directory search channel is closed on errors/aborts
  631. ;
  632. ;        display abort message when file skipped due to SET FILE PROTECT
  633. ;        (by an "X" or "Z" in the ACK packet) on the other Kermit
  634. ;
  635. ;  KRTSER - gen.t filespec more carefully tested, defaults to .LST type
  636. ;        double prompt on server exit killed by hosing ^M in FIN packet
  637. ;        remget - now uses srcnam for input file
  638. ;        no args to server command allowed under RT/TSX
  639. ;        input file name to serv.r checked by fparse
  640. ;        gen.c inserts colon after device name if necessary
  641. ;        gen.w - remote who via xreply added
  642. ;        upcase incoming remote command args, so mskerm is happy
  643. ;        gen.d checks for valid device before initiating any output,
  644. ;        defaults to DK if no arg given, as from MSKermit
  645. ;        modified gen.u to use krtdir
  646. ;        remspa accepts optional device argument, gen.u passes to krtdir
  647. ;        remfin returns error status in r0, to CONNECT if FINISH succeeds
  648. ;        disallow running server unless link device is TT
  649. ;
  650. ;  KRTSHO - SHOW command with no args displays assigns ala RT-11
  651. ;        sho$all - shortened up
  652. ;        added sho$attributes
  653. ;        added sho$devices - displays the bbs access permission list only
  654. ;        added sho$submounts, using TSX emts
  655. ;        added sho$vl - displays status of vlswch under TSX+
  656. ;        add DEC-Multinational type to sho$file
  657. ;        moved release notes to the help text file
  658. ;        sho$packet - display "^A" notation in addition to octal numbers
  659. ;        also lists long-packets max length, set length, rec'd length
  660. ;        add xtime for spiffier transfer time display, other small fixes
  661. ;        sho$fi: indicate if file name conversion disabled, lower case on
  662. ;        added home directory to sho$default
  663. ;        fixed display formatting for sho$phone_numbers
  664. ;        sho$params indicates if SET LONG OFF or SET NOLONG
  665. ;        added MILNET to SHO CONSOLE
  666. ;        added c$print
  667. ;        moved sho$line to krtcm1
  668. ;        added SHO TERMINAL
  669. ;        add SHOW INCOMPLETE-FILE-DISPOSITION
  670. ;        add SHO MEMORY, display remaining handler free space under RT-11
  671. ;        add SHO SL, SHO UPDATE, added LOCAL-ECHO, BREAK to SHO CONSOLE
  672. ;        add SHO REPEAT-CHAR, SERVER
  673. ;        pass file date/time/prot to COPY output file
  674. ;        added SHOW commands for everything else possible..
  675. ;        SHO VERSION uses DEC method of version numbering
  676. ;
  677. ;  KRTST0 - set$pa - fixed display bug with "?" arg
  678. ;        enhanced set$speed error handling
  679. ;        added SET PHONE XMODE n for Hayes extended response mode support
  680. ;        cleaned up all debug code, allowing debug to TT w/o a disk file
  681. ;        moved set$line to KRTDSP, so it can call c$idle in adj. overlay
  682. ;        make SET DEBUG NONE off ALL debugging, including TT
  683. ;        add separate parameter for initial-connect retry ala VMS Kermit
  684. ;        add SET INCOMPLETE-FILE-DISPOSITION
  685. ;        add SET SL
  686. ;        move [SET] LOGFILE here, integrate with SET DEBUG..
  687. ;        make logfile default type .LOG, ask before zapping existing file
  688. ;        allow LP as the logfile, please SPOOL this in the op system!
  689. ;        add optional debug mode to LOGFILE, file name to SET DEBUG mode
  690. ;        LOGFILE sans args closes an open logfile
  691. ;        add SET SETTLE-TIME to allow for modem's reset processing time
  692. ;        add SET SL ON,OFF,[NO]KED
  693. ;
  694. ;        added SET DIAL RINGING, CONnnnn for supported speeds, ABORT
  695. ;        COMMENT, IDLE, PROMPT and INIT.ONCE for user-defined modem
  696. ;
  697. ;  KRTST1 - HOME uses dkname:
  698. ;        set$df - now calls c$cwd
  699. ;        set$sn - clear r0 after printing error message, avoid dupe msg
  700. ;        sts$pl - corrected packet length max test to 94. (maxpak)
  701. ;        set$attributes - fixed so "?" arg doesn't set to last displayed
  702. ;        added set ld empty, using TSX emts
  703. ;        sf$typ - patched to pass proper arg to any routine it calls ..
  704. ;        str$pl re-enables long packets if set >94., warns if CRC not on
  705. ;        set$file - added SET FILE NAMING [NO]LOWER-CASE, for Unix
  706. ;        SET LONG ON now also does SET REC PAC 1204 and SET BLO 3
  707. ;        con8bit set/cleared as appropriate by set$tt
  708. ;        time-out may now be set as low as 1 second
  709. ;        SET REC PAC >94 now enables long-packets, if set off prior to it
  710. ;        added SET CL PORTS, UNITS for auto line assign under TSX+
  711. ;        added SET CONSOLE [NO]MILNET to force 2 XONs when CONNECTing
  712. ;        cleaned up SET FILE code, see HELP SET FILE for details
  713. ;
  714. ;        set$bi - modified to be augmented by new entries, not trashed,
  715. ;        to allow dependence on it for selection of filtering for the
  716. ;        new improved type routine in KRTCM1, supports types <3 chars
  717. ;
  718. ;        st$nlp - clr senlng, which is now used to ensure a packet of
  719. ;        almost or equal to 94 bytes in a long-packet xfr will get the
  720. ;        correct header.  command dispatch table also patched for this
  721. ;
  722. ;        added set$vl - sets action on vlswch char ^W and print window
  723. ;        char ^B in the CONNECT mode under TSX+  see HELP SET VLSWCH
  724. ;
  725. ;        moved SET [NO]QUIET here, made it SET TT [NO]QUIET, added tests
  726. ;        for it where missing..
  727. ;
  728. ;  KRTSUB - added upper case subroutine
  729. ;        moved itoa here
  730. ;        add support for non-EIS CPUs
  731. ;
  732. ;  KRTTRA - after each byte sent the response from the receiver is echo'd
  733. ;        this makes it handy for reading text files into a called
  734. ;        system's message editor, etc..  speed is locked at 1 byte/tick,
  735. ;        which is 600 baud in 60Hz land
  736. ;
  737. ;        added code to echo last char(s) from remote after EOF is reached
  738. ;        modified action on EOF to reconnect to remote system, suppressing
  739. ;        CONNECT's sign-on for a cleaner (cursor+display intact) return
  740. ;
  741. ;  KRTUTL - added logical disk mount using TSX+ emts
  742. ;        getrec patched to accept passed buffer-length
  743. ;        50/60Hz test added to asctim
  744. ;        ascdat now uses copy in krtdir
  745. ;        cleaned up the delete, rename and copy subroutines..
  746. ;        move copy file name checking to c$copy, now shared with PRINT
  747. ;        try to mount .DEV logical disk if .DSK default fails
  748. ;        fixed COPY error handling when out file is too small
  749. ;
  750. ;  KRTXL  - DTR drop sped up to a 0.5 second interval..
  751. ;        dumped waitti as multiple byte reads accomplish the same thing
  752. ;        CLHOSE defined for use in clearing CL handler, uses spfun 265
  753. ;        CLSTAT defined and inqdtr added, for CL lines only..
  754. ;        enhanced set$speed error handling
  755. ;        mapxl now allocates the handler under TSX
  756. ;        added inqcd
  757. ;        SET SPEED reinits modem if one was on-line
  758. ;
  759. ;        mapxl now uses .cstat to get physical name from logical name
  760. ;        one may ASS CL0 PHN then run Kermit and SET LINE PHN within it
  761. ;
  762. ;        dropped TSX hi-eff term mode when data are going thru a handler
  763. ;        allowing use of ^A and etc during transfers under TSX
  764. ;
  765. ;        allow LFOUT operation of CL handler.  under TSX return is made
  766. ;        an activation character, thus no LF is appended..
  767. ;
  768. ;  KRTXM  - added equiv. of SETSIZ KRTTSX/T:64., helps on some TSX systems..
  769. ;
  770. ;  KRTXMO - added xmodem..  this is currently send only from here via the
  771. ;        connected terminal line (no handler support)
  772.  
  773.  
  774. ; /BBS/    Non-relevant edits (other operating systems) have been pulled below..
  775.  
  776. ; 60 21-Mar-89    00:00:00  K11DIA.MAC    Completed definition of DF224 modem
  777. ; 59 17-Sep-87    15:28:36  K11SER.MAC    Fix processing of server cwd cmd
  778. ; 56 23-Jun-87    07:41:18  K11PRT.MAC    Fix sending break for XL on RT-11
  779. ; 56 19-Feb-87    15:58:58  All sources    Use teco macro to change all the
  780. ;                    .includeS to be conditional, this
  781. ;                    was done to allow assembly on RT-11
  782. ;                    version 4 and P/OS
  783. ; 56 09-Dec-86    14:15:23  K11INI.MAC    Control A stats support
  784. ;              K11REC.MAC
  785. ;              K11SEN.MAC
  786. ; 56 06-Nov-86    08:27:54  K11SHO.MAC    Fix command macro list (SHO ?)
  787. ; 55 23-Oct-86    11:00:59  K11CMD.MAC    Prompting bug for RT-11 XM overlay
  788. ; 54 30-Sep-86    13:24:07        SHOW DIAL
  789. ; 54 29-Sep-86    10:23:49  Numerous    Fix sources for possible I/D space
  790. ;                    linking under RSTS/E and RSX11M+
  791. ; 54 23-Sep-86    16:28:14  K11DIA.MAC    Support VADIC 4224 .v22bis modem
  792. ; 54 23-Sep-86    16:28:46  K11ST0.MAC    SET PHONE TONE/PULSE and SET PHONE
  793. ;                    BLIND, added for VA4224 support
  794. ; 54 09-Sep-86    16:01:27  K11ST1.MAC    SET FILE NAMING/NAMES option
  795. ;              K11CVT.MAC    Options are: LITERAL, CONVERTED
  796. ;              K11DAT.MAC             FULL, UNTRANSLATED
  797. ; 53 13-Aug-86    09:38:04  K11PAK.MAC    Add SET SEN [NO]XON so one can force
  798. ;              K11ST1.MAC    every packet sent to be prefixed with
  799. ;              K11DAT.MAC    an XON.  Perhaps this will help for
  800. ;                    the DHV/U problems with flow control.
  801. ; 53 12-Aug-86    16:28:14  K11PAK.MAC    Fix BUFUNP to process repeat counts
  802. ;              K11SER.MAC    It would seem the 2.29 of MS Kermit
  803. ;              K11REC.MAC    is prefixing file name in F packets
  804. ; 53 12-Aug-86    11:05:03  K11CMD.MAC    Allow ; and ! to delimit comments
  805. ; 53 07-Aug-86    08:40:36  K11RCO.MAC    Minor changes to connect under RT-11
  806. ;              K11PRT.MAC    SJ without timer support. This was
  807. ;                    done AGAINST my better judgement.
  808. ; 53 05-Aug-86    19:35:19  Many        Make CMDBUF and ARGBUF pointers to
  809. ;                    the actual data in order to reduce
  810. ;                    the K11XM and K11RT4 sizes to help
  811. ;                    in SRUN or FRUN. Add code to re-
  812. ;                    locate some PIC code into dynamic
  813. ;                    region based from APR7 for RT-11.
  814. ; 53 29-Jul-86    13:10:34  K11ST1.MAC    Add SET FIL TYP DEC_MULTINATIONAL
  815. ;                    to allow 8-bit text files. The mod
  816. ;                    to K11ATR was to add support for
  817. ;                    this between two 3.53 or later K11
  818. ;                    systems.
  819. ; 52 28-Jul-86    17:10:00  K11RTI.MAC    More TSX+ features, also for PRO
  820. ;                    (I now have a TSX+ system on my
  821. ;                    PRO/350)
  822. ; 52 2X-Jul-86          Numerous    Command line editing and recall,
  823. ;                    use arrow keys to control. Created
  824. ;                    K11EDI.MAC from CLEEDI.MAC
  825. ; 52 2x-Jul-86          K11RT*.MAC    Root size reductions for XM, via
  826. ;                    moving more things into dynamic
  827. ;                    region.  Some things in K11DAT were
  828. ;                    changed to pointers.
  829. ; 51 07-Jul-86    12:31:17  K11PRT.MAC    .TWAIT for packet reads to reduce
  830. ;                    overhead on XM and TSX+
  831. ; 51 13-Jun-86    13:53:05  K11CVT.MAC    Truncate file names for RT-11
  832. ; 51 06-Jun-86    09:52:29  K11RTI.MAC    Alter TSX+ memory allocation
  833. ; 51 06-Jun-86    09:52:57  K11PRT.MAC    Get rid of .HRESET for XC handler
  834. ; 51 04-Jun-86    11:16:07  Misc.        More changes to get K11XM.SAV to run
  835. ;                    in the Foreground on RT-11 V5
  836. ; 51 29-May-86    13:50:00  K11CMD.MAC    Remove first (unneeded) call to SETCC
  837. ;                    so we can wait for XINIT to do a .QSET
  838. ;                    as we need extra one for the control
  839. ;                    C watcher on RT-11.
  840. ; 51 29-May-86    13:46:07  K11RT4.MAC    Add a real control C trap. IE, start a
  841. ;                    watchdog timer to check the terminal
  842. ;                    status word.
  843. ; 51 27-May-86    11:33:23  K11RCO.MAC    Kludge for bug in RT 5.1 XL handler
  844. ; 51 25-May-86    09:33:12  K11RT4.MAC    Move XINIT out into K11RTI.MAC and put
  845. ;              K11RTI.MAC    into an overlay. Also redo the overlay
  846. ;              K11XM.COM    to cut down autoload vectors on RT XM.
  847. ; 51 23-May-86    11:49:44  A few        Allocate ALBUFF at run time
  848. ; 51 23-May-86    10:50:16  K11RCO.MAC    Check for SJ exec having a clock
  849. ; 51 08-May-86    15:54:56  K11RCO.MAC    Rewrote RT-11 connect code
  850. ; 51 08-May-86    13:20:33  K11CM1.MAC    Fix TYPE command for large recordsize
  851. ;                    files
  852. ; 49 28-Mar-86    09:25:10  K11HLP.MAC    Rewrote help routine
  853. ; 49 24-Mar-86    12:16:33  K11ATR.MAC    Fix protocol error for attribute
  854. ;                    packets. See K11INS.DOC and K11.BWR,
  855. ;                    also see K11ATR.MAC
  856. ; 48 13-Mar-86    14:28:10  K11SHO.MAC    SHOW PHONE
  857. ; 47 05-Mar-86    12:48:19  K11PCO.MAC    Trash K11CON, K11RTC is for RT-11
  858. ; 45 20-Feb-86    15:28:56  K11DIA.MAC    Added SET PHONE NUMBER
  859. ;              K11ST0.MAC
  860. ; 45 18-Feb-86    11:14:04  K11ST0.MAC    Added SET DIAL
  861. ; 45 11-Feb-86    12:17:09  K11RT4.MAC    Pass KMON command BYE for server
  862. ;                    logout on TSX+
  863. ; 45 11-Feb-86    12:27:42  K11RTD.MAC    Skip volume verify for LDn:
  864. ; 45 11-Feb-86    12:28:06  K11PRT.MAC    Do a SET CLn LFOUT when closing line
  865. ; 45 10-Feb-86    11:52:21  K11CON.MAC    Removed RT-11 code
  866. ; 45 10-Feb-86    11:30:41  Misc        Final MODS from Steve Heflin
  867. ; 44 07-Feb-86    15:48:45  K11PAK.MAC    Change Steve Heflin's exiting Kermit
  868. ;                    if the wait for SOH reads a contrl Z
  869. ;                    to require TWO ^Zs in a row
  870. ; 44 07-Feb-86    13:58:09  K11DAT.MAC    Data for displaying TIMEOUT count
  871. ;              K11INI.MAC    Display TIMEOUT count
  872. ; 44 04-Feb-86    09:00:12  K11PRT.MAC    Implicit SET CL NOLFOUT for TSX+
  873. ;                    Write SET SPEED code for CL (TSX+)
  874. ; 44 03-Feb-86    12:46:50  K11PRT.MAC    Allow CLn: for TSX+, where N is 0..7
  875. ;              K11DSP.MAC
  876. ; 43 24-Jan-86    16:30:22  K11PRT.MAC    Added SET RT-11 BREAK [SHORT][LONG]
  877. ;              K11DAT.MAC    Short is 275 MS, long is 3 Sec
  878. ;              K11ST0.MAC
  879. ; 43 23-Jan-86    15:58:51  Misc        Added stats for packet and file data
  880. ;                    Also compute data rate in STAT and
  881. ;                    SHO PAC commands
  882. ; 43 17-Jan-86    13:39:50  K11INI.MAC    Clean up SET SEND/RECEIVE and also
  883. ;              K11ST1.MAC    use LONG PACKETS only if the user
  884. ;                    did SET REC PAC > 94
  885. ; 43 17-Jan-86    11:26:01  K11PAK.MAC    Change packet stats into 32. bits
  886. ;              K11INI.MAC    to avoid overflow. Run DOB on SYSLIB
  887. ;              K11DAT.MAC    modules CDDMG, CBTA and SAVRG and
  888. ;              K11SHO.MAC    put them into K11RT4.MAC
  889. ;              K11REC.MAC
  890. ;              K11SEN.MAC
  891. ;              K11RT4.MAC
  892. ; 42 14-Jan-86    13:03:38  K11DIA.MAC    Rixon R212A modem support added
  893. ;                    by Robin Miller of Northern Telecom
  894. ; 42 10-Jan-86    11:43:37  several    LONG packet support
  895. ; 41 31-Dec-85    12:23:53  K11ST1.MAC    Added SET SERVER [NO]TIME_OUT [value]
  896. ;              K11PAK.MAC
  897. ;              K11INI.MAC
  898. ;              K11DAT.MAC
  899. ;              K11SER.MAC
  900. ;              K11DEB.MAC
  901. ; 41 31-Dec-85    04:23:27  K11PRT.MAC    Added support for RT-11 5.2 and DTR
  902. ;                    control
  903. ; 41 28-Dec-85    11:43:52  Numerous    Added Steve Heflin's mods in for AtoZ
  904. ;
  905. ; The following things (edit 40) came up from comments received at F85 Decus
  906. ;
  907. ; 40 18-Dec-85    10:03:57  K11DSP.MAC    Added dummy EP for INQDTR:
  908. ; 40 18-Dec-85    10:03:02  K11ST0.MAC    Print DTR status on SET LINE
  909. ; 40 17-Dec-85    13:20:12  K11DIA.MAC    Added REDIAL ntimes command
  910. ;              K11DAT.MAC    Added global PHNUM for REDIAL command
  911. ; 40 16-Dec-85    15:14:23  K11CVT.MAC    Remove .COM from default binary types
  912. ;
  913. ; 2.39 is the Fall Decus version
  914. ;
  915. ; 39 04-Dec-85    17:58:37  K11DIA.MAC    Modem type data structure mods, see
  916. ;                    K11DIA.MAC for more info
  917. ; 39 03-Dec-85    13:00:14  K11TSX.MAC    More mods to use CONSOLE port on RT-11
  918. ;              K11DSP.MAC    Also, SET LIN TT will override the
  919. ;                    use of XL or MT service
  920. ; 39 30-Nov-85    12:35:44  K11INI.MAC    Send ESC> to force ANSI mode if VT-100
  921. ; 39 14-Nov-85    10:17:15  K11RT4.MAC    Check for XC, XL and MT service.  If
  922. ;                    not present, warn and fake using TSX
  923. ;                    TT code.
  924. ; 38 07-Nov-85    15:13:06  K11RTD.MAC    Rewrite handling for REMOTE DIR server
  925. ;              K11SER.MAC    processing so that we do not fill up
  926. ;                    a file with the directory listing and
  927. ;                    then send the file.  Instead stuff
  928. ;                    GETROUTINE: with &SDODIR.
  929. ; 38 06-Nov-85    16:20:33  K11SER.MAC    Change REM HELP to use asciz sender
  930. ;                    instead of dumping to file and sending
  931. ;                    the file for the extended response
  932. ; 38 06-Nov-85    15:17:36  K11RT4.MAC    Change EPT name GETCR0 to FGETCR0
  933. ; 38 06-Nov-85    15:13:59  K11PAK.MAC    Moved GETCR0 to call actual next_char
  934. ;                    routine via CALL @GETROUTINE so we can
  935. ;                    support the use of alternate routines.
  936. ;                    This allows extended server responses
  937. ;                    to use memory or whatever instead of
  938. ;                    temporary files.
  939. ; 37 05-Nov-85    10:19:47  K11PRT.MAC    Added .TWAIT for 1/3 second in TTYFIN
  940. ;                    to avoid turning the XC/XL driver off
  941. ;                    before all I/O has been sent to host
  942. ; 37 04-Nov-85    17:23:30  K11PRT.MAC    Put back  in the kludges for the lack
  943. ;                    of a clock, which somehow got lost in
  944. ;                    subspace somewhere (RT-11 specific)
  945. ; 37 04-Nov-85    15:25:08  K11PRT.MAC    Various mods for CL handler for TSX+
  946. ;              K11RT4.MAC    to allow the use of 8-BIT mode on the
  947. ;              K11TSX.MAC    handler, also avoid dropping DTR when
  948. ;              K11DSP.MAC    we close CL line. Dummy EPTs stuffed
  949. ;                    in K11TSX for reset @ exit code.
  950. ; 37 04-Nov-85    13:23:52  K11REC.MAC    ensure call to FPARSE for case where
  951. ;                    user says GET remote_name local_name
  952. ; 37 01-Nov-85    10:51:33  K11INI.MAC    Get defensive in RPAR so we can catch
  953. ;                    short SINIT packets better and fix(?)
  954. ;                    them.  Needed for FIDO Kermit.
  955. ; 37 19-Oct-85    17:17:49  K11DIA.MAC    Add DIAL command
  956. ; 37 19-Oct-85    17:00:01  K11ST0.MAC    Added SET MODEM command
  957. ; 36 13-Oct-85    15:27:45  K11SEN.MAC    Fix up control C aborts. Add new state
  958. ;              K11REC.MAC    called STA.CCABORT for processng ctl C
  959. ;                    aborts.
  960. ; 36 10-Oct-85    14:51:33  K11PAK.MAC    Fix call from M$RETRY to ERROR()
  961. ; 36 24-Sep-85    12:29:53  K11SER.MAC    Added REMOTE LOGIN and support for it
  962. ;              K11COM.MAC    in the server
  963. ;              K11CMD.MAC
  964. ;              K11CMD.MAC    Disabled for SEND if wildcarded file
  965. ;              K11SEN.MAC    name and GET filename asfilename
  966. ; 36 17-Sep-85    10:55:06  K11REC.MAC    Allow SEND file asfile
  967. ; 36 17-Sep-85    10:54:11  K11ST0.MAC    Added SET RT-11 CREATE_SIZE value to
  968. ;                    for allocation for small disks on file
  969. ;                    creates, sometimes needed in Kermit-11
  970. ;                    to non Kermit-11 transfers
  971. ; 36 13-Sep-85    12:30:12  K11ST1.MAC    Added SET REC START-OF-PACKET, SET
  972. ;              K11PAK.MAC    SEND START, SET START-OF-PACKET which
  973. ;                    forces both SOPs to same value
  974. ; 36 10-Sep-85    13:38:31  K11ST0.MAC    Added SET RT-11 command, currently as
  975. ;              K11RTD.MAC    SET RT-11 [NO]VOLUME_VERIFY, to skip
  976. ;              K11DAT.MAC    checking systype at offset 760 in the
  977. ;              K11RT4.MAC    directory header for disks. Also added
  978. ;              K11COM.MAC    SET RT-11 [NO]FLOW_CONTROL same as the
  979. ;                    old SET RTFLOW [ON][OFF]
  980. ; 35 01-Sep-85    14:45:33  K11SEN.MAC    Added messages for retry aborts
  981. ; 35 01-Sep-85    14:30:22  K11PAK.MAC    Modified insertion of prompt into
  982. ;                    error messages
  983. ; 35 01-Aug-85    14:15:10  K11CVT.MAC    Fix file names with fubar characters
  984. ;              K11REC.MAC    to be legit (insert "X" into name),
  985. ;                    as in GET abcde_f.dat --> abcdexf.dat
  986. ; 34 29-Jul-85    14:22:28        Mod REM CWD to accept password if
  987. ;                    present, no prompts though
  988. ; 32 02-Jul-85    22:29:34  K11HLP.RNO    Add Doc for modems
  989. ; 32 02-Jul-85    13:44:50  K11CMD.MAC    Added support for CWD and REM CWD
  990. ;              K11SER.MAC    Support for GN$CONNECT (rem cwd)
  991. ;              K11COM.MAC    Added CWD and REM CWD to command lists
  992. ; 32 02-Jul-85    13:14:22  K11INI.MAC    Set pro/350 to 7-bit to avoid multinat
  993. ;                    char sets, use SET CONS 8 to override
  994. ; 32 02-Jul-85    13:02:04  K11PAK.MAC    Insert current prompt into error text
  995. ;                    sent to other system
  996. ;
  997. ; New tape to Columbia      V2.31
  998. ;
  999. ; 31 20-Jun-85    18:42:39  K11SEN.MAC    Update SDATA to not abort on "unknown"
  1000. ;                    packet type
  1001. ; 31 20-Jun-85    18:42:27  K11SHO.MAC    Updated SHOW command
  1002. ; 31 17-Jun-85    15:29:36  K11RT4.MAC    Add .HRESET if device was X?: at exit
  1003. ; 30 01-Jun-85    11:03:30  K11INI.MAC    Mods for SET UPDATE, also set do a SET
  1004. ;                    TERM VT100 for PRO/3xx systems
  1005. ; 30 01-Jun-85    11:02:28  K11ST1.MAC    Added LOGFILE filnam.typ so we can
  1006. ;                    be more compatible (calls SET LOGFILE)
  1007. ; 30 01-Jun-85    11:01:45  K11DAT.MAC    Added BLIP:: for packet logging ala
  1008. ;                    SET UPDATE n.  SET UPD 0 will disable
  1009. ;                    all packet counts to the terminal.
  1010. ; 29 18-May-85    14:17:39  K11SER.MAC    Update packet types to symbolic names
  1011. ; 29 17-May-85    05:08:47  K11ST1.MAC    Add SET FILE [NO]SUPERSEDE to protect
  1012. ;              K11REC.MAC    files that already exists
  1013. ; 29 14-MAY-85    10:26:33  K11INI.MAC    Fix bug for setting 8-bit prefixing
  1014. ;                    Quite noticeable on PRO/RT version
  1015. ; 28 09-May-85    07:40:41  K11RTD.MAC    Add support for server REM DIR command
  1016. ;                    for RT and TSX+
  1017. ; 28 07-May-85    17:40:06  K11TSX.MAC    Final mods by Ned Rhodes for TSX+
  1018. ;              K11PRT.MAC
  1019. ; 28 01-May-85    16:00:01  K11ST1.MAC    Ignore TYPE in SET FILE [TYPE] arg
  1020. ; 28 22-Apr-85    10:34:56  K11RT4.MAC    Kludge if RT system does not have a
  1021. ;                    clock
  1022. ; 28 20-Apr-85    09:22:01  K11ST1.MAC    Added SET BINARY-TYPE .typ for
  1023. ;              K11CVT.MAC    overriding the built-in binary file
  1024. ;                    type list
  1025. ; 27 19-Mar-85    15:59:06  K11SEN.MAC    Fix losing attribute packets in case
  1026. ;                    we timed out or were NAKed
  1027. ; 26 28-Feb-85    14:00:30  K11RT4.MAC    Fixes for TSX+
  1028. ;              K11DSP.MAC
  1029. ;              K11TSX.MAC
  1030. ; 25 29-Jan-85    09:40:22  K11SEN.MAC    Fix things up for ^E,^X and ^Z inter-
  1031. ;              K11REC.MAC    upts on getting and sending files
  1032. ; 25 28-Jan-85    15:30:01  K11SER.MAC    Get rid of embedded CR/LFs in short
  1033. ;                    server reply string
  1034. ; 25 17-Jan-85    10:56:03  K11HLP.HLP    More explanation about BINARY files as
  1035. ;                    there seems to be a lot of confusion
  1036. ;                    about binary file transfer
  1037. ; 25 17-Jan-85    10:52:38  K11DSP  BDN    Clear PROFLG in ASSDEV if SET LINE is
  1038. ;                    done and device is not X?: for RT-11
  1039. ; 25 17-Jan-85    10:51:58  K11SEN  BDN    Added abort (^E,^X & ^Z) for SENDing
  1040. ; 24 09-Nov-84    15:35:17  K11TSX  BDN    Creation from NED RHODE'S mods for TSX
  1041. ; 24 09-Nov-84    15:35:05  K11DSP  BDN    Creation
  1042. ; 24 09-Nov-84    15:32:36  K11RT?  BDN    Virtual overlays for XM, K11DSP to
  1043. ;                    call the correct terminal I/O overlay
  1044. ;                    based on the exec and line type (ie,
  1045. ;                    TSX+ and XC/XL).  We can now AVOID
  1046. ;                    generating a different save image for
  1047. ;                    each config.
  1048. ; 23 25-Oct-84    16:47:20  K11XXX  BDN    This is getting to be a drag having to
  1049. ;                    generate six different versions of the
  1050. ;                    Kermit-11 each time I change something
  1051. ; 23 25-Oct-84    16:46:01  K11CON  BDN    Removed break sending code to specific
  1052. ;                    executive support modules
  1053. ; 23 25-Oct-84    16:45:36  K11PRT  BDN    Real break sending for the PRO/RT-11
  1054. ; 23 25-Oct-84    16:45:11  K11ST1  BDN    SET REPEAT ON/OFF
  1055. ; 23 25-Oct-84    16:44:52  K11PAK  BDN    Repeat count prefixing added
  1056. ; 23 21-Oct-84    16:37:57  K11???  BDN    Got sick of working on PRO/RT-11
  1057. ; 23 21-Oct-84    16:38:36  K11CMD  BDN    Moved printing of banner
  1058. ; 23 21-Oct-84    16:37:16  K11REC  BDN    Added error logging and got all state
  1059. ;                    switches parameterized
  1060. ; 23 21-Oct-84    16:36:51  K11CVT  BDN    Added new file types for binary mode
  1061. ; 23 16-Oct-84    15:32:31  K11CM1  BDN    Removed number of commands from K11CMD
  1062. ;                    to save space for PRO/RT-11 version
  1063. ; 23 15-Oct-84    13:52:09  K11RT?  BDN    Fixed all the .FETCH stuff
  1064. ; 23 15-Oct-84    13:39:22  K11ST1  BDN    Creation-split K11STT in 1/2 for RT-11
  1065. ; 23 15-Oct-84    13:39:22  K11ST0  BDN    Creation-split K11STT in 1/2 for RT-11
  1066. ; 23 15-Oct-84    13:39:05  K11CMD  BDN    Moved C$SET back in
  1067. ; 23 14-Oct-84    16:01:22  K11PRT  BDN    New  module for XC port communications
  1068. ;                    with PRO/RT-11 version 5.1
  1069. ; 23 14-Oct-84    15:20:13  K11SEN  BDN    Creation, split receive and send state
  1070. ;              K11REC    out from K11PAK to save space for  the
  1071. ;                    PRO/RT-11 version of Kermit
  1072. ; 22 14-Aug-84    10:24:23  K11RTU  BDN    Added code for ASCTIM for RT-11 Kermit
  1073. ; 22 14-Aug-84    10:21:51  K11ATR  BDN    Add attribute packet type 41 (8) so we
  1074. ;              K11RT4    send  the receiving Kermit the size of
  1075. ;                    the file.  Need for RT-11 Kermit since
  1076. ;                    RT-11 has to preallocate files.  Could
  1077. ;                    not create file larger than 243 blocks
  1078. ;                    on the PDT150 until this was put in.
  1079. ; 22 10-Aug-84    13:20:31  K11RT4  BDN    Moved ERROR text and error lookup code
  1080. ;              K11RTU    to K11RTE, also moved RT-11 COPY to
  1081. ;                    K11RTU overlay
  1082. ; 22 08-Aug-84    15:50:33  K11RTD  BDN    Change check for RT-11 volume valid
  1083. ;                    from home block offset 730 to 760
  1084. ; 22 03-Aug-84    10:28:54  K11PAK  BDN    Finish code for talking to half duplex
  1085. ;              K11COM    IBM 370 compatible systems.  Added SET
  1086. ;              K11STT    IBM ON/OFF, SET LOCAL ON/OFF.  SET LOC
  1087. ;                    is equivalent to SET DUPLEX FULL/HALF.
  1088. ; 21 30-Jul-84    16:07:44  K11CVT  BDN    Add .EXE and .RTS to binary file list
  1089. ; 21 30-Jul-84    11:17:24  K11PAK  BDN    More work for IBM mode
  1090. ; 21 24-Jul-84    11:35:15  K11RTD  BDN    Extended directory lookup for RT-11 to
  1091. ;                    allow "%" in the file name or type
  1092. ; 21 23-Jul-84    12:47:03  K11DEF  BDN    New module, an .include file to
  1093. ;                    define all the packet types
  1094. ; 21 23-Jul-84    12:32:11  K11SER  BDN    Stuff the default dev into the server
  1095. ;                    extended reply temp file name (needed
  1096. ;                    for RT-11 Kermit)
  1097. ; 21 23-Jul-84    12:31:47  K11RT4  BDN    ensure that we are NOT running under
  1098. ;                    the SJ monitor
  1099. ; 21 19-Jul-84    15:35:00  K11PAK  BDN    Added 8-bit prefixing
  1100. ; 20 19-Jul-84    10:26:57  K11RTU  BDN    Add support for REN, DEL for RT-11 V5
  1101. ; 18 06-Jul-84    15:20:34        Update sent to Frank Da Cruz for fubar
  1102. ;                    RT-11 code with .FETCH and .DSTAT
  1103. ; 18 03-Jul-84    10:16:03  K11INI  BDN    Moved INIT + KERINI from K11CMD.MAC to
  1104. ;                    module (K11INI). Also moved SPAR,RPAR,
  1105. ;                    DSKDMP,FILLOG from K11PAK to here to
  1106. ;                    save space in the root for RT-11
  1107. ; 18 06-Jul-84    12:45:27  K11RT4  BDN    Finally found out that I had the
  1108. ;                    arguments for .DSTAT swapped, which
  1109. ;                    explain why the RT-11 file opens and
  1110. ;                    creates were being so flakey
  1111. ;
  1112. ; 17 22-Jun-84    12:33:15  !!! finally ship new version out to Columbia !!!
  1113. ;
  1114. ; 17 21-Jun-84    19:33:48  K11RT4  BDN    Final RT-11 code modifications
  1115. ; 17 21-Jun-84    16:22:12  K11CMD  BDN    Fix open for takefile (no type arg)
  1116. ; 17 19-Jun-84    18:08:56  misc      BDN    Add wildcard support for RT-11 version
  1117. ; 17 11-Jun-84    11:21:51  K11CVT  BDN    Add code to decide if a file is binary
  1118. ;                    based on the file type (ala .SAV)
  1119. ; 17 10-Jun-84    16:44:50  K11RT4  BDN    Timing bug in file open routine (?)
  1120. ;                    Fix overlay error (K11ATR with K11SUB)
  1121. ; 16 28-May-84    15:55:08  K11PAK  BDN    ensure that BUFEMP does not try to
  1122. ;                    CTL chars that could not have been set
  1123. ;                    Defensive response to CPM Kermit 3.9
  1124. ;                    which ALWAYS sends &s over with the
  1125. ;                    CTL quote, "#".  Note: 20KERMIT does
  1126. ;                    this also. Fix should be in CPM Kermit
  1127. ;                    but it's simple to fix at this end.
  1128. ; 16 28-May-84    09:10:19  K11CMD  BDN    Fix call to TTYRST for Kermit-11/RT
  1129. ; 16 25-May-84    15:39:26  K11STT  BDN    Moved command definitions for the SET
  1130. ;                    command to K11COM.MAC to save space
  1131. ; 16 25-May-84    12:18:08  K11DEB  BDN    Added DISPLAY globalsym command
  1132. ;                    Prints out values in module
  1133. ;                    K11DAT.MAC for debugging purposes
  1134. ; 16 21-May-84    17:01:56  K11PAK  BDN    Don't retry until MAXTRY the SINFO
  1135. ;                    packet since older Kermits will not be
  1136. ;                    able to understand "I" packets.  Old
  1137. ;                    Kermits ALWAYS send NAKS for SINFO.
  1138. ; 16 18-May-84    10:29:02  K11SER  BDN    The code for response to an "R" packet
  1139. ;                    was sending the RMS error text after
  1140. ;                    routine GETNXT already sent err packet
  1141. ; 15 08-May-84    11:15:35  K11PAK  BDN    ensure R0 cleared in BUFEMP in case
  1142. ;                    the data packet was null
  1143. ; 15 06-May-84    11:33:56  K11PAK  BDN    Moved the ACK for the EOF packet to be
  1144. ;                    send AFTER output file is closed.  An
  1145. ;                    occasional RSX problem in the BREAK
  1146. ;                    packet lost due to timing required
  1147. ;                    this mod, though if the line is set up
  1148. ;                    properly this would not be a problem.
  1149. ; 15 01-May-84    11:41:49  K11ATR  BDN    Added support for attribute packets
  1150. ;                    Auto determination of binary mode
  1151. ;                    Support for getting the IFAB data will
  1152. ;                    only work between like Kermits
  1153. ;                    Added SET ATTRIB OFF command to dis-
  1154. ;                    able any attribute sending even if the
  1155. ;                    other Kermit's CAPAS field indicates
  1156. ;                    support of it (ie, handle incompatible
  1157. ;                    protocol versions or bugs)
  1158. ; 14 18-Apr-84    10:40:01  K11PAK  BDN    Mods for deferred file creates to
  1159. ;                    handle attribute packets
  1160. ; 13 04-Apr-84    18:39:38  K11SER  BDN    Calls to SINFO if we expect extended
  1161. ;                    reply from a remote server, required
  1162. ;                    if block checks are type 2 or 3
  1163. ; 13 04-Apr-84    18:37:58  K11CON  BDN    Have X cmd cancel link being XOFF'd
  1164. ;                    by the remote as well as send the
  1165. ;                    remote an XON
  1166. ; 13 04-Apr-84    10:13:32  K11PAK  BDN    Debug logging mods. Added TTXON calls
  1167. ;                    to fix XOFF'd line.  Added SINFO
  1168. ;                    to handle init for expected server
  1169. ;                    reply.
  1170. ; 13 02-Apr-84    11:14:36  K11CON  BDN    Added support for half duplex link
  1171. ;                    added global "duplex" to K11DAT.MAC
  1172. ; 13 30-Mar-84    10:40:35  K11MAC  BDN    Defined a macro for XOR which does not
  1173. ;                    require "XOR reg,dst" format.  It uses
  1174. ;                    4 instructions and will    be needed
  1175. ;                    anyway for the RT-11 version.
  1176. ; 13 30-Mar-84    10:34:02  K11PAK  BDN    Fix extended server replies to work
  1177. ;                    when the checksum is type 2 (12bit
  1178. ;                    arith sum) or type 3 (16 bit CRC)
  1179. ; 13 30-Mar-84    10:31:46  K11PAK  BDN    Added software parity generation. Will
  1180. ;                    be mainly used when connecting out to
  1181. ;                    a remote system that requires parity
  1182. ; 12 20-Mar-84    19:55:15  K11CVT  BDN    New module.  Do executive independent
  1183. ;                    parsing of file specs to return only
  1184. ;                    filename.type.  This will help users
  1185. ;                    who need DAP support.  It's also
  1186. ;                    overlaid into the ERRDVR region.
  1187. ; 12 08-Mar-84    12:33:59  K11CMD  BDN    Added default of ".CMD" for TAKE
  1188. ; 12 08-Mar-84    11:56:14  K11CMD  BDN    Move "remlst" and "cmdlst" into K11COM
  1189. ;                    which is overlaid in the ERROR seg.
  1190. ;                    Added calls to LOACMD + LOAREM to get
  1191. ;                    the overlay with K11COM resident + to
  1192. ;                    return a pointer to the command list.
  1193. ;                    It saves about 3000 (8) bytes in task
  1194. ;                    size.
  1195. ; 12 07-Mar-84    12:28:16  K11TRA  BDN    Added routine to "brute force" a file
  1196. ;                    to a remote line. Needed it to get the
  1197. ;                    new (and not yet done) RT-11 version
  1198. ;                    on RT-11 system being used for test
  1199. ;                    which is, would you believe, a real
  1200. ;                    PDT150
  1201. ; 11 05-Mar-84    10:22:48        Sent version 2.11 to Columbia and DEC
  1202. ; 11 02-Mar-84    11:27:22  K11CMD  BDN    Modified init stuff to look for init
  1203. ;                    file KERMIT.INI in SY: then
  1204. ;                    to try    LB:[1,2], SY:[1,2] and KERMIT:
  1205. ; 10 17-Feb-84    15:08:05  K11CMD  BDN    Did some trial stuff on talking to IBM
  1206. ;                    mainframes, but the CMS Kermit makes
  1207. ;                    things difficult as it can't time out.
  1208. ;                    Added Set Handshake and show for it
  1209. ;                    Not yet done with handshake garbage
  1210. ; 10 17-Feb-84    15:07:14  K11PAK  BDN    Mods for doing ^X and ^Z things
  1211. ; 07 08-Feb-84    15:19:58  K11SER  BDN    Force mode to be remote if to run as a
  1212. ;                    server. Not really needed, but what
  1213. ;                    about doing a SET LINE + then SERVER ?
  1214. ; 06 06-Feb-84    10:34:04  K11PAK  BDN    Added SETTMO to decide receive time
  1215. ;                    out to use based on server timeout,
  1216. ;                    the other Kermit's desired timeout +
  1217. ;                    any timeout set via SET TIMEOUT value
  1218. ; 06 04-Feb-84    11:55:22  K11CMD  BDN    Added local and remote copy, rename
  1219. ; 06 04-Feb-84    11:54:59  K11SER  BDN    Added remote copy and rename support
  1220. ; 06 01-Feb-84    13:07:26  K11CMD  BDN    Local and remote WHO commands
  1221. ; 06 01-Feb-84    13:07:10  K11SER  BDN    Add support for remote WHO command
  1222. ; 06 01-Feb-84    10:37:49  K11SER  BDN    Support remote type in server
  1223. ; 06 01-Feb-84    10:36:27  K11CMD  BDN    Add REMOTE TYPE and added DISK to be
  1224. ;                    same as SPACE
  1225. ; 06 01-Feb-84    10:21:19  K11CMD  BDN    Moved type and rename cmds to K11SHO
  1226. ;                    to space space in the root
  1227. ; 05 31-Jan-84    08:41:03  K11CMD  BDN    Moved SHOW command to K11SHO.MAC, also
  1228. ;                    moved $NAME + COMMAND macros to K11CDF
  1229. ; 05 30-Jan-84    16:38:01  K11SER  BDN    Consolidated remote server command
  1230. ;                    packet sending and creation
  1231. ; 05 30-Jan-84    12:01:41  K11CMD  BDN    Add ERASE, DELETE
  1232. ; 04 27-Jan-84    21:33:21  K11CMD  BDN    Added REM ERASE, also add synonym
  1233. ;                    for SET LOGFILE as LOG_FILE
  1234. ; 04 27-Jan-84    20:02:34  K11HLP  BDN    Fix keyword match to match @ pos 1
  1235. ; 04 27-Jan-84    18:55:44  K11PAK  BDN    If datafield.len < 0 reset checksum
  1236. ;                    type to type "1" in RPACK$
  1237. ; 04 27-Jan-84    18:45:08  K11SER  BDN    Redo support for remote commands
  1238. ; 04 27-Jan-84    18:30:07  K11PAK  BDN    Redo support - extended server replies
  1239. ;
  1240. ; Version 2
  1241. ;
  1242. ; I decided that I would like to have the normal TED timestamp on the edit.
  1243. ;
  1244. ;    03 25-Jan-84  K11HLP    BDN    Finished subtopics for HELP command
  1245. ;    02 18-Jan-84  K11CMD    BDN    Added REMOTE, SPACE and REMOTE SPACE
  1246. ;    02 17-Jan-84  K11CMD    BDN    Added commands NOTE and COMMENT for
  1247. ;                    echoing text from indirect files
  1248. ;    02 17-Jan-84  K11CMD    BDN    Allow open for KERMIT.INI
  1249. ;    02 17-Jan-84  K11PAK    BDN    Allow 12 bit and CRC-CCITT Checksums
  1250. ;                    User should always set the checksum
  1251. ;                    type for both KERMITS
  1252. ;    02 16-Jan-84  K11CMD    BDN    Allow underscore and digits in command
  1253. ;                    names
  1254. ;    02 16-Jan-84  K11PAK    BDN    Redo checksum processing to
  1255. ;                    accommodate 12 bit and CRC types
  1256. ;    02 16-Jan-84  K11CMD    BDN    Add Set Block-Check-Type + SHOW BLOCK
  1257. ;    02 13-Jan-84  K11CMD    BDN    Moved C$HELP to module K11HLP
  1258. ;    02 13-Jan-84  K11CMD    BDN    Added showing speed for SHOW LINE
  1259. ;    02 13-Jan-84  K11CMD    BDN    Added TAKE and @ commands
  1260. ;    02 12-Jan-84  K11PAK    BDN    Fix checking for X, Z in ACK for Sdata
  1261. ;    02 11-Jan-84  K11CMD    BDN    Added RENAME command
  1262. ;    01 08-Jan-84  K11PAK    BDN    Fix .asciz for ERROR: SPACK
  1263. ;    01 08-Jan-84  K11CMD    BDN    Added call to XINIT for initialization
  1264. ;                    based on the operating system
  1265. ;    01 08-Jan-84  K11PAK    BDN    Change timeout to MYTIME from MAXTIME
  1266. ;                    if remote's SINIT packet had a value
  1267. ;                    of zero for the timeout (CMS Kermit?)
  1268. ;    01 08-Jan-84  K11CMD    BDN    fix SET PARITY
  1269.  
  1270.  
  1271.     .include "IN:KRTMAC.MAC"
  1272.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  1273.     .include "IN:KRTDEF.MAC"
  1274.     .iif ndf  MSG$DA  .error    <; .include for IN:KRTDEF.MAC failed>
  1275.  
  1276. .if df    RT11                ; /E64/
  1277.     .mcall    .CMKT    ,.PURGE    ,.RCTRLO,.TWAIT    ; /62/
  1278. .endc    ;RT11                ; /E64/
  1279.  
  1280.  
  1281.     .sbttl    Local data        ; /63/
  1282.  
  1283.     .psect    $pdata
  1284. .if df    RT11                ; /E64/
  1285. fifteen:.word    0 ,15            ; /62/ 15 ticks for .twait
  1286. .endc    ;RT11                ; /E64/
  1287. ;nosub:    .byte    0 ,152            ; /BBS/ disable subprocess access
  1288. ;    .word    'H
  1289. ;    .word    0
  1290. caratc:    .asciz    "^C"<cr><lf>        ; /62/ something to echo
  1291. cmd.01:    .ascii    "Kermit-11 for "    ; for SHOW VERSION
  1292. .if df    RSTS                ; /E64/
  1293.     .asciz    "RSTS/E  "        ; /E64/
  1294. .endc    ;RSTS                ; /E64/
  1295. .if df    RT11                ; /E64/
  1296.     .if df    NONEIS            ; include which
  1297.     .ascii    "NON"            ; instruction set
  1298.     .endc                ; Kermit is using
  1299.     .asciz    "EIS RT-11"
  1300. cmd.02:    .asciz    "XB,XM,ZB,ZM"
  1301. cmd.03:    .asciz    "FB,SB,SJ"
  1302. cmd.04:    .asciz    "/TSX-Plus  "
  1303. .endc    ;RT11                ; /E64/
  1304. cmd.05:    .asciz    " failed at line #"    ; error message
  1305. cmd.06:    .asciz    ':'<cr><lf>'  "'    ; line number tag & top of next line
  1306. cmd.07:    .asciz    '"'<cr><lf>'  '        ; end of line & top of following line
  1307. cmd.08:    .asciz    " closed"<cr><lf>    ; take file is closed
  1308. cmdch:    .asciz    "_ABCDEFGHIJKLMNOPQRSTUVWXYZ-@0123456789." ; /63/ legal chars
  1309. comment:.byte    scolon ,'! ,0        ; /63/ comment delimiters list
  1310.     .even
  1311.  
  1312.  
  1313.     .psect    $code
  1314.     .sbttl    Init the program
  1315.  
  1316. kermit::mov    #stack    ,sp        ; initialize a large stack
  1317. ;    mov    #nosub    ,r0        ; /BBS/ do this for this bbs to
  1318. ;    emt    375            ; /BBS/ prevent leaving until done
  1319. .if df    RSTS                ; /E64/
  1320.     call    drpprv            ; drop temp privs (for RSTS)
  1321.     clr    cccnt            ; clear control C count
  1322.     clr    exstal            ; /41/ Clear exit status now
  1323. .endc    ;RSTS                ; /E64/
  1324.     call    sho$version        ; print version and edit number
  1325.     call    kerini            ; init program, look for KRT.INI
  1326.     tst    sy.ini            ; /BBS/ init file going to run?
  1327.     bne    10$            ; /62/ ya, wait until after it's done
  1328.     call    sho$line        ; /BBS/ no, display default now
  1329. 10$:    call    binini            ; load binary-types list into buffer
  1330.     br    NEW10$            ; /BBS/ skip over ^C's newline
  1331.  
  1332.  
  1333.     .sbttl    CCAST returns here    ; /62/ moved all this to mainline
  1334.  
  1335. .if df    RT11                ; /E64/
  1336. cmdloop::.cmkt    #rtwork    ,#40        ; in case not coming from ccast
  1337.     mov    #stack    ,sp        ; reset the stack
  1338.     .rctrlo                ; ensure TT output is enabled
  1339.     tst    sl.on            ; is SL on?
  1340.     beq    10$            ; no, monitor will echo "^C"
  1341.     wrtall    #caratc            ; ya, print "^C"
  1342. 10$:    clr    xprint            ; kill the print the world facility
  1343.     call    clrcns            ; hose any pending terminal input
  1344.  
  1345.     tst    linksts            ; was link running?
  1346.     beq    30$            ; nope..
  1347.     tst    inprogress        ; packet exchange in progress?
  1348.     beq    20$            ; nope..
  1349.     spack    #msg$error,paknum    ; yes, try to break out of it all
  1350.     .twait    #rtwork    ,#fifteen    ; wait 15 ticks for output completion
  1351.     call    incsta            ; /63/ finish up transfer stats
  1352.     movb    #defchk    ,chktyp        ; reset the checksum type
  1353.     mov    #1    ,chksiz        ; and the size of the checksum
  1354. 20$:    call    clostt            ; close it up
  1355. 30$:    clr    inserv            ; not a server now
  1356.     clr    sertim            ; not waiting for a server command
  1357.     clr    xmode            ; just in case..
  1358.  
  1359.     clr    bufp+0            ; hose TT channel, pointer := 0
  1360.     mov    buflst+0,r4        ; get the buffer address
  1361.     mov    bufsiz+0,r0        ; and size
  1362. 40$:    clrb    (r4)+            ; for i := 1 to bufsiz
  1363.     sob    r0    ,40$        ;   do buffer[i] := chr(0)
  1364.     calls    close    ,<#lun.in>    ; hose input channel
  1365.     clr    inopn            ; reset its flag
  1366.     calls    close    ,<#lun.ou>    ; hose output channel
  1367.     .purge    #lun.ou            ; /62/ in case close chokes..
  1368.     clr    outopn            ; reset its flag
  1369. ; /BBS/    note the log file (lun.log) remains open..
  1370.     calls    close    ,<#lun.ta>    ; hose command file channel
  1371.     clr    cmdlun            ; reset its flag
  1372.     clr    tk.err            ; done with this now
  1373.     clr    sy.ini            ; ditto
  1374.     mov    qu.ini    ,infomsg    ; restore SET TT [NO]QUIET
  1375.     .purge    #lun.sr            ; dump dir search channel
  1376.     clr    dirflg            ; /62/ reset embedded blanks flag
  1377.     .br    NEW10$            ; /63/ fall through to NEW10$
  1378. .endc    ;RT11                ; /E64/
  1379.  
  1380. .if df    RSTS                ; /E64/
  1381. cmdloop::
  1382.     .br    NEW10$            ; /63/ fall through to NEW10$
  1383. .endc    ;RSTS                ; /E64/
  1384.  
  1385.     .sbttl    Kermit main_program_loop
  1386.  
  1387. NEW10$:    clr    cccnt            ; no ^Cs typed yet
  1388.     call    setcc            ; /BBS/ enable ^C test's mark timer
  1389. .if df    RSTS                ; /E64/
  1390.     call    drpprv            ; insure no privs are up now
  1391. .endc    ;RSTS                ; /E64/
  1392.     mov    argbuf    ,argpnt        ; ensure arg pointer is reset
  1393.     call    fixchk            ; restore the SET block check type
  1394.     textsrc                ; /62/ ensure reset to file I/O
  1395.     clr    inprogress        ; /63/ packet xfr no longer active
  1396.     clr    rem.ack            ; /63/ no ACK rec'd for REMOTE cmd
  1397.     clr    xredial            ; /BBS/ hose redial options word
  1398.     clr    status            ; /BBS/ reset take file error status
  1399.     clr    summary            ; /BBS/ reset summary only flag
  1400.     clr    logini            ; /BBS/ reset packet log display flag
  1401.     clr    at$len            ; /BBS/ used to pass file size locally
  1402. .if df    RSTS                ; /E64/
  1403.     clr    at$len+2        ; /E64/  (high word, too)
  1404. .endc    ;RSTS                ; /E64/
  1405.     clr    pf2$ok            ; /BBS/ PF2 can overlay help from here
  1406.     call    getcmd            ; read and parse the command
  1407.     mov    sp    ,pf2$ok        ; /BBS/ so PF2 doesn't eat overlays
  1408.     tst    r0            ; get a valid command?
  1409.     blt    40$            ; no, goto command error handler
  1410.     jsr    pc    ,@cmdadr    ; ya, dispatch to the command
  1411.  
  1412. 10$:    tst    jobtype            ; /62/ command file or detatched job?
  1413.     beq    30$            ; /62/ no
  1414.     bmi    20$            ; /62/ detached, always bail on error
  1415.     tst    exieof            ; /62/ cmd file, does user want out?
  1416.     beq    30$            ; /62/ no, keep Kermit alive..
  1417. 20$:    tst    status            ; /45/ error status ok so far?
  1418.     beq    NEW10$            ; /BBS/ ya
  1419.     tst    cmdlun            ; /62/ no, reading from indirect file?
  1420.     bne    NEW10$            ; ya, do one more loop to dump err msg
  1421.     bisb    #fatal$    ,@#userrb    ; /62/ no, inform rest of the world
  1422.     jmp    c$exit            ; /BBS/ an error occured and exit..
  1423.  
  1424. 30$:    cmp    r0    ,#cmd$ab    ; /62/ ^C typed?
  1425.     bne    NEW10$            ; /62/ no
  1426.     jmp    cmdloop            ; /62/ ya
  1427.  
  1428.  
  1429.     .sbttl    Parse errors or EOF come here
  1430.  
  1431. 40$:    save    <r0>            ; /BBS/ save error from above
  1432.     cmp    r0    ,#cmd$bad    ; /BBS/ come here on ^C/^Z abort?
  1433.     bhi    60$            ; /62/ ya, don't run a take file!
  1434.     mov    cmdbuf    ,r4        ; /BBS/ pointer to command buffer
  1435.     cmpb    #'@    ,(r4)+        ; /BBS/ is it RT-11 style "@COMMAND" ?
  1436.     bne    60$            ; /BBS/ nope
  1437.     tst    (sp)+            ; /BBS/ ya, pop saved error off stack
  1438.     mov    argbuf    ,r0        ; /BBS/ pointer to argument buffer
  1439. 50$:    movb    (r4)+    ,(r0)+        ; /BBS/ copy it in like a command arg
  1440.     bne    50$            ; /BBS/ until the null
  1441.     call    c$take            ; /BBS/ attempt to take it
  1442.     br    10$            ; /BBS/ done..
  1443.  
  1444. ; /BBS/ allow changing default device ala CP/M by entering device name
  1445. ;    requires enabling access control from which names are tested
  1446.  
  1447. 60$: ;    scan    #':    ,cmdbuf        ; /BBS/ find first colon in string
  1448. ;    mov    r0    ,r1        ; /BBS/ save its offset
  1449. ;    strlen    cmdbuf            ; /BBS/ get string length
  1450. ;    tst    r0            ; /BBS/ anybody there?
  1451. ;    beq    90$            ; /BBS/ nope..
  1452. ;    cmp    r0    ,#4        ; /BBS/ more than 4 bytes?
  1453. ;    bgt    90$            ; /BBS/ ya, bail out
  1454. ;    tst    r1            ; /BBS/ is there a colon in cmdbuf?
  1455. ;    beq    70$            ; /BBS/ no, go pop one in..
  1456. ;    cmp    r0    ,r1        ; /BBS/ is first colon also last one?
  1457. ;    bne    90$            ; /BBS/ nope, :: is not allowed..
  1458.  
  1459. ;70$:    add    cmdbuf    ,r0        ; /BBS/ point to end
  1460. ;    cmpb    #':    ,-(r0)        ; /BBS/ is last byte a colon?
  1461. ;    beq    80$            ; /BBS/ ya
  1462. ;    tstb    (r0)+            ; /BBS/ no, back to end of string
  1463. ;    movb    #':    ,(r0)+        ; /BBS/ tag it with a colon
  1464. ;    clrb    @r0            ; /BBS/ reterminate
  1465.  
  1466. ;80$:    calls    fparse    ,<cmdbuf,#errtxt> ; /BBS/ this lets "LD" become "LD0"
  1467. ;    tst    r0            ; /BBS ..is it an authorized dev?
  1468. ;    bne    90$            ; /BBS/ nope..
  1469. ;    tst    (sp)+            ; /BBS/ dump now meaningless error reg
  1470. ;    copyz    #errtxt    ,#defdir,#5    ; /BBS/ modify default dir
  1471. ;    call    sho$yy            ; /BBS/ and display the change
  1472. ;    br    NEW10$            ; /BBS/ back for more..
  1473.  
  1474. 90$:    unsave    <r0>            ; /BBS/ pop err reg from getcmd, etc..
  1475.     cmp    r0    ,#cmd$ex    ; ^Z typed?
  1476.     bne    100$            ; no
  1477.     jmp    c$exit            ; yes, exit normally
  1478.  
  1479. 100$:    cmp    r0    ,#cmd$bad    ; invalid command?
  1480.     bne    110$            ; no
  1481.     direrr    #er$unr            ; /BBS/ ya, print out an error message
  1482.     br    140$            ; /62/ check exit status
  1483.  
  1484. 110$:    cmp    r0    ,#cmd$ab    ; /BBS/ ^C abort?
  1485.     bne    120$            ; /39/ no
  1486.     jmp    cmdloop            ; /BBS/ ya, return to ^C entry point
  1487.  
  1488. 120$:    cmp    r0    ,#cmd$un    ; /39/ not unique?
  1489.     bne    130$            ; /62/ no
  1490.     direrr    #er$amb            ; /BBS/ yes, say so
  1491.     br    140$            ; /62/ check exit status
  1492.  
  1493. 130$:    cmp    r0    ,#cmd$nx    ; /62/ ^Z but don't exit to monitor?
  1494.     beq    NEW10$            ; /62/ ya
  1495.  
  1496. 140$:    tst    jobtype            ; /62/ command file or detatched job?
  1497.     beq    NEW10$            ; /62/ no
  1498.     bmi    150$            ; /62/ detached, always bail on error
  1499.     tst    exieof            ; /62/ cmd file, does user want out?
  1500.     beq    NEW10$            ; /62/ no, keep Kermit alive..
  1501. 150$:    bisb    #fatal$    ,@#userrb    ; /62/ no, inform rest of the world
  1502.     jmp    c$exit            ; /62/ an error occured and exit..
  1503.  
  1504.  
  1505.     .sbttl    SHOW ALL        ; /63/ here to call different overlays
  1506.  
  1507. sho$all::.newline            ; /63/ format display for readability
  1508.     call    sho$a0            ; /63/ this is all to place the modem
  1509.     tst    modtype            ; /63/ (has a modem type been set?)
  1510.     beq    10$            ; /63/ in a good place for SHOW ALL..
  1511.     call    shodia            ; /63/ (ya)
  1512.     .newline            ; /63/ format display
  1513. 10$:    call    sho$a1            ; /63/ do remaining parameters
  1514.     return
  1515.  
  1516.  
  1517.     .sbttl    Kludge to put new code in caller's overlay
  1518.  
  1519. xxsdia::jmp    shodia            ; /62/ SHOW DIAL
  1520.  
  1521.  
  1522.     .sbttl    The FINISH command
  1523.  
  1524. c$fin::    call    ckremote
  1525.     bcs    10$            ; we are remote, abort this
  1526.     call    remfin            ; tell remote server to exit
  1527.     tst    rem.ack            ; /63/ did it work?
  1528.     beq    10$            ; /63/ nope..
  1529.     jmp    c$conn            ; /BBS/ ya, go CONNECT
  1530. 10$:    clr    r0            ; /62/ error already handled
  1531.     return
  1532.  
  1533.  
  1534.     .sbttl    The REMOTE command
  1535.  
  1536. c$rem::    call    ckremote        ; running as remote?
  1537.     bcs    40$            ; nope..
  1538.     call    loarem            ; get the remote command overlay in
  1539.     calls    getcm0    ,<argbuf,r0>    ; and try it please
  1540.     mov    r0    ,r3        ; /BBS/ save the index (can't use r1)
  1541.     bmi    10$            ; /BBS/ didn't find the remote command
  1542.     tst    wasnul            ; /BBS/ were commands listed via "?"
  1543.     bne    40$            ; /BBS/ ya
  1544.     call    loarem            ; get the overlay resident
  1545.     calls    getcm1    ,<argbuf,r0,r3>    ; get any required args for command
  1546.     tst    r0            ; now could we get command arguments?
  1547.     bmi    10$            ; /BBS/ no
  1548.     call    lower            ; /62/ SET FILE NAMING LOWER-CASE?
  1549.     jsr    pc    ,@r1        ; dispatch on it now please
  1550.     jmp    clrcns            ; /62/ flush TT input, clear r0
  1551.  
  1552. 10$:    cmp    r0    ,#cmd$un    ; /BBS/ ambiguous?
  1553.     bne    20$            ; /BBS/ nope..
  1554.     mov    #er$ram    ,r0        ; /62/ really ambiguous REMOTE command
  1555.     br    30$            ; /62/ done
  1556. 20$:    cmp    r0    ,#cmd$bad    ; /BBS/ bad command?
  1557.     bne    40$            ; /62/ no
  1558.     mov    #er$run    ,r0        ; /62/ unrecognizable REMOTE command
  1559. 30$:    direrr    r0            ; /62/ report the error
  1560. 40$:    return
  1561.  
  1562.  
  1563.     .sbttl    REMOTE command sub-routines
  1564.  
  1565. rmtcop::call    gettwo            ; ensure both arguments are here
  1566.     tst    r0            ; are they?
  1567.     bne    10$            ; no, just exit then please
  1568.     call    lower            ; /62/ in case 2d arg came from gettwo
  1569.     call    remcop            ; /62/ attempt the copy operation
  1570. 10$:    return
  1571.  
  1572. rmtren::call    gettwo            ; ensure both arguments are here
  1573.     tst    r0            ; are they?
  1574.     bne    10$            ; no, just exit then please
  1575.     call    lower            ; /62/ in case 2d arg came from gettwo
  1576.     call    remren            ; /62/ attempt the rename operation
  1577. 10$:    return
  1578.  
  1579. ckremo::tst    remote            ; local or remote?  also clears carry
  1580.     beq    10$            ; /63/ 0 means local, carry is clear
  1581.     direrr    #er$not            ; /BBS/ not running as a local Kermit
  1582.     sec                ; which is not ok
  1583. 10$:    return
  1584.  
  1585. lower:    tst    locase            ; /BBS/ SET FIL NAM LOWER-CASE?
  1586.     bne    10$            ; /BBS/ ya, leave it alone
  1587.     upcase    argbuf            ; /BBS/ no, make it upper case
  1588. 10$:    return
  1589.  
  1590.  
  1591.     .sbttl    Shared parse routine    ; /BBS/ almost all new
  1592.  
  1593. isitas::mov    csi.fake,nextone    ; /62/ use fake csi comma parsing?
  1594.     beq    20$            ; /62/ no (also clears nextone..)
  1595.     scan    #comma    ,r1        ; more than one set args supplied?
  1596.     mov    r0    ,nextone    ; save its position in the arg buffer
  1597.     beq    20$            ; no comma found
  1598.     add    r1    ,nextone    ; save pointer to next argument(s)
  1599.     mov    nextone    ,r0        ; copy to
  1600.     clrb    -(r0)            ; put a null where the comma was..
  1601.     tstb    (r1)            ; anything left?
  1602.     bne    10$            ; ya
  1603.     mov    #er$fnm    ,r0        ; no, emit an
  1604.     br    50$            ; error message
  1605. 10$:    mov    sp    ,wasmore    ; for display formatting
  1606. 20$:    calls    fixwild    ,<r1>        ; make "?" into "%"
  1607.     mov    #srcnam    ,r2        ; destination address
  1608.     clrb    asname            ; not renaming yet..
  1609. 30$:    tstb    @r1            ; end of the line today?
  1610.     beq    80$            ; yes, exit this loop
  1611.     cmpb    @r1    ,#space        ; if a space they may have typed
  1612.     beq    40$            ; SEND file asfile
  1613.     movb    (r1)+    ,(r2)+        ; ok so far, copy the name over
  1614.     br    30$            ; next please
  1615. 40$:    clrb    @r2            ; ensure source name .asciz
  1616.     inc    r1            ; found a space in the command line
  1617.     tstb    @r1            ; anything left?
  1618.     beq    80$            ; no
  1619.     calls    iswild    ,<#srcnam>    ; check for wildcarding in name
  1620.     tst    r0            ; can't rename outfile if wildcarded
  1621.     beq    60$            ; no wildcard found
  1622. 50$:    direrr    r0            ; display error..
  1623.     return                ; and return with r0 intact
  1624.  
  1625. 60$:    strcpy    #asname    ,r1        ; 1st arg not wildcard, copy 2nd arg
  1626.     mov    rawfil    ,-(sp)        ; save current setting
  1627.     clr    rawfil            ; enable namcvt
  1628.     calls    namcvt    ,<r1,#spare1>    ; dump everything but "file.typ"
  1629.     tstb    spare1            ; anything left?
  1630.     bne    70$            ; ya, continue
  1631.     calls    namcvt    ,<#srcnam,#spare1> ; no, get inp "file.typ" only
  1632.     calls    fixfil    ,<#spare1,#errtxt> ; truncate rec'd names, send is ok
  1633.     strcat    #asname    ,#errtxt    ; concat in_file_name to out_dev
  1634.  
  1635. 70$:    mov    (sp)+    ,rawfil        ; back to where it wuz..
  1636.     calls    iswild    ,<#asname>    ; ensure file name is ok
  1637.     tst    r0            ; is it?
  1638.     bne    50$            ; no
  1639. 80$:    clrb    @r2            ; ensure source name .asciz
  1640.     return                ; note r0 is cleared by chk.tt, above
  1641.  
  1642. chk.tt::strcpy    #errtxt    ,(r5)        ; /63/ make a temp copy of file name
  1643.     upcase    r0            ; /63/ so it can be upper cased
  1644.     cmpb    #'T&137    ,(r0)+        ; /63/ is first byte an "T" ?
  1645.     bne    10$            ; /63/ nope..
  1646.     cmpb    #'T&137    ,(r0)+        ; /63/ is second byte a "T" ?
  1647.     bne    10$            ; /63/ nope..
  1648.     cmpb    #':    ,(r0)        ; /63/ is "TT" followed by a colon?
  1649.     bne    10$            ; /63/ no
  1650.     mov    #er$ttx    ,r0        ; /63/ ya, must REM TY to do this..
  1651.     return
  1652. 10$:    clr    r0            ; /63/ not TT, thus no problem
  1653.     return
  1654.  
  1655.  
  1656.     .sbttl    Get command from the attached terminal
  1657.  
  1658. ;    G E T C M D
  1659. ;
  1660. ;    input:        written into cmdbuf
  1661. ;    output:     r0    = command index in dispatch table
  1662. ;         r0    = -1 (cmd$bad) for invalid command
  1663. ;              -2 (cmd$ex)  for exit
  1664.  
  1665.     CVTARG    = C.CRLF ! C.LSPA ! C.SSPA ! C.TSPA ; /BBS/ don't upper case
  1666.  
  1667.     ; offsets into command dispatch data table
  1668.     .NAME    =    0    ; command name
  1669.     .MINLE    =    2    ; minimum length of string to match
  1670.     .CMDAD    =    4    ; the command's address
  1671.     .CMDAR    =    6    ; address of prompting string, or 0 if none
  1672.  
  1673. getcmd:    clrb    @argbuf            ; ensure argument buffer is cleared
  1674. 10$:    clr    cmdnum            ; init command index number
  1675. .if df    RT11                ; /E64/
  1676.     .rctrlo                ; /BBS/ be sure one can see what's up
  1677. .endc    ;RT11                ; /E64/
  1678. .if df    RSTS                ; /E64/
  1679.     call    ttrctl            ; /E64/ be sure one can see what's up
  1680. .endc    ;RSTS                ; /E64/
  1681.     mov    cmdbuf    ,r4        ; point to the command buffer
  1682.     calls    readcmd    ,<r4,#prompt>    ; get from current input stream
  1683.     tst    r0            ; and exit if it failed for whatever
  1684.     bne    20$            ; /BBS/ preserve r0, check for ^C, ^Z
  1685.     calls    cvt$$    ,<r4,r1,#cvtarg> ; remove junk
  1686.     tst    r0            ; anything left?
  1687.     beq    10$            ; no, reprompt and try again
  1688.     add    cmdbuf    ,r0        ; ya, point to the end of it all
  1689.     clrb    @r0            ; and make it .asciz
  1690.     mov    sp    ,pf2$ok        ; /BBS/ so PF2 can't eat overlays
  1691.     call    loacmd            ; get the command list overlay
  1692.     calls    getcm0    ,<r4,r0>    ; search for the command
  1693.     mov    r1    ,cmdadr        ; store address of routine away
  1694.     mov    r0    ,cmdnum        ; store index of command away
  1695.     mov    r0    ,r3        ; did we actually find a command?
  1696.     bmi    20$            ; no
  1697.     tst    wasnul            ; /BBS/ were commands listed via "?"
  1698.     bne    20$            ; /BBS/ ya
  1699.     call    loacmd            ; get the command list overlay
  1700.     calls    getcm1    ,<r4,r0,r3>    ; now get the rest of the command line
  1701.     tst    r0            ; or prompt for extra
  1702.     bmi    20$            ; it didn't work
  1703.     mov    cmdnum    ,r0        ; return command number
  1704. 20$:    return
  1705.  
  1706.  
  1707.     .sbttl    Get the next command    ; /BBS/ heavily modified..
  1708.  
  1709. ;    R E A D C M D
  1710. ;
  1711. ;    input:     (r5)    = buffer address
  1712. ;        2(r5)    = prompt address
  1713. ;    output:      r0    = error
  1714. ;          r1    = byte count
  1715.  
  1716. readcmd::mov    r2    ,-(sp)
  1717. 10$:    tst    cmdlun            ; reading from indirect file?
  1718.     bne    20$            ; ya
  1719.     jmp    170$            ; no
  1720. 20$:    tst    tk.err            ; successful last take command?
  1721.     bne    30$            ; nope
  1722.     tst    status            ; check this one too..
  1723.     beq    40$            ; it was ok
  1724. 30$:    tst    infomsg            ; /62/ if TT is not set quiet, the bad
  1725.     bne    110$            ; /62/ cmd line is already displayed
  1726.     br    100$            ; /62/ go do error message(s)
  1727.  
  1728. 40$:    clr    r2            ; /62/ init temp KRT.INI running flag
  1729.     inc    exstal            ; increment command file line number
  1730.     calls    getrec    ,<@r5,#lun.ta,#ln$max> ; /62/ read the record in
  1731.     tst    r0            ; did it work?
  1732.     bne    90$            ; nope..
  1733.     mov    r1    ,r0        ; copy of length
  1734.     add    @r5    ,r0        ; end of record just read
  1735.     clrb    @r0            ; null terminate
  1736.     tst    infomsg            ; echo this?
  1737.     beq    50$            ; no
  1738.     wrtall    2(r5)            ; yes, print the passed prompt
  1739.     wrtall    @r5            ; and also echo the command
  1740.     .newline
  1741.  
  1742. 50$:    tst    r1            ; was anything there?
  1743.     beq    10$            ; no, on to the next one..
  1744.     mov    @r5    ,r2        ; ya, pointer to buffer
  1745. 60$:    scan    (r2)+    ,#comment    ; look for a comment delimiter
  1746.     tst    r0            ; well?
  1747.     bne    70$            ; found one..
  1748.     tstb    @r2            ; anything left to check?
  1749.     bne    60$            ; ya, go try the next char
  1750.     br    80$            ; no, no comments found
  1751.  
  1752. 70$:    clrb    -(r2)            ; zap starting at comment char
  1753.     strlen    @r5            ; get remaining length
  1754.     mov    r0    ,r1        ; save copy
  1755.     beq    10$            ; /62/ nothing remains
  1756. 80$:    clr    r0            ; clear error register and
  1757.     jmp    190$            ; /62/ exit with a successful read
  1758.  
  1759. 90$:    cmp    r0    ,#er$eof    ; hopefully, it's end of file
  1760.     beq    120$            ; yes
  1761.     direrr    r0            ; no, get error message text to errtxt
  1762. 100$:    wrtall    #indnam            ; dump offending file's name
  1763.     wrtall    #cmd.05            ; /63/ " failed at line #"
  1764.     mov    exstal    ,r0        ; load line number
  1765.     call    L10266            ; dump it to TT
  1766.     wrtall    #cmd.06            ; /63/ ':'<cr><lf>'  "'
  1767.     wrtall    @r5            ; append the offending string
  1768.     wrtall    #cmd.07            ; /63/ '"'<cr><lf>'  '
  1769. 110$:    wrtall    #errtxt            ; now dump the error message
  1770.     call    incsts            ; /62/ flag the error here too..
  1771.     .newline
  1772.  
  1773. 120$:    mov    sy.ini    ,r2        ; /62/ from KRT.INI?
  1774.     beq    130$            ; no
  1775.     call    defterm            ; display default, set up TT
  1776.     br    140$            ; and continue
  1777. 130$:    tst    infomsg            ; really print the message?
  1778.     beq    140$            ; no
  1779.     wrtall    #indnam            ; use file name
  1780.     wrtall    #cmd.08            ; /63/ " closed"<cr><lf>
  1781. 140$:    calls    close    ,<#lun.ta>    ; close the file on any errors
  1782.     clr    tk.err            ; /62/ reset the take file error flag
  1783.     clr    cmdlun            ; /62/ next command is comming from TT
  1784.     tst    status            ; /62/ did an error occur?
  1785.     bne    150$            ; /62/ ya
  1786.     tst    r2            ; /62/ no, closing KRT.INI?
  1787.     bne    170$            ; /62/ EOF exit is only for TAKE files
  1788.     tst    exieof            ; /62/ exit at EOF?
  1789.     beq    170$            ; /62/ no
  1790.     mov    #cmd$ex    ,r0        ; /62/ yes, pass a ^Z back to exit
  1791.     br    190$            ; /62/
  1792.  
  1793. 150$:    tst    jobtype            ; /62/ detatched job?
  1794.     bmi    160$            ; /62/ ya, always bail on an error
  1795.     tst    exieof            ; /62/ does user want out?
  1796.     beq    170$            ; /62/ no, keep Kermit alive..
  1797. 160$:    bisb    #fatal$    ,@#userrb    ; /62/ ya, inform rest of the world
  1798.     jmp    c$exit            ; /62/ and exit..
  1799.  
  1800. 170$:    tst    mcrcmd            ; did we ever look for a MCR> command?
  1801.     bne    180$            ; ya, just do a terminal read
  1802.     calls    getmcr    ,<@r5>        ; no MCR> command yet, check for it
  1803.     mov    r0    ,r1        ; did we get any characters there?
  1804.     beq    180$            ; no
  1805.     wrtall    2(r5)            ; print the prompt
  1806.     wrtall    @r5            ; and echo the passed command
  1807.     .newline
  1808.     clr    r0            ; no error
  1809.     br    190$
  1810.  
  1811. 180$:    calls    kbredi    ,<2(r5),@r5>    ; read a record from the terminal
  1812. 190$:    mov    (sp)+    ,r2
  1813.     return
  1814.  
  1815.  
  1816.     .sbttl    Find the command in the table
  1817.  
  1818. ;    G E T C M 0
  1819. ;
  1820. ;    input:     (r5)    = command buffer
  1821. ;        2(r5)    = first command descriptor block
  1822. ;    output:      r0    = command index
  1823. ;          r1    = dispatch address
  1824. ;    errors:      r0    = -1 (cmd$bad)    unrecognized command
  1825. ;              -4 (cmd$un)    command not unique
  1826. ;
  1827. ;    descriptor block:
  1828. ;        .word    address of command name text
  1829. ;        .word    minimum number of name chars to make a match
  1830. ;        .word    address of command subroutine itself
  1831. ;        .word    address of optional argument prompt (null if unused)
  1832.  
  1833. getcm0::save    <r2,r3,r4>
  1834.     clr    wasnul            ; /45/ not null (ie, ?) anymore
  1835.     mov    #4    ,-(sp)        ; /BBS/ number of names per line
  1836.     mov    @r5    ,r1        ; the passed command buffer
  1837.     strlen    r1            ; get the command length
  1838.     mov    r0    ,r3        ; error if nothing is there
  1839.     beq    170$            ; oops
  1840.     cmpb    @r1    ,#'?        ; /45/ help desired today?
  1841.     bne    90$            ; /45/ no
  1842.     mov    2(r5)    ,r4        ; /45/ yes, get start of list
  1843.  
  1844. 10$:    mov    .name(r4),r1        ; /45/ anything to dump?
  1845.     beq    70$            ; /BBS/ no, exit
  1846.  
  1847.     ; /BBS/ this does 4 columns across the screen, ala VMS help..
  1848. 20$:    strlen    r1            ; compute the padding to next column
  1849.     mov    r0    ,r3        ; get copy of length
  1850. 30$:    sub    #18.    ,r3        ; assume worst case 18. spaces needed
  1851.     neg    r3            ; we now have the number of spaces
  1852.     bgt    40$            ; that is, if it's a positive number
  1853.     inc    r3            ; add in leading blank missed at 40$
  1854.     neg    r3            ; preset for looping into next column
  1855.     dec    (sp)            ; is there a next column to overwrite?
  1856.     bne    30$            ; yes, pad to end of it
  1857.     .newline            ; no, goto a new line
  1858.     mov    #4    ,(sp)        ; reset the counter now
  1859.     br    20$            ; and start fresh again..
  1860. 40$:    mov    #space    ,r0        ; load a space
  1861.     call    writ1ch            ; dump it to TT
  1862.     wrtall    r1            ; add on the current name
  1863.     add    #$listl*2,r4        ; bump to the next entry
  1864.     dec    (sp)            ; is there room left for the next one?
  1865.     beq    60$            ; nope
  1866.     mov    #space    ,r0        ; load a space
  1867. 50$:    call    writ1ch            ; dump it to TT
  1868.     sob    r3    ,50$        ; until padded to length of 18. bytes
  1869.     br    10$            ; then back for more
  1870. 60$:    .newline
  1871.     mov    #4    ,(sp)        ; reset the counter now
  1872.     br    10$            ; back for more
  1873. 70$:    cmp    #4    ,(sp)        ; is the current line blank?
  1874.     beq    80$            ; ya, skip the extra blank line
  1875.     .newline            ; no, do a newline
  1876.  
  1877. 80$:    mov    #nulcmd    ,r1        ; /45/ no, return nulcmd
  1878.     mov    sp    ,wasnul        ; /45/ flag as having been null
  1879.     clr    r0            ; /45/ no errors from getcm0
  1880.     br    180$            ; that's it
  1881.  
  1882. 90$:    clr    r2            ; length := 0
  1883.     upone    r1            ; /BBS/ upcase for the search..
  1884. 100$:    scan    (r1)    ,#cmdch        ; /63/ is this character ok in name?
  1885.     dec    r0            ; /63/ find it in the list?
  1886.     blt    120$            ; /63/ no, it must be a delimiter
  1887.     bgt    110$            ; /63/ ya, and it's not a "_"
  1888.     movb    #'-    ,(r1)        ; /63/ convert "_" to "-"
  1889. 110$:    inc    r1            ; /63/ next time check the next char
  1890.     inc    r2            ; command name length so far
  1891.     sob    r3    ,100$        ; next
  1892.  
  1893. 120$:    tst    r2            ; anything useful in command line?
  1894.     ble    170$            ; no
  1895.     mov    2(r5)    ,r4        ; the list of edit commands
  1896.     clr    r3            ; r3 will have the command number
  1897.  
  1898. 130$:    tst    .name(r4)        ; anything left in the command list?
  1899.     beq    170$            ; no
  1900.     strlen    .name(r4)        ; get the length of the command name
  1901.     calls    instr, <.name(r4),r0,@r5,r2> ; the next command?
  1902.     cmp    r0    ,#1        ; /39/ find anything?
  1903.     bne    140$            ; /39/ no
  1904.     mov    r0    ,@sp        ; /39/ save it
  1905. 140$:    cmpb    r2    ,.minle(r4)    ; check if command length is ok
  1906.     blo    150$            ; no, not enough for the command
  1907.      dec    r0            ; if match = position 1 we have
  1908.      beq    160$            ; found the command
  1909. 150$:    inc    r3            ; commandnum := commandnum + 1
  1910.     add    #$listl*2,r4        ; cmdsaddr   := succ(cmdsaddr)
  1911.     br    130$            ; try again..
  1912.  
  1913. 160$:    mov    r3    ,r0        ; return command index and
  1914.     mov    .cmdad(r4),r1        ; the command address
  1915.     br    180$
  1916.  
  1917. 170$:    mov    #cmd$ba    ,r0        ; bad command
  1918.     dec    @sp            ; /39/ command not unique?
  1919.     bne    180$            ; /39/ no
  1920.     mov    #cmd$un    ,r0        ; /39/ yes, say so
  1921. 180$:    tst    (sp)+
  1922.     unsave    <r4,r3,r2>
  1923.     return
  1924.  
  1925.  
  1926.     .sbttl    Check for additional input needed
  1927.  
  1928. ;    G E T C M 1
  1929. ;
  1930. ;    input:     (r5)    = current command buffer
  1931. ;        2(r5)    = command table address
  1932. ;        4(r5)    = index of the current command
  1933. ;
  1934. ;    output:      r0    = index of current command or < 0 for error
  1935. ;        argbuf    = any additional input or rest of the command line
  1936.  
  1937. getcm1::save    <r1,r2,r3>
  1938.     sub    #ln$max+2,sp        ; /BBS/ allocate a small buffer for
  1939.     mov    sp    ,r2        ; /55/ saving the command prompt
  1940.     tst    wasnul            ; /45/ was the command for ?
  1941.     beq    10$            ; /45/ no
  1942.     clr    wasnul            ; /45/ not null anymore
  1943.     clr    r0            ; /45/ yes, return index 0
  1944.     br    60$            ; /45/ exit
  1945. 10$:    mov    @r5    ,r1        ; get command line address
  1946.     scan    #space    ,r1        ; look for a delimiter between
  1947.     tst    r0            ; the command name and its argument
  1948.     beq    20$            ; nothing there
  1949.     add    r1    ,r0        ; point to the string after the space
  1950.     copyz    r0 ,argbuf ,#ln$max    ; /BBS/ copy the command arg over
  1951.     br    40$            ; done
  1952.  
  1953. 20$:    clrb    @argbuf            ; /BBS/ don't mistake arg0 for arg1 !
  1954.     mov    4(r5)      ,r3        ; get the command index
  1955.     mul    #$listl*2 ,r3        ; if no arg given see if one is needed
  1956.     add    2(r5)      ,r3        ; add in base address of command table
  1957.     mov    .cmdar(r3),r3        ; get the argument prompt now
  1958.     beq    40$            ; /63/ no arg prompt for this command
  1959.     strcpy    r2    ,r3        ; /55/ copy the prompt over now
  1960. 30$:    calls    kbredi    ,<r2,argbuf>    ; /55/ read a command from keyboard
  1961.     tst    r0            ; get anything?
  1962.     bne    50$            ; read failed or ^C or ^Z typed
  1963.     calls    cvt$$,<argbuf,r1,#cvtarg> ; remove junk
  1964.     tst    r0            ; is there anything left?
  1965.     beq    30$            ; no, reprompt and try again
  1966.     mov    r0    ,r1        ; something is left, point to the
  1967.     add    argbuf    ,r1        ; end of the line
  1968.     clrb    @r1            ; null terminate
  1969. 40$:    mov    4(r5)    ,r0        ; /62/ return command index
  1970.     br    60$
  1971.  
  1972. 50$:    cmp    r0    ,#cmd$ex    ; /62/ was ^Z typed?
  1973.     bne    60$            ; /62/ no
  1974.     mov    #cmd$nx    ,r0        ; /62/ ya, don't exit pgm from here
  1975. 60$:    add    #ln$max+2,sp        ; /BBS/ pop the temp buffer
  1976.     unsave    <r3,r2,r1>
  1977.     return
  1978.  
  1979.  
  1980.     .sbttl    Null command, do nothing..
  1981.  
  1982. nulcmd:    clr    r0            ; /45/ no errors
  1983.     return
  1984.  
  1985.  
  1986.     .sbttl    SHOW VERSION        ; /63/ here so server can also call it
  1987.  
  1988. sho$ve::calls    get$ve    ,<#spare1>    ; separate this from the actual
  1989.     wrtall    #spare1            ; version string build so the
  1990.     return                ; server can get the same string..
  1991.  
  1992. get$ve::strcpy    (r5)    ,#cmd.01    ; /63/ display name, instruction set
  1993. .if df    RT11                ; /E64/
  1994.     tst    imgtyp            ; virtual overlay image running?
  1995.     beq    10$            ; no
  1996.     strcat    r0    ,#cmd.02    ; /63/ ya, say so
  1997.     br    20$
  1998. 10$:    strcat    r0    ,#cmd.03    ; /63/ it's the low memory image
  1999. 20$:    strcat    r0    ,#cmd.04    ; /63/ tag with "/TSX-Plus  "
  2000. .endc    ;RT11                ; /E64/
  2001.     strcat    r0    ,#sho.ve    ; release, ver, last edit date
  2002.     return                ; /63/ note that the returned string's
  2003.                     ; length must not exceed LN$MAX bytes
  2004.     .end    kermit
  2005.