TinyLZW
Tiny LZW implementations in assembly
Install / Use
/learn @4lpha0ne/TinyLZWREADME
TinyLZW
This project is meant to become a collection of tiny variable LZW implementations in x86 (16 bit) assembly for sizecoding purposes. It is about keeping the code footprint small to use it as a decompressor for tiny executables (mostly COM files) for demoscene productions in the < 1 kB size range. Versions for Z80 and other CPUs should also be possible.
This is work in progress. Right now only a stack based variant is included. An iterative and a recursive variant will follow soon.
Implementation Details
For storing the dictionary I had the idea of using a <link, char> table structure, which ofc already had been described somewhere in the past as I found out. This means that for every new dictionary entry only the current code and the successing character have to be stored. To reconstruct the full string, the codes pointing to other dictionary entries (100h and upward) simply have to be followed recursively.
The main loop without bitstream decoder (which can vary based on the format: n bits, n-8 bits + byte, phased in binary etc.) is 29 bytes right now (working this way on P4 and later platforms due to the zero flag being set by IMUL there). There are defines to select safe/unsafe and IMUL flag behaviour variants.
The code is not fully tested. I'll add some basic tests to it soon. Right now testing is done in stepwise debugging.
License
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
