[A83] Re: Is compression possible?
[Prev][Next][Index][Thread]
[A83] Re: Is compression possible?
On Thu, 25 Apr 2002, Darren wrote:
> Patrick Davidson wrote:
>
> > The Lite86 decompression code from the TI-86 (which would also run on a
> > TI-83+) is only about 50 bytes in size. So unless the compression
> > decreases a program's size by less than 50 bytes, the self-extracting
> > compressed program would be smaller. And even if the gain is small,
> > giving output that is 80% of the original, that could still make the
> > difference between being able to have 25 games on your TI-83+ versus only
> > 20 without it.
>
> Wow! Do you know which algorithm it uses? I wrote a simple LZSS decompressor
> which weighed in at just under 200 bytes (not really optimized, tho).
>
> A compressor, OTOH, would certainly be a quite bit larger.
>
> I'll see if I can squeeze a few more bytes out of my program :P
You can look at the source code to see what it is doing. I don't know the
precise name for the algorithm, but it uses simple offset-length
enconding. The decompression code certainly does look very well optimized
in this case. As for the compressor, that certainly would be larger, but
not much larger since the compression is not terribly complex. Probably a
larger concern should be that the compression might be very slow on-calc,
since you have to compare data at each byte boundary with the data at each
previous boundary back 2048 bytes. So for a 10K program, 20 million
comparisons, or 400 million clock cycles (about a minute) if each takes 20
clock cycles (which would seem fairly good).
Follow-Ups:
References: