Zip/unzip commands for cx16shell on Commander X16.
  • Lua 99.3%
  • Makefile 0.7%
Find a file
2026-03-14 20:44:02 -04:00
lib Cosmetics 2026-03-14 20:44:02 -04:00
.gitignore Initial commit 2026-03-13 21:15:13 -04:00
Makefile Support deflating files 2026-03-14 20:12:13 -04:00
README.md Cosmetics 2026-03-14 20:44:02 -04:00
unzip.p8 Refactor and rename switches. 2026-03-14 18:20:31 -04:00
zip.p8 Support deflating files 2026-03-14 20:12:13 -04:00

X16 Zip

This is a bare-bones zip/unzip program for Commander X16, written in Prog8.

It runs under cx16shell, which uses ISO mode. It loads at $4000 and operates as an external command: put it in /SHELL-FILES/COMMANDS/ZIP(/UNZIP), now you can run zip and unzip at the cx16shell command line.

Usage:

$ zip
usage: zip [-h] [-d|-l] archive.zip [file...]

$ unzip
usage: unzip [-h] [-v] [-o] archive.zip [file...]

$

For zip, -d means "delete these files from the archive" and -l means "list the files in the archive". For unzip, -v means "view the list of files in the archive". -o means overwrite destination files without asking.

Limitations

It can't compress or uncompress files >64k. It can't handle archives with >64 files in them. I bet there are all sorts of bugs around subdirectories.

License

None. This is provided with no warranty, or even any claim to authorship.

Authorship, and LLM Use

I was playing with Claude Code for another project, and figured I'd just ask it to give me a zip utility, in the background. This is what it came up with (after asking me like 200x whether it could run grep or find).

I intend to use, share, and maintain this code, but Claude Code wrote it. It used the prog8 documentation, the X16 ROM source and documentation, the PKZip file format spec, a reference CRC32 implementation, and the prog8 examples in its repo.

It initially wrote a prog8 program with a BASIC wrapper (even though I told it to use the get-program-args functions), so I turned it into a cx16shell command (just by adding/removing the right compiler directives).

It had a couple of bugs (crc math, pointer/buffer confusion), but it fixed them after I described the symptoms.