home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11cmd.mac < prev    next >
Text File  |  2020-01-01  |  69KB  |  1,821 lines

  1.     .title    k11cmd    command level for kermit-11
  2.     .ident    /3.60/
  3.     .enabl    gbl
  4.  
  5.     baselev    ==    3        ; baseline level
  6.     edit    ==    60.        ; edit (independent of base_level)
  7.     release    ==    'T&137        ; T for test, V for release
  8.  
  9.     .save
  10.     .psect    ident    ,ro,d,gbl,rel,con
  11. lasted::.ascii    /  Last edit: 21-Mar-89 /
  12.     .ascii    / /
  13.     .byte    0
  14.     .even
  15. ident::    .word    baselev,edit,release
  16.     .psect    $pdata
  17. do$ver::.word    1
  18. do$exi::.word    1
  19. do$lng::.word    1
  20. umddef::.word    usermd
  21. warn$::    .byte    CR,LF
  22.     .ascii    /Check SHOW RELEASE_NOTES for possible incompatabilities/
  23.     .byte    CR,LF
  24.     .ascii    /with previous releases of Kermit-11 and other Kermits./
  25.     .byte    CR,LF,0
  26. $beep2:    .byte    CR,LF,7,7,0
  27.     .even    
  28.     .restore
  29.  
  30.     .macro    BEEP2
  31.     PRINT    #$beep2
  32.     .endm    BEEP2
  33.  
  34.  
  35. ;    Brian Nelson  01-Dec-83  13:19:14
  36. ;
  37. ;    Change Software, Toledo, Ohio
  38. ;    University of Toledo, Toledo, Ohio
  39. ;
  40. ;    Copyright (C) 1983   Change Software, Inc.
  41. ;
  42. ;    edits:
  43. ;
  44. ; 60 21-Mar-89  00:00:00  K11M41.MAC    For RSX, ensure Kermit is privileged
  45. ;              K11MCO.MAC    before performing SF.SMC to remote
  46. ;              K11DIA.MAC    port; failure to do so will crash M+
  47. ;                    V4.0.  Also added local terminal
  48. ;                    buffering to RSX connect module.
  49. ;                    Completed definition of DF224 modem.
  50. ; 59 12-Oct-87  08:55:33  K11ATR.MAC    Support attribute packet type 54(8)
  51. ;              K11RMS.MAC    to send files11 protection over. If
  52. ;                    RSTS, convert to/from F11 format.
  53. ; 59 17-Sep-87  15:28:36  K11SER.MAC    Fix processing of server cwd cmd.
  54. ; 58 14-Aug-87  08:19:24  K11ECO.MAC    SET LINE TTN:/[NO]ALLOCATE, added
  55. ;              K11ST1.MAC    mostly for RSTS/E
  56. ; 56 23-Jun-87  07:41:18  K11PRT.MAC    Fix sending break for XL on RT11
  57. ; 56 13-Mar-87  13:18:18  K11RMS.MAC    Dynamically allocate the command
  58. ;              K11M41.MAC    line buffer count set by TKB via
  59. ;              K11E80.MAC    GBLDEF=LNCNT$:nn. This allows us
  60. ;                    to have > 3 for the I/D tasks.
  61. ; 56 19-Feb-87  15:58:58  All sources    Use teco macro to change all the
  62. ;                    .INCLUDES to be conditional, this
  63. ;                    was done to allow assembly on RT11
  64. ;                    version 4 and P/OS.
  65. ; 56 17-Feb-87  09:35:04  K11RMS    Redo record buffer allocation to
  66. ;                    be dynamic at startup. Set MAXSIZ
  67. ;                    during task build to allow bigger
  68. ;                    buffers for I/D space Kermit11.
  69. ; 56 09-Dec-86  14:15:23  K11INI.MAC    Control A stats support.
  70. ;              K11REC.MAC
  71. ;              K11SEN.MAC
  72. ; 56 06-Nov-86  08:27:33  K11M41.MAC    IO.WAL for tt output with CLE
  73. ; 56 06-Nov-86  08:27:54  K11SHO.MAC    Fix command macro list (SHO ?)
  74. ; 55 23-Oct-86  11:00:59  K11CMD.MAC    Prompting bug for RT11 XM overlay
  75. ; 54 30-Sep-86  13:24:07        SHOW DIAL
  76. ; 54 29-Sep-86  10:23:49  Numerous    Fix sources for possible I/D space
  77. ;                    linking under RSTS/E and RSX11M+.
  78. ; 54 23-Sep-86  16:28:14  K11DIA.MAC    Support VADIC 4224 .v22bis modem
  79. ; 54 23-Sep-86  16:28:46  K11ST0.MAC    SET PHONE TONE/PULSE and SET PHONE
  80. ;                    BLIND, added for VA4224 support.
  81. ; 54 10-Sep-86  11:22:52  K11M41.MAC    Fix setting of typeahead buffer
  82. ;                    size for M+, ie, move the TC.TBS
  83. ;                    to a point AFTER the TC.RAT.
  84. ; 54 09-Sep-86  16:01:27  K11ST1.MAC    SET FILE NAMING/NAMES option
  85. ;              K11CVT.MAC    Options are: LITERAL, CONVERTED
  86. ;              K11DAT.MAC                 FULL, UNTRANSLATED
  87. ; 54 23-Aug-86  12:37:09  K11E80.MAC    Had to cut some code from K11E80 and
  88. ;              K1180S.MAC    K11M41, moved to K1180S and K11RMZ
  89. ;              K11M41.MAC    respectively so the task images don't
  90. ;                      cross the 130000 high limit boundary.
  91. ;                    Caused by adding in extra XAB's.
  92. ; 54 22-Aug-86  14:36:44  K11RMS.MAC    Added in Date XAB's per a user request
  93. ;                    Ultimate goal: to send attribute paks
  94. ;                    with creation date/time.
  95. ; 53 13-Aug-86  09:38:04  K11PAK.MAC    Add SET SEN [NO]XON so one can force
  96. ;              K11ST1.MAC    every packet sent to be prefixed with
  97. ;              K11DAT.MAC    an XON. Perhaps this will help for
  98. ;                    the DHV/U problems with flow control.
  99. ; 53 12-Aug-86  16:28:14  K11PAK.MAC    Fix BUFUNP to process repeat counts.
  100. ;              K11SER.MAC    It would seem the 2.29 of MS Kermit
  101. ;              K11REC.MAC    is prefixing filename in F packets.
  102. ; 53 12-Aug-86  11:08:13  K11M41.MAC    IO.GTS to check for extended I/O
  103. ;                    Also check TC.PAR
  104. ; 53 12-Aug-86  11:05:03  K11CMD.MAC    Allow ; and ! to delimit comments.
  105. ; 53 07-Aug-86  08:40:36  K11RCO.MAC    Minor changes to connect under RT11
  106. ;              K11PRT.MAC    SJ without timer support. This was
  107. ;                    done AGAINST my better judgement.
  108. ; 53 05-Aug-86  19:35:19  Many        Make CMDBUF and ARGBUF pointers to
  109. ;                    the actual data in order to reduce
  110. ;                    the K11XM and K11RT4 sizes to help
  111. ;                    in SRUN or FRUN's. Add code to re-
  112. ;                    locate some PIC code into dynamic
  113. ;                    region based from APR7 for RT11.
  114. ; 53 29-Jul-86  13:10:34  K11ST1.MAC    Add SET FIL TYP DEC_MULTINATIONAL
  115. ;                    to allow 8bit text files. The mod
  116. ;                    to K11ATR was to add support for
  117. ;                    this between two 3.53 or later K11
  118. ;                    systems.
  119. ; 53 29-Jul-86  12:58:38  K11ATR.MAC    Modified attribute  type '0' to
  120. ;                    allow types other than IFABs. It
  121. ;                    is backwards compatible with old
  122. ;                    versions of Kermit-11.
  123. ; 52 28-Jul-86  17:10:00  K11RTI.MAC    More TSX+ features, also for PRO.
  124. ;                    (I know have a TSX+ system on my
  125. ;                    PRO/350).
  126. ; 52 2X-Jul-86          Numerous    Command line editing and recall,
  127. ;                    use arrow keys to control. Created
  128. ;                    K11EDI.MAC from CLEEDI.MAC
  129. ; 52 2x-Jul-86          K11RT*.MAC    Root size reductions for XM, via
  130. ;                    moving more things into dynamic
  131. ;                    region. Affected K11RMS, K11M41,
  132. ;                    K11E80 and K11DAT also as some
  133. ;                    things in K11DAT were changed to
  134. ;                    pointers.
  135. ; 51 07-Jul-86  12:31:17  K11PRT.MAC    .TWAIT for packet reads to reduce
  136. ;                    overhead on XM and TSX+
  137. ; 51 03-Jun-86  12:00:43  K11M41.MAC    Support for IO.EIO
  138. ; 51 13-Jun-86  13:53:05  K11CVT.MAC    Truncate filenames for RT11
  139. ; 51 06-Jun-86  09:52:29  K11RTI.MAC    Alter TSX+ memory allocation
  140. ; 51 06-Jun-86  09:52:57  K11PRT.MAC    Get rid of .HRESET for XC handler
  141. ; 51 04-Jun-86  11:16:07  Misc.        More changes to get K11XM.SAV to run
  142. ;                    in the Foreground on RT11 v5.
  143. ; 51 29-May-86  13:50:00  K11CMD.MAC    Remove first (unneeded) call to SETCC
  144. ;                    so we can wait for XINIT to do a .QSET
  145. ;                    as we need extra one for the control
  146. ;                    C watcher on RT11.
  147. ; 51 29-May-86  13:46:07  K11RT4.MAC    Add a real control C trap. IE, start a
  148. ;                    watchdog timer to check the terminal
  149. ;                    status word.
  150. ; 51 27-May-86  11:33:23  K11RCO.MAC    Kludge for bug in the RT 5.1 XL handler
  151. ; 51 25-May-86  09:33:12  K11RT4.MAC    Move XINIT out into K11RTI.MAC and put
  152. ;              K11RTI.MAC    into an overlay. Also redo the overlay
  153. ;              K11XM.COM    to cut down autoload vectors on RT XM.
  154. ; 51 23-May-86  11:49:44  A few        Allocate ALBUFF at run time.
  155. ; 51 23-May-86  10:50:16  K11RCO.MAC    Check for SJ exec having a clock
  156. ; 51 08-May-86  15:54:56  K11RCO.MAC    Rewrote RT11 connect code.
  157. ; 51 08-May-86  13:20:33  K11CM1.MAC    Fix TYPE command for large recordsize
  158. ;                    files.
  159. ; 50 04-Apr-86    19:59:36  K11M41.MAC    Enable echoing for local terminal in
  160. ;                    case of task abort w/o characteristics
  161. ;                    getting reset.
  162. ; 50 04-Apr-86    19:57:27  K11PCO.MAC    Look for spawning PRO/COMM if PROCOM
  163. ;              K11DAT.MAC    global ne 0. Set via SET POS [NO]DTE
  164. ;              K11ST0.MAC    and via tkb GBLPAT option. SET code
  165. ;              K11STD.MAC    in K11ST0, cmd def in K11STD.
  166. ; 50 02-Apr-86    15:53:27  K11ECO.MAC    Rewrote RSTS/E connect code for speed
  167. ; 49 28-Mar-86    09:25:10  K11HLP.MAC    Rewrote help routine
  168. ; 49 24-Mar-86    12:16:33  K11ATR.MAC    Fix protocol error for attribute
  169. ;                    packets. See K11INS.DOC and K11.BWR,
  170. ;                    also see K11ATR.MAC
  171. ; 48 21-Mar-86    16:54:53  K11DIA.MAC    Don't go to sleep for 2 secs after
  172. ;                    successfull connection unless M or M+
  173. ; 48 21-Mar-86    16:54:26  K11PCO.MAC    Extend flushing of XOFFS to P/OS
  174. ; 48 13-Mar-86    14:28:10  K11SHO.MAC    SHOW PHONE
  175. ; 48 17-Mar-86    13:22:19  K11ECO.MAC    Ignore XOFF's from connected host.
  176. ;                    (have a fubarred DHU11 on my 785).
  177. ; 47 07-Mar-86    18:17:30  K11RMS.MAC    BINFIL return(text) for FB$FTN files
  178. ;                    This means that FD.FTN files will be
  179. ;                    converted to text files.
  180. ; 47 05-Mar-86    12:48:19  K11PCO.MAC    Trash K11CON, K11PCO is for P/OS,
  181. ;                    K11RXY is for RSX, K11ECO RSTS/E,
  182. ;                    K11RTC RT11.
  183. ; 46 21-Feb-86    11:45:01  K11RMS.MAC    Add TLOG$S call to see if the
  184. ;                    filespec is a logical name.
  185. ; 45 20-Feb-86    15:28:56  K11DIA.MAC    Added SET PHONE NUMBER
  186. ;              K11ST0.MAC
  187. ; 45 18-Feb-86    11:14:04  K11ST0.MAC    Added SET DIAL
  188. ; 45 14-Feb-86    13:46:55  K11E80.MAC    Modify RSTS packet reader to cancel
  189. ;                    XOFF'ed line, requires SYSIO priv.
  190. ; 45 12-Feb-86    16:56:35  K11M41.MAC    Find out terminal type for RSX & POS
  191. ; 45 11-Feb-86    12:17:09  K11RT4.MAC    Pass kmon command BYE for server
  192. ;                    logout on TSX+
  193. ; 45 11-Feb-86    12:27:42  K11RTD.MAC    Skip volume verify for LDn:
  194. ; 45 11-Feb-86    12:28:06  K11PRT.MAC    Do s SET CLn LFOUT when closing line
  195. ; 45 11-Feb-86    15:44:36  K11E80.MAC    Rewrote support for SERVER logout to
  196. ;                    use RSTS/E v9 features, also hangup
  197. ;                    line if logout will succeed.
  198. ; 45 10-Feb-86    11:56:37  K11ECO.MAC    Creation, RSTS/E ONLY connect code.
  199. ; 45 10-Feb-86    11:52:21  K11CON.MAC    Removed RSTS/E and RT11 code
  200. ; 45 10-Feb-86    11:30:41  Misc        Final MODS from Steve Heflin
  201. ; 44 08-Feb-86    06:13:26  K11RXY.MAC    Added Robin Miller's new high speed
  202. ;                    connect code as SET RSX CONNECT ALT
  203. ; 44 07-Feb-86    16:02:52  K11M41.MAC    Follow Heflin's EXST$S with EXIT$S
  204. ; 44 07-Feb-86    16:00:00  K11E80.MAC    Try to UNDO DEC's feature of turning
  205. ;                    C1 characters into ESCAPE sequences.
  206. ; 44 07-Feb-86    15:48:45  K11PAK.MAC    Change Steve Heflin's exiting Kermit
  207. ;                    if the wait for SOH reads a contrl Z
  208. ;                    to require TWO control Z's in a row.
  209. ; 44 07-Feb-86    13:58:09  K11DAT.MAC    Data for displaying TIMEOUT count
  210. ;              K11INI.MAC    Display TIMEOUT count
  211. ; 44 04-Feb-86    09:00:12  K11PRT.MAC    Implicit SET CL NOLFOUT for TSX+
  212. ;                    Write SET SPEED code for CL (TSX+)
  213. ; 44 03-Feb-86    12:46:50  K11PRT.MAC    Allow CLn: for TSX+, where N is 0..7
  214. ;              K11DSP.MAC
  215. ; 43 24-Jan-86    16:30:22  K11PRT.MAC    Added SET RT11 BREAK [SHORT][LONG]
  216. ;              K11DAT.MAC    Short is 275 MS, long is 3 Sec.
  217. ;              K11ST0.MAC
  218. ; 43 24-Jan-86    14:42:32  K11RMZ.MAC    Creation from K11RMS. Root segment
  219. ;                    was getting too large.
  220. ;              K11CPY.MAC    Reduce buffer size, module too large
  221. ; 43 23-Jan-86    15:58:51  Misc        Added stats for packet and file data
  222. ;                    Also compute data rate in STAT    and
  223. ;                    SHO PAC commands.
  224. ; 43 17-Jan-86    13:39:50  K11INI.MAC    Clean up SET SEND/RECEIVE and also
  225. ;              K11ST1.MAC    use LONG PACKETS only if the user
  226. ;                    did SET REC PAC > 94
  227. ; 43 17-Jan-86    11:26:01  K11PAK.MAC    Change packet stats into 32 bits
  228. ;              K11INI.MAC    to avoid overflow. Run DOB on SYSLIB
  229. ;              K11DAT.MAC    modules CDDMG, CBTA and SAVRG and
  230. ;              K11SHO.MAC    put them into K11RT4.MAC
  231. ;              K11REC.MAC
  232. ;              K11SEN.MAC
  233. ;              K11RT4.MAC
  234. ; 42 14-Jan-86    13:03:38  K11DIA.MAC    Rixon R212A modem support added
  235. ;                    by Robin Miller of Nothern Telecom
  236. ; 42 10-Jan-86    11:43:37  several    LONG packet support.
  237. ; 41 31-Dec-85    12:23:53  K11ST1.MAC    Added SET SERVER [NO]TIME_OUT [value]
  238. ;              K11PAK.MAC
  239. ;              K11INI.MAC
  240. ;              K11DAT.MAC
  241. ;              K11SER.MAC
  242. ;              K11DEB.MAC
  243. ; 41 31-Dec-85    04:23:27  K11PRT.MAC    Added support for RT11 5.2 and DTR
  244. ;                    control.
  245. ; 41 28-Dec-85    11:43:52  Numerous    Added Steve Heflin's mods in for AtoZ
  246. ;
  247. ; The following things (edit 40) came up from comments received at F85 Decus
  248. ;
  249. ; 40 18-Dec-85    10:03:57  K11DSP.MAC    Added dummy EP for INQDTR:
  250. ;
  251. ; 40 18-Dec-85    10:03:35  K11M41.MAC    Added dummy EP for INQDTR:
  252. ; 40 18-Dec-85    10:03:02  K11ST0.MAC    Print DTR status on SET LINE
  253. ; 40 18-Dec-85    10:01:55  K11E80.MAC    Add routine to find out if line has DTR
  254. ;                    up. RSTS/E normally keeps DTR low, it
  255. ;                    raises it on seeing CD or RING. Only
  256. ;                    works on 9.x or later.
  257. ; 40 17-Dec-85    18:24:53  K11E80.MAC    Redo of RSTS/E v9.x options regarding
  258. ;                    setting typeahead (small buffer quota)
  259. ;                    i.e., save and restore it please.
  260. ; 40 17-Dec-85    13:39:06  K11M41.MAC    Added mods by Robin Miller for logical
  261. ;                    names for terminals, also checks for
  262. ;                    SET LIN TTn: for TTn: having someone
  263. ;                    logged in. (RSX11M/M+ only)
  264. ; 40 17-Dec-85    13:20:12  K11DIA.MAC    Added REDIAL ntimes command.
  265. ;              K11DAT.MAC    Added global PHNUM for REDIAL command
  266. ; 40 16-Dec-85    15:14:23  K11CVT.MAC    Remove .COM from default binary types
  267. ;                    Re: Bernie Eiben's "QAR". Very much
  268. ;                    a PAIN if one edits VMS com files on
  269. ;                    the PRO.
  270. ; 40 16-Dec-85    15:13:19  K11M41.MAC    Start timer on packet writes to clear
  271. ;                    things in case we got XOFF'ed
  272. ;
  273. ; 2.39 is the Fall Decus version
  274. ;
  275. ; 39 06-Dec-85    11:57:58  K11DIA.MAC    Support for calling external routine
  276. ;              K11M41.MAC    to dial (ala PRO/TMS). Added in mods
  277. ;                    from Steve Covey for PRO/TMS dialing
  278. ;                    out, mods for dialing in not done.
  279. ; 39 04-Dec-85    17:58:37  K11DIA.MAC    Modem type data structure mods, see
  280. ;                    K11DIA.MAC for more info.
  281. ; 39 03-Dec-85    13:00:14  K11TSX.MAC    More mods to use CONSOLE port on RT11
  282. ;              K11DSP.MAC    Also, SET LIN TT: will override the
  283. ;                    use of XL or MT service.
  284. ; 39 30-Nov-85    12:35:44  K11INI.MAC    Send ESC > to force ansi mode if a
  285. ;                    VT100.
  286. ; 39 30-Nov-85    12:35:20  K11E80.MAC    Minor mods for RSTS/E v9.x, get term
  287. ;                    type and set buffer count for input.
  288. ; 39 16-Nov-85    12:13:26  K11CON.MAC    Intercept ESC Z and return a terminal
  289. ;                    id that all exec's understand on P/OS.
  290. ;                    Also, intercept all escape sequences
  291. ;                    from P/OS keyboard and map some of the
  292. ;                    upper row F keys to something usefull,
  293. ;                    like ESC (F11)-> \033, INT (F6)>-> \03
  294. ;                    and so on. Both features added at the
  295. ;                    request of B. Eiben, DEC LDP, formerly
  296. ;                    DEC LCG (eiben@dec-marlboro.arpa)
  297. ; 39 14-Nov-85    10:17:53  K11TSX.MAC    TSXFLG=1 for TSX+, -1 for RT11 without
  298. ;                    XC,XL or MT service. Thus, RT11 kermit
  299. ;                    can run using console only systems.
  300. ; 39 14-Nov-85    10:17:15  K11RT4.MAC    Check for XC, XL and MT service.  If
  301. ;                    not present, warn and fake using TSX
  302. ;                    TT: code.
  303. ; 38 09-Nov-85    12:35:05  K11M41.MAC    Alter XBINREAD to use MRKT$S for the
  304. ;                    read timeout and do an IO.KIL if it
  305. ;                    fails then convert IE.ABO to IS.TMO
  306. ; 38 07-Nov-85    15:13:06  K11M41.MAC    Rewrite handling for REMOTE DIR server
  307. ;              K11E80.MAC    processing so that we do not fill up
  308. ;              K11RTD.MAC    a file with the directory listing and
  309. ;              K11SER.MAC    then send the file. Instead stuff
  310. ;                    GETROUTINE: with &SDODIR.
  311. ; 38 06-Nov-85    16:20:33  K11SER.MAC    Change REM HELP to use asciz sender
  312. ;                    instead of dumping to file and sending
  313. ;                    the file for the extended response.
  314. ;
  315. ; 38 06-Nov-85    15:17:36  K11RT4.MAC    Change EPT name GETCR0 to FGETCR0
  316. ; 38 06-Nov-85    15:17:36  K11RMS.MAC    Change EPT name GETCR0 to FGETCR0
  317. ; 38 06-Nov-85    15:13:59  K11PAK.MAC    Moved GETCR0 to call actual next_char
  318. ;                    routine via CALL @GETROUTINE so we can
  319. ;                    support the use of alternate routines.
  320. ;                    This allows extended server responses
  321. ;                    to use memory or whatever instead of
  322. ;                    temporary files.
  323. ; 37 05-Nov-85    10:19:47  K11PRT.MAC    Added .TWAIT for 1/3 second in TTYFIN
  324. ;                    to avoid turning the XC/XL driver off
  325. ;                    before all I/O has been sent to host.
  326. ; 37 04-Nov-85    17:23:30  K11PRT.MAC    Put back  in the kludges for the lack
  327. ;              K11RTT.MAC    of a clock, which somehow got lost in
  328. ;                    subspace somewhere (RT11 specific).
  329. ; 37 04-Nov-85    15:25:08  K11PRT.MAC    Various mods for CL: handler for TSX+
  330. ;              K11RT4.MAC    to allow the use of 8BIT mode on the
  331. ;              K11TSX.MAC    handler, also avoid dropping DTR when
  332. ;              K11RTT.MAC    we close CL line. Dummy EPT's stuffed
  333. ;              K11DSP.MAC    in K11TSX and K11RTT for reset @ exit
  334. ;                    code.
  335. ; 37 04-Nov-85    13:23:52  K11REC.MAC    Insure call to FPARSE for case where
  336. ;                    user says GET remote_name local_name
  337. ; 37 01-Nov-85    10:51:33  K11INI.MAC    Get defensive in RPAR so we can catch
  338. ;                    short SINIT packets better and fix(?)
  339. ;                    them. Needed for FIDO Kermit.
  340. ; 37 29-Oct-85    17:01:53  K11M41.MAC    Add code for IO.BRK on P/OS.
  341. ; 37 28-Oct-85    17:40:52  K11M41.MAC    Stuff *.*;* into DEFDIR in DODIR: iif
  342. ;                    the first byte of DEFDIR is \0 (null)
  343. ; 37 28-Oct-85    13:37:44  K11CON.MAC    Added code re Steve Heflin to (1) do
  344. ;                    a MRKT$S iif 'TC.DLU' does a zero to
  345. ;                    non-zero transition,  and (2)  alter
  346. ;                    function code for REMWRITE QIO if the
  347. ;                    TC.DLU == 2 to IO.WBT!TF.WAL,  a must
  348. ;                    do for M+ V3  and MicroRsx V3.    Would
  349. ;                    assume not  needed for packet sending
  350. ;                    as currently packet sending is block-
  351. ;                    ing (ie, its half duplex).
  352. ; 37 19-Oct-85    17:17:49  K11DIA.MAC    Add DIAL command
  353. ; 37 19-Oct-85    17:00:01  K11ST0.MAC    Added SET MODEM command
  354. ; 36 13-Oct-85    15:27:45  K11SEN.MAC    Fix up control C aborts. Add new state
  355. ;              K11REC.MAC    called STA.CCABORT for processng ctl C
  356. ;              K11M41.MAC    aborts. Added IO.KIL in ctrl C ast
  357. ;              K11E80.MAC    code for RSX and P/OS to stop current
  358. ;                    i/o operation. Can't do this on RSTS.
  359. ; 36 10-Oct-85    14:53:55  K11CON.MAC    Save and reset speed if change TC.DLU
  360. ; 36 10-Oct-85    14:51:33  K11PAK.MAC    Fix call from M$RETRY to ERROR()
  361. ; 36 24-Sep-85    12:29:53  K11E80.MAC    Added REMOTE LOGIN and support for it
  362. ;              K11SER.MAC    in the server. The server support makes
  363. ;              K11COM.MAC    sense only for RSTS/E V9.x since RSTS
  364. ;              K11CMD.MAC    is the only PDP exec supporting logins
  365. ;                    via executive directives. REM LOGIN was
  366. ;                    a request by Dale Handy for a specific
  367. ;                    application.
  368. ;              K11CMD.MAC    Disabled for SEND if wilcarded filename
  369. ;              K11SEN.MAC    and   GET filename destination_filename
  370. ; 36 17-Sep-85    10:55:06  K11REC.MAC    Allow SEN filename destination_filename
  371. ; 36 17-Sep-85    10:54:11  K11ST0.MAC    Added SET RT11 CREATE_SIZE value to
  372. ;                    for allocation for small disks on file
  373. ;                    creates, sometimes needed for Kermit-11
  374. ;                    to non Kermit-11 transfers.
  375. ; 36 13-Sep-85    12:30:12  K11ST1.MAC    Added SET REC START-OF-PACKET, also
  376. ;              K11PAK.MAC    SET SEN STA . Also added
  377. ;                    SET START-OF-PACKET which forces both
  378. ;                    SOP's to same value.
  379. ; 36 10-Sep-85    13:38:31  K11ST0.MAC    Added SET RT11 command, currently as
  380. ;              K11RTD.MAC    SET RT11 [NO]VOLUME_VERIFY, to skip
  381. ;              K11DAT.MAC    checking systype at offset 760 in the
  382. ;              K11RT4.MAC    directory header for disks. Also added
  383. ;              K11COM.MAC    SET RT11 [NO]FLOW_CONTROL, same as the
  384. ;                    old SET RTFLOW [ON][OFF]
  385. ; 35 01-Sep-85    14:45:33  K11SEN.MAC    Added messages for retry aborts.
  386. ; 35 01-Sep-85    14:30:22  K11PAK.MAC    Modified insertion of prompt into error
  387. ; 35 01-Aug-85    14:15:10  K11CVT.MAC    Fix filenames with fubar characters
  388. ;              K11REC.MAC    to be legit (insert 'x' into name),
  389. ;                    as in GET abcde_f.dat --> abcdexf.dat
  390. ; 34 29-Jul-85    14:22:28        Mod REM CWD to accept password if
  391. ;                    present, no prompts though.
  392. ; 33 16-Jul-85    21:12:01  K11HLP.RNo    Update HELP for SET RSX.
  393. ; 33 16-Jul-85    21:10:47  K11M41.MAC    Do a MCR SET/NORPA=TTn:, needed if the
  394. ;                    line was set to /RPA as /RPA tells the
  395. ;                    TTDRV to pass XON and XOFF thru.
  396. ; 33 16-Jul-85    20:57:50  K11RXX.MAC    Added new connect code, for now invoked
  397. ;              K11ST0.MAC    via SET RSX CONNECT ALTERNATE, default
  398. ;              K11CON.MAC    is SET RSX CONNECT DEFAULT. If it works
  399. ;                    out ok, will change new code to default
  400. ;                    as it appears to do the connect i/o
  401. ;                    better due to it's own internal xon/xof
  402. ;                    and double buffering.
  403. ; 32 02-Jul-85    22:29:34  K11HLP.RNO    Add Doc for modems.
  404. ;
  405. ; 32 02-Jul-85    13:44:50  K11CMD.MAC    Added support for CWD and REM CWD.
  406. ;              K11SER.MAC    Support for GN$CONNECT (rem cwd)
  407. ;              K11COM.MAC    Added CWD and REM CWD to command lists
  408. ; 32 02-Jul-85    13:14:22  K11INI.MAC    Set pro/350 to 7 bit to avoid multinat
  409. ;                    char sets, use SET CONS 8 to override.
  410. ; 32 02-Jul-85    13:10:31  K11CON.MAC    Set remote line to binary mode for RSTS
  411. ;                    version 9 for the CONNECT command, (see
  412. ;                    TTDVR, it changes C1 ( > 200 (8)) chars
  413. ;                    to escape sequences, neat, huh?).
  414. ; 32 02-Jul-85    13:02:04  K11PAK.MAC    Insert current prompt into error text
  415. ;                    sent to other system.
  416. ;
  417. ; New tape to Columbia      V2.31
  418. ;
  419. ;
  420. ; 31 20-Jun-85    18:42:39  K11SEN.MAC    Updated SDATA to not abort on 'unknown'
  421. ;                    packet type.
  422. ; 31 20-Jun-85    18:42:27  K11SHO.MAC    Updated SHOW command
  423. ; 31 17-Jun-85    15:29:36  K11RT4.MAC    Added .HRESET if device was X?: at exit.
  424. ; 31 17-Jun-85    14:53:34  K11CMD.MAC    Add call to RSTSRV to restore line chars
  425. ;                    if control C abort under SERVER & RSX.
  426. ; 31 17-Jun-85    14:23:14  K11CON.MAC    Wait 6 seconds if changing TC.DLU
  427. ; 30 04-Jun-85    11:26:04  K11M41.MAC    Added SET RSX CHARIO and SET RSX LINEIO.
  428. ;              K11ST0.MAC    The former will force packet reads to do
  429. ;                    a SF.GMC for the typeahead count, then
  430. ;                    read that many under IO.RAL, as is done
  431. ;                    for P/OS. The latter will (default) do
  432. ;                    reads by line for M and M+.
  433. ; 30 04-Jun-85    11:23:52  K11ST0.MAC    Added SET RSX TC.DLU value to alter
  434. ;              K11M41.MAC    the tc.dlu setting for connecting to a
  435. ;              K11DAT.MAC    modem. By default, Kermit will never try
  436. ;              K11CON.MAC    to change it, however, a value of 1 or 2
  437. ;              K11COM.MAC    will force a change if not already set.
  438. ; 30 01-Jun-85    11:04:31  K11M41.MAC    Add 19.2 and 38.4 speeds into SET SPEED
  439. ; 30 01-Jun-85    11:03:30  K11INI.MAC    Mods for SET UPDATE, also set do a SET
  440. ;                    TER VT100 for PRO/3xx systems.
  441. ; 30 01-Jun-85    11:02:28  K11ST1.MAC    Added LOGFILE filename.type so we can
  442. ;                    be more compatible (calls SET LOGFILE)
  443. ; 30 01-Jun-85    11:01:45  K11DAT.MAC    Added 'BLIP::' for packet logging ala
  444. ;                    SET UPDATE n. A SET UPD 0 will disable
  445. ;                    all packet counts to the terminal.
  446. ; 29 18-May-85    14:17:39  K11SER.MAC    Update packet types to symbolic names
  447. ; 29 17-May-85    05:08:47  K11ST1.MAC    Add SET FIL [NO]SUPERCEDE to protect
  448. ;              K11REC.MAC    files that already exists.
  449. ; 29 14-MAY-85    10:26:33  K11INI.MAC    Fix bug for setting 8bit prefixing.
  450. ;                    Quite noticable on PRO/RT version.
  451. ; 28 09-May-85    07:40:41  K11RTD.MAC    Add support for server REM DIR command
  452. ;                    for RT and TSX+.
  453. ; 28 07-May-85    17:40:06  K11TSX.MAC    Final mods by Ned Rhodes for TSX+
  454. ;              K11PRT.MAC
  455. ; 28 01-May-85    16:00:01  K11ST1.MAC    Ignore TYPE in SET FILE [TYPE] arg
  456. ; 28 22-Apr-85    10:34:56  K11RT4.MAC    Kludge if RT system does not have a
  457. ;              K11RTT.MAC    clock.
  458. ; 28 20-Apr-85    09:22:01  K11ST1.MAC    Added SET BINARY-TYPE .filetype for
  459. ;              K11CVT.MAC    overriding the built-in binary file
  460. ;                    type list.
  461. ; 27 XX-Apr-85          K11M41.MAC    Fix ASSDEV: for stack problem
  462. ; 27 19-Mar-85    15:59:06  K11SEN.MAC    Fix losing attribute packets in case
  463. ;                    we timed out or were naked.
  464. ; 26 28-Feb-85    14:01:08  K11RMS.MAC    Change % to ? in wildcards for RSTS/E
  465. ;              K11SER.MAC    server to kludge around the problem
  466. ;                    that some Kermits mangle ? in cmdline
  467. ; 26 28-Feb-85    14:00:30  K11RT4.MAC    Fixes for TSX+
  468. ;              K11DSP.MAC
  469. ;              K11TSX.MAC
  470. ; 26 20-Feb-85    15:13:05  K11E80.MAC    Changed default record format from
  471. ;                    FILES-11 variable to STREAM ASCII.
  472. ; 25 29-Jan-85    09:40:22  K11SEN.MAC    Fix things up for ^e,^x and ^z inter-
  473. ;              K11REC.MAC    upts on getting and sending files.
  474. ; 25 28-Jan-85    15:30:01  K11SER.MAC    Get rid of imbedded crlfs in the short
  475. ;                    server reply string.
  476. ; 25 17-Jan-85    10:56:03  K11HLP.HLP    More explanation about BINARY files as
  477. ;                    there seems to be a lot of confusion
  478. ;                    about binary file transfer.
  479. ; 25 17-Jan-85    10:53:17  K11CON  BDN    Added SET CONSOLE 7, SET CONSOLE 8 to
  480. ;              K11ST1  BDN    force P/OS Kermit11 to junk bit 7 when
  481. ;                    in terminal mode, thus avoiding DEC's
  482. ;                    multinational character set.
  483. ; 25 17-Jan-85    10:52:38  K11DSP  BDN    Clear PROFLG in ASSDEV if SET LINE is
  484. ;                    done and device is not X?: for RT11.
  485. ; 25 17-Jan-85    10:51:58  K11SEN  BDN    Added abort (^E,^X & ^Z) for SENDing.
  486. ; 25 16-Jan-85    13:20:45  K11E80  BDN    Mods for much faster packet reading.
  487. ;                    Sped file get up by about 35% for RSTS
  488. ; 24 26-Nov-84    11:46:53  K11E80  BDN    Fix a UU.TRM call for RSTS T9.0-07.
  489. ; 24 09-Nov-84    15:35:17  K11TSX  BDN    Creation from NED RHODE'S modifications
  490. ;                    to K11RTT for TSX+.  Note that this one
  491. ;                    I can never test as I do not use TSX.
  492. ; 24 09-Nov-84    15:35:05  K11DSP  BDN    Creation.
  493. ; 24 09-Nov-84    15:32:36  K11RT?  BDN    Virtual overlays for XM, K11DSP to call
  494. ;                    the  correct terminal i/o overlay based
  495. ;                    on the exec and line type (ie, TSX+ and
  496. ;                    XC/XL). We can now  AVOID  generating a
  497. ;                    differnt save image for each config.
  498. ; 23 25-Oct-84    16:47:20  K11XXX  BDN    This is getting to be a drag having to
  499. ;                    generate six different versions of the
  500. ;                    Kermit-11 each time I change something.
  501. ; 23 25-Oct-84    16:46:01  K11CON  BDN    Removed break sending code to specific
  502. ;                    executive support modules.
  503. ; 23 25-Oct-84    16:45:36  K11PRT  BDN    Real break sending for the PRO/RT11
  504. ; 23 25-Oct-84    16:45:11  K11ST1  BDN    SET REPEAT ON/OFF
  505. ; 23 25-Oct-84    16:44:52  K11PAK  BDN    Repeat count prefixing added.
  506. ; 23 21-Oct-84    16:37:57  K11???  BDN    Got sick of working on PRO/RT11.
  507. ; 23 21-Oct-84    16:38:36  K11CMD  BDN    Moved printing of banner.
  508. ; 23 21-Oct-84    16:37:16  K11REC  BDN    Added error logging and got all state
  509. ;                    switches parameterized.
  510. ; 23 21-Oct-84    16:36:51  K11CVT  BDN    Added new filetypes for binary mode.
  511. ; 23 16-Oct-84    15:32:31  K11CM1  BDN    Removed     number of commands from K11CMD
  512. ;                    to save space for PRO/RT11 version.
  513. ; 23 15-Oct-84    13:52:09  K11RT?  BDN    Fixed all the .FETCH stuff
  514. ; 23 15-Oct-84    13:39:22  K11ST1  BDN    Creation, split K11STT in half for RT11
  515. ; 23 15-Oct-84    13:39:22  K11ST0  BDN    Creation, split K11STT in half for RT11
  516. ; 23 15-Oct-84    13:39:05  K11CMD  BDN    Moved C$SET back in
  517. ; 23 14-Oct-84    16:01:22  K11PRT  BDN    New  module for XC port communications
  518. ;                    with PRO/RT11 version 5.1
  519. ; 23 14-Oct-84    15:20:13  K11SEN  BDN    Creation, split receive and send state
  520. ;              K11REC    out from K11PAK to save space for  the
  521. ;                    PRO/RT11 version of Kermit.
  522. ; 22 20-Aug-84    14:51:05  K11M41  BDN    Mods for P/OS
  523. ; 22 15-Aug-84    09:15:32  K11M41  BDN    Slave the connect line at SET LINE  in
  524. ;                    routine ASSDEV (restored @ exit). Also
  525. ;                    add RPOI$S call to  ...BYE for generic
  526. ;                    logout from server.
  527. ; 22 14-Aug-84    10:24:23  K11RTU  BDN    Added code for ASCTIM for RT11 Kermit.
  528. ; 22 14-Aug-84    10:21:51  K11ATR  BDN    Add attribute packet type 41 (8) so we
  529. ;              K11RMS    send  the recieving Kermit the size of
  530. ;              K11RT4    the file. Needed for RT11 Kermit since
  531. ;                    RT11 needs to preallocate files. Could
  532. ;                    not create file larger than 243 blocks
  533. ;                    on the PDT150 until this was put in.
  534. ; 22 10-Aug-84    13:20:31  K11RT4  BDN    Moved ERROR text and error lookup code
  535. ;              K11RTU    to K11RTE.MAC, also moved RT11 COPY to
  536. ;                    K11RTU overlay.
  537. ; 22 08-Aug-84    15:50:33  K11RTD  BDN    Change the check for RT11 volume valid
  538. ;                    from home block offset 730 to 760.
  539. ; 22 03-Aug-84    10:28:54  K11PAK  BDN    Finish code for talking to half duplex
  540. ;              K11COM    IBM 370 compatible systems.  Added SET
  541. ;              K11STT    IBM ON/OFF, SET LOCAL ON/OFF.  SET LOC
  542. ;                    is equivalent to SET DUPLEX FULL/HALF.
  543. ; 22 03-Aug-84    10:28:23  K11M41  BDN    Hook for single character reads if any
  544. ;                    handshaking character is set.
  545. ; 21 30-Jul-84    16:11:36  K11M41  BDN    Added date and time ascii conversion.
  546. ; 21 30-Jul-84    16:11:01  K11COM  BDN    Added commands TIME and DATE
  547. ; 21 30-Jul-84    16:08:17  K11M41  BDN    Fix TTPARS to return device name so we
  548. ;                    can use DECNET/M HTnn: device names.
  549. ; 21 30-Jul-84    16:07:44  K11CVT  BDN    Add .EXE and .RTS to binary file list.
  550. ; 21 30-Jul-84    11:17:24  K11PAK  BDN    More work for IBM mode
  551. ; 21 24-Jul-84    11:35:15  K11RTD  BDN    Extended directory lookup for RT11 to
  552. ;                    allow '%' in the filename or type.
  553. ; 21 23-Jul-84    12:47:03  K11DEF  BDN    New module, an '.include' file to define
  554. ;                    all the packet types.
  555. ; 21 23-Jul-84    12:32:11  K11SER  BDN    Stuff the default device into the server
  556. ;                    extended reply temp filename (needed for
  557. ;                    RT11 Kermit).
  558. ; 21 23-Jul-84    12:31:47  K11RT4  BDN    Insure that we are NOT running under the
  559. ;                    SJ monitor.
  560. ; 21 19-Jul-84    15:35:00  K11PAK  BDN    Added 8 bit prefixing
  561. ; 20 19-Jul-84    10:26:57  K11RTU  BDN    Add support for RENAME and DELETE for RT
  562. ;                    version 5.
  563. ; 19 15-Jul-84    17:14:10  K11E80  BDN    Add checks to be sure that the SET  LINE
  564. ;                    devicename was a real device for  RSTS/E
  565. ;                    and not some file name like SET LIN 1.
  566. ; 19 11-Jul-84    17:59:20  K11STT  BDN    Add SERVER DETACH command to allow  ser-
  567. ;              K11M41    ver to detach from KB: (or TI:).  In the
  568. ;              K11E80    the case of RSTS/E, spawn new job to log
  569. ;              K11RT4    the caller back in.
  570. ; 19 11-Jul-84    17:49:26  K11ATR  BDN    Fix RMS problem with attributes for RSTS
  571. ;                    non attributed binary files.
  572. ; 18 06-Jul-84    15:20:34        Update sent  to Frank Da Cruz  for fubar
  573. ;                    RT11 code with .FETCH and .DSTAT
  574. ;
  575. ;
  576. ; 18 06-Jul-84    13:29:21  K11RTT  BDN    Add loop to eat any buffered server NAKS
  577. ;                    in TTYINI().
  578. ;
  579. ;
  580. ; 18 03-Jul-84    10:16:03  K11INI  BDN    Moved INIT and KERINI from K11CMD.MAC to
  581. ;                    module (K11INI).  Also moved SPAR, RPAR,
  582. ;                    DSKDMP and FILLOG from K11PAK to here to
  583. ;                    save space in the root for RT11 version.
  584. ; 18 06-Jul-84    12:45:27  K11RT4  BDN    Finally found out that I had gotten  the
  585. ;                    arguments for .DSTAT swapped, which will
  586. ;                    explain why the RT11 file opens and cre-
  587. ;                    ates were being so flakey.
  588. ; 18 26-Jun-84    09:06:03  K11LCL  BDN    Optionally slow transfer rate down for
  589. ;                    user's based on the uic and speed
  590. ; 17 22-Jun-84    12:33:15  !!! finally ship new version out to Columbia !!!
  591. ;
  592. ;
  593. ; 17 22-Jun-84    11:20:29  K11M41  BDN    Add SREX$S  call in TTYINI so an aborted
  594. ;                    server can fix the line back up.
  595. ;
  596. ; 17 22-Jun-84    09:31:19  K11RMS  BDN    Don't set fb$wri in the FAC field when a
  597. ;                    file is readonly for binary file reads.
  598. ; 17 21-Jun-84    19:33:48  K11RT4  BDN    Final RT11 code modifications.
  599. ; 17 21-Jun-84    16:22:12  K11CMD  BDN    Fix open for takefile (missing type arg)
  600. ; 17 21-Jun-84    15:19:46  K11STT  BDN    If set line kb: or set line ti: then  we
  601. ;              K11M41    should reset back to remote mode.
  602. ;              K11E80
  603. ; 17 19-Jun-84    18:08:56  misc      BDN    Add xon/xoff support to RT11 connect be-
  604. ;                    cause the MT service for RT has     far too
  605. ;                    much  overhead    for speeds  greater than
  606. ;                    300 baud.
  607. ;                    Add wildcard support for RT11 version.
  608. ;                    Add IO.ATT for slaved terminal re M+ 2.1
  609. ;                    and RSX v4.1 kits (curse you, K. Olsen).
  610. ;                    The 'new'  versions of    M+ and M disable
  611. ;                    typeahead  for    slaved lines  unless the
  612. ;                    device is attached (?). Rather odd (?)
  613. ; 17 11-Jun-84    11:21:51  K11CVT  BDN    Add  code to decide if    a file is binary
  614. ;                    based on the filetype (ala .SAV, .BAC..)
  615. ; 17 10-Jun-84    16:44:50  K11RTT  BDN    Reduce tt read overhead for RT11 version
  616. ;              K11RT4  BDN    Dummy out K11LCL for RT11 to save space.
  617. ;              K11RT4  BDN    Timing bug in file open routine (?)
  618. ;              K11RT4    Fix overlay error  (K11ATR with K11SUB).
  619. ; 16 28-May-84    15:55:08  K11PAK  BDN    Insure that 'BUFEMP' does not try to CTL
  620. ;                    characters that could not have been set.
  621. ;                    Defensive response to the CPM Kermit 3.9
  622. ;                    which ALWAYS sends ampersands  over with
  623. ;                    the CTL quote, '#'.  Note: 20KERMIT does
  624. ;                    this also.  Fix should be in CPM Kermit,
  625. ;                    but it's simple to fix at this end.
  626. ; 16 28-May-84    09:10:19  K11CMD  BDN    Fix call to TTYRST for Kermit-11/RT
  627. ; 16 28-May-84    09:09:40  K11RTT  BDN    Kermit-11 now runs under the FB moniter
  628. ;                    for Rt11 version 5 with MT support.
  629. ; 16 28-May-84    09:08:47        Version 3.0.051 of VMS Kermit  fixed the
  630. ;                    above problem of ACK length.
  631. ; 16 25-May-84    15:40:35  K11PAK  BDN    Problem with VMSKERIT not liking 10 char
  632. ;                    acks for 'S' packets, changed ACK packet
  633. ;                    size to 11 for the time being until  the
  634. ;                    problem can be isolated.
  635. ; 16 25-May-84    15:39:26  K11STT  BDN    Moved command definitions for the  'SET'
  636. ;                    command to K11COM.MAC to save space.
  637. ; 16 25-May-84    12:18:08  K11DEB  BDN    Added 'DISPLAY globalsym' command.  This
  638. ;                    prints out values of variables in module
  639. ;                    K11DAT.MAC for debugging purposes.
  640. ; 16 21-May-84    17:01:56  K11PAK  BDN    Don't retry until MAXTRY the SINFO ('I')
  641. ;                    packet since older Kermit's will not  be
  642. ;                    able to understand 'I' packets. The  old
  643. ;                    Kermits will ALWAYS send NAKS for SINFO.
  644. ; 16 18-May-84    10:29:02  K11SER  BDN    The code for response to an  'R'  packet
  645. ;                    was sending the RMS error text after the
  646. ;                    routine GETNXT already sent error packet
  647. ; 16 14-May-84    09:38:50  K11CON  BDN    Check for errors from the qio's for RSX.
  648. ;                    In particular, catch the IE.DNR in  case
  649. ;                    the carrier drops.
  650. ; 15 08-May-84    11:15:35  K11PAK  BDN    Insure R0 cleared in BUFEMP in case  the
  651. ;                    the data packet was null.
  652. ; 15 06-May-84    11:33:56  K11PAK  BDN    Moved  the  ACK for the EOF packet to be
  653. ;                    send AFTER the output file is closed. An
  654. ;                    occasional RSX problem in that the BREAK
  655. ;                    packet was lost     due to timing    required
  656. ;                    this mod,  though  if the line is set up
  657. ;                    properly this would not be a problem.
  658. ; 15 06-May-84    11:33:38  K11RMS  BDN    Increased record buffersize to 160
  659. ; 15 04-May-84    13:56:21  K11M41  BDN    Fixed read  timeouts in RBD's version of
  660. ;                    BINREA.     Also hooked BINREA into CANTYP.
  661. ; 15 03-May-84    10:29:22  K11E80  BDN    Added UU.SPL stuff for the PRINT command
  662. ;              K11M41    Dummy support for it on RSX since PRINT$
  663. ;                    macro needs FCS, not RMS, support.  Will
  664. ;                    check RMS out or else SPAWN a PRINT cmd.
  665. ; 15 03-May-84    10:25:46  K11M41  BDN    Fixed the faking of BREAK for RSX.  Pass
  666. ;              K11CON    a LUN to use for the set speed QIO.
  667. ; 15 02-May-84    11:03:57  K11RMS  BDN    Found  out that either INIDM from SYSLIB
  668. ;                    or the GSA code from the RMS v2 kit will
  669. ;                    fail if th e task size is exactly on a 1
  670. ;                    KW boundary. In this case the high limit
  671. ;                    was 113777,  causing $INIDM  to crash at
  672. ;                    startup.
  673. ; 15 01-May-84    11:41:49  K11ATR  BDN    Added support for attribute packets.
  674. ;                    Allow auto determination of binary mode.
  675. ;                    Support for getting  the IFAB data  will
  676. ;                    only work between like Kermits.
  677. ;                    Added SET ATTRIBUTES OFF command to dis-
  678. ;                    able  any attribute  sending even if the
  679. ;                    other Kermit's CAPAS field indicates the
  680. ;                    support of it (ie,  handle  incompatible
  681. ;                    protocal versions or bugs)
  682. ; 14 18-Apr-84    10:41:34  K11RMS  BDN    Added 'inited' flag for lun being active
  683. ; 14 18-Apr-84    10:40:01  K11PAK  BDN    Mods for defered file creates to handle
  684. ;                    attribute packets
  685. ; 14 12-Apr-84    17:07:51  K11CON  BDN    Print speed and escape seq for CONNECT.
  686. ; 13 04-Apr-84    18:43:33  K11RMS  BDN    Added ept's FOPEN and  FCREATE to  allow
  687. ;                    use of multiple     block buffering for seq
  688. ;                    files. Desired for use by HELP command.
  689. ; 13 04-Apr-84    18:39:38  K11SER  BDN    Calls to SINFO if we expect an    extended
  690. ;                    reply from a remote server, required  if
  691. ;                    block checks are type 2 or 3.
  692. ; 13 04-Apr-84    18:37:58  K11CON  BDN    Have X command cancel link being xoff'ed
  693. ;                    by the remote as well as send the remote
  694. ;                    an xon.
  695. ; 13 04-Apr-84    10:13:32  K11PAK  BDN    Debug logging mods. Added calls to TTXON
  696. ;                    to fix xoff'ed line.  Also added routine
  697. ;                    SINFO to handle init for expected server
  698. ;                    reply.
  699. ; 13 04-Apr-84    09:36:06  K11STT  BDN    Changes to SET BLOCK
  700. ; 13 03-Apr-84    17:11:35  K11M41  BDN    Added TTXON to cancel xoffed line state.
  701. ; 13 03-Apr-84    16:22:01  K11E80  BDN    Added TTXON to cancel xoffed line state.
  702. ; 13 02-Apr-84    17:14:29  K11E80  BDN    Insure that no single  private delimiter
  703. ;                    is set for  the terminal, ala the ttyset
  704. ;                    command SET DELIMITER "ch".  If     set, an
  705. ;                    unusual exec bug seems to creep     in when
  706. ;                    a .sleep is executed ????
  707. ; 13 02-Apr-84    11:14:36  K11CON  BDN    Added support for half duplex link. Also
  708. ;                    added global 'duplex' to K11DAT.MAC
  709. ; 13 02-Apr-84    11:14:12  K11STT  BDN    Added SET DUPLEX HALF, SET DUPLEX FULL
  710. ; 13 30-Mar-84    10:45:08  K11E80  BDN    Removed     hardware parity set code  since
  711. ;              K11M41    we will generate our own if need be.
  712. ; 13 30-Mar-84    10:40:35  K11MAC  BDN    Defined a macro     for XOR which    does not
  713. ;                    require 'XOR reg,dst' format.  It uses 4
  714. ;                    instructions  and will    be needed anyway
  715. ;                    for the RT11 version.
  716. ; 13 30-Mar-84    10:34:02  K11PAK  BDN    Fix extended server replies to work when
  717. ;                    the checksum is type 2 (12bit arith sum)
  718. ;                    or type 3 (16 bit CRC).
  719. ; 13 30-Mar-84    10:33:03  K11E80  BDN    Rewrote DIRECTORY code, disable non-priv
  720. ;                    users from looking at other accounts. Is
  721. ;                    patchable via ONLPAT, see K11INS.DOC.
  722. ; 13 30-Mar-84    10:32:44  K11LCL  BDN    Modified protection for commands.
  723. ; 13 30-Mar-84    10:31:46  K11PAK  BDN    Added software parity generation.  Would
  724. ;                    be mainly used when connecting out to  a
  725. ;                    remote system that requires parity.
  726. ; 12 23-Mar-84    08:47:08  K11LCL  BDN    Rewrote so commands  can be disabled via
  727. ;                    ONLPAT for RSTS/E.
  728. ; 12 20-Mar-84    20:06:06  K11E80  BDN    Modified control C ast support so it can
  729. ;                    be compatible  with the     newly added RSX
  730. ;                    control C ast processing.
  731. ; 12 20-Mar-84    20:04:15  K11M41  BDN    Added control C ast recognition for RSX.
  732. ; 12 20-Mar-84    20:03:16  K11CON  BDN    Added  directive SREX$S     for RSX connect
  733. ;                    to reset the  TT: lines to  their former
  734. ;                    states in case of an ABORT.
  735. ; 12 20-Mar-84    19:57:16  K11E80  BDN    Conditional'ed out  NAMCVT,  which I re-
  736. ;              K11M41    wrote and put into K11CVT.MAC.
  737. ; 12 20-Mar-84    19:55:15  K11CVT  BDN    A new module.  Do  executive independent
  738. ;                    parsing of file specs to return only the
  739. ;                    filename.filetype.  This will help those
  740. ;                    users who  need DAP support.  It's  also
  741. ;                    overlayed into the ERRDVR region.
  742. ; 12 19-Mar-84    16:52:51  K11RMS  BDN    Put  back SY:  defaulting for RSTS only.
  743. ;              K11CPY    Done if     TST FU$DEF  is <> 0.  FU$DEF is
  744. ;                    defined in K11E80 to be .word 177777. In
  745. ;                    K11M41 it is .word 0.
  746. ; 12 19-Mar-84    14:15:40  K11CMD  BDN    Add check for device name on CONNECT cmd
  747. ;              K11RMS    Add routine to get MCR/CCL command line.
  748. ; 12 17-Mar-84    13:23:45  K11RMS  BDN    Add in Bob Denny's mods for RSX i/o  and
  749. ;              K11CON    doing RMS DAP access correctly.
  750. ;              K11M41
  751. ;              K11CPY
  752. ;
  753. ; 12 14-Mar-84    16:58:12  K11RMS  BDN    Skip the $SEARCH if there is no wildcard
  754. ;                    context.  This gets around problems with
  755. ;                    RSTS sites that modify the exec to alter
  756. ;                    the way the exec does directory lookup.
  757. ;                    This option is only executed if the  lo-
  758. ;                    cation FU$DIR is <> 0 (see K11RMS.MAC)
  759. ;
  760. ; 12 14-Mar-84    10:49:37  K11E80  BDN    Don't  set 8BIT mode for the cpu console
  761. ;                    if we are  running Kermit  from it  as a
  762. ;                    local Kermit dialing out (RSTS/E only).
  763. ; 12 14-Mar-84    10:45:39  K11CON  BDN    Added  'BIC #^C177,R1'    in front of both
  764. ;                    of the    'CMPB R1,CONESC'  to fix problem
  765. ;                    using Kermit's connect command from  the
  766. ;                    console (TT00: or KB0:)
  767. ; 12 08-Mar-84    12:33:59  K11CMD  BDN    Added default of '.CMD' for TAKE
  768. ; 12 08-Mar-84    11:56:14  K11CMD  BDN    Move  'remlst' and 'cmdlst' into  K11COM
  769. ;                    which is overlayed in the ERROR segment.
  770. ;                    Added calls to LOACMD and LOAREM to  get
  771. ;                    the overlay with K11COM resident and  to
  772. ;                    return a pointer to the command list. It
  773. ;                    saves about 3000 (8) bytes in task size.
  774. ;                    Note that  this does  not sit  well with
  775. ;                    what $AUTO likes to do.
  776. ;                    If it causes a problem, put K11COM  back
  777. ;                    into the root.
  778. ;                    Also had to make all RM$xxx epts in  the
  779. ;                    module K11CMD global.
  780. ; 12 07-Mar-84    12:28:16  K11TRA  BDN    Added routine to 'brute force' a file to
  781. ;                    a remote line. Needed it to get the  new
  782. ;                    (and not yet done) RT11 version onto the
  783. ;                    RT11 system being used for testing which
  784. ;                    is, would you believe, a real PDT150.
  785. ; 12 06-Mar-84    16:05:42  K11CMD  BDN    Mods to override auotmatic use of  local
  786. ;                    terminal name if we're running in server
  787. ;                    mode and the user did a SET LINE TTnn:
  788. ; 11 05-Mar-84    10:22:48        Sent version 2.11 to  Columbia and  DEC.
  789. ;                    Did NOT include Bob Denny's RSX mods.
  790. ;
  791. ; 11 02-Mar-84    11:27:22  K11CMD  BDN    Modified init stuff to look for the init
  792. ;                    file KERMIT.INI in SY: then if not there
  793. ;                    to try    LB:[1,2], SY:[1,2] and KERMIT:
  794. ;
  795. ;
  796. ; The following mods were done by:
  797. ;    Bob Denny
  798. ;    Alisa Systems, Inc.
  799. ;    Pasadena, Ca
  800. ;
  801. ; 10 xx-Mar-84    xx:xx:xx  K11M41    Bob also rewrote much of the RSX i/o
  802. ;                    support and wrote the connect code for
  803. ;                    RSX using asynch qios.
  804. ; 10 07-mar-84    14:47:00  K11CPY    Close input file if $create failed.
  805. ;
  806. ; 10 05-Mar-84    15:47:30  K11CPY    Remove defaulting to SY: so Decnet  will
  807. ;                    work  with systems that don't understand
  808. ;                    SY:
  809. ; 10 04-Mar-84    02:55:47  K11RMS    Many small changes to allow DECNET (DAP)
  810. ;                    remote file access. See comments in
  811. ;                    K11RMS.MAC
  812. ; 10 04-Mar-84    01:10:03  K11M41    Remove FCS style filename parsing and
  813. ;                    allow DAp remote file specifications.
  814. ; 10 03-Mar-84    20:44:35  DAP11S.ODL    Created this for sequential-only DAP
  815. ;                    support RMS. General purpose, though.
  816. ; 10 03-Mar-84    20:41:10  K11DAP.ODL    Add new odl for Decnet (DAP) remote file
  817. ;                    support for RSX11M.
  818. ; 10 03-Mar-84    20:34:18  K11RSX.ODL    Remove FCS parsing factor
  819. ;
  820. ;
  821. ; The following mods were done by:
  822. ;    Brian Nelson
  823. ;    Change Software, Inc.
  824. ;    Toledo, Ohio
  825. ;
  826. ; 10 17-Feb-84    15:08:05  K11CMD  BDN    Did some trial    stuff on talking  to IBM
  827. ;                    mainframes,  but  the CMS  Kermit  makes
  828. ;                    things difficult as it can't time out.
  829. ;                    Added Set Handshake and show for it. Not
  830. ;                    yet done with handshake garbage.
  831. ; 10 17-Feb-84    15:07:14  K11PAK  BDN    Mods for  doing ^X and ^Z  things.  Also
  832. ;                    affected K11M41 and K11E80.
  833. ; 09 10-Feb-84    12:25:17  K11M41  BDN    Add HANGUP via IO.HNG qio, added code to
  834. ;                    spawn  MCR SET /SPEED=TTnn:xxxx:xxxx  if
  835. ;                    the SF.SMC  call to  change speed  fails
  836. ;                    with  an IE.PRI error,    also changed the
  837. ;                    cli for SPWN$S to CLI... from MCR...
  838. ;                    Also use MCR spawn for disabling echo.
  839. ; 08 09-Feb-84    21:33:55  K11RSX.ODL    Overlayed CSI1, CSI2 and PARSE which are
  840. ;                    used to get the simple filename.ext from
  841. ;                    the RMS11 expanded name string.
  842. ; 07 09-Feb-84    09:20:34  K11E80  BDN    Try to anticipate the DHV11 q bus inter-
  843. ;                    face for  showing and setting speed.  No
  844. ;                    changes needed to K11M41 for rsx.
  845. ; 07 08-Feb-84    15:19:58  K11SER  BDN    Force mode to be remote if we are to run
  846. ;                    as a server. Not really needed, but what
  847. ;                    about doing a SET LINE and then SERVER ?
  848. ; 06 06-Feb-84    10:34:04  K11PAK  BDN    Added SETTMO to decide what receive time
  849. ;                    out to use based on server timeout,  the
  850. ;                    other  kermit's desired     timeout and any
  851. ;                    timeout set via SET TIMEOUT value.
  852. ; 06 04-Feb-84    11:55:22  K11CMD  BDN    Added local copy and remote copy, rename
  853. ; 06 04-Feb-84    11:54:59  K11SER  BDN    Added remote copy and rename support.
  854. ; 06 04-Feb-84    11:53:32  K11CPY  BDN    New module, do file copies using RMS i/o
  855. ;                    This could be dependent on new    versions
  856. ;                    of  RMS11 as I access  the IFABS to copy
  857. ;                    the correct file attributes,
  858. ; 06 03-Feb-84    10:06:23  K11RMS  BDN    Rewrote     the default  directory to  work
  859. ;                    the way     it should by using  $PARSE  and
  860. ;                    the DNS and DNA fields in the FAB.  Also
  861. ;                    added FPARSE to return an expanded name.
  862. ;                    Changes to K11CMD, K11SER and K11PAK.
  863. ; 06 02-Feb-84    17:24:19  K11E80  BDN    Fix  CANTYP and     change parameter  list.
  864. ;                    Mods required to K11SER, K11PAK,  K11CMD
  865. ;                    and K11M41.
  866. ; 06 01-Feb-84    14:25:46  K11RMS  BDN    Insure FB$FID in the FOP is cleared  for
  867. ;                    the $ERASE call.
  868. ; 06 01-Feb-84    13:07:26  K11CMD  BDN    Local and remote WHO commands.
  869. ; 06 01-Feb-84    13:07:10  K11SER  BDN    Add support for remote WHO command
  870. ; 06 01-Feb-84    13:06:36  K1180S  BDN    New module, do a partial SYSTAT for RSTS
  871. ; 06 01-Feb-84    10:37:49  K11SER  BDN    Support remote type in server
  872. ; 06 01-Feb-84    10:36:27  K11CMD  BDN    Add  'REMOTE TYPE' and added 'DISK to be
  873. ;                    same as 'SPACE'
  874. ; 06 01-Feb-84    10:22:17  K11SER  BDN    Insure KERMIT.TMP has the default device
  875. ;                    string inserted in it for create.
  876. ; 06 01-Feb-84    10:21:19  K11CMD  BDN    Moved type and rename commands to K11SHO
  877. ;                    to space space in the root.
  878. ; 05 31-Jan-84    09:36:56  K11RMS  BDN    Fixed  help file access     problem at  the
  879. ;                    source, ie, insure FB$GET is set only if
  880. ;                    the file is opened for reading.
  881. ; 05 31-Jan-84    08:41:03  K11CMD  BDN    Moved SHOW command to  K11SHO.MAC,  also
  882. ;                    moved $NAME and COMMAND macros to K11CDF
  883. ; 05 30-Jan-84    20:10:28  K11HLP  BDN    Found out  that K11HLP    needs temp privs
  884. ;                    to get at the help file (K11HLP.HLP). If
  885. ;                    the sys     manager installs  the    optional
  886. ;                    patch to FIP for UU.LOK then a <234>  is
  887. ;                    needed.
  888. ; 05 30-Jan-84    16:38:01  K11SER  BDN    Consolidated remote  server command pac-
  889. ;                    ket sending and creation.
  890. ; 05 30-Jan-84    13:44:28  K11RMS  BDN    Added  RMS $ERASE  code and disk logging
  891. ;                    of files deleted.
  892. ; 05 30-Jan-84    12:01:41  K11CMD  BDN    Add ERASE, DELETE
  893. ; 04 27-Jan-84    21:33:21  K11CMD  BDN    Added REM ERASE,  also add synonyms  for
  894. ;                    SET LOGFILE as LOG_FILE and LOG-FILE.
  895. ; 04 27-Jan-84    20:02:34  K11HLP  BDN    Fix keyword match to  match @ position 1
  896. ; 04 27-Jan-84    18:55:44  K11PAK  BDN    If datafield.len < 0 then reset checksum
  897. ;                    type to type '1' in RPACK$
  898. ; 04 27-Jan-84    18:45:08  K11SER  BDN    Redo support for remote commands
  899. ; 04 27-Jan-84    18:30:07  K11PAK  BDN    Redo support for extended server replies
  900. ;
  901. ; Version 2
  902. ;
  903. ;
  904. ; I decided that I would like to have the normal TED timestamp on the edit.
  905. ;
  906. ;
  907. ;    03 25-jan-84  K11RMS    BDN    Added support for stream ascii
  908. ;    03 25-Jan-84  K11CMD    BDN    Added SET RECORD-FORMAT STREAM and
  909. ;                    and   SET RECORD-FORMAT VARIABLE
  910. ;    03 25-Jan-84  K11HLP    BDN    Finished subtopics for HELP command
  911. ;    03 23-Jan-84  K11SER    BDN    Finished  prototype version of extended
  912. ;                    replies and added the  remote DIRECTORY
  913. ;                    command (generic D) to test it for RSTS
  914. ;    03 23-Jan-84  K11M41    BDN    Modified CANTYP(lun) to force LUN 5  if
  915. ;                    a value of zero (0) is passed for a lun
  916. ;                    to  make it  compatible     with  the RSTS
  917. ;                    version of CANTYP.
  918. ;    03 23-Jan-84  K11E80    BDN    Rewrote NOECHO(line)  and ECHO(line) to
  919. ;                    set noecho when the remote  link is set
  920. ;                    via SET LIN  and open in K11CON.  Added
  921. ;                    calls in K11CMD and K11CON to NOECHO.
  922. ;    03 22-Jan-84  K11M41    BDN    Fixed  BINREAD(lun,tmo)     to work with a
  923. ;                    passed timout of '-1' to effect a  read
  924. ;                    without wait (no stalling if no data).
  925. ;    03 20-Jan-84  K11M41    BDN    Test and fix TTSPEED, SETSPD and BINREA
  926. ;                    for RSX11M/M+
  927. ;    02 18-Jan-84  K11CMD    BDN    Added  REMOTE,    SPACE and  REMOTE SPACE
  928. ;                    commands.  Support  added to K11E80 and
  929. ;                    K11SER for generic U command.
  930. ;    02 17-Jan-84  K11CMD    BDN    Added  commands     NOTE and  COMMENT  for
  931. ;                    echoing text from indirect files.
  932. ;    02 17-Jan-84  K11CMD    BDN    Allow open for KERMIT.INI
  933. ;    02 17-Jan-84  K11PAK    BDN    Allow 12 bit and CRC-CCITT Checksums
  934. ;                    The user should always set the checksum
  935. ;                    type for both KERMITS.
  936. ;    02 16-Jan-84  K11CMD    BDN    Allow  underscore and digits in command
  937. ;                    names.
  938. ;    02 16-Jan-84  K11PAK    BDN    Redo  checksum processing to accomadate
  939. ;                    12 bit and CRC types.
  940. ;    02 16-Jan-84  K11CMD    BDN    Add Set Block-Check-Type and SHOW BLOCK
  941. ;    02 13-Jan-84  K11CMD    BDN    Moved C$HELP to module K11HLP
  942. ;    02 13-Jan-84  K11M41    BDN    More rsxm/m+ code added
  943. ;    02 13-Jan-84  K11CMD    BDN    Added showing speed for SHOW LINE
  944. ;    02 13-Jan-84  K11CMD    BDN    Added TAKE and @ commands
  945. ;    02 12-Jan-84  K11PAK    BDN    Fix checking for X , Z in ACK for Sdata
  946. ;    02 11-Jan-84  K11CMD    BDN    Added RENAME command
  947. ;    02 11-Jan-84  K11RMS    BDN    Added RMS rename
  948. ;    01 08-Jan-84  K11PAK    BDN    Fix .asicz for ERROR: SPACK
  949. ;    01 08-Jan-84  K11CMD    BDN    Added  call to XINIT for initialization
  950. ;                    based on the operating system.
  951. ;    01 08-Jan-84  K11PAK    BDN    Change    timeout to  MYTIME from MAXTIME
  952. ;                    if remote's SINIT packet had a value of
  953. ;                    zero for the timeout (CMS kermit?)
  954. ;    01 08-Jan-84  K11CMD    BDN    fix SET PARITY
  955.  
  956.  
  957.     .sbttl    define macros and things we want for KERMIT-11
  958.  
  959.  
  960.  
  961.     .if ndf, K11INC
  962.     .ift
  963.     .include    /IN:K11MAC.MAC/
  964.     .include    /IN:K11CDF.MAC/
  965.     .endc
  966.  
  967.     .iif ndf, k11inc, .error ; INCLUDE for IN:K11MAC.MAC failed
  968.  
  969.     .macro    $NAME junk
  970.     .endm    $NAME
  971.     .psect    $code
  972.  
  973.     cc$max    ==    2
  974.  
  975.     .enabl    gbl
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.     .sbttl    the main program
  985.     code
  986.  
  987.     .enabl    lsb            ; For I/D space
  988.  
  989. kermit::message
  990.     tst    do$ver            ; /41/ Always print version #?
  991.     beq    5$            ; /41/ No
  992.     call    sho$ve            ; print version and edit number
  993.     print    #warn$            ; /49/ Warning messages
  994. 5$:    call    drpprv            ; drop temp privs (for RSTS)
  995.     clr    cccnt            ; clear control C count
  996.     mov    #stack    ,sp        ; initialize a large stack
  997.     clr    exstac            ; /41/ Clear exit status now
  998.     clr    exstal            ; /41/ Clear exit status now
  999.     call    kerini            ; try to open SY:KERMIT.INI
  1000.     call    binini            ;
  1001.  
  1002. 10$:    CALLS    setcc    ,<#cctrap>    ; command loop reading
  1003.     call    drpprv            ; insure no privs are up now
  1004.     mov    argbuf    ,argpnt        ; insure arg pointer is reset
  1005.     call    fixchk            ; restore setted crc type
  1006.     clr    cccnt            ; no control C's
  1007.     call    getcmd            ; read and parse the command
  1008.     tst    r0            ; but did it work out ?
  1009.     blt    70$            ; no
  1010.     jsr    pc    ,@cmdadr    ; dispatch to the command
  1011.     cmpb    jobtype    ,#JOB$BAT    ; /45/ Batch job today ?
  1012.     bne    11$            ; /45/ No
  1013.     tst    status            ; /45/ Status OK so far ?
  1014.     bne    14$            ; /45/ Batch and bad status, DIE
  1015. 11$:    tst    exireq            ; /41/ Server force an exit ?
  1016.     bne    15$            ; /41/ Yes, do it then
  1017.     tst    logreq            ; /41/ Logout from CONNECT?
  1018.     beq    90$            ; /41/ No
  1019. 14$:    call    c$hang            ; /41/ Yes, Send logout string and
  1020.                     ; /41/ Hang the line up
  1021. 15$:    jmp    c$exit            ; /41/ Exit normally now
  1022.  
  1023.  
  1024.                     ; Parse errors or EOF comes here
  1025. 70$:    cmp    r0    ,#cmd$ex    ; control Z typed
  1026.     bne    80$            ; no
  1027.     jmp    c$exit            ; yes, exit normally
  1028.  
  1029. 80$:    mov    #-IE.ITS,exstac        ; /41/ Assume inconsistent exit
  1030.     cmp    r0    ,#cmd$ba    ; invalid command ?
  1031.     bne    85$            ; no
  1032.     print    #200$            ; yes, print out an error message
  1033.     br    90$            ; and go back for more
  1034.  
  1035. 85$:    cmp    r0    ,#cmd$un    ; /39/ not unique?
  1036.     bne    90$            ; /39/ no
  1037.     print    #210$            ; /39/ yes
  1038.  
  1039. 90$:    tst    exstac            ; /41/ Take exit with STATUS now ?
  1040.     beq    100$            ; /41/ No
  1041.     tst    cmdlun            ; /41/ Indirect command file running?
  1042.     beq    100$            ; /41/ No, ignore the error
  1043.     CALLS    close    ,<#LUN.TA>    ; /41/ Yes, abort the command file
  1044.     clr    cmdlun            ; /41/ No more indirect file active
  1045.     tst    mcrind            ; /41/ Were we running KER @Filename?
  1046.     beq    100$            ; /41/ No, drop to interactive mode
  1047.     jmp    c$exit            ; /41/ Yes, exit with STATUS please
  1048. 100$:    clr    exstac            ; /41/ Clear exit status
  1049.     br    10$            ; back to the command loop
  1050.  
  1051.  
  1052.     .save
  1053.     .psect    $PDATA    ,D
  1054. 200$:    .asciz    /Unrecognized command/<cr><lf>
  1055. 210$:    .asciz    /%Command not unique./<cr><lf>
  1056.     .even
  1057.     .restore
  1058.     .dsabl    lsb
  1059.  
  1060.     global    <argbuf,argpnt,binini,drpprv,fixchk,stack>
  1061.     global    <mcrind,exstac,exstal,cmdlun,exireq,logreq> ; /41/
  1062.     global    <jobtyp,status>                    ; /45/
  1063.  
  1064.  
  1065.  
  1066.     .sbttl    commands
  1067.     .enabl    lsb
  1068.  
  1069. c$rec::    $name    <REC>
  1070.     call    opentt            ; initialize the link line
  1071.     mov    pauset    ,oldpau        ; save old pause settings
  1072.     call    throtl            ; perhaps thottle the line speed
  1073.     tst    outopn            ; is an output file already open?
  1074.     beq    10$            ; no
  1075.     CALLS    close    ,<#lun.ou>    ; yes, close it up please
  1076. 10$:    CALLS    recsw    ,<#'R>        ; get the file
  1077.     tst    r0            ; did it work
  1078.     bne    20$            ; no
  1079.     CALLS    printm    ,<#1,#200$>    ; yes, say so if we are local
  1080.     br    100$            ; bye
  1081. 20$:    CALLS    printm    ,<#1,#210$>    ; it failed, say so iff local
  1082.     inc    status            ; /45/ Flag for BATCH exit
  1083. 100$:    call    clostt            ; release the terminal
  1084.     mov    oldpau    ,pauset        ; restore old pause setting
  1085.     message
  1086.     return
  1087.  
  1088.     .enabl    lc
  1089.     .save
  1090.     .psect    $PDATA    ,D
  1091. 200$:    .asciz    /Complete/<cr><lf>
  1092. 210$:    .asciz    /Receive failed/<cr><lf>
  1093.     .even
  1094.     .restore
  1095.     .dsabl    lsb
  1096.  
  1097.  
  1098.     global    <oldpau    ,pauset    ,throtl>
  1099.  
  1100.  
  1101.  
  1102.     .sbttl    send a file to pc
  1103.     .enabl    lsb
  1104.     .enabl    lc
  1105.  
  1106.  
  1107. c$send::$name    <SEN>
  1108.     clr    index            ; initialize for directory i/o
  1109.     tst    inopn            ; is an input file currently open
  1110.     beq    5$            ; no
  1111.     CALLS    close    ,<#lun.in>    ; yes, pelase close old file up
  1112. 5$:    call    opentt            ; open and initialize the terminal
  1113.     mov    argbuf    ,r1        ; address of command line buffer
  1114.     tstb    @r1
  1115.     bne    10$            ; yes
  1116.     message    <?Syntax   SEND Filename.type>,cr
  1117.     br    100$
  1118. 10$:    tst    sermode            ; are we a server now ?
  1119.     bne    15$            ; yes, don't delay sending it.
  1120.     tst    remote
  1121.     beq    15$
  1122.     CALLS    suspend    ,<sendly>    ; give them a moment to type REC
  1123.  
  1124. 15$:    mov    #srcnam    ,r2        ; /36/ destination address
  1125.     clrb    asname            ; /36/ no SEND f1 [AS] f2
  1126. 20$:    tstb    @r1            ; /36/ and of the line today ?
  1127.     beq    40$            ; /36/ yes, exit this loop
  1128.     cmpb    @r1    ,#40        ; /36/ if a space they may have typed
  1129.     beq    30$            ; /36/ SEND file [as] file
  1130.     movb    (r1)+    ,(r2)+        ; /36/ ok so far, copy the name over
  1131.     br    20$            ; /36/ next please
  1132. 30$:    inc    r1            ; /36/ found a <SPACE> in the cmd line
  1133.     cmpb    @r1    ,#40        ; /36/ assume not trailing control char
  1134.     blos    40$            ; /36/ no
  1135.     clrb    @r2            ; /36/ insure source name(s) asciz
  1136.     CALLS    iswild    ,<#srcnam>    ; /36/ check for wildcarding on the name
  1137.     tst    r0            ; /36/ if NE, then wildcarded
  1138.     bne    40$            ; /36/ can't rename outgoing if wildcard
  1139.     strcpy    #asname    ,r1        ; /36/ not wildcard, copy it
  1140. 40$:    clrb    @r2            ; /36/ insure source name .asciz
  1141.     CALLS    tlog    ,<#srcnam>    ; /46/ Expand logical if need be
  1142.     call    getnxt            ; get the first filename please
  1143.     tst    r0            ; did it work ?
  1144.     bne    100$            ; no. Getnxt will send the error pak
  1145.     CALLS    sendsw    ,<#'S>        ; now send the file
  1146.     tst    r0            ; did it work ?
  1147.     bne    90$            ; no
  1148.     CALLS    printm    ,<#1,#200$>    ; yes
  1149.     br    100$            ; bye
  1150. 90$:    CALLS    printm    ,<#1,#210$>    ; no
  1151.     inc    status            ; /45/ Flag for BATCH status
  1152. 100$:    call    clostt            ; exit
  1153.     message
  1154.     clrb    asname            ; /36/ insure no more alternate names
  1155.     return
  1156.     
  1157.  
  1158.     global    <cmdbuf    ,filsiz    ,index    ,inopn    ,sermod    ,srcnam    ,sendly>
  1159.     
  1160.     .save
  1161.     .psect    $PDATA    ,D
  1162. 200$:    .asciz    <7><7>/Send complete/<cr><lf>
  1163. 210$:    .asciz    <CR><LF><7><7>/Send failed/<cr><lf>
  1164.     .even
  1165.     .restore
  1166.     .dsabl    lsb
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.     .sbttl    open and close a link
  1173.     .enabl    lsb
  1174.  
  1175.  
  1176.  
  1177. opentt::tst    linksts            ; already open ?
  1178.     bne    100$            ; yes, ignore it then
  1179.     tst    remote            ; if remote
  1180.     beq    10$            ;  then ttname := ourname
  1181.     tst    inserv            ; but not if we are a server
  1182.     beq    5$            ; and the line number has been
  1183.     tstb    ttname            ; set already
  1184.     bne    10$            ;
  1185. 5$:    CALLS    gttnam    ,<#ttname>    ; get the terminal name here
  1186. 10$:    CALLS    ttyini    ,<#ttname,#lun.ti,#ter$pa>
  1187.     tst    r0
  1188.     bne    100$
  1189.     CALLS    ttysav    ,<#ttname>    ; save terminal settings
  1190.     CALLS    ttyset    ,<#ttname>    ; set some things now
  1191.     mov    sp    ,linksts    ; flag it as being open
  1192. 100$:    return
  1193.  
  1194.     .dsabl    lsb
  1195.  
  1196. clostt::save    <r0>
  1197.     CALLS    ttyfin    ,<#ttname,#lun.ti>
  1198.     CALLS    ttyrst    ,<#ttname>
  1199.     clr    linksts
  1200.     unsave    <r0>
  1201.     return
  1202.     
  1203.     global    <linksts,remote    ,rwdata    ,rwsize    ,ttname>
  1204.     global    <gttnam    ,ttyini    ,ttyrst    ,ttysav    ,ttyset>
  1205.     global    <chksiz    ,chktyp    ,defchk    ,mx$try    ,maxtry>
  1206.     global    <inserv>
  1207.  
  1208.  
  1209.  
  1210.  
  1211.     .sbttl    exit kermit-11
  1212.  
  1213. c$exit::call    sd$off
  1214. 10$:    tst    outopn
  1215.     beq    20$
  1216.     CALLS    close    ,<#lun.ou>
  1217. 20$:
  1218.     jmp    exit
  1219.  
  1220.     global    <exit>
  1221.  
  1222.  
  1223.  
  1224. c$nop::    return                ; a NO-OP command ???
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.     .sbttl    bye, finish and get
  1233.  
  1234.  
  1235.  
  1236. rmtbye::
  1237. c$bye::    $name    <BYE>
  1238.     call    ckremote        ; must not be remote for this
  1239.     bcs    100$            ; we are remote, abort this
  1240.     call    rembye            ; tell a server to logout
  1241. 100$:    return                ; back to command loop
  1242.  
  1243.  
  1244. rmtfin::
  1245. c$fin::    $name    <FIN>
  1246.     call    ckremote        ; must not be remote for this
  1247.     bcs    100$            ; we are remote, abort this
  1248.     call    remfin            ; tell a server to exit
  1249. 100$:    return                ; back to command loop
  1250.  
  1251.  
  1252.     .enabl    lsb
  1253.  
  1254. rmtget::
  1255. c$get::    $name    <GET>
  1256.     call    ckremote        ; must not be remote for this
  1257.     bcs    100$            ; we are remote, abort this
  1258.     clrb    asname            ; /36/ assume no names
  1259.     call    nextarg            ; /36/ if two files present use last one
  1260.     tstb    @r1            ; /36/ for new name (first file only)
  1261.     beq    10$            ; /36/ nothing present
  1262.     strcpy    #asname    ,r1        ; /36/ something there, copy it please
  1263.     clrb    -(r1)            ; /36/ get rid of last arg now
  1264. 10$:    CALLS    tlog    ,<argbuf>    ; /46/ Do any needed logical xlates
  1265.     CALLS    remget    ,<argbuf>    ; tell a server to get a file
  1266.     tst    r0            ; success ?
  1267.     beq    100$            ; yes
  1268.     CALLS    printm    ,<#1,#gmsg>    ; no
  1269.     inc    status            ; /45/ Failed
  1270.     br    110$
  1271. 100$:    BEEP2
  1272.     message    <Kermit: Get complete>,CR
  1273. 110$:    message
  1274.     clrb    asname            ; /36/ always fix [as file] name to null
  1275.     return                ; back to command loop
  1276.  
  1277.     .save
  1278.     .psect    $PDATA    ,D
  1279. gmsg:    .asciz    /Get from server aborted/<cr><lf>
  1280.     .even
  1281.     .restore
  1282.  
  1283.     .dsabl    lsb
  1284.  
  1285.  
  1286. rmtspa::$name    <SPA>
  1287.     call    remspa            ; issue a space ('U') generic command
  1288. 100$:    return
  1289.  
  1290.  
  1291. rmthlp::$name    <HEL>
  1292.     call    remhlp            ; issue a space ('U') generic command
  1293. 100$:    return
  1294.  
  1295.  
  1296. rmthos::$name    <HOS>
  1297.     CALLS    remhos    ,<argbuf>
  1298.     return
  1299.  
  1300.  
  1301. rmtdir::$name    <RDI>
  1302.     CALLS    remdir    ,<argbuf>    ; issue a dir ('D') generic command
  1303.     return
  1304.  
  1305.  
  1306. rmttyp::$name    <TYP>
  1307.     CALLS    remtyp    ,<argbuf>    ; issue a typ ('T') generic command
  1308.     return
  1309.  
  1310.  
  1311. rmtwho::$name    <WHO>
  1312.     CALLS    remwho    ,<argbuf>    ; issue a who ('W') generic command
  1313.     return
  1314.  
  1315.  
  1316. rmtdel::$name    <DEL>
  1317.     CALLS    remera    ,<argbuf>    ; issue a erase ('E') generic command
  1318.     return
  1319.  
  1320.  
  1321. rmtcwd::$name    <CWD>            ; Change Working Directory
  1322.     mov    argbuf    ,r1        ; check for optional password
  1323. 10$:    tstb    @r1            ; find eos yet ?
  1324.     beq    30$            ; yes exit
  1325.     cmpb    (r1)+    ,#40        ; look for a space
  1326.     bne    10$            ; nothing
  1327. 20$:    tstb    @r1            ; null here ?
  1328.     beq    30$            ; yes, no password present
  1329.     CALLS    remcwd    ,<argbuf,r1>    ; send password over also
  1330.     br    100$            ; and exit
  1331. 30$:    CALLS    remcwd    ,<argbuf,#null>    ; send the command to the server
  1332. 100$:    return                ; without any password trash
  1333.  
  1334.  
  1335. rmtlgi::$name    <LOG>            ; Login
  1336.     mov    argbuf    ,r1        ; check for optional password
  1337. 10$:    tstb    @r1            ; find eos yet ?
  1338.     beq    30$            ; yes exit
  1339.     cmpb    (r1)+    ,#40        ; look for a space
  1340.     bne    10$            ; nothing
  1341. 20$:    tstb    @r1            ; null here ?
  1342.     beq    30$            ; yes, no password present
  1343.     clrb    -1(r1)            ; insert null over the <space>
  1344.     CALLS    remlgi    ,<argbuf,r1>    ; send password over also
  1345.     br    100$            ; and exit
  1346. 30$:    CALLS    remlgi    ,<argbuf,#null>    ; send the command to the server
  1347. 100$:    return                ; without any password trash
  1348.  
  1349.  
  1350. rmtren::$name    <REN>            ; do a remote rename please
  1351.     call    gettwo            ; insure both arguments are here
  1352.     tst    r0            ; but did that work out ok ?
  1353.     bne    100$            ; no, just exit then please
  1354.     CALLS    remren    ,<cmdbuf,argbuf>; send a generic 'r' please
  1355. 100$:    return                ; bye
  1356.  
  1357.  
  1358. rmtcop::$name    <COP>            ; do a remote Kopy please
  1359.     call    gettwo            ; insure both arguments are here
  1360.     tst    r0            ; but did that work out ok ?
  1361.     bne    100$            ; no, just exit then please
  1362.     CALLS    remcop    ,<cmdbuf,argbuf>; send a generic 'K' please
  1363. 100$:    return                ; bye
  1364.  
  1365.  
  1366.  
  1367. ckremo:    tst    remote            ; are we local or remote
  1368.     bne    100$            ; local, ok
  1369.     clc                ; ok
  1370.     return                ; bye
  1371. 100$:    message    <KERMIT is not running as a LOCAL Kermit>,cr
  1372.     sec
  1373.     return
  1374.  
  1375.     global    <asname    ,cmdbuf    ,argbuf>
  1376.     global    <rembye    ,remdir    ,remera    ,remfin    ,remget    ,remhlp>
  1377.     global    <remspa    ,conesc    ,remote    ,ttdial    ,ttname>
  1378.     global    <remcop    ,remren>
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.     .sbttl    get the next command
  1386.     .enabl    lsb
  1387.  
  1388. ;    R E A D C M D
  1389. ;
  1390. ;    input:    @r5    buffer address
  1391. ;        2(r5)    prompt address
  1392. ;    output:    r0    error
  1393. ;        r1    byte count
  1394.  
  1395.  
  1396. readcmd:mov    r2    ,-(sp)        ; /41/
  1397. 10$:    tst    cmdlun            ; reading from indirect file
  1398.     beq    50$            ; no, do a read on the terminal
  1399.     inc    exstal            ; /41/ Increment command file line#
  1400.     CALLS    getrec    ,<@r5,#lun.ta>    ; yes, try to read a record
  1401.     tst    r0            ; did it work ?
  1402.     bne    30$            ; yes
  1403.  
  1404.     tst    tkecho            ; should we echo the prompt and
  1405.     beq    100$            ; the command string read ?
  1406.     tst    infomsg            ; /41/ Echo this ?
  1407.     beq    100$            ; /41/ No
  1408.     print    2(r5)            ; yes, print the passed prompt
  1409.     tst    r1            ; /56/ Anything there?
  1410.     beq    20$            ; /56/ No
  1411.     print    @r5    ,r1        ; and also echo the command.
  1412. 20$:    message                ; /56/ crlf
  1413.     mov    @r5    ,r2        ; Check for comment
  1414.     cmpb    @r2    ,#';        ; Well?
  1415.     beq    10$            ; Yes, ignore then
  1416.     cmpb    @r2    ,#'!        ; Well?
  1417.     beq    10$            ; Yes, ignore then
  1418.     br    100$            ; and exit with a success read
  1419.  
  1420. 30$:    cmp    r0    ,#ER$EOF    ; hopefully, it's end of file
  1421.     beq    40$            ; yes
  1422.     message    <Read error on TAKE file: >
  1423.     direrr    r0            ; no, print the RMS error number
  1424. 40$:    tst    sy.ini            ; from kermit.ini ?
  1425.     bne    45$            ; yes, don't print the message
  1426.     tst    infomsg            ; /41/ Really print the message
  1427.     beq    45$            ; /41/ no
  1428.     message    <TAKE file closed>,cr
  1429. 45$:    CALLS    close    ,<#lun.ta>    ; close the file on any errors
  1430.     clr    mcrind            ; /41/ No longer KER @Filename
  1431.     clr    sy.ini            ; no longer a kermit.ini
  1432.     clr    cmdlun            ; and read a command from TI:
  1433.  
  1434. 50$:    tst    mcrcmd            ; did we ever get a mcr command
  1435.     beq    60$            ; no
  1436.     tst    exieof            ; /45/ Do we really want EOF returned?
  1437.     beq    70$            ; /45/ No, just do a terminal READ
  1438.     mov    #-1    ,r0        ; yes, fake end of file then
  1439.     br    100$            ; bye
  1440. 60$:    CALLS    getmcr    ,<@r5>        ; no mcr command yet, check for it
  1441.     mov    r0    ,r1        ; did we get any characters there?
  1442.     clr    r0            ; say no errors
  1443.     mov    r1    ,mcrcmd        ; flag if we got a mcr command
  1444.     beq    70$            ; /41/ Nothing was there
  1445.     mov    @r5    ,r2        ; /41/ Check if KER @Filename.type
  1446.     cmpb    @r2    ,#'@        ; /41/ Well
  1447.     bne    80$            ; /41/ No
  1448.     mov    sp    ,mcrind        ; /41/ Yes, we will exit on error then
  1449. 80$:    br    100$            ; /41/ And take an exit bow
  1450.     
  1451. 70$:    CALLS    kbredi    ,<2(r5),@r5>    ; read a record from the terminal
  1452. 100$:    mov    (sp)+    ,r2        ; /41/
  1453.     return                ; bye
  1454.  
  1455.  
  1456.     .save
  1457.     .psect    $PDATA    ,D
  1458. tkecho::.word    -1            ; if <> then echo the take file
  1459.     .restore
  1460.  
  1461.     global    <cmdlun    ,argbuf    ,cmdbuf    ,er$eof    ,lun.ta    ,mcrcmd>
  1462.     global    <mcrind,infomsg>
  1463.  
  1464.     .dsabl    lsb
  1465.  
  1466.  
  1467.  
  1468.  
  1469.     .sbttl    the LOCAL command (basically, a NOP)
  1470.  
  1471.  
  1472. c$loc::    $name    <LOC>
  1473.     call    loacmd
  1474.     CALLS    getcm0    ,<argbuf,r0>
  1475.     tst    r0
  1476.     bmi    110$
  1477.     mov    r0    ,r3
  1478.     call    loacmd
  1479.     CALLS    getcm1    ,<argbuf,r0,r3>
  1480.     tst    r0
  1481.     bmi    110$
  1482.     jsr    pc    ,@r1
  1483. 110$:    return
  1484.  
  1485.  
  1486.     global    <argbuf>
  1487.  
  1488.  
  1489.  
  1490.  
  1491.     .sbttl    the REMOTE command
  1492.     .enabl    lsb
  1493.  
  1494. c$rem::    $name    <REM>
  1495.     call    ckremo            ; insure that we are remote
  1496.     bcs    120$            ; no, exit then
  1497.     call    loarem            ; get the command overlay in
  1498.     CALLS    getcm0    ,<argbuf,r0>    ; and try it please
  1499.     tst    r0            ; did we find the remote command
  1500.     bmi    110$            ; no
  1501.     mov    r0    ,r3        ; save the index (can't use r1)
  1502.     call    loarem            ; get the overlay resident
  1503.     CALLS    getcm1    ,<argbuf,r0,r3>    ; get any required args for command
  1504.     tst    r0            ; now could we get command arguements?
  1505.     bmi    120$            ; no
  1506.     jsr    pc    ,@r1        ; dispatch on it now please
  1507.     return
  1508. 110$:    message    <Unrecogized REMOTE command>,cr
  1509. 120$:    return
  1510.  
  1511.     .dsabl    lsb
  1512.  
  1513.     global    <loarem>
  1514.  
  1515.  
  1516. c$cwd::    strcpy    #defdir    ,argbuf        ; CWD command, same as SET DEF command
  1517.     clr    r0            ; no errors
  1518.     return                ; exit
  1519.  
  1520.  
  1521.  
  1522.  
  1523.     global    <sdirini,sdodir>
  1524.  
  1525. c$home::clrb    defdir
  1526.     clr    r0
  1527.     return
  1528. c$test::
  1529. xxsdia::call    shodia
  1530.     return
  1531.  
  1532.     GLOBAL    <shodia>
  1533.  
  1534.  
  1535.     .sbttl    get command from the attached terminal
  1536.  
  1537. ;    G E T C M D
  1538. ;
  1539. ;    input:    nothing
  1540. ;    output:    r0    command index in dispatch table
  1541. ;        r0    -1 (CMD$BAD) for invalid command
  1542. ;            -2 (CMD$EX)  for exit
  1543. ;    side effects:    cmdbuf written into
  1544.  
  1545.     cvtarg    =    4 + 10 + 20 + 40 + 200
  1546.  
  1547.     .name    =    0
  1548.     .minle    =    2
  1549.     .cmdad    =    4
  1550.     .cmdar    =    6
  1551.     .cmdat    =    10
  1552.  
  1553.     cmd$un    ==    -4
  1554.     cmd$ab    ==    -3
  1555.     cmd$ex    ==    -2
  1556.     cmd$bad    ==    -1
  1557.  
  1558. getcmd::clrb    @argbuf
  1559. 10$:    clr    cmdnum
  1560.     mov    cmdbuf    ,r4        ; point to the command buffer
  1561.     CALLS    readcmd    ,<r4,#prompt>    ; get from current input stream
  1562.     tst    r0            ; and exit if it failed for whatever
  1563.     bne    120$            ; oops
  1564.     tst    cccnt            ; time to exit on control C ?
  1565.     bne    120$            ; yep
  1566.     CALLS    cvt$$    ,<r4,r1,#cvtarg>; remove junk, convert to upcase
  1567.     tst    r0            ; anything left ?
  1568.     beq    10$            ; no, reprompt and try again
  1569.     add    cmdbuf    ,r0        ;
  1570.     clrb    @r0            ; .asciz
  1571.     call    loacmd            ; get the command list overlay
  1572.     CALLS    getcm0    ,<r4,r0>    ; search for the command
  1573.     mov    r1    ,cmdadr        ; store address of routine away
  1574.     mov    r0    ,cmdnum        ; store index of command away
  1575.     mov    r0    ,r3        ; did we actually find a command ?
  1576.     bmi    110$            ; no
  1577.     call    loacmd
  1578.     CALLS    getcm1    ,<r4,r0,r3>    ; now get the rest of the commandline
  1579.     tst    r0            ; or prompt for extra. Did it work
  1580.     bmi    110$            ; no
  1581. 100$:    mov    cmdnum    ,r0
  1582. 110$:    return
  1583.  
  1584. 120$:    mov    #cmd$ex    ,r0
  1585.     return
  1586.  
  1587.  
  1588.     global    <loacmd    ,prompt>
  1589.  
  1590.  
  1591.  
  1592.     .sbttl    getcm1    check for additional input needed
  1593.  
  1594. ;    G E T C M 1
  1595. ;
  1596. ;    input:    @r5    current command buffer
  1597. ;        2(r5)    command table address
  1598. ;        4(r5)    index of the current command
  1599. ;
  1600. ;    output:    r0    index of current command or < 0 for error
  1601. ;        argbuf    any additional input or rest of the command line
  1602.  
  1603.     .enabl    lsb            ; /55/
  1604.  
  1605. getcm1:    save    <r1,r2,r3>        ; Save registers that we destroy
  1606.     sub    #100    ,sp        ; /55/ Allocate a small buffer for
  1607.     mov    sp    ,r2        ; /55/ saving the command prompt.
  1608.     tst    wasnul            ; /45/ Was the command for ?
  1609.     beq    10$            ; /45/ No
  1610.     clr    wasnul            ; /45/ Not null anymore
  1611.     clr    r0            ; /45/ Yes, return index 0
  1612.     br    110$            ; /45/ Exit
  1613. 10$:    mov    @r5    ,r1        ; Get command line address
  1614.     scan    #40    ,r1        ; Look for a space that might delimit
  1615.     tst    r0            ; the command name from an argument
  1616.     beq    30$            ; Nothing there
  1617.     add    r1    ,r0        ; Point to the string after the space
  1618.     COPYZ    r0,argbuf,#200        ; Copy the command arg over please
  1619.     br    100$            ; And exit
  1620.  
  1621. 30$:    mov    4(r5)    ,r3        ; Get the command index
  1622.     mul    #$listl*2,r3        ; If no arg given, see if one is needed
  1623.     add    2(r5)    ,r3        ; Add in base address of command table
  1624.     mov    .cmdar(r3),r3        ; Get the argument prompt now
  1625.     tstb    @r3            ; Anything there that is required ?
  1626.     beq    100$            ; No, so take a normal exit then.
  1627.     STRCPY    r2    ,r3        ; /55/ Copy the prompt over now
  1628. 40$:    CALLS    kbredi    ,<r2,argbuf>    ; /55/ Read a command from the keyboard
  1629.     tst    r0            ; And exit if it failed for whatever
  1630.     bne    90$            ; The read failed (control Z typed).
  1631.     tst    cccnt            ; No, but is there a Control C?
  1632.     bne    90$            ; Yes, treat as end of file
  1633.     CALLS    cvt$$,<argbuf,r1,#cvtarg>;Remove junk, convert to upcase
  1634.     tst    r0            ; Is there anything left ?
  1635.     beq    40$            ; No, reprompt and try again
  1636.     mov    r0    ,r1        ; Something is left, point to the
  1637.     add    argbuf    ,r1        ; end of the line and null terminate
  1638.     clrb    @r1            ; ...
  1639.     br    100$            ; Take normal exit
  1640.  
  1641.  
  1642. 90$:    MESSAGE                ; /55/ Insure a carriage return
  1643.     mov    #cmd$ab    ,r0        ; Control Z on keyboard read.
  1644.     br    110$            ; And exit
  1645. 100$:    mov    4(r5)    ,r0        ; Return command index
  1646. 110$:    add    #100    ,sp        ; /55/ Pop the temporary buffer
  1647.     unsave    <r3,r2,r1>        ; Restore registers we used
  1648.     return                ; And exit
  1649.  
  1650.     .dsabl    lsb            ; /55/
  1651.  
  1652.     global    <argbuf    ,cmdadr    ,cmdbuf    ,cmdnum>
  1653.  
  1654.  
  1655.  
  1656.  
  1657.     .sbttl    getcm0    find the command in the table
  1658.  
  1659.  
  1660. ;    input:    @r5    command buffer
  1661. ;        2(r5)    first command descriptor block
  1662. ;    output:    r0    command index
  1663. ;        r1    dispatch address
  1664. ;
  1665. ;    errors:    r0    -1 (CMD$BAD)    unrecognized command
  1666. ;        r0    -4 (CMD$UN)    not unique
  1667. ;
  1668. ;    descriptor block:
  1669. ;
  1670. ;        .word    commandname text
  1671. ;        .word    minimum length
  1672. ;        .word    address of command itself
  1673. ;        .word    required argument prompt or a null for nothing
  1674. ;        .word    type of argument
  1675.  
  1676.     .enabl    lsb            ; /45/
  1677.  
  1678. getcm0::save    <r2,r3,r4>
  1679.     clr    wasnul            ; /45/ Not NULL (ie, ?) anymore
  1680.     clr    -(sp)            ; /39/ temp
  1681.     mov    @r5    ,r1        ; the passed command buffer
  1682.     strlen    r1            ; get the command length
  1683.     mov    r0    ,r3        ; error if nothing is there
  1684.     beq    110$            ; oops
  1685.  
  1686.     cmpb    @r1    ,#'?        ; /45/ Help desired today ?
  1687.     bne    9$            ; /45/ No
  1688.     mov    2(r5)    ,r4        ; /45/ Yes, get start of list
  1689.     message                ; /45/ A crlf
  1690. 5$:    mov    .name(r4),r1        ; /45/ Anything to dump?
  1691.     beq    8$            ; /45/ No, exit
  1692.     print    r1            ; /45/ The command text allowed
  1693.     print    #300$            ; /45/ Move over
  1694.     mov    .cmdar(r4),r1        ; /45/ Get address of prompt
  1695.     tstb    @r1            ; /45/ Prompting text?
  1696.     beq    7$            ; /45/ No
  1697.     print    .cmdar(r4)        ; /45/ The prompt text next
  1698. 7$:    message                ; /45/ A crlf
  1699.     add    #$listl*2,r4        ; /45/ Jump to the next entry
  1700.     br    5$            ; /45/ Yes, dump it
  1701. 8$:    mov    #nulcmd    ,r1        ; /45/ No, return NULCMD
  1702.     mov    sp    ,wasnul        ; /45/ Flag as having been NULL
  1703.     clr    r0            ; /45/ No errors from GETCM0
  1704.     br    200$            ; /45/ Exit please
  1705.  
  1706. 9$:    clr    r2            ; length := 0
  1707. 10$:    scan    (r1)+    ,#cmdch        ; is this character ok in name?
  1708.     tst    r0            ; find it in the list ?
  1709.     beq    20$            ; no, we have found enough
  1710.     inc    r2            ; command name len and pointer
  1711.     sob    r3    ,10$        ; next
  1712.  
  1713. 20$:    tst    r2            ; anything useful in cmd line
  1714.     ble    110$            ; No leading letters ????
  1715.     mov    2(r5)    ,r4        ; the list of edit commands
  1716.     clr    r3            ; R3 will have the command #
  1717.  
  1718. 30$:    tst    .name(r4)        ; anything left in the command list
  1719.     beq    110$            ; no
  1720.     strlen    .name(r4)        ; get the length of the command name
  1721.     CALLS    instr, <.name(r4),r0,@r5,r2> ; the next command?
  1722.     cmp    r0    ,#1        ; /39/ find anything ?
  1723.     bne    35$            ; /39/ no
  1724.     mov    r0    ,@sp        ; /39/ save it
  1725. 35$:    cmpb    r2    ,.minle(r4)    ; check if command length is ok
  1726.     blo    40$            ; no, not enough for the command
  1727.      dec    r0            ; if match = position 1 we have it
  1728.      beq    100$            ;  then 'found the command'
  1729. 40$:    inc    r3            ; commandnum := commandnum + 1
  1730.     add    #$listl*2,r4        ; cmdsaddr   := succ( cmdsaddr)
  1731.     br    30$
  1732.  
  1733.  
  1734. 100$:    mov    r3    ,r0        ; return command index and exit
  1735.     mov    .cmdad(r4),r1        ; return the command address also
  1736.     br    200$
  1737.  
  1738. 110$:    mov    #cmd$ba    ,r0        ; bad command
  1739.     dec    @sp            ; /39/ command not unique?
  1740.     bne    120$            ; /39/ no
  1741.     mov    #cmd$un    ,r0        ; /39/ yes, say so
  1742. 120$:    br    200$
  1743.  
  1744. 200$:    tst    (sp)+            ; /39/ pop it
  1745.     unsave    <r4,r3,r2>
  1746.     return
  1747.  
  1748.     .save
  1749.     .psect    $PDATA    ,D
  1750. 300$:    .asciz    /   /
  1751.     .even
  1752. cmdch:    .asciz    /0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-@_./
  1753.     .even
  1754.     .restore
  1755.  
  1756.     .dsabl    lsb
  1757.  
  1758.  
  1759.     .sbttl    cctrap    the control C trap
  1760.     .enabl    lsb
  1761.  
  1762. cctrap::cmp    cccnt    ,#cc$max
  1763.     bhi    100$
  1764.     CALLS    setcc    ,<#cctrap>
  1765.     inc    cccnt
  1766.     return
  1767.  
  1768. 100$:    tst    inserv
  1769.     beq    110$
  1770.     call    rstsrv
  1771. 110$:    tst    infomsg                    ; /43/
  1772.     beq    120$                    ; /43/
  1773.     message    <Exiting due to control C interupt>,cr    ; /43/
  1774. 120$:    jmp    c$exit
  1775.  
  1776.     global    <cccnt    ,exit    ,inserv    ,rstsrv    ,infomsg>
  1777.  
  1778.  
  1779.     .dsabl    lsb
  1780.  
  1781.  
  1782.  
  1783. ;    D I R E R $
  1784. ;
  1785. ;    called from DIRERR value    macro
  1786.  
  1787.     .enabl    lsb
  1788.  
  1789.  
  1790. direr$::mov    r0    ,-(sp)        ; direrr will select whether or not
  1791.     mov    4(sp)    ,r0        ; to call rms error or FIP (or DIR)
  1792.     beq    10$            ; error based on whether the error
  1793.     CALLS    syserr    ,<r0,#errtxt>    ; code is < 0 (implies RMS) or > 0
  1794.     print    #errtxt            ; which  implies either FIP  (RSTS)
  1795.     message                ; or a DIRECTIVE error (RSX).  Thus
  1796. 10$:    mov    (sp)+    ,r0        ; for RSX all error codes should be
  1797.     mov    @sp    ,2(sp)        ; made > 0 for non RMS errors.
  1798.     tst    (sp)+            ; error 0 is a no-op.
  1799.     return
  1800.  
  1801.     .dsabl    lsb
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.     
  1808. nextar::mov    argbuf    ,r1
  1809. 10$:    tstb    @r1
  1810.     beq    100$
  1811.     cmpb    (r1)+    ,#40
  1812.     bne    10$
  1813. 100$:    return
  1814.  
  1815.  
  1816. nulcmd::clr    r0            ; /45/ No errors
  1817.     return                ; /45/ Exit
  1818.  
  1819.  
  1820.     .end    kermit
  1821.