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 / KAYPRO / KPKER405.LBR / KERMIT80.DZC / KERMIT.DOC
Text File  |  2000-06-30  |  36KB  |  735 lines

  1.  
  2.  
  3.  
  4. 1. CP/M-80 KERMIT
  5.  
  6. Program:    Bill Catchings, Columbia University, with contributions from Bernie
  7.             Eiben   (DEC),  Nick  Bush  (Stevens),  John  Bray  (University  of
  8.             Tennessee), Bruce Tanner (Cerritos College), Greg Small (University
  9.             of California at Berkeley), Kimmo Laaksonen (Helskini University of
  10.             Technology), and many others.
  11. Language:   8080 Assembler or MAC80
  12. Version:    3.9
  13. Date:       April 1984
  14. Documentation:
  15.             Frank da Cruz, Columbia University
  16.  
  17. KERMIT-80 Capabilities At A Glance:
  18.   Local operation:                   Yes
  19.   Remote operation:                  No
  20.   Transfers text files:              Yes
  21.   Transfers binary files:            Yes
  22.   Wildcard send:                     Yes
  23.   ^X/^Y interruption:                Yes
  24.   Filename collision avoidance:      Yes
  25.   Can time out:                      Yes
  26.   8th-bit prefixing:                 Yes
  27.   Repeat count prefixing:            No
  28.   Alternate block checks:            Yes
  29.   Terminal emulation:                Yes, VT52 and others
  30.   Communication settings:            Yes; duplex, parity
  31.   Transmit BREAK:                    Yes; some versions
  32.   IBM communication:                 Yes
  33.   Transaction logging:               No
  34.   Session logging (raw download):    Yes
  35.   Raw upload:                        Yes
  36.   Act as server:                     No
  37.   Talk to server:                    Yes; SEND, GET, FIN, BYE
  38.   Advanced commands for servers:     No
  39.   Local file management:             Yes; DIR, ERA, SET DEFAULT disk
  40.   Handle file attributes:            No
  41.   Command/init files:                No
  42.   Printer control:                   Yes, limited
  43.  
  44.  
  45.                                 SUMMARY OF CP/M
  46.  
  47. CP/M-80 (version 2.2) has only five built-in commands, and they all  deal  with
  48. files; other functions are done by invoking programs.
  49.  
  50. CP/M file specifications are of the form DEV:XXXXXXXX.YYY, where
  51.  
  52. DEV:            is  a  device  name, normally the A: or B: floppy.  If omitted,
  53.                 the device name defaults to your connected diskette.
  54.  
  55. XXXXXXXX        is a filename of up to 8 characters.
  56.  
  57. YYY             is the file type, up to 3 characters.
  58.  
  59. File names and file types may contain letters, digits, and some special charac-
  60. ters, including dash, dollar sign, and underscore, but no imbedded spaces.  Up-
  61. per and lower case letters are equivalent.
  62.  
  63. "Wildcard" file-group specifications are permitted in file names and file types
  64. (but not device names) within certain contexts; a "*" matches a whole field,  a
  65. "?"  matches  a single character, including space.  Examples: "*.F??" specifies
  66. all files whose types start with F and are 1, 2, or 3 characters  long;  "F?.*"
  67. specifies  all  files whose names start with F and are no more than two charac-
  68. ters long (before the trailing spaces).
  69.  
  70. The five CP/M commands are:
  71.  
  72. DIR file        Lists the the names of the specified files.  The  default  file
  73.                 specification is "*.*".  Example: "DIR B:*.FOR".
  74.  
  75. ERA file        Erases (deletes) the specified file(s); wildcards allowed.
  76.  
  77. REN new old     Changes the name of a file from old to new, e.g.
  78.                 "REN NEW.FOR=OLD.FOR".
  79.  
  80. SAVE            Saves the specified number of memory blocks into a file.
  81.  
  82. TYPE file       Types the specified file on the screen, e.g.  "TYPE FOO.TXT".
  83.  
  84. The most important programs are:
  85.  
  86. STAT            Gives statistics on disk usage.
  87.  
  88. PIP             Peripheral  Interchange Program.  Copies files.  In response to
  89.                 the "*" prompt, give a command of the form 
  90.  
  91.                     disk:outfile=disk:infile
  92.  
  93.                 Wildcards ("*" for a whole field or "?" for a  letter)  can  be
  94.                 used.   Examples: "A:=B:*.*" to copy a whole disk, "A:=B:*.FOR"
  95.                 to copy all the Fortran programs from disk B to disk A. If  the
  96.                 disk  specification  is  omitted,  your "connected" disk is as-
  97.                 sumed.  Command line arguments are  also  accepted,  e.g.  "PIP
  98.                 A:=B:*.*".
  99.  
  100. For  further  information  on CP/M, consult your microcomputer manual or a CP/M
  101. handbook.
  102.  
  103.  
  104.                              KERMIT-80 DESCRIPTION
  105.  
  106. Implementations of Kermit-80 presently exist for  the  DEC  VT180 (Robin),  the
  107. DECmate  II,  the  Intertec  Superbrain,  the  Heath/Zenith  89  and  Z100, the
  108. Apple  II with the Z80 SoftCard, the Osborne 1, the TRS-80 II  with  CP/M,  the
  109. Telcon  Zorba,  the  Kaypro,  the  Vector  Graphics  CP/M  system,  the  Morrow
  110. Decision I, the Nokia MikroMikko, and others.  There is also a  "generic"  CP/M
  111. version that should run on most 8080-compatible CP/M 2.2 systems, but which may
  112. provide less performance, and another for CP/M 3.0.
  113.  
  114. Since  Kermit-80  runs  on  a  standalone micro, it is always in control of the
  115. screen -- it is always local.  Thus, it always keeps the  screen  updated  with
  116. the  file  name and the packet number, whether sending or receiving.  Kermit-80
  117. is capable of an imprecise or "fuzzy" timeout on  an  input  request,  and  can
  118. break  deadlocks  automatically.  In most cases, this is not important, because
  119. the KERMIT on the other side is most likely able to handle the timeouts.    The
  120. timeouts  done  by  Kermit-80 are fuzzy because they depend on the speed of the
  121. Z80 processor and other factors that can vary from system to system.
  122.  
  123. If despite the timeout capability, the transmission appears to  be  stuck  (and
  124. you  can tell that this has happened if the screen fails to change for a while)
  125. you can type carriage return to have the micro do what it would have done on  a
  126.   timeout,  namely  NAK the expected packet to cause to foreign host to send it
  127. again (or, if the micro is sending, to retransmit the  last  packet).    Micro/
  128. micro or micro/IBM-mainframe transfers could require this kind of manual inter-
  129. vention.
  130.  
  131. File transfers may be interrupted in several ways.
  132.  
  133. Control-C       This will return you to Kermit-80 command level immediately, so
  134.                 that  you  can  connect  back to the remote system, or take any
  135.                 other desired action.
  136.  
  137. Control-X       When sending a file, this will terminate  the  sending  of  the
  138.                 current  file  with a signal to the KERMIT on the other side to
  139.                 discard what it got so far.  If there  are  more  files  to  be
  140.                 sent,  KERMIT-80  will go on to the next one.  When receiving a
  141.                 file, KERMIT-80 will send a signal to the remote KERMIT to stop
  142.                 sending this file.  If the remote KERMIT understands this  sig-
  143.                 nal  (not  all  implementations  of KERMIT do), it will comply,
  144.                 otherwise the file will keep coming.  In any case,  the  remote
  145.                 KERMIT will go on to the next file in the group, if any.
  146.  
  147. Control-Z       Like  Control-X,  except  if a file group is being transmitted,
  148.                 this will stop the transmission of the entire group.  If only a
  149.                 single  file  is  being  transmitted,  it  works  exactly  like
  150.                 Control-X.
  151.  
  152. Carriage Returns
  153.                 If you type carriage return repeatedly Kermit-80 will retry the
  154.                 current  packet  up to its retry limit (somewhere between 5 and
  155.                 16 times) and then, if no valid response was  received,  return
  156.                 to Kermit-80 command level.
  157.  
  158.  
  159.                               KERMIT-80 COMMANDS
  160.  
  161. KERMIT-80  uses  the DECSYSTEM-20 keyword style command language.  Each keyword
  162. may be abbreviated to its minumum unique length.  "?" may be typed to request a
  163. menu of the available options for the current field at any point in a  command.
  164. ESC  may  be typed at any point in a command to fill out the current keyword or
  165. filename; if sufficient characters have not been typed to identify the  current
  166. field uniquely, KERMIT-80 will sound a beep and allow you to continue from that
  167. point.
  168.  
  169. CONNECT Establish  a "virtual terminal" connection to any host that may be con-
  170.         nected to the serial port, i.e. pass all typein to the serial port  and
  171.         display  all input from the serial port on the screen.  Also, emulate a
  172.         DEC  VT52  to  allow  cursor  control,  screen   clearing,   etc.,   if
  173.         VT52-EMULATION  is  ON  (see  below), in which case you should also set
  174.         your terminal type on the remote host to VT52.  (Some versions  emulate
  175.         other  terminals.)    The escape character differs from micro to micro;
  176.         when you issue the CONNECT command, the  micro  will  print  a  message
  177.         telling  you  how  to  get  back.   The escape sequence is generally an
  178.         uncommonly-used   control    character,    like    CTRL-backslash    or
  179.         CTRL-rightbracket, followed by a single letter "command".
  180.  
  181.         C   Close Connection, return to Kermit-80> command level.
  182.         S   Display Status of connection, but maintain remote connection.
  183.         ?   List available single-character commands.
  184.         0   (zero) Send a null (0) character.
  185.         B   Send a BREAK signal.  Only some systems provide this function.
  186.         ^]  (or  whatever - a second copy of the escape character) Send the es-
  187.             cape character itself to the remote host.
  188.  
  189. SEND filespec
  190.         Send file(s) specified by filespec to the remote Kermit.  The  filespec
  191.         may contain CP/M wildcards.
  192.  
  193. RECEIVE Receive  file(s)  from  the  remote Kermit.  Store them under the names
  194.         provided in the file headers supplied by the remote host.  If the names
  195.         aren't legal, use as many legal characters from the  name  as  possible
  196.         (see  the  description  of  SET FILE-WARNING below).  If there's a con-
  197.         flict, and FILE-WARNING is ON, warn the user and try to build a  unique
  198.         name for the file by adding "&" characters to the name.
  199.  
  200. GET filespec
  201.         When  Kermit-80  is  talking to a Kermit Server on the host, you should
  202.         use the GET command to request the server to send files to you, for ex-
  203.         ample: get hlp:k*.hlp Limitation: If you  request  an  alternate  block
  204.         check  type  using the SET BLOCK command, the GET command will not com-
  205.         municate it to the remote server.  If you want to  have  type  2  or  3
  206.         block checks done when getting files from the server, you have to issue
  207.         the  appropriate  SET BLOCK command to the remote KERMIT before putting
  208.         it in server mode.
  209.  
  210. LOG filespec
  211.         When CONNECTed to a foreign host as a terminal, log the  terminal  ses-
  212.         sion  to  the  specified  diskette file.  This functionality depends to
  213.         some extent on the remote host's ability to do XON/XOFF  flow  control,
  214.         and  does  not  guarantee a complete transcript (after all, that's what
  215.         the KERMIT protocol is for).  The log file is closed when  the  connec-
  216.         tion  is  closed by typing the escape character followed by the single-
  217.         character command "C".
  218.  
  219. TRANSMIT filespec
  220.         Send the specified file to the system on the other end of  the  connec-
  221.         tion as though it were being typed at the terminal, one line at a time.
  222.         No  KERMIT  protocol is involved.  You must manually confirm each line.
  223.         This is useful for sending files to systems that don't  have  a  KERMIT
  224.         program.    During transmission, you may type the escape character fol-
  225.         lowed by one of these single-character commands:
  226.  
  227.         C   Cease transmission
  228.         R   Re-transmit the previous line
  229.  
  230. BYE     When talking to a remote Kermit Server, this  command  shuts  down  the
  231.         server  and  logs it out, and also exits from Kermit-80 to CP/M command
  232.         level.
  233.  
  234. LOGOUT  Like BYE, but leaves you at Kermit-80 command level.
  235.  
  236. FINISH  Like LOGOUT, but shuts down the remote server without logging  it  out.
  237.         Leaves you at Kermit-80 command level; subsequent CONNECT commands will
  238.         put you back at host system command level.
  239.  
  240. SET parameter [value]
  241.         Set the specified parameter to the specified value.  Possible settings:
  242.  
  243.         WARNING ON (or OFF)
  244.                 Warn  user  of  filename  conflicts  when  receiving files from
  245.                 remote host, and attempt to generate a unique  name  by  adding
  246.                 "&" characters to the given name.  ON by default.
  247.  
  248.         VT52-EMULATION ON (or OFF)
  249.                 When  connected  as  a  terminal  to  a  foreign host, controls
  250.                 whether the micro emulates a VT52 or  runs  in  "native  mode".
  251.                 VT52  emulation is ON by default, except on micros that already
  252.                 have terminal functionality built in, such as the DEC VT180 and
  253.                 DECmate (these act as VT100-series terminals).    Some  systems
  254.                 emulate other terminals, like the ADM3A.
  255.  
  256.         LOCAL-ECHO ON (or OFF)
  257.                 When  you  CONNECT to a remote host, you must set LOCAL-ECHO ON
  258.                 if the host is half  duplex,  OFF  if  full  duplex.    OFF  by
  259.                 default.
  260.  
  261.         ESCAPE  Change  the  escape character for virtual terminal connections.
  262.                 Kermit-80 will prompt you for the new escape  character,  which
  263.                 you enter literally.
  264.  
  265.         BAUD    Change  the baud rate of the communications port.  This command
  266.                 only works on some systems, and its actual operation  can  vary
  267.                 from  system  to  system.  Type SET BAUD followed by a question
  268.                 mark, and follow the directions.  On systems that do  not  sup-
  269.                 port this command, you must set the port baud rate from CP/M or
  270.                 other setup mechanism outside of KERMIT-80.
  271.  
  272.         PARITY  Sets  parity  for  outgoing characters to one of the following:
  273.                 NONE, SPACE, MARK, EVEN, or ODD.  On input, if parity is  NONE,
  274.                 then  the  8th  bit is kept (as data), otherwise it is stripped
  275.                 and ignored.  The parity setting applies to both terminal  con-
  276.                 nection and file transfer.  If you set parity to anything other
  277.                 than none, KERMIT-80 will attempt to use "8th bit prefixing" to
  278.                 transfer  binary files.  If the other KERMIT is also capable of
  279.                 8th bit prefixing, then binary files can  be  transferred  suc-
  280.                 cessfully;  if  not, the 8th bit of each data byte will be lost
  281.                 (you will see a warning on your screen if this happens).
  282.  
  283.         TIMER ON (or OFF)
  284.                 Enable or disable the "fuzzy timer".    The  timer  is  off  by
  285.                 default,  because in the normal case KERMIT-80 is communicating
  286.                 with a mainframe KERMIT that has its own timer.  Mainframe KER-
  287.                 MIT timers tend to be more precise  or  adaptable  to  changing
  288.                 conditions.    You should SET TIMER ON if you are communicating
  289.                 with a KERMIT that does not have a timer.  You should SET TIMER
  290.                 OFF if you are communicating over a network with long delays.
  291.  
  292.         IBM ON (or OFF)
  293.                 Allow the transfer of files to and from an IBM  mainframe  com-
  294.                 puter.    This  makes  Kermit-80  wait  for  the IBM turnaround
  295.                 character (XON), ignore parity on input, add appropriate parity
  296.                 to output, and use local  echoing  during  CONNECT.    As  dis-
  297.                 tributed, KERMIT-80 uses MARK parity for IBM communication.  If
  298.                 you don't give this command, IBM mode is OFF.  Since IBM VM/CMS
  299.                 KERMIT  does not have timeout capability, SET IBM ON also turns
  300.                 on the "fuzzy timer" automatically.
  301.  
  302.         BLOCK-CHECK-TYPE
  303.                 The options are:
  304.  
  305.                 1-CHARACTER-CHECKSUM
  306.                         Normal, default, standard 6-bit checksum.
  307.                 2-CHARACTER-CHECKSUM
  308.                         A 12-bit checksum encoded as two characters.
  309.                 3-CHARACTER-CRC-CCITT
  310.                         A 16-bit CCITT-format Cyclic Redundancy Check,  encoded
  311.                         as 3 characters.
  312.  
  313.         The  2  and 3 character options should only be used under conditions of
  314.                 extreme line noise.  Many implementations of KERMIT  only  sup-
  315.                 port the single character checksum.
  316.  
  317.         FILE-MODE
  318.                 Tells KERMIT-80 what kind of file it is sending, so that KERMIT
  319.                 can  correctly  determine the end of the file.  SET FILE BINARY
  320.                 means to send all the 128-byte blocks of  the  file,  including
  321.                 the last block in its entirety; SET FILE ASCII is used for text
  322.                 files,  and  transmission stops when the first Control-Z is en-
  323.                 countered anywhere in the file (this is the CP/M convention for
  324.                 marking the end of a text file).   If  binary  transmission  is
  325.                 used  on  a text file, some extraneous characters (up to 127 of
  326.                 them) may appear at the end of the file on the  target  system.
  327.                 If ASCII transmission is used on a binary file, the entire file
  328.                 will  not  be sent if it happens to contain any data bytes that
  329.                 correspond to Control-Z.
  330.  
  331.         DEFAULT-DISK
  332.                 This allows you to set the default disk as source and  destina-
  333.                 tion  of  file  transfers.    In addition, issuing this command
  334.                 causes you to switch to the  specified  disk  and  log  it  in,
  335.                 write-enabled.    The  selected  disk appears in your KERMIT-80
  336.                 prompt, for instance 
  337.  
  338.                     Kermit-80 A:>
  339.  
  340.         PORT    Allows you to switch  between  different  communication  ports.
  341.                 This command is not available on all systems.
  342.  
  343.         PRINTER ON  or OFF.  Turns copying of CONNECT session to printer on and
  344.                 off.  No attempt is made to do buffering or flow control; it is
  345.                 assumed printer can keep up.
  346.  
  347. DIR     This provides a directory listing of the specified files.  If no  files
  348.         are  specified,  all files on the default disk are listed.  File sizes,
  349.         in K, are included.  You may interrupt  the  listing  at  any  time  by
  350.         typing any character.  The listing (even if interrupted) concludes with
  351.         a display of the amount of free storage left on the disk.
  352.  
  353. ERA     This executes the CP/M ERA command on the specified file(s).  The names
  354.         of the files being erased are not displayed.
  355.  
  356.  
  357. 1.1. Generic KERMIT-80
  358.  
  359. "Generic  Kermit-80" is a implementation of Kermit that should run on any 8080-
  360. compatible CP/M system no modification at all, or perhaps  only  a  minor  one.
  361. Unlike   other  Kermit-80  implementations,  it  contains  no  system-dependent
  362. manipulation of the serial port or screen.  All I/O is done with standard  CP/M
  363. BIOS  calls, and I/O redirection is done using the CP/M IOBYTE function, which,
  364. according to the Digital Research CP/M Operating System Manual, is an  optional
  365. feature of any particular CP/M implementation.  If your system does not provide
  366. the IOBYTE function, Generic Kermit-80 will not work; furthermore, not all sys-
  367. tems that implement IOBYTE do so in the same way.
  368.  
  369. The  reason all Kermit-80 implementations aren't generic is that a good deal of
  370. speed is sacrificed by getting all services from the operating system.  While a
  371. specific implementation of Kermit-80 may be able to operate at 4800,  9600,  or
  372. even  19200 baud, Generic Kermit will fail to work on some systems at speeds in
  373. excess of 1200 baud.
  374.  
  375. Generic Kermit also differs from other Kermit-80  implementations  in  that  it
  376. does not do fancy screen control during file transfer; it simply types the file
  377. names,  packet  numbers,  and  messages in sequence across and down the screen.
  378. This works best if you can put your  micro  or  terminal  in  "autowrap"  mode;
  379. otherwise  the  packet  numbers  will  pile  up  in  the  rightmost column; the
  380. filenames and messages will always appear on a new line, however.  Neither does
  381. generic Kermit-80 do termimal emulation; thus a generic Kermit-80  acts  either
  382. as a "dumb terminal" (sometimes called a "glass TTY"), or else its own built in
  383. terminal  firmware  provides cursor control functions independent of the Kermit
  384. program.
  385.  
  386. Note that VT180 and DECmate-II Kermit are simply adaptations of Generic  Kermit
  387. that do VT100 (ANSI) screen control during file transfer.
  388.  
  389.  
  390. 1.2. Installation
  391.  
  392. Kermit-80  was written originally for the Intertec SuperBrain in lowest-common-
  393. denominator 8080 code with the standard assembler, ASM (no macros, no  advanced
  394. instructions),  so  that it can be assembled on any CP/M-80 system(The 8080 as-
  395. sembler is distributed as a standard  part  of  CP/M-80,  whereas  the  fancier
  396. Z80  or macro assemblers are normally a commercial product).  It has since been
  397. modified to run on many other systems as well.  Kermit-80 should be able to run
  398. on any 8080-, 8085- or Z80-based  microcomputer  under  CP/M  with  only  minor
  399. modifications (see below).
  400.  
  401. All  versions  of  Kermit-80  are  assembled  from the same source, with system
  402. dependencies taken care of by assembly-time conditionals.  The  most  important
  403. system  dependencies are terminal emulation (when CONNECTed to the remote host)
  404. and screen handling, which are dependent on the individual micro's escape codes
  405. (these features are table driven and easily modified for other  CP/M  systems),
  406. and the lowest level i/o routines for the serial communications port.  The port
  407. routines  are  best  done  only  with BDOS calls, but some systems do not allow
  408. this, primarily because the BDOS routines strip the parity bit during port i/o,
  409. and the parity bit is used for data when  transmitting  binary  files.    Also,
  410. using  BDOS  calls, there's no way to poll the serial port; you must hang until
  411. input appears.
  412.  
  413. Kermit-80's i/o routines must check the port status and go elsewhere if no  in-
  414. put  is available; this allows for virtual terminal connection, keyboard inter-
  415. ruption of stuck transmissions, etc.   On  systems  that  fully  implement  i/o
  416. redirection  via the optional CP/M IOBYTE facility, this may be done by switch-
  417. ing the IOBYTE definition.  On others, however, IN/OUT instructions  explicitly
  418. referencing the port device registers must be used.
  419.  
  420. CP/M-80  KERMIT  version  3.8  and above includes a "fuzzy timer" that allows a
  421. timeout to occur after an interval ranging from 5 to 20 seconds (depending upon
  422. the speed of the processor and the operating system routines) during which  ex-
  423. pected  input does not appear at the port.  In this case, retransmission occurs
  424. automatically.  In any case, you may type a carriage return during transmission
  425. to simulate a timeout when the transfer appears to be stuck.
  426.  
  427.  
  428. 1.2.1. Downloading Kermit-80
  429.  
  430. If you already have a version of Kermit on your micro and you want to install a
  431. new version, simply use your present version to get  the  new  one.    If  it's
  432. stored  in the form of a .COM file, you can run it directly.  If it's stored as
  433. a .HEX file, you must first LOAD it on your micro to produce a .COM file.
  434.  
  435. If you do not have a copy of KERMIT on your micro, and you cannot borrow a Ker-
  436. mit floppy but you do have access to a mainframe computer with a  copy  of  the
  437. Kermit-80 distribution, you should read this section.
  438.  
  439. There  are  several  ways  to get Kermit from a host system to your micro.  The
  440. easiest is to "download" the precompiled "hex" file into  your  micro's  memory
  441. and  then  save it on the disk.  The following is a procedure which, though far
  442. from foolproof, should allow you to get a version of Kermit to your CP/M  based
  443. micro.  It depends upon the host prompt, or at least the first character of the
  444. host  prompt,  being some character that cannot appear in a hex file (the valid
  445. characters for hex files are the digits 0-9, the upper case  letters  A-F,  the
  446. colon  ``:'',  carriage return, and line feed).  As soon as any other character
  447. is encountered, the transfer will terminate.  If your host  does  not  issue  a
  448. prompt  that  will  accommodate this scheme, you can achieve the same effect by
  449. modifing the adding an atsign ``@'' to the very end  of  the  hex  file  before
  450. sending  it  from  the host.  The program below looks for an atsign (the normal
  451. DEC-20 prompt, hex 40).  DECSYSTEM-10 users would look for a dot, hex 2E.
  452.  
  453.    1. Look for the appropriate hex file in the host's KERMIT  area.    The
  454.       name    will   be   something   like   CPMROBIN.HEX,   CPMHEATH.HEX,
  455.       CPMOSBORN.HEX, etc.  If you don't find it, but you do  find  a  cor-
  456.       responding  .ASM or .M80 file, you'll either have to build a new hex
  457.       file on the host using a cross assembler (see below for  how  to  do
  458.       this  on  a  DEC-10 or DEC-20), or else bring the M80 source file to
  459.       your micro and assemble it there.
  460.  
  461.    2. Connect to your host  using  a  terminal  or  a  terminal  emulation
  462.       facility.    Ensure  that  your  host does not have your terminal in
  463.       "page mode".  E.g. on the DEC-20, give the Exec command TERMINAL  NO
  464.       PAUSE END-OF-PAGE.
  465.  
  466.    3. Tell the host to display the hex file at your terminal.  E.g. on the
  467.       DEC-20, give the Exec command TYPE KERMIT.HEX, without a terminating
  468.       carriage return.
  469.  
  470.    4. Return  to your micro.  Connect to a floppy disk with plenty of free
  471.       space.  Make sure your IOBYTE is set so  that  RDR:  and  PUN:  cor-
  472.       respond  to the I/O port that is connected to the DEC-20 (this would
  473.       normally be the case unless  you  have  done  something  special  to
  474.       change  things).    Run  DDT and type in the following (the comments
  475.       should not be typed in; they are  there  just  to  tell  you  what's
  476.       happening):
  477.  
  478.           -ikermit.hex            ;Setup FCB for file KERMIT.HEX.
  479.           -a100                   ;Begin assembling code at 100.
  480.           0100 lxi h,ffe          ;Where to put HEX file.
  481.           0103 shld 300           ;Save the address.
  482.           0106 mvi e,d            ;Get a CR.
  483.           0108 mvi c,4            ;Output function.
  484.           010A call 5
  485.           010D mvi c,3            ;Input function.
  486.           010F call 5
  487.           0112 ani 7f             ;Turn off the parity.
  488.           0114 cpi 40             ;Our DEC-20 prompt atsign?
  489.           0116 jz 124             ;Yes, we have whole file.
  490.           0119 lhld 300           ;Get the pointer.
  491.           011C mov m,a            ;Else, store the char.
  492.           011D inx h              ;Increment the pointer.
  493.           011E shld 300           ;Save the pointer.
  494.           011F jmp 10d            ;Go around again.
  495.           0124 mvi a,1a           ;Get a control-Z.
  496.           0126 lhld 300           ;Get the pointer.
  497.           0129 mov m,a            ;Store the char.
  498.           012A shld 300           ;Save the pointer.
  499.           012D lxi h,1000         ;Pointer to file.
  500.           0130 shld 310           ;Save the pointer.
  501.           0133 mvi c,16           ;Make file.
  502.           0135 lxi d,5c
  503.           0138 call 5
  504.           013B lhld 310           ;Get the file pointer.
  505.           013E xchg               ;Put it in DE.
  506.           013F mvi c,1a           ;Set DMA.
  507.           0141 call 5
  508.           0144 mvi c,15           ;Write DMA to file.
  509.           0146 lxi d,5c
  510.           0149 call 5
  511.           014C lhld 310           ;Get the file pointer.
  512.           014F lxi d,80           ;Get the DMA size.
  513.           0152 dad d              ;Adjust file pointer.
  514.           0153 shld 310           ;Save it.
  515.           0156 lda 301            ;Get high order byte.
  516.           0159 cmp h              ;Have we passed the end?
  517.           015A jm 170             ;Yes.
  518.           015D jz 163             ;Maybe.
  519.           0160 jmp 13b            ;No.
  520.           0163 lda 300            ;Get low order byte.
  521.           0166 cmp l              ;Passed the end?
  522.           0167 jm 170             ;Yes.
  523.           016A jz 170             ;Yes.
  524.           016D jmp 13b            ;Not quite.
  525.           0170 mvi c,10           ;Close file.
  526.           0172 lxi d,5c
  527.           0175 call 5
  528.           0178 ret
  529.           0179
  530.           -g100,179               ;Execute the program.
  531.           -                       ;Reboot
  532.  
  533.       Now there should be a file KERMIT.HEX on your connected disk.
  534.  
  535.    5. Load  this  using the CP/M command LOAD to produce KERMIT.COM.  This
  536.       should be a runnable version of Kermit.  Note that  CP/M  hex  files
  537.       have  checksums on each line.  If there were any transmission errors
  538.       during the downloading process, the CP/M loader will  notice  a  bad
  539.       checksum and will report an error (something like "Illegal Format").
  540.       If  you  get  any  errors  during  loading,  either fix the hex file
  541.       locally with an editor, or repeat the previous step.
  542.  
  543. You now should have a running version of Kermit-80.
  544.  
  545.  
  546. 1.2.2. Building KERMIT.HEX
  547.  
  548. The source for Kermit-80 should be available on your  host  computer.    It  is
  549. written  using  8080  assembler mnemonics, so it can be assembled on most 8080s
  550. and Z80s using the standard 8080 assembler provided with CP/M.    If  you  have
  551. KERMIT.ASM on your CP/M system, you can assemble it directly on the micro using
  552. ASM,  setting  the  desired assembly switches as explained below.  If you don't
  553. have it, you can attempt to download the source file from the  host  using  the
  554. procedure outlined above.
  555.  
  556. A cross assembler is provided that runs on the DEC-10 and DEC-20, called MAC80,
  557. contributed by Bruce Tanner at Cerritos College, that may be used for cross as-
  558. sembling KERMIT-80 as shown in this example (for TOPS-20):
  559.  
  560.    1. Copy   PS:<KERMIT>CPMKxx.M80   to  your  directory,  as  KERMIT.M80.
  561.       TOPS-10 filename rules must be followed.  This is the 8080 assembler
  562.       source file; xx is the current version number; for instance  version
  563.       3.8 would be stored as CPMK38.M80.
  564.  
  565.    2. Edit  KERMIT.M80  to  set  the  conditional assembly switch for your
  566.       machine.  These are right near the top of the file.  The switch  for
  567.       your machine should be set to TRUE and all the others to FALSE.
  568.  
  569.    3. The "ibm-flag" setting is site dependent.  As shipped from Columbia,
  570.       it  turns  on half duplex line handshaking, using CTRL-Q as the tur-
  571.       naround character, sets LOCAL-ECHO ON, TIMER ON,  and  PARITY  MARK.
  572.       Make any changes required for your site.
  573.  
  574.    4. The default FILE-MODE is ASCII as shipped from Columbia.  This means
  575.       that  when  text  files are sent from the CP/M system, no extraneous
  576.       characters will be sent after the  end,  but  that  outgoing  binary
  577.       files  may  be truncated erroneously if the user forgets to SET FILE
  578.       BINARY.  You can change the default to BINARY, so that  no  data  is
  579.       ever lost from any file, but text files will usually have extraneous
  580.       junk at the end.
  581.  
  582.    5.   Run MAC80:
  583.  
  584.           @mac80
  585.           *kermit=kermit
  586.           *^Z
  587.  
  588.       The result will be in your directory as KERMIT.HEX.
  589.  
  590.    6. Use  Kermit,  MODEM,  or any other downloading mechanism to transfer
  591.       KERMIT.HEX to the micro, or download it using the DDT program  shown
  592.       above.
  593.  
  594.    7. On the micro, load the hex file:  
  595.  
  596.           A>load kermit
  597.  
  598.       KERMIT.COM will appear on the floppy.
  599.  
  600.    8. The new Kermit should be ready to run.
  601.  
  602.  
  603. 1.2.3. Generic Kermit-80
  604.  
  605. If  your  CP/M  2.2 system implements i/o redirection via the (optional) IOBYTE
  606. mechanism, you can probably run Generic Kermit on it, either without  modifica-
  607. tion,  or  by a very simple change to the program.  The standard CP/M IOBYTE is
  608. set up as follows:
  609. I/O Byte assignments (four 2-bit fields for 4 devices at location 3)
  610. :
  611. bits 6+7        LIST field
  612.     0           LIST is Teletype device (TTY:)
  613.     1           LIST is CRT device (CRT:)
  614.     2           LIST is Lineprinter (LPT:)
  615.     3           LIST is user defined (UL1:)
  616.  
  617. bits 4+5        PUNCH field
  618.     0           PUNCH is Teletype device (TTY:)
  619.     1           PUNCH is high speed punch (PUN:)
  620.     2           PUNCH is user defined #1 (UP1:)
  621.     3           PUNCH is user defined #2 (UP2:)
  622.  
  623. bits 2+3        READER field
  624.     0           READER is Teletype device (TTY:)
  625.     1           READER is high speed reader (RDR:)
  626.     2           READER is user defined #1 (UR1:)
  627.     3           READER is user defined #2 (UR2:)
  628.  
  629. bits 0+1        CONSOLE field
  630.     0           CONSOLE is console printer (TTY:)
  631.     1           CONSOLE is CRT device (CRT:)
  632.     2           CONSOLE is in Batch-mode (BAT:); READER = Input, LIST = Output
  633.     3           CONSOLE is user defined (UC1:)
  634. (Here, bit zero is the least significant, "rightmost", bit).
  635.  
  636. I/O redirection is accomplished by switching the  IOBYTE  between  two  values,
  637. "batch  i/o"  and "normal i/o".  In normal i/o mode, the keyboard is defined to
  638. be the console.  In batch i/o mode, the serial port is defined to be  the  con-
  639. sole.   This switching is necessary because the console is the only device that
  640. can be tested to see if input is available, but KERMIT must  shuttle  back  and
  641. forth between the keyboard and the serial port looking for input.  Here are the
  642. batch and default i/o mode definitions used in "standard" Generic KERMIT-80:
  643.  
  644. batio   EQU     056H            ;I/O byte CON=BAT,LIST=CRT,READER=RDR
  645. defio   EQU     095H            ;I/O byte CON=CRT,LIST=LPT,READER=RDR
  646.  
  647. Other  systems may have other logical devices that point to the serial port, in
  648. which case you'll need to redefine these symbols to point to those devices  and
  649. then reassemble the program (with assembly switch GENER set to TRUE, all others
  650. FALSE).
  651.  
  652. If  your system runs CP/M 3.0, then the CPMPLUS version of KERMIT should run on
  653. your system without modification, except perhaps for  screen  control  or  baud
  654. rate setting.
  655.  
  656.  
  657.  
  658. Index
  659.  
  660.  
  661.           8080   2
  662.  
  663.           Baud   2
  664.           BIOS   2
  665.           Block Check   2
  666.           Bootstrap   3
  667.           BYE   2
  668.  
  669.           Connect   1
  670.           CP/M   2
  671.           Cross Assembler   3
  672.  
  673.           DECsystem-10   3
  674.           DECSYSTEM-20   3
  675.           Downloading   3
  676.  
  677.           Eighth-Bit Prefix   2
  678.           Escape Character   1, 2
  679.  
  680.           File-Warning   1
  681.           FINISH   2
  682.  
  683.           Generic Kermit-80   2, 4
  684.           GET   1
  685.  
  686.           Hex File   3
  687.  
  688.           IBM   2
  689.           IOBYTE   4
  690.  
  691.           Local   1
  692.           Local-Echo   2
  693.           LOG   2
  694.           LOGOUT   2
  695.  
  696.           MAC80   3
  697.  
  698.           NAK   1
  699.  
  700.           Parity   2
  701.  
  702.           RECEIVE   1
  703.  
  704.           SEND   1
  705.           SET   2
  706.           Superbrain   2
  707.  
  708.           Timeout   1, 3
  709.           TIMER   2
  710.           TRANSMIT   2
  711.  
  712.           Virtual Terminal   1
  713.           VT100   2
  714.           VT52   2
  715.  
  716.           Warning   2
  717.  
  718.           XON/XOFF   2
  719.  
  720.           Z80   2
  721.  
  722.  
  723.  
  724.                                Table of Contents
  725.  
  726. 1. CP/M-80 KERMIT                                                             1
  727.  
  728. 1.1. Generic KERMIT-80                                                        2
  729. 1.2. Installation                                                             2
  730.      1.2.1. Downloading Kermit-80                                             3
  731.      1.2.2. Building KERMIT.HEX                                               3
  732.      1.2.3. Generic Kermit-80                                                 4
  733.  
  734. Index                                                                         5
  735.