BinSplit V1.00 1/3/94   (c) 1994 Dataman Programmers Ltd.
-----------------------------------------------------------------------

BinSplit, as it's name suggests is a utility for splitting a binary
file.  BinSplit will take a binary file, and split it at a given point,
creating two new files, and leaving the original file intact.

Why use BinSplit?
-----------------

Perhaps the main reason for using BinSplit is to avoid using the dreaded
DEBUG!  You can achieve similiar results using DEBUG, but the size of
file to be split is limited to less than 640K (BinSplit can split files
of nearly 2 gigabytes), quite apart from being the most un-userfriendly
program ever written!

BinSplit's main use is for splitting a large binary file designed to be
downloaded into an EPROM programmer, such as the Dataman S4.  The S4
comes as standard with 128K bytes of RAM, but is capable of programming
EPROMs upto 1024K bytes.  Let's suggest we have such an S4, and we also
have a binary file of size 1024K bytes (1 megabyte).  In this situation,
we need to download 128K bytes of data at a time, and program that data
into the appropriate part of the EPROM.  In other words, the file needs
to be split into 128K blocks.  This is where BinSplit comes in.  Using
BinSplit, the file can quite easily be split into 8 x 128K byte files.

The whole job can be automated by putting the appropriate commands into
a batch file as shown below.  "file.bin" is our 1024K byte file.

--------------------------------------------------------------------------------
binsplit file.bin 1 temp  131072
binsplit temp     2 temp2 131072
binsplit temp2    3 temp  131072
binsplit temp     4 temp2 131072
binsplit temp2    5 temp  131072
binsplit temp     6 temp2 131072
binsplit temp2    7 8     131072
del temp
del temp2
--------------------------------------------------------------------------------

This will create 8 files, numbered 1 through 8, each of 128K bytes.

Two temporary files will have been created during this process, and are
deleted.

Syntax
------

The Syntax for BinSplit is as follows:

binsplit [Input file] [Output file #1] [Output file #2] [Split Offset]

Input File:     The file to be split.
Output file #1: The first output file.
Output file #2: The second output file.
Split offset:   The point at which the input file is to be split.

All parameters (file names and offset) can be entered from the command
line.  Alternatively, BinSplit will prompt for parameters if they are
not specified.  For example, typing the following will perform the split
with no further input required from the user.  In this example, the file
"eprom.bin" is split into two files, named "newfile1" and "newfile2",
with the first 65536 (64K) bytes being written to "newfile1".
The remainder of the data is written to "newfile2":

 ---- C:\ >binsplit eprom.bin newfile1 newfile2 65536 [return]

Just typing "binsplit" and pressing return will prompt the user for the
input file, output file #1, output file #2 and split offset - in that
order:

 ---- C:\ >binsplit [return]
      BinSplit V1.00  1/3/94
      (c) 1994 Dataman Programmers Ltd.

      Enter input filename: system.rom
      Enter output filename #1: file.top
      Enter output filename #2: file.end
      Enter offset in decimal: 32768

      Splitting file: "system.rom".  Size: 65536 bytes
      Writing file #1: "file.top" at 1 - 32768
      Writing file #2: "file.end" at 32769 - 65536

      Finished

BinSplit will display a progress bar at the bottom of the screen, to
indicate how far the split has got.  BinSplit works fairly quickly, due
to the 32K buffer used for read/write operations.

Dataman Programmers Ltd
Station Road
Maiden Newton
Dorchester
Dorset
DT2 0AE
United Kingdom

Tel: +44/0 1300 320719
Fax: +44/0 1300 321012
BBS: +44/0 1300 321095

E&OE
