squeeze
=======

squeeze takes an ARM executable image file and compresses it, usually
to about half the size, adding decompression code so that the image
will automatically expand itself when it is run.

[sbrodie note:
  the code is not (yet) suitable for StrongARM, so the UnsqueezeAIF
  module patches the decompress code generated by this tool so that
  it does work.  You must not change the unsqueeze code without
  similarly informing xpand and RiscOS/Sources/HWSupport/UnsqueezeAIF
  of the change too.
]

Briefly, the image is treated as a sequence of 32-bit words, and each
word is encoded in one of four ways, specified by a 4-bit nibble:

  zero -> nibble 0
  the 7*256 most common word values are encoded with one byte extra as
  an index into a table
  the 7*256 most common upper-3-byte values are encoded with one byte
  extra as index into another table, with the low byte separate
  anything else is given in full as 4 bytes.

The tables of common values are sorted into ascending order
and encoded in a devious way.


As of version 5.02, the code appended to the AIF imagine checks
that there is sufficient memory to unsqueeze the data without
data aborting (exceeding the Wimp slot) or overwriting any caller
application (eg. if squeezed app is a subtask launched by amu)

Sources in Tools/Sources/squeeze (originally on Aquarius)

--sbrodie, 21 Jun 1999
