Hacker News new | ask | show | jobs
by stevekemp 367 days ago
You can find (compilable) versions of CP/M on github hosted by many people.

I've referred to them a fair bit in recent times as I've been fighting to get my golang CP/M emulator working on a couple of stubborn binaries.

(Downside is that many of the versions of CP/M sources you see use the weird intel-style of assembly rather than the more typical Z80 opcodes. Still that's not a real blocker.)

1 comments

Those are usually disassembled binaries, not the original source code. Which used Intel style assembly and PL/M.

And Z80 syntax may be more common today, but Zilog made some rather bad choices IMO. If "LD A,(HL)" loads a byte from memory address HL, then you would expect "JP (HL)" to load the address to jump to from memory instead of directly from the HL register. "PCHL" is a lot clearer. Also in 8080 syntax, one mnemonic => one addressing mode and base opcode. No surprising syntax errors because some operand combination isn't allowed, or 4 clock penalty to fetch a prefix byte...

There are inconsistencies, to be sure, for both sides.

I guess it mostly depends which you grew up with, or were otherwise exposed to first, which determines which one makes most sense to you.