I adapted your code to an 8086 (segmented memory) depacker
ecm-pushbx opened this issue · 3 comments
ecm-pushbx commented
Like I did with your LZSA2 depacker before, I adapted your "size-optimized aPLib decompressor for 8088" for use in my 86-DOS kernel/executable format. It is available in my hgweb repo.
The changes that I had to do:
- Use bp for stack frame to access variables throughout
- Count down remaining lengths of source and destination (needed to detect success or failure with overlapping buffers, also provides simple error checking)
- Use far pointers throughout, which are normalised after every use
- Add stack frame variables for the high words of distance and gamma
- Allow matches with >= 64 KiB distance and/or >= 64 KiB length
- Allow overlapping buffers by checking the pointers after matches and match bytes
emmanuel-marty commented
Thanks! I will link to your Mercurial repos for both depackers. If you use it in production I'll be happy to link to your projects as well.
emmanuel-marty commented
Thanks again, link added to the README
ecm-pushbx commented
In 8f354ae did you mean to delete the link to the i8080 decompressors?