home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMPRESS / NARC25.ZIP / NARC.DOC next >
Encoding:
Text File  |  1988-12-31  |  77.7 KB  |  1,977 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                    NARC - A STAND-ALONE DE-ARCHIVE UTILITY
  11.                            (no other files required)
  12.  
  13.  
  14.  
  15.  
  16.                          Documentation for NARC.EXE
  17.  
  18.  
  19.                            Written by Gary Conway
  20.  
  21.  
  22.                         Infinity Design Concepts, Inc.
  23.  
  24.  
  25.                             Louisville, Kentucky
  26.  
  27.  
  28.                    Copyright (c) 1987-89, All rights reserved
  29.  
  30.  
  31.                                 Version 2.5
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                NARC.EXE is a shareware program. NARC.EXE is and will remain 
  71.                the property of Gary Conway. This program may not be used in 
  72.                any connection with commercial ventures, nor as a sales aid, 
  73.                without the expressed written consent of the author. All 
  74.                rights are reserved.
  75.  
  76.  
  77.                          Infinity Design Concepts, Inc.
  78.                          1052 Parkway Drive
  79.                          Louisville, Kentucky 40217
  80.                          (502)-636-1234 
  81.  
  82.                  Member  IEEE
  83.                          PCCL
  84.                          KKUG
  85.                          NSPE
  86.  
  87.  
  88.                  All  new releases of NARC.EXE and all other  IDC software
  89.                can be located -FIRST- on ;
  90.  
  91.                  The SoftStone   FOG #24  (supporting CP/M and MSDOS)
  92.                  (502)241-4109
  93.                  60 MEGs
  94.                  300/1200/2400 baud
  95.                  24 hrs.
  96.                  Louisville, Kentucky
  97.  
  98.                  Curt Edwards - SYSOP
  99.  
  100.          Sponsored by:   Kentucky Kaypro Users Group
  101.                          Accounting Computer Systems
  102.                          First Osborne Group
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                        REGISTRATION
  132.  
  133.  
  134.                If you find yourself using NARC, please take the time to do 
  135.                the right thing and that is register your copy. You have been 
  136.                provided the opportunity to freely test the program before 
  137.                even thinking about registering. This is only fair, so, in 
  138.                fairness, you should reciprocate and register your copy, if 
  139.                you continue using the program.
  140.  
  141.                 Why register ?
  142.  
  143.                 1) You get the NARCCFG.EXE program for customizing NARC.
  144.                 2) You get notification of updates to all IDC software.
  145.                 3) You get patch table information.
  146.                 4) You get FREE net-mail services for contacting IDC.
  147.  
  148.                 Disk only with current version ..................  $20.00
  149.                 (includes manual on disk)
  150.  
  151.                 Printed manual ..................................  $15.00
  152.                 (bound and printed manual only, NO REGISTRATION)
  153.  
  154.                 Printed manual and reg. disk ....................  $35.00 
  155.  
  156.                 Site License ....................................  $50.00
  157.                 (required for business use)
  158.                 (applies for up to 20 machines)
  159.                 (please call for quantity discounts)
  160.  
  161.                Registered  users  can  obtain update  disks  for  $10.00.
  162.  
  163.                Customers residing outside of North America, should add
  164.                $5.00 U.S for airmail postage.
  165.  
  166.                Add $3.50 for shipping and handling.
  167.  
  168.                Customers residing outside of the United States of America
  169.                should send a check or money order drawn on a U.S. bank or
  170.                in U.S. funds or use a credit card.
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                You will find the registration form in the ARChive with  this 
  193.                document  under the name REGISTER.FRM. Please use  this  form 
  194.                for registration.
  195.  
  196.  
  197.                               Infinity Design Concepts, Inc.
  198.                                     1052 Parkway Drive
  199.                                 Louisville, Kentucky  40217
  200.                                       (502)-636-1234
  201.  
  202.                 The user is granted the right to make unlimited copies of
  203.                 the SHAREWARE versions of the program (except NARCCFG.EXE 
  204.                 and NARCCFG.DOC) and to distribute these copies as desired
  205.                 without profit, EXCEPT that Infinity Design Concepts, Inc.
  206.                 reserves the SOLE right to distribute the program(s) for
  207.                 profit.
  208.  
  209.  
  210.  
  211.                 NOTE: NARCCFG.EXE is NOT a shareware program and may not
  212.                       be released to the general public in any form 
  213.                       under any circumstances whatsoever.
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  243.  
  244.  
  245.  
  246.  
  247.  
  248.   .............................................................................
  249.   ........................                         ............................
  250.   ........................    TABLE OF CONTENTS    ............................
  251.   .............................................................................
  252.  
  253.                                                                Page
  254.            FEATURES UNIQUE TO NARC..............................1
  255.            WHAT IS IT ANYWAY..................................  2
  256.            ACKNOWLEDGEMENTS...................................  2
  257.            COMPATIBILITY......................................  3
  258.                Author's Ramblings.............................  3
  259.                ARChive Storage Methods Supported By NARC......  3
  260.                    Packing
  261.                    Squeezing
  262.                    Crunching
  263.                    Squashing
  264.            OVERVIEW...........................................  4
  265.                Video Modes ...................................  4
  266.                Mouse Support .................................  4
  267.                Sound .........................................  5
  268.                Environment Variables..........................  5
  269.            HELP...............................................  7
  270.            COMMANDS...........................................  7
  271.                Extract Command................................  7
  272.                View Command...................................  8
  273.                Print Command..................................  8
  274.                ARC-wind Command...............................  9
  275.                DRV-wind Command...............................  9
  276.                DirTree  Command..........*  NEW  *............  9
  277.                Quit Command...................................  10
  278.            ALTERNATE COMMANDS.................................  10
  279.                Function keys..................................  10
  280.                Find Command...................................  11
  281.                Kill File Command..............................  11
  282.                Page UP, DOWN, HOME,END........................  11
  283.                Using extensions besides .ARC and .ARK.........  11
  284.                Calling IDCshell.EXE...........................  11
  285.                Command Line Processor.........................  12
  286.                Trivia status screen...........................  12
  287.            OPERATING HINTS AND SHORTCUTS......................  12
  288.            ERROR MESSAGES.....................................  13
  289.            ARCHIVE FILE FORMATS AND GENERAL INFORMATION.......  14
  290.                Packing........................................  15
  291.                Huffman coding (SQUEEZING).....................  16
  292.                Crunching (LZW Compression)....................  20
  293.            DETAILS OF STORAGE VERSIONS........................  22
  294.                ARChive file Header Structure..................  24
  295.            HASHING............................................  25
  296.                CRC - calculations.............................  25
  297.            ARC RELEASE DATES AND VERSIONS.....................  26
  298.  
  299.      ........................................................................
  300.        Narc (c) 1987-89 Infinity Design Concepts, Inc.  all rights reserved
  301.  
  302.  
  303.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  304.  
  305.  
  306.  
  307.  
  308.  
  309.      ........................................................................
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  365.  
  366.  
  367.                                   ═══════════════════════
  368.                                   FEATURES UNIQUE TO NARC
  369.                                   ═══════════════════════
  370.  
  371.  
  372.                1) allows random access to archives. ALL of the other archive
  373.                   utilities allow ONLY serial access to archives.
  374.                2) allows viewing DOC files before extraction. This feature
  375.                   allows you to determine which, if any of the subfiles that
  376.                   you want to extract. This can save considerable time and
  377.                   disk clutter when you extract only the necessary files.
  378.                3) has a view feature that allows page up, page down, home
  379.                   end and arrow key movement through a file. Binary files 
  380.                   can also be viewed in HEX mode. Also includes a text 
  381.                   search function.
  382.                4) allows printing files from an archive without extracting 
  383.                   the file first. Supports many printing options.
  384.                5) allows users with floppy systems to load NARC once and
  385.                   examine many archives from all floppy drives. Other
  386.                   archive utilities must reload (and reread the arc) for 
  387.                   each command.
  388.                6) directory tree allows one to easily move from directory
  389.                   to directory or drive to drive.
  390.                7) large archives are much easier to deal with in NARC since
  391.                   you may page through the subfiles.
  392.                8) mouse support for all functions.
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  425.           
  426.                                      Page 1
  427.  
  428.                                 ═══════════════════
  429.                                 WHAT IS IT ANYWAY ?
  430.                                 ═══════════════════
  431.  
  432.  
  433.                NARC is a menu driven de-ARChive facility, written entirely 
  434.                in assembler. NARC allows you to easily move from ARC file to 
  435.                ARC file, with the option of viewing, printing, extracting or 
  436.                deleting the subfiles from the ARChive. The program may be 
  437.                operated from the mouse or the keyboard. Menus are of the 
  438.                musical popup variety to add a little "TechNoFlash" to the 
  439.                proceedings. NARC is the culmination of about 18 months of 
  440.                frustrating effort and 13000 + lines of 8088 source code. 
  441.                NARC was developed using the Norton Editor and the Microsoft 
  442.                Macro assembler on a Kaypro PC and an ALR 386/20.
  443.  
  444.                Why....
  445.  
  446.  
  447.                Because I use a lot of ARC  files and  ARC.EXE and the clones 
  448.                are  reminiscent  of  the  early  Ward  Christensen CP/M days 
  449.                in user interface etiquette, I wanted something a little more 
  450.                flexible and friendly to use. I would like to pause here for 
  451.                a second and give a little credit to Mr. Christensen ( the 
  452.                Don Garlits of CP/M ) for the fine FREE utilities he has 
  453.                given to ALL of us over the years. The next time you do a 
  454.                modem transfer, you can thank him and Keith Petersen for the 
  455.                original XMODEM from which all others have transpired.
  456.  
  457.            Why NARC...
  458.  
  459.                It  seemed like a good idea. Short for uN-ARC. The  idea  was 
  460.                originally Bob Freed's.
  461.  
  462.            Acknowledgments..
  463.  
  464.                I would like to thank my parents for not killing me at any 
  465.                early age and my wife for not killing me at a later age...
  466.  
  467.                I would like to thank Bob Freed for his allowing me to 
  468.                examine his Z80 code before writing NARC. Bob wrote UNARC for 
  469.                the CP/M world and is ( as of this writing 4/28/87) working 
  470.                on NOAH the ARCing program for CP/M. I would also like to 
  471.                thank System Enhancement Associates for releasing their 
  472.                source code in "C". Without both of the above, NARC would 
  473.                have been a much larger chore than it was. Note also that the 
  474.                crunching algorithm used in ARC.EXE was taken from COMPRESS, 
  475.                used in UNIX. A special thanks to the following kind folks.
  476.  
  477.  
  478.                      Curt Edwards        Jerry Taylor
  479.                      Chuck Crumpton      Frank Roemer
  480.                      Paul Bowling        Dr. Matthew Witten 
  481.                      Paul Clarke         Kevin Able
  482.                      Carlisle Crutcher   H.W. Straley
  483.                      John R. Gernert     Mr. Dudley Hoffman
  484.                      Dr. Melvin Maron
  485.  
  486.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  487.           
  488.                                      Page 2
  489.  
  490.  
  491.                                 ═════════════
  492.                                 COMPATIBILITY
  493.                                 ═════════════
  494.  
  495.  
  496.                NARC is compatible with all known "skrunching" algorithms, 
  497.                that is up to and including Squashing. NARC is compatible 
  498.                with ARC.EXE version 5.21 and PKxARC. NARC supports Squashing 
  499.                which is nothing more than a variation of the crunching 
  500.                algorithm, yet it is the easiest (and most logical) of the 
  501.                crunching methods to code. I have heard a lot of criticism of 
  502.                squashing, but those folks need to get up with the times, 
  503.                squashing is (and should be) here to stay. NARC also 
  504.                recognizes the .ARK extension soon to be prevalent in the 
  505.                CP/M world via Bob Freed's CP/M archive facility, NOAH.
  506.  
  507.  
  508.            Author's Ramblings
  509.  
  510.  
  511.                System Enhancement Associates, I am told is dropping the ball 
  512.                as far as ARC.EXE goes. I think that Thom Henderson deserves 
  513.                a great round of applause for his contribution and help with 
  514.                a formidable problem, namely, storage space (or lack 
  515.                thereof).
  516.  
  517.                The oldest version of ARC.EXE that I can find is version 
  518.                3.10, released 5-1-85. This version supports storage methods 
  519.                up to and including squeezing (no crunching). If anyone has 
  520.                an older version I would be interested in seeing it. Here is 
  521.                a list of the versions that I do have and would be interested 
  522.                in getting any other versions floating around.
  523.  
  524.                  3.10    4.10    4.50    4.52    5.00    5.10    5.12    5.20
  525.  
  526.  
  527.                        ═════════════════════════════════════════
  528.                        ARCHIVE STORAGE METHODS SUPPORTED BY NARC
  529.                        ═════════════════════════════════════════
  530.  
  531.  
  532.  
  533.                          Packing         - all versions
  534.                          Squeezing       - Huffman Coding
  535.                          Crunching       - all versions (LZW encoding)
  536.                          Squashing       - one version
  537.  
  538.  
  539.          Note: LZW stands for Lempel-Ziv-Welch
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  549.           
  550.                                      Page 3
  551.  
  552.            OverView...
  553.  
  554.                When NARC is first invoked, it saves the current drive/path 
  555.                for use again on exit, so you always end up where you 
  556.                started. Some folks like that and some don't. I DO. NARC 
  557.                first searches the default path for ARC/ARK files and if any 
  558.                are found they are displayed in a window on the left side of 
  559.                the screen. The arrow keys (or the mouse), PgUP,PgDN, Home 
  560.                and End may be used to move the cursor bar up and down the 
  561.                window, there are two ways to select the highlighted ARC 
  562.                file.
  563.  
  564.                  (1) Hit the ENTER key
  565.                  (2) Press the left mouse button
  566.  
  567.  
  568.                After selecting the sub-file of interest, NARC displays all 
  569.                of the ARC sub-files and their statistics on the screen. You 
  570.                are also given a menu bar at the bottom of the screen. You 
  571.                may use the arrow keys or the mouse to move the cursor bar to 
  572.                the desired selection and then select with the  ENTER key or 
  573.                the left mouse button. As the cursor bar is moved, you are 
  574.                also given a brief description of the highlighted command. A 
  575.                file may be located in the list by the now common ALT-letter 
  576.                key combination. This applies to all menus in NARC. The 
  577.                commands will now be discussed individually.
  578.  
  579.          Note: You may also select any option from the command bar by
  580.                entering the first letter of the command.
  581.  
  582.  
  583.                 The ESCape key will abort any operation or window.
  584.  
  585.  
  586.                                         Video Modes
  587.  
  588.  
  589.                NARC will determine whether a monochrome or color video 
  590.                adapter is being used and act accordingly. If a CGA or EGA 
  591.                card is detected, then NARC will select 80 x 25 color mode, 
  592.                unless color has been turned off with NARCCFG. The users 
  593.                video mode and cursor shape is saved when NARC is invoked and 
  594.                restored upon exit or shell.
  595.  
  596.                                        Mouse Support
  597.  
  598.                NARC will determine if a mouse driver is present. If so, then 
  599.                NARC's mouse support routines are enabled and working at all 
  600.                times within the program. The left mouse button ALWAYS 
  601.                emulates the ENTER key (for selecting highlighted items) and 
  602.                the right mouse button ALWAYS emulated the ESC key (for 
  603.                aborting operations). Highlight bar movement can always be 
  604.                accomplished with mouse motion. The sensitivity of mouse 
  605.                motion can be changed with NARCCFG. The mouse routines were 
  606.                written with the Microsoft mouse in mind and any mouse that 
  607.                is compatible with the Microsoft mouse should work.
  608.  
  609.  
  610.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  611.           
  612.                                      Page 4
  613.  
  614.                                            Sound
  615.  
  616.                NARC makes use of the 8253 programmable interval timer chip 
  617.                and speaker port to create some gurgles,bleeps,whistles and 
  618.                burps in general, that some folks like and some don't. The 
  619.                chip is programmed for square wave output in mode 3. The 
  620.                sound may be permanently disabled with NARCCFG. NARC 
  621.                determines microprocessor speed and adjusts the sound 
  622.                routines accordingly so that the sounds are pretty much the 
  623.                same on all machines.
  624.  
  625.  
  626.                                    ENVIRONMENT VARIABLES
  627.  
  628.  
  629.                If you don't know what an environment variable is, then 
  630.                continue reading. If you DO know, then skip to "The Goods" 
  631.                section below.
  632.  
  633.                      What are they ?
  634.  
  635.                An environment variable is a convenient way for programs to 
  636.                communicate with DOS or with each other through a commonly 
  637.                shared spot(s) in memory. If you type "SET" <ENTER> at the 
  638.                DOS prompt, DOS will respond by showing you the current spot 
  639.                of shared memory which we call the environment. These text 
  640.                strings can be created,read, modified and deleted at any time 
  641.                by any program. Each variable has a certain format that must 
  642.                be adhered to. The format is as follows,
  643.  
  644.                      variable_name = string
  645.  
  646.                 An example would be  IDCED=C:\UTILITY\WS
  647.  
  648.                Spaces are allowed before and after the equal sign. This 
  649.                variable will mean absolutely nothing to DOS, but, to NARC, 
  650.                it will show the way to your editor. The variable name here 
  651.                is IDCED and the string is C:\UTILITY\WS which is the 
  652.                pathname for finding WordStar on the disk. You can change 
  653.                this string to anything you want by simply typing --- SET 
  654.                IDCED= (and type your pathname for your editor). NARC uses 
  655.                several of these environment variables to communicate with 
  656.                you and you should set them up in your AUTOEXEC.BAT file.
  657.  
  658.                What do I do if DOS says, "Out of Environment Space" ?
  659.  
  660.                DOS reserves only so much space for the environment strings, 
  661.                and if you have a long search path or a lot of strings, then 
  662.                you may run out of space. I can offer two suggestions, one 
  663.                for DOS 3.1 and one for DOS 3.2. There is a "switch" that you 
  664.                can add to your CONFIG.SYS file (If you don't have one, then 
  665.                you should !). One of the lines in your config.sys file 
  666.                should read Shell=C:\COMMAND.COM or something similar. You 
  667.                can add the following to the end of this line to increase 
  668.                your environment space.
  669.  
  670.  
  671.  
  672.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  673.           
  674.                                      Page 5
  675.  
  676.                      DOS 3.1 -      /E:nn    where nn = 10 up to 62. This
  677.                                              number times 16 is the length
  678.                                              of your environment.
  679.  
  680.                           example:  Shell=c:\command.com c:\ /P/E:10
  681.  
  682.                                     This would reserve 160 bytes.
  683.  
  684.                      DOS 3.2 - add  /E:nnnn  where nnnn is the actual
  685.                                              number of bytes to reserve.
  686.  
  687.                           example: Shell=c:\command.com c:\ /P /E:160
  688.  
  689.                                     This would reserve 160 bytes.
  690.  
  691.  
  692.                Environment variables can be set up in your Autoexec.bat file 
  693.                as follows.
  694.  
  695.  
  696.                      Set IDCARCPATH=c:\utility\idcshell.exe
  697.                      Set IDCED=c:\wordproc\editor.ext
  698.  
  699.  
  700.  
  701.                 The Goods ..
  702.  
  703.                      IDCED=c:\editors\ws.exe
  704.  
  705.                           Use this variable to tell NARC where your
  706.                           editor is located, so that when the F9 key is
  707.                           pressed to invoke the editor, NARC will know
  708.                           where to locate it. The drive and path and editors
  709.                           name must be given (in upper or lower case). The
  710.                           file extension (.COM or .EXE) MUST be given.
  711.                
  712.                      IDCARCPATH=c:\utility\idcshell.exe
  713.  
  714.                           Use this variable to tell IDCshell where to find
  715.                           IDCshell when the "I" key is pressed. As with IDCED,
  716.                           the drive and path and filename and extension must
  717.                           be given.
  718.  
  719.                      NARCHELP=c:\utility\narchelp.hlp
  720.  
  721.                           Use this variable to tell NARC where to find
  722.                           the NARC help file when the F1 key is pressed.
  723.  
  724.  
  725.                      IDCTEMP=e:\ramdisk
  726.  
  727.                           Use this variable to tell NARC where it can
  728.                           place temporary work files. If you have a ramdisk
  729.                           set up, then this would be a good use for it since
  730.                           all file operations will be MUCH faster from
  731.                           the ramdisk.
  732.  
  733.  
  734.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  735.           
  736.                                      Page 6
  737.  
  738.                                THE HELP SCREEN
  739.  
  740.  
  741.                From the files screen, it is always possible to get a context 
  742.                sensitive help screen. Hitting the F1 or F10 key will cause a 
  743.                full screen of help to pop up that has information specific 
  744.                to the command that the cursor bar was pointing to.
  745.  
  746.                Once the help window is opened up, it is then possible to get 
  747.                help on any of the commands. The Home key will take you to 
  748.                the help index (as will the "I" key). The window may be  put 
  749.                at any time with the ESC key.
  750.  
  751.                NOTE: There are several commands that are listed under
  752.                      miscellaneous commands in the INDEX section of the
  753.                      help screens, so be sure to check them out.
  754.  
  755.  
  756.                                    ════════
  757.                                    COMMANDS
  758.                                    ════════
  759.  
  760.  
  761.            ═══════════════
  762.            Extract Command
  763.            ═══════════════
  764.  
  765.                Selecting this option will cause another prompt to be 
  766.                displayed, asking whether you wish to extract the highlighted 
  767.                file or tagged files. (Files are tagged with the space bar). 
  768.                "Point and shoot" here again as before. The ESC key or the 
  769.                right mouse button will abort the operation. If the disk 
  770.                becomes full, you will be informed and have the option of 
  771.                aborting or continuing.
  772.  
  773.  
  774.            Highlighted File
  775.  
  776.                When EXTRACT is selected, you will be asked for a drive/path 
  777.                to extract the file to. If you simply hit ENTER or the left 
  778.                mouse button, the file will be extracted to the default 
  779.                drive/path. You may also enter any valid DOS drive/path. The 
  780.                ESC key or the right mouse button will abort the operation.
  781.          
  782.                 NOTE: Control-R can be used to recall the last path that
  783.                       files were extracted to.
  784.  
  785.            Tagged Files
  786.  
  787.                The Space bar (or F3 key) is used to TAG the current file. 
  788.                When a file is tagged, a diamond will be displayed on the 
  789.                line with the current file in column 80.  The space bar will 
  790.                also unTAG a file, thus it is a "toggle". When the space bar 
  791.                is pressed, a diamond will appear as described above and  the 
  792.                cursor bar will move to the next file. When the "TAGGED" 
  793.                option is selected from the command line, all files that have 
  794.                been tagged, will be extracted to the SAME drive/path.
  795.  
  796.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  797.           
  798.                                      Page 7
  799.  
  800.  
  801.                After the file is extracted, it's date and time are set to 
  802.                those contained in the ARC file. The file is also checked for 
  803.                size and CRC, if both of these do not match exactly what was 
  804.                contained in the ARC file header, then an error has occurred 
  805.                and the user is notified. The files will also remain tagged 
  806.                after the extraction.
  807.  
  808.  
  809.            ════════════
  810.            View Command
  811.            ════════════
  812.  
  813.                This option will display the currently highlighted file on 
  814.                the screen. The PgUP, PGDN, Home and End keys, as well as the 
  815.                cursor keys allow movement through the file. The file to be 
  816.                viewed is first extracted to the default drive (or to 
  817.                whereever the IDCTEMP variable points) to a file called 
  818.                NARC.TMP. This file is deleted when the view is ended. The 
  819.                extraction is performed due to the sequential nature of ARC 
  820.                files, which makes it nearly impossible to perform the page 
  821.                up,down operations on the compressed file itself. If NARC 
  822.                finds that there is not enough disk space or directory space 
  823.                to create NARC.TMP, you will be asked for another drive where 
  824.                the temporary file can be created.
  825.  
  826.                The newest addition to the view command in NARC 2.1 is the 
  827.                text search command. Simply hit "S" and you will be prompted 
  828.                for a string to find. When located, the text will be 
  829.                highlighted on the screen, otherwise a message is issued 
  830.                stating that the text was not found. The search is case 
  831.                insensitive, that is you may enter upper or lower case 
  832.                letters and NARC will find a match.
  833.  
  834.                 The mouse is also supported now in the view function.
  835.  
  836.            ═════════════
  837.            Print Command
  838.            ═════════════
  839.  
  840.                The print option will print the currently highlighted file. 
  841.                After selecting the print option, you will be asked which 
  842.                character pitch you want to print in. Enter the number that 
  843.                you wish (or 0 for the default pitch) and the printer will be 
  844.                set to that pitch.
  845.  
  846.          NOTE: The printer strings that come installed with NARC are compatible
  847.                with EPSON printer strings. If you wish to install NARC with
  848.                your own strings, see NARCCFG.DOC for complete instructions.
  849.  
  850.                After selecting selected the printer pitch, you will be shown 
  851.                three more options for formatting the printout. Use the arrow 
  852.                keys to move left and right. The space bar is used to toggle 
  853.                the options ON or OFF. When you have finished and are ready 
  854.                to print, hit ENTER (or left mouse button). The ESC key or 
  855.                the right mouse button will abort at any time. The options 
  856.                are;
  857.  
  858.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  859.           
  860.                                      Page 8
  861.  
  862.  
  863.                  Format -        YES - This option causes NARC to format the
  864.                                        output with page breaks and page numbers.
  865.                                  NO  - NARC does not format the file.
  866.  
  867.          The following two options work independently of the Format option.
  868.  
  869.                  Strip High -    YES - NARC will strip the high bit off each
  870.                                        character before it is sent to the
  871.                                        printer. Some word processors set this
  872.                                        high bit on some characters as a means of
  873.                                        text formatting. These characters will
  874.                                        print as garbage usually.
  875.                                  NO  - NARC will not strip the high bit.
  876.  
  877.                  Strip Control - YES - NARC will strip all control characters
  878.                                        from the file before it is printed. This
  879.                                        is useful on files that have embedded
  880.                                        formatting characters, and you wish to
  881.                                        have NARC provide the formatting.
  882.                                  NO  - NARC will not strip the control chars.
  883.  
  884.                NOTE: On all of the following windows, the PG UP, PG DN,
  885.                      HOME and END keys in addition to the cursor keys
  886.                      allow movement through the window.
  887.  
  888.  
  889.            ════════════════
  890.            ARC-wind Command   
  891.            ════════════════
  892.  
  893.                This option will display the window containing all of the 
  894.                ARC/ARK files in the current sub-directory. Move the cursor 
  895.                bar up and down with the mouse or arrow keys and select with 
  896.                the  ENTER key or left mouse button.
  897.  
  898.            ════════════════
  899.            DRV-wind Command
  900.            ════════════════
  901.  
  902.                This option will pop up a window that contains all of the 
  903.                logical drives that DOS reports to NARC. Select as before and 
  904.                the ARC-window will be popped up so that you can then choose 
  905.                an ARC file to examine.
  906.  
  907.            ═══════════════
  908.            DirTree Command
  909.            ═══════════════
  910.  
  911.                This command is totally new with release 2.1. The old window 
  912.                approach won a lot of criticism and rightfully so. I had a 
  913.                tree routine that I wrote some time ago, that I just wasn't 
  914.                happy with speed-wise and didn't want to stick that thing in 
  915.                NARC. I did have some nice ideas for a new routine that would 
  916.                be much faster and slicker all around and finally found the 
  917.                time to write it and NARC  release 2.1 has it, you may judge 
  918.                for yourself.
  919.  
  920.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  921.           
  922.                                      Page 9
  923.  
  924.  
  925.                A visual tree is presented that displays all subdirectories 
  926.                on the disk. Once the tree has been read, NARC will not read 
  927.                it again, unless you have changed drives.
  928.  
  929.                From the tree, you can create and delete subdirectories, 
  930.                select a new drive or subdirectory or return with no action 
  931.                at all. The ESC key will abort the tree operations.
  932.  
  933.  
  934.            ════════════
  935.            Quit Command
  936.            ════════════
  937.  
  938.                The exit options have been changed so that now you will be 
  939.                prompted for where you wish to exit the program. You have the 
  940.                choice of exiting to the current directory or the original 
  941.                directory where NARC was invoked from. This can be made 
  942.                totally automatic with the ARCCFG program in the registered 
  943.                version.
  944.  
  945.  
  946.  
  947.            ══════════════════
  948.            ALTERNATE COMMANDS
  949.            ══════════════════
  950.  
  951.                The extra commands can be located on the help screens, which 
  952.                are invoked by the F1,F10 or ? keys.
  953.  
  954.            F1 - key
  955.                 Invokes the context sensitive help system.
  956.  
  957.            F2 - key
  958.                This  keys  function varies with the window that  is  on  the 
  959.                screen  at any one time. When an ARC file is opened  and  the 
  960.                subfile  list is onscreen, this key will pop up the ARC  file 
  961.                window  again.  Any  other use of this key is  given  at  the 
  962.                appropriate time on the screen.
  963.  
  964.            F3 - key
  965.                This key will tag a subfile and move the cursor bar on to the 
  966.                next subfile. This key also has other functions, and they are 
  967.                also shown on the screen when necessary.
  968.  
  969.            F4 - key
  970.                The  F4  key  will  print an image of  the  screen  less  the 
  971.                advertisement and command lines. 
  972.  
  973.            F5 - key
  974.                Invokes  the NARC-DOS command processor.  You may then  enter 
  975.                any  valid DOS command.  When  finished,  simply  hit   ENTER   
  976.                by  itself  and you will be returned to NARC.  You  may  also 
  977.                enter   "COMMAND"  which  will  invoke  a  second   copy   of 
  978.                COMMAND.COM, if the file COMMAND.COM is in your search  path. 
  979.                To return to NARC, you would then type "EXIT". 
  980.  
  981.  
  982.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  983.           
  984.                                      Page 10
  985.  
  986.            F6 - key
  987.                This  key  will tag all of the subfiles in  the  ARChive  for 
  988.                subsequent extraction.
  989.  
  990.            F7 - key
  991.                This key will invert all of the tags on the subfiles, that is 
  992.                all  files  that were tagged will become untagged  and  vice-
  993.                versa.
  994.  
  995.            F9  - key
  996.                 This key will call your editor. Note that you MUST have
  997.                 first set up the environment variable IDCED before this
  998.                 function  can  be  used.  See  the  section  on  environment 
  999.                variables.
  1000.  
  1001.            F10 - key
  1002.                  This key will call up the context sensitive help system.
  1003.  
  1004.        ALT-F10  - key
  1005.                 This sequence displays the trivia screen, where your serial
  1006.                 number and other information is located.
  1007.  
  1008.            (F)ind command.
  1009.                Will  prompt for a wildcard filename to find in the  sub-file 
  1010.                list. Any number of characters may be used, for example,  you 
  1011.                may  enter  a single character and NARC will find  the  first 
  1012.                file  whose name begins with that  character.  Alternatively, 
  1013.                you may enter a complete wildcard specification and NARC will 
  1014.                attempt to find a match.
  1015.  
  1016.            (K)ill file command.
  1017.                Will  remove  the  currently highlighted  sub-file  from  the 
  1018.                ARChive.  No additional disk space is required for  temporary 
  1019.                files.
  1020.  
  1021.          PgUP,PgDN,Home and End
  1022.                These keys do what you might expect.  These functions work in 
  1023.                all windows.
  1024.  
  1025.             (S)et search spec command.
  1026.                When  NARC searches the current directory for archive  files, 
  1027.                it normally searches for .ARC and .ARK files. The .ARK may be 
  1028.                changed  to  another extension (or wildcard  extension)  with 
  1029.                this command. All subsequent searches will use both the  .ARC 
  1030.                extension  and  the newly defined mask. This command  may  be 
  1031.                used from the ARC file window or from the subfile screen.
  1032.  
  1033.                The extension may also be passed from the command line. Enter 
  1034.                NARC /h for complete information.
  1035.  
  1036.             (I)dc-arc command.
  1037.                 This command will run IDCshell.EXE.  Note that the 
  1038.                environment variable IDCARCPATH must be set up before this 
  1039.                command will work, unless IDCshell is in the current 
  1040.                directory. IDCshell is the companion program to NARC and will 
  1041.                be released in April - 88. This command provides a simple 
  1042.                link between the arcing functions of IDCshell (and its 
  1043.  
  1044.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1045.           
  1046.                                      Page 11
  1047.  
  1048.                copy/rename/delete/print/view etc...) functions. Note that 
  1049.                NARC can also be called from IDCshell via its "N" command 
  1050.                along with a filename.
  1051.  
  1052.                               THE NARC COMMAND LINE PROCESSOR
  1053.  
  1054.                A command line processor has been added that is compatible 
  1055.                with both ARC and PKXARC. There are some variations on the 
  1056.                implementation of these commands that are not wholly 
  1057.                compatible with ARC and PK. For example, the ONLY command 
  1058.                that operates on wildcard subfiles is the extract command. 
  1059.                The "T" (test ARC integrity command) will simply open the ARC 
  1060.                file and display the main NARC screen. This is done, since 
  1061.                NARC does the integrity check when reading the ARC file. The 
  1062.                "D" (delete subfile) command will only delete one file at a 
  1063.                time. This is done since it is very seldom that files are 
  1064.                deleted from an ARC anyway and the wildcard can be very 
  1065.                dangerous.
  1066.  
  1067.          Command line syntax:
  1068.  
  1069.                  NARC  [command] [ARC file] [submask]
  1070.  
  1071.          where;
  1072.  
  1073.          [command]      may be any of the following and may be preceded by 
  1074.                         "-" or "/"
  1075.  
  1076.                  D,-D                    = delete submask file from ARCmask
  1077.                  X,-X,E,-E               = extract submask file(s) from ARCmask
  1078.                  P,-P                    = print submask file from ARCmask
  1079.                  V,-V,L,-L,T,-T,Z,-Z     = open ARCmask file and display files
  1080.                  C,-C                    = view submask file in ARCmask
  1081.                  H                       = shows command line options
  1082.  
  1083.          [ARC file]      may be any ARC file with or without the extension. An
  1084.                          extension of .ARC is assumed, but may be explicitly
  1085.                          included as .ARC or .ARK. The drive/path may also be
  1086.                          included.
  1087.  
  1088.          [submask]       may be any valid wildcard filename.
  1089.  
  1090.                                    TRIVIA STATUS SCREEN
  1091.  
  1092.                This  screen shows some useful information about the  current 
  1093.                NARC  environment.  It is invoked with  the  ALT-F10  command 
  1094.                sequence from the subfiles screen.
  1095.  
  1096.  
  1097.                        Operating Hints and Philosophy and Shortcuts
  1098.  
  1099.  
  1100.  
  1101.                When NARC is first invoked, it pops up the window showing all 
  1102.                of the ARC files in the current directory. The first thing 
  1103.                that you must always do is to select an ARC file. The reason 
  1104.                for this is that  when I want to look inside an  ARC  file, I 
  1105.  
  1106.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1107.           
  1108.                                      Page 12
  1109.  
  1110.                will move to that drive/directory  and then  call NARC.  This 
  1111.                saves me from having to select where I want to look and what 
  1112.                drive and all that mess.  This way, when the program comes 
  1113.                up, I can go right to work.
  1114.  
  1115.                NOTE:  When  the ARC file window is onscreen,  you  may  also 
  1116.                choose  another  file  extension beside  .ARK  with  the  "S" 
  1117.                command.  See the section entitled "Using extensions  besides 
  1118.                .ARC and .ARK.
  1119.  
  1120.                When there are no windows popped up, the "A" key (or F2 key)  
  1121.                will pop up the ARC file window, regardless of where the 
  1122.                command line cursor bar is. This is handy when you have a lot 
  1123.                of ARC's that you want to thumb through, with just the 2  
  1124.                mouse  buttons or ENTER and F2 keys, you can look through a 
  1125.                whole directory of ARC files in nothing flat ! Also along  
  1126.                these lines, when the ARC window is on the screen, the right 
  1127.                mouse button or the ESCape key will exit the program.
  1128.  
  1129.  
  1130.                NARC buffers 64k of the input file at one time, thus speeding 
  1131.                up file operations.  The output buffer is 32k and should be 
  1132.                larger in the next version. NARC requires about 194K of RAM 
  1133.                to operate.
  1134.  
  1135.                     (This prime advertising space for rent)
  1136.  
  1137.  
  1138.  
  1139.                Note that the arrows keys may be used to move the error 
  1140.                message box up and down the screen. This feature is provided 
  1141.                so that if the message covers up something on the screen that 
  1142.                you would like to see, you may move the box.
  1143.  
  1144.  
  1145.                             ══════════════════════
  1146.                                 Error Messages.
  1147.                             ══════════════════════
  1148.  Memory Allocation Error.
  1149.          - NARC allocates memory when it is invoked, this says that DOS told
  1150.            NARC that there was not enough memory left to run the program
  1151.  
  1152.  ERROR: Extraction Failed due to CRC error, Hit ENTER
  1153.          - After a file is extracted, the CRC contained in the ARC header is
  1154.            compared to the CRC that NARC calculates, this message says  that
  1155.            the two were different. This is the CRC-16 polynomial.
  1156.  
  1157.  ERROR: Extraction Failed due to FileSize error
  1158.          - Same as above, except with filesize
  1159.  
  1160.  ERROR: Disk File Inconsistency.  Hit ENTER
  1161.          - This will usually mean that the user has swapped disks just after
  1162.            telling NARC to View,Print or Extract and NARC does not recognize
  1163.            the file.
  1164.  
  1165.  
  1166.  
  1167.  
  1168.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1169.           
  1170.                                      Page 13
  1171.  
  1172.  ERROR: Incompatible Crunch Format
  1173.          - Says that either the stowage code for this file is not supported by
  1174.            NARC -OR- there is an error in the ARC header
  1175.  
  1176.  ERROR: Extraction Failed due to Lack of Disk Space - (A)bort (C)ontinue
  1177.          - Abort will stop tagged extraction, continue will try to fit next
  1178.            file. 
  1179.  Squeezed File Has a Diseased Decode Tree.
  1180.          - When unsqueezing a file, NARC has found a bad entry in the decode
  1181.            table.
  1182.  
  1183.  ERROR: No directory space on destination!
  1184.          - Self explanatory
  1185.  Bad Path Name, Hit ENTER
  1186.          - The destination path that the user entered for extraction is not
  1187.            a valid DOS pathname, re-enter.
  1188.  
  1189.  Requires DOS version 2.0 or above.
  1190.          - NARC requires DOS 2.0 or above to operate.
  1191.  
  1192.  Invalid archive file format
  1193.          - NARC could not find any ARC headers, this is probably not an ARC file
  1194.  
  1195.  Warning: Bad archive file header, bytes  skipped = xxxxx
  1196.          - If an entry has a bad header, NARC will examine the next 64k bytes
  1197.            looking for a good header.  This is to maintain compatibility with
  1198.            ARC v.5.20 which allows self-unpacking ARC files.
  1199.  
  1200.  Unexpected end of  ARChive file
  1201.          - Says that NARC couldn't find the last ARC header
  1202.  
  1203.  No matching file(s) in ARChive
  1204.          - ARC file is empty
  1205.  
  1206.  
  1207.  Cannot create work file, enter drive for temporary file
  1208.  
  1209.          - there was not enough directory space or disk space to
  1210.            create NARC.TMP for viewing. Enter a drive letter where
  1211.            NARC can create the necessary work file. The file will
  1212.            be deleted when the view has ended.
  1213.   
  1214.                  ════════════════════════════════════════════
  1215.                  ARCHIVE FILE FORMATS AND GENERAL INFORMATION
  1216.                  ════════════════════════════════════════════
  1217.  
  1218.  
  1219.                 For Those With a Little More Curiosity...
  1220.  
  1221.  
  1222.  
  1223.                The following are the currently supported stowage methods.
  1224.  
  1225.                 1    unpacked (obsolete)
  1226.                 2    unpacked
  1227.                 3    packed
  1228.                 4    squeezed (after packing)
  1229.  
  1230.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1231.           
  1232.                                      Page 14
  1233.  
  1234.                 5    crunched (obsolete)
  1235.                 6    crunched (after packing) (obsolete)
  1236.                 7    crunched (after packing, using faster hash algorithm)
  1237.                 8    crunched (after packing, using dynamic LZW variations)
  1238.                 9    Squashed c/o Phil Katz (no packing) (var. on crunching)
  1239.  
  1240.                 NOTE:    LZW is Lempel-Ziv-Welch crunching algorithm
  1241.                          A little about the stowage methods.
  1242.  
  1243.                 Packing -
  1244.  
  1245.                This is the simplest of the storage methods. Suppose that you  
  1246.                have a line of text and at the end of the line, you have 40 
  1247.                spaces. These 40 spaces are compressed into 3 bytes in the 
  1248.                ARC file by the "packer". The first byte is the actual 
  1249.                character to be expanded (in our case a space). The second  
  1250.                byte is a special "flag" byte that indicates that we need to 
  1251.                expand these bytes when we extract the file. The third byte 
  1252.                is the count byte (in our case it would be 40). So you can 
  1253.                see that any time the ARC'er finds repeated bytes like this, 
  1254.                it can compress them into 3 bytes. The anomalous case to 
  1255.                watch out for here is when the count byte is the same 
  1256.                character as the "flag" byte, this proved to be a difficult 
  1257.                roach to kill !
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1293.           
  1294.                                      Page 15
  1295.  
  1296.                             ══════════════════════════
  1297.                             HUFFMAN CODING (SQUEEZING)
  1298.                             ══════════════════════════
  1299.  
  1300.  
  1301.  
  1302.                It does, at first, seem that making a file smaller would be 
  1303.                an impossible task. I will make an attempt here to shed a 
  1304.                little light on this subject since that is a question that I 
  1305.                hear pretty frequently and it is not a two minute discussion 
  1306.                question. It does require some thought.
  1307.  
  1308.                To compress a file with the Huffman algorithm, commonly 
  1309.                called squeezing, the first thing that must be done is to 
  1310.                read the file completely and count the occurrences of each 
  1311.                character. That is you count the "A" 's and the "B" 's and so 
  1312.                forth. There are 256 characters in the extended ASCII 
  1313.                character set, of which approximately 90 are "printable", 
  1314.                that is you can see them on the screen. The IBM set has more 
  1315.                "printables", but that is of no consequence, since the 
  1316.                squeezer deals only with the numbers and doesn't care whether 
  1317.                or not the file is an ASCII text file or an EXE file. Once 
  1318.                the squeezer has counted the occurrences of each character, 
  1319.                thus the frequency of occurrence, it scans the table for the 
  1320.                characters that appear the least number of times and forms an 
  1321.                imaginary link between them, called a node. Somewhere else in 
  1322.                the tree, we will later develop a pointer that points to this 
  1323.                node. When you start putting all of these things together, 
  1324.                you will form a binary tree in memory. Confused enough ? Let 
  1325.                us try an example.
  1326.  
  1327.                We have a file that is 100 bytes long and has 6 different 
  1328.                characters in it. We have counted the occurrence of each of 
  1329.                the characters and found the following.
  1330.  
  1331.  
  1332.                  quantity        character
  1333.  
  1334.                           5 -    D
  1335.                          10 -    A
  1336.                          10 -    F
  1337.                          20 -    B
  1338.                          25 -    E
  1339.                          30 -    C
  1340.  
  1341.                The spelling in the file wasn't very good, but we don't care. 
  1342.                Now we take these numbers and will call them the  frequency 
  1343.                of each character. We then arrange the table as below. This 
  1344.                is an arbitrary arrangement, but it is useful here so as to 
  1345.                make our tree readable on the screen. The arrangement makes 
  1346.                no difference.
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1355.           
  1356.                                      Page 16
  1357.  
  1358.                 Frequency        20      10      5       10      30      25
  1359.  
  1360.                 Character        B       A       D       F       C       E
  1361.  
  1362.  
  1363.                We then examine the table to find the two characters with the 
  1364.                smallest frequency of occurrence. In our case, it is obvious 
  1365.                that one of them is 5,but which 10 do we choose. As it turns 
  1366.                out, it doesn't matter which one you choose, we will 
  1367.                arbitrarily choose the F. We draw lines from the D and the F 
  1368.                to form our node (the box below).
  1369.  
  1370.  
  1371.                 Frequency        30      10     5        10      20      25
  1372.  
  1373.                 Character        C       A      D         F       B       E
  1374.                                                 \        /
  1375.                                                  \      /
  1376.                                                    ╔══╗
  1377.                                                    ║15║ = 5 + 10
  1378.                                                    ╚══╝
  1379.  
  1380.  
  1381.                The number in the box is the sum of the frequencies of the D 
  1382.                and F characters. Now we again look for the lowest two 
  1383.                frequencies, except, this time we do not consider the D and F 
  1384.                characters individually, we instead consider the node. The 
  1385.                lowest two now are the A and the node, that is 10 and 15. We 
  1386.                again do some artwork.
  1387.  
  1388.  
  1389.                Frequency      30      10         5        10      20      25
  1390.  
  1391.                Character       C      A          D         F       B      E
  1392.                                       \          \       /               
  1393.                                        \          \     /
  1394.                                         \          ╔══╗
  1395.                                          \         ║15║ = 5 + 10
  1396.                                           \        ╚══╝
  1397.                                            \      /
  1398.                                             \    / 
  1399.                                              ╔══╗
  1400.                                              ║25║ = 10 + 15
  1401.                                              ╚══╝
  1402.  
  1403.  
  1404.                We look at the table again for the next two lowest 
  1405.                frequencies and now find B and E. We continue in this  
  1406.                fashion until the entire "tree" is built, that is until it 
  1407.                all condenses to one node. The leaves are the actual  
  1408.                characters at the top of the tree and the nodes represent 
  1409.                branch joints with the root at the bottom.
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1417.           
  1418.                                      Page 17
  1419.  
  1420.                 Frequency    30        10        5        10    20        25
  1421.  
  1422.                 Character    C         A        D         F     B        E
  1423.                               \         \       \         /      \       /
  1424.                                \         \       \       /        \     /
  1425.                                 \         \         ╔══╗            ╔══╗
  1426.                                  \         \        ║15║            ║45║
  1427.                                   \         \       ╚══╝            ╚══╝
  1428.                                    \         \      /              /
  1429.                                     \         \    /              /
  1430.                                      \         ╔══╗              /
  1431.                                       \        ║25║             /
  1432.                                        \       ╚══╝            /
  1433.                                         \       /             /
  1434.                                          \     /             /
  1435.                                           ╔══╗              /
  1436.                                           ║55║             /
  1437.                                           ╚══╝            /
  1438.                                             \            /
  1439.                                              \          /
  1440.                                                 ╔════╗
  1441.                                                 ║ROOT║
  1442.                                                 ╚════╝
  1443.  
  1444.  
  1445.                Now that our tree is made up, we can encode the file. We 
  1446.                start at the root (always). To encode the first character 
  1447.                (leaf) of the tree (the letter C), we trace up the tree until 
  1448.                we hit the letter C at the top. Along our journey, if we make 
  1449.                a left turn, we record a 0 bit, and a 1 for a right turn. So 
  1450.                for the C, we would go left to 55 (and record a 0) and then 
  1451.                left again to the letter C (and record another 0),so the 
  1452.                Huffman code for our letter C is 00. For A we go left to 55, 
  1453.                right to 25 and left to A and it becomes 010. By doing all of 
  1454.                the letters this way, we find the following.
  1455.  
  1456.  
  1457.                          C = 00          ( 2 bits )
  1458.                          A = 010         ( 3 bits )
  1459.                          D = 0110        ( 4 bits )
  1460.                          F = 0111        ( 4 bits )
  1461.                          B = 10          ( 2 bits )
  1462.                          E = 11          ( 2 bits )
  1463.  
  1464.                Mind that the zeroes and ones above are bits and not bytes. 
  1465.                Each character was represented in the original file by 8 bits 
  1466.                (one byte) and since we have reduced the number of bits 
  1467.                needed to represent each character, we therefore reduce the 
  1468.                size of the file. The savings add up as follows,
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1479.           
  1480.                                      Page 18
  1481.  
  1482.                 character  frequency     original bits    squeezed bits  savings
  1483.  
  1484.                 C            30           30 x 8 = 240      30 x 2 = 60    180
  1485.                 A            10           10 x 8 = 80       10 x 3 = 30     50
  1486.                 D             5            5 x 8 = 40        5 x 4 = 20     20
  1487.                 F            10           10 x 8 = 80       10 x 4 = 40     40
  1488.                 B            20           20 x 8 = 160      20 x 2 = 40    120
  1489.                 E            25           25 x 8 = 200      25 x 2 = 50    150
  1490.                          ══════════               ══════            ═════  ═════
  1491.                 Totals      100                    800              240    560
  1492.                                                     │                │
  1493.                            original file size ──────┘                │
  1494.                            squeezed file size ───────────────────────┘
  1495.  
  1496.  
  1497.                240 is 30% of 800, so we have compressed this file by 70%. 
  1498.                Golly Wally, that seems pretty good. The rub lies in the fact 
  1499.                that in order to reconstruct the original file, we must have 
  1500.                access to the decode tree and since each tree will be 
  1501.                different for each file, we must therefore save the tree with 
  1502.                the file. It turns out that the tree can have only 256 nodes 
  1503.                in a bytewise compression technique and each node will hold 4 
  1504.                bytes as pointers,a full table will be about 1k long. The 
  1505.                table in our example has 5 nodes plus the 6 leaf nodes (where 
  1506.                our characters are), totaling 11. 4 times 11 is 44 and if we 
  1507.                add a few bytes for storing the node count and some other 
  1508.                statistics, our table is about 50 bytes long. If we look at 
  1509.                the 240 in the above table this gives the total number  of 
  1510.                bits that it will take to encode the file, divide 240 by 8 to 
  1511.                get the number of bytes (30) and add it to our 50, we get a  
  1512.                compressed file size of 80 bytes. Since our original file was 
  1513.                100 bytes, we have achieved a 20% reduction in file size. Not 
  1514.                bad. What we have really accomplished is a translation of 
  1515.                character sets, with our new set requiring less space than 
  1516.                the original ASCII set.
  1517.  
  1518.                 How far can we go ?
  1519.  
  1520.                If we look at the maximums that we can obtain for the 
  1521.                different bit combinations in a optimally skewed tree, that 
  1522.                is a tree that is not exactly symmetrical, we find that we 
  1523.                can have only 4 - 2 bit codes, 8 - 3 bit codes, 16 - 4 bit 
  1524.                codes, 32 - 5 bit codes, 64 - 6 bit codes, 128 - 7 bit codes, 
  1525.                the remaining 4 will be 8 bit codes.
  1526.  
  1527.  
  1528.                                  2       - 1 bit codes
  1529.                                  4       - 2 bit codes
  1530.                                  8       - 3 bit codes
  1531.                                  16      - 4 bit codes
  1532.                                  32      - 5 bit codes
  1533.                                  64      - 6 bit codes
  1534.                                  128     - 7 bit codes
  1535.                               --------
  1536.                                  254
  1537.  
  1538.  
  1539.  
  1540.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1541.           
  1542.                                      Page 19
  1543.  
  1544.                And since we have a total of 256 different bytes to encode, 
  1545.                the remaining 2 characters  must have 8 bit codes. If we add 
  1546.                the number of bits that this represents,we find a total of 
  1547.                1554 bits or 195 bytes. So at maximum, we have compressed the 
  1548.                256 bytes to 195 or 33%, thus the idealistic  maximum that 
  1549.                can be  achieved with the Huffman algorithm is 33% when using 
  1550.                a byte level implementation.
  1551.  
  1552.                One final note; The Huffman scheme requires the input file to 
  1553.                be read twice, once to count characters and frequencies and 
  1554.                then again to do the  actual encoding. The major differences 
  1555.                in Huffman coding and  crunching lie in the fact  that 
  1556.                crunching is a one pass operation and does not require the 
  1557.                table to be stored with the file. Both, however, are 
  1558.                extremely vulnerable to errors, for example, imagine what 
  1559.                would happen if you skipped one bit when squeezing the file, 
  1560.                all of the remaining characters in the file would  become the 
  1561.                proverbial garbage, since we are looking at the file on a bit 
  1562.                level.
  1563.  
  1564.  
  1565.                NARC uses the method described in K. & R. pp. 130 for setting 
  1566.                up the binary tree with several modifications. The simple 
  1567.                binary tree is acceptable for this, since the tree never 
  1568.                grows and therefore will never become unbalanced.
  1569.  
  1570.                If you followed that, now go back and read the second 
  1571.                paragraph again, maybe it will make sense this time.
  1572.  
  1573.                             ══════════════════════
  1574.                                   CRUNCHING
  1575.                             ══════════════════════
  1576.  
  1577.  
  1578.                Crunching began with an article by J. Ziv and A. Lempel in 
  1579.                IEEE Trans. Information Theory, May 1977, where the method 
  1580.                was originally described. Terry A. Welch wrote a definitive 
  1581.                application article in IEEE Computer, June 1984 which 
  1582.                described in detail how to apply the algorithm and some  
  1583.                common problems encountered. Thus the name LZW compression.
  1584.  
  1585.                Crunching takes the Huffman coding method a step further as 
  1586.                it does not include a table with the crunched file. The 
  1587.                crunching algorithm also "learns" as it proceeds through the 
  1588.                file. If it finds repeated strings in the file, they will be 
  1589.                encoded into a table. This table is set up (in NARC's 
  1590.                implementation) as a 4096 by 3 table. Each entry is formatted 
  1591.                as <PREF>,<SUFFIX>, where PREF is a 2 byte pointer to another 
  1592.                entry. SUFFIX is the byte for this entry. Representing the 
  1593.                PREF's as pointers rather than values speeds up most 
  1594.                operations in NARC. This idea came from Bob Freed and is very 
  1595.                trick.
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1603.           
  1604.                                      Page 20
  1605.  
  1606.                One obvious benefit of crunched files is the fact that there 
  1607.                is no need to  include the encoding table in the compressed 
  1608.                file as was the case with squeezing. Another great benefit is 
  1609.                the fact that     crunching is a one pass operation as 
  1610.                opposed to the two pass situation in squeezed files.
  1611.  
  1612.                Crunching begins by creating an "atomic" table, that is a 
  1613.                table in RAM that contains 256 entries, one for each 
  1614.                character in the extended  ASCII set. The values range 
  1615.                sequentially from 0 to 255. The table entries are arranged as 
  1616.                follows.
  1617.  
  1618.                          Prefix Pointer (2 bytes) and Suffix byte (1 byte)
  1619.  
  1620.                In this initial table setup, the Suffix bytes are the 0 
  1621.                through 255 mentioned above. These are the "atomic"  
  1622.                characters, in that they must be in the table  before  
  1623.                crunching or uncrunching can begin, since all files contain  
  1624.                some portion of this character set. We do not know which 
  1625.                characters will be included in any given file and which ones 
  1626.                will be excluded,so we must include them all in our initial 
  1627.                table. Once this table is set up, we can begin crunching.
  1628.  
  1629.                The Prefix pointer will contain a value that is a pointer to 
  1630.                another string. When the table is initially set up, there are 
  1631.                no other strings, so this Prefix pointer is set to a special 
  1632.                "Null" string, that is it points nowhere. We must be careful 
  1633.                when crunching the file, to look for this special pointer and 
  1634.                act accordingly when we encounter it.
  1635.  
  1636.                This Prefix and Suffix business is used to "build" long 
  1637.                strings. If we read the input file and found that the first 
  1638.                character was the letter "I", we would look this letter up in 
  1639.                the string table by hashing (computing an address). If we 
  1640.                found the letter in the table (which we certainly will on the 
  1641.                first character), then we output it's "hashed" address as a 
  1642.                code to the output file (the crunched file). Suppose then, 
  1643.                that the next character input from the file was the letter 
  1644.                "D", the cruncher would then look at the I and the D together 
  1645.                to see if they exist as a string in the table. Well of 
  1646.                course, since this is the second character of the file, we 
  1647.                know that it doesn't, so the cruncher forms a new entry in 
  1648.                the string table. This entry has  as its' Prefix pointer, a 
  1649.                value that "points" to the letter "I" entry in the table, 
  1650.                that we made a minute ago. The suffix byte in this case would 
  1651.                be the letter "D". Now another code is output to the crunched 
  1652.                file, representing the letter "D". Well this is great,  we  
  1653.                have  now turned 2 bytes from the input file (16 bits) into 3 
  1654.                bytes in the output file (24 bits). You are correct, 
  1655.                crunching begins by  "not crunching" , but it is a crazy 
  1656.                world ! The real value becomes apparent when we  run into 
  1657.                this same sequence "ID" in the input file again. Now we will 
  1658.                find an entry for it in the string table and we can  output a 
  1659.                single 12 bit code that stands for "ID", thus saving 4 bits. 
  1660.                The cruncher continues "learning" strings like this until the 
  1661.                file is crunched. It should be noted that the string table is 
  1662.                dynamically changing as the input file is processed.
  1663.  
  1664.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1665.           
  1666.                                      Page 21
  1667.  
  1668.  
  1669.                The early versions of crunching implemented, stopped 
  1670.                "learning" once the string table was full. This gave a very 
  1671.                poor compression ratio in some files. Versions 8 and 9 have 
  1672.                an additional feature called adaptive reset, where the string 
  1673.                table is cleared and crunching begins all over again ! This 
  1674.                capability really helps the larger files more than smaller 
  1675.                files.
  1676.  
  1677.  
  1678.  
  1679.  
  1680.                              Details of Storage Versions
  1681.  
  1682.  
  1683.                  NARC supports all of the current "skrunching" algorithms. A 
  1684.                brief description of each follows.
  1685.  
  1686.                                       Version    1
  1687.  
  1688.                 - "STORED" File is simply stored (obsolete now, 25 byte 
  1689.                header)
  1690.  
  1691.                  NOTE: Files stored with this version are rare.
  1692.  
  1693.                                       Version    2
  1694.                
  1695.                -  "STORED"  Current  version of  simple  storage.  This  
  1696.                version was implemented with the implementation of  file 
  1697.                compression.  The main difference in version 1 and 2  is 
  1698.                the  ARC header  (see header section below),  version  1 
  1699.                has a header length 4 bytes smaller than any of the rest 
  1700.                of the storage  methods since in  version 1 there was no 
  1701.                need to  store the  original file length separately from 
  1702.                the stored file length since they were the same.
  1703.  
  1704.                                       Version 3
  1705.  
  1706.                -  "PACKED" Repeated bytes are packed into a three  byte 
  1707.                string (see Packing above)
  1708.  
  1709.                                       Version    4
  1710.             
  1711.                - "SQUEEZED" after packing. The file is first packed  as 
  1712.                described above and then squeezed
  1713.  
  1714.                                       Version    5
  1715.  
  1716.                -  "CRUNCHED"  This is the first implementation  of  LZW 
  1717.                released. Uses fixed length codes and a complex  hashing 
  1718.                function. (obsolete now) (See hashing below)
  1719.  
  1720.                  NOTE: Files compressed with this version are hard to find.
  1721.                        Version was released only one month when next version
  1722.                        came out.
  1723.  
  1724.                                       Version    6
  1725.  
  1726.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1727.           
  1728.                                      Page 22
  1729.  
  1730.  
  1731.                - "CRUNCHED" after packing. The file is first packed and 
  1732.                then  crunched.  Uses fixed length codes  and  the  same 
  1733.                hashing function as version 5.
  1734.  
  1735.                                       Version    7
  1736.  
  1737.                -  "CRUNCHED" after packing. Same as version 6 except  a 
  1738.                faster hashing function is used.
  1739.  
  1740.                  NOTE: Thom Henderson (author of ARC) has this to say about
  1741.                        version 7. "This approach was abandoned because dynamic
  1742.                        Lempel-Ziv works as well, and packs smaller also. However
  1743.                        inadvertent release of a developmental copy forces us to
  1744.                        leave this in."
  1745.  
  1746.  
  1747.                                       Version    8
  1748.  
  1749.                -  "CRUNCHED" after packing. Uses variable length  codes 
  1750.                in  the  crunched file (9 to 12 bits) and has  a  faster 
  1751.                hash function (actually not hashing at all, but for  the 
  1752.                sake of consistency, we will call it that). This version 
  1753.                also resets the string table when it becomes full  which 
  1754.                benefits  the  compression ratio of larger  files.  This 
  1755.                resetting is commonly called an adaptive reset.
  1756.  
  1757.  
  1758.                                       Version    9
  1759.  
  1760.                -  "SQUASHED"  (variation on  crunching  scheme).  This 
  1761.                version uses the same hashing function as version 8  but 
  1762.                varies  the crunching codes from 9 to 13 bits. There  is 
  1763.                also  no  packing, which affords the  string  table  the 
  1764.                opportunity to "learn" longer codes and thus improve the 
  1765.                compression ratio (benefits "real large" files).
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1789.           
  1790.                                      Page 23
  1791.  
  1792.  
  1793.  ARC file header structure is same for both DOS and CP/M
  1794.  
  1795.  Byte number             Value(s)        Meaning
  1796.   ══════════════════════════════════════════════════════════════════════════
  1797.          1               1Ah             Header Flag
  1798.          2               0-9             Compression Version
  1799.          3-15            ---             ASCIIZ compressed filename
  1800.          16-19           ---             Compressed file size in bytes
  1801.                                          Low Word, High Word with each word
  1802.                                          in LoHi format
  1803.          20-21           bits            DOS date format
  1804.                          15-9            Year
  1805.                           8-5            Month
  1806.                           4-0            Day        (all zeroes means no date)
  1807.          22-23           bits            DOS time format
  1808.                          15-11           Hours (military)
  1809.                          10-5            Minutes
  1810.                           4-0            Seconds
  1811.          24-25           ---             CRC-16 in LoHi format of uncompressed
  1812.                                          file. ------- This is important.
  1813.          26-29           ---             Original uncompressed  file size
  1814.                                  NOTE:   Version 1 files are not compressed
  1815.                                          so the length can be  found with
  1816.                                          bytes 16-19, also the header len
  1817.                                          for version 1 files is 25 bytes.
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1851.           
  1852.                                      Page 24
  1853.  
  1854.                 Hashing.....
  1855.  
  1856.                Hashing is simply an arithmetic way of coming up with an 
  1857.                address in a table. You have a set of input numbers (codes) 
  1858.                that will map one-to-one with the output codes in an ideal 
  1859.                situation. That is, each time you input a certain number, you 
  1860.                can rest assured that the output will always return the same 
  1861.                output number. This is not quite the case in the current 
  1862.                versions of .ARC files. The reason is that the algorithm 
  1863.                would require a MEG or so of RAM for implementation. The 
  1864.                utilization of a smaller string table in all of the ARC 
  1865.                programs introduces the possibility of producing the same  
  1866.                output number for 2 or more input numbers. This is called a 
  1867.                hash collision. This is handled separately in .ARC files with 
  1868.                what is called a "collision table", which helps to locate the 
  1869.                correct table entry.
  1870.  
  1871.  
  1872.                  There are three versions of "hashing" used in ARC files.
  1873.  
  1874.  Hash1   - Key = upper 12 bits of lower 18 bits of unsigned square of
  1875.                  (prefix code + suffix byte) OR 800h
  1876.  
  1877.                  Used in stowage versions 5 and 6
  1878.  
  1879.  Hash2   - Key = lower 12 bits of unsigned product of
  1880.                  (prefix code + suffix byte) * 15073
  1881.  
  1882.                  Used in stowage version 7
  1883.  
  1884.  Hash3   - Key = next available address in table.
  1885.  
  1886.                  Used in stowage versions 8 and 9
  1887.  
  1888.  
  1889.  
  1890.  
  1891.          CRC calculations -
  1892.  
  1893.                NARC does not use the traditional table lookup method for 
  1894.                calculating the CRC of the file. The table approach requires 
  1895.                the table to be in RAM and takes up more space. NARC 
  1896.                calculates the CRC on the fly, which  requires no table and 
  1897.                saves space. The algorithm is taken from the definitive 
  1898.                article by Aram Perez in IEEE Micro, June '83. The polynomial 
  1899.                is X^16 + X^15 + X^2 + X^1 which is not compatible with the 
  1900.                Xmodem CRC.
  1901.  
  1902.  
  1903.                                      Gary Conway
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.      NARC.DOC   Copyright (c) 1987-89   Infinity Design Concepts, Inc.
  1913.           
  1914.                                      Page 25
  1915.  
  1916.                         ══════════════════════════════
  1917.                         ARC RELEASE DATES AND VERSIONS
  1918.                         ══════════════════════════════
  1919.  
  1920.  
  1921.  
  1922.                These are the various versions of ARC.EXE that I have and 
  1923.                what versions of storage they supported. PKxARC supports all 
  1924.                of these methods as well since they were all originally 
  1925.                created by ARC.EXE.
  1926.  
  1927.  
  1928.          Date                                   Stowage Methods
  1929.          Released        Version                   Supported
  1930.  
  1931.          05-01-85        3.10            Storing,Packing,Squeezing  (1-4)
  1932.                                            ( version 5 in here somewhere)
  1933.          06-26-85        4.10            Up to version 6 of crunching
  1934.          11-18-85        4.50            Up to version 6 of crunching
  1935.          12-04-85        4.52            Up to version 6 of crunching
  1936.                                            ( version 7 in here somewhere)
  1937.          01-21-86        5.00            Up to version 8 of crunching
  1938.          01-31-86        5.10            Up to version 8 of crunching
  1939.          02-05-86        5.12            Up to version 8 of crunching
  1940.          10-24-86        5.20            Up to version 8 of crunching
  1941.  
  1942.  
  1943.                This list is compiled in an attempt to start some kind of 
  1944.                historical record as to what transpired in the ARC world. I 
  1945.                would be interested in hearing of additions.
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  End of NARC.DOC   Copyright (c) 1987,88    Infinity Design Concepts, Inc.
  1975.           
  1976.                                      Page 26
  1977.