
Live coding an assembler for CP/M - ingve
http://cowlark.com/2019-06-01-cpm-asm/
======
kragen
It's likely that this is contaminated with the copyright of the original — the
author admits having had access to the original, and it's likely that some of
their code would show "substantial similarity" if examined by a jury, which is
sufficient to show copyright infringement under US law. And, notoriously,
Caldera has been taken over by shameless criminals even worse than the ones at
Oracle — the ones who turned the name "SCO" into an obscenity meaning "to try
to steal someone else's work through the courts".

It's outrageous and ridiculous that in 2019 we need to worry about possibly
infringing the copyright of code written in the 1970s, when copyright arguably
didn't even cover software, by a man who died in 1994 and who probably would
have approved of the project. Copyright law is a menace to anyone doing
preservation or creative work of any kind — note the recent million-dollar
verdict in favor of Nintendo against abandonware ROM sites — and should be
abolished or at least scaled back to a reasonable term, like five years.

On another note, the Z80 isn't as obsolete as you might think — like the 8051,
it's used relatively often as an embedded core in modern devices, such as the
S1 MP3 player from the 2000s and the TI-73+, TI-83+, and TI-84 calculators
SirCmpwn wrote KnightOS for. And, unlike the 8051, the Z80 has reasonable
self-hosted development tools, including Turbo Pascal.

~~~
david-given
Re copyright contamination: that's pretty doubtful, actually. While it's not a
clean room reimplementation it does work quite differently, with a whole set
of different bugs, syntactic wibbles and semantic quirks, as well as being in
a completely different language. I am actually _right now_ working on the .prn
file output, and duplicating the behaviour of the original is essentially
impossible as it's very much dependent on how the original parsed the input
and mine parses differently. (Try assembling 'foo equ 1 ! mov a, foo' and try
and predict what the DR assembler's prn file output is! You'll be surprised.)

Also, the IP's not owned by Caldera any more. It got spun off into Lineo,
which then folded. Some assets went to Embedix which then got folded into
Metrowerks, and the rest reverted to the investor, Canopy Group (he says
reading Wikipedia), but I don't know which.

It's probably worth approaching them to try and get the license fixed --- the
existing one is painfully vague and the CP/M community bickers endlessly about
what it actually means, and the encumbrance requiring everything to be
distributed through one site is just stupid. Whether they still contain anyone
who's heard of CP/M, I don't know.

~~~
david-given
Oh, yeah --- I'm not complaining about Z80 being obsolete. I'm complaining
that it's too new! CP/M proper uses 8080 machine code, which Z80 code is
almost (but not quite) backwards compatible with. So Z80 machines can run
classic CP/M binaries but classic CP/M machines can't run Z80 code.

sdcc only generates Z80 code, not 8080, so my assembler can't be used on a
Tandy Model 100, for example. I have another compiled lined up which will
generate 8080 code, though. Less buggy, too.

~~~
kragen
Yeah, I didn't think _you_ thought the Z80 was obsolete. (It kind of is, just
less than people think.) I meant that _other people_ reading about it in the
context of CP/M might think it was purely a retrocomputing exercise. (And the
classic CP/M machines I had used Z80s, so they could run Z80 code.)

------
dukoid
"This is part of a slowly ongoing project to produce a completely open source
CP/M clone which can be distributed with emulators and the like" \-- Will this
be limited to 8080 / Z80 or platform independent? If the latter, to which
extent?

~~~
david-given
Z80 and 8080 only --- I would like it to be 8080 only but I haven't been able
to source an 8080 CP/M kernel and shell which are provably open source. So
instead I'm using ZSDOS kernel (GPL) and the ZCPR1 shell (PD).

Fun fact: CP/M is modular! You can mix and match kernels, shells and BIOSes as
much as you like and everything's still binary compatible! What's more, the
original Digital Research distribution contained all the tools necessary to
let you do this and port CP/M to a new architecture! Truly, it was a different
era.

Interested parties may wish to watch
[https://www.youtube.com/watch?v=FGWshrMZcCc](https://www.youtube.com/watch?v=FGWshrMZcCc),
where I demonstrate an earlier version of the thing running on a Z80-based
Amstrad NC200 laptop, and do some programming on it.

