;

                       ZMP - A ZMODEM Program for CP/M

                       Version 1.4 -- 12 November 1988
                           Developed from HMODEM II
                                by Ron Murray


   1    Overview            2    Operation           3    Customization 

   B    Send break to modem             M    Toggle memory capture mode 
   C    Configure system                P    Toggle printer             
   D    Get disk directory              Q    Quit                       
   F    File operations                 R    Receive a file             
   H    Get instructions                S    Send a file                
   I    Initiate phone call (dial)      X    Hangup                     
   K    Display keyboard macros         Y    Print screen               
   L    Change line parameters          Z    Clear local screen         
:1

   ZMP is  a  communications/file  transfer program  for CP/M  which  performs
Xmodem,  Xmodem-1k (often erroneously  called Ymodem),  true Ymodem and Zmodem
file transfer protocols.   Although tested with Z80DOS,  ZRDOS,  and CP/M 2.2,
there seems  to  be no reason why it shouldn't work with CP/M 3  as well.  The
only requirements are a Z80 processor,  a computer running CP/M in  one of its
various guises,  with at least 45k  of TPA (but the  more the better!),  and a
modem.

   When you try to pack this many features into one program, you end up with a
pretty large file.   The big problem occurs when file transfers are attempted:
unless you have at least 4-8k  of buffer size,  you might  as well  use xmodem
protocol.  The approach taken in ZMP is to use overlays for various functions,
accepting the time taken to load these from disk.   Thus performance will vary
depending on your disk setup:  if you have  a hard disk and  a fast processor,
you will likely not notice the difference.  


   In order to produce a program which would work with most CP/M systems,  the
Zmodem protocol performed by ZMP is fairly simple.   The transmit section uses
'Full Streaming  with Reverse Interrupt',  as Chuck Forsberg  calls  it in his
description  of the Zmodem protocol.   This means that,  if your system can do 
serial I/O and disk I/O at the same time, ZMP does not take advantage of this.
The receive section  uses 'Segmented Streaming.'   This means that the receive
program tells  the transmit  program  how  big its  buffer  is.   The transmit
program then sends just that much data, then waits for an acknowledge from the
receiver.   Errors may occur  if too much  data is sent  in this case, but the
protocol should recover and the file will be received intact (we hope!).

   The string  which ZMP passes  to the receiving program to interrupt in case 
of errors is likewise simple.   Basically it causes  the receiving  program to
send a Ctrl-C character and then wait for one second.   The receiver will then
send its ZRPOS string,  by which time ZMP, as the transmitter, should be ready
to receive it.
:2

Operation:

   The following files must  be on the same disk and user area,  which must be
specified in your customization overlay:

   ZMCONFIG.OVR -- the configuration overlay
   ZMINIT.OVR   -- the initialization overlay
   ZMTERM.OVR   -- the terminal overlay
   ZMXFER.OVR   -- the file transfer overlay
   ZMP.HLP      -- the help file (recommended)

   Start the program with ZMP.  The screen should clear,  then a title message
is printed,  then ZMP  enters terminal  mode.   You may type esc-H for help at 
this point.  When you first run the program, the first thing you need to do is
to enter the configuration  overlay (type esc-C) and set  all the defaults and
others  to suit  your system  as required.   When  you exit the  configuration 
program,  answer 'Y' to  the 'Make changes permanent?' question.   ZMP.FON and 
ZMP.CFG will  be produced  on your  disk,  in the same drive/user area  as the 
above files.  Type esc-H for a display of options available.
:3

Customization:

   ZMP must  be customized to suit your system.   This involves overlaying the
un-installed  copy  of  ZMP.COM (ZMPX.COM) with  a  user-written  installation
overlay.   There is  a blank overlay file  in the distribution library.   This
value is set  at  0145 hex,  and should stay there permanently.   See the file
ZMP-OVL.UPD for more details on how to set up an overlay.
:b

Send Break to Modem:


   If your overlay has been set up to send a break command to your UART,  this
command will  perform  this function.   (Some remote systems  also  may need a 
break sent to them during Zmodem transfers).
:C

Configure System:

   This function is designed to  set system defaults, save phone numbers, etc.
Changing baud rates,  etc. for a particular call  are better  handled with the
escape-L option.   If you answer Y  or y  to  the  'make  changes  permanent?' 
question,  the  new configuration will  be saved in  a ZMP.CFG  file,  and the
phone numbers in a ZMP.FON file for later use.   The .CFG file is read,  if it
exists, when ZMP is first started.

   The following Configuration Menu is displayed:

        A - Edit long distance access number
        K - Edit keyboard macros
        L - Set line parameters
        M - Set modem parameters
        P - Edit phone number list
        S - Set system parameters
        T - Set file transfer parameters
        Z - Exit
:D

Get Disk Directory:

   
   Gets a directory of  the current  drive and  user area.  Change  to another
with the escape-F command, described below.   The directory will be sorted and
will include  drive/user area  that there  is insufficient memory available to
sort them.   In this case an unsorted directory,  without file sizes,  will be
printed.
:F

Disk/File operations:

   This command is used to change the current drive/user area, to reset a disk
in the current drive, and to view, erase,  print  or rename files.   There are
also options to give a directory of the current drive/user area, and to supply
a  new  filename for  the capture file.   The filename may specify a different
drive/user area than the current one.

   The following File and Disk Command Menu is displayed:

        C - Change disk in default drive
        D - Directory of current disk
        E - Erase file on default drive
        F - Change default name of capture file (currently ZMP.LOG)
        L - Log into new du: (currently B0:)
        P - Print a file on default drive
        R - Rename a file on default drive
        V - View a file on default drive
        Z - Exit
:H


Get Help:


   Prints the ZMP.HLP file.  You may then either type CR to return to terminal
mode, or enter the required function key.
:I


Initiate Phone Call:


   Reads the ZMP.FON file, if any,  and prints it.   Then you  are asked which
number you want.  Enter the identifying letter of the number you wish to call.
You can also enter numbers not in the list.  Multiple numbers can be called by
entering them separated with commas.   Dialling will then commence,  and  will
continue until one of the numbers answers, or until you abort the process with
the escape key.  Note that the baud rate used for the call is that in the .FON
file for  that number,  or the current one if the new number is entered.  This
function works best if the  strings in the .CFG file have been set up for your
modem, and the initialization string  sent to  the modem  sets it into verbose
mode the status messages.
:K


Display/Keyboard Macros

   The configuration  module allows  up  to 10 macro  keys  to be defined, and 
these  are  recalled by  typing  message followe  by the  numbers  0-9.   This 
function prints the current assignments.
:L

Change Line Settings:

   This function allows temporary changes of  baud rate,  stop bits,  and data
bits.   There is also  an option  to  operate  terminal  mode  in  full duplex
(locally typed chars are sent but not displayed  on  the screen),  half duplex
(locally typed chars are sent and also displayed on the screen),  or echo mode
(as  for half duplex,  but  received chars  are echoed to the remote system as
well as being displayed.  Don't  run  two computers  in  an  echo  mode unless
you're bored.  There are also options to  allow/disallow  control  chars above
CR to be displayed in terminal mode, to strip the parity bit in terminal mode,
and to re-initialize the UART and modem at the current baud rate.

   Like IMP, ZMP uses location 003C hex  to store a value corresponding to the
present baud  rate.   Then,  if  you leave ZMP  and later re-enter,  it checks
location 003C.   If it contains a legal value,  then that baud rate is set for
you, else it sets the default baud rate as selected in the .CFG file.
:M


Toggle Capture Mode in Memory:


   Received characterss will  be saved in  a buffer and saved in  a file named 
'ZMP.LOG' when  the buffer fills  or when  the command  is  entered  again.  A 
Ctrl-S/Ctrl-Q sequence is  sent to  the  remote  computer while  the buffer is
being saved in an attempt to stop it sending more data.
:P


Toggle Printer:


   This is similar to the 'M' command,  except incoming characters are sent to
the printer.   This  functions best  if your  system performs  the  BIOS 'List
Status' function correctly.
:Q


Quit the Program:


   Obvious.  You will be asked if this  is really  what  you want.   Any entry
other than N or n will exit to CP/M. 
:R

Receive a File:

   You will be asked which protocol you  wish to use.   The default is ZMODEM.
The <X>modem option will alow  either 128-byte  blocks (standard XMODEM) or 1k
blocks (XMODEM-1k),  since this is decided by the transmit end.   Note that if 
an attempt is made to receive  a file which has the same name as a file on the
current drive/user area,  the current one  will be renamed to .BAK and the new
one will then be received normally.

   Note that  the byte count  on the  screen is not kept  up-to-date on Zmodem
receive.   This is  because the data  arrives non-stop  and there is simply on 
time  available with non-interrupt driven computers to update the screen.   An
update is performed if errors occur,  and when the computer pauses to write to
the disk.

   Starting with version 1.4,  Zmodem file receive will commence automatically
upon recept of the sender's ZRQINIT string.   Thus all you need  to do is have
the sender initiate the transfer,  select the drive and user area you wish the
files to be received on, and wait...


The following status window is displayed in Receive File Mode:

                  RECEIVE FILE Mode:  Press ESC to Abort...
 
                  +---------------------------------------+
                  |            Protocol:                  |
                  |            Filename:                  |
                  |           File Size:                  |
                  |         Block Check:                  |
                  |       Transfer Time:                  |
                  |   Bytes Transferred:                  |
                  |  Blocks Transferred:                  |
                  |     Sectors in File:                  |
                  |         Error Count:                  |
                  |        Last Message:                  |
                  +---------------------------------------+
:s

Send a File:

   Operation is similar to the receive function.  Additional options available
are ASCII send and  the capability of distinguishing between normal Xmodem and
Xmodem-1k.   In Ymodem and Zmodem modes, wildcard filenames and multiple file-
names are allowed.   Multiple filenames should be entered separated by spaces.
In  all  cases,  files on  different  drive/user  areas may  be  specified  by 
supplying a ZCPR3-style DU: prefix (e.g., C7:NEATPROG.WOW).

   Byte count information  is displayed  in Zmodem  mode  on  transmit.   This 
causes noticeable  breaks between packets,  but it  is felt  that this is out-
weighed by the usefulness of the information.  ZMP's Zmodem mode is capable of
CRC-32 operation, although CRC-16 mode is used if the receiver is incapable of
CRC-32.   Some other terminal programs,  however, do strange things when faced
with a receiving program which claims it can do CRC-32.   If this happens, the
configuration function  (esc-C from terminal mode) has  an  option  to disable 
CRC-32.
:x


Hangup:


   This function causes the modem to disconnect from the phone line.
:y


Print Screen:


   Allows the current screen to be dumped to printer.   Note that this must be
supported in the overlay:  most terminals are incapable of this function.  The
standard overlay prints 'This function not supported.'  
:z


Clear Screen:


   Allows the screen to be cleared.  Useful if if fills with rubbish.
