
                         Elmsoft TURBOCRUNCHER
                         ---------------------
 
How to use Turbocruncher
------------------------
Run the file TURBOE.BAS. The program asks you names of the file to crunch and
the compacted one it has to create.

Warning, file length mustn't be over &8500 bytes.

When you have typed all things needed, Turbocruncher loads in memory the file,
displays on screen informations about it, and waits for you acknowledgment.

After the packing process (be patient, the bigger your file is, the longer
it will take time), Turbocruncher gives you the result of it brain storming.
Then, it asks you if the decrunching routine has to be added at the start of
the packed file.

If you answer No, you have to use the decrunching routine by yourself (file
DECRUNCH.ASM to assembly with Maxam).

If you answer Yes (Why not ?), Turbocruncher needs the address IN MEMORY where
the packed program must be decompacted. It has no connexion with the loading
address of the packed file !

The packed file is freely relocatable, so you can load it in memory where you
want. Unfortunately, there is one BIG restriction, let's see it now


I want to use my packed file (decrunching routine in the packed file)
---------------------------------------------------------------------
There is one rule you DO always follow : the packed file must not use the
same memory area than the original file.

It is not clear :-). Well, a little example might help you...

You have just packed a beautiful screen, which characteristics are :

        Load address          : &C000
        Length                : &4000
        Exec address          : &0000

The new packed file has these values :

        Load address          : changeable
        Length                : &13C4
        Exec address          : changeable

So, you can load the packed file everywhere in memory, excepted in the area
&C000-&FFFF. Of course, if you works under Basic, don't damage system 
areas...

Basic loader :

        10 OPENOUT"D":MEMORY &3FFF
        20 LOAD "SCREEN.CRU",&4000
        30 CALL &4000

By default, crunched files loading address is &2000.

Please note that the decrunching routine changes values of the bytes &26 and &27
in the memory. It puts two commands to know where it has been loaded (POP HL
JP (HL)).


I want to use my packed file (no routine in the file)
-----------------------------------------------------
This way, the only limitation of TurboCruncher is the Basic buffer (&8500).
Unfortunately, it is a little bit more difficult to use (brain on).

        * When the file is packed, note the load address in memory of the packed
          file given by Turbo Cruncher.

        * Define all needed parameters in the decrunching routine. The easier
          way is to assembly the Maxam file (DECRUNCH.ASM), after having typed
          the needed informations.

The routine is free relocatable but of course, you should not put it in the
memory area used by the original file...

There is two ways to CALL the decrunching routine.

  * If the flag_perso value is &1, it uses the already defined parameters.
    Warning, the decrunching routine must have been a little bit changed,
    look at the source file. Elmsoft seems not to have predicted the fact that
    someone would use his routine this way...

  * If the flag_perso value is &0, it awaits in the IX register the beginning of
    a six bytes arrays :
        
                - Length of the packed file
                - Start in memory of the unpacked file
                - Start in memory of the packed file 

Please note this fact : a crunched program cannot be launched by the decrunching
routine. It does not take care of the exec address. Of course, you can make your
own decrunching routine...


Warning warning warning !!!
---------------------------
Sometimes, the very last bytes of a coded files cannot be decrunched 
correctly. To avoid this kind of problem, you must load in memory the crunched
code three bytes higher than the value given by TurboCruncher.

When Turbocruncher generates a 'bad' crunched file. If the file end is 
&C1 &02, &C1 is overwritten by the unpacked code (&C1 means copy 1 byte, the
byte value is the next byte). 

If the decrunching routine follows immediatly the crunched code, sometimes,
the first bytes of the routine can be overwritten by the unpack code.


News of the english release
---------------------------
I suppose you have notice the english messages !

I also tried to fix some little imperfections of the program (don't kill me
Elmar, please !).

- Turbocruncher is now dumb ! It does not produce horrible sounds during the
  crunching process...

- If you have enter a filename not present on the diskette, the program does not
  try to crunch it but shows you a nice error message...

- Binary code have been linked into only one file.

- Filenames can have now 14 characters. It gives you the capabilite to choose
  the drive where a file is located (eg : A:TEST.BIN). Useful if you work with
  two drives.

- Now you can display the directory of a diskette ! Just push the <ENTER> key
  when the program asks you for the input filename.


Well, the program is still rustic, but I love its window manager !
d into only one file.

- Filenames can have now 14 characters. It gives you the capabilite to choose
  the drive where a file