Playing around with assembler
- Assembly 57.4%
- C 35.8%
- Makefile 6.8%
| doc | Update README.md | |
| msdos | Another small size optimization | |
| msx | Note on hundreds | |
| tools | Mode bit in LSB saves us 5 bytes | |
| .editorconfig | Editorconfig for Codeberg's rendering | |
| .gitignore | Ignore .idea/ | |
| LICENSE.md | Initial import | |
| Makefile | Account for dependencies in top-level Makefile | |
| README.md | Update dependency list | |
ASM toys
Playing around with assembly.
Check out fizzbuzz.asm for MSX:
...swatch.asm for MS-DOS:
Custom RLE
zuidrl2.asm uses a custom compression scheme. It's based on regular run-length encoding, where a prefix byte indicates how often the next byte is to be repeated, but adds a flag for "verbatim copy" mode to deal with high-entropy (non-repeating) sequences like the bottom half of our test image. The flag is in the lower bit so that one bit shift tests it (CF flag) and puts the count in place.
| Program | Encoding | Data size | Ratio | Decoder |
|---|---|---|---|---|
| zuidas.ams | raw | 64,000 B | 100% | 4 B |
| zuidrle.asm | plain RLE | 50,331 B | 79% | 10 B |
| zuidrl2.asm | custom RLE | 35,852 B | 56% | 16 B |
Running
Building requires 'make', a C compiler and libpng (for the conversion tools), NASM, and non-GNU z80asm:
make
Building only targets for specific platforms:
make msx
make msdos
Running MSX targets with openMSX:
openmsx msx/hello.rom
openmsx msx/fizzbuzz.rom
Running MS-DOS targets with DOSBox:
dosbox msdos/swatch.com
dosbox msdos/zuidrl2.com
Author
By Sijmen J. Mulder (ik@sjmulder.nl). See LICENSE.md.