home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pub / trs80model4 / m4str.asm < prev    next >
Assembly Source File  |  2020-01-01  |  19KB  |  668 lines

  1. ;    M4STR/ASM
  2. ;Pure storage.
  3. FLINK    DS    256        ;FAILURE LINK STORAGE
  4. STRING    DS    256        ;STORAGE FOR THE STRING TO MATCH
  5. LENGTH    DB    0        ;LENGTH OF STRING
  6. BUFPTR    DW    0        ;POINTER INTO THE BUFFER
  7. MULBUF    DS    256        ;THE BUFFER
  8. CTLTBL    DB    35
  9.     DB    'ACK',6,254,'BEL',7,254,'BS',8,254
  10.     DB    'CAN',24,254,'CR',13,254,'DC1',17,254
  11.     DB    'DC2',18,254,'DC3',19,254,'DC4',20,254
  12. DLY    EQU    250
  13.     DB    'DEL',127,254,'DLE',16,254,'DLY*',DLY,254
  14.     DB    'EM',25,254,'ENQ',5,254,'EOT',4,254
  15.     DB    'ESC',27,254,'ETB',23,254,'ESC',27,254
  16.     DB    'FF',12,254,'FS',28,254,'GS',29,254
  17.     DB    'HT',9,254,'LF',10,254,'NAK',21,254
  18.     DB    'NUL',0,254,'RS',30,254,'SI',15,254
  19.     DB    'SO',14,254,'SOH',1,254,'SPA',32,254
  20.     DB    'STX',2,254,'SUB',26,254,'SYN',22,254
  21.     DB    'VS',31,254,'VT',31,254
  22.     DB    0
  23. GTSTRG    DS    6        ;String space for storing above ANSI strs
  24. WLDBUF    DS    6        ;Save wildcards here
  25. ALRMAD    DW    ALARM        ;Delay TCB
  26. TIMER    DW    0        ;Counter
  27. RECTIME    DW    RECTIMOUT    ;Receive timeout TCB
  28. SVTIMER    DW    0
  29. TKNAME    DB    'KERMIT/INI',13    ;Name of the initialization file
  30. TKLEN    EQU    $-TKNAME    ;Length of the name
  31. ;    THE FOLLOWING FLAGS ARE STATE FLAGS FOR WHEN EOF OCCURS.
  32. ;    IF ANY ARE SET WHEN EOF OCCURS THAN AN ERROR HAS OCCURED.
  33. INBUF    DS    102H        ;FILE INPUT BUFFER
  34. HSTCHR    DB    0        ;TERMINATOR FROM THE HOST IN '*'
  35. DLYFLG    DB    0        ;WAS A DELAY INVOKED
  36. CHRGOT    DB    0        ;ACTUAL CHARACTER FROM THE FILE
  37. ;    PARSING OPTION FLAGS
  38. CSEFLG    DB    0        ;IGNORE CASE FLAG
  39. SPTFLG    DB    0        ;ECHOING OF SET OPTIONS IS ON
  40. ECHFLG    DB    0        ;IS ECHO OF SENT STRINGS ON
  41. EXTFLG    DB    1        ;EXIT AT EOF FLAG
  42. ;    EARLY EOF STATE FLAGS
  43. ESFLG    DB    0        ;ESCAPE CHARACTER SEQUENCE
  44. CTLFLG    DB    0        ;CONTROL CHARACTER SEQUENCE
  45. SNDFLG    DB    0        ;SEND STATE FLAG
  46. RECFLG    DB    0        ;RECEIVE SATE FLAG
  47. MULFLG    DB    0        ;MULTI-SEND STATE FLAG
  48. OPTFLG    DB    0        ;SET OPTIONS STATE FLAG
  49. BUFFSIZE    EQU    2048        ;Size of buffer
  50. SRCPTR        DW    0        ;Source string pointer
  51. HASWILD        DB    0        ;Wild cards present flag
  52. SPAT        DW    0        ;Pattern pointer
  53. SSTR        DW    0        ;String pointer
  54. PSAVE        DW    0        ;Saved pattern pointer
  55. SSAVE        DW    0        ;Saved string pointer
  56. SDIRDRV        DB    '0'        ;Saved current drive
  57. DIRBUFF        DS    256        ;Buffer for DIR/SYS record
  58. COMPNAME    DS    32        ;Complete file name
  59. FNLEN        DB    0        ;Length of pattern
  60. MOREDRV        DB    0        ;More drives to check flag
  61. DIRFCB        DB    'DIR/SYS:'    ;Directory file control block
  62. DIRDRV        DB    '0',CR        ;Where to put the drive number
  63.         DC    23,0        ;Remaining, for 33 bytes total
  64. TFBUF        DS    256        ;Current pattern storage
  65. FILEBUFF    DS    BUFFSIZE    ;Place for file name list
  66. FBPTR        DW    FILEBUFF    ;Pointer to next available space
  67. FILECNT        DB    0        ;Number of file names in FILEBUFF
  68. DIRSPEC        DB    'DIR/SYS:'    ;DIR/SYS pattern
  69. DLEN        EQU    $-DIRSPEC    ;Length of text to move
  70. PARMS        DB    80H        ;@PARAM parse table
  71.         DB    56H
  72.         DB    'SYSTEM'
  73. SYSRESP        DB    0
  74.         DW    SYSFLAG
  75.         DB    55H
  76.         DB    'INVIS'
  77. INVRESP        DB    0
  78.         DW    INVFLAG
  79.         DB    0
  80. SYSFLAG        DW    0
  81. INVFLAG        DW    0
  82. BADCD    DB    13,'Bad code inside of <...>',39,'s',EOS
  83. NOECHO    DB    13,'Host did not echo last character sent',13,EOS
  84. QUTMES    DB    13,'Ignoring => ',EOS
  85. STOBIG    DB    13,'String too big for buffer!',13,EOS
  86. LGFAIL    DB    13,'Operation aborted!',13,EOS
  87. PREESC    DB    13,'Missing character following \',13,EOS
  88. PRECTL    DB    13,'Missing character following ^',13,EOS
  89. PREOPT    DB    13,'Missing > in <...> sequence',13,EOS
  90. TXTHLP    DB    CR,16,'Enter a text string',17,CR,EOS
  91. FILHLP    DB    CR,16,'Enter a file specification!',17,CR,EOS
  92. NUMHLP    DB    CR,16,'Enter a Decimal number!',17,CR,EOS
  93. FILESFND    DB    'Sending files:',CR,EOS
  94. NOFILES    DB    16,'No files found',17,CR,EOS
  95. OUTOFSTR    DB    16,'Too many files, out of space',17,CR,EOS
  96. NOTIMER    DB    CR,16,'No task slots available for timeout',17,CR,EOS
  97. NODELAY    DB    CR,16,'No task slots available for delay, using 1 second'
  98.     DB    17,CR,EOS
  99. NOMEM    DB    CR,16,'Can',39,'t move LOW$ to new value',17,CR,EOS
  100. BADPARM    DB    CR,'Bad parameter list',CR,EOS
  101. TRANABRT    DB    'Transaction aborted',CR,EOS
  102. TRANCANC    DB    'Transaction canceled',CR,EOS
  103. WRTPROT    DB    CR,'Drive is write protected',EOS
  104. DSKOK    DB    CR,'Default drive changed',CR,EOS
  105. REMOVSTR    DB    'Removing: ',EOS
  106. TIMEMES    DB    '   Time: ',EOS
  107. LOGERROR    DB    'Log file I/O error.  '
  108. ERMS20    DB    'Log file CLOSED!',CR,EOS
  109. BLANKS    DB    '    ',EOS
  110. INTRO    DB    CR,'TRS-80 Model 4(p) TRSDOS 6.2 - KERMIT - Version'
  111.     DB    ' 5.2',CR,'By Gregg Wonderly',CR,CR
  112.     DB    'Type a ? for help at any time....',CR,EOS
  113. CFCL    DB    CR,'No *CL DCB!',CR,EOS
  114. CFSO    DB    CR,'No *SO DCB!',CR,EOS
  115. CFSI    DB    CR,'No *SI DCB!',CR,EOS
  116. NONDCB    DB    CR,'Can not find a DCB for the *FI or *FO devices!'
  117.     DB    CR,EOS
  118. NOSPACE    DB    CR,'Not enough space left for definition',CR,EOS
  119. KPLUS    DB    'K + ',EOS
  120. BYTESMES    DB    ' bytes transfered.',EOS
  121. KEYHELP    DB    CR,'Press keystroke you desire: ',EOS
  122. STRHELP    DB    CR,'Enter definition string, end with <BREAK> '
  123.     DB    '(255 characters MAX)',CR,EOS
  124. SPACSTR    DB    CR,'Remaining key definition space: ',EOS
  125. TOOLONG    DB    CR,'String too long for one packet!',CR,EOS
  126. NPKTSTR    DB    CR,'Number of packets  => ',EOS
  127. NRTRSTR    DB    CR,'Number of retries  => ',EOS
  128. NCHRSTR    DB    CR,'Bytes transfered   => ',EOS
  129. NRECCH    DB    CR,'Kbytes received    => ',EOS
  130. NSNDCH    DB    CR,'Kbytes transmitted => ',EOS
  131. CBATCH    DB    32,16,'[Cancelling batch]',17,32,EOS
  132. CFILE    DB    32,16,'[Cancelling file]',17,32,EOS
  133. UNKNOWN    DB    CR,'Unknown packet type',CR,EOS
  134. HELPMSG    DB    CR,'     CTRL-F => Cancel file            '
  135.     DB    'CTRL-B => Cancel Batch'
  136.     DB    CR,'     CTRL-C => Quit protocol          '
  137.     DB    'CTRL-A => Transfer status'
  138.     DB    CR,'     CTRL-D => Toggle debugging       '
  139.     DB    'CTRL-H => This message'
  140.     DB    CR,'     CTRL-E => Send error, quit       '
  141.     DB    'ENTER  => Resend last packet',CR,EOS
  142. RMMES    DB    BELL,32,16,'[Discarded]',17,32,EOS
  143. DO62DR    DB    'CAT '
  144. DO61DR    DB    'DIR '
  145. DIRCMD    DS    4
  146. DIRBUF    DS    256
  147. DEFTRLOG    DB    'TRANS/LOG',CR
  148. DEFSESLOG    DB    'SESSION/LOG',CR
  149. DEFDEBLOG    DB    'DEBUG/LOG',CR
  150. DECBUF    EQU    $
  151. NBUFF    DS    6
  152. VISIBLE    DB    0
  153. THEVAL    DW    0
  154. RMTPTR    DW    0
  155. OUTADDR    DW    0
  156. PREVCH    DB    0
  157. CURLEN    DB    0
  158. MAXLEN    DB    0
  159. CURCOL    DB    0
  160. MAXCOL    DB    78
  161. RPTFLG    DB    0
  162. NEXT    DW    0
  163. RPTCNT    DB    0
  164. RPTQ    DB    '~'
  165. EBQFLG    DB    1
  166. EBQ    DB    '&'
  167. MYCTLQ    DB    '#'
  168. LEFTOVER    DS    7
  169. CH    DW    0
  170. DISCARD    DB    0
  171. LOGNAMES    DB    1
  172. INITRMT    DW    0
  173. INITCNT    DW    0
  174. PKTTYPE    DB    0
  175. FLDLEN    DW    0
  176. KTRANS    DW    0
  177. RTRANS    DW    0,0
  178. STRANS    DW    0,0
  179. CURTRANS    DW    0,0
  180. SOUPTR    DW    0
  181. XOFREC    DB    0
  182. TAKLOG    DB    0
  183. RECTYP    DB    0
  184. SNDTYP    DB    0
  185. INDSP    DB    0
  186. OTDSP    DB    0
  187. PREVLCHR    DB    0    ;Previous character logged to session log
  188. TRTAB    DB    0,1,2,3,4,5,6,7,24,9,26,11,12,29,0,0,16,17,18,19,20
  189.     DB    21,22,23,24,25,26,27,28,29,30,31,32,33
  190. KEYTABLE    DC    512,0    ;Must be 256 words of zeroes
  191.     DW    0        ;A little padding for off by one errors
  192. TOPADDR    DW    DEFTABLE
  193. DEFTABLE    DS    2048    ;Key definition space
  194. DEFTLEN        EQU    $-DEFTABLE
  195. KEYPOS    DW    ATNULL        ;Initial buffered string pointer
  196. ATNULL    DB    0        ;A null byte to signal no characters
  197. DIFFADDR    DW    0
  198. STRINGLEN    DB    0
  199. SAVEDKEY    DB    0
  200. KEYSTRING    DW    0
  201. KEYNUMBER    DB    0
  202. TABLEADDR    DW    0
  203. CMPADDR    DW    0
  204. MOVEDIFF    DW    0
  205. KEYNUM    DB    0
  206. KEYPTR    DW    0
  207. KEYLEN    DB    0
  208. OUTRNG    DB    CR,'Value out of range!!',CR,EOS
  209. NODEF    DB    CR,'No definition exists',EOS
  210. SOUFCB    DS    40
  211. TAKFLG    DB    0
  212. INCNT    DB    0
  213. XFFLG    DB    0
  214. FLOFLG    DB    1
  215. TFCB    DS    32
  216. OLDLOW    DW    0
  217. FLAGS    DW    0
  218. BEPLEN    DB    0
  219. BELFLG    DB    1
  220. CLDCB    DW    0
  221. TMIDCB    DW    0
  222. TMODCB    DW    0
  223. RFIDCB    DW    0
  224. MAXCNT    DB    180
  225. SVMAX    DB    80
  226. DISFLG    DB    1
  227. HLPMES    DB    8,' One of the following...',CR,EOS
  228. SORFLG    DB    0
  229. MAXTRY    DB    7
  230. GENTYPE    DB    0
  231. GENLEN    DB    0
  232. SORLOC    DW    0
  233. LOGOPN    DB    CR,16,'Logfile is already OPEN!',17,CR,EOS
  234. NOLOGF    DB    CR,16,'Logfile is not OPEN!',17,CR,EOS
  235. SNDREC    DB    EOS
  236. KERREC    DB    13,'Receiving => ',EOS
  237. KERSND    DB    13,'Sending => ',EOS
  238. DSSOP    EQU    1
  239. DRSOP    EQU    1
  240. SWTBUF    DS    2048
  241. CONCRS    DW    0
  242. CMDCRS    DW    0
  243. FTIME    DB    0
  244. SNDST    DB    0
  245. TIME    DB    30H
  246. TBUF    DS    256    ;TAKE COMMAND INPUT BUFFER.
  247. ;
  248. ;    The next 512 bytes produce a 256 byte circular buffer for
  249. ;    the communications input routine.
  250. ;
  251.     DS    256
  252. CHRBUF    DS    256
  253. CURCHR    DW    CHRBUF        ;Buffer is initially empty
  254. NXTCHR    DW    CHRBUF
  255.     DB    'SETCOM '
  256. CLBUF    DS    256
  257. KERM    DB    14,16,17,'KERMIT 4(p)>',EOS    ;cursor on at prompt
  258. CRLF    DB    CR,EOS
  259. ERMES1    DB    CR,16,'Unrecognized command',17,CR,EOS
  260. ERMES2    DB    CR,16,'Illegal character',17,CR,EOS
  261. ERMES3    DB    CR,16,'Not confirmed',17,CR,EOS
  262. ERMES4    DB    'Unable to receive initiate',CR,EOS
  263. ERMES5    DB    'Unable to receive file name',CR,EOS
  264. ERMES6    DB    'Unable to receive end of file',CR,EOS
  265. ERMS10    DB    'Unable to receive data',CR,EOS
  266. ERMS17    DB    CR
  267. ERMS11    DB    'System DOS error',CR,EOS
  268. ERMS14    DB    'No acknowledgement from the host',CR,EOS
  269. ERMS15    DB    CR,'Unable to find file',CR,EOS
  270. ERMS16    DB    'Unable to rename file',EOS
  271. ERMS18    DB    CR,'Unable to tell host that the session is finished',EOS
  272. ERMS19    DB    CR,'Unable to tell host to logout',EOS
  273. INFMS3    DB    BELL,CR,'Completed',EOS
  274. INFMS4    DB    BELL,'Failed',EOS
  275. INFMS5    DB    'Renaming file => ',EOS
  276. INFMS6    DB    CR,'<Closing the log file>',EOS
  277. INFMS7    DB    CR,'<Connected to remote host, type ',EOS
  278. INFMS8    DB    'C to return>',CR
  279.     DB    '<CLEAR> is Control-',95,CR,EOS
  280. INFMS9    DB    CR,'<Connection closed, back at micro>',EOS
  281. INMS10    DB    'Control-',EOS
  282. INMS13    DB    BELL,CR,'Interrupted',EOS
  283. INMS18    DB    CR,'File KILLED',EOS
  284. CFRMES    DB    CR,16,'Confirm with <ENTER>, cancel with <BREAK>',17,CR
  285.     DB    EOS
  286. CMIN00    EQU    CFRMES
  287. ABRTMSG    DB    'Transfer aborted...'
  288. ABRTMSGLEN    EQU    $-ABRTMSG
  289. ESCMES    DB    CR,'Type the new escape character: ',EOS
  290. INTHLP    DB    16,CR,17,CR,CR
  291.     DB    '    ? =  This message',CR
  292.     DB    '    0 =  (zero) Transmit a NULL',CR
  293.     DB    '    B =  Send modem break',CR
  294.     DB    '    C =  Close the connection',CR
  295.     DB    '    Q =  Quit logging session',CR
  296.     DB    '    R =  Resume logging session',CR,CR
  297.     DB    'Type the escape character again to send it to the host.'
  298.     DB    16,CR,17,EOS
  299. ;
  300. SENDRECV    DB    '                       ',16,'Send',17,'  ',16
  301.         DB    'Receive',17,'  |  ',EOS
  302. INPUTSTR    DB    16,'Input settings',17,'                        '
  303.         DB    '|  ',EOS
  304. OUTPUTSTR    DB    16,'Output settings',17,'                       '
  305.         DB    '|  ',EOS
  306. SEPAR    DB    '      |  ',EOS
  307. ONSTR    DB    16,'ON',17,EOS
  308. OFFSTR    DB    16,'OFF',17,EOS
  309. XONSTR    DB    16,'XON-XOFF',17,EOS
  310. NONSTR    DB    16,'NONE',17,EOS
  311. NOESTR    EQU    NONSTR
  312. ASCIIST    DB    16,'ASCII',17,EOS
  313. BINST    DB    16,'BINARY',17,EOS
  314. DMESTR    DB    16,'DUMB',17,EOS
  315. DSCRDST    DB    16,'DISCARD',17,EOS
  316. KEEPST    DB    16,'KEEP',17,EOS
  317. ;
  318. ;
  319. ;    Miscellaneous SET strings
  320. ;
  321. BELSTR        DB    'Bell: ',EOS
  322. PNTSTR        DB    'Printer: ',EOS
  323. BUGST        DB    'Debugging: ',EOS
  324. TYPEST        DB    'File type: ',EOS
  325. LOCST        DB    'Local echo: ',EOS
  326. ESCST        DB    'Escape char: ',EOS
  327. FILST        DB    'File warning: ',EOS
  328. FLOWST        DB    'Flow control: ',EOS
  329. DSKDEF        DB    'Default drive: ',EOS
  330. EMSTR        DB    'Emulation type: ',EOS
  331. DISPST        DB    'File disposition: ',EOS
  332. BCKST        DB    'Block check type: ',EOS
  333. TAKST        DB    'Display TAKE file: ',EOS
  334. EIGHTSTR    DB    'Eight bit quoting: ',EOS
  335. ;
  336. ;    This value must be the length of the longest of the
  337. ;    above strings (except the ending EOS).
  338. ;
  339. SHSTRLEN    EQU    $-EIGHTSTR-1
  340. ;
  341. ;    Send/Recv strings
  342. ;
  343. EOLST        DB    'End-of-line:  ',EOS
  344. RETST        DB    'Turn around:  ',EOS
  345. PCHST        DB    'Pad character:  ',EOS
  346. QTEST        DB    'Control quote:  ',EOS
  347. TOST        DB    'Time out value:  ',EOS
  348. PADST        DB    'Padding Length:  ',EOS
  349. SOPST        DB    'Start-of-packet:  ',EOS
  350. SRSTRLEN    EQU    $-SOPST+2
  351. ;
  352. ;    Input strings (Length must fit within SRSTRLEN)
  353. ;
  354. IDSPST        DB    'Display input:  ',EOS
  355. CSEST        DB    'Ignore case:  ',EOS
  356. ;
  357. ;    Output strings (Length must fit within SRSTRLEN)
  358. ;
  359. ODSPST        DB    'Display output:  ',EOS
  360. HSTEST        DB    'Match echo:  ',EOS
  361. ;
  362. BCKST1    DB    '-character',EOS
  363. RPPOS    DB    'RPack=>',EOS
  364. SPPOS    DB    'SPack=>',EOS
  365. CLRTOP    DB    1CH,1FH,EOS    ;clear screen
  366. ;
  367. ;    COMND tables
  368. ;
  369. ;    Structure of command table
  370. ;
  371. ;    1) Number of entries.
  372. ;    2) Length of longest keyword + 2
  373. ;    3) Each entry is arranged as follows
  374. ;        a) visibility byte, 1-command is visible, 2-invisible
  375. ;        b) length of command in bytes.
  376. ;        c) 'name of command and eos'
  377. ;        d) offset into command table at KERMTB
  378. ;        e) offset into command table at KERMTB
  379. ;
  380. ;    ---> Note this command table is in alphabetic order.
  381. ;
  382. COMTAB    DB    30    ;Number of keywords in table
  383.     DB    9    ;LONGEST KEYWORD + 2
  384.     DB    1,3,'BYE',EOS,33,33
  385.     DB    0,1,'C',EOS,6,6
  386.     DB    1,5,'CLEAR',EOS,63,63
  387.     DB    1,5,'CLOSE',EOS,66,66
  388.     DB    1,7,'CONNECT',EOS,6,6
  389.     DB    1,3,'DIR',EOS,36,36
  390.     DB    0,1,'E',EOS,3,3
  391.     DB    1,4,'ECHO',EOS,69,69
  392.     DB    1,4,'EXIT',EOS,3,3
  393.     DB    1,6,'FINISH',EOS,27,27
  394.     DB    1,3,'GET',EOS,12,12
  395.     DB    1,5,'INPUT',EOS,51,51
  396.     DB    1,4,'KILL',EOS,39,39
  397.     DB    0,1,'L',EOS,42,42
  398.     DB    1,5,'LOCAL',EOS,42,42
  399.     DB    1,3,'LOG',EOS,9,9
  400.     DB    1,6,'LOGOUT',EOS,30,30
  401.     DB    1,6,'OUTPUT',EOS,54,54
  402.     DB    1,5,'PAUSE',EOS,57,57
  403.     DB    1,5,'PULSE',EOS,60,60
  404.     DB    0,1,'R',EOS,12,12
  405.     DB    1,7,'RECEIVE',EOS,12,12
  406.     DB    1,6,'REMOTE',EOS,0,0
  407.     DB    0,1,'S',EOS,15,15
  408.     DB    1,4,'SEND',EOS,15,15
  409.     DB    1,3,'SET',EOS,18,18
  410.     DB    1,6,'SETCOM',EOS,45,45
  411.     DB    1,4,'SHOW',EOS,21,21
  412.     DB    1,6,'STATUS',EOS,24,24
  413.     DB    1,4,'TAKE',EOS,48,48
  414. MXSLEN    EQU    19
  415. SHOTAB    DB    SHLEN/3+1
  416.     DB    MXSLEN        ;LONGEST KEYWORD + 2
  417.     DB    1,3,'ALL',EOS    ;THE OTHER TWO BYTES WILL BE SUBSTITUTED
  418. SETTAB    DB    SHLEN/3        ;Number of entries in the jump table
  419.     DB    MXSLEN        ;LONGEST KEYWORD + 1
  420.     DB    1,4,'BELL',EOS,27,27
  421.     DB    1,16,'BLOCK-CHECK-TYPE',EOS,12,12
  422.     DB    1,9,'DEBUGGING',EOS,21,21
  423.     DB    1,12,'DEFAULT-DISK',EOS,24,24
  424.     DB    1,17,'EIGHT-BIT-QUOTING',EOS,6,6
  425.     DB    1,9,'EMULATION',EOS,15,15
  426.     DB    1,6,'ESCAPE',EOS,0,0
  427.     DB    1,4,'FILE',EOS,9,9
  428.     DB    1,12,'FLOW-CONTROL',EOS,39,39
  429.     DB    1,5,'INPUT',EOS,41,41
  430.     DB    1,3,'KEY',EOS,36,36
  431.     DB    1,10,'LOCAL-ECHO',EOS,3,3
  432.     DB    1,6,'OUTPUT',EOS,45,45
  433.     DB    1,7,'PRINTER',EOS,18,18
  434.     DB    1,7,'RECEIVE',EOS,30,30
  435.     DB    1,4,'SEND',EOS,33,33
  436.     DB    1,12,'TAKE-DISPLAY',EOS,48,48
  437. ;
  438. ;    File options
  439. ;
  440. FILETAB    DB    3
  441.     DB    13
  442.     DB    1,11,'DISPOSITION',EOS,0,0
  443.     DB    1,4,'TYPE',EOS,3,3
  444.     DB    1,7,'WARNING',EOS,6,6
  445. ;
  446. ;    File disposition options
  447. ;
  448. DISPTAB    DB    2
  449.     DB    9
  450.     DB    1,7,'DISCARD',EOS,1,1
  451.     DB    1,4,'KEEP',EOS,0,0
  452. ;
  453. ;    Remote commands parse table
  454. ;
  455. RMTTAB    DB    21
  456.     DB    16
  457.     DB    1,9,'CLOSE-LOG',EOS,42,42
  458.     DB    1,4,'COPY',EOS,30,30
  459.     DB    1,3,'CWD',EOS,0,0
  460.     DB    1,6,'DELETE',EOS,3,3
  461.     DB    1,3,'DIR',EOS,6,6
  462.     DB    1,4,'DISK',EOS,9,9
  463.     DB    1,4,'HELP',EOS,12,12
  464.     DB    1,4,'HOST',EOS,15,15
  465.     DB    1,6,'KERMIT',EOS,18,18
  466.     DB    1,5,'LOGIN',EOS,54,54
  467.     DB    1,7,'MESSAGE',EOS,33,33
  468.     DB    1,7,'PROGRAM',EOS,57,57
  469.     DB    1,14,'QUERY-VARIABLE',EOS,39,39
  470.     DB    1,6,'RENAME',EOS,24,24
  471.     DB    1,8,'SEND-LOG',EOS,45,45
  472.     DB    1,13,'SERVER-STATUS',EOS,60,60
  473.     DB    1,12,'SET-VARIABLE',EOS,36,36
  474.     DB    1,9,'START-LOG',EOS,48,48
  475.     DB    1,8,'STOP-LOG',EOS,51,51
  476.     DB    1,4,'TYPE',EOS,27,27
  477.     DB    1,3,'WHO',EOS,21,21
  478. ;
  479. ;    Emulation type parse table
  480. ;
  481. EMLTAB    DB    2
  482.     DB    6
  483.     DB    1,4,'DUMB',EOS,3,3
  484.     DB    1,4,'NONE',EOS,0,0
  485. ;
  486. ;    Close options parse table
  487. ;
  488. CLSTAB    DB    3
  489.     DB    13
  490.     DB    1,5,'DEBUG',EOS,1,1
  491.     DB    1,7,'SESSION',EOS,0,0
  492.     DB    1,11,'TRANSACTION',EOS,2,2
  493. ;
  494. ;    Clear command options parse table
  495. ;
  496. CLRTAB    DB    2
  497.     DB    12
  498.     DB    1,10,'INPUT-PORT',EOS,0,0
  499.     DB    1,6,'SCREEN',EOS,3,3
  500. ;
  501. ;    Flow control options parse table
  502. ;
  503. FLOTAB    DB    2
  504.     DB    10
  505.     DB    1,4,'NONE',EOS,0,0
  506.     DB    1,8,'XON-XOFF',EOS,1,1
  507. ;
  508. ;    SET SEND/RECEIVE options parse table
  509. ;
  510. STSNTB    DB    7
  511.     DB    17
  512.     DB    1,11,'END-OF-LINE',EOS,12,12
  513.     DB    1,8,'PAD-CHAR',EOS,0,0
  514.     DB    1,7,'PADDING',EOS,3,3
  515.     DB    1,15,'QUOTE-CHARACTER',EOS,15,15
  516.     DB    1,15,'START-OF-PACKET',EOS,6,6
  517.     DB    1,8,'TIME-OUT',EOS,9,9
  518.     DB    1,9,'TURN-CHAR',EOS,18,18
  519. ;
  520. ;    SET OUTPUT options parse table
  521. ;
  522. OUTTAB    DB    2
  523.     DB    11
  524.     DB    1,9,'HOST-ECHO',EOS,0,0
  525.     DB    1,7,'DISPLAY',EOS,3,3
  526. ;
  527. ;    SET INPUT options parse table
  528. ;
  529. INPTAB    DB    2
  530.     DB    13
  531.     DB    1,11,'CASE-IGNORE',EOS,0,0
  532.     DB    1,7,'DISPLAY',EOS,3,3
  533. ;
  534. ;    SET FILE TYPE options parse table
  535. ;
  536. TYPETAB    DB    2
  537.     DB    8
  538.     DB    1,6,'BINARY',EOS,1,1
  539.     DB    1,5,'ASCII',EOS,0,0
  540. ;
  541. ;    SET BLOCK-CHECK-TYPE options parse table
  542. ;
  543. BLKTAB    DB    3
  544.     DB    8
  545.     DB    1,1,'1',EOS,'11'
  546.     DB    1,1,'2',EOS,'22'
  547.     DB    1,1,'3',EOS,'33'
  548. ;
  549. ;    OFF/ON parse table
  550. ;
  551. ONTAB    DB    4    ;Number of entries
  552.     DB    5    ;Max length + 2
  553.     DB    0,2,'NO',EOS,0,0    ;YES and NO are invisible
  554.     DB    1,2,'ON',EOS,1,1
  555.     DB    1,3,'OFF',EOS,0,0
  556.     DB    0,3,'YES',EOS,1,1
  557. ;
  558. ;    Assorted error/informational messages
  559. ;
  560. CMER00    DB    CR,'Program error, Invalid COMND call',EOS
  561. CMER01    DB    CR,'Ambiguous',EOS
  562. CMER02    DB    CR,'Illegal input filespec',EOS
  563. CMCRLF    DB    CR,EOS
  564. ;
  565. ;    Storage for the parser, etc.
  566. ;
  567. CMSTAT    DB    0    ;What is presently being parsed.
  568. CMAFLG    DB    0    ;Non-zero when an action char has been found.
  569. CMCCNT    DB    0    ;Non-zero if a significant char is found.
  570. CMSFLG    DB    0    ;Non-zero when the last char was a space.
  571. CMOSTP    DW    0    ;Old stack pointer for reparse.
  572. CMRPRS    DW    0    ;Address to go to on reparse.
  573. CMPRMP    DW    0    ;Address of prompt.
  574. CMPTAB    DW    0    ;Address of present keyword table.
  575. CMDBUF    DS    100H    ;Buffer for command parsing.
  576. CMFCB    DW    0    ;Pointer to FCB.
  577. CMCPTR    DW    0    ;Pointer for next char input.
  578. CMDPTR    DW    0    ;Pointer into the command buffer.
  579. CMKPTR    DW    0    ;Pointer to keyword.
  580. CMSPTR    DW    0    ;Place to save a pointer.
  581. OLDSP    DW    0    ;Room for old system stack.
  582.     DS    200H    ;Room for lots of calls
  583. STACK    DW    0
  584. EOFLAG    DB    0    ;EOF flag; non-zero on EOF.
  585. FILFLG    DB    0    ;NON-ZERO WHEN FILE NOT OPEN
  586. LSTCHR    DB    0    ;Last character in disk i/o
  587. DEFDSK    DB    '0'    ;Default disk drive number
  588. LOGFLG    DB    0    ;Flag for session logging
  589. DEBLOG    DB    0    ;Flag for debug logging
  590. TRANLOG    DB    0    ;Flag for transaction logging
  591. ECOFLG    DB    0    ;Local echo flag (default off).
  592. ESCFLG    DB    0    ;Escape flag (start off).
  593. EMULFLAG    DB    0    ;Emulation flag, NONE is default
  594. FLWFLG    DB    0    ;file warning flag (default on)
  595. FILTYPE    DB    0    ;File type, default is ASCII
  596. DBFLG    DB    0    ;debugging flag (default off)
  597. PRTFLG    DB    0    ;printer flag (default off)
  598. ESCCHR    DB    DEFESC    ;Storage for the escape character.
  599. CHRCNT    DB    0    ;Number of chars in the file buffer.
  600. FILCNT    DB    0    ;Number of chars left to fill.
  601. OUTPNT    DW    0    ;Position in packet.
  602. BUFPNT    DW    0    ;Position in file buffer.
  603. FCBPTR    DW    0    ;Position in FCB.
  604. FCBEXT    DW    0
  605. DATPTR    DW    0    ;Position in packet data buffer.
  606. LOGPTR    DW    LBUFF    ;pointer into log file buffer
  607. CBFPTR    DW    0    ;Position in character buffer.
  608. PKTPTR    DW    0    ;Poistion in receive packet.
  609. OSIZE    DB    0    ;Old size of packet before overflow
  610. SIZE    DB    0    ;Size of data from gtchr.
  611. SPSIZ    DB    DSPSIZ    ;Send packet size.
  612. RPSIZ    DB    DRPSIZ    ;Receive packet size.
  613. STIME    DB    DSTIME    ;Send time out.
  614. RTIME    DB    DRTIME    ;Receive time out.
  615. SPAD    DB    DSPAD    ;Send padding.
  616. RPAD    DB    DRPAD    ;Receive padding.
  617. SPADCH    DB    DSPADC    ;Send padding char.
  618. RPADCH    DB    DRPADC    ;Receive padding char.
  619. SEOL    DB    DSEOL    ;Send EOL char.
  620. REOL    DB    DREOL    ;Receive EOL char.
  621. SSOHCH    DB    DSSOP    ;SEND START OF PACKET
  622. RSOHCH    DB    DRSOP    ;RECEIVE START OF PACKET
  623. SQUOTE    DB    DSQUOT    ;Send quote char.
  624. RQUOTE    DB    DRQUOT    ;Receive quote char.
  625. STURN    DB    0    ;Send turn around character
  626. RTURN    DB    0    ;Receive turn around character
  627. CHKTYP    DB    DSCHKT    ;Checksum type desired
  628. CURCHK    DB    DSCHKT    ;Current checksum type
  629. INICHK    DB    DSCHKT    ;Agreed upon checksum type
  630. CZSEEN    DB    0    ;Flag that control-Z was typed
  631. MFNPTR    DW    MFNBUF    ;multiple file processing buffer
  632. PKTNUM    DB    0    ;Packet number.
  633. NUMPKT    DW    0    ;Total number of packets sent.
  634. NUMRTR    DW    0    ;Total number of retries.
  635. NUMTRY    DB    0    ;Number of tries on this packet.
  636. OLDTRY    DB    0    ;Number of tries on previous packet.
  637. TFILNAM    DS    33    ;Space for saved file name printed during GETs
  638. RMTDATA    DS    101H    ;Data for remote commands
  639. STATE    DB    0    ;Present state of the automaton.
  640. PACKET    DS    4    ;Packet (data is part of it).
  641. DATA    DS    101H    ;Data and checksum field of packet.
  642. RECPKT    DS    70H    ;Receive packet storage (use the following).
  643. FILBUF    DS    70H    ;Character buffer.
  644. ;
  645. ;** Temp 1 & 2 must be in order
  646. ;
  647. TEMP1    DB    0    ;Temporary storage.
  648. TEMP2    DB    0
  649. TEMP3    DB    0
  650. TEMP4    DB    0
  651. ;
  652. ;    Data storage for MFNAME (multi-file access)
  653. ;
  654. MFREQ    DS    40    ;Requested name
  655. MFNBUF    DS    100H    ;filename buffer
  656. ;
  657. FCB    DS    40    ;file control block
  658. LFCB    DS    40    ;log file fcb
  659. TRFCB    DS    40    ;Transaction file fcb
  660. DFCB    DS    40    ;Debug fcb
  661. KFCB    DS    40    ;kill file fcb
  662. BUFF    DS    256    ;file buffer
  663. LBUFF    DS    256    ;log file buffer
  664. TBUFF    DS    256    ;Transaction log buffer
  665. DBUFF    DS    256    ;Debug log buffer
  666. ARGBLK    DS    20H    ;Used
  667. ; end of file
  668.