zx-fizzbuzz
2 years agofizzbuzz.s: Increment `len' in place rather than via register.
Mark Wooding [Sun, 14 Nov 2021 15:46:11 +0000 (15:46 +0000)]
fizzbuzz.s: Increment `len' in place rather than via register.

The Z80 isn't a load/store architecture, even though my RISC-programming
habits lead me to treat it like one.

2 years agofizzbuzz.s: Delete pointless calculation of new high digit position.
Mark Wooding [Sun, 14 Nov 2021 15:44:10 +0000 (15:44 +0000)]
fizzbuzz.s: Delete pointless calculation of new high digit position.

HL is already in the right place.  We only end up here if `djnz' fails,
which means we've stepped len bytes through buf, and therefore HL now
holds buf + len -- which is what we try to calculate.

2 years agofizzbuzz.s: Add a dummy high length byte.
Mark Wooding [Sun, 14 Nov 2021 15:03:23 +0000 (15:03 +0000)]
fizzbuzz.s: Add a dummy high length byte.

The length is still only one byte, but the extra zero means we can load
the BC in a single instruction rather than having to prat about with
setting up the two halves separately -- and loading C via A because of
instruction-set limitations.

2 years agoAdd a ZX81 port.
Mark Wooding [Sun, 14 Nov 2021 13:56:59 +0000 (13:56 +0000)]
Add a ZX81 port.

It seems that ZX81 emulators are awful.  This hack is the best I could
come up with.

Since I wrote the thing in ZX BASIC in an emulator, I guess
`zx81-loader.p' file is the preferred form for modification.

2 years agofizzbuzz.s: Abstract out a number of system dependencies.
Mark Wooding [Sun, 14 Nov 2021 13:55:21 +0000 (13:55 +0000)]
fizzbuzz.s: Abstract out a number of system dependencies.

Maybe you can see where this is going.

2 years agoAdd machinery for building a working `.tap' file.
Mark Wooding [Sun, 14 Nov 2021 13:53:38 +0000 (13:53 +0000)]
Add machinery for building a working `.tap' file.

I maintain the ZX BASIC loader program using FUSE, so, alas, the
`spectrum-loader.tap' file is the `preferred' form for modification.
I'd like something less awful.

2 years agoMakefile: Add a cheesy makefile.
Mark Wooding [Sun, 14 Nov 2021 13:48:11 +0000 (13:48 +0000)]
Makefile: Add a cheesy makefile.

2 years agoImport yesterday's source.
Mark Wooding [Sun, 14 Nov 2021 10:28:22 +0000 (10:28 +0000)]
Import yesterday's source.