[net.micro.cbm] C64KER.DOC

GMW@psuvm.BITNET (06/05/85)

     
     
     
     
     
     
     
     
     
     
     
                             KERMIT-65 USERS GUIDE
     
                                C64 Version 1.3
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
                                 Compiled By:
                                 Eric Lavitsky
                               17 February 1985
     
                 Center For Computer and Information Services
                              Rutgers University
                            Piscataway, New Jersey
     
                          This Copy Was Produced On:
                       Friday, 22 February 1985 at 10:18
                             Using Scribe 4(1400)
Introduction                                                             Page 1
     
     
1. Introduction
     
1.1. Overview
     
KERMIT-65  is  a  program that implements the KERMIT file transfer protocol for
the Commodore 64 micro computer system. It is written in 6502 assembly language
and  should  run  on  any C64. KERMIT-65 also Converts your C64 into a powerful
computer terminal. It emulates the popular Digital Equipment  Corporation  VT52
terminal  or  a  simple  glass TTY.  The program handles all conversion of Com-
modore to standard ASCII and can diplay all 96 standard ASCII characters.
     
C64 Kermit-65 was initially translated by Dave Dermott from the original  Apple
version  1.0  by Antonio J. Mione. Several enhancements and bug fixes including
many from Apple version 2.1 were added by Eric Lavitsky.
     
C-64 Kermit-65 Capabilities At A Glance:
     
  Local operation:                   Yes
  Remote operation:                  Yes
  Transfers text files:              Yes
  Transfers binary files:            Yes
  Wildcard send:                     No
  ^X/^Y interruption:                No
  Filename collision avoidance:      Yes
  Can time out:                      No
  8th-bit prefixing:                 No
  Repeat count prefixing:            No
  Alternate block checks:            No
  Terminal emulation:                Yes; Glass TTY, VT52
  Communication settings:            Yes; local echo, parity, word-size
  Transmit BREAK:                    Yes
  IBM communication:                 Yes
  Transaction logging:               No
  Session logging (raw download):    No
  Raw upload:                        No
  Act as server:                     No
  Talk to server:                    Yes; BYE, FINISH, GET, SEND
  Advanced commands for servers:     No
  Local file management:             Yes
  Handle file attributes:            No
  Command/init files:                No
  Printer control:                   No
     
1.2. System Requirements
     
What you will need:
     
   - C64 and Disk drive
   - Modem - any will do (300/1200, VIC, RS232)
   - Supermon64.V1 (or any equivalent relocatable monitor)
Known Bugs, Deficiencies                                                 Page 2
     
     
2. Known Bugs, Deficiencies
     
KERMIT-65 is currently missing some features which exist  in  Apple  KERMIT-65.
There are also some restrictions which apply.
     
The differences and restrictions are as follows:
     
   - EIGHT-BIT-QUOTING mode is not supported.
   - The  SET  BAUD  option  is not fully implemented. To get speeds other
     than 300 or 1200 baud, you  will  have  to  set  the  RS232-REGISTERS
     directly.
   - If  you  change  the RS232-REGISTERS directly, the change will not be
     reflected in the BAUD, PARITY, or WORD-SIZE parameters.
     
2.1. HINTS
     
If you wish to edit BASIC programs on the mainframe system, you should  convert
them to text files on the C64 before you send them since the BASIC interpreters
store keywords as single character tokens. If the  receiving  system  does  not
handle  eight-bit ASCII or CBM ASCII characters well, KERMIT-65 should have its
FILE-BYTE-SIZE set to SEVEN-BIT. It will send standard seven-bit ASCII  to  the
receiving  KERMIT.  When  KERMIT-65  is receiving from such a system, this will
pick up the seven-bit characters and write out CBM ASCII on the disk file.
     
2.2. Notes
     
Please note that typing a 'Q' at anytime during a file  transaction  will  quit
the current transaction, closing the current file. Kermit can also be forced to
'timeout' by typing a space at any point in the transaction. Kermit  will  then
resend the current packet.
Running KERMIT                                                           Page 3
     
     
3. Running KERMIT
     
3.1. Booting KERMIT
     
Insert your working KERMIT-65 disk into the 1541 drive label side up.  Type the
following:
     
        LOAD"KERMIT",8 <cr>
        RUN <cr>
     
The screen will come up with the following message:
     
            Commodore 64 Kermit-65 - V1.3
     
            Kermit-65>
     
     
You are now in the KERMIT-65 parser which is modeled after the COMND parser  of
the  TOPS-20  Operating  System from Digital Equipment Corporation. You may now
type commands to the parser to set options or begin actions.
     
During interactive operation, you may use the ?-prompting  help  feature  ("?")
and recognition (ESC) features while typing commands.  A question mark typed at
any point in a command displays the options available at that point; typing  an
ESC  character  causes the current keyword to be completed (or default value to
be supplied).  If you have not typed sufficient characters to uniquely  specify
the  keyword  or filename (or if there is no default value) then a beep will be
sounded and you may continue typing. Keywords may be abbreviated to any  prefix
that is unique.
     
3.2. Commands in KERMIT
     
Commands available in version 1.3 of Kermit-65 are:
     
            BYE         CONNECT     DOS         EXIT        FINISH      GET
            QUIT        RECEIVE     SEND        SET         SHOW        STATUS
     
BYE
                This command will cause Kermit-65 to tell a  server  Kermit  at
                the other end of the connection to exit from Kermit and, if ap-
                plicable, terminate its job (or process, etc.).  When Kermit-65
                receives  the  acknowledgement that this is being done, it will
                exit to DOS.
     
     
                                 KERMIT-65>BYE
     
CONNECT
                The  CONNECT  command will allow you to connect to a remote job
                over the terminal line as a virtual terminal. The format of the
                CONNECT command is:
Running KERMIT                                                           Page 4
     
     
                               KERMIT-65>CONNECT
     
     
                To get back to the Kermit parser,  type  the  escape  character
                followed   by  a  'C'.  The  default  escape  character  is  ^Y
                (control-Y), so to return to Kermit-65 you  would  type  '^YC'.
                There  are  other options to the escape character, these may be
                seen by typing a '?'  after typing  the  escape  character.  To
                send  the current escape character to the host, type the escape
                character twice.
     
DOS
                The  DOS  command  will  invoke  a separate parser to allow the
                sending of commands to the disk drive. The format is:
     
     
                                 KERMIT-65>DOS
     
                Commands are in standard DOS format as  decribed  in  the  disk
                manual.  They include $ for directory (note block counts are in
                hex!), S to scratch files. A blank line (RETURN)  will  display
                the disk error status if any. Enter Q to return to KERMIT.  eg:
     
                              DOS>$KER*     -- directory of ker* files
                              DOS>S0:a*     -- delete files A*
                              DOS>Q         -- returns to KERMIT
     
EXIT
                The EXIT command will cause Kermit to return to  BASIC  command
                level. This command is the same as the QUIT command. An example
                of this command is:
     
     
                                KERMIT-65>EXIT
     
FINISH
                This  command  will  cause Kermit-65 to tell a server Kermit at
                the other end of the connection to  exit  from  Kermit.    When
                Kermit-65 receives the acknowledgement that this is being done,
                Kermit-65 will prompt for another command.
     
     
                               KERMIT-65>FINISH
     
GET
                This  command  can  only be used in 'user' mode.  It will cause
                Kermit-65 to request that the other Kermit (which must be  run-
                ning in server mode) transmit the specifed file to Kermit-65.
     
     
                       KERMIT-65>GET file-specification
Running KERMIT                                                           Page 5
     
     
                Where "file-specification" is a valid  file  specification  for
                the system on which the other Kermit is running.
     
QUIT
                This command will cause Kermit-65 to return  to  BASIC  command
                level. This is the same as the EXIT command.
     
     
                                KERMIT-65>QUIT
     
RECEIVE
                The RECEIVE command is used to put Kermit-65 into  remote  mode
                waiting  for  a  single  file transfer transaction.  If no file
                specification is given, Kermit-65 will wait for a file transfer
                initialization  sequence  from  the  other  Kermit.   If a file
                specification is given, that file specification will be used to
                store the received file(s), regardless of what name is supplied
                by the other Kermit.
     
     
                               KERMIT-65>RECEIVE
     
or
     
                     KERMIT-65>RECEIVE file-specification
     
     
                Where "file-specification" is any valid CBM DOS file specifica-
                tion.
     
SEND
                The  SEND  command  will  allow you to send a file to the other
                Kermit.  The command format is:
     
     
                       KERMIT-65>SEND file-specification
     
     
                Where   "file-specification"   is   any  normal  CBM  DOS  file
                specification.
     
SET
                The  SET  command  is used to set various parameters in Kermit.
                The format of the command is:
     
     
                    KERMIT-65>SET <option> <suboption> ...
     
     
                The options available to SET are:
     
                    BAUD                DEBUGGING           EIGHT-BIT-QUOTING
Running KERMIT                                                           Page 6
     
     
                    ESCAPE              FILE-BYTE-SIZE      FILE-TYPE
                    FILE-WARNING        FLOW-CONTROL        IBM
                    LOCAL-ECHO          PARITY              RECEIVE
                    RS232-REGISTERS     SEND                VT52-EMULATION
                    WORD-SIZE
     
                        A description of the options and suboptions follows.
     
SET BAUD
                The SET BAUD command is used to set the  speed  at  which  com-
                munications will take place.
     
     
                           KERMIT-65>SET BAUD value
     
     
                Where value is from the following table:
     
                                50      75
                                110     150
                                300     1200
                                1800    2400
     
SET DEBUGGING
                The  SET DEBUGGING command is used to set the debug type out on
                the user's terminal.
     
     
                        KERMIT-65>SET DEBUGGING keyword
     
     
                Where keyword is either OFF, TERSE, or VERBOSE.  OFF causes all
                debugging output to be suppressed.  TERSE  directs  a  copy  of
                each  packet  to  the screen printing any control characters as
                '^char'.  VERBOSE prints identifying text for each field in the
                header  and prints the actual data section of the packet in the
                same manner TERSE uses.
     
SET EIGHT-BIT-QUOTING
                This  command  will  turn  on or turn off the eight-bit-quoting
                feature.    If   set   ON,   it   forces   Kermit-65   to   use
                eight-bit-quoting  which may be handy if it must receive a text
                file in which some or all of the characters are not in CBM  AS-
                CII.
     
     
                    KERMIT-65>SET EIGHT-BIT-QUOTING keyword
     
     
                Where keyword is ON or OFF.
Running KERMIT                                                           Page 7
     
     
SET ESCAPE
                This  command  will  set  the  escape character for the CONNECT
                processing.  The command will take the hex value of the charac-
                ter  to  use  as  the  escape character.  This is the character
                which is used to "escape" back to  KERMIT-65  after  using  the
                CONNECT  command.  It defaults to ^Y (hex 19).  It is usually a
                good idea to set this character to something which is not  used
                (or  at  least  not  used  very  much)  on  the system to which
                KERMIT-65 is CONNECTing.
     
     
                   KERMIT-65>SET ESCAPE hex-character-value
     
     
                Where  hex-character-value  is the ASCII value of the character
                to use as the escape character (in hex).
     
SET FILE-BYTE-SIZE
                This  command  sets  the byte size KERMIT-65 will use for files
                being received or transmitted.  SEVEN-BIT bytes should be  used
                for  ASCII text files which are to be used as text files on the
                CBM DOS system. EIGHT-BIT bytes should be used for binary files
                being transferred to and from the C64.  This allows the file to
                be returned without any changes.
     
     
                       KERMIT-65>SET FILE-BYTE-SIZE size
     
     
                Where size is SEVEN-BIT or EIGHT-BIT.
     
SET FILE-TYPE   This command tells Kermit-65 what type of file is being sent or
                received.  It is important that this parameter is set correctly
                since  it is used to determine the exact file length when send-
                ing files in addition to determining special  processing  which
                may  have  to  be done (i.e.  When receiving a text file, write
                all characters in CBM ASCII.). The format of this command is:
     
     
                         KERMIT-65>SET FILE-TYPE type
     
     
                Where  type  is  ASCII,  BINARY, PETASCI or SCRIPT. BINARY is a
                core image (and is normally transferred in eight-bit mode). AS-
                CII  is  any  file  of ASCII text. PETASCI is a CBM ASCII file.
                SCRIPT is a file produced  by  the  SPEEDSCRIPT  wordprocessor,
                which was published in the Gazzette! Magazine.
     
SET FILE-WARNING
                This command determines what KERMIT-65 will do when it receives
                a  file  with a file name that already exists.  If FILE-WARNING
                is turned ON, KERMIT-65 will not supersede the old file.    In-
Running KERMIT                                                           Page 8
     
     
                stead  it will create a file with the original file name plus a
                '.0' appended to it.  It will increment  the  'version'  number
                until  it  succeeds  in  creating  a  unique  file  name.    If
                FILE-WARNING is turned OFF (the default), Kermit-65 will super-
                sede the old file.
     
     
                      KERMIT-65>SET FILE-WARNING keyword
     
     
                Where keyword is either ON or OFF.
     
SET FLOW-CONTROL
                The  SET  FLOW-CONTROL  command  will  enable  the selection of
                XON/XOFF flow control if desired. This  option  is  recommended
                set for communication speeds of 1200 baud or higher.
     
     
                      KERMIT-65>SET FLOW-CONTROL keyword
     
     
                Where keyword is either ON or OFF.
     
SET IBM
                The  SET  IBM  command  allows  KERMIT-65 to be put into a mode
                which will allow  transfers  to  an  IBM  host.    This  causes
                KERMIT-65  to  wait  for  the  IBM  turnaround  character (XON,
                CTRL-Q) before sending any characters to the other Kermit.   It
                also  forces  the parity type to be mark, the word length to be
                seven-bit, and turns on local echo for the CONNECT command.
     
     
                           KERMIT-65>SET IBM keyword
     
     
                Where keyword is either ON or OFF.
     
SET LOCAL-ECHO   The SET LOCAL-ECHO command specifies whether characters should
                be echoed locally  when  CONNECTing  to  another  system.    If
                LOCAL-ECHO  is  set  to ON, any character typed on the terminal
                will be echoed immediately to the terminal, as  well  as  being
                sent  to  the  other  system.  If LOCAL-ECHO is set to OFF (the
                default), the characters typed on the terminal are only sent to
                the   other   system  (which  would  normally  be  echoing  the
                characters).
     
     
                       KERMIT-65>SET LOCAL-ECHO keyword
     
     
                Where keyword is either ON or OFF.
Running KERMIT                                                           Page 9
     
     
SET PARITY
                This command determines the type of parity to use on the trans-
                mission line.  Kermit normally uses characters which consist of
                eight data bits with no parity bit.  For systems  or  transmis-
                sion  media  which  require  a specific parity type, Kermit can
                send characters as seven data bits plus a parity bit.
     
     
                         KERMIT-65>SET PARITY keyword
     
     
                Where keyword is one of:
     
                   1. NONE (default) - eight data bits and no parity bit.
     
                   2. MARK  -  seven  data bits with the parity bit set to
                      one.
     
                   3. SPACE - seven data bits with the parity bit  set  to
                      zero.
     
                   4. EVEN  -  seven  data bits with the parity bit set to
                      make the overall parity even.
     
                   5. ODD - seven data bits with the  parity  bit  set  to
                      make the overall parity odd.
     
SET RECEIVE
                It is possible to set various parameters  associated  with  the
                receiving of the data from the remote Kermit.  SET RECEIVE will
                enable you to set the various receive parameters.
     
     
                       KERMIT-65>SET RECEIVE <suboption>
     
     
                The suboptions of this SET command are:
     
              EIGHT-BIT-QUOTE-CHAR        END-OF-LINE   PACKET-LENGTH
              PAD-CHAR                    PADDING       QUOTE-CHAR
              TIMEOUT
     
SET RECEIVE EIGHT-BIT-QUOTE-CHAR
                This command sets the character to be used (when necessary)  to
                quote  characters  which  have the eighth bit (parity bit) set.
                This is used to transfer  eight-bit  bytes  on  a  transmission
                medium  which only supports seven data bits.  The default value
                is 26 (ASCII "&").  Eight-bit-quoting will only be used if both
                Kermit's  can  handle  it,  and the tranmission medium does not
                transmit 8 data bits (as indicated by the SET PARITY command).
Running KERMIT                                                          Page 10
     
     
                 KERMIT-65>SET RECEIVE EIGHT-BIT-QUOTE-CHAR nn
     
     
                Where  nn  is  the ASCII value of the character (in hex) to use
                for quoting characters which have the eighth bit set.
     
SET RECEIVE END-OF-LINE
                This  will set the end of line character that KERMIT-65 expects
                to receive from the remote Kermit.  This is the character which
                terminates  a  packet.    The  default  value  is 0F (ASCII CR,
                CTRL-M).
     
     
                     KERMIT-65>SET RECEIVE END-OF-LINE nn
     
     
                Where nn is the ASCII value of the character to use for the end
                of line character (in hex).
     
SET RECEIVE PACKET-LENGTH
                This  will  set  the receive packet length.  The value for this
                parameter must be between 10 and 96.  Packet lengths outside of
                this range are illegal.  The default value is 5E (94 decimal).
     
     
                    KERMIT-65>SET RECEIVE PACKET-LENGTH nn
     
SET RECEIVE PAD-CHAR
                This parameter is the padding character that is  expected  from
                the  remote  Kermit.  The parameter must be a hex number in the
                range of 0 to 1F or 7F.  All other values  are  illegal.    The
                default value is 0 (an ASCII NUL).
     
     
                       KERMIT-65>SET RECEIVE PAD-CHAR nn
     
     
                Where nn is the ASCII value of the character to be  used  as  a
                pad character (in hex).
     
SET RECEIVE PADDING
                This command will set the number  of  padding  characters  that
                will  be  expected from the other Kermit.  The default value is
                0.
     
     
                       KERMIT-65>SET RECEIVE PADDING nn
     
     
                Where nn is the hex number of padding characters to use.
     
SET RECEIVE QUOTE-CHAR
Running KERMIT                                                          Page 11
     
     
                This will set the quoting character that KERMIT-65 will  expect
                on incoming messages.  This is the character used to quote con-
                trol characters.  The default value is 23 (ASCII "#").
     
     
                      KERMIT-65>SET RECEIVE QUOTE-CHAR nn
     
     
                Where nn is the ASCII value of the quoting character (in hex).
     
SET RECEIVE TIMEOUT
                This will set the number of seconds after  which  KERMIT-65  is
                requesting  a  timeout from the remote Kermit. This time out is
                used to handle transmission errors which totally  lose  a  mes-
                sage.  The default value is 15 seconds.
     
     
                       KERMIT-65>SET RECEIVE TIMEOUT nn
     
     
                Where nn is the number of seconds to wait  for  a  message  (in
                hex).
     
SET RS232-REGISTERS
                This sets the 2 registers for controlling the baud rate, parity
                etc.  The  2 registers are treated as a 16 bit hex integer. The
                first 2 digits are the SECOND register and the  last  2  digits
                are  the  FIRST  register.  If  only  2 digits are entered, the
                second register is cleared. Examples:
     
     
                KERMIT-65>SET RS232-REGISTERS 0006 (or  SET  RS  06)  sets  the
                registers  to 06,00 for 300 baud, 8 bit, no parity (this is the
                default)
     
                KERMIT-65>SET RS232-REGISTERS A026 sets the registers to  26,A0
                for 300 baud, 7 bit, parity mark.
     
                See  the C64 reference manual for a complete description of all
                the bits in the 2 registers.
     
SET SEND
                It  is  possible  to set various parameters associated with the
                sending of data to the remote Kermit.  SET SEND will enable you
                to  set  the  various SEND parameters.  These parameters should
                not normally be set since, as part of the transfer  initializa-
                tion   process,   the   two   Kermits  exchange  their  RECEIVE
                parameters.  The capability  of  setting  these  parameters  is
                provided  so  that the transfer initialization can be completed
                even if the default parameters are not correct.
Running KERMIT                                                          Page 12
     
     
                        KERMIT-65>SET SEND <suboption>
     
     
                The suboptions of this SET command are:
     
              EIGHT-BIT-QUOTE-CHAR        END-OF-LINE   PACKET-LENGTH
              PAD-CHAR                    PADDING       QUOTE-CHAR
              TIMEOUT
     
SET SEND EIGHT-BIT-QUOTE-CHAR
                This command sets the character to be used (when necessary)  to
                quote  characters  which  have the eighth bit (parity bit) set.
                This is used to transfer  eight-bit  bytes  on  a  transmission
                medium  which only supports seven data bits.  The default value
                is 26 (ASCII "&").  Eight-bit-quoting will only be used if both
                Kermit's  can  handle  it,  and the tranmission medium does not
                transmit 8 data bits (as indicated by the SET PARITY command).
     
     
                  KERMIT-65>SET SEND EIGHT-BIT-QUOTE-CHAR nn
     
     
                Where  nn  is  the ASCII value of the character (in hex) to use
                for quoting characters which have the eighth bit set.
     
SET SEND END-OF-LINE
                This  will  set  the  end of line character that KERMIT-65 will
                send to the remote Kermit.  This is the  character  which  ter-
                minates a packet.  The default value is 0F (ASCII CR, CTRL-M).
     
     
                       KERMIT-65>SET SEND END-OF-LINE nn
     
     
                Where nn is the ASCII value of the character to use for the end
                of line character (in hex).
     
SET SEND PACKET-LENGTH
                This will set the send packet  length.    The  value  for  this
                parameter must be between 10 and 96.  Packet lengths outside of
                this range are illegal.  The default value is 5E (94 decimal).
     
     
                      KERMIT-65>SET SEND PACKET-LENGTH nn
     
SET SEND PAD-CHAR
                This  parameter  is  the  padding character that is sent to the
                remote Kermit.  The parameter must be  an  hex  number  in  the
                range  of  0  to  1F or 7F.  All other values are illegal.  The
                default value is 0 (an ASCII NUL).
Running KERMIT                                                          Page 13
     
     
                        KERMIT-65>SET SEND PAD-CHAR nn
     
     
                Where  nn  is  the ASCII value of the character to be used as a
                pad character (in hex).
     
SET SEND PADDING
                This  command  will  set  the number of padding characters that
                will be sent to the other Kermit.  The default value is 0.
     
     
                         KERMIT-65>SET SEND PADDING nn
     
     
                Where nn is the hex number of padding characters to use.
     
SET SEND QUOTE-CHAR
                This will set the quoting character that KERMIT-65 will send in
                outgoing messages.  This is the character used to quote control
                characters.  The default value is 23 (ASCII "#").
     
     
                       KERMIT-65>SET SEND QUOTE-CHAR nn
     
     
                Where nn is the ASCII value of the quoting character (in hex).
     
SET SEND TIMEOUT
                Since Kermit-65 has no clock to use, it can not  timeout.  This
                parameter, therefore is useless.
     
SET VT52-EMULATION
                This switch determines whether or not Kermit-65 will act like a
                VT52  when  it  is  CONNECTed  to a remote Kermit. The possible
                values for the switch are ON and OFF. The default is ON.
     
     
                       KERMIT-65>SET VT52-EMULATION OFF
     
SET WORD-SIZE
                This option will set the word length for communication.
     
     
                         KERMIT-65>SET WORD-SIZE size
     
     
                Where size is either SEVEN-BIT or EIGHT-BIT
     
SHOW
                The  SHOW command will allow you to show the various parameters
                that are set with the SET command.
Running KERMIT                                                          Page 14
     
     
                    KERMIT-65>SHOW <option> <suboption>...
     
     
                The options available to SHOW are:
     
                    ALL                 BAUD                DEBUGGING
                    EIGHT-BIT-QUOTING   ESCAPE              FILE-BYTE-SIZE
                    FILE-TYPE           FILE-WARNING        FLOW-CONTROL
                    IBM                 LOCAL-ECHO          PARITY
                    RECEIVE             RS232-REGISTERS     SEND
                    VT52-EMULATION      WORD-SIZE
     
                        A description of the options and suboptions follows.
     
SHOW ALL
                The SHOW ALL command will cause all of  the  parameters  to  be
                listed.
     
SHOW BAUD
                Shows the current Baud rate.
     
SHOW DEBUGGING
                Display  whether debugging is off, in terse mode, or in verbose
                mode.
     
SHOW EIGHT-BIT-QUOTING
                Shows  whether  or  not Kermit-65 is using eight-bit-quoting on
                file transfers.
     
SHOW ESCAPE
                This  will  display  the  character being used to escape from a
                connection to a remote Kermit.
     
SHOW FILE-BYTE-SIZE
                This command shows whether Kermit is treating seven bits or all
                eight bits as significant when writing to a file.
     
SHOW FILE-TYPE
                Shows what type of file Kermit-65 is reading or writing.
     
SHOW FILE-WARNING
                Shows whether or not Kermit-65 will check if a file  exists  on
                receive,  and  try  to  modify the name used for the file if it
                does.
     
SHOW FLOW-CONTROL
                Shows  whether  or not Kermit-65 is using XON/XOFF flow control
                for communication.
     
SHOW IBM
                Shows  whether or not Kermit-65 is being used to talk to an IBM
                mainframe.
Running KERMIT                                                          Page 15
     
     
SHOW LOCAL-ECHO Shows whether or not Kermit-65 will print a copy of  characters
                on  the  screen  which  are  typed  by the user and sent to the
                mainframe during connect processing.
     
SHOW PARITY
                Shows  the  type  of parity being used by Kermit-65 in order to
                talk to the other Kermit.
     
SHOW RECEIVE
                Shows the setting of a particular receive packet parameter. The
                suboptions available are:
     
                EIGHT-BIT-QUOTE-CHAR            END-OF-LINE     PACKET-LENGTH
                PAD-CHAR                        PADDING         QUOTE-CHAR
                TIMEOUT
     
                        These are analogous to the SET  RECEIVE  options  given
above.
     
SHOW RS232-REGISTERS
                Shows the value of the 2 RS232 registers as a single 16 bit hex
                value.
     
SHOW SEND
                Shows the setting of a particular send  packet  parameter.  The
                suboptions available are:
     
                EIGHT-BIT-QUOTE-CHAR            END-OF-LINE     PACKET-LENGTH
                PAD-CHAR                        PADDING         QUOTE-CHAR
                TIMEOUT
     
                        These  are  analogous  to  the  SET  SEND options given
above.
     
SHOW VT52-EMULATION
                Shows whether or not Kermit-65 is acting like a VT52 when talk-
                ing to another Kermit during connect processing.
     
SHOW WORD-SIZE  Shows the current word-length for communication.
     
STATUS
                The  current  status  of Kermit-65 will be displayed.  This in-
                cludes the  number  of  characters  that  have  been  sent  and
                received  from  the remote Kermit.  Also included is the amount
                of characters which were actual data and the overhead for  both
                send and receive.
KERMIT-65 SYSTEM INSTALLATION GUIDE                                     Page 16
     
     
4. KERMIT-65 SYSTEM INSTALLATION GUIDE
     
4.1. THE FILES
     
The following files should be supplied on the distribution tape:
     
   - C64BOOT.BAS - Initial bootstrap program to load C64KER.BOO
     
   - C64BOOT.FOR - FORTRAN program at mainframe to talk to C64BOOT.BAS
     
   - C64DXL.BAS - Hex disk file loader in BASIC
     
   - C64DXL.HEX - Assembled version of Disk Hex load program
     
   - C64DXL.M65 - Source of program to load KERMIT-65 from C64 diskette
     
   - C64KER.BIN  - Assembled version of KERMIT-65 (Eight-bit Binary Object
     code)
     
   - C64KER.HEX - Assembled version of KERMIT-65
     
   - C64KER.M65 - CROSS assembler source for KERMIT-65
     
   - CROSS.MAC - CROSS Microprocessor Assembler (Source)
     
   - CROSS.EXE - CROSS Microprocessor Assembler (Object)
     
4.2. Building KERMIT-65
     
.R CROSS<cr>                    ! Run CROSS Microprocessor Assembler
     
*C64K.HEX/PTP:KIM=C64K.M65/M65  ! Generate .HEX file
     
     
This command will produce an ASCII HEX file which can be downline  loaded  onto
the  C64  using  C64LBT. If a listing is desired, one can be produced by adding
",KERMIT.LST" after the "/PTP:KIM" in the command  line  to  CROSS.  Note  that
CROSS  tends  to  pad  its' output files with NULLS. You may want to strip them
with the editor of your choice to cut down the files' size (which will also cut
down on the time recquired to transmit the file).
     
4.3. General Procedures and Conventions
     
Before working with KERMIT on the C64 do the following:
     
   1. Make sure all equipment is turned off.
     
   2. Remove all cartridges from you C64 computer.
     
   3. Turn on your disk drive and monitor.
     
   4. Turn on your C64 computer.
KERMIT-65 SYSTEM INSTALLATION GUIDE                                     Page 17
     
     
   5. Turn on your printer.
     
   6. Insert your working disk into the disk drive.
     
   7. Follow the procedures outlined below to bring up KERMIT.
     
4.4. Loading an assembled file
     
The  procedure to bootstrap an assembled KERMIT object file from a mainframe to
the C64 is as follows:
     
1) On the C64, Load and run SUPERMON machine language  monitor  or  equivalent.
Preferably should be in address $C800-$CFFF.
     
2)  Type  in  the  BASIC  program C64BOOT.BAS on the C64. This is a simple file
transfer protocol for receiving '.HEX' files. It is recommended that  the  user
save this program as it may be needed to bootstrap newer versions of KERMIT, or
C64DXL in the future.
     
3) Run C64BOOT.BAS on the C64. The procedure is:
     
        LOAD"C64BOOT.BAS",8
        RUN<cr>
     
        NOW IN DUMB TERMINAL MODE.  PRESS F1 KEY
        TO BEGIN RECEIVING FILE. (MAKE SURE THAT
        HOST IS SET FOR HALF-DUPLEX.)
     
     
     
4) Call and login to the mainframe on which KERMIT-65 resides.
     
5) Compile and execute C64BOOT.FOR. This will be used along with C64BOOT.BAS on
the  C64  to  load  C64DXL.HEX AND C64KER.HEX. Once C64BOOT is executing on the
mainframe, give control back to the C64.
     
6) First download C64DXL.HEX
     
        <F1>
        LOCAL FILENAME? C64DXL.HEX
     
     
C64BOOT will display status messages about what it is receiving on  the  screen
as well as saving the data on disk.
     
7) Then download C64KER.HEX
     
        <F1>
        LOCAL FILENAME? C64KER.HEX
     
     
C64BOOT  will  display status messages about what it is receiving on the screen
KERMIT-65 SYSTEM INSTALLATION GUIDE                                     Page 18
     
     
as well as saving the data on disk.
     
8) Logout (if you wish) and exit C64BOOT.BAS
     
9) Type in and save C64DXL.BAS. Run C64DXL.BAS
     
        LOAD"C64DXL.BAS",8
        RUN<cr>
        Name Of File? C64DXL.HEX<cr>
     
 C64DXL will display what it is loading into memory.
     
10) Save C64DXL. Type the following: (if you haven't already, load Supermon  at
C7ED)
     
 SYS 51181 (to enter Supermon)
 .S "C64DXL.C000",08,C000,C2EE<cr>
     
     
11) Start executing C64DXL.
     
 LOAD "C64DXL.C000",8,1<cr>
 SYS 49152<cr>
 Hex Object File Loader
 Object File Name? C64KER.HEX <cr>
     
C64DXL will display what it is loading into memory.
     
6) When done, enter SUPERMON and save the file:
     
 .S "KERMIT",08,0801,xxxx+1<cr>
     
 Where xxxx is the last address diplayed by C64DXL
     
The new version of Kermit is now on disk.
     
4.5. Loading a new version of KERMIT-65
     
Once  KERMIT-65  is on the users system, it can be used to load new versions of
KERMIT-65.  There are two ways of doing this.  One will work in any  enviroment
where  the  initial  bootstrap  procedure  works,  since it depends only on the
capability of transferring text files.   The  other  method  depends  upon  the
capability of being able to obtain and transfer a binary file.
     
4.6. Loading from a .HEX file
     
1)  Use Kermit to transfer C64DXL over to your C64 (If you already have C64DXL,
skip to step 4). C64DXL is a disk hex loader that will take CROSS  format  .HEX
files on your C64 and load them into memory:
     
        LOAD"KERMIT",8<cr>
        RUN<cr>
KERMIT-65 SYSTEM INSTALLATION GUIDE                                     Page 19
     
     
        (Do your mainframe Kermit setup here)
        KERMIT-65>GET C64DXL.HEX<cr> (or RECEIVE C64DXL.HEX)
     
2) Type in and save C64DXL.BAS. Run C64DXL.BAS
     
        LOAD"C64DXL.BAS",8
        RUN<cr>
        Name Of File? C64DXL.HEX<cr>
     
 C64DXL will display what it is loading into memory.
     
     
3) Save C64DXL. Type the following:
     
 SYS 51181 (to enter Supermon)
 .S "C64DXL.C000",08,C000,C2EE<cr>
     
     
4) Use Kermit-65 to transfer the new version of itself over.  Make the C64 file
a Text file. WARNING: This file will take LOTS of space (about 130 sectors)  so
make sure the disk is reasonably empty.
     
5) Start executing C64DXL.
     
 LOAD "C64DXL.C000",8,1<cr>
 SYS 49152<cr>
 Hex Object File Loader
 Object File Name? C64KER.HEX <cr>
     
C64DXL will display what it is loading into memory.
     
6) When done, enter SUPERMON and save the file:
     
 .S "KERMIT",08,0801,xxxx+1<cr>
     
 Where xxxx is the last address diplayed by C64DXL
     
The new version of Kermit is now on disk.
     
4.7. Loading from the binary version
     
There  is  yet another way to Bootstrap a new version of KERMIT onto an C64. If
the user has an older version of KERMIT-65 which supports binary mode transfer,
and  has  access  to a machine with a valid copy of C64KER.BIN, they can simply
transfer C64KER.BIN  using  their  version  of  KERMIT.  Be  sure  to  set  the
File-byte-size  to Eight-bit, and the File-type-mode to Binary before transfer-
ing the file since this is the actual object code.  Also be sure that the send-
ing Kermit is also set for doing a binary transfer.  No special loading or con-
version is needed.
Character and Control Code Definitions                                  Page 20
     
     
I. Character and Control Code Definitions
     
I.1. Keyboard Layout
     
Because of the unusual layout of the C64 keyboard, the desire  to  support  all
ascii  characters,  and  a  personal need to find the ESC and DEL keys in their
usual positions, the following key substitutions apply (note- ^x is short- hand
for CONTROL-x):
     
        TO SEND         TYPE
        -------         ----
        \               BRITISH-POUND
        ^\              ^BRITISH-POUND
        ^               UP-ARROW
        ^^              ^UP-ARROW
        ^[ (ESC)        ^[ or LEFT ARROW
        :               F1
        :               F2
        _               F3
        ~               F4
        |               F5
        `               F6
        NULL            F7
        ^_              F8
        DEL (RUB)       Commodore DEL
        ^T              SHIFT/INST
        ^H (BS)         ^H, or ^T
        ^J (NL)         SHIFT/RETURN or ^J
        ^S (DC3)        ^S or HOME
        ^Q (DC1)        ^Q or CURSOR DOWN
        ^I (TAB)        ^I (ie. No separate TAB key)
     
Note  that  if the FLOW-CONTROL option has been set, pressing the COMMODORE key
will place the terminal program in a suspended display  mode  (ie.  the  cursor
will freeze at it's current position), and ^S will be sent to the host computer
when the RS-232 input buffer fills up.  Similarly, pressing the  COMMODORE  key
will  remove  the terminal from the suspended display mode and send a ^Q to the
host computer only if a ^S had previously been sent and the buffer  has  become
nearly  empty.    This  enables  the  COMMODORE key to be used like the SCROLL/
NO-SCROLL key on DEC terminals.  Suspended display mode  is  indicated  to  the
user  by the cursor dissapearing , an indication that the COMMODORE key must be
pressed to resume displaying the received text.  The program may also  send  ^S
and  ^Q to the host computer on it's own from time to time if it detects an im-
pending RS-232 buffer overflow condition - this normally will only occur  while
printing  a  number  of  short or blank lines while scrolling the screen up (or
down), since 4 to 15 characters are received into the RS-232 buffer during  the
time  it  takes  to  scroll the whole screen.  In any case, this automatic flow
control is fully synchronized with the flow control necessitated by the use  of
the COMMODORE key to suspend and resume the display of received text.  Depress-
ing the ^S and ^Q keys (or their substitutes indicated  above)  unconditionally
sends  those ASCII characters to the remote host computer without any local ef-
fect.
Character and Control Code Definitions                                  Page 21
     
     
This terminal program does `not' support flow control in the opposite direction
-  receiving  ^S  from the host computer will not lock the keyboard or have any
other effect, nor will ^Q.
     
     
I.2. GLASS terminal
     
The GLASS TTY terminal type prints all characters except ASCII 0-31  and  ASCII
127.  Most control codes are ignored.  The following, however, are recognized:
     
        CHARACTER       EFFECT
        ---------       ------
        ^G (BEL)        sounds a beep
        ^H (BS)         cursor backspaces
        ^I (TAB)        cursor moves right to next tab stop
        ^J (NL)         cursor moves down one line with scrolling
        ^M (CR)         cursor moves to start of line
     
     
                   Table I-1:   Control Codes For Glass TTY
     
Tab  stops are pre-defined and fixed at every 8 columns beginning with column 0
(ie. 0, 8, 16, 24, ...).
     
I.3. VT-52 Terminal
     
The VT-52 terminal prints the same characters as the GLASS TTY.  It  reacts  to
control  characters  the  same  as  the  GLASS, except when ESC (decimal 27) is
received. Kermit will treat the next character received specially; if it  isn't
in  the  following  table, KERMIT ignores the character; if it is in the table,
the action is as indicated.
     
        CHARACTER       EFFECT
        ---------       ------
        ^[A             cursor moves up one line
        ^[B             cursor moves down
        ^[C             cursor moves right one char.
        ^[D             cursor moves left one char.
        ^[H             cursor homes
        ^[I             cursor moves up one line with scrolling
        ^[J             clears from cursor to end of screen
        ^[K             clears from cursor to end of line
        ^[Ylc           cursor moves to line l-$20, col c-$20
        ^[Z             sends DEC VT-52 terminal id string
        ^[n             turns off reverse video
        ^[o             turns on reverse video
     
                    Table I-2:   Escape Sequences for VT-52
Character and Control Code Definitions                                  Page 22
     
     
VAX UNIX users (Berkeley 4.1bsd) will find that the following "termcap" entries
effectively  describe this terminal program for use with the terminal dependent
UNIX programs (eg. vi, emacs, more, rogue, etc.):
     
  qc|c64|C64|Commodore 64:co#40:li#25:\
          :up=\EA:do=\EB:cl=\EH\EJ:am:bs:\
          :bw:ho=\EH:nd=\EC:so=\Eo:\
          :se=\En:cm=\EY%+ %+ :\
          :ce=\EK:sr=\EI:pt:
     
VAX VMS users can probably get away  with  the  following  (although  some  VMS
programs  [eg.  edt]  require  an auxilliary keypad, and do not work especially
well in 40 column mode):
     
          set term /dev=vt52
          set term /pag=25
          set term /wid=40
     
TOPS-20 users can run "emacs" and the like after the following:
     
          term vt52
          term length 25
          term width 40
          term pause com
C64BOOT.BAS - BOOTSTRAP PROGRAM FOR C64HXL                              Page 23
     
     
II. C64BOOT.BAS - BOOTSTRAP PROGRAM FOR C64HXL
     
Here is the  download program  for the  C64.  Note  that the  RS-232
channel open statement in  line 10 may need  to be modified for  the
particular host.   Also, be  aware that  this program  performs  the
proper ASCII  to  PETASCII conversions.   The  hex loader  on  CU20B
assumes that no conversions are done, therefore expecting  lowercase
letters, instead of uppercase.  I patched my copy of the hex loader;
however, removing the GOSUB 150 in line 198 will omit the conversion
to PETASCII, thereby  allowing the  regular hex  loader to  function
properly.
     
The mainframe host should have a DONWLOAD program to accompany  this
one which runs on  the C64.  DOWNLOAD is  currently written in  CLU,
and is  available  in  executable  form for  TOPS-20  and  4.2  UNIX
systems.
     
To download a file, load and  run this program on the Commodore  64.
Use the dumb terminal mode  to log in to  the remote host.  Set  the
remote host for half duplex communication (this prevents the  remote
host from echoing the acknowledgements it receives back to the C64).
Then run the download program on the remote host, including the name
of the file you  wish to download  to the C64  on the command  line.
For example, to download the file foo, you would type DOWNLOAD FOO
     
=============================================================================
     
1 REM FILE CAPTURE PROGRAM; ROBERT LENOIL, AUTHOR.
2 REM WRITTEN DECEMBER 1984. CLEANED UP FOR GENERAL PUBLIC FEBRUARY 1985.
5 PRINT "[CLEAR]NOW IN DUMB TERMINAL MODE.  PRESS F1 KEY";
6 PRINT "TO BEGIN RECEIVING FILE. (MAKE SURE THAT";
7 PRINT"HOST IS SET FOR HALF-DUPLEX.)"
8 PRINT "----------------------------------------";
10 OPEN 1,2,0,CHR$(38)+CHR$(161) : OPEN 15,8,15
15 GET A$ : IF A$ = CHR$(133) THEN 20
18 PRINTA$; : PRINT#1,A$; : GET#1,A$ : GOSUB 150 : PRINTA$; : GOTO 15
20 F$="" : INPUT "LOCAL FILENAME";F$
23 IF F$="" THEN CLOSE 15 : CLOSE 1 : PRINT "QUITTING" : END
25 OPEN 8,8,8,"0:"+F$+",S,W"
30 GOSUB 60 : IF EN$ > "00" THEN CLOSE 8 : GOTO 20
35 GET#1,A$ : IF A$ > "" GOTO 35
40 GOSUB 45 : GOTO 190
45 PRINT#1,"ok" : RETURN :REM "OK" ON REMOTE HOST
47 PRINT#1,"ng" : RETURN :REM "NG" ON REMOTE HOST
60 INPUT#15,EN$,EM$,ET$,ES$ : IF EN$ > "00" THEN PRINT "[RVS ON]"EN$EM$ET$ES$
61 RETURN
150 REM CONVERT ASCII TO PETASCII
155 A = ASC(A$+CHR$(0)) : IF A > 64 AND A < 91 THEN A = A + 128
160 IF A > 96 AND A < 123 THEN A = A - 32
165 IF A=127 THEN A=20
170 A$=CHR$(A) :RETURN
190 L$="" : CK=0
C64BOOT.BAS - BOOTSTRAP PROGRAM FOR C64HXL                              Page 24
     
     
195 GET#1,A$ : IF A$="" THEN 195
197 IF A$=CHR$(13) THEN 200
198 CK = CK + ASC(A$) : GOSUB 150 : L$ = L$ +A$ : PRINT A$; : GOTO 195
200 PRINT : CK$=""
202 GET#1,A$ : IF A$="" THEN 202
203 IF A$ <> CHR$(13) THEN CK$ = CK$ + A$ : GOTO 202
205 IF CK = ABS(VAL(CK$)) THEN 210
207 PRINT "[RVS ON]CHECKSUM ERROR - SENDING NACK" : GOSUB 47 : GOTO 190
210 PRINT#8,L$ : GOSUB 60 : IF EN$ > "00" THEN STOP :REM (FATAL?) DISK ERROR
215 GOSUB 45 : IF LEFT$(CK$,1) <> "-" THEN 190
220 CLOSE 8 : GOTO 20
C64BOOT.CLU - MAINFRAME SIDE OF BOOTSTRAP                               Page 25
     
     
III. C64BOOT.CLU - MAINFRAME SIDE OF BOOTSTRAP
     
%% Program to download files to my Commodore 64
%% Sends lines, one at a time.  Each line is followed by a
%% checksum.  Commodore validates checksum, and either sends
%% "OK" or "NG".  If no good, retransmit.  Last line's checksum
%% is sent with a leading minus sign to show end-of-file.
     
start_up = proc ()
     
   po:stream := stream$primary_output()
   pi:stream := stream$primary_input()
   file:stream := stream$open(file_name$parse(get_jcl()),"read")
   except when not_possible(why:string):
      stream$putl(po,"Could not open file: " || why) return end
     
   received:string := ""
   while received ~= "OK" do received := stream$getl(pi) end
        % don't start until initial OK
     
   while ~stream$empty(file) | received = "NG" do
      line:string
      if received = "OK" then line := stream$getl(file) end
      checksum:int := 0
      for c:char in string$chars(line) do
         stream$putc_image(po,c)
         checksum := checksum + char$c2i(c)
      end
      stream$putc_image(po,'\r')
      if stream$empty(file) then stream$putc(po,'-') end
      stream$puts_image(po, int$unparse(checksum) || "\r")
      received := stream$getl(pi)
   end
     
end start_up
C64BOOT.CLU - MAINFRAME SIDE OF BOOTSTRAP                               Page 26
C64BOOT.CLU - MAINFRAME SIDE OF BOOTSTRAP                               Page 27
Table of Contents                                                        Page i
     
     
   Table of Contents
     
1. Introduction                                                               1
     
   1.1. Overview                                                              1
   1.2. System Requirements                                                   1
     
2. Known Bugs, Deficiencies                                                   2
     
   2.1. HINTS                                                                 2
   2.2. Notes                                                                 2
     
3. Running KERMIT                                                             3
     
   3.1. Booting KERMIT                                                        3
   3.2. Commands in KERMIT                                                    3
     
4. KERMIT-65 SYSTEM INSTALLATION GUIDE                                       16
     
   4.1. THE FILES                                                            16
   4.2. Building KERMIT-65                                                   16
   4.3. General Procedures and Conventions                                   16
   4.4. Loading an assembled file                                            17
   4.5. Loading a new version of KERMIT-65                                   18
   4.6. Loading from a .HEX file                                             18
   4.7. Loading from the binary version                                      19
     
I. Character and Control Code Definitions                                    20
     
   I.1. Keyboard Layout                                                      20
   I.2. GLASS terminal                                                       21
   I.3. VT-52 Terminal                                                       21
     
II. C64BOOT.BAS - BOOTSTRAP PROGRAM FOR C64HXL                               23
     
III. C64BOOT.CLU - MAINFRAME SIDE OF BOOTSTRAP                               25
List of Tables                                                          Page ii
     
     
     List of Tables
   Table I-1:   Control Codes For Glass TTY                                  21
   Table I-2:   Escape Sequences for VT-52                                   21