u/Ok-Suggestion-5413

▲ 7 r/cpm

I ported Patrik Rak's Spectrum Z80 tests to CP/M 2.2

I hadn't seen this done before (though I'm sure someone has done it) and I was curious what bugs in might find in my emulator. The tests have some Spectrum dependencies and use an older assembler, so it took a little work. I ran some popular emulators with the tests. It can be found here: ntvcm/z80test-cpm at main · davidly/ntvcm

The net: there's not a lot of interesting new test coverage in these tests beyond what's available in other well-known Z80 test suites.

The only real bugs I found were in my emulator, NTVCM. Using Z80 loop instructions to create self-modifying code wasn't supported (though every other emulator I ran pass that test without a problem).

NTVCM also doesn't update the R register by default because it's unused and slows execution substantially. Once enabled with a #define those tests pass too.

Details about the results are in the link above. Some emulators don't support IN/OUT instructions (why would they?) and that causes some tests to fail.

Almost all Z80 emulators pass the well-known test ZEXDOC.COM, which covers documented instructions. Some also pass ZEXALL.COM, which covers undocumented instructions. Many emulators fail ZEXALL.COM in the name of code clarity, performance, and need -- apps don't use those instructions so why implement them?

I created ZEXSUP.MAC (supplemental) to cover documented instructions not tested in ZEXDOC.COM. I found that all emulators that pass ZEXDOC.COM also pass ZEXSUP.COM. It can be found here: cpm_compilers/m80/ZEXSUP.MAC at main · davidly/cpm_compilers

reddit.com
u/Ok-Suggestion-5413 — 12 days ago
▲ 16 r/cpm

dcc: A C89 compiler for CP/M on Z80

Ever want to run ANSI C apps on CP/M? This compiler runs on Windows/Linux/MacOS to generate .MAC files. Then you can use M80 and L80 (in emulators) to assemble and link, and the resulting COM files run on old CP/M machines.

It's a very silly thing to build, sure. But I had fun. It generates faster and smaller apps than compilers from the CP/M era. Details on github.

davidly/dcc: C89 compiler targeting CP/M 2.2 on a Z80

u/Ok-Suggestion-5413 — 3 months ago