1
2
Fork
You've already forked asm
0
Playing around with assembler
  • Assembly 57.4%
  • C 35.8%
  • Makefile 6.8%
Find a file
2025年03月13日 13:31:05 +01:00
doc Update README.md 2025年03月13日 12:19:17 +01:00
msdos Another small size optimization 2025年03月13日 08:41:17 +01:00
msx Note on hundreds 2025年03月07日 10:33:01 +01:00
tools Mode bit in LSB saves us 5 bytes 2025年03月13日 01:27:47 +01:00
.editorconfig Editorconfig for Codeberg's rendering 2025年03月07日 01:04:40 +01:00
.gitignore Ignore .idea/ 2025年03月13日 08:41:39 +01:00
LICENSE.md Initial import 2025年03月07日 01:01:42 +01:00
Makefile Account for dependencies in top-level Makefile 2025年03月13日 13:30:54 +01:00
README.md Update dependency list 2025年03月13日 13:31:05 +01:00

ASM toys

Playing around with assembly.

Check out fizzbuzz.asm for MSX:

FizzBuzz on openMSX

...swatch.asm for MS-DOS:

VGA swatch on DOSBox

Custom RLE

Zuidas picture on DOSBox

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.