Subject: GC compressor (fixed)
[This is a repost of the GZ compressor, the GC trick used by the GZ in the
now cancelled post used A=A+CON A,16 instead of A=A+CON A,10 as it should.
This caused the rpl for doing GC not to start, but PC would be set to a
location causing unpredictable behaviour. This happened whenever there was
insufficient memory to uncompress without doing garbage collection. Thanks to
Moz for noticing the bug. Original article with the fixed files follows.]
Here is a new compressor for HP48. Very fast, quite efficient, directed for
compressing *LARGE* objects. Will work on any HP48 revision, also from
covered GX banks.
The compressor uses LZSS algorithm. Matches are found by separate chaining in
a ring buffer. 4096 hashes, ring size 4096, thus memory requirement is
quite large - 26624 bytes. Makes compression kind of hard on some HP48
revisions. For further information please refer to the source code.
For speed GZ will turn off the display. Progress will be shown by rotating
the annunciators every time a match is found, depending on the object to be
compressed this can be very fast. ON-key will abort compression. After
compression is done the efficiency is shown in the status area, following
sample is for GZ.S when compressed on my GX rev P:
+----------------------------------+
| SIZE: 10195 -> 5018 | old -> new bytes
| %CH : -50.78 TIME: 9.695 | %CH + execution time
PK users may remove UPK/PK, they are no longer supported. The format is
slightly different so better UPK any compressed object first. Also you will
need the latest Jazz or GNU Tools to compile the source code due to the new
opcodes. (Please, no email about either.)
All rights reserved. Permission to include non-modified GZ in non-commercial
software granted as long as the name is retained (I've tested too many
compressors only to find RF). Permission to use the uncompressor section only
in non-commercial programs granted.