Skip to content

Repository files navigation

MinZ logo: a mint-green shamrock

MinZ

MinZ is an experimental compiler toolchain for writing programs for Z80 machines with modern language features. Nanz is its main source language; Frill, C, Pascal, ABAP and other frontends also feed the shared HIR → MIR2 pipeline. The repository includes a Z80 assembler and emulators, so a small program can go from source to execution here.

The project is active research: examples and targets have different levels of maturity. Start with a runnable program below; use the current handover, ranked backlog, and dated technical audit for measured status.

Run a program

Install Go, then from the repository root:

git clone https://github.com/oisee/minz.git
cd minz
make -C minzc mz mza mze
mkdir -p build
minzc/mz examples/nanz/hello_cpm.nanz --target cpm -o build/hello.a80
minzc/mza build/hello.a80 -o build/hello.com
minzc/mze build/hello.com -t cpm

The emulator prints Hello!. The Nanz source is small enough to modify and rerun. For more programs, see fun and examples.

What you can make

ObjC plasma Nanz canvas Nanz rotozoomer
Plasma rendered by the MIR2 VM House drawn by Nanz canvas functions Animated Nanz rotozoomer
ObjC source Nanz source Nanz source

These images are current MIR2 VM canvas renders. Build mzv with make -C minzc mzv, then run python3 scripts/build_rotozoomer_gif.py to regenerate the GIF (requires Pillow). Run cd minzc && go test ./pkg/c89 ./pkg/nanz -run '^(TestPlasmaRender|TestCanvasImplShowcase|TestRotozoomerGallery)$' -count=1 to compare the gallery with the current source. The CP/M example above exercises the Z80 path. Gallery verification · Rotozoomer details.

Explore

MinZ is released under the MIT license.

About

Minz /mɪnts/ - neo compiler for Z80. Features lambdas, SMC, provable optimal RegAlloc and ABI-per-function, seamless ASM integration, Compile-time execution, OOP-like experience via UFCS. Can compile: Nanz, Lizp, PL/M, Pascal, C89, Frill (F#), ABAP. Optimized Z80 assembly for retro/embedded.

Topics

Resources

Contributing

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages