Hacker News new | ask | show | jobs
by david-given 2779 days ago
I wrote a self-hosting (if you're very patient) compiler for the 6502 and Z80 a while back. Both are a bit of a shock if you're used to true 16 bit arch architectures. I did a couple of writeups on the problems of doing basic arithmetic in them:

http://cowlark.com/2018-02-27-6502-arithmetic/index.html

http://cowlark.com/2018-03-18-z80-arithmetic/index.html

The 6502 is more orthogonal, and while each instruction does less they're very fast; the Z80 is fundamentally more powerful but weirdly inconsistent, terrifyingly slow, and the unorthogonal register system means that you spend half your time shuffling registers.