Compare and Browse Version 1.40 - by David Mitchell            Page 1
                   IBM Internal Use Only

  CAB is a special-purpose browser that lets you look at, and compare
  two files at the same time. 128 bytes of each file are displayed, in
  HEX and ASCII, using the same format as DEBUG. CAB is not a very
  "smart" file comparison tool, nor a very powerful file browser, but
  it may assist in comparing different versions of the same file.

  These help screens are arranged as follows:
                                                     Page
    Summary of CAB commands  . . . . . . . . . . . . . 2
    CAB file window format . . . . . . . . . . . . . . 3
    Scrolling a file window  . . . . . . . . . . . . . 4
    Viewing a file . . . . . . . . . . . . . . . . . . 5
    Comparing and Searching  . . . . . . . . . . . . . 6
    Displaying a directory . . . . . . . . . . . . . . 7
    Invoking CAB from DOS  . . . . . . . . . . . . . . 8
    Bugs, Features and Enhancements  . . . . . . . . . 9
    Implementation Notes . . . . . . . . . . . . . .  10
        Compare and Browse Version 1.40 - by David Mitchell            Page 2
                 Summary of CAB commands

The CAB command line shows 12 commands. To enter a command either type the
first letter, or press �� to select the highlighted command. Pressing the
space bar or F10 highlights the next command, while F9 the previous one.

  Compare    starts a compare of the two files, starting at the current
             position, and stopping at the first point of difference
  Search     searches the file in the ACTIVE window for a given string
             starting at the current position
  Xsearch    same as search, but accepts hex string
  View       closes the file in the ACTIVE window and switches to a new one
  + - =      scrolling commands (see page 4)
  Dir        displays a directory (similar to DOS "dir" command)
  Help       displays this help file! (so does F1)
  Quit       quits from CAB back to DOS
  Next       repeats the last Compare or Search (starts at next byte)
  Mode       switches between Mono and Color adapters
To cancel a command after it has been selected, press Esc.
        Compare and Browse Version 1.40 - by David Mitchell            Page 3
                         CAB file windows

Each window has a title line, which displays the name (including drive and path)
the file size (in decimal and hex) and the attributes of the file.
The attributes are:

  H - hidden file          S - system file           R - read-only file
  A - archive bit (file changed since last backup)   D - Sub-directory

Each window displays 128 bytes, arranged as 8 lines of 16 bytes. The current
position is at the middle of the window - the first byte of line 5. In the
centre of the screen 64 bytes from each file are shown, in ASCII, to make it
easy to compare the two files.  Arrows indicate the current position on these
lines too. The current position is displayed in both decimal and hex.


The ACTIVE window is highlighted. The Tab or Esc key is used to "toggle"
between windows. Tab works even when entering a response to a command.

        Compare and Browse Version 1.40 - by David Mitchell            Page 4
               CAB file window scrolling commands

                       ����������������������������������������������������Ŀ
The cursor keys scroll  �     Home       �                �     PgUp        �
the file in the ACTIVE  � Top of File    � Back 16 bytes   � Back 64 bytes   �
window as shown.        ����������������������������������������������������Ĵ
If Shift is pressed as  �      --       �                 �      --        �
well, then BOTH files   � Back 1 byte    �                 � Forward 1 byte  �
are scrolled.           ����������������������������������������������������Ĵ
                       �      End       �                �     PgDn        �
The current position    � Bottom of File � Forward 16 bytes� Forward 64 bytes�
can also be changed     ����������������������������������������������������
using the +, - and = commands. These prompt you to add a number  which can be
in decimal(up to 8 digits), or a hex value (just precede the value with H or h
for example h 0e bc or h 0ebc or h ebc or H00EBC are all acceptable)

    +      adds the value to the current position (moves forward)
    -      subtracts  the value from the current position (moves backward)
    =      makes the value the new current position.
        Compare and Browse Version 1.40 - by David Mitchell            Page 5
                         Viewing a File

The View Command

The View command displays the named file in the ACTIVE window. Any current
file is closed. The filespec can include drive and path specifiers.

A file may also be selected for viewing by:

       selecting a file on the directory display (see page 7)
       following the CAB command with a filespec (see page 8)

If the file does not exist or an error occurs while the file is being opened,
CAB will beep, and an error message will be displayed. With a 1-drive system,
avoid switching the current drive while CAB is running as the DOS message
"Insert diskette for drive .."  will spoil the display.



        Compare and Browse Version 1.40 - by David Mitchell            Page 6
               The Compare, Search and Next Commands

The Compare Command

The Compare command scans both files, starting at the current position. It
stops when a difference is found, or at end of file (EOF). Pressing any
key during the compare causes it to be terminated.

The Search and Xsearch Commands

These search the file in the ACTIVE window for the given string. Searching
starts at the current position and stops when the string is found or at EOF.
Pressing any key during the search causes it to be terminated.

The Next Command

This command repeats the last Compare or Search command (whichever was later).
It starts at the byte after the current position, so for example after a Search
the repeated use of Next will locate each occurence of the string in turn.
        Compare and Browse Version 1.40 - by David Mitchell            Page 7
                         The Dir Command

You can display a directory listing within CAB using the Dir command. This
works almost exactly like the DOS dir command. You can supply just a drive,
a path, a filespec (with global characters like *), or any combination. If
you just press �� the current directory is displayed.

CAB can display up to 200 directory lines. If the current directory contains
more files, CAB will beep and display an error message - only the first 200
files will be displayed.

The directory can be scrolled, just like this file, using the cursor keys.

With a 1-drive system, avoid switching the current drive while CAB is running,
as the DOS messages "Insert diskette for drive .."  will spoil the display.

If Ctrl-Enter is pressed, the highlighted file is selected for viewing in the
ACTIVE window. Note that although sub-directory entries are shown, these cannot
be viewed as files (CAB will beep).
        Compare and Browse Version 1.40 - by David Mitchell            Page 8
                   Invoking CAB from DOS

The CAB command can be used in the following ways:

       CAB             without options, both windows will be empty
       CAB file1       top window will display file1
       CAB f1 f2       f1 in top window, f2 in lower window
       CAB ?           jumps directly to these help screens
       CAB f1 f2 /C    displayed on Color adapter (if you have one!)
       CAB f1 f2 /M    displayed on the Mono adapter (ditto)

The /C and /M options, like CAB's Mode command, check that the appropriate
adapter is installed. The switching stays in effect when you leave CAB.

Getting back to DOS

The Q command leaves CAB, closing any open files, and returns to DOS.
If CAB was invoked from a BAT file or from FileCommand, return is to
the BAT file or FileCommand.
        Compare and Browse Version 1.40 - by David Mitchell            Page 9
                 Bugs, Features and Enhancements

This release has removed some restrictions. In particular, CAB will now deal
with much larger files (up to 99MB), searching and comparing can be interrupted
by pressing any key and the Xsearch command allows arbitrary hex strings to be
searched for. The TAB key now toggles between windows, even during the entering
of responses to commands. I have also removed the useless Blank command.

Currently CAB still does not:

-  properly support the colour adapter. Screen updating is too slow.

-  properly trap disk read errors. CAB does take over the DOS critical error
  handler (temporarily), but no attempt is made to display the specific reason
  for the error. If such errors occur, it is best to terminate CAB.

-  run under DOS 1 (it uses a lot of DOS 2 function calls).

I am sure there are still several bugs in CAB. Let me know if you find any.
        Compare and Browse Version 1.40 - by David Mitchell            Page 10
                      Implementation Notes

CAB is written in Assembler (C would have been better). For each file it has
four buffers, each 4K in size. A least-recently-used algorithm controls what
is in these buffers. Files of any size up to 99MB can be viewed, and CAB's
scrolling speed is independent of file size.

The CAB COM file is about 10K in size, but CAB really needs 64K of free storage
to run properly. As well as 32K of file buffers, CAB uses 12K to store the HELP
file, and 10K for the Directory buffer. If there is less than 42K of free space
CAB will refuse to run. If less than 64K is free, the DIR function is suppressed
while if less than 54K is free, the HELP function is suppressed as well.

To avoid flashes on the color display, video buffer updates are synchronised
with the vertical retrace, so scrolling is much slower than on the Mono display.

For further information consult the author:
       David Mitchell, IBM (UK) International Products Ltd., Feltham, UK
       VNET: ESP18 at GFORD1    Tel: LONDON 751-8422    Telex: UFEL
============================== End of Help =====================================
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@