TempleOS - 5-Minute Random Code Walk-Thru #9 (mzkLAlYlbbo)

Explains Kernel `ExpandBuf` and `CompressBuf` behavior in TempleOS and how the LZW-based routine tracks compressed and expanded sizes, including partial-buffer control with an ARC control structure. Discusses the 12-bit dictionary model, a 7-bit ASCII optimization, and the use of hand-written assembly for performance with his compiler. Connects the byte-oriented method to efficient `.GR` graphics compression under 16-color constraints.

Copyright © 2023 - 2026 Serhii Zasenko. All rights reserved