Re: LZ: New idea for compression program!
[Prev][Next][Index][Thread]
Re: LZ: New idea for compression program!
On Tue, 10 Sep 1996, Scott J. Rein wrote:
> >You really can't put the code in the decompression
> >program that's going to figure out if the decompression
> >program is there or not, or figure out if there isn't
> >enough ram to run the decompression program.
> >
> >It's tempting to get real fancy with this but sometimes simple
> >is better.
>
> I know... it is tempting. But I don't really understand why.
> If the calling program will pass the compressed string info
> on to the decompression program, why can't the decompression
> program be set up to calculate if there is enough space. What
> is the diffence between putting it there and in every single
> compressed string?
If the string contains the code to run the decompression
program it will also have to contain the code to decide
first if the decompression program is there or not, and
if so, where. Assuming the decompression program needs
some memory to run in, the calling program will also need
to decide if there is enough memory and refuse to call the
decompression program if there isn't.
If it were me, I would keep it real simple. I would have
zshell run the decompression program which would make an
uncompressed copy of the string and execute it. Then,
when the copy is finished it will do a ret and return to
the decompressor, which will do a ret and return to zshell.
I'd also try real hard to avoid having either zshell or
the target program know anything about the compression,
even if that means giving up some features. Flexibility
is much more important.
There's been some discussion of changing PROGRAM_ADDR in
zshell. I would only do that after discussing it with the
zshell people, and only with their approval. Also, I would
find out if it has to be restored before exiting.
Also, what other features of zshell might have to be dealt
with. Is PROGRAM_ADDR the only one?
Memory is going to be needed to decompress the program into.
I have no idea how that memory is obtained in zshell. Does
it have memory allocation routines or do you have all the
rest of the calcs memory or is there no real control? I
haven't seen any discussion of this yet. The memory needs
to be there and your program has to know it's there and know
how much, if possible.
Barry
References: