














                                 L A P T A L K

                                       A
                                      Tiny
                               Telecommunications
                                    Program
                                      for
                                Laptop Computers

                                  Release: 2.1

                              Revised: 13-Dec-2007










                         Dunfield Development Services
                         -----------------------------
                             High quality tools for
                              Embedded Development
                                 at low prices.

                            http://www.dunfield.com


                       Copyright 1991-2007 Dave Dunfield
                              All rights reserved.



                              LAPTALK Users Guide

                               TABLE OF CONTENTS


                                                                         Page

     1. INTRODUCTION                                                        1


     2. USING LAPTALK                                                       2

        2.1 Command Line Options                                            2
        2.2 LAPTALK Functions                                               2
        2.3 Function menu                                                   3
        2.4 Download file                                                   3
        2.5 Upload file                                                     3
        2.6 Kill capture                                                    3
        2.7 Perform script                                                  3
        2.8 Break signal                                                    4
        2.9 Hangup modem                                                    4
        2.10 Reset terminal                                                 4
        2.11 Clear screen                                                   4
        2.12 Configuration                                                  4
        2.13 Shell to DOS                                                   4
        2.14 Exit to DOS                                                    4

     3. CONFIGURATION                                                       5

        3.1 General switches                                                5
        3.2 General parameters                                              8
        3.3 Serial port settings                                            9
        3.4 Transfer protocols                                              9
        3.5 Tab stops                                                      10
        3.6 Function keys                                                  10
        3.7 Function menu scripts                                          11
        3.8 Video attributes                                               12
        3.9 Keyboard mapping                                               13
        3.10 Load configuration                                            14
        3.11 Save configuration                                            14

     4. FILE TRANSFER PROTOCOLS                                            15

        4.1 Configuration                                                  15
        4.2 The XMODEM module                                              16
        4.3 Examples                                                       16

     5. SCRIPT INTERPRETER                                                 17

        5.1 Insert Codes                                                   17
        5.2 Script File Commands                                           18
        5.3 Fast Access Scripts                                            23

     6. TERMINAL CONTROL CODES                                             24

    LAPTALK Users Guide                                    Table of Contents

                                                                         Page
     7. VGA FONT EDITOR                                                    27


     8. VT-100 TEST UTILITY                                                28

    LAPTALK Users Guide                                              Page: 1


    1. INTRODUCTION

          I first conceived of LAPTALK when I did a great deal of  traveling
       with a small 8088 dual-floppy (no hard disk) laptop computer. Being a
       shareware author, I try to log into local BBS's wherever I travel, to
       upload the latest versions of my software.

          Some of my archives are quite large,  requiring up to 1/2 hour  to
       transfer  (at 2400 bps).  Using the floppies was unacceptable,  since
       the drives just sat  there  starting  and  stopping....  The  obvious
       solution  was  to  define  a  RAMdisk,  allowing  smooth,  quiet  and
       non-destructive operation.

          Then I ran into a small problem....  The telecomm  packages  which
       contained the features I used were all very large,  typically 200-300
       Kbytes in size.  This not only used up a good portion of the 640K ram
       on my laptop  (thereby reducing the size of my RAMdisk),  but it took
       lot of space on the 720K floppy drive,  and  took  FOREVER  to  load.
       There just had to be a better solution...

          I decided to write my own very small "no frills" terminal program,
       which would still have the features I needed, which were:

          1) Reasonable subset of ANSI (VT100) terminal emulation
          2) Built in capture and upload of ASCII files.
          3) Ability to link to external transfer protocols
          4) Powerful "command" language to automate uploads etc.
          5) A simple "host" capability for remote access.

          The results  of  my  effort  was  LAPTALK,  a  ".COM"  file  which
       addresses the above requirements and more,  and weighs  in  at  under
       20K.

          The complete source code to LAPTALK is distributed with my MICRO-C
       compiler as an example program.

       Dunfield Development Systems offers complete low cost  C  development
       packages for many different 8 and 16 bit embedded processors, as well
       as other related development software tools.  For  more  information,
       please contact:

                         Dunfield Development Services
         115 Manion Heights Cres.   RR#2 Carp, Ontario Canada   K0A 1L0
         http://wwww.dunfield.com                     FAX: 613-256-5821
    LAPTALK Users Guide                                              Page: 2


    2. USING LAPTALK

          When you first run LAPTALK,  it will  attempt  to  open  the  file
       LAPTALK.CFG in your current directory.  If found,  it will  read  its
       configuration from it.  If  the  configuration  file  is  not  found,
       LAPTALK will display a warning message, and assume various defaults.

          Once started,  LAPTALK will present you with a terminal  emulation
       screen.  The top 24 lines are the actual data window,  and  the  25th
       line is a status line.  You may now type on the keyboard to send data
       to the serial port,  and see  any  incomming  data  in  the  terminal
       window.

       2.1 Command Line Options

             The format of the LAPTALK command line is:

                LAPTALK [-i c=file f=file] [script [arguments]]

             The  '-i'  switch tells LAPTALK to  NOT  enter  an  interactive
          session.  This is most useful when used with a command line script
          file,  so that control will return  to  DOS  when  the  script  is
          finished.

             The  'c=<file>'  parameter allows you to  specify  a  different
          configuration file which is to be  used  instead  of  the  default
          "LAPTALK.CFG".

             The 'f=<file>'  parameter allows you to load a different custom
          VGA  font  file.  Note  that  the  "Use  VT-100  character   font"
          configuration option must be enabled for this to have any effect.

             If [script] is given, LAPTALK will execute the named script and
          pass it any additional  [arguments]  BEFORE the  main  interactive
          mode is entered.

       2.2 LAPTALK Functions

             To access LAPTALK's functions, press CTRL-HOME or CTRL-END. You
          will be presented with this menu:

                                +--------------+
                                |Function menu |
                                |Download file |
                                |Upload file   |
                                |Kill capture  |
                                |Perform script|
                                |Break signal  |
                                |Hangup modem  |
                                |Reset terminal|
                                |Clear screen  |
                                |Configuration |
                                |Shell to DOS  |
                                |Exit to DOS   |
                                +--------------+
    LAPTALK Users Guide                                              Page: 3


             You may activate a function by moving the hilighted cursor  bar
          to it  (with the UP and DOWN arrow keys)  and pressing  ENTER.  To
          quickly move the cursor bar to a particular entry,  type the first
          letter of the entry.

       2.3 Function menu

             This function presents you with a list of "functions" that have
          been configured.  Each function represents  a  "script"  (command)
          file, complete with arguments, that will run when that function is
          selected.

             This is a convenient way to set up automatic dialing lists etc.

       2.4 Download file

             This function will prompt with a menu of  available  protocols,
          and then for the name of  the  file  to  be  transferred.  If  you
          specify a filename which contains wildcard character ('*' or '?'),
          LAPTALK will show you a list of matching files,  and allow you  to
          pick one.

             Once the filename is selected, LAPTALK will invoke the selected
          protocol,  and attempt to download the file from the remote system
          to your PC.

       2.5 Upload file

             This function is similar to  "Download file",  except that  the
          file is transferred from your PC to the remote system.

       2.6 Kill capture

             This function  is  used  following  a  download  using  "ASCII"
          protocol,  to stop LAPTALK from capturing the terminal session  to
          the file.  When an ASCII download is in effect,  you will see  the
          string  "cap"  in the status line at the  bottom  of  the  screen.
          Selecting this function will stop the  data  capture,  and  remove
          that indication from the status line.

       2.7 Perform script

             This function prompts for  a  script  filename  and  arguments.
          Unless you specify otherwise, the file is assumed to be located in
          the LAPTALK  home  directory,  and  it  is  assumed  to  have  the
          extension  ".SCR".  LAPTALK will process the file  as  a  "script"
          program.

             This method of running a script program  is  useful  for  those
          files which you do not use  frequently  enough  to  have  in  your
          "function  menu".  It  is  also  useful  in  that  you  may  enter
          parameters to the program when you specify its name.

             If the filename you supply contains wildcard character  ('*' or
          '?'),  LAPTALK will show you a list of the matching script  files,
          and allow you to select one.
    LAPTALK Users Guide                                              Page: 4


       2.8 Break signal

             This function causes LAPTALK to send a BREAK signal.

       2.9 Hangup modem

             This command drops the DTR and RTS signals to the modem  for  a
          brief period of time,  causing most modems to go offline and  hang
          up any calls which are in  progress.  See  you  modem  manual  for
          information on how to set up your modem to do this.

       2.10 Reset terminal

             Causes LAPTALK to reset to it's initial configuration.

       2.11 Clear screen

             This functions clears the TTY screen.

       2.12 Configuration

             This function invokes the LAPTALK configuration menu,  allowing
          you to alter the various parameters  controlling  all  aspects  of
          LAPTALK's operation.

             See the "configuration" section for more details.

       2.13 Shell to DOS

             This function invokes the DOS command processor  (as defined in
          the environment variable COMSPEC),  to  allow  you  to  enter  and
          execute DOS commands.  LAPTALK remains  active.  Use  the  command
          "EXIT" to return to LAPTALK.

       2.14 Exit to DOS

             This function terminates LAPTALK,  returning to the DOS command
          processor.
    LAPTALK Users Guide                                              Page: 5


    3. CONFIGURATION

          When you select 'Configuration' from LAPTALK's main function menu,
       you will be presented with this sub-menu:

                            +---------------------+
                            |General switches     |
                            |General parameters   |
                            |Serial port settings |
                            |Transfer protocols   |
                            |Tab stops            |
                            |Function keys        |
                            |Function menu scripts|
                            |Video attributes     |
                            |Keyboard mapping     |
                            |Load configuration   |
                            |Save configuration   |
                            +---------------------+

          Most editing functions accept the following  special  keys  during
       data entry:

                Ins     - Toggle insert/delete mode
                Del     - Delete character under cursor
                Bksp    - Backup and delete
                Home    - Move to beginning of field
                End     - Move to end of field
                PgUp    - Clear entire field
                PgDn    - Clear to end of field

       3.1 General switches

             This configuration sub-menu presents you with  a  selection  of
          ON/OFF switches,  which control the way  LAPTALK  handles  certain
          events.  To toggle a particular switch between 'Y'es (ON) and 'N'o
          (OFF), simply press the indicated letter:

             A: Sound ALARM in messages

                When set to 'Y'es (ON),  this switch causes LAPTALK to sound
             a BEEP whenever an error  (or  informational)  message  box  is
             presented.

             B: Echo data send in tty

                When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
             display on the terminal  screen,  any  data  entered  from  the
             keyboard,  as well as sending it to  the  remove  device.  This
             option should be  set  ON  whenever  you  are  connected  to  a
             computer which DOES NOT echo input data,  and OFF whenever  you
             are using a system that DOES echo its input.

                Incorrect setting of this option will cause the effect  that
             either you cannot see what you are typing,  OR you will get two
             characters displayed for every one that you type.
    LAPTALK Users Guide                                              Page: 6


             C: Echo data sent in scripts

                When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
             display on the terminal screen, any data that is transmitted by
             scripts files (as well as send it to the remote device).

                The correct setting of this switch will depend on the nature
             of the script file, and the remote system.

             D: Send LF on ASCII uploads

                When set to 'Y'es (ON), this switch causes LAPTALK to output
             both a CARRIAGE RETURN and a LINE FEED at the end of each  line
             of text which is transmitted during an ASCII upload.  When  set
             to 'N'o (OFF), only a CARRIAGE RETURN.

                When uploading to a computer expecting keyboard input,  this
             switch is usually set OFF,  because you do not normally include
             LINE FEED on keyboard input.  When uploading to  a  printer  or
             terminal,  setting this switch ON will prevent the output  from
             continuously overwriting itself one line.

             E: Send space in NULL lines

                When set to 'Y'es (ON), this switch causes LAPTALK to expand
             any lines of ZERO LENGTH which  are  being  transmitted  during
             ASCII uploads to contain a single space.

                The text entry interface of many  online  systems  interpret
             NULL lines as  "end of entry".  A null line in an uploaded file
             will cause these system to stop accepting text (and usually get
             very confused by the remainder of the uploaded  file).  Setting
             this switch ON will prevent this from occurring.

             F: Drop DTR+RTS on exit

                When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
             deassert the DTR and RTS modem control signals of the  PC  COMM
             port whenever you select "Exit to DOS" from the main menu. This
             will usually hangup a modem,  or terminate you login session on
             a multitasking system.  The exact effect  will  depend  on  the
             device to which you are connected.

                When this  switch  set  OFF,  LAPTALK  leaves  DTR  and  RTS
             asserted on the PC COMM port, insuring that device to which you
             are connected is unaware that you have terminated the  program.
             You may then re-enter LAPTALK and resume your communication  at
             some later time.

             G: VT100/ANSI mode (N=VT52)

                When set to  'Y'es  (ON),  causes LAPTALK  to  generate  and
             respond to VT100/ANSI control codes.  When set to  'N'o  (OFF),
             LAPTALK will generate and respond to VT52 control codes.
    LAPTALK Users Guide                                              Page: 7


             H: Keypad application mode

                When set to 'Y'es (ON), LAPTALK generate application control
             codes when keys on the numeric keypad are pressed.  When set to
             'N'o, LAPTALK generates standard numeric characters.

             I: Newline mode

                When  set  to  'Y'es,   the   ENTER   key   generates   both
             carriage-return (0x0D) and line-feed (0x0A) codes. Reception of
             a  line-feed  (0x0A)  causes  the  cursor  to  advance  to  the
             beginning of the next line.  When set to  'N'o,  the ENTER  key
             generates only  carriage-return,  and  reception  of  line-feed
             advances to the unchanged position on the next line.

             J: Wrap at end of line

                When set to  'Y'es,  LAPTALK will automatically move the  to
             beginning of the next line if characters  are  received  beyond
             the rightmost edge of the screen.  When set to 'N'o, extra data
             simply replaces the character in column 80 and the cursor  does
             not move.

             K: UK charset (Shift-3 = '')

                When set to 'Y'es, the character generated by Shift-3 is the
             UK pound sign.  When set to  'N'o,  this character will  be  US
             pound sign.

             L: VT-100 character font (VGA)

                When set to  'Y'es,  LAPTALK will  load  a  VGA  font  which
             correctly displays the various graphic characters available  on
             a VT-100  terminal.  When  set  to  'N'o,  a  "best  available"
             translation is made using the existing PC  character  set.  See
             the section on "VGA fonts".

             M: + Emulate attributes (VGA)

                When set,  LAPTALK will employ VGA features to enable all of
             the  VT-100  character  attributes  (Bold,  Underscore,  Blink,
             Reverse)  to display correctly.  Since this completely  changes
             the display of screen attributes, an alternate set of attribute
             configurations is used when this option  is  active.  Available
             only when  "VT-100 character font"  is enabled.  May  not  work
             correctly on some systems.

             N: Block cursor (otherwise line)

                When set to 'Y'es, LAPTALK uses a block cursor,  when set to
             'N'o a link cursor appears.
    LAPTALK Users Guide                                              Page: 8


       3.2 General parameters

             This configuration sub-menu presents you with  a  selection  of
          parameters which control various aspects of LAPTALK's operation:

             Home directory

                The directory name entered at this prompt determines the DOS
             directory  where  LAPTALK  will  search   for   SCRIPT   FILES,
             CONFIGURATION FILES,  and FILE TRANSFER  PROTOCOL  MODULES.  If
             left blank, LAPTALK will search the current directory.

             Answerback MSG

                The string entered  here  is  transmitted  whenever  an  ENQ
             character is received by the terminal.  The  control  sequences
             available when programming Function keys are available.

             Modem hangup delay

                This parameter defines the number of milliseconds for  which
             LAPTALK will drop the DTR and  RTS  modem  control  signals  in
             order to hang up the modem.  LAPTALK will hang up the modem  in
             response to your selection of the "Hangup modem"  option of the
             main function menu, or the occurance of a "hangup" command in a
             script file.

             String TX character delay

                This parameter defines the length  of  time  in  approximate
             milliseconds which LAPTALK will wait between  characters  in  a
             string being  transmitted.  String  transmissions  occur  as  a
             result of several SCRIPT  commands,  as  well  as  the  various
             function keys in tty mode.

             ASCII Upload char delay

                This parameter defines the length  of  time  in  approximate
             milliseconds  which  LAPTALK  will  wait   between   characters
             transmitted during ASCII uploads.

             ASCII Upload line delay

                This parameter defines the length of  time  in  milliseconds
             which LAPTALK will wait between lines transmitted during  ASCII
             uploads.
    LAPTALK Users Guide                                              Page: 9


             ASCII Upload sync. char

                This parameter defines an ASCII character  value  for  which
             LAPTALK will wait, after sending a line during ASCII uploads. A
             value of zero  (0)  is a special case,  and causes  LAPTALK  to
             ignore the sync character,  proceeding immediately (after ASCII
             Upload line delay) with transmission of the next line.

                LAPTALK will only match characters which are received  AFTER
             the line has been transmitted.  This prevents any occurances of
             the defined character which  are  embedded  in  the  line  from
             triggering the next transmission.

                LAPTALK will always wait for the  minimum  time  defined  by
             "ASCII  Upload  line  delay"   before   proceeding   with   the
             transmission,  regardless  of  when  the  sync.  character   is
             received. It will also wait for one interval of time defined by
             "ASCII Upload char delay"  before proceeding with  transmission
             if the sync.  character is received after the "line delay"  has
             expired.

                In the event that a communication error or some other  event
             prevents LAPTALK from  seeing  the  sync.  character,  you  can
             manually proceed to the next line by pressing the SPACE bar.

       3.3 Serial port settings

             This configuration sub-menu allows you to select the COMM port,
          Baudrate, Parity,  Number of Data bits,  Number of Stop bits,  and
          Enable/Disable XON/XOFF flow control.

       3.4 Transfer protocols

             This configuration sub-menu permits you to define up  to  eight
          file transfer protocols,  which  can  be  invoked  from  the  main
          function menu,

             For details on configuring the protocols,  refer to  the  "FILE
          TRANSFER PROTOCOLS" section of this manual.
    LAPTALK Users Guide                                              Page: 10


       3.5 Tab stops

             Sets up the stops where the  cursor  will  be  positioned  upon
          receipt of a horizontal-tab code.  Use the arrow keys to move back
          and forth along the position scale,  and 'T'  to toggle a tab stop
          ON or OFF.

            C   = Clear all tab stops
           1-9  = Auto-set stops at 'n' character intervals.
            0   - Auto-set stops at 10 character intervals.
           TAB  - Move to next set stop.
           ESC  - Exit

       3.6 Function keys

             Allows you to define strings to be sent when  the  PC  function
          keys F1-F10 are pressed. Entries are available for normal function
          keys,  as well as SHIFT,  CTRL and ALT function keys  (total of 40
          entries).

             Each entry consists of a label, and a string which is sent when
          the key is pressed.  For SHIFT, CTRL and ALT keys,  the labels are
          displayed in the status line when the modifier key is pressed.  To
          display the labels for normal keys, press both shift keys at once.

             Within the string, you can use the following special codes:

                ^c              - Control character of 'c' (eg: ^M = Return)
                ^0-9            - Delay 'n' times 500ms ('0'=10x500)
                ^$name [args..];- Perform script
                ^^              - Send '^' character

             Special keys available during function keys entry:

                ^Home/^End      - Move to first/last definition
                ^PgUp/^PgDn     - Move back/forward 10 definitions
    LAPTALK Users Guide                                              Page: 11


       3.7 Function menu scripts

             This configuration sub-menu permits you to define up  to  eight
          script files  (complete with arguments)  which may be invoked from
          the  "Function menu"  selection of the  main  LAPTALK  menu.  This
          provides "fast access" to your favorite scripts.

             Each entry has the following format:

                     [name;][script file name] [arguments]

             [name;]  is the name  that  will  appear  in  the  script  file
          selection window. It is delimited from the filename by a semicolon
          (';').  If no name is given,  LAPTALK displays  the  name  of  the
          script file.

             [script file name] is the full name of the script file which is
          to run when this entry is  selected.  If  not  specified,  LAPTALK
          assumes the extension ".SCR". Unless the name includes a directory
          path,  LAPTALK assumes that the file will be found in the  LAPTALK
          home directory.

             [arguments]  are any command line  arguments  which  should  be
          passed to the script file.

             Here are a few example entries which implement a simple  "phone
          list" using the "dial.scr" script supplied with LAPTALK:

                BBS;dial 555-1234
                WORK;dial 555-5678
                JOHN;dial 555-9012

             NOTE: See 'PHONE.SCR' for another way to set up a phone list.
    LAPTALK Users Guide                                              Page: 12


       3.8 Video attributes

             This  configuration  option  allows  you  to  set   the   video
          attributes  (colors)  of the  various  windows  and  screens  that
          LAPTALK presents.

             The following entries may be selected:

                TTY attributes          *
                Status line
                Error message box's
                String input fields     **
                Main menu's
                Sub-menu's

        * - TTY attributes are selected with the ANSI escape sequence
            "{ESC}[#...m", where '#' is a series of numbers:
                    0 = All attributes off
                    1 = Bold
                    4 = Underline
                    5 = Blink
                    7 = Reverse

        **- Also includes FILE SELECTION WINDOWS.

          NOTE: In some modes, the PC video screen is not capable of some of
          the above  attributes,  nor  is  it  capable  of  displaying  some
          combinations of attributes.  LAPTALK addresses this shortcoming by
          allowing you to program a unique PC display  attribute  for  every
          possible combination of the four VT-100 attributes,  allowing  you
          to choose how you wish them to be displayed.

             When you select this option, you will be presented with the TTY
          screen attributes.  You may use the PgDn and PgUp  keys  to  cycle
          between the selections listed above.

             The Right and Left arrow keys may be used to cycle between  the
          available FOREGROUND video options.

             The Up and Down arrow keys may be used  to  cycle  between  the
          available BACKGROUND video options.

             Press ESCAPE when you have finished.  NOTE: If you have altered
          the "TTY:  Normal"  or the "Status line"  entries,  the TTY screen
          will be cleared to new attributes.
    LAPTALK Users Guide                                              Page: 13


       3.9 Keyboard mapping

             This function allows you to remap most keys on the PC  keyboard
          to specific laptalk functions.

             When activated,  you will be prompted to press the key you wish
          to remap.  After pressing a key,  you will see  the  scancode  and
          currently assigned function for that key,  and be prompted for the
          following actions:

          3.9.1 F1=New Key

                Press F1 to select another key to remap.

          3.9.2 F2=Assign function

                Presents a selection screen to select  the  function  to  be
             assigned to the key (1):

                        F1-10   = Function keys         (2)
                       sF1-10   = Shift-Function keys   (2)
                       cF1-10   = Ctrl-Function keys    (2)
                       aF1-10   = Alt-Function keys     (2)
            Up/Down/Left/Right  = VT-100 arrow keys
                        kp 0-9  = Keypad number keys
                kp - , ENTER .  = Keypad misc. keys
                        Menu    = Activate main menu (3)

          3.9.3 F3=Assign ascii (4)

                Prompts for an ASCII character which is assigned to the key.

          3.9.4 F4=Clear

                Remove any assignment for the key.  Keys which normally send
             ASCII data will revert to their original function.  Other  keys
             will become inoperative.

          3.9.5 ESC=Exit

                Press ESC to exit the keyboard remap function.

          NOTES:

          (1) You may assign the same function to multiple keys.

          (2)  LAPTALK supports 40 function keys,  each of which can send an
          arbitrary string. By mapping to function keys, you can cause other
          keys to send specific string.

          (3)  If you do not have at least one key assigned  with  the  Menu
          function, you will be unable to configure or terminate LAPTALK.

          (4)  Normally it is best to use F4=Clear to allow an ASCII key  to
          send it's intended letter.  Use of this function will disable  the
          recognition of Shift (the key will always send the letter case you
          define).
    LAPTALK Users Guide                                              Page: 14


       3.10 Load configuration

             This option prompts you for a filename,  and  then  loads  that
          file as a new LAPTALK configuration.  The LAPTALK  home  directory
          and the extension  ".CFG"  are assumed if  not  specified  in  the
          filename.  Wildcard characters ('*' and '?') may be used, in which
          case you will be presented with a menu of the  matching  files  to
          pick from.

       3.11 Save configuration

             This options prompts you for a filename,  and  then  saves  the
          current LAPTALK configuration into that  file.  The  LAPTALK  home
          directory and the extension ".CFG" are assumed if not specified in
          the filename.  Wildcard characters ('*' and '?')  may be used,  in
          which case you will be presented with a menu of matching files  to
          pick from.
    LAPTALK Users Guide                                              Page: 15


    4. FILE TRANSFER PROTOCOLS

          LAPTALK allows up to 8 file  transfer  protocols  to  be  defined,
       which are implemented as external programs.  Only the ASCII  transfer
       protocol is implemented internally.

       4.1 Configuration

             You set up  the  file  transfer  protocols  via  the  "Transfer
          Protocols"  option under the configuration menu.  You may  make  8
          entries, one for each protocol.

             The format of the protocol definition entry is as follows:

                   [name;][executable file name] [arguments]

             [name;]  is the name that appears  in  the  protocol  selection
          window,  of the file upload/download functions.  It  is  delimited
          from the filename by a semicolon  (';').  If  no  name  is  given,
          LAPTALK displays the name of the executable file.

             [executable file name] is the full name of the program which is
          to run when the protocol is selected.  It  must  be  a  ".COM"  or
          ".EXE" file  (LAPTALK assumes ".COM" is no type is given).  Unless
          the name includes a directory path,  LAPTALK assumes that the file
          will be found in the LAPTALK home directory.

             [arguments]  are any command line  arguments  which  should  be
          passed to the program.  The following  "special sequences"  may be
          used in the arguments field:

            \A          - Use ASCII transfer instead of COM/EXE file.
            \B          - Insert BAUD rate ('110'-'115200').
            \C          - Insert COMM port ('1'-'4').
            \D<string>\ - Insert <string> for DOWNLOADS only.
            \F          - Obtain and insert a filename.
            \G          - Like '\F' but ignored for downloads.
            \H          - Insert LAPTALK home directory.
            \N          - Insert number of DATA BITS (5-8).
            \P          - Insert PARITY (Odd, Even, Mark, Space or None).
            \S          - Insert number of STOP BITS (1-2).
            \U<string>\ - Insert <string> for UPLOADS only.
            \W          - Wait for ENTER after transfer.
            \X          - Like '\F' but passes wildcards through.
            \Y          - Like '\X' but ignored for downloads.
            \Z          - ZAP (save, clear and restore) screen.
            \\          - Insert a single '\'.
    LAPTALK Users Guide                                              Page: 16


       4.2 The XMODEM module

             The  LAPTALK  package  includes  XMODEM.COM,  a  program  which
          implements basic XMODEM  file  transfers.  It  has  the  following
          command line syntax:

           XMODEM <filename> [-C -D -P R=size P=port F=value S=speed]

             The meanings of the command line options are:

                -C      - Skip CRC negotiation & proceed with CHECKSUM
                -D      - Perform DOWNLOAD instead of UPLOAD
                -P      - Force pause ("Press any key") when finished
                R=size  - Specify record size
                P=port  - Specify COMM port (1, 2, 3 or 4)
                F=value - Fill unused bytes of last upload record
                          with this value.
                S=speed - Communicate at this baud rate

             Here are some LAPTALK protocol entries for use with XMODEM.COM:

                        Xmodem \F s=\B\D -d\
                        Xmodem/1K;xmodem \F s=\B r=1024\D -d\

       4.3 Examples

             The internal ASCII transfer can be activated  with  a  transfer
          protocol entry such as:

                        ASCII \F\A

             Here are XMODEM,  YMODEM and ZMODEM transfer  protocol  entries
          which make use of a popular shareware communications module called
          DSZ:

                        XMODEM;DSZ port \C \Drx\\Usx\ \F\Z
                        YMODEM;DSZ port \C \Drb\\Usb\ \F\Z
                        ZMODEM;DSZ port \C \Drz\\Usz\ \G\Z

          DSZ is available from:

                              Omen Technology INC
                                 P.O. Box 4681
                            Portland, OR 97208-4681
                               FAX: 503-621-3735
    LAPTALK Users Guide                                              Page: 17


    5. SCRIPT INTERPRETER

          LAPTALK includes a powerful "script" interpreter, which allows you
       to set up automatic sequences of events to be performed as  a  single
       operation.

          The script interpreter can be considered as a simple  "programming
       language", complete with commands, expressions and variables.

       5.1 Insert Codes

             Any any point in a script  file,  you  can  use  any  of  these
          "Insert Codes",  to cause the script interpreter to insert a ASCII
          string representing some value  into  the  command  line  at  that
          point:

            ^c      - Insert control code of 'c'. (Ie: '^C' = 0x03)
            \b      - Insert a BACKSPACE character. (0x08)
            \d      - Insert a DELETE character.    (0x7F)
            \e      - Insert a ESCAPE character.    (0x1B)
            \h      - Insert LAPTALK home directory.
            \r      - Insert a RETURN character.    (0x0D)
            \n      - Insert a NEWLINE sequence.    (0X0D, 0x0A)
            \s      - Insert the MODEM SIGNALS as a decimal value,
                      made up of these components (OR'd together):
                        1   - CTS has changed state.
                        2   - DSR has changed state.
                        4   - Ringing has just ended.
                        8   - CD has changed state.
                        16  - CTS state (1 = asserted)
                        32  - DSR state (1 = asserted)
                        64  - RI  state (1 = asserted)
                        128 - CD  state (1 = asserted)
                    * You can test the individual signals by ANDing ('&')
                      this value with a mask.
            \#n     - Insert character with decimal value n.
            \0-9    - Insert the corresponding argument (0-9) from the script
                      command line. Argument 0 is the name of the script.
            \A-Z    - Insert the contents of the corresponding variable.
            \\      - Insert a single '\'.
            \^      - Insert a single '^'.
    LAPTALK Users Guide                                              Page: 18


       5.2 Script File Commands

             Some of commands  described  in  this  section  accept  various
          arguments which they use to perform their actions. Arguments shown
          in angle braces  ('<>')  are REQUIRED.  Arguments shown in  square
          braces ('[]') are OPTIONAL.

             The various arguments accepted by the script commands are:

            text        - The rest of the command line, which is treated as a
                          text string.

            variable    - A script variable name ('A'-'Z'). Note that for
                          commands which specifically require a variable name,
                          you DO NOT include a preceding '\' (otherwise the
                          CONTENTS of the variable would be passed).

            script      - The name of a script file.

            arguments   - Any arguments to a script file.

            protocol    - A file transfer protocol name. This is the name
                          defined under the "Transfer Protocols" option of
                          the configuration menu, which appears in the
                          protocol selection list for uploads and downloads.

            filename    - The name of a file to upload or download.

            value       - An expression resulting in a numeric value. This
                          may consist of numbers (-32768 to 32767) and any
                          of the following operators:
                                +   - Addition          -   - Subtraction
                                *   - Multiplication    /   - Division
                                %   - Modulus           &   - Bitwise AND
                                |   - Bitwise OR        ^   - EXCLUSIVE OR
                                <<  - Shift Left        >>  - Shift Right
                                ==  - Test for EQUALITY (0=False, 1=True)
                                !=  - Test for INEQUALITY
                                >   - Test for GREATER THAN
                                <   - Test for LESS THAN
                                >=  - Test for GREATER THAN or EQUAL
                                <=  - Test for LESS THAN or EQUAL
                          When multiple operators are present, they are
                          processed from LEFT to RIGHT, without precedence.
                          Round brackets '()' may be used for force the
                          grouping of operators into sub-expressions.

            string      - A text string enclosed within delimiters.
                          It does not matter what characters are used for the
                          delimiters, as long as they are identical, and do
                          not occur within the string.

            command     - Any script file command

            label       - A line label. Any line can be labeled by placing a
                          colon (':') at the beginning of the line, followed
                          immediately by a label name.
    LAPTALK Users Guide                                              Page: 19


          5.2.1 abort <text>

                Displays <text> as an error message, and then terminates all
             scripts  (including any which called  the  one  containing  the
             "abort" command).

          5.2.2 assign <variable> <text>

                Places  <text>  into  the  indicated  variable  (A-Z).  Each
             variable can hold up to 50 characters.

          5.2.3 call <script> [arguments]

                Suspends processing of the current script file,  and  begins
             executing the named one.  The new script file will have its own
             environment (arguments, variables etc.) and will not affect the
             environment of the  calling  script.  When  the  called  script
             terminates, the original script will resume execution.

          5.2.4 chain <script> [arguments]

                Terminates execution  of  the  current  script,  and  begins
             executing the named one.  This function is similar  to  "call",
             except that the original script will not resume  when  the  new
             one terminates.

          5.2.5 clear

                This command clears the main terminal screen.

          5.2.6 close

                This command is used to  stop  capturing  data  to  a  file,
             following an ASCII download.

          5.2.7 config [config filename]

                Loads all LAPTALK options  and  parameters  from  the  named
             configuration file.

          5.2.8 dos [text]

                The remainder of the command  line  is  passed  to  the  DOS
             command processor to be executed as a system command.

          5.2.9 download <protocol> [filename]

                This  command  will  download  the  named  file  using   the
             specified protocol (From your protocol setup menu).

                If <filename> is not supplied, you will be prompted for it.
    LAPTALK Users Guide                                              Page: 20


          5.2.10 echo <text>

                The remainder of  the  command  line  is  displayed  on  the
             console terminal screen,  without  a  following  line-feed  and
             carriage-return. See also 'print'.

          5.2.11 error <text>

                Similar to "abort",  except that the message is displayed in
             a window, and you must press ENTER to remove it.

          5.2.12 equate <variable> <value>

                Similar to  "assign",  except  that  the  remainder  of  the
             command line is evaluated as  a  numeric  expression,  and  the
             result is assigned to the variable as an ASCII number.

          5.2.13 exittodos

                Causes the entire LAPTALK program to terminate.  Control  is
             returned to the DOS prompt.

          5.2.14 flush [text]

                Removes  all  previously  received  data  from  the  capture
             buffer.  If [text] is supplied,  that text is then written into
             the capture buffer.

          5.2.15 goto [+]<label>

                Searches the script file  for  the  location  of  the  named
             label, and proceeds to execute commands from there.

                If  '+'  is specified,  the search will begin at the current
             line,  instead of the beginning of the file.  In large scripts,
             this will speed up forward references to labels.

          5.2.16 hangup

                This command drops the DTR and RTS signals to the modem  for
             a period of time in order to force it offline.

          5.2.17 if <string> : <command>

                Executes the named command only if  <string>  can be located
             in the capture buffer.

          5.2.18 ifnot <string> : <command>

                Executes the named command  only  if  <string>  can  NOT  be
             located in the capture buffer.
    LAPTALK Users Guide                                              Page: 21


          5.2.19 ifeq <string> <string> : command

                Executes the named command only of the  two  <string>'s  are
             identical.

          5.2.20 ifne <string> <string> : command

                Executes the named command only if the  two  <string>'s  are
             NOT identical.

          5.2.21 if# <value> : command

                Executes the named command only if  the  numeric  result  of
             evaluating <value> is not zero.

          5.2.22 input <variable> [text]

                Issues a prompt containing  [text],  and then reads a string
             from the console which is assigned to the named <variable>.

          5.2.23 invisible

                Causes all data subsequently received from the  serial  port
             to NOT be displayed on the terminal screen. See also "visible".

          5.2.24 log [text]

                The remainder of the command line is  written  to  the  open
             ASCII capture file.  If no ASCII capture  is  in  progress,  no
             action is taken.

          5.2.25 menu <variable> <text>

                Presents a menu,  with each word from <text> as a selection.
             The  <variable>  is set to 0 if the first entry is selected,  1
             for the second, 2 for the third, etc. If the menu is aborted by
             pressing ESCAPE, the variable is set to -1.

          5.2.26 print [text]

                The remainder of  the  command  line  is  displayed  on  the
             console  terminal  screen,  followed   by   a   line-feed   and
             carriage-return. See also 'echo'.

          5.2.27 read <variable> <text>

                Similar to  "input",  except that the prompt is issued,  and
             the string is read from the serial port.

          5.2.28 rem [text]

                This command is used to insert remarks into the script file.
             The remainder of the command line is simply ignored.
    LAPTALK Users Guide                                              Page: 22


          5.2.29 scan <string> <time> [: command]

                Waits for either the specified <string>  to be received from
             the serial port, or until <time> milliseconds have elapsed.  If
             a command is given,  it will be executed if the string was  NOT
             seen before the timer expired.

          5.2.30 send <text>

                The remainder of the command  line  is  transmitted  to  the
             serial port.

          5.2.31 skip <value>

                Skips ahead by the specified number of lines,  and  proceeds
             to process the script file from  there.  In  other  words,  the
             specified number of lines  following  the  one  containing  the
             "skip" command will not be processed.

                This is a convenient way to perform  multi-line  conditional
             statements.

          5.2.32 stop

                Terminates processing of the current script  file.  If  this
             file was called by another script file, that file will resume.

          5.2.33 terminal

                This command invokes the ANSI  terminal,  which  will  allow
             interactive communication with the remote port  until  CTRL-END
             if entered, following which the script file will resume.

          5.2.34 upload <protocol> [filename]

                This command will upload the named file using the  specified
             protocol (From your protocol setup menu).

                If <filename> is not supplied, you will be prompted for it.

          5.2.35 visible

                Causes all data subsequently received from the  serial  port
             to be displayed on the terminal screen. See also "invisible".

          5.2.36 wait <time>

                Waits until no data has been received from the  serial  port
             for the indicated number of milliseconds.
    LAPTALK Users Guide                                              Page: 23


       5.3 Fast Access Scripts

             You may set up a  "Function menu",  with up to 8  "fast access"
          scripts  (complete with arguments)  that can be invoked from a pop
          up menu.  This is done with the  "Function  Menu  Scripts"  option
          under the "Configuration" menu.

             The format of each function menu entry is:

                     [name;][script file name] [arguments]

             [name;]  is the name that appears in the script file  selection
          window of the "Function menu"  function.  It is delimited from the
          script file name by a semicolon (';').

             [script file name] is the full name of the script file which is
          to be processed.  Unless  the  name  includes  a  directory  path,
          LAPTALK assumes that the file will be found in  the  LAPTALK  home
          directory.  If not explicitly given, LAPTALK assumes the extension
          ".SCR".

             [arguments]  are any command line  arguments  which  should  be
          passed to the script.
    LAPTALK Users Guide                                              Page: 24


    6. TERMINAL CONTROL CODES

          LAPTALK recognizes the  following  subset  of  the  ANSI  terminal
       control codes:

        VT100 mode:
            ^E          - Send answerback message
            ^G          - Sound ALARM
            ^H          - Backspace
            ^I          - Horizontal TAB
            ^J          - Line feed
            ^M          - Carriage return
            ^O          - SI : Activate G0 character set
            ^N          - SO : Activate G1 character set
            {ESC}c      - Reset terminal
            {ESC}D      - Cursor down (scroll at bottom)
            {ESC}E      - Cursor down and start of line (scroll at bottom)
            {ESC}H      - Set horizontal tab stop of cursor position
            {ESC}M      - Cursor up (reverse scroll at top)
            {ESC}Z      - Identify terminal
            {ESC}[#A    - Cursor up # lines (default=1)
            {ESC}[#B    - Cursor down # lines (default = 1)
            {ESC}[#C    - Cursor right # lines (default = 1)
            {ESC}[#D    - Cursor left # lines (default = 1)
            {ESC}[#;#H  - Position cursor to Y,X        Home: {ESC}[H
            {ESC}[#;#f  - Alternate position cursor     Home: {ESC}[f
            {ESC}[#J    - Clear screen  (0=To End, 1=From Start, 2=All)
            {ESC}[#K    - Clear line    (0=To End, 1=From Start, 2=All)
            {ESC}[#c    - Identify terminal (Device Attributes)
            {ESC}[#g    - Clear horizontal tab stop (0=At cursor, 3=All)
            {ESC}[#..h  - Set ANSI mode (20=Newline/Line-feed)
            {ESC}[?3..h - Set DEC mode (1=CursorKey 2=ANSI/VT52 6=Origin 7=Wrap)
            {ESC}[#..l  - Reset ANSI mode (see above)
            {ESC}[?#..l - Reset DEC mode (see above)
            {ESC}[#..m  - Attributes (0=Off 1=Bold 4=Undline 5=Blink 7=Reverse)
            {ESC}[#n    - Device status (5=DSR response, 6=CSR response)
            {ESC}[#..q  - Load indicators (0=Clear, 1-4=Light)
            {ESC}[#;#r  - Set top/bottom margins (0=Full-screen)
            {ESC}[#x    - Request terminal parameters
            {ESC}[2y    - Reset terminal
            {ESC}(A     - Set G0 character set as UK
            {ESC}(B     - Set G0 character set as US
            {ESC}(0     - Set G0 character set as Graphic
            {ESC})A     - Set G1 character set as UK
            {ESC})B     - Set G1 character set as US
            {ESC})0     - Set G1 character set as Graphic
            {ESC}=      - Switch keypad to application mode
            {ESC}>      - Switch keypad to numeric mode
            {ESC}7      - Save cursor position
            {ESC}8      - Restore cursor from saved position
    LAPTALK Users Guide                                              Page: 25


        VT-52 mode:
            {ESC}A      - Cursor Up
            {ESC}B      - Cursor Down
            {ESC}C      - Cursor Right
            {ESC}D      - Cursor Left
            {ESC}H      - Cursor to Home
            {ESC}I      - Cursor up (reverse scroll at top)
            {ESC}J      - Clear to end of screen
            {ESC}K      - Clear to end of line
            {ESC}Yyx    - Position cursor to y,x (hex 20 offset)
            {ESC}Z      - Identify
            {ESC}=      - Switch keypad to application mode
            {ESC}>      - Switch keypad to numeric mode
            {ESC}<      - Switch to ANSI/VT-100 emulation

        The following special codes are transmitted for keys:

            Key           ANSI/VT-100      VT-52
            ---------------------------------------
            Backspace       ^H              ^H
            Tab             ^I              ^I
            Enter           ^M              ^M
            Delete          Hex: 7F         Hex: 7F
            Up arrow        {ESC}[A         {ESC}A
            Down arrow      {ESC}[B         {ESC}B
            Right arrow     {ESC}[C         {ESC}C
            Left arrow      {ESC}[D         {ESC}D
            Insert  (PF1)   {ESC}[P         {ESC}P
            Home    (PF2)   {ESC}[Q         {ESC}Q
            PgUp    (PF3)   {ESC}[R         {ESC}R
            End     (PF4)   {ESC}[S         {ESC}S

        Unless reconfigured, the default Function keys assignments are:

            F1  {ESC}Oq             F6  {ESC}Ov
            F2  {ESC}Or             F7  {ESC}Ow
            F3  {ESC}Os             F8  {ESC}Ox
            F4  {ESC}Ot             F9  {ESC}Oy
            F5  {ESC}Ou             F10 {ESC}Op
    LAPTALK Users Guide                                              Page: 26


          Due to physical differences it is not possible  to  exactly  match
       the DEC application keypad.  LAPTALK creates  the  following  default
       mapping:

            +-----+-----+-----+-----+     DEC  PC Ascii VT-100/AP   VT-52/AP
            | PF1 | PF2 | PF3 | PF4 |     ---------------------------------
            +-----+-----+-----+-----+      0    0   0   {ESC}Op     {ESC}?p
            |  7  |  8  |  9  |     |      1    1   1   {ESC}Oq     {ESC}?q
            +-----+-----+-----+  ,  |      2    2   2   {ESC}Or     {ESC}?r
            |  4  |  5  |  7  |     |      3    3   3   {ESC}Os     {ESC}?s
            +-----+-----+-----+-----+      4    4   4   {ESC}Ot     {ESC}?t
            |  1  |  2  |  3  |     |      5    5   5   {ESC}Ou     {ESC}?u
            +-----+-----+-----+Enter|      6    6   6   {ESC}Ov     {ESC}?v
            |     0     |  .  |     |      7    7   7   {ESC}Ow     {ESC}?w
            +-----------+-----+-----+      8    8   8   {ESC}Ox     {ESC}?x
          DEC  PC   VT-100      VT-52      9    9   9   {ESC}Oy     {ESC}?y
          PF1 NumLk {ESC}OP     {ESC}P     .    .   .   {ESC}On     {ESC}?n
          PF2   /   {ESC}OQ     {ESC}Q     ,    +   ,   {ESC}Ol     {ESC}?l
          PF3   *   {ESC}OR     {ESC}R     -  PgDn  -   {ESC}Om     {ESC}?m
          PF4   -   {ESC}OS     {ESC}S    Ent  Ent  ^M  {ESC}OM     {ESC}?M

          You can re-map the entire  keyboard  layout  using  the  "Keyboard
       mapping" configuration fnction.
    LAPTALK Users Guide                                              Page: 27


    7. VGA FONT EDITOR

          If you are using a VGA compatible adapter, LAPTALK has the ability
       to load a custom font.  One such font is built  in  to  LAPTALK,  and
       provides a VT-100 compatible character set.  The  alternate  font  is
       enabled by  the  "Use  VT-100  character  font"  under  the  "General
       switches" configuration item.

       You can use the 'F=fontfile' command line option to load an alternate
       font from a .VGA font file.  I have provided VGAFE, a VGA font editor
       which will allow you to create and edit your own  custom  fonts.  The
       program is very straightforward to use  and  the  function  keys  are
       listed on the main screen.

       I have also provided LAPTALK.VGA,  a file based copy of the font that
       is built into LAPTALK which you can use as a starting point  (LAPTALK
       does not require this file).  You can also use VGAFE with a new file,
       and it will preload the VGA font from your computers BIOS.

       When preparing fonts for LAPTALK,  please be aware  that  the  VT-100
       graphics characters (codes 5F - 7E)  are mapped into the following PC
       characters:

            5F  20          67  F1          6F  86 *1       77  C2
            60  04          68  84 *1       70  87 *1       78  B3
            61  B1          69  85 *1       71  C4          79  F3
            62  80 *1       6A  D9          72  88 *1       7A  F2
            63  81 *1       6B  BF          73  89 *1       7B  E3
            64  82 *1       6C  DA          74  C3          7C  D8 *2
            65  83 *1       6D  C0          75  B4          7D  9C
            66  F8          6E  C5          76  C1          7E  F9

        *1 = Symbol does not exist in standard PC font
        *2 = Symbol is not an exact match in PC font
    LAPTALK Users Guide                                              Page: 28


    8. VT-100 TEST UTILITY

          VTEST is a small program I write to test the capability of  VT-100
       terminal emulators.  It performs most of the functions which  can  be
       supported on a genuine  VT-100,  and  is  useful  to  see  how  these
       function are handled on a terminal emulator.

          VTEST is very straightforward to use, simply connect your terminal
       (or PC running a terminal emulator)  to the COM1 or COM2 serial port,
       and execute the command: VTEST COM1 -or- VTEST COM2

          VTEST will  perform  the  various  tests  with  on-screen  prompts
       describing the operations being performed.  After each test you  will
       be prompted to press  <return>  to proceed to the next.  You can also
       press <ESC>  to exit the program.  Input will be accepted from either
       the terminal or PC keyboard.
