%if 0 8086 Assembly LZ4/LZSA2/LZSA1 depacker test executable by E. C. Masloch, 2022, 2026 Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. %endif %include "lmacros1.mac" numdef LZ4 strdef PAYLOAD, "" cpu 8086 org 256 section _TEXT start: jmp test %if _LZ4 %include "lz4.asm" %else %include "lzsa.asm" %endif test: mov di, buffer push es push di mov si, payload push ds push si push cs %if _LZ4 call _lz4_depack %else call _lzsa_depack %endif int3 mov ax, 4C00h int 21h align 16 payload: %ifnidni _PAYLOAD, "" incbin _PAYLOAD %elif _LZSA2 incbin "payload.sa2" %elif _LZSA1 incbin "payload.sa1" %elif _LZ4 incbin "payload.lz4" %else %error No method selected %endif align 16 buffer: times 32768 db 26h