*****************************************************************************
    This document is intended to supplement the MS-DOS KERMIT Users Guide.
   It is the documentation for the extended DEC Rainbow version of MS-KERMIT.
 *****************************************************************************

                By David L. Knoell, Basic American Food Company
                                    Vacaville, CA 95696  (707-446-2200)

1.11.  DEC Rainbow Command Extensions and Enhancements

SET TERMINAL

Syntax: SET TERMINAL parameter [value]

This command  was  not  implemented  on  V 2.29 of the DEC Rainbow MS-KERMIT, so
there should be no conflict with previous versions.  The DEC Rainbow has most of
the SET TERMINAL parameters  implemented via SET-UP mode and therefore available
to  the  software through non-volatile  memory.    Parameters  set  through  the
standard  DEC  Rainbow SET-UP are honored  in  Kermit;    and  therefore,  those
functions are not duplicated in the SET TERMINAL command.

The first group of parameters sets the  terminal type to be emulated.  This only
determines  the  "answer-back" generated in response to a  "who/what  are  you?"
command from the host.  The following sequences are recognized:

         Parameter        Response Sequence       Special Status
         ---------        -----------------       --------------
         NONE             <ESC>[?6c                  VT102-d      
         HEATH-19         <ESC>/Z                    VT52-h
         VT100            <ESC>[?4;2c                VT100
         VT102            <ESC>[?6c                  VT102
         VT125            <ESC>[?12;7;1c             VT125
         VT220            <ESC>[?62;1;2;8c           VT220
         VT52             <ESC>/Z                    VT52
         
  **note- The  terminal  emulation  software  depends  on  the built-in firmware
          VT102/VT52 emulation  to  perform  much  but not all of the work.  The
          above settings do not influence how transmitted/received sequences are
          parsed or responded to.   The setting of the ANSI/VT52 firmware switch
          (via  SET-UP or host software)  is  the  controlling  factor.    These
          parameters have been provided primarily so that host software (VAX/VMS
          for example) will receive the response it  needs.    The tables in the
          modules  MSXRB1x  and  MSYRB1x can be expanded to  provide  additional
          selections.          
         
The  remaining  SET  TERMINAL  parameters specify various operating modes within
which you run the basic VT1XX/VT2XX emulator.

AUTO-XON {ON, OFF}
        Sends a X-ON  to  the  host when re-CONNECTing after once having escaped
        back to  the  "Kermit-MS>"  prompt.   This function is useful, since the
        serial buffers are  cleared  and  reset  during an escape back to kermit
        prompt level.  Default  is  OFF.    Tested  and used with VAX/VMS system
        software.
        
EIGHTBIT-MODE {ON, OFF}
        Enables transmission/receipt of true 8-bit  characters while in terminal
        emulation mode.  This is essential  when  supporting devices such as the
        DEC's  LN03 laser printer using the DEC  multi-national  character  set.
        The host system software should be made compatible  with  this function,
        for  example:    under  VAX/VMS  the command "$ SET  TERMINAL/EIGHTBIT",
        should  be used or else the terminal driver in VMS will strip/clear  the
        eighth bit.  There is  no  effect  during file transfers since Kermit-MS
        knows when it's in transfer or terminal mode.  Default is OFF.
        

FUNCTION-KEYS {VT102, VT220}
        Set  to VT102 (Default) the Rainbow's F11,F12,F13 keys transmit a (ESC),
        (BS),(LF)  respectively.  When set to VT220 they transmit and respond as
        VT220 level  2  (true VT220) keys and transmit the function key sequence
        normal for keys on the top row (ie.  <ESC>[Pn~ where Pn is 23 for F11,24
        for F12, and 25  for  F13).    The  fact  that  both key definitions can
        co-exist even though the firmware  does  not support it, is accomplished
        with software within the emulator.   This  software  is also used by the
        SET  KEY  function  so  that those three  keys  can  actually  have  six
        different definitions.  See Appendix B for the scan codes to use.
        
LINE-MONITOR {ON, OFF}
        Sets the printer port to loop-back to the serial port when set ON.  This
        function is very similar to a set-up  function  found  in a VT240 called
        "Printer-to-Host".  When set ON the interrupt service  routines  in  the
        emulator handle the printer port interrupts as well as  those  from  the
        serial port.  In previous versions the interrupts from the  printer port
        were  passed  back  to  MS-DOS  for processing by the original interrupt
        service  routines  and  still  are,  if  this function is OFF (Default).
        There are no restrictions on using this setting even when doing a screen
        dump to printer  or  auto-print (print characters as they are received).
        When used in conjunction  with  the  ANSI  "printer-controller  on"  and
        MONITOR-MODE the Rainbow Kermit emulator  becomes completly passive.  In
        other words, data from the serial  port is routed unparsed and untouched
        to the printer port while data received  from the printer port (actually
        another  serial  port)  is  routed  to  the  COMM  serial  port.    When
        MONITOR-MODE is ON the traffic is displayed on the  Rainbow's screen for
        review.  The device on the printer port does not  have  to be a printer,
        in  fact it could be another computer.  The emulator currently  supports
        X-ON/X-OFF from the printer port device only and the baud rate /  parity
        settings  are  supported  via  SET-UP or SETPORT.  The emulater has a 1K
        buffer for  input  but  does  not support X-ON/X-OFF flow control to the
        printer port. (note-MONITOR-MODE is a new Kermit Special function.)
        
MONITOR-STYLE {PRINTABLE, VIDEO}
        Determines how control characters will be displayed when the emulator is
        placed  in  MONITOR-MODE.   The default is VIDEO which displays carriage
        return, line feed, horz tab, vert tab, new line, and form feed as single
        characters from the  VT100  special  line  drawing  character  set.  The
        PRINTABLE parameter uses standard 2 or 3 character sequences enclosed in
        angle brackets "<>" (eg.  <CR>,<FF> etc.).  
        
SAVE-SCREEN {ON, OFF}
        Determines the action taken when  the  screen is re-sized from 80 to 132
        characters or 132  to 80 characters.  If set ON, then the text currently
        visible on the screen is restored after the re-sizing.  If OFF, then the
        DEC standard of clearing the  screen and homing the cursor is done.  The
        Default is OFF.  This function  does not operate when the screen size is
        changed via the firmware-driven SET-UP screen.   It operates only during
        a  software  "SET/RESET  SEQUENCE  (<ESC>[?3h  or <ESC>[?3l)" or  via  a
        special-function assigned to a key.
        
SPECIAL-FUNCTIONS {ENABLED, DISABLED}
        ENABLEs (Default) the  hard-coded  Kermit  special functions assigned to
        fixed keys.    Example:   Prev Screen key scrolls back one page in video
        memory.  If  DISABLED,  all  fixed  key  assignments are removed and the
        normal sequence for the  key  is transmitted.  See the section on kermit
        special functions on how to assign the functions to keys.



NEW and ENHANCED FEATURES              
        

1.11.1 Keyboard Key Translations


There are now  4  levels  of  key  translations supported in this version of the
emulator.  The Function keys (grey)  can  be  assigned (with some exceptions) to
all 4 levels at the same time;    however,  only  the  highest  level definition
currently defined is translated.  Level 1 is the highest level.


                                      ASCII    SPECIAL
   LEVEL  TYPE of ASSIGNMENT        Strings  FUNCTIONS  Comments
   -----  -----------------------   -------  --------- ---------------------
     1    VT220 User Defined Keys      YES       NO    Down-line loaded
     2    Interactive "Hot Keys"       YES      YES    In CONNECT mode
     3    Kermit SET KEY type          YES      YES    Kermit command level
     4    Kermit pre-assigned           NO      YES    Hard-coded in program
     

Level 1: VT220 UDK's
         Since  these  key definitions are loaded via host driven software  they
         are given the highest priority.  See the section on VT220  User Defined
         Keys for a full discussion.  Also Appendix A.
         
Level 2: Interactive "Hot Keys"         
         Any  key  (except  Hold screen and Set-up) can be defined or re-defined
         during CONNECT mode.  The key can be assigned either to an Ascii string
         (255  characters  max)  or  to  a Special Function.  In  fact  the  key
         definition routines are themselves available as Special Functions.  You
         can also cancel the current definition by assigning the key to an ascii
         string of null length.    The routine provides menus and prompts so the
         process of defining a key  is easy.  The definitions are only valid for
         a given Kermit session, ie:  if you exit to DOS they are lost.  To make
         the assignment semi-permanent you can assign the  keys  via the SET KEY
         function  in  a KERMIT.INI file which is processed  when  you  activate
         Kermit.
         
Level 3: Kermit SET KEY
         This  standard  Kermit  command  has  been  enhanced  to enable Special
         Functions to be assigned to keys.  The scan code used  indicates to the
         emulator  that  the  definition  is  not  an  ascii string but rather a
         Special Function.   You can calculate the Special Function scan code to
         be used by  simply adding 4096 (decimal) to the scan code generated via
         the SHOW KEY command.    Appendix  B  gives a complete list of all scan
         codes generated on a DEC  Rainbow.    When  Kermit  prompts for the key
         definition you simply supply the octal  code  assigned  to each Special
         Function  (\xxx where xxx is a 3-digit  octal  number).    These  octal
         numbers are assigned in sequence and as new  functions  are  added they
         simply  increase the number of valid functions available.   Appendix  C
         gives a list of vaild functions currently implemented.
         
Level 4: Kermit pre-assigned Functions
         For  compatibility  with previous versions of MS-KERMIT these functions
         are currently hard-coded in the program as before.  In addition several
         new functions have been added to the hard-coded list.  Interactive HELP
         "Show all Keys"  provides  a  seperate section in the display for these
         key definitions.  Appendix  D  also  gives a current list.  Please note
         that you can "turn off" these pre-assigned function definitions via the
         "SET TERM SPECIAL-FUNCTIONS DISABLE" Kermit command. 


1.11.2 VT220 User Defined Keys (UDK's)
       
The User Defined Keys feature of the VT220 has been implemented with extensions.
You do not have to be in VT220 mode for these keys to be down-loaded or used.  A
standard VT220 allows the keys F6 through F20  (including  Help  and  Do)  to be
programmable via the DECUDK device control strings.  They  are invoked by typing
the  SHIFT-(function key).  This implementation allows both the shift  and  also
the  un-shifted  function keys to be downline loaded.  In addition  the  editing
keys  (Find,Insert  Here,Remove,Select,Prev  Screen,Next  Screen)  may  also  be
defined (both shifted and un-shifted).    Please  note  that  this  is  not  DEC
standard;  so use with caution.    The  clear and lock parameters have also been
implemented  and  all  sequences  work  as described  in  the  VT220  Programmer
Reference Manual (pg 4-37 thru 4-41) EK-VT220-RM-001.

DECUDK Device Control String Format

  DCS   Pc;Pl  |  Ky1/st1;ky2/st2;......kyn/stn   ST
  
 Where: DCS is the Control String Introducer (90 hex in 8-bit) or
                                             (<ESC>P in 7-bit)
        Pc is Clear Parameter (0 or none clear all keys before loading)
                              (1 load new key values,clear old only if defined)
        Pl is Lock  Parameter (0 or none lock against future redefinition)
                              (1 do not lock against future redefinition)
        |  Vert Bar Final character - characters between this character and
                                      the string terminator (ST) will be
                                      parsed by the emulator for definitions.
        Ky1 is a key code to be defined (see list below)                   
        /   is a ascii slash used as a seperator
        St1 is a string of hex pairs which are the encoded contents of the key
        ;   is a ascii semi-colon used to seperate multiple key definitions
        ST  is the ansi String Terminator (9c hex in 8-bit) or
                                          (<ESC>\ in 7-bit)
                                          
More  information  can  be  found  in  the  VT220 Programmers  Reference  Manual
mentioned  above  and  by looking at the sample VAX Basic  program  provided  in
Appendix  A.    The  following  list  of Key codes provides information  on  the
extensions made to the standard VT220 codes.  Leading zeros are required  as the
key code must be 2 ascii digits.  In coding the Hex pairs you may use both upper
and lower case alpha characters for the hex digits A-F (a-f).

EXAMPLES:

   (a) To clear keys send the following string:  <DCS>0;1|<ST>
  
   (b) To lock keys send the following string:  <DCS>1;0|<ST>
   
   (c) To define key Shift/F20 as the string "PRINT" without clearing or locking
       any other keys you would:
  
      (1) Convert the text to Hex pairs:
          P = 50 hex
          R = 52 hex
          I = 49 hex
          N = 4E or 4e hex
          T = 54 hex
          
      (2) Compose the entire control sequence as follows:
   
            8-bit mode - <DCS>1;1|34/5052494E54<ST>
               
            7-bit mode - <ESC>P1;1|34/5052494E54<ESC>\
       
*note-the 34 preceeding the / is the UDK key code found in the following table


            Table of Key Codes for Use in Defining UDK's
            --------------------------------------------

                             (shifted)     (un-shifted)
     KEY NAME                 KEY CODE       KEY CODE
   --------------             --------       --------
   F6-Interrupt                  17 *           57
   F7-Resume                     18 *           58
   F8-Cancel                     19 *           59
   F9-Main Screen                20 *           60
   F10-Exit                      21 *           61
   F11-(ESC) - VT220 only        23 *           63   |   active only if 
   F12-(BS)  - VT220 only        24 *           64   | FUNCTION-KEYS VT220
   F13-(LF)  - VT220 only        25 *           65   |    has been set      
   F14-Addtnl Options            26 *           66
   F15-Help                      28 *           68
   F16-Do                        29 *           69
   F17-                          31 *           71
   F18-                          32 *           72
   F19-                          33 *           73
   F20-                          34 *           74
   Find                          01             41
   Insert Here                   02             42
   Remove                        03             43
   Select                        04             44
   Prev Screen                   05             45
   Next Screen                   06             46
   (ESC) - VT100 only            07             47   |   active only if   
   (BS)  - VT100 only            08             48   | FUNCTION-KEYS VT100
   (LF)  - VT100 only            09             49   |    has been set       
                                                      
                                    * Indicates standard VT220 code. All others
                                      should be considered extentions.


 ----------The leading zeros in the Key Code (if any) are required------------



    note- the VT100 only keys and the VT220 only keys can always  be
          loaded regardless of the "SET TERMINAL FUNCTION-KEYS" setting. 
          

1.11.3 Special Kermit Functions

The following section describes the Kermit Special Functions currently available
in this  version  of  the  emulator.    The  octal  code (\xxx) assigned to each
function is given.    Many of the routines come in three versions:  toggle, turn
on, and turn off.    They are grouped here by type of function and therefore the
octol codes are not in  sequence.  Appendix C gives a complete list in numerical
sequence.

------ SCREEN MANAGEMENT (SCROLL) ROUTINES

 \002  View Prev Screen (Scroll)      | Go back one screen if possible
 \003  View Next Screen (Scroll)      | Go forward one screen if possible
 \004  View Prev Line (Scroll)        | Go back a single line if possible
 \005  View Next Line (Scroll)        | Go forward a single line if possible
 \006  View Screen Bottom             | Re-position screen at last recvd char


------ KERMIT SET TERMINAL ROUTINES

 \020  Toggle Eight-bit Mode          | 
 \021  Turn on Eight-bit Mode         | same as SET TERMINAL EIGHTBIT-MODE
 \022  Turn off Eight-bit Mode        |

 \026  Toggle Save Screen (80/132)    |
 \027  Turn on Save Screen (80/132)   | same as SET TERMINAL SAVE-SCREEN
 \030  Turn off Save Screen (80/132)  |

 \101  Toggle Line Monitor Mode       |
 \102  Turn on Line Monitor Mode      | same as SET TERMINAL LINE-MONITOR
 \103  Turn off Line Monitor Mode     |

 \105  Toggle Special Functions       |
 \106  Special Functions Disabled     | same as SET TERMINAL SPECIAL-FUNCTIONS
 \107  Special Functions Enabled      |

 \110  Toggle Function Key Mode       |
 \111  Set Function Keys to VT220     | same as SET TERMINAL FUNCTION-KEYS
 \112  Set Function Keys to VT100     |


------ PRINT AND DUMP ROUTINES

 \000  Print Screen                   | Current full screen only    
 \114  Print Screen + Memory          | As above + to end of scroll memory

 \001  Dump Screen to Disk            | Similar to Print Screen but to disk
 \113  Dump Screen + Memory to Disk   | As above + to end of scroll memory  

 \011  Print Current Line             | Print line which has cursor on it

 \012  Toggle Print Recv Char         | Send received characters to
 \013  Turn on Print Recv Char        | the printer just as received
 \014  Turn off Print Recv Char       | with no editing

 \015  Toggle Media Copy              | Similar to ANSI Media Copy - Printer
 \016  Turn on Media Copy             | Controller on/off however if turned on
 \017  Turn off Media Copy            | with this rtn then must turn off too.

 \023  Toggle Auto-print              | Simulates <CSI>?5i (on); <CSI>?4i (off)
 \024  Turn on Auto-print             | If on, then print each line as cursor is
 \025  Turn off Auto-print            | about to move to next line. 

------ CONNECT MODE INTERACTIVE ROUTINES

 \007  Send Break                     |  275 ms Break
 \010  Send Break (long)              | 2000 ms Break (2 sec)

 \031  Toggle Monitor Mode (debug)    | Monitor mode (Debug) shows transmitted
 \032  Turn on Monitor Mode (debug)   | and received characters and escapes.
 \033  Turn off Monitor Mode (debug)  | Rcvd=norm video;Xmit=rev video

 \061  Connect mode Help (menu)       | Allows selection of functions below:
 \070  Define Hot Key - Spl Function  | Set any key to a special function
 \071  Define Hot Key - Ascii String  | Set any key to an Ascii string (255 max)
 \072  Show all Key Definitions       | See definitions in priority sequence
 \073  Show Special Status            | View current emulator status/settings
 \104  Show Diagnostics & Internals   | Current internal variables shown

 \062  Kermit Close (Prompt)          | same as hitting kermit escape-char + C
 \063  Kermit Command Menu            | same as hitting kermit escape-char + ?
 \064  Kermit Push to DOS             | same as hitting kermit escape-char + P
 \065  Kermit Quit Logging            | if logging and  on: then quits log
 \066  Kermit Resume Logging          | if logging and off: then resumes log
 \067  Kermit Exit to MS-DOS          | simulates a escape-char + c + exit + cr
 \074  Kermit Status                  | same as hitting kermit escape-char + S

 \075  Hold-Screen (soft) Xon/Xoff    | Simulates hold screen w/xon/xoff + Lite

 \076  Toggle the UDK Lock            | Allows the UDK lock to be set/reset
 \077  Turn on (Lock) the UDK's       | externally (as in a VT220 set-up)
 \100  Turn off (Unlock) the UDK's    | current setting on special status

 \115  Toggle Loop-Back Mode          | This is same as doing both a line-
 \116  Turn on Loop-Back Mode         | monitor and Media copy (printer
 \117  Turn off Loop-Back Mode        | controller) at same time.


------ RAINBOW SET-UP ROUTINES

 \034  Toggle Screen Size (80/132)    |
 \035  Set Screen to 80 cols          | Same as SET-UP except it honors the
 \036  Set Screen to 132 cols         |        Save-Screen setting

 \037  Toggle Smooth Scroll           |
 \040  Turn on Smooth Scroll          | Same as SET-UP uses ANSI set/reset
 \041  Turn off Smooth Scroll         |

 \042  Toggle Screen Background       |
 \043  Screen Background Light        | Same as SET-UP uses ANSI set/reset
 \044  Screen Background Dark         |

 \045  Toggle Auto-repeat keys        |
 \046  Turn on Auto-repeat keys       | Same as SET-UP uses ANSI set/reset
 \047  Turn off Auto-repeat keys      |

 \050  Toggle US/UK Char Set          |
 \051  Set US as Char Set             | Same as SET-UP uses ANSI set/reset
 \052  Set UK as Char Set             | Does not change current only default

 \053  Toggle Auto-wrap               |
 \054  Turn on Auto-wrap              | Same as SET-UP uses ANSI set/reset
 \055  Turn off Auto-wrap             |

 \056  Toggle New-line Mode           |
 \057  Turn on New-line Mode          | Same as SET-UP uses ANSI set/reset
 \060  Turn off New-line Mode         |

 \122  Toggle Cursor Style (Und/Blk)  |
 \123  Set Cursor Style to Block      | Same as SET-UP direct firmware set
 \124  Set Cursor Style to Underline  |
 
------ RAW FILE (ASCII) TRANSMIT FUNCTIONS

 \120  Transmit File (Kermit.xmt)     | file is opened and sent to serial port
                                      | just as though it was keyed in. Note-
                                      | this procedure will honor the setting
                                      | of the Kermit EOF flag. If set to ctrl
                                      | Z it will stop when found, else entire
                                      | file is sent.  The user may key a ctrl
                                      | X to abort the transmission.
                                      
 \121  Set File Name for Raw Transmit | same as function from main help menu


1.11.4 Video Scroll Buffer Management

The scroll buffer  routines have been extensively re-worked and several features
and improvements have been made.


SIZE
        The maximum size of the video buffers has  been  increased  to 20 pages.
        That works out to 480 lines of up to 132 characters of text.  The memory
        is allocated on a line by line basis and required  changes to the memory
        allocation portion of 2.29 kermit.  This is caused by the fact that on a
        Rainbow  a  line  of  text  can be 132 characters long, which is  not  a
        multiple  of  a  MS-DOS  paragraph (16 bytes).  In order to maximize the
        screen memory  available,  the  characters (text) are kept separate from
        the video attributes  and  have a separate segment address.  This allows
        64K for text and  64K for attribute storage yielding 480 lines of screen
        memory.

     
SPEED
        Direct transfers from Video  Memory  to  the  scroll  buffers  has  been
        implemented.   This saves an  extra  transfer  through  an  intermediate
        memory buffer.  The direct transfer  is  used only during normal receive
        character processing, not for scroll-back processing.
        

ATTRIBUTES
        This  implementation  provides  for line attribute control  as  well  as
        character  video attributes.  This is done by  temporarily  storing  the
        line  attribute  in the high nibble of the first character of  a  line's
        video attribute.  The line attribute uses only 3 bits and the  character
        attribute uses only the low order 4 bits.
           

ACCURACY
        Every attempt  has  been  made  to  maintain  the  accuracy of the video
        scroll-back memory.  If you scroll back and then a character is received
        from the host the  emulator  restores  the  screen  to  the proper place
        before putting the received character  to  the  screen.    Split  screen
        (scrolling  regions)  are  also  handled as  well  as  the  origin  mode
        (absolute vs.  relative).
           

BUGS
        The Rainbows hardware and firmware are very complex and a number of bugs
        in v2.29 were  located  and fixed.  Smooth scroll coupled with auto-wrap
        was one problem which  has  been  corrected.    Apparently smooth scroll
        affects the ability of the  firmware  to  maintain its wrap-pending flag
        accurately if the previous line is still moving when a new line tries to
        auto-wrap.  The symptom of this problem  is  that multiple duplicate top
        lines are saved into scroll  memory  and  several  (more at slow scroll,
        less at fast scroll) characters which  should  have  wrapped  are  lost.
        Protection has also been added so the  scroll-back routines don't try to
        display lines they don't have.



1.11.5 Printer and Dump Support


Complete  support  for  all printer port functions has  been  included  in  this
version of the emulator.  The emulator now performs  all  of  the same functions
available through the Rainbow's "Terminal Mode" emulator.  This includes support
for the "PRINT EXTENT" and "PRINT TERM CHAR" which are settable  via  SET-UP  or
through host  software  (Ansi  SET/RESET  sequences).  In addition, the emulator
also supports the  VT100 line drawing character set so that garbage does not get
sent to the printer  port.  The method of implementation is the same as provided
by DEC in the firmware's  terminal  emulation  mode.    It has been tested using
video line monitors attached to the  Rainbow's  printer  port.  Video attributes
are also processed so the net result  is  an accurate representation of what was
on the screen at the time of the  print/dump  request.    The  Rainbow  emulator
assumes that the device attached to the printer port is a DEC compatible printer
and issues the appropiate Ansi/DEC escape and control sequences.   For printers,
the video attributes of bold and underline will come out if the printer supports
them.    The  reverse  and  blinking attributes, as well as the line  attributes
(double  hi/wide), are also sent;  however, most printers just ignore them.  The
screen dump to disk utilities have been integrated with the printer port support
so that the  same  results  are  obtained.  Dumping a complex screen to disk and
then "playing it back"  via the MS-DOS type command yields an exact duplicate of
the original screen. 

The following VT100 Ansi compatible sequences are supported:

Name                                   Mnemonic   Sequence
----                                   --------   --------

Print form feed on                     DECPFF     <ESC>[?18h
Print form feed off                    DECPFF     <ESC>[?18l

Print extent (Full screen)             DECPEX     <ESC>[?19h
Print extent (Scrolling region)        DECPEX     <ESC>[?19l 

Media copy (Enter auto print)          MC         <ESC>[?5i
Media Copy (Exit auto print)           MC         <ESC>[?4i

Media Copy (Enter printer controller)  MC         <ESC>[5i
Media Copy (Exit printer controller)   MC         <ESC>[4i

Media Copy (Print screen)              MC         <ESC>[i or <ESC>[1i 

Media Copy (Print cursor line)         MC         <ESC>[?i or <ESC>[?1i

notes:
    1. The DECPFF and DECPEX sequences are used in MC (Print Screen) only.
    2. Except for using DECPFF and DECPEX the Kermit Special Function "\000
       Print Screen" is the same as MC (Print screen).
    3. Kermit Special Function "\023,\024,\025 Auto-print" duplicate the Ansi
       compatible MC (Enter/Exit auto print) sequences.
    4. Kermit Special Function "\011 Print Current Line" is the same as the    
       Media Copy (Print cursor line).
    5. Kermit Special Functions "\015,\016,\017 Media Copy" are similar to the  
       Media Copy (Enter/Exit printer controller).    The one difference is that
       if you use the Kermit function to "Enter", you must also use it to "Exit"
       printer controller mode.  This is to  allow  all  characters (including a
       possible Media Copy (exit printer controller) sequence) to  be  routed to
       the printer port.  The Kermit Special Function "Media  Copy"  can be used
       to  turn  off  a  host  generated  media copy (enter printer  controller)
       sequence.
    6. Auto-print means that the line will be printed immediately before the   
       cursor moves off the current line.
    7. Printer-controller means that all characters (except x-on/x-off,nulls,
       DEL's, and <ESC>[?4i MC (exit printer controller)) will be passed 
       without interpretation to the printer port.


1.11.6 Connect Mode Interactive Help

The general form of this routine is a menu which  allows  a  selection  of  five
different  functions.   Each function is a completly independent  routine  which
can be assigned  individually to a key if desired.  All routines overlay the top
15 lines of the  current  video  display  in reverse video and completly restore
them  when finished.  The  bottom  line  is  always  high-lighted  and  contains
instructions for the current function.



1. display......


             M A I N   H E L P   M E N U




Select a Function:


             ---->  Show all Key Definitions


                    Set Interactive Hot Key to Special Function


                    Set Interactive Hot Key to an Ascii String


                    Show Special Interactive Status


                    Show Kermit Diagnostics and Internals


                    Set File Name for Raw Transmit




-------------------------------------------------------------------------------
 <Select>/<Return> to SELECT; Up-arrow/Down-arrow to MOVE; space/<Exit> to EXIT
-------------------------------------------------------------------------------




note - Only  the arrow keys are used by  this routine;  however, the  cursor  is
       circular  in  nature  and  if positioned at the bottom item a  down-arrow
       causes it to go to the top.  If at the top  and  up-arrow then it goes to
       the bottom.  When called the first time the arrow cursor is placed at the
       top menu selection;    however,  after  the  first  call  the  cursor  is
       re-positioned to the last  menu  item  selected.  It should be noted that
       this routine is selectable as  a  special function itself, as well as its
       five individual components.


1.11.6 Connect Mode Interactive Help (continued).......


                           Show all Key Definitions
                           ------------------------


        --------------------------
        VT-220 UDK Key Definitions   
        --------------------------
   There are no Key Definitions for this Type        
                   or
    Shift/F9-Main Screen ==> [...........]             
               F7-Resume ==> [...........] 
                             [...........] .. etc.

    
        --------------------------
        "Hot Keys" Key Definitions   
        --------------------------
   There are no Key Definitions for this Type        
                   or
    Shift/F9-Main Screen ==> [...........]             
              Keypad PF1 ==> [...........] 
                             [...........] .. etc.

    
        -------------------------
        Kermit Set Key Definitions   
        --------------------------
   There are no Key Definitions for this Type        
                   or
    Shift/F9-Main Screen ==> [...........]             
              Keypad PF1 ==> [...........] 
                             [...........] .. etc.

    
        --------------------------
        Kermit Funtion Assignments 
        --------------------------
    There are no Key Definitions for this Type        
                   or
         F2-Print Screen ==> [...........]             
             Prev Screen ==> [...........] 
        Ctrl/Prev Screen ==> [...........] .. etc.



-------------------------------------------------------------------------------
  Space or <Exit> to EXIT; <Prev>/<Next> Screen or Up-arrow/Down-arrow to PAGE
-------------------------------------------------------------------------------


note - The key definitions are displayed in the priority sequence that they will
       be processed.  The routine formats all  definitions  into pages and these
       pages are what you have control over viewing.    The up-arrow/prev-screen
       keys  give  backward  paging  and  the  down-arrow/next-screen keys allow
       forward paging.  The top of the display has a  message  telling that it's
       on Page x of n Pages.


                     Set Interactive Hot Key to Special Function
                     -------------------------------------------

1. prompt....  Press the Key you want to Define


2. display...  Shift/Ctrl/Keypad PF3 or other description depending on

                                              which key is pressed
3. then display.....


This Key Currently has No Definitions
             or
This Key Currently Defined as Follows:

     As a VT220 UDK key ---> [....................key...................
    As a "Hot Keys" key ---> .................definitions...............
  As a Set Key type key ---> ..................displayed................
 As Kermit Function key ---> ....................here..................]


4. then show function menu......


Select a Function:
                   [..........allowable................
                   ...........functions................
            --->   ...........displayed................
                   .............here...................
                   ....................................]


-------------------------------------------------------------------------------
Use: up/dwn Arrows, Prv/Nxt Scrn to Move; cr or Select to Pick; Cancel to Quit
-------------------------------------------------------------------------------


note- The display size is limited,  so  a  best  effort  attempt    is  made  at
      displaying  the  current  definitions for the selected key.  If the screen
      will overflow a message is displayed and after hitting any key the routine
      resumes with a  limited  area  for  showing function choices.  The minimum
      area is one line.    The  arrow  keys  operate  a line at a time while the
      next/prev screen keys move whatever  is  the  current  display depth.  The
      function menu does not wrap-around but  will sound a beep if you try to go
      above the top or past the bottom. 
      


1.11.6 Connect Mode Interactive Help (continued).......


                      Set Interactive Hot Key to an Ascii String
                      ------------------------------------------


1. prompt....  Press the Key you want to Define


2. display...  Shift/Ctrl/Keypad PF3 or other description depending on

                                              which key is pressed
3. then display.....


This Key Currently has No Definitions
             or
This Key Currently Defined as Follows:

     As a VT220 UDK key ---> [....................key...................
    As a "Hot Keys" key ---> .................definitions...............
  As a Set Key type key ---> ..................displayed................
 As Kermit Function key ---> ....................here..................]


4. then allow string entry.........


  Enter Key Definition ----> [........... enter definition.....................
                             ..................................................
                             ................................................]



-------------------------------------------------------------------------------
Use: <X] to ERASE; Ctrl-alpha key for CTL-CHAR; <Exit> to END; <Cancel> to QUIT
-------------------------------------------------------------------------------


note- The display size is limited so a best effort attempt is made at displaying
      the current definitions for the selected key.  If the screen will overflow
      a message is displayed and after hitting  any key the routine resumes with
      a limited area for a new definition.   If  you  exceed  the new definition
      area the key strokes are still being recorded but  do  not  display.   the
      maximium length of any single key definition is 255 characters.    If  you
      exceed that, the routine beeps until you hit <exit>, <cancel> or <X].  Any
      control characters entered will be high-lighted as a bright character.
      


                       Show Special Interactive Status
                       -------------------------------

1. sample display......

LEFT SIDE:

      Default Ascii Character set : US,UK or VT100
         Current G0 Character set : US,UK or VT100
         Current G1 Character set : US,UK or VT100
        Shift In/Shift Out Status : SI or SO
          Auto-repeat Keys Status : Off or On
        Caps Lock Function Status : Caps or Shift
                    New Line Mode : CR or CR/LF
                   Auto-wrap Mode : Off or On
           Print Termination Char : None or FF
              Print Screen Extent : Scroll or Full
        Save Screen (80/132) Mode : Off or On
            Kermit Logging Status : Off or On
            VT220 UDK Lock Status : Locked or Unlocked




RIGHT SIDE:

      Terminal Type (responds as) : VT102-d,VT52-h,VT52,VT102,VT220,VT125,VT100
          Firmware Emulation Mode : VT52 or Ansi
                   Eight Bit Mode : Off or On
          Auto-Xon (connect) Mode : Off or On
                 Function Keys as : VT100+ or VT220
         Kermit Special Functions : Enabled or Disabled
       Line Monitor (Port B) Mode : Off or On
          Media Copy (controller) : Off or On
         Auto-print (line) Status : Off or On
           Print Recvd Characters : Off or On
      Monitor Mode (debug) Status : Off or On
       Monitor Mode Display Style : Print or Video
          Insert/Replacement Mode : Replace or Insert



-------------------------------------------------------------------------------
                 --------- Hit Any Key to Exit ---------  
-------------------------------------------------------------------------------

This display provides additional information about the current (dynamic)  status
of the Rainbow emulator.  This data is found in  software  switches  within  the
emulator  or in high memory (NVM and Video) which is accessed  by  the  built-in
ROM firmware.



                    Show Kermit Diagnostics and Internals
                    -------------------------------------

1. sample display......

Scroll Buffers: Total Lines = 480 (20 Screens) Current: Top = 342  Bottom = 0

Key Buffers---: #Max #Now  Max Used Avail   Diagnostics:
   VT220 Keys :   48    0 1024    0  1024     Wait for Transmitter (X32)... 148
     Hot Keys :   50    0  512    0   512     Receive Timeout (.rtime)..... 0
     Set Keys :  200    8  400   63   337     Sent Chars Buffered.......... 0
                                              Receive Error (framing)...... 0
     Com Line :  Sent  Rcvd  Typd  ChlB       Chan B (printer) receive..... 0
         X-On :     6     2     0     0       Receive Buffer Over-flow..... 0
        X-Off :     6     5     0     0       Receive Parity Error......... 0
                                              Channel B Buffer Over-flow... 0
 Scroll Region: 1;24 Origin Mode is Absolute 

-------------------------------------------------------------------------------
    <Cancel> key to Reset the Diagnostics - Any other Key to Exit
-------------------------------------------------------------------------------

The <Cancel> key will reset the Com Line  (xon/xoff  counts)  as well as all the
diagnostic  variables.   Most  of  the  information  is  obvious;  however,  the
diagnostics need some further explanation:

Line 1- Wait for Transmitter (X32)...
        The count of the  number of retries required in the software controlling
        the transmission of characters on  port A.  It is actually the number of
        times the software looped (divided by  32)  waiting  for  the tranmitter
        ready bit to come on.  A  high  number  indicates  that  the emulator is
        spending time waiting to transmit.
Line 2- Receive Timeout (.rtime).....
        Can only happen during file tranfer, not in terminal mode.  It indicates
        the  host  has  x-off'ed us and the kermit receive timeout interval  has
        expired  without  being  x-on'ed  by  the  host.    In terminal mode the
        software buffers  the  remaining  transmittable  characters in a special
        circular output buffer.  (see next line)
Line 3- Sent Chars Buffered..........
        Count of the  total  number  of  characters  routed  through the special
        output circular buffer.   Host  x-off  is  not  the only reason we route
        through this buffer.  Special care is given not to over-run a host input
        buffer and so if the receive buffer exceeds a certain threshold we route
        through  the  circular  buffer.    In  addition    a   timing  delay  of
        approximately  3  mili-seconds  is  introduced  between  characters when
        transmitting either from the buffer or sending long strings.
Line 4- Receive Error (framing)......
        Indicates a framing or parity (hardware) error.  Usually caused by mis-
        matched speeds between the Rainbow and Host.
Line 5- Chan B (printer) receive.....
        Indicates character traffic from printer port back to MS-DOS.
Line 6- Receive Buffer Over-flow.....
        Over-run of receive buffer caused by host not responding to X-off.
Line 7- Receive Parity Error.........
        A software parity  error  detected; most  likely  caused  by a mis-match
        between Host and Kermit's parity settings.
Line 8- Channel  B  Buffer  Over-flow...
        Indicates a buffer over-flow in line-monitor mode.   Most  likely caused
        by the device on the printer port (B) not responding  to X-off.
 


                              Set File Name for Raw Transmit
                              ------------------------------       

1. display.........


          Current    |-------------------------------------------------------|
         File Name:  | Kermit.xmt                                            |
                     |-------------------------------------------------------|




                     |-------------------------------------------------------|
 Enter File Name --> |                                                       |
                     |-------------------------------------------------------|

             Note: Enter Drive and/or Full Path Name to specify a file not in
                   the Current Path (default or set by "CWD").




------------------------------------------------------------------------------
           Use:  <X] to Erase;   <Exit> to End;    <Cancel> to Quit
------------------------------------------------------------------------------






2. Instructions:
                 Type in a new file name. Do not end with a <CR>, instead use
                 the <Exit> key. If the file can be located by DOS the following
                 message is shown and the current name is updated.
                 
                         *** A New Current File Name has been Selected ***
                 
                 If the file is invalid the following message is shown and the
                 old name remains unchanged.
                 
                        Can Not Find File using the Current Path 


1.11.7 Improvements and Bug Fixes

   THE FOLLOWING IS A SUMMARY OF CHANGES MADE TO V2.29 of Kermit-MS

Interrupt Service Routines
        The interrupt service routine have been completly re-written and tested.
        Several  problems  with flow-control (xon/xoff) have been corrected.  If
        the transmitter  is  being held (host sent x-off) it is correct protocol
        to still send  x-off  to  the  host  if the transmitter's receive buffer
        fills or if the  user  types  a  x-off.    Another  problem was that the
        receive buffer hi-water mark is  detected  within  the interrupt service
        routine and it is not appropiate  for the ISS to use an external routine
        to send a x-off (OUTCHR).    This  version sends the x-off directly from
        within the interrupt service routine.   In addition to a hi-water point,
        this version implements a lo-water mark too.  This prevents the receiver
        from x-on'ing the host too soon and improves  throughput.    Support was
        added so that Kermit can optionally control the printer  port interrupts
        (see Line-monitor mode).  A transmit circular buffer was added  so  that
        the routine does not hang on transmission of long character strings.   A
        problem  was  caused  by  the  host x-off'ing before the string had been
        completly sent.  Transmission  of  buffered  characters  was also slowed
        down (terminal mode only) so as not to over-run a host's buffer control.
        
Monitor Mode
        Monitor mode uses video attributes to distinguish  between various modes
        of operation.  In general the following apply:

         NORMAL   - Received Characters                      
         BRITE    - Parsed escape and control sequences    
        
         REVERSE  - Transmitted Characters 
         BRITE    - Control Characters (Ascii col 0,1,8 and 9)
         UNDERLINE- Buffered in circular transmit buffer
         BLINKING - Trapped in Level 2 firmware buffer (response to report
                                                        cursor position) 
       
        In addition to characters received/transmitted, monitor mode also  shows
        X-on's and X-off's received or transmitted.  Monitor mode  causes only a
        slight  decrease in throughput as measured by the number of  x-on's  and
        x-off's  received and sent.  This is due to direct manipulation  of  the
        video  attribute  byte in the firmware rather than using Ansi sequences.
        Most escape and control sequences are not actually done in monitor mode;
        however, as a convience some are (eg.  UDK download). 
        
Escape and Control Sequences
        The emulator now  has  a  complete  Ansi escape/control parser which has
        been modeled after the Rainbow's own terminal emulation.  The DEC manual
        "Rainbow 100+/100B Terminal Emulation Manual  QV069-GZ"  was the primary
        source for most of the design.    Although  all escape,control sequences
        and device control sequences are parsed, most  are  simply passed to the
        system firmware for actual exectuion.  If monitor mode has been invoked,
        this  process  is  different.    In that case most  sequences  are  just
        displayed and not sent to the firmware.  There are  some  exceptions  to
        this  rule,  especially  those sequences handled by the emulator itself.
        An example  is  the VT220 UDK device control string which is handled the
        same in monitor  mode  as  in regular terminal mode.  Another example is
        the  emulator's handling of  the  "Device  Attributes  (what  are  you)"
        request.  In addition, those  sequences  which  set internal translation
        flags such as "set keypad to application mode" work in monitor mode.  In
        general, functions which effect the key translation modes execute, while
        those  that  effect  the  screen  display  (cursor  position,    graphic
        rendition, etc) do not execute in monitor mode.

Video Attributes
        In order to  improve  VT220  compatibility,  the  video  attributes  are
        handled by  the  emulator directly.  This has allowed the support of the
        following additions to  the  "select graphic rendition" sequences:

    (SGR) <ESC>[Ps;Ps....m       
    
                Ps = 22 Display normal intensity (bold off)
                   = 24 Display not underline (underline off)
                   = 25 Display not blinking (blinking off)
                   = 27 Display positive image (reverse off)

Emulation of VT2xx specific sequences
        The Rainbow uses firmware to support a "VT100 console" and so extensions
        to the sequences recognized by  the  emulator  must  be  implemented  in
        software.  The following VT2xx sequences have been implemented:
        
   (ICH) Insert Characters - <CSI> Pn @ 
         Insert Pn blank characters at the cursor position, with  the  character
         attributes set to normal.  The cursor does not move  and remains at the
         beginning  of  the  inserted blank characters.  A parameter of 0  or  1
         causes one blank character to be inserted.  Data on the line is shifted
         forward as in character insertion.

   (ECH) Erase Character - <CSI> Pn X
         Erases characters at the cursor position  and  the next n-1 characters.
         A  parameter  of  0  or 1 causes  a  single  character  to  be  erased.
         Character attributes are set to normal.  No reformatting of data on the
         line occurs.  The cursor remains in the same position.
        
(DECSCA) Select Character Attributes - <CSI> Ps " q
         Select  all  subsequent  characters to be "selective erasable" or  "not
         selective erasable".
            Ps = 0 All attributes off (does not apply to SGR)
               = 1 Designate character as "non-erasable" by DECSEL/DECSED
                   (attribute on)
               = 2 Designate character "erasable" by DECSEL/DECSED
                   (attribute off)
                   
(DECSEL) Selective Erase in Line - <CSI> ? Ps K
         Similar  to  "Erase  in  line  (EL)" except "erasable" characters only.
         Does not effect video line attributes or video character attributes.

            Ps = 0 or null Erases all "erasable" characters (DECSCA) from cursor
                   to the end of line.  
               = 1 Erases all "erasables" from beginning of line up to and 
                   including the current cursor position.
               = 2 Erases all "erasables" on the current line.

(DECSED) Selective Erase in Display - <CSI> ? Ps J
         Similar  to  "Erase in display (ED)" except "erasable" characters only.
         Does not effect video line attributes or video character attributes.

            Ps = 0 or null Erases all "erasable" characters (DECSCA) from cursor
                   to the end of display.  
               = 1 Erases all "erasables" from beginning of display up to and 
                   including the current cursor position.
               = 2 Erases all "erasables" on the current display.
            
(DECTCEM) Text Cursor Enable Mode - <CSI>?25h (Set) -or- <CSI>?25l (Reset)   
          Set   ( <CSI>?25h ) causes the cursor to be visible. 
          Reset ( <CSI>?25l ) causes the cursor to not be visible. 


1.11.8 Cautions and Future Enhancements

Rainbow and the VAX
        This version  has  been  tested  and  run under VAX/VMS V4.4 and several
        problems are known.    In particular, using a port connected via a DMF32
        adapter using the SYSGEN  defaults  causes  strange  side  effects  when
        transmitting long character strings.   The DMF32 has a silo for received
        characters and a time-out parameter which  is  intended  to minimize CPU
        interrupts.  The time-out allows a minimum time to elapse before posting
        an interrupt and if transmitting at a fast  rate (eg.  9600 baud) from a
        program such as Kermit, several characters accumulate in the silo before
        the CPU is notified.  The standard type-ahead buffer in  VMS  is  set to
        send  x-off  when  less  than  8 bytes remain in the type-ahead  buffer;
        unfortunately  the DMF32 silo can have more than enough to cause a  data
        over-run.    Another problem is that the DMF32 has a speed error of  +5%
        when  set  to  19,200 baud.  The Rainbow on the other hand uses a  Intel
        8274 multi-protocol serial controller  with  an  error  rate  of  -3% at
        19,200 baud.  The combined  effect  of these speed differences makes VAX
        to Rainbow communications at 19,200 baud  impossible.  This emulator was
        tested at 19,200 baud with VMS by telling the terminal  driver in VMS to
        send  two  stop bits instead of one.  As of now,  there  is  no  way  of
        "locking"  this into the driver and any VMS request (even SHOW TERMINAL)
        to the driver resets the stop bits to "normal". 

Additional Special Functions
        The process of adding additional special functions  to  the  emulator is
        relatively easy.  Addition of a routine to  "raw  transmit"  a  file  is
        already underway.  Most of the features required for such a function are
        already  in this emulator (ie.  circular transmit buffer).   It  may  be
        useful to have a function to reset the terminal to some sort of standard
        conditions (as in VT220 reset function).

VT52 mode
        No  attempt  has  been made to operate the emulator in "true" VT52 mode.
        This means that the emulator acts like a VT1xx/VT2xx emulator regardless
        of the current firmware  emulation  mode  (VT52/ANSI).   If however, the
        firmware mode is set to  VT52,  then some VT1xx/VT2xx sequences won't be
        recognized by the firmware.  Best  advice  is to run as a VT1xx/VT2xx if
        at all possible.

Appendix A - VAX Basic example program to load and lock the VT220 UDK's   pg A-1


10      !
        external string function asc.hex

        declare word j

        declare string constant dcs      = esc + "P" 
        declare string constant st       = esc + "\"
        declare string constant start_it = dcs + "1,1|"
        declare string constant clear_it = dcs + "0;1|" + st

        declare word constant max_keys = 48
        
        dim Keys$(max_keys), Udef$(max_keys)

        !
        ! shift/key F6 - Interrupt
        !
        keys$(1)="17"\udef$(1)=""

        !
        ! shift/key F7 - Resume
        !
        keys$(2)="18"\udef$(2)=""

        !
        ! shift/key F8 - Cancel
        !
        keys$(3)="19"\udef$(3)=""

        !
        ! shift/key F9 - Main Screen
        !
        keys$(4)="20"\udef$(4)=""

        !
        ! shift/key F10 - Exit
        !
        keys$(5)="21"\udef$(5)=""

        !
        ! shift/key F11 - (ESC) VT220 function keys only
        !
        keys$(6)="23"\udef$(6)=""

        !
        ! shift/key F12 - (BS) VT220 function keys only
        !
        keys$(7)="24"\udef$(7)=""

        !
        ! shift/key F13 - (LF) VT220 function keys only
        !
        keys$(8)="25"\udef$(8)=""

        !
        ! shift/key F14 - Addtnl Options
        !
        keys$(9)="26"\udef$(9)=""

        !
        ! shift/key F15 - Help
        !
        keys$(10)="28"\udef$(10)=""

        !
        ! shift/key F16 - Do
        !
        keys$(11)="29"\udef$(11)=""

        !
        ! shift/key F17 -
        !
        keys$(12)="31"\udef$(12)=""

        !
        ! shift/key F18 -
        !
        keys$(13)="32"\udef$(13)=""

        !
        ! shift/key F19 -
        !
        keys$(14)="33"\udef$(14)=""

        !
        ! shift/key F20 -
        !
        keys$(15)="34"\udef$(15)=""

        !
        ! shift/key Find
        !
        keys$(16)="01"\udef$(16)=""

        !
        ! shift/key Insert Here
        !
        keys$(17)="02"\udef$(17)=""

        !
        ! shift/key Remove
        !
        keys$(18)="03"\udef$(18)=""

        !
        ! shift/key Select
        !
        keys$(19)="04"\udef$(19)=""

        !
        ! shift/key Prev Screen
        !
        keys$(20)="05"\udef$(20)=""

        !
        ! shift/key Next Screen
        !
        keys$(21)="06"\udef$(21)=""

        !
        ! shift/key F11 - (ESC) VT100 function keys only
        !
        keys$(22)="07"\udef$(22)=""

        !
        ! shift/key F12 - (BS) VT100 function keys only
        !
        keys$(23)="08"\udef$(23)=""

        !
        ! shift/key F13 - (LF) VT100 function keys only
        !
        keys$(24)="09"\udef$(24)=""

        !
        ! key F6 - Interrupt
        !
        keys$(25)="57"\udef$(25)=""

        !
        ! key F7 - Resume
        !
        keys$(26)="58"\udef$(26)=""

        !
        ! key F8 - Cancel
        !
        keys$(27)="59"\udef$(27)=""

        !
        ! key F9 - Main Screen
        !
        keys$(28)="60"\udef$(28)=""

        !
        ! key F10 - Exit
        !
        keys$(29)="61"\udef$(29)=""

        !
        ! key F11 - (ESC) VT220 function keys only
        !
        keys$(30)="63"\udef$(30)=""

        !
        ! key F12 - (BS) VT220 function keys only
        !
        keys$(31)="64"\udef$(31)=""

        !
        ! key F13 - (LF) VT220 function keys only
        !
        keys$(32)="65"\udef$(32)=""

        !
        ! key F14 - Addtnl Options
        !
        keys$(33)="66"\udef$(33)=""

        !
        ! key F15 - Help
        !
        keys$(34)="68"\udef$(34)=""

        !
        ! key F16 - Do
        !
        keys$(35)="69"\udef$(35)=""

        !
        ! key F17 -
        !
        keys$(36)="71"\udef$(36)=""

        !
        ! key F18 -
        !
        keys$(37)="72"\udef$(37)=""

        !
        ! key F19 -
        !
        keys$(38)="73"\udef$(38)=""

        !
        ! key F20 -
        !
        keys$(39)="74"\udef$(39)=""

        !
        ! key Find
        !
        keys$(40)="41"\udef$(40)=""

        !
        ! key Inser Here
        !
        keys$(41)="42"\udef$(41)=""

        !
        ! key Remove
        !
        keys$(42)="43"\udef$(42)=""

        !
        ! key Select
        !
        keys$(43)="44"\udef$(43)=""

        !
        ! key Prev Screen
        !
        keys$(44)="45"\udef$(44)=""

        !
        ! key Next Screen
        !
        keys$(45)="46"\udef$(45)=""

        !
        ! key F11 - (ESC) VT100 function keys only
        !
        keys$(46)="47"\udef$(46)=""

        !
        ! key F12 - (BS) VT100 function keys only
        !
        keys$(47)="48"\udef$(47)=""

        !
        ! key F13 - (LF) VT100 function keys only
        !
        keys$(48)="49"\udef$(48)=""

        !
        ! Clear and unlock the UDK's "<ESC>P1;1|<ESC>\"
        !
        print clear_it;


        !
        ! Set any key which has data in the udef$ string associated with it.
        !
        for j = 1 to 48
          print start_it;keys$(j);"/";asc.hex(udef$(j));st; unless udef$(j)==""
        next j

        !
        ! Lock the keys against further re-definition and give sign-off
        !
        print dcs+"1|"+st;
        print "VT220 user defined keys have been reset and locked"

  end
20      !
   Function String Asc.hex (string a)
   Declare String ax,cx
   Declare Long sys_status,c,j,ml
   Declare Long Constant wid=2
   External Long Function Ots$cvt_l_tz (long,string,long by value,long by value)
        asc.hex=""
        ml=len(a)
          Functionexit if ml <= 0
        ax=""
         For j = 1 to ml
          cx="  "
          c=Ascii(seg$(a,j,j))
          sys_status=Ots$cvt_l_tz(c,cx,wid,wid)
          ax = ax+cx
         Next j
        asc.hex = ax
        Functionend


Appendix B -      Kermit Scan Codes for the DEC Rainbow                  pg B-1

                   .... Normal Scan codes ....   ... Special Scan codes ...
                    Key-                Shift     Key-                Shift
    Keyboard Key    code  Shift   Ctrl  +Ctrl     code  Shift   Ctrl  +Ctrl
    ------------    ----  -----   ----  -----     ----  -----   ----  -----
          Return      13    525   1037   1549     4109   4621   5133   5645
             Tab       9    521   1033   1545     4105   4617   5129   5641
           Space      32    544   1024   1536     4128   4640   5120   5632
      Delete <X]     127    639   1151   1663     4223   4735   5247   5759
               A      97    577   1025   1537     4193   4673   5121   5633
               B      98    578   1026   1538     4194   4674   5122   5634
               C      99    579   1027   1539     4195   4675   5123   5635
               D     100    580   1028   1540     4196   4676   5124   5636
               E     101    581   1029   1541     4197   4677   5125   5637
               F     102    582   1030   1542     4198   4678   5126   5638
               G     103    583   1031   1543     4199   4679   5127   5639
               H     104    584   1032   1544     4200   4680   5128   5640
               I     105    585   1033   1545     4201   4681   5129   5641
               J     106    586   1034   1546     4202   4682   5130   5642
               K     107    587   1035   1547     4203   4683   5131   5643
               L     108    588   1036   1548     4204   4684   5132   5644
               M     109    589   1037   1549     4205   4685   5133   5645
               N     110    590   1038   1550     4206   4686   5134   5646
               O     111    591   1039   1551     4207   4687   5135   5647
               P     112    592   1040   1552     4208   4688   5136   5648
               Q     113    593   1041   1553     4209   4689   5137   5649
               R     114    594   1042   1554     4210   4690   5138   5650
               S     115    595   1043   1555     4211   4691   5139   5651
               T     116    596   1044   1556     4212   4692   5140   5652
               U     117    597   1045   1557     4213   4693   5141   5653
               V     118    598   1046   1558     4214   4694   5142   5654
               W     119    599   1047   1559     4215   4695   5143   5655
               X     120    600   1048   1560     4216   4696   5144   5656
               Y     121    601   1049   1561     4217   4697   5145   5657
               Z     122    602   1050   1562     4218   4698   5146   5658
          ~ or `      96    638   1054   1566     4192   4734   5150   5662
          ! or 1      49    545                   4145   4641
          @ or 2      50    576   1024   1536     4146   4672   5120   5632
          # or 3      51    547   1051   1563     4147   4643   5147   5659
          $ or 4      52    548   1052   1564     4148   4644   5148   5660
          % or 5      53    549   1053   1565     4149   4645   5149   5661
          ^ or 6      54    606   1054   1566     4150   4702   5150   5662
          & or 7      55    550   1055   1567     4151   4646   5151   5663
          * or 8      56    554   1151   1663     4152   4650   5247   5759
          ( or 9      57    552                   4153   4648
          ) or 0      58    553                   4154   4649
          _ or -      45    607                   4141   4703
          + or =      61    555                   4157   4651
          { or [      91    635   1051   1563     4187   4731   5147   5659
          } or ]      93    637   1053   1565     4189   4733   5149   5661
          : or ;      59    570                   4155   4666
          " or '      39    546                   4135   4642
          | or \      92    636   1052   1564     4188   4732   5148   5660
          > or <      60    574                   4156   4670
          , or ,      44    556                   4140   4652
          . or .      46    558                   4142   4654
          ? or /      47    575   1055   1567     4143   4671   5151   5663

Appendix B -      Kermit Scan Codes for the DEC Rainbow                  pg B-2

                              ..Normal Scan codes..     ..Special Scan codes..
                              Key-             Shift    Key-             Shift
        Keyboard Key  Base    code Shift  Ctrl +Ctrl    code Shift  Ctrl +Ctrl
      --------------  ----    ---- -----  ---- -----    ---- -----  ---- -----
        Print Screen     3     259   771  1283  1795    4355  4867  5379  5891
                  F4     5     261   773  1285  1797    4357  4869  5381  5893
          F5 (Break)   101     357   869  1381  1893    4453  4965  5477  5989
      F6 (Interrupt)     7     263   775  1287  1799    4359  4871  5383  5895
         F7 (Resume)     9     265   777  1289  1801    4361  4873  5385  5897
         F8 (Cancel)    11     267   779  1291  1803    4363  4875  5387  5899
    F9 (Main Screen)    13     269   781  1293  1805    4365  4877  5389  5901
          F10 (Exit)    15     271   783  1295  1807    4367  4879  5391  5903
     F11 (ESC) VT100    27      27   539  1051  1563    4123  4635  5147  5659
      F12 (BS) VT100     8       8   520  1032  1544    4104  4616  5128  5640
      F13 (LF) VT100    10      10   522  1034  1546    4106  4618  5130  5642
F14 (Addtnl Options)    17     273   785  1297  1809    4369  4881  5393  5905
          F15 (Help)     0     256   768  1280  1792    4352  4864  5376  5888
            F16 (Do)     1     257   769  1281  1793    4353  4865  5377  5889
                 F17    19     275   787  1299  1811    4371  4883  5395  5907
                 F18    21     277   789  1301  1813    4373  4885  5397  5909
                 F19    23     279   791  1303  1815    4375  4887  5399  5911
                 F20    25     281   793  1305  1817    4377  4889  5401  5913
                Find    27     283   795  1307  1819    4379  4891  5403  5915
         Insert Here    29     285   797  1309  1821    4381  4893  5405  5917
              Remove    31     287   799  1311  1823    4383  4895  5407  5919
              Select    33     289   801  1313  1825    4385  4897  5409  5921
         Prev Screen    35     291   803  1315  1827    4387  4899  5411  5923
         Next Screen    37     293   805  1317  1829    4389  4901  5413  5925
            Up-Arrow    39     295   807  1319  1831    4391  4903  5415  5927
          Down-Arrow    41     297   809  1321  1833    4393  4905  5417  5929
         Right-Arrow    43     299   811  1323  1835    4395  4907  5419  5931
          Left-Arrow    45     301   813  1325  1837    4397  4909  5421  5933
            Keypad 0    47     303   815  1327  1839    4399  4911  5423  5935
            Keypad 1    50     306   818  1330  1842    4402  4914  5426  5938
            Keypad 2    53     309   821  1333  1845    4405  4917  5429  5941
            Keypad 3    56     312   824  1336  1848    4408  4920  5432  5944
            Keypad 4    59     315   827  1339  1851    4411  4923  5435  5947
            Keypad 5    62     318   830  1342  1854    4414  4926  5438  5950
            Keypad 6    65     321   833  1345  1857    4417  4929  5441  5953
            Keypad 7    68     324   836  1348  1860    4420  4932  5444  5956
            Keypad 8    71     327   839  1351  1863    4423  4935  5447  5959
            Keypad 9    74     330   842  1354  1866    4426  4938  5450  5962
         Keypad Dash    77     333   845  1357  1869    4429  4941  5453  5965
        Keypad Comma    80     336   848  1360  1872    4432  4944  5456  5968
       Keypad Period    83     339   851  1363  1875    4435  4947  5459  5971
        Keypad Enter    86     342   854  1366  1878    4438  4950  5462  5974
          Keypad PF1    89     345   857  1369  1881    4441  4953  5465  5977
          Keypad PF2    92     348   860  1372  1884    4444  4956  5468  5980
          Keypad PF3    95     351   863  1375  1887    4447  4959  5471  5983
          Keypad PF4    98     354   866  1378  1890    4450  4962  5474  5986

     F11 (ESC) VT200   104     360   872  1384  1896    4456  4968  5480  5992
      F12 (BS) VT200   107     363   875  1387  1899    4459  4971  5483  5995
      F13 (LF) VT200   110     366   878  1390  1902    4462  4974  5486  5998


Appendix C - Numerical list of Kermit Special Function Codes          Page C-1

            Octal                                                      
             Code   Special Function Routine Description            
            -----   ------------------------------------             
          
             \000   Print Screen                        
             \001   Dump Screen to Disk             
             \002   View Prev Screen (Scroll)       
             \003   View Next Screen (Scroll)       
             \004   View Prev Line (Scroll)         
             \005   View Next Line (Scroll)         
             \006   View Screen Bottom              
             \007   Send Break                      
             \010   Send Break (long)               
             \011   Print Current Line              
             \012   Toggle Print Recv Char          
             \013   Turn on Print Recv Char         
             \014   Turn off Print Recv Char        
             \015   Toggle Media Copy               
             \016   Turn on Media Copy              
             \017   Turn off Media Copy             
             \020   Toggle Eight-bit Mode           
             \021   Turn on Eight-bit Mode          
             \022   Turn off Eight-bit Mode         
             \023   Toggle Auto-print               
             \024   Turn on Auto-print              
             \025   Turn off Auto-print             
             \026   Toggle Save Screen (80/132)     
             \027   Turn on Save Screen (80/132)    
             \030   Turn off Save Screen (80/132)   
             \031   Toggle Monitor Mode (debug)     
             \032   Turn on Monitor Mode (debug)    
             \033   Turn off Monitor Mode (debug)   
             \034   Toggle Screen Size (80/132)     
             \035   Set Screen to 80 cols           
             \036   Set Screen to 132 cols          
             \037   Toggle Smooth Scroll            
             \040   Turn on Smooth Scroll           
             \041   Turn off Smooth Scroll          
             \042   Toggle Screen Background        
             \043   Screen Background Light         
             \044   Screen Background Dark          
             \045   Toggle Auto-repeat keys         
             \046   Turn on Auto-repeat keys        
             \047   Turn off Auto-repeat keys       
             \050   Toggle US/UK Char Set           
             \051   Set US as Char Set              
             \052   Set UK as Char Set              
             \053   Toggle Auto-wrap                
             \054   Turn on Auto-wrap               
             \055   Turn off Auto-wrap              
             \056   Toggle New-line Mode            
             \057   Turn on New-line Mode           
             \060   Turn off New-line Mode                        
             \061   Connect mode Help (menu)        
             \062   Kermit Close (Prompt)           
             \063   Kermit Command Menu             
             \064   Kermit Push to DOS              
             \065   Kermit Quit Logging             
             \066   Kermit Resume Logging           
             \067   Kermit Exit to MS-DOS           
             \070   Define Hot Key - Spl Function   
             \071   Define Hot Key - Ascii String   
             \072   Show all Key Definitions        
             \073   Show Special Status             
             \074   Kermit Status                   
             \075   Hold-Screen (soft) Xon/Xoff     
             \076   Toggle the UDK Lock             
             \077   Turn on (Lock) the UDK's        
             \100   Turn off (Unlock) the UDK's     
             \101   Toggle Line Monitor Mode        
             \102   Turn on Line Monitor Mode       
             \103   Turn off Line Monitor Mode      
             \104   Show Diagnostics & Internals    
             \105   Toggle Special Functions        
             \106   Special Functions Disabled      
             \107   Special Functions Enabled       
             \110   Toggle Function Key Mode        
             \111   Set Function Keys to VT220      
             \112   Set Function Keys to VT100      
             \113   Dump Screen + Memory to Disk    
             \114   Print Screen + Memory           
             \115   Toggle Loop-Back Mode           
             \116   Turn on Loop-Back Mode          
             \117   Turn off Loop-Back Mode         
             \120   Transmit File (Kermit.xmt)
             \121   Set File Name for Raw Transmit
             \122   Toggle Cursor Style (Und/Blk)
             \123   Set Cursor Style to Block
             \124   Set Cursor Style to Underline

Appendix D -      Kermit Pre-assigned (Hard-coded) Functions          Page D-1


                             BY KEY:

                              Octal
                Key Name      Code   Special Function Description
               ----------     ----   ----------------------------
  
               Print Screen   \000   Print Screen                      
        Ctrl / Print Screen   \012   Toggle Print Recv Char           

       Shift / F4             \064   Kermit Push to DOS               
        Ctrl / F4             \062   Kermit Close (Prompt)            
Shift / Ctrl / F4             \067   Kermit Exit to MS-DOS            

               F5-Break       \007   Send Break                        
        Ctrl / F5-Break       \010   Send Break (long)                

       Shift / F15-Help       \061   Connect mode Help (menu)         
        Ctrl / F15-Help       \063   Kermit Command Menu              
Shift / Ctrl / F15-Help       \031   Toggle Monitor Mode (debug)      

       Shift / F16-Do         \001   Dump Screen to Disk                
        Ctrl / F16-Do         \001   Dump Screen to Disk               

               Prev Screen    \002   View Prev Screen (Scroll)         
        Ctrl / Prev Screen    \004   View Prev Line (Scroll)            

               Next Screen    \003   View Next Screen (Scroll)         
       Shift / Next Screen    \006   View Screen Bottom                
        Ctrl / Next Screen    \005   View Next Line (Scroll)            

       Shift / Up-Arrow       \004   View Prev Line (Scroll)           
        Ctrl / Up-Arrow       \002   View Prev Screen (Scroll)          

       Shift / Down-Arrow     \005   View Next Line (Scroll)           
        Ctrl / Down-Arrow     \003   View Next Screen (Scroll)          

       Shift / Right-Arrow    \006   View Screen Bottom                 

       Shift / Keypad Enter   \000   Print Screen                      
        Ctrl / Keypad Enter   \012   Toggle Print Recv Char            

Appendix D -      Kermit Pre-assigned (Hard-coded) Functions          Page D-2


                           BY FUNCTION:

                             Octal
                Key Name      Code   Special Function Description
               ----------     ----   ----------------------------
  
               Prev Screen    \002   View Prev Screen (Scroll)         
        Ctrl / Up-Arrow       \002   View Prev Screen (Scroll)          

               Next Screen    \003   View Next Screen (Scroll)         
        Ctrl / Down-Arrow     \003   View Next Screen (Scroll)          

        Ctrl / Prev Screen    \004   View Prev Line (Scroll)            
       Shift / Up-Arrow       \004   View Prev Line (Scroll)           

        Ctrl / Next Screen    \005   View Next Line (Scroll)            
       Shift / Down-Arrow     \005   View Next Line (Scroll)           

       Shift / Next Screen    \006   View Screen Bottom                
       Shift / Right-Arrow    \006   View Screen Bottom                 

               Print Screen   \000   Print Screen                      
       Shift / Keypad Enter   \000   Print Screen                      

        Ctrl / Print Screen   \012   Toggle Print Recv Char           
        Ctrl / Keypad Enter   \012   Toggle Print Recv Char            

       Shift / F16-Do         \001   Dump Screen to Disk                
        Ctrl / F16-Do         \001   Dump Screen to Disk               

               F5-Break       \007   Send Break                        
        Ctrl / F5-Break       \010   Send Break (long)                

       Shift / F4             \064   Kermit Push to DOS               
        Ctrl / F4             \062   Kermit Close (Prompt)            
Shift / Ctrl / F4             \067   Kermit Exit to MS-DOS            
        Ctrl / F15-Help       \063   Kermit Command Menu              

       Shift / F15-Help       \061   Connect mode Help (menu)         

Shift / Ctrl / F15-Help       \031   Toggle Monitor Mode (debug)