home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BONDWELL / BW2-COMM.LBR / KERMIT.DZC / KERMIT.DOC
Text File  |  2000-06-30  |  80KB  |  1,599 lines

  1.  
  2. % type cpmkermit .doc
  3.  
  4.  
  5.  
  6. 1. CP/M-80 KERMIT
  7.  
  8. Program:    Bill Catchings, Columbia University, with contributions from Bernie
  9.             Eiben   (DEC),  Nick  Bush  (Stevens),  John  Bray  (University  of
  10.             Tennessee), Bruce Tanner (Cerritos College), Greg Small (University
  11.             of California at Berkeley), Kimmo Laaksonen (Helskini University of
  12.             Technology), and many others.
  13. Language:   8080 Assembler or MAC80
  14. Version:    3.9
  15. Date:       April 1984
  16. Documentation:
  17.             Frank da Cruz, Columbia University
  18.  
  19. KERMIT-80 Capabilities At A Glance:
  20.   Local operation:                   Yes
  21.   Remote operation:                  No
  22.   Transfers text files:              Yes
  23.   Transfers binary files:            Yes
  24.   Wildcard send:                     Yes
  25.   ^X/^Y interruption:                Yes
  26.   Filename collision avoidance:      Yes
  27.   Can time out:                      Yes
  28.   8th-bit prefixing:                 Yes
  29.   Repeat count prefixing:            No
  30.   Alternate block checks:            Yes
  31.   Terminal emulation:                Yes, VT52 and others
  32.   Communication settings:            Yes; duplex, parity
  33.   Transmit BREAK:                    Yes; some versions
  34.   IBM communication:                 Yes
  35.   Transaction logging:               No
  36.   Session logging (raw download):    Yes
  37.   Raw upload:                        Yes
  38.   Act as server:                     No
  39.   Talk to server:                    Yes; SEND, GET, FIN, BYE
  40.   Advanced commands for servers:     No
  41.   Local file management:             Yes; DIR, ERA, SET DEFAULT disk
  42.   Handle file attributes:            No
  43.   Command/init files:                No
  44.   Printer control:                   Yes, limited
  45.  
  46.  
  47.                                 SUMMARY OF CP/M
  48.  
  49. CP/M-80 (version 2.2) has only five built-in commands, and they all  deal  with
  50. files; other functions are done by invoking programs.
  51.  
  52. CP/M file specifications are of the form DEV:XXXXXXXX.YYY, where
  53.  
  54. DEV:            is  a  device  name, normally the A: or B: floppy.  If omitted,
  55.                 the device name defaults to your connected diskette.
  56.  
  57. XXXXXXXX        is a filename of up to 8 characters.
  58.  
  59. YYY             is the file type, up to 3 characters.
  60.  
  61. File names and file types may contain letters, digits, and some special charac-
  62. ters, including dash, dollar sign, and underscore, but no imbedded spaces.  Up-
  63. per and lower case letters are equivalent.
  64.  
  65. "Wildcard" file-group specifications are permitted in file names and file types
  66. (but not device names) within certain contexts; a "*" matches a whole field,  a
  67. "?"  matches  a single character, including space.  Examples: "*.F??" specifies
  68. all files whose types start with F and are 1, 2, or 3 characters  long;  "F?.*"
  69. specifies  all  files whose names start with F and are no more than two charac-
  70. ters long (before the trailing spaces).
  71.  
  72. The five CP/M commands are:
  73.  
  74. DIR file        Lists the the names of the specified files.  The  default  file
  75.                 specification is "*.*".  Example: "DIR B:*.FOR".
  76.  
  77. ERA file        Erases (deletes) the specified file(s); wildcards allowed.
  78.  
  79. REN new old     Changes the name of a file from old to new, e.g.
  80.                 "REN NEW.FOR=OLD.FOR".
  81.  
  82. SAVE            Saves the specified number of memory blocks into a file.
  83.  
  84. TYPE file       Types the specified file on the screen, e.g.  "TYPE FOO.TXT".
  85.  
  86. The most important programs are:
  87.  
  88. STAT            Gives statistics on disk usage.
  89.  
  90. PIP             Peripheral  Interchange Program.  Copies files.  In response to
  91.                 the "*" prompt, give a command of the form 
  92.  
  93.                     disk:outfile=disk:infile
  94.  
  95.                 Wildcards ("*" for a whole field or "?" for a  letter)  can  be
  96.                 used.   Examples: "A:=B:*.*" to copy a whole disk, "A:=B:*.FOR"
  97.                 to copy all the Fortran programs from disk B to disk A. If  the
  98.                 disk  specification  is  omitted,  your "connected" disk is as-
  99.                 sumed.  Command line arguments are  also  accepted,  e.g.  "PIP
  100.                 A:=B:*.*".
  101.  
  102. For  further  information  on CP/M, consult your microcomputer manual or a CP/M
  103. handbook.
  104.  
  105.  
  106.                              KERMIT-80 DESCRIPTION
  107.  
  108. Implementations of Kermit-80 presently exist for  the  DEC  VT180 (Robin),  the
  109. DECmate  II,  the  Intertec  Superbrain,  the  Heath/Zenith  89  and  Z100, the
  110. Apple  II with the Z80 SoftCard, the Osborne 1, the TRS-80 II  with  CP/M,  the
  111. Telcon  Zorba,  the  Kaypro,  the  Vector  Graphics  CP/M  system,  the  Morrow
  112. Decision I, the Nokia MikroMikko, and others.  There is also a  "generic"  CP/M
  113. version that should run on most 8080-compatible CP/M 2.2 systems, but which may
  114. provide less performance, and another for CP/M 3.0.
  115.  
  116. Since  Kermit-80  runs  on  a  standalone micro, it is always in control of the
  117. screen -- it is always local.  Thus, it always keeps the  screen  updated  with
  118. the  file  name and the packet number, whether sending or receiving.  Kermit-80
  119. is capable of an imprecise or "fuzzy" timeout on  an  input  request,  and  can
  120. break  deadlocks  automatically.  In most cases, this is not important, because
  121. the KERMIT on the other side is most likely able to handle the timeouts.    The
  122. timeouts  done  by  Kermit-80 are fuzzy because they depend on the speed of the
  123. Z80 processor and other factors that can vary from system to system.
  124.  
  125. If despite the timeout capability, the transmission appears to  be  stuck  (and
  126. you  can tell that this has happened if the screen fails to change for a while)
  127. you can type carriage return to have the micro do what it would have done on  a
  128.   timeout,  namely  NAK the expected packet to cause to foreign host to send it
  129. again (or, if the micro is sending, to retransmit the  last  packet).    Micro/
  130. micro or micro/IBM-mainframe transfers could require this kind of manual inter-
  131. vention.
  132.  
  133. File transfers may be interrupted in several ways.
  134.  
  135. Control-C       This will return you to Kermit-80 command level immediately, so
  136.                 that  you  can  connect  back to the remote system, or take any
  137.                 other desired action.
  138.  
  139. Control-X       When sending a file, this will terminate  the  sending  of  the
  140.                 current  file  with a signal to the KERMIT on the other side to
  141.                 discard what it got so far.  If there  are  more  files  to  be
  142.                 sent,  KERMIT-80  will go on to the next one.  When receiving a
  143.                 file, KERMIT-80 will send a signal to the remote KERMIT to stop
  144.                 sending this file.  If the remote KERMIT understands this  sig-
  145.                 nal  (not  all  implementations  of KERMIT do), it will comply,
  146.                 otherwise the file will keep coming.  In any case,  the  remote
  147.                 KERMIT will go on to the next file in the group, if any.
  148.  
  149. Control-Z       Like  Control-X,  except  if a file group is being transmitted,
  150.                 this will stop the transmission of the entire group.  If only a
  151.                 single  file  is  being  transmitted,  it  works  exactly  like
  152.                 Control-X.
  153.  
  154. Carriage Returns
  155.                 If you type carriage return repeatedly Kermit-80 will retry the
  156.                 current  packet  up to its retry limit (somewhere between 5 and
  157.                 16 times) and then, if no valid response was  received,  return
  158.                 to Kermit-80 command level.
  159.  
  160.  
  161.                               KERMIT-80 COMMANDS
  162.  
  163. KERMIT-80  uses  the DECSYSTEM-20 keyword style command language.  Each keyword
  164. may be abbreviated to its minumum unique length.  "?" may be typed to request a
  165. menu of the available options for the current field at any point in a  command.
  166. ESC  may  be typed at any point in a command to fill out the current keyword or
  167. filename; if sufficient characters have not been typed to identify the  current
  168. field uniquely, KERMIT-80 will sound a beep and allow you to continue from that
  169. point.
  170.  
  171. CONNECT Establish  a "virtual terminal" connection to any host that may be con-
  172.         nected to the serial port, i.e. pass all typein to the serial port  and
  173.         display  all input from the serial port on the screen.  Also, emulate a
  174.         DEC  VT52  to  allow  cursor  control,  screen   clearing,   etc.,   if
  175.         VT52-EMULATION  is  ON  (see  below), in which case you should also set
  176.         your terminal type on the remote host to VT52.  (Some versions  emulate
  177.         other  terminals.)    The escape character differs from micro to micro;
  178.         when you issue the CONNECT command, the  micro  will  print  a  message
  179.         telling  you  how  to  get  back.   The escape sequence is generally an
  180.         uncommonly-used   control    character,    like    CTRL-backslash    or
  181.         CTRL-rightbracket, followed by a single letter "command".
  182.  
  183.         C   Close Connection, return to Kermit-80> command level.
  184.         S   Display Status of connection, but maintain remote connection.
  185.         ?   List available single-character commands.
  186.         0   (zero) Send a null (0) character.
  187.         B   Send a BREAK signal.  Only some systems provide this function.
  188.         ^]  (or  whatever - a second copy of the escape character) Send the es-
  189.             cape character itself to the remote host.
  190.  
  191. SEND filespec
  192.         Send file(s) specified by filespec to the remote Kermit.  The  filespec
  193.         may contain CP/M wildcards.
  194.  
  195. RECEIVE Receive  file(s)  from  the  remote Kermit.  Store them under the names
  196.         provided in the file headers supplied by the remote host.  If the names
  197.         aren't legal, use as many legal characters from the  name  as  possible
  198.         (see  the  description  of  SET FILE-WARNING below).  If there's a con-
  199.         flict, and FILE-WARNING is ON, warn the user and try to build a  unique
  200.         name for the file by adding "&" characters to the name.
  201.  
  202. GET filespec
  203.         When  Kermit-80  is  talking to a Kermit Server on the host, you should
  204.         use the GET command to request the server to send files to you, for ex-
  205.         ample: get hlp:k*.hlp Limitation: If you  request  an  alternate  block
  206.         check  type  using the SET BLOCK command, the GET command will not com-
  207.         municate it to the remote server.  If you want to  have  type  2  or  3
  208.         block checks done when getting files from the server, you have to issue
  209.         the  appropriate  SET BLOCK command to the remote KERMIT before putting
  210.         it in server mode.
  211.  
  212. LOG filespec
  213.         When CONNECTed to a foreign host as a terminal, log the  terminal  ses-
  214.         sion  to  the  specified  diskette file.  This functionality depends to
  215.         some extent on the remote host's ability to do XON/XOFF  flow  control,
  216.         and  does  not  guarantee a complete transcript (after all, that's what
  217.         the KERMIT protocol is for).  The log file is closed when  the  connec-
  218.         tion  is  closed by typing the escape character followed by the single-
  219.         character command "C".
  220.  
  221. TRANSMIT filespec
  222.         Send the specified file to the system on the other end of  the  connec-
  223.         tion as though it were being typed at the terminal, one line at a time.
  224.         No  KERMIT  protocol is involved.  You must manually confirm each line.
  225.         This is useful for sending files to systems that don't  have  a  KERMIT
  226.         program.    During transmission, you may type the escape character fol-
  227.         lowed by one of these single-character commands:
  228.  
  229.         C   Cease transmission
  230.         R   Re-transmit the previous line
  231.  
  232. BYE     When talking to a remote Kermit Server, this  command  shuts  down  the
  233.         server  and  logs it out, and also exits from Kermit-80 to CP/M command
  234.         level.
  235.  
  236. LOGOUT  Like BYE, but leaves you at Kermit-80 command level.
  237.  
  238. FINISH  Like LOGOUT, but shuts down the remote server without logging  it  out.
  239.         Leaves you at Kermit-80 command level; subsequent CONNECT commands will
  240.         put you back at host system command level.
  241.  
  242. SET parameter [value]
  243.         Set the specified parameter to the specified value.  Possible settings:
  244.  
  245.         WARNING ON (or OFF)
  246.                 Warn  user  of  filename  conflicts  when  receiving files from
  247.                 remote host, and attempt to generate a unique  name  by  adding
  248.                 "&" characters to the given name.  ON by default.
  249.  
  250.         VT52-EMULATION ON (or OFF)
  251.                 When  connected  as  a  terminal  to  a  foreign host, controls
  252.                 whether the micro emulates a VT52 or  runs  in  "native  mode".
  253.                 VT52  emulation is ON by default, except on micros that already
  254.                 have terminal functionality built in, such as the DEC VT180 and
  255.                 DECmate (these act as VT100-series terminals).    Some  systems
  256.                 emulate other terminals, like the ADM3A.
  257.  
  258.         LOCAL-ECHO ON (or OFF)
  259.                 When  you  CONNECT to a remote host, you must set LOCAL-ECHO ON
  260.                 if the host is half  duplex,  OFF  if  full  duplex.    OFF  by
  261.                 default.
  262.  
  263.         ESCAPE  Change  the  escape character for virtual terminal connections.
  264.                 Kermit-80 will prompt you for the new escape  character,  which
  265.                 you enter literally.
  266.  
  267.         BAUD    Change  the baud rate of the communications port.  This command
  268.                 only works on some systems, and its actual operation  can  vary
  269.                 from  system  to  system.  Type SET BAUD followed by a question
  270.                 mark, and follow the directions.  On systems that do  not  sup-
  271.                 port this command, you must set the port baud rate from CP/M or
  272.                 other setup mechanism outside of KERMIT-80.
  273.  
  274.         PARITY  Sets  parity  for  outgoing characters to one of the following:
  275.                 NONE, SPACE, MARK, EVEN, or ODD.  On input, if parity is  NONE,
  276.                 then  the  8th  bit is kept (as data), otherwise it is stripped
  277.                 and ignored.  The parity setting applies to both terminal  con-
  278.                 nection and file transfer.  If you set parity to anything other
  279.                 than none, KERMIT-80 will attempt to use "8th bit prefixing" to
  280.                 transfer  binary files.  If the other KERMIT is also capable of
  281.                 8th bit prefixing, then binary files can  be  transferred  suc-
  282.                 cessfully;  if  not, the 8th bit of each data byte will be lost
  283.                 (you will see a warning on your screen if this happens).
  284.  
  285.         TIMER ON (or OFF)
  286.                 Enable or disable the "fuzzy timer".    The  timer  is  off  by
  287.                 default,  because in the normal case KERMIT-80 is communicating
  288.                 with a mainframe KERMIT that has its own timer.  Mainframe KER-
  289.                 MIT timers tend to be more precise  or  adaptable  to  changing
  290.                 conditions.    You should SET TIMER ON if you are communicating
  291.                 with a KERMIT that does not have a timer.  You should SET TIMER
  292.                 OFF if you are communicating over a network with long delays.
  293.  
  294.         IBM ON (or OFF)
  295.                 Allow the transfer of files to and from an IBM  mainframe  com-
  296.                 puter.    This  makes  Kermit-80  wait  for  the IBM turnaround
  297.                 character (XON), ignore parity on input, add appropriate parity
  298.                 to output, and use local  echoing  during  CONNECT.    As  dis-
  299.                 tributed, KERMIT-80 uses MARK parity for IBM communication.  If
  300.                 you don't give this command, IBM mode is OFF.  Since IBM VM/CMS
  301.                 KERMIT  does not have timeout capability, SET IBM ON also turns
  302.                 on the "fuzzy timer" automatically.
  303.  
  304.         BLOCK-CHECK-TYPE
  305.                 The options are:
  306.  
  307.                 1-CHARACTER-CHECKSUM
  308.                         Normal, default, standard 6-bit checksum.
  309.                 2-CHARACTER-CHECKSUM
  310.                         A 12-bit checksum encoded as two characters.
  311.                 3-CHARACTER-CRC-CCITT
  312.                         A 16-bit CCITT-format Cyclic Redundancy Check,  encoded
  313.                         as 3 characters.
  314.  
  315.         The  2  and 3 character options should only be used under conditions of
  316.                 extreme line noise.  Many implementations of KERMIT  only  sup-
  317.                 port the single character checksum.
  318.  
  319.         FILE-MODE
  320.                 Tells KERMIT-80 what kind of file it is sending, so that KERMIT
  321.                 can  correctly  determine the end of the file.  SET FILE BINARY
  322.                 means to send all the 128-byte blocks of  the  file,  including
  323.                 the last block in its entirety; SET FILE ASCII is used for text
  324.                 files,  and  transmission stops when the first Control-Z is en-
  325.                 countered anywhere in the file (this is the CP/M convention for
  326.                 marking the end of a text file).   If  binary  transmission  is
  327.                 used  on  a text file, some extraneous characters (up to 127 of
  328.                 them) may appear at the end of the file on the  target  system.
  329.                 If ASCII transmission is used on a binary file, the entire file
  330.                 will  not  be sent if it happens to contain any data bytes that
  331.                 correspond to Control-Z.
  332.  
  333.         DEFAULT-DISK
  334.                 This allows you to set the default disk as source and  destina-
  335.                 tion  of  file  transfers.    In addition, issuing this command
  336.                 causes you to switch to the  specified  disk  and  log  it  in,
  337.                 write-enabled.    The  selected  disk appears in your KERMIT-80
  338.                 prompt, for instance 
  339.  
  340.                     Kermit-80 A:>
  341.  
  342.         PORT    Allows you to switch  between  different  communication  ports.
  343.                 This command is not available on all systems.
  344.  
  345.         PRINTER ON  or OFF.  Turns copying of CONNECT session to printer on and
  346.                 off.  No attempt is made to do buffering or flow control; it is
  347.                 assumed printer can keep up.
  348.  
  349. DIR     This provides a directory listing of the specified files.  If no  files
  350.         are  specified,  all files on the default disk are listed.  File sizes,
  351.         in K, are included.  You may interrupt  the  listing  at  any  time  by
  352.         typing any character.  The listing (even if interrupted) concludes with
  353.         a display of the amount of free storage left on the disk.
  354.  
  355. ERA     This executes the CP/M ERA command on the specified file(s).  The names
  356.         of the files being erased are not displayed.
  357.  
  358.  
  359. 1.1. Generic KERMIT-80
  360.  
  361. "Generic  Kermit-80" is a implementation of Kermit that should run on any 8080-
  362. compatible CP/M system no modification at all, or perhaps  only  a  minor  one.
  363. Unlike   other  Kermit-80  implementations,  it  contains  no  system-dependent
  364. manipulation of the serial port or screen.  All I/O is done with standard  CP/M
  365. BIOS  calls, and I/O redirection is done using the CP/M IOBYTE function, which,
  366. according to the Digital Research CP/M Operating System Manual, is an  optional
  367. feature of any particular CP/M implementation.  If your system does not provide
  368. the IOBYTE function, Generic Kermit-80 will not work; furthermore, not all sys-
  369. tems that implement IOBYTE do so in the same way.
  370.  
  371. The  reason all Kermit-80 implementations aren't generic is that a good deal of
  372. speed is sacrificed by getting all services from the operating system.  While a
  373. specific implementation of Kermit-80 may be able to operate at 4800,  9600,  or
  374. even  19200 baud, Generic Kermit will fail to work on some systems at speeds in
  375. excess of 1200 baud.
  376.  
  377. Generic Kermit also differs from other Kermit-80  implementations  in  that  it
  378. does not do fancy screen control during file transfer; it simply types the file
  379. names,  packet  numbers,  and  messages in sequence across and down the screen.
  380. This works best if you can put your  micro  or  terminal  in  "autowrap"  mode;
  381. otherwise  the  packet  numbers  will  pile  up  in  the  rightmost column; the
  382. filenames and messages will always appear on a new line, however.  Neither does
  383. generic Kermit-80 do termimal emulation; thus a generic Kermit-80  acts  either
  384. as a "dumb terminal" (sometimes called a "glass TTY"), or else its own built in
  385. terminal  firmware  provides cursor control functions independent of the Kermit
  386. program.
  387.  
  388. Note that VT180 and DECmate-II Kermit are simply adaptations of Generic  Kermit
  389. that do VT100 (ANSI) screen control during file transfer.
  390.  
  391.  
  392. 1.2. Installation
  393.  
  394. Kermit-80  was written originally for the Intertec SuperBrain in lowest-common-
  395. denominator 8080 code with the standard assembler, ASM (no macros, no  advanced
  396. instructions),  so  that it can be assembled on any CP/M-80 system(The 8080 as-
  397. sembler is distributed as a standard  part  of  CP/M-80,  whereas  the  fancier
  398. Z80  or macro assemblers are normally a commercial product).  It has since been
  399. modified to run on many other systems as well.  Kermit-80 should be able to run
  400. on any 8080-, 8085- or Z80-based  microcomputer  under  CP/M  with  only  minor
  401. modifications (see below).
  402.  
  403. All  versions  of  Kermit-80  are  assembled  from the same source, with system
  404. dependencies taken care of by assembly-time conditionals.  The  most  important
  405. system  dependencies are terminal emulation (when CONNECTed to the remote host)
  406. and screen handling, which are dependent on the individual micro's escape codes
  407. (these features are table driven and easily modified for other  CP/M  systems),
  408. and the lowest level i/o routines for the serial communications port.  The port
  409. routines  are  best  done  only  with BDOS calls, but some systems do not allow
  410. this, primarily because the BDOS routines strip the parity bit during port i/o,
  411. and the parity bit is used for data when  transmitting  binary  files.    Also,
  412. using  BDOS  calls, there's no way to poll the serial port; you must hang until
  413. input appears.
  414.  
  415. Kermit-80's i/o routines must check the port status and go elsewhere if no  in-
  416. put  is available; this allows for virtual terminal connection, keyboard inter-
  417. ruption of stuck transmissions, etc.   On  systems  that  fully  implement  i/o
  418. redirection  via the optional CP/M IOBYTE facility, this may be done by switch-
  419. ing the IOBYTE definition.  On others, however, IN/OUT instructions  explicitly
  420. referencing the port device registers must be used.
  421.  
  422. CP/M-80  KERMIT  version  3.8  and above includes a "fuzzy timer" that allows a
  423. timeout to occur after an interval ranging from 5 to 20 seconds (depending upon
  424. the speed of the processor and the operating system routines) during which  ex-
  425. pected  input does not appear at the port.  In this case, retransmission occurs
  426. automatically.  In any case, you may type a carriage return during transmission
  427. to simulate a timeout when the transfer appears to be stuck.
  428.  
  429.  
  430. 1.2.1. Downloading Kermit-80
  431.  
  432. If you already have a version of Kermit on your micro and you want to install a
  433. new version, simply use your present version to get  the  new  one.    If  it's
  434. stored  in the form of a .COM file, you can run it directly.  If it's stored as
  435. a .HEX file, you must first LOAD it on your micro to produce a .COM file.
  436.  
  437. If you do not have a copy of KERMIT on your micro, and you cannot borrow a Ker-
  438. mit floppy but you do have access to a mainframe computer with a  copy  of  the
  439. Kermit-80 distribution, you should read this section.
  440.  
  441. There  are  several  ways  to get Kermit from a host system to your micro.  The
  442. easiest is to "download" the precompiled "hex" file into  your  micro's  memory
  443. and  then  save it on the disk.  The following is a procedure which, though far
  444. from foolproof, should allow you to get a version of Kermit to your CP/M  based
  445. micro.  It depends upon the host prompt, or at least the first character of the
  446. host  prompt,  being some character that cannot appear in a hex file (the valid
  447. characters for hex files are the digits 0-9, the upper case  letters  A-F,  the
  448. colon  ``:'',  carriage return, and line feed).  As soon as any other character
  449. is encountered, the transfer will terminate.  If your host  does  not  issue  a
  450. prompt  that  will  accommodate this scheme, you can achieve the same effect by
  451. modifing the adding an atsign ``@'' to the very end  of  the  hex  file  before
  452. sending  it  from  the host.  The program below looks for an atsign (the normal
  453. DEC-20 prompt, hex 40).  DECSYSTEM-10 users would look for a dot, hex 2E.
  454.  
  455.    1. Look for the appropriate hex file in the host's KERMIT  area.    The
  456.       name    will   be   something   like   CPMROBIN.HEX,   CPMHEATH.HEX,
  457.       CPMOSBORN.HEX, etc.  If you don't find it, but you do  find  a  cor-
  458.       responding  .ASM or .M80 file, you'll either have to build a new hex
  459.       file on the host using a cross assembler (see below for  how  to  do
  460.       this  on  a  DEC-10 or DEC-20), or else bring the M80 source file to
  461.       your micro and assemble it there.
  462.  
  463.    2. Connect to your host  using  a  terminal  or  a  terminal  emulation
  464.       facility.    Ensure  that  your  host does not have your terminal in
  465.       "page mode".  E.g. on the DEC-20, give the Exec command TERMINAL  NO
  466.       PAUSE END-OF-PAGE.
  467.  
  468.    3. Tell the host to display the hex file at your terminal.  E.g. on the
  469.       DEC-20, give the Exec command TYPE KERMIT.HEX, without a terminating
  470.       carriage return.
  471.  
  472.    4. Return  to your micro.  Connect to a floppy disk with plenty of free
  473.       space.  Make sure your IOBYTE is set so  that  RDR:  and  PUN:  cor-
  474.       respond  to the I/O port that is connected to the DEC-20 (this would
  475.       normally be the case unless  you  have  done  something  special  to
  476.       change  things).    Run  DDT and type in the following (the comments
  477.       should not be typed in; they are  there  just  to  tell  you  what's
  478.       happening):
  479.  
  480.           -ikermit.hex            ;Setup FCB for file KERMIT.HEX.
  481.           -a100                   ;Begin assembling code at 100.
  482.           0100 lxi h,ffe          ;Where to put HEX file.
  483.           0103 shld 300           ;Save the address.
  484.           0106 mvi e,d            ;Get a CR.
  485.           0108 mvi c,4            ;Output function.
  486.           010A call 5
  487.           010D mvi c,3            ;Input function.
  488.           010F call 5
  489.           0112 ani 7f             ;Turn off the parity.
  490.           0114 cpi 40             ;Our DEC-20 prompt atsign?
  491.           0116 jz 124             ;Yes, we have whole file.
  492.           0119 lhld 300           ;Get the pointer.
  493.           011C mov m,a            ;Else, store the char.
  494.           011D inx h              ;Increment the pointer.
  495.           011E shld 300           ;Save the pointer.
  496.           011F jmp 10d            ;Go around again.
  497.           0124 mvi a,1a           ;Get a control-Z.
  498.           0126 lhld 300           ;Get the pointer.
  499.           0129 mov m,a            ;Store the char.
  500.           012A shld 300           ;Save the pointer.
  501.           012D lxi h,1000         ;Pointer to file.
  502.           0130 shld 310           ;Save the pointer.
  503.           0133 mvi c,16           ;Make file.
  504.           0135 lxi d,5c
  505.           0138 call 5
  506.           013B lhld 310           ;Get the file pointer.
  507.           013E xchg               ;Put it in DE.
  508.           013F mvi c,1a           ;Set DMA.
  509.           0141 call 5
  510.           0144 mvi c,15           ;Write DMA to file.
  511.           0146 lxi d,5c
  512.           0149 call 5
  513.           014C lhld 310           ;Get the file pointer.
  514.           014F lxi d,80           ;Get the DMA size.
  515.           0152 dad d              ;Adjust file pointer.
  516.           0153 shld 310           ;Save it.
  517.           0156 lda 301            ;Get high order byte.
  518.           0159 cmp h              ;Have we passed the end?
  519.           015A jm 170             ;Yes.
  520.           015D jz 163             ;Maybe.
  521.           0160 jmp 13b            ;No.
  522.           0163 lda 300            ;Get low order byte.
  523.           0166 cmp l              ;Passed the end?
  524.           0167 jm 170             ;Yes.
  525.           016A jz 170             ;Yes.
  526.           016D jmp 13b            ;Not quite.
  527.           0170 mvi c,10           ;Close file.
  528.           0172 lxi d,5c
  529.           0175 call 5
  530.           0178 ret
  531.           0179
  532.           -g100,179               ;Execute the program.
  533.           -                       ;Reboot
  534.  
  535.       Now there should be a file KERMIT.HEX on your connected disk.
  536.  
  537.    5. Load  this  using the CP/M command LOAD to produce KERMIT.COM.  This
  538.       should be a runnable version of Kermit.  Note that  CP/M  hex  files
  539.       have  checksums on each line.  If there were any transmission errors
  540.       during the downloading process, the CP/M loader will  notice  a  bad
  541.       checksum and will report an error (something like "Illegal Format").
  542.       If  you  get  any  errors  during  loading,  either fix the hex file
  543.       locally with an editor, or repeat the previous step.
  544.  
  545. You now should have a running version of Kermit-80.
  546.  
  547.  
  548. 1.2.2. Building KERMIT.HEX
  549.  
  550. The source for Kermit-80 should be available on your  host  computer.    It  is
  551. written  using  8080  assembler mnemonics, so it can be assembled on most 8080s
  552. and Z80s using the standard 8080 assembler provided with CP/M.    If  you  have
  553. KERMIT.ASM on your CP/M system, you can assemble it directly on the micro using
  554. ASM,  setting  the  desired assembly switches as explained below.  If you don't
  555. have it, you can attempt to download the source file from the  host  using  the
  556. procedure outlined above.
  557.  
  558. A cross assembler is provided that runs on the DEC-10 and DEC-20, called MAC80,
  559. contributed by Bruce Tanner at Cerritos College, that may be used for cross as-
  560. sembling KERMIT-80 as shown in this example (for TOPS-20):
  561.  
  562.    1. Copy   PS:<KERMIT>CPMKxx.M80   to  your  directory,  as  KERMIT.M80.
  563.       TOPS-10 filename rules must be followed.  This is the 8080 assembler
  564.       source file; xx is the current version number; for instance  version
  565.       3.8 would be stored as CPMK38.M80.
  566.  
  567.    2. Edit  KERMIT.M80  to  set  the  conditional assembly switch for your
  568.       machine.  These are right near the top of the file.  The switch  for
  569.       your machine should be set to TRUE and all the others to FALSE.
  570.  
  571.    3. The "ibm-flag" setting is site dependent.  As shipped from Columbia,
  572.       it  turns  on half duplex line handshaking, using CTRL-Q as the tur-
  573.       naround character, sets LOCAL-ECHO ON, TIMER ON,  and  PARITY  MARK.
  574.       Make any changes required for your site.
  575.  
  576.    4. The default FILE-MODE is ASCII as shipped from Columbia.  This means
  577.       that  when  text  files are sent from the CP/M system, no extraneous
  578.       characters will be sent after the  end,  but  that  outgoing  binary
  579.       files  may  be truncated erroneously if the user forgets to SET FILE
  580.       BINARY.  You can change the default to BINARY, so that  no  data  is
  581.       ever lost from any file, but text files will usually have extraneous
  582.       junk at the end.
  583.  
  584.    5.   Run MAC80:
  585.  
  586.           @mac80
  587.           *kermit=kermit
  588.           *^Z
  589.  
  590.       The result will be in your directory as KERMIT.HEX.
  591.  
  592.    6. Use  Kermit,  MODEM,  or any other downloading mechanism to transfer
  593.       KERMIT.HEX to the micro, or download it using the DDT program  shown
  594.       above.
  595.  
  596.    7. On the micro, load the hex file:  
  597.  
  598.           A>load kermit
  599.  
  600.       KERMIT.COM will appear on the floppy.
  601.  
  602.    8. The new Kermit should be ready to run.
  603.  
  604.  
  605. 1.2.3. Generic Kermit-80
  606.  
  607. If  your  CP/M  2.2 system implements i/o redirection via the (optional) IOBYTE
  608. mechanism, you can probably run Generic Kermit on it, either without  modifica-
  609. tion,  or  by a very simple change to the program.  The standard CP/M IOBYTE is
  610. set up as follows:
  611. I/O Byte assignments (four 2-bit fields for 4 devices at location 3)
  612. :
  613. bits 6+7        LIST field
  614.     0           LIST is Teletype device (TTY:)
  615.     1           LIST is CRT device (CRT:)
  616.     2           LIST is Lineprinter (LPT:)
  617.     3           LIST is user defined (UL1:)
  618.  
  619. bits 4+5        PUNCH field
  620.     0           PUNCH is Teletype device (TTY:)
  621.     1           PUNCH is high speed punch (PUN:)
  622.     2           PUNCH is user defined #1 (UP1:)
  623.     3           PUNCH is user defined #2 (UP2:)
  624.  
  625. bits 2+3        READER field
  626.     0           READER is Teletype device (TTY:)
  627.     1           READER is high speed reader (RDR:)
  628.     2           READER is user defined #1 (UR1:)
  629.     3           READER is user defined #2 (UR2:)
  630.  
  631. bits 0+1        CONSOLE field
  632.     0           CONSOLE is console printer (TTY:)
  633.     1           CONSOLE is CRT device (CRT:)
  634.     2           CONSOLE is in Batch-mode (BAT:); READER = Input, LIST = Output
  635.     3           CONSOLE is user defined (UC1:)
  636. (Here, bit zero is the least significant, "rightmost", bit).
  637.  
  638. I/O redirection is accomplished by switching the  IOBYTE  between  two  values,
  639. "batch  i/o"  and "normal i/o".  In normal i/o mode, the keyboard is defined to
  640. be the console.  In batch i/o mode, the serial port is defined to be  the  con-
  641. sole.   This switching is necessary because the console is the only device that
  642. can be tested to see if input is available, but KERMIT must  shuttle  back  and
  643. forth between the keyboard and the serial port looking for input.  Here are the
  644. batch and default i/o mode definitions used in "standard" Generic KERMIT-80:
  645.  
  646. batio   EQU     056H            ;I/O byte CON=BAT,LIST=CRT,READER=RDR
  647. defio   EQU     095H            ;I/O byte CON=CRT,LIST=LPT,READER=RDR
  648.  
  649. Other  systems may have other logical devices that point to the serial port, in
  650. which case you'll need to redefine these symbols to point to those devices  and
  651. then reassemble the program (with assembly switch GENER set to TRUE, all others
  652. FALSE).
  653.  
  654. If  your system runs CP/M 3.0, then the CPMPLUS version of KERMIT should run on
  655. your system without modification, except perhaps for  screen  control  or  baud
  656. rate setting.
  657.  
  658.  
  659.  
  660. Index
  661.  
  662.  
  663.           8080   2
  664.  
  665.           Baud   2
  666.           BIOS   2
  667.           Block Check   2
  668.           Bootstrap   3
  669.           BYE   2
  670.  
  671.           Connect   1
  672.           CP/M   2
  673.           Cross Assembler   3
  674.  
  675.           DECsystem-10   3
  676.           DECSYSTEM-20   3
  677.           Downloading   3
  678.  
  679.           Eighth-Bit Prefix   2
  680.           Escape Character   1, 2
  681.  
  682.           File-Warning   1
  683.           FINISH   2
  684.  
  685.           Generic Kermit-80   2, 4
  686.           GET   1
  687.  
  688.           Hex File   3
  689.  
  690.           IBM   2
  691.           IOBYTE   4
  692.  
  693.           Local   1
  694.           Local-Echo   2
  695.           LOG   2
  696.           LOGOUT   2
  697.  
  698.           MAC80   3
  699.  
  700.           NAK   1
  701.  
  702.           Parity   2
  703.  
  704.           RECEIVE   1
  705.  
  706.           SEND   1
  707.           SET   2
  708.           Superbrain   2
  709.  
  710.           Timeout   1, 3
  711.           TIMER   2
  712.           TRANSMIT   2
  713.  
  714.           Virtual Terminal   1
  715.           VT100   2
  716.           VT52   2
  717.  
  718.           Warning   2
  719.  
  720.           XON/XOFF   2
  721.  
  722.           Z80   2
  723.  
  724.  
  725.  
  726.                                Table of Contents
  727.  
  728. 1. CP/M-80 KERMIT                                                             1
  729.  
  730. 1.1. Generic KERMIT-80                                                        2
  731. 1.2. Installation                                                             2
  732.      1.2.1. Downloading Kermit-80                                             3
  733.      1.2.2. Building KERMIT.HEX                                               3
  734.      1.2.3. Generic Kermit-80                                                 4
  735.  
  736. Index                                                                         5
  737. % ty cpmgener.doc
  738. "Generic Kermit-80" is a implementation of Kermit that should run on many
  739. 8080-compatible CP/M-80 2.2 system with little or no modification.  (There's
  740. also a generic Kermit-80 for CP/M-80 3.0).  Unlike other Kermit-80
  741. implementations, it contains no system-dependent manipulation of the serial
  742. port or screen.  All I/O is done with standard CP/M BIOS calls, switching
  743. devices by manipulating the IOBYTE.  Whether Generic Kermit runs, or can be
  744. made to run, on a particular micro depends upon two things:
  745.  
  746. (1) Did the manufacturer fully implement the "optional" CP/M IOBYTE?
  747.  
  748. (2) Is the IOBYTE implemented "correctly?", that is, are the four fields
  749.     defined correctly and in the right order, and do the CON:, LST:,
  750.     PUN:, and BAT: devices indicate the devices that KERMIT expects?
  751.     KERMIT wants the serial port to correspond to the RDR: and PUN: devices,
  752.     and wants to be able to switch the console between the CRT: and
  753.     BAT: devices, where BAT: should be defined to use RDR: for input
  754.     and LST: for output.
  755.  
  756. Generic Kermit is known to run without modification on the DEC VT180 (up to
  757. 9600 baud) and other DEC micros.  It was tested on the Intertec Superbrain and
  758. failed to work because the IOBYTE did not point to the CRT screen in the
  759. expected way.  Similarly for the DECmate-II CP/M option, but in this case the
  760. correct IOBYTE definitions were discovered, and a "specific" version of generic
  761. Kermit-80 was built for the DECmate II; if you look for DMII in the
  762. CPMGENERI.ASM source file, you'll see that only a couple definition statements
  763. were necessary to do the trick.
  764.  
  765. The other way in which generic Kermit-80 is generic is that it does not assume
  766. anything about terminal; it does not attempt to emulate a VT52 or any other
  767. type of terminal, and it does not use fancy screen control when updating the
  768. screen during file transfer.  It assumes the micro has the ability to auto-
  769. matically wrap long lines around on the screen.
  770.  
  771. The present VT180 and DECmate Kermits are actually generic Kermit slightly
  772. modified to do VT100 display screen updating during file transfer.
  773.  
  774. To get Generic Kermit on to your system (if you can't get it on a floppy
  775. disk), use whatever procedure is available to you on your micro to download
  776. the file KER:CPMGENERIC.HEX.  The DDT program listed in the Kermit Users
  777. Manual will do the trick on most systems, or use MODEM7 or some other file
  778. transfer package if you have it.
  779.  
  780. To modify Generic Kermit to run on a new system on which it does not run
  781. as distributed, see the instructions in the section "Generic Kermit-80"
  782. in the back of the Kermit User Guide.
  783.  
  784. How did it get done (in the words of Bernie Eiben, "inventor"):
  785.  
  786. The "standard" CP/M system allows limited assignment of "logical" devices to
  787. physical devices. This is handled by the I/O byte. The I/O byte allows one to
  788. "assign" 4 "physical" devices to 4 "logical" devices.  This allows one to use
  789. the CP/M call CONSTAT ( is there a Input at the "logical" CONSOLE-device ? ) to
  790. be used for any of the "other" four assignable devices for CONSOL.  One of
  791. these devices is BAT:, the BATCH device ( Input comes from "logical" device
  792. READER, Output goes to "logical" device LIST ).
  793.  
  794. We use in GENERIC Kermit during CONNECT-state (terminal-emulation) and
  795. SEND/RECEIVE state the CONSOLE=BAT: assignment, to be able to "poll" for
  796. pending character-input from the physical device READER=RDR: , which is for the
  797. DEC-VT180 (aka ROBIN) and the DEC-RAINBOW the COMM-Port.
  798.  
  799. To circumvent BDOS-implementation differences, we call the BIOS directly. This
  800. is accomplished in routine INIADR, which grabs location 1 and 2 ( at 0 is a JMP
  801. WARMSTART ), adds increments of 3 ( we got the second entry of the BIOS-JMP
  802. vector -- the next three entries are JMP CONSTAT, JMP CONIN and JMP CONOUT )
  803. and plugs them into our BIOS-CALL routines.
  804. % type cpmkermi.bwr
  805. CP/M-80 KERMIT STATUS
  806.  
  807. CP/M-80 KERMIT (Kermit-80) was originally written for a single system (by Bill
  808. Catchings, formerly of Columbia), and then support for additional systems was
  809. added (at Columbia and elsewhere) using conditional assembly to select a
  810. particular machine's device addresses, screen control codes, or other system
  811. dependent features.
  812.  
  813. Meanwhile, a way of supporting different CP/M systems without device dependent
  814. code was discovered (by Bernie Eiben at DEC), involving tricky manipulation of
  815. the IOBYTE.  When Kermit-80 is built in this way, it is called "Generic
  816. Kermit-80".  It can generally be made to run on any system that implements the
  817. "optional" CP/M IOBYTE facility, either as-is, or by changing the IOBYTE
  818. definitions.
  819.  
  820. The source still contains conditional assembly support for many systems from
  821. the pre-generic version, but not all of this support has been tested when
  822. built from the current source.  If you want to build Kermit-80 for a
  823. particular micro, try the following in this order:
  824.  
  825. 1. Download CPMGENERI.HEX, which is "Generic Kermit-80", load it, and see if
  826.    it works.  If it does, you're done.
  827.  
  828. 2. Look in the source, at the definitions of the symbols BATIO and DEFIO.
  829.    These are the two IOBYTE values that Kermit-80 switches between for the
  830.    console and the serial port.  See if these need to be redefined for your
  831.    system.  If so, change the definitions, make sure assembly switch GENER
  832.    is TRUE and all others are FALSE, reassemble, download the resulting
  833.    hex file and try it out.  If it works, you're done.
  834.  
  835.    The current source is CPMBASE.M80.  Accept no substitutes!
  836.  
  837. 3. If generic Kermit-80 doesn't work, look for an assembly
  838.    switch for your micro, set it to TRUE and all others to FALSE, assemble,
  839.    download, try it out.  If it works, fine, you're done.  If it doesn't work,
  840.    you'll have to debug it.
  841.  
  842. 4. If generic Kermit-80 doesn't work, and there's no assembly switch for your
  843.    micro, add a new assembly switch and conditional code to support your
  844.    system, debug it, and send it back to us.
  845.  
  846. CPMKERMIT.DOC contains detailed information about KERMIT-80.  This information
  847. also appears as a chapter in the Kermit User Guide.
  848.  
  849. Here is a list of known problems with KERMIT-80:
  850.  
  851. 1. No command files or initialization files.
  852.  
  853. 2. The incredibly ugly IF...ENDIF structure of the program makes it almost
  854. impossible to read and maintain, and to add support for new systems without
  855. endangering the support for old ones.  The program needs to be completely
  856. rewritten, broken up into separate modules for protocol, disk i/o, screen i/o,
  857. console i/o, port/modem i/o, command parsing, terminal emulation, data and
  858. definitions.  Of these, only the protocol module would be system independent.
  859.  
  860. 3. Lower case letters in an incoming file header should be raised to upper case
  861. and nulls or other control characters in the filename should be discarded.
  862.  
  863. 4. A NAK for the next packet is NOT an ack for the current one if the current
  864. one was a Send-Init.
  865.  
  866. 5. Check for packet number wrap-around when checking for things like "is this
  867. a NAK for the previous packet?" when comparing packet numbers.
  868.  
  869. 6. May want to verify other side's Send-Init parameters more rigorously and
  870. force them to legal values if illegal.
  871.  
  872. 7. Junk in command buffer after a file transfer (or is it just an unsuccessful
  873. file transfer?) sometimes prevents the first command after the transfer from
  874. being parsed.
  875.  
  876. 8. The old file stepping mechanism -- which allowed only 16 files to be sent in
  877. a wildcard send command -- has been replaced by a new mechanism that lets any
  878. number be sent.  However, the new mechanism is very costly, requiring on the
  879. order of n**2 directory lookups to send n files.  The new method should
  880. incorporate the old -- build a table of, say, 16 (32? 64?) files to send, and
  881. when that gets used up, build another table.
  882.  
  883. 9. KERMIT-80 (and all the other micro versions) badly need to be able to send a
  884. BREAK signal.  You need it to talk to IBM systems, and to get the attention of
  885. various kinds of port switchers, multiplexers, etc.  Code has been added to
  886. allow the VT180 and DECmate II to do this, but none of the other
  887. implementations have it.  This is, of course, highly system dependent.
  888.  
  889. 10. Fix logging function.  Most implementations don't have it; those that do
  890. lose characters.  Log to a big area in memory; when buffer gets nearly full,
  891. send ^S, dump it to disk, send ^Q.  Look at MODEM, see what it does.
  892.  
  893. 11. Retry count still isn't updated in every case.
  894.  
  895. 12. Here's a bug that has not yet been fixed in CPMBASE.M80 or the .HEX files:
  896.  
  897. Date: 29 May 1984 0242-PDT
  898. From: Charles Carvalho <CHARLES at ACC>
  899. Subject: Fix for Kermit-80 V3.9
  900. To: CC.FDC at COLUMBIA-20
  901.  
  902. Kermit-80 v3.9 will always prefix all &'s in the data with #'s.  This should
  903. only be done if 8th-bit prefixing has been requested.  This problem will only
  904. be seen when the other Kermit does not request (or permit) 8th-bit quoting,
  905. since Kermit-80 always agrees to use 8th-bit quoting.  To fix it, replace the
  906. following three lines between gtch4a: and gtch4b:.
  907.  
  908.     lxi    h,qbchr        ;[jd] point to 8-bit quote char
  909.     cmp    m        ;[jd] is it our quote character?
  910.     jz    gtch4b        ;[jd] yes, have to quote it...
  911.  
  912. with:
  913.  
  914.     lda    quot8        ; Are we doing 8th-bit quoting?
  915.     ora    a
  916.     jz    gtch4c        ; if not, skip this test and restore character.
  917.     lda    qbchr        ; get 8th-bit quote character
  918.     cmp    d        ; same as current character?
  919.     jz    gtch4b        ; yes, have to quote it...
  920. gtch4c:    mov    a,d        ; no. get character back again.
  921.  
  922.  
  923. The next release will have this fix, and many other enhancements.
  924.  
  925. [This fix is installed in an interim release called 3.9A -- If your version of
  926. KERMIT-80 announces itself as 3.9A, then it has this fix.]
  927. % type cpmkermi.mss
  928. @Part(CPMKERMIT,root="USER")
  929. @Chapter<CP/M-80 KERMIT>
  930. @Begin<Description,Leftmargin +12,Indent -12,spread 0>
  931. @i(Program:)@\Bill Catchings, Columbia University,
  932. with contributions from Bernie Eiben (DEC), Nick Bush (Stevens),
  933. John Bray (University of Tennessee), Bruce Tanner (Cerritos College),
  934. Greg Small (University of California at Berkeley),
  935. Kimmo Laaksonen (Helskini University of Technology), and many others.
  936.  
  937. @i(Language:)@\8080 Assembler or MAC80
  938.  
  939. @i(Version:)@\3.9
  940.  
  941. @i(Date:)@\April 1984
  942.  
  943. @i(Documentation:)@\Frank da Cruz, Columbia University
  944. @end<Description>
  945. @label<-k80>
  946.  
  947. @i<KERMIT-80 Capabilities At A Glance:>
  948. @begin<format,leftmargin +2>
  949. @tabclear()@tabset(3.5inches,4.0inches)
  950. Local operation:@\Yes
  951. Remote operation:@\No
  952. Transfers text files:@\Yes
  953. Transfers binary files:@\Yes
  954. Wildcard send:@\Yes
  955. @q<^X/^Y> interruption:@\Yes
  956. Filename collision avoidance:@\Yes
  957. Can time out:@\Yes 
  958. 8th-bit prefixing:@\Yes
  959. Repeat count prefixing:@\No
  960. Alternate block checks:@\Yes
  961. Terminal emulation:@\Yes, VT52 and others
  962. Communication settings:@\Yes; duplex, parity
  963. Transmit BREAK:@\Yes; some versions
  964. IBM communication:@\Yes
  965. Transaction logging:@\No
  966. Session logging (raw download):@\Yes
  967. Raw upload:@\Yes
  968. Act as server:@\No
  969. Talk to server:@\Yes; SEND, GET, FIN, BYE
  970. Advanced commands for servers:@\No
  971. Local file management:@\Yes; DIR, ERA, SET DEFAULT disk
  972. Handle file attributes:@\No
  973. Command/init files:@\No
  974. Printer control:@\Yes, limited 
  975. @end<format>
  976.  
  977. @heading<Summary of CP/M>
  978.  
  979. CP/M-80 (version 2@q<.>2)
  980. has only five built-in commands, and they all deal with files;
  981. other functions are done by invoking programs.
  982.  
  983. CP/M file specifications are of
  984. the form @q(DEV:XXXXXXXX.YYY), where
  985. @begin<description>
  986.  @q(DEV:)@\is a @i<device name>,
  987. normally the A:@ or B:@ floppy.  If omitted, the device name defaults
  988. to your connected diskette.
  989.  
  990. @q(XXXXXXXX)@\is a @i<filename> of up to 8 characters.
  991.  
  992. @q(YYY)@\is the @i<file type>, up to 3 characters.
  993.  @end<description>
  994.  File names and file types may contain letters, digits, and some
  995. special characters, including dash, dollar sign, and underscore, but
  996. no imbedded spaces.  Upper and lower case letters are equivalent.
  997.  
  998.  "Wildcard" file-@|group specifications are permitted in file names
  999. and file types (but not device names) within certain contexts; a "@q(*)"
  1000. matches a whole field, a "@q(?)"  matches a single character, including
  1001. space.  Examples: "@q(*.F??)" specifies all files whose @i<types> start
  1002. with F and are 1, 2, or 3 characters long; "@q(F?.*)" specifies all
  1003. files whose names start with F and are no more than two characters
  1004. long (before the trailing spaces).
  1005.  
  1006. The five CP/M commands are:
  1007.  @Begin<Description>
  1008. DIR @i<file>@\Lists the the names of the specified files.  The
  1009. default file specification is "*.*".  Example: @w<"@q(DIR B:*.FOR)">.
  1010.  
  1011. ERA @i<file>@\Erases (deletes) the specified file(s); wildcards allowed.
  1012.  
  1013. REN @i<new> @i<old>@\Changes the name of a file from @i<old> to @i<new>, e.g.@*
  1014. @w<"@q(REN NEW.FOR=OLD.FOR)">.
  1015.  
  1016. SAVE@\Saves the specified number of memory blocks into a file.
  1017.  
  1018. TYPE @i<file>@\Types the specified file on the screen, e.g.
  1019. @w<"@q(TYPE FOO.TXT)">.
  1020.  @End<Description>
  1021. The most important programs are:
  1022.  @Begin<Description>
  1023. STAT@\Gives statistics on disk usage.
  1024.  
  1025. PIP@\@u<P>eripheral @u<I>nterchange @u<P>rogram.  Copies files.  In
  1026. response to the "@q(*)" prompt, give a command of the form
  1027.  @example<disk:outfile=disk:infile>
  1028.  Wildcards ("@q(*)" for a whole field or "@q(?)"  for a letter) can be used.
  1029. Examples: "@q(A:=B:*.*)" to copy a whole disk, "@q(A:=B:*.FOR)" to copy all
  1030. the Fortran programs from disk B to disk A.  If the disk specification
  1031. is omitted, your "connected" disk is assumed.  Command line arguments
  1032. are also accepted, e.g. "@q(PIP A:=B:*.*)".
  1033. @End<Description>
  1034. For further information on CP/M, consult your microcomputer manual or
  1035. a CP/M handbook.
  1036.  
  1037. @heading<KERMIT-80 Description>
  1038.  
  1039. Implementations of Kermit-80 presently exist for the DEC VT180@ (Robin), the
  1040. DECmate II, the Intertec Superbrain, the Heath/Zenith 89 and Z100, the @w<Apple
  1041. II> with the Z80 SoftCard, the @w<Osborne 1>, the TRS-80 II with CP/M, the
  1042. Telcon Zorba, the Kaypro, the Vector Graphics CP/M system, the Morrow
  1043. @w<Decision I>, the Nokia MikroMikko, and others.  There
  1044. is also a "generic" CP/M version that should run on most 8080-@|compatible CP/M
  1045. 2.2 systems, but which may provide less performance, and another for CP/M 3.0.
  1046.  
  1047. @index<Timeout>
  1048. Since Kermit-80 runs on a standalone micro, it is always in control of the
  1049. screen -- it is always @i<local>@index<Local>.  Thus, it always keeps the
  1050. screen updated with the file name and the packet number, whether sending or
  1051. receiving.  Kermit-80 is capable of an imprecise or "fuzzy" timeout on an
  1052. input request, and can break deadlocks automatically.  In most cases, this is
  1053. not important, because the KERMIT on the other side is most likely able to
  1054. handle the timeouts.  The timeouts done by Kermit-80 are fuzzy because they
  1055. depend on the speed of the Z80 processor and other factors that can vary from
  1056. system to system.
  1057.  
  1058. If despite the timeout capability, the transmission appears to be stuck (and
  1059. you can tell that this has happened if the screen fails to change for a while)
  1060. you can type carriage return to have the micro do what it would have done on a
  1061. @Index[Timeout] timeout, namely NAK@Index[NAK] the expected packet to cause to
  1062. foreign host to send it again (or, if the micro is sending, to retransmit the
  1063. last packet).  Micro/@|micro or micro/@|IBM-@|mainframe transfers could require
  1064. this kind of manual intervention.
  1065.  
  1066. File transfers may be interrupted in several ways.
  1067. @begin<description>
  1068. Control-C@\This will return you to Kermit-80 command level immediately, so that
  1069. you can connect back to the remote system, or take any other desired action.
  1070.  
  1071. Control-X@\When sending a file, this will terminate the sending of the current
  1072. file with a signal to the KERMIT on the other side to discard what it got so
  1073. far.  If there are more files to be sent, KERMIT-80 will go on to the next one.
  1074. When receiving a file, KERMIT-80 will send a signal to the remote KERMIT to
  1075. stop sending this file.  If the remote KERMIT understands this signal (not all
  1076. implementations of KERMIT do), it will comply, otherwise the file will keep
  1077. coming.  In any case, the remote KERMIT will go on to the next file in the
  1078. group, if any.
  1079.  
  1080. Control-Z@\Like Control-X, except if a file group is being transmitted, this
  1081. will stop the transmission of the entire group.  If only a single file is being
  1082. transmitted, it works exactly like Control-X.
  1083.  
  1084. Carriage Returns@\If you type carriage return repeatedly Kermit-80 will retry
  1085. the current packet up to its retry limit (somewhere between 5 and 16 times) and
  1086. then, if no valid response was received, return to Kermit-80 command level.
  1087. @end<description>
  1088.  
  1089. @heading<Kermit-80 Commands>
  1090.  
  1091. KERMIT-80 uses the DECSYSTEM-20 keyword style command language.  Each keyword
  1092. may be abbreviated to its minumum unique length.  "?" may be typed to request a
  1093. menu of the available options for the current field at any point in a command.
  1094. ESC may be typed at any point in a command to fill out the current keyword or
  1095. filename; if sufficient characters have not been typed to identify the current
  1096. field uniquely, KERMIT-80 will sound a beep and allow you to continue from that
  1097. point.
  1098. @begin<description,leftmargin +8,indent -8>
  1099. @Index[Virtual Terminal]@Index[Escape Character]@Index[Connect]
  1100. CONNECT@\Establish a "virtual terminal" connection to any host that may be
  1101. connected to the serial port, i.e.@ pass all typein to the serial port and
  1102. display all input from the serial port on the screen.  Also, emulate a DEC VT52
  1103. to allow cursor control, screen clearing, etc., if VT52-EMULATION is ON (see
  1104. below), in which case you should also set your terminal type on the remote host
  1105. to VT52.  (Some versions emulate other terminals.)  The escape character
  1106. differs from micro to micro; when you issue the CONNECT command, the micro will
  1107. print a message telling you how to get back.  The escape sequence is generally
  1108. an uncommonly-@|used control character, like CTRL-backslash or
  1109. CTRL-rightbracket, followed by a single letter "command".
  1110.  @begin<description,spread 0,leftmargin +4, indent -4>
  1111. C@\Close Connection, return to @q(Kermit-80>) command level.
  1112.  
  1113. S@\Display Status of connection, but maintain remote connection.
  1114.  
  1115. @q<?>@\List available single-character commands.
  1116.  
  1117. 0@\(zero) Send a null (0) character.
  1118.  
  1119. B@\Send a BREAK signal.  Only some systems provide this function.
  1120.  
  1121. @q<^]>@\(or whatever - a second copy of the escape character) Send the
  1122. escape character itself to the remote host.
  1123.  @end<description>
  1124.  
  1125. @Index[SEND]SEND @i<filespec>@\Send file(s) specified by @i<filespec> to
  1126. the remote Kermit.  The @i<filespec> may contain CP/M wildcards.
  1127.  
  1128. @Index[RECEIVE]@Index[File-Warning]
  1129. RECEIVE@\Receive file(s) from the remote
  1130. Kermit.  Store them under the names provided in the file headers supplied by
  1131. the remote host.  If the names aren't legal, use as many legal characters from
  1132. the name as possible (see the description of SET FILE-WARNING below).  If
  1133. there's a conflict, and FILE-WARNING is ON, warn the user and try to build a
  1134. unique name for the file by adding "@q<&>" characters to the name.
  1135.  
  1136. @Index<GET>GET @i<filespec>@\When Kermit-80 is talking to a Kermit Server on
  1137. the host, you should use the GET command to request the server to send
  1138. files to you, for example: @q[@w<get hlp:k*.hlp>] Limitation: If you request
  1139. an alternate block check type using the SET BLOCK command, the GET command will
  1140. not communicate it to the remote server.  If you want to have type 2 or 3 block
  1141. checks done when getting files from the server, you have to issue the
  1142. appropriate SET BLOCK command to the remote KERMIT before putting it in server
  1143. mode.
  1144.  
  1145. @Index[LOG]LOG @i<filespec>@\When CONNECTed to a foreign host as a terminal,
  1146. log the terminal session to the specified diskette file.  This functionality
  1147. depends to some extent on the remote host's ability to do
  1148. @Index[XON/XOFF]XON/XOFF flow control, and does not guarantee a complete
  1149. transcript (after all, that's what the KERMIT protocol is for).  The log file
  1150. is closed when the connection is closed by typing the escape character followed
  1151. by the single-@|character command "C".
  1152.  
  1153. @Index[TRANSMIT]TRANSMIT @i<filespec>@\Send the specified file to the system on
  1154. the other end of the connection as though it were being typed at the terminal,
  1155. one line at a time.  No KERMIT protocol is involved.  You must manually confirm
  1156. each line.  This is useful for sending files to systems that don't have a
  1157. KERMIT program.  During transmission, you may type the escape character
  1158. followed by one of these single-@|character commands:
  1159. @begin<description,spread 0,leftmargin +4, indent -4>
  1160. C@\Cease transmission
  1161.  
  1162. R@\Re-transmit the previous line
  1163. @end<description>
  1164.  
  1165. BYE@\When talking to a remote Kermit Server, this command shuts down
  1166. the server and logs it out, and also exits from Kermit-80 to CP/M command
  1167. level.@Index[BYE]
  1168.  
  1169. @Index[LOGOUT]LOGOUT@\Like BYE, but leaves you at Kermit-80 command level.
  1170.  
  1171. @Index[FINISH]FINISH@\Like LOGOUT, but shuts down the remote server without
  1172. logging it out.  Leaves you at Kermit-80 command level; subsequent CONNECT
  1173. commands will put you back at host system command level.
  1174.  
  1175. @Index[SET]SET @i<parameter> [@i<value>]@\Set the specified parameter to
  1176. the specified value.  Possible settings:
  1177. @begin<description,leftmargin +8,indent -8>
  1178. @Index[Warning]WARNING ON (or OFF)@\Warn user of filename conflicts when
  1179. receiving files from remote host, and attempt to generate a unique name by
  1180. adding "@q<&>" characters to the given name.  ON by default.
  1181.  
  1182. @Index[VT52]VT52-EMULATION ON (or OFF)@\When connected as a terminal
  1183. to a foreign host, controls whether the micro emulates a VT52 or
  1184. runs in "native mode".  VT52 emulation is ON by default, except on micros
  1185. that already have terminal functionality built in, such as the DEC VT180 and
  1186. DECmate (these act as @index<VT100>VT100-@|series terminals).  Some systems
  1187. emulate other terminals, like the ADM3A.
  1188.  
  1189. @Index[Local-Echo]LOCAL-ECHO ON (or OFF)@\When you CONNECT to a remote
  1190. host, you must set LOCAL-@|ECHO ON if the host is half duplex, OFF if
  1191. full duplex.  OFF by default.
  1192.  
  1193. @Index[Escape Character]ESCAPE@\Change the escape character for
  1194. virtual terminal connections.  Kermit-80 will prompt you for the new
  1195. escape character, which you enter literally.
  1196.  
  1197. @Index[Baud]BAUD@\Change the baud rate of the communications port.  This
  1198. command only works on some systems, and its actual operation can vary from
  1199. system to system.  Type SET BAUD followed by a question mark, and follow the
  1200. directions.  On systems that do not support this command, you must set the port
  1201. baud rate from CP/M or other setup mechanism outside of KERMIT-80.
  1202.  
  1203. @Index[Parity]PARITY@\Sets parity for outgoing characters to one of the
  1204. following: NONE, SPACE, MARK, EVEN, or ODD.  On input, if parity is NONE, then
  1205. the 8th bit is kept (as data), otherwise it is stripped and ignored.  The
  1206. parity setting applies to both terminal connection and file transfer.
  1207. If you set parity to anything other than none, KERMIT-80 will attempt to use
  1208. @Index<Eighth-Bit Prefix>
  1209. "8th bit prefixing" to transfer binary files.  If the other KERMIT is also
  1210. capable of 8th bit prefixing, then binary files can be transferred
  1211. successfully; if not, the 8th bit of each data byte will be lost (you will see
  1212. a warning on your screen if this happens).
  1213.  
  1214. @Index[TIMER]TIMER ON (or OFF)@\Enable or disable the "fuzzy timer".  The timer
  1215. is off by default, because in the normal case KERMIT-80 is communicating with a
  1216. mainframe KERMIT that has its own timer.  Mainframe KERMIT timers tend to be
  1217. more precise or adaptable to changing conditions.  You should SET TIMER ON if
  1218. you are communicating with a KERMIT that does not have a timer.  You should SET
  1219. TIMER OFF if you are communicating over a network with long delays.
  1220.  
  1221. @Index[IBM]IBM ON (or OFF)@\Allow the transfer of files to and from an IBM
  1222. mainframe computer.  This makes Kermit-80 wait for the IBM turnaround character
  1223. (XON), ignore parity on input, add appropriate parity to output, and use local
  1224. echoing during CONNECT.  As distributed, KERMIT-80 uses MARK parity for IBM
  1225. communication.  If you don't give this command, IBM mode is OFF.  Since IBM
  1226. VM/CMS KERMIT does not have timeout capability, SET IBM ON also turns on the
  1227. "fuzzy timer" automatically.
  1228.  
  1229. @Index[Block Check]BLOCK-CHECK-TYPE@\The options are:
  1230. @begin<description,spread 0,leftmargin +8,indent -8>
  1231. 1-CHARACTER-CHECKSUM@\Normal, default, standard 6-bit checksum.
  1232.  
  1233. 2-CHARACTER-CHECKSUM@\A 12-bit checksum encoded as two characters.
  1234.  
  1235. 3-CHARACTER-CRC-CCITT@\A 16-bit CCITT-format Cyclic Redundancy Check, encoded
  1236. as 3 characters.
  1237.  
  1238. @end<description>
  1239. The 2 and 3 character options should only be used under conditions of extreme
  1240. line noise.  Many implementations of KERMIT only support the single character
  1241. checksum.
  1242.  
  1243. FILE-MODE@\Tells KERMIT-80 what kind of file it is sending, so that KERMIT can
  1244. correctly determine the end of the file.  SET FILE BINARY means to send all the
  1245. 128-@|byte blocks of the file, including the last block in its entirety; SET
  1246. FILE ASCII is used for text files, and transmission stops when the first
  1247. Control-Z is encountered anywhere in the file (this is the CP/M convention for
  1248. marking the end of a text file).  If binary transmission is used on a text
  1249. file, some extraneous characters (up to 127 of them) may appear at the end of
  1250. the file on the target system.  If ASCII transmission is used on a binary file,
  1251. the entire file will not be sent if it happens to contain any data bytes that
  1252. correspond to Control-Z.
  1253.  
  1254. DEFAULT-DISK@\This allows you to set the default disk as source and destination
  1255. of file transfers.  In addition, issuing this command causes you to switch to
  1256. the specified disk and log it in, write-@|enabled.  The selected disk appears
  1257. in your KERMIT-80 prompt, for instance @example[Kermit-80 A:>]
  1258.  
  1259. PORT@\Allows you to switch between different communication ports.  This command
  1260. is not available on all systems.
  1261.  
  1262. PRINTER@\ON or OFF.  Turns copying of CONNECT session to printer on and off.
  1263. No attempt is made to do buffering or flow control; it is assumed printer can
  1264. keep up.
  1265. @end<description>
  1266.  
  1267. DIR@\This provides a directory listing of the specified files.  If no files are
  1268. specified, all files on the default disk are listed.  File sizes, in K, are
  1269. included.  You may interrupt the listing at any time by typing any character.
  1270. The listing (even if interrupted) concludes with a display of the amount of
  1271. free storage left on the disk.
  1272.  
  1273. ERA@\This executes the CP/M ERA command on the specified file(s).  The names of
  1274. the files being erased are not displayed.
  1275. @end<description>
  1276.  
  1277. @section<Generic KERMIT-80>
  1278.  
  1279. @index<Generic Kermit-80>@index<8080> "Generic Kermit-80" is a implementation
  1280. of Kermit that should run on any 8080-@|compatible CP/M system no modification
  1281. at all, or perhaps only a minor one.  Unlike other Kermit-80 implementations,
  1282. it contains no system-@|dependent manipulation of the serial port or screen.
  1283. All I/O is done with standard CP/M BIOS@index<BIOS> calls, and I/O redirection
  1284. is done using the CP/M IOBYTE function, which, according to the Digital
  1285. Research @i<CP/M Operating System Manual>, is an optional feature of any
  1286. particular CP/M implementation.  If your system does not provide the IOBYTE
  1287. function, Generic Kermit-80 will not work; furthermore, not all systems that
  1288. implement IOBYTE do so in the same way.
  1289.  
  1290.  The reason all Kermit-80 implementations aren't
  1291. generic is that a good deal of speed is sacrificed by getting all services from
  1292. the operating system.  While a specific implementation of Kermit-80 may be able
  1293. to operate at 4800, 9600, or even 19200 baud, Generic Kermit will fail to work
  1294. on some systems at speeds in excess of 1200 baud.
  1295.  
  1296. Generic Kermit also differs from other Kermit-80 implementations in that it
  1297. does not do fancy screen control during file transfer; it simply types the
  1298. file names, packet numbers, and messages in sequence across and down the
  1299. screen.  This works best if you can put your micro or terminal in "autowrap"
  1300. mode; otherwise the packet numbers will pile up in the rightmost column; the
  1301. filenames and messages will always appear on a new line, however.  Neither does
  1302. generic Kermit-80 do termimal emulation; thus a generic Kermit-80 acts either
  1303. as a "dumb terminal" (sometimes called a "glass TTY"), or else its own built in
  1304. terminal firmware provides cursor control functions independent of the Kermit
  1305. program.
  1306.  
  1307. Note that VT180 and DECmate-II Kermit are simply adaptations of Generic Kermit
  1308. that do VT100 (ANSI) screen control during file transfer.
  1309.  
  1310. @section<Installation>
  1311.  
  1312. Kermit-80 was written originally for the @Index[Superbrain] Intertec SuperBrain
  1313. in lowest-@|common-@|denominator @Index[8080] 8080 code with
  1314. the standard assembler, ASM (no macros, no advanced instructions), so that it
  1315. can be assembled on any CP/M-80 system@foot{The 8080 assembler is distributed
  1316. as a standard part of CP/M-80, whereas the fancier Z80@Index[Z80] or macro
  1317. assemblers are normally a commercial product}.  It has since been modified to
  1318. run on many other systems as well.  Kermit-80 should be able to run on any
  1319. 8080-, 8085- or Z80-@|based microcomputer under @Index[CP/M] CP/M with only
  1320. minor modifications (see below).
  1321.  
  1322. All versions of Kermit-80 are assembled from the same source, with system
  1323. dependencies taken care of by assembly-@|time conditionals.  The most important
  1324. system dependencies are terminal emulation (when CONNECTed to the remote host)
  1325. and screen handling, which are dependent on the individual micro's escape codes
  1326. (these features are table driven and easily modified for other CP/M systems),
  1327. and the lowest level i/o routines for the serial communications port.  The port
  1328. routines are best done only with BDOS calls, but some systems do not allow
  1329. this, primarily because the BDOS routines strip the parity bit during port i/o,
  1330. and the parity bit is used for data when transmitting binary files.  Also,
  1331. using BDOS calls, there's no way to poll the serial port; you must hang until
  1332. input appears.
  1333.  
  1334. Kermit-80's i/o routines must check the port status and go elsewhere if no
  1335. input is available; this allows for virtual terminal connection, keyboard
  1336. interruption of stuck transmissions, etc.  On systems that fully implement i/o
  1337. redirection via the optional CP/M IOBYTE facility, this may be done by
  1338. switching the IOBYTE definition.  On others, however, IN/OUT instructions
  1339. explicitly referencing the port device registers must be used.
  1340.  
  1341. @index<Timeout>
  1342. CP/M-80 KERMIT version 3.8 and above includes a "fuzzy timer" that allows a
  1343. timeout to occur after an interval ranging from 5 to 20 seconds (depending upon
  1344. the speed of the processor and the operating system routines) during which
  1345. expected input does not appear at the port.  In this case, retransmission
  1346. occurs automatically.  In any case, you may type a carriage return during
  1347. transmission to simulate a timeout when the transfer appears to be stuck.
  1348.  
  1349. @subsection<Downloading Kermit-80>
  1350.  
  1351. If you already have a version of Kermit on your micro and you want to install
  1352. a new version, simply use your present version to get the new one.  If it's
  1353. stored in the form of a @q<.COM> file, you can run it directly.  If it's stored
  1354. as a @q<.HEX> file, you must first LOAD it on your micro to produce a @q<.COM>
  1355. file.
  1356.  
  1357. If you do not have a copy of KERMIT on your micro, and you cannot borrow a
  1358. Kermit floppy but you do have access to a mainframe computer with a copy of the
  1359. Kermit-80 distribution, you should read this section.
  1360.  
  1361. @Index[Bootstrap]@index<Downloading> There are several ways to get Kermit from
  1362. a host system to your micro.  The easiest is to "download" the precompiled
  1363. "hex" file into your micro's memory and then save it on the disk.  The
  1364. following is a procedure which, though far from foolproof, should allow you to
  1365. get a version of Kermit to your CP/M based micro.  It depends upon the host
  1366. prompt, or at least the first character of the host prompt, being some
  1367. character that cannot appear in a hex file (the valid characters for hex files
  1368. are the digits 0-9, the upper case letters A-F, the colon ``@q<:>'', carriage
  1369. return, and line feed).  As soon as any other character is encountered, the
  1370. transfer will terminate.  If your host does not issue a prompt that will
  1371. accommodate this scheme, you can achieve the same effect by modifing the adding
  1372. an atsign ``@@'' to the very end of the hex file before sending it from the
  1373. host.  The program below looks for an atsign (the normal DEC-20 prompt, hex
  1374. 40).  DECSYSTEM-10 users would look for a dot, hex 2E.
  1375.  @Begin <Enumerate>
  1376. Look for the appropriate hex file in the host's KERMIT area.  The name will be
  1377. something like @q<CPMROBIN.HEX>, @q<CPMHEATH.HEX>, @q<CPMOSBORN.HEX>, etc.
  1378. If you don't find it, but you do find a corresponding @q<.ASM> or @q<.M80>
  1379. file, you'll either have to build a new hex file on the host using a cross
  1380. assembler (see below for how to do this on a DEC-10 or DEC-20), or else bring
  1381. the M80 source file to your micro and assemble it there.
  1382.  
  1383. Connect to your host using a terminal or a terminal emulation facility.  Ensure
  1384. that your host does not have your terminal in "page mode".  E.g. on the DEC-20,
  1385. give the Exec command @q<TERMINAL NO PAUSE END-OF-PAGE>.
  1386.  
  1387. Tell the host to display the hex file at your terminal.  E.g. on the DEC-20,
  1388. give the Exec command @q<TYPE KERMIT.HEX>, @i<@u(without) a terminating
  1389. carriage return>.
  1390.  
  1391. Return to your micro.  Connect to a floppy disk with plenty of free space.
  1392. Make sure your IOBYTE is set so that @q<RDR:> and @q<PUN:> correspond to the
  1393. I/O port that is connected to the DEC-20 (this would normally be the case
  1394. unless you have done something special to change things).  Run DDT and type in
  1395. the following (the comments should not be typed in; they are there just to tell
  1396. you what's happening):
  1397. @Begin <Example,Free>
  1398. -ikermit.hex            ;Setup FCB for file KERMIT.HEX.
  1399. -a100                   ;Begin assembling code at 100.
  1400. 0100 lxi h,ffe          ;Where to put HEX file.
  1401. 0103 shld 300           ;Save the address.
  1402. 0106 mvi e,d            ;Get a CR.
  1403. 0108 mvi c,4            ;Output function.
  1404. 010A call 5
  1405. 010D mvi c,3            ;Input function.
  1406. 010F call 5
  1407. 0112 ani 7f             ;Turn off the parity.
  1408. 0114 cpi 40             ;Our DEC-20 prompt atsign?
  1409. 0116 jz 124             ;Yes, we have whole file.
  1410. 0119 lhld 300           ;Get the pointer.
  1411. 011C mov m,a            ;Else, store the char.
  1412. 011D inx h              ;Increment the pointer.
  1413. 011E shld 300           ;Save the pointer.
  1414. 011F jmp 10d            ;Go around again.
  1415. 0124 mvi a,1a           ;Get a control-Z.
  1416. 0126 lhld 300           ;Get the pointer.
  1417. 0129 mov m,a            ;Store the char.
  1418. 012A shld 300           ;Save the pointer.
  1419. 012D lxi h,1000         ;Pointer to file.
  1420. 0130 shld 310           ;Save the pointer.
  1421. 0133 mvi c,16           ;Make file.
  1422. 0135 lxi d,5c
  1423. 0138 call 5
  1424. 013B lhld 310           ;Get the file pointer.
  1425. 013E xchg               ;Put it in DE.
  1426. 013F mvi c,1a           ;Set DMA.
  1427. 0141 call 5
  1428. 0144 mvi c,15           ;Write DMA to file.
  1429. 0146 lxi d,5c
  1430. 0149 call 5
  1431. 014C lhld 310           ;Get the file pointer.
  1432. 014F lxi d,80           ;Get the DMA size.
  1433. 0152 dad d              ;Adjust file pointer.
  1434. 0153 shld 310           ;Save it.
  1435. 0156 lda 301            ;Get high order byte.
  1436. 0159 cmp h              ;Have we passed the end?
  1437. 015A jm 170             ;Yes.
  1438. 015D jz 163             ;Maybe.
  1439. 0160 jmp 13b            ;No.
  1440. 0163 lda 300            ;Get low order byte.
  1441. 0166 cmp l              ;Passed the end?
  1442. 0167 jm 170             ;Yes.
  1443. 016A jz 170             ;Yes.
  1444. 016D jmp 13b            ;Not quite.
  1445. 0170 mvi c,10           ;Close file.
  1446. 0172 lxi d,5c
  1447. 0175 call 5
  1448. 0178 ret
  1449. 0179
  1450. -g100,179               ;Execute the program.
  1451. -                       ;Reboot
  1452. @End<Example>
  1453.  Now there should be a file @q<KERMIT.HEX> on your connected disk.
  1454.  
  1455. Load this using the CP/M command LOAD to produce @q<KERMIT.COM>.  This should
  1456. be a runnable version of Kermit.  Note that CP/M hex files have checksums on
  1457. each line.  If there were any transmission errors during the downloading
  1458. process, the CP/M loader will notice a bad checksum and will report an error
  1459. (something like "Illegal Format").  If you get any errors during loading,
  1460. either fix the hex file locally with an editor, or repeat the previous step.
  1461.  @End<Enumerate>
  1462.  
  1463. You now should have a running version of Kermit-80.
  1464.  
  1465. @subsection<Building KERMIT.HEX>
  1466.  
  1467. The source for Kermit-80 should be available on your host computer.  It is
  1468. written using 8080 assembler mnemonics, so it can be assembled on most 8080s
  1469. and Z80s using the standard 8080 assembler provided with CP/M.  If you have
  1470. @q<KERMIT.ASM> on your CP/M system, you can assemble it directly on the micro
  1471. using ASM, setting the desired assembly switches as explained below.  If you
  1472. don't have it, you can attempt to download the source file from the host using
  1473. the procedure outlined above.
  1474.  
  1475. A cross assembler @index<Cross Assembler> is provided that runs on the
  1476. @index<DECSYSTEM-20>@index<DECsystem-10> DEC-10 and DEC-20, called MAC80,
  1477. contributed by Bruce Tanner at Cerritos College, that may be used for cross
  1478. assembling KERMIT-80 as shown in this example (for TOPS-20):
  1479.  @begin<enumerate>
  1480. Copy @q(PS:<KERMIT>CPMK@i<xx>.M80) to your directory, as @q<KERMIT.M80>.
  1481. TOPS-10 filename rules must be followed.  This is the 8080 assembler source
  1482. file; @i<xx> is the current version number; for instance version 3.8 would be
  1483. stored as @q<CPMK38.M80>.
  1484.  
  1485. Edit @q<KERMIT.M80> to set the conditional assembly switch for your machine.
  1486. These are right near the top of the file.  The switch for your machine should
  1487. be set to TRUE and all the others to FALSE.
  1488.  
  1489. The "ibm-flag" setting is site dependent.  As shipped from Columbia, it turns
  1490. on half duplex line handshaking, using CTRL-Q as the turnaround character, sets
  1491. LOCAL-ECHO ON, TIMER ON, and PARITY MARK.  Make any changes required for your
  1492. site.
  1493.  
  1494. The default FILE-MODE is ASCII as shipped from Columbia.  This means that when
  1495. text files are sent from the CP/M system, no extraneous characters will be sent
  1496. after the end, but that outgoing binary files may be truncated erroneously if
  1497. the user forgets to SET FILE BINARY.  You can change the default to BINARY, so
  1498. that no data is ever lost from any file, but text files will usually have
  1499. extraneous junk at the end.
  1500.  
  1501. @begin<multiple>
  1502. @index<MAC80>@index<Hex File>
  1503. Run MAC80:
  1504. @begin<example>
  1505. @@@u<mac80>
  1506. *@ux<kermit=kermit>
  1507. *@ux<^Z>
  1508. @end<example>
  1509. The result will be in your directory as @q<KERMIT.HEX>.
  1510. @end<multiple>
  1511.  
  1512. Use Kermit, MODEM, or any other downloading mechanism to transfer
  1513. @q(KERMIT.HEX) to the micro, or download it using the DDT program shown above.
  1514.  
  1515. On the micro, load the hex file:
  1516. @example{A>@ux[load kermit]}
  1517. @q(KERMIT.COM) will appear on the floppy.
  1518.  
  1519.  The new Kermit should be ready to run.
  1520.  @end<enumerate>
  1521.  
  1522. @subsection<Generic Kermit-80>
  1523.  
  1524. @index<Generic Kermit-80>@Index<IOBYTE>
  1525. If your CP/M 2.2 system implements i/o redirection via the (optional) IOBYTE
  1526. mechanism, you can probably run Generic Kermit on it, either without
  1527. modification, or by a very simple change to the program.  The standard CP/M
  1528. IOBYTE is set up as follows:
  1529. @begin<verbatim,group,blanklines hinge>
  1530. I/O Byte assignments (four 2-bit fields for 4 devices at location 3)
  1531. :
  1532. bits 6+7        LIST field
  1533.     0           LIST is Teletype device (TTY:)
  1534.     1           LIST is CRT device (CRT:)
  1535.     2           LIST is Lineprinter (LPT:)
  1536.     3           LIST is user defined (UL1:)
  1537.  
  1538. bits 4+5        PUNCH field
  1539.     0           PUNCH is Teletype device (TTY:)
  1540.     1           PUNCH is high speed punch (PUN:)
  1541.     2           PUNCH is user defined #1 (UP1:)
  1542.     3           PUNCH is user defined #2 (UP2:)
  1543.  
  1544. bits 2+3        READER field
  1545.     0           READER is Teletype device (TTY:)
  1546.     1           READER is high speed reader (RDR:)
  1547.     2           READER is user defined #1 (UR1:)
  1548.     3           READER is user defined #2 (UR2:)
  1549.  
  1550. bits 0+1        CONSOLE field
  1551.     0           CONSOLE is console printer (TTY:)
  1552.     1           CONSOLE is CRT device (CRT:)
  1553.     2           CONSOLE is in Batch-mode (BAT:); READER = Input, LIST = Output
  1554.     3           CONSOLE is user defined (UC1:)
  1555. @end<verbatim>
  1556. (Here, bit zero is the least significant, "rightmost", bit).
  1557.  
  1558. I/O redirection is accomplished by switching the IOBYTE between two values,
  1559. "batch i/o" and "normal i/o".  In normal i/o mode, the keyboard is defined to
  1560. be the console.  In batch i/o mode, the serial port is defined to be the
  1561. console.  This switching is necessary because the console is the only device
  1562. that can be tested to see if input is available, but KERMIT must shuttle back
  1563. and forth between the keyboard @i<and> the serial port looking for input.  Here
  1564. are the batch and default i/o mode definitions used in "standard" Generic
  1565. KERMIT-80:
  1566. @begin<verbatim>
  1567.  
  1568. batio   EQU     056H            ;I/O byte CON=BAT,LIST=CRT,READER=RDR
  1569. defio   EQU     095H            ;I/O byte CON=CRT,LIST=LPT,READER=RDR
  1570. @end<verbatim>
  1571.  
  1572. Other systems may have other logical devices that point to the serial port,
  1573. in which case you'll need to redefine these symbols to point to those devices
  1574. and then reassemble the program (with assembly switch GENER set to TRUE, all
  1575. others FALSE).
  1576.  
  1577. If your system runs CP/M 3.0, then the CPMPLUS version of KERMIT should run on
  1578. your system without modification, except perhaps for screen control or baud
  1579. rate setting.
  1580. % e program (with assembly switch GENER set to TRUE, all others