Ask HN: 6502 or Z80?

19 points by qwertyuiop924 ↗ HN
Pretty self-explanatory, really.

The grandfather of ARM, or the cousin of x86?

Speccy or BBC?

The chip that made the Apple //, or the one behind your terminal?

CP/M, or 1000 BASIC variants?

Which one would you pick? And why?

Oh, and no saying that you pick the 6809. We'd all love a 6809, but they weren't common at the time, and Rochester isn't selling in small quantites now, AFAIK. Besides, it's so much nicer that everyone else would agree with you, which takes the fun out of things.

21 comments

[ 4.1 ms ] story [ 56.6 ms ] thread
Z80. I found it so much easier to program (while hand-assembling using a printed opcode table) back in the 80s. Also, ZX Spectrum all the way ;-)
I also got started writing assembly by looking up opcodes in the back of the orange-book which came bundled with my 48k Spectrum. Writing programs on paper, and filling in the offsets for (relative) jumps once complete.

Happily the format of z80 and Intel assembly were very similar, so I didn't find it hard to move to PC-stuff when I arrived at university. (Not a surprise given where the Zilog developers came from.)

Z80 was the first assembly language I wrote in, and even if I mostly just hacked games for infinite lives I had a lot of fun doing so. Cracking protections on tape-based games was a challenge without the internet, but the lessons learned eventually applied to PC-stuff when I discovered +fravia. (Though we don't talk about that kind of thing any more ;)

Man, all of us 2000s kids really missed out on this sort of thing. It was hard to get into programming, much less assembler: nobody even knew how.

I eventually picked up a "For Dummies" book that taught be the basics, and worked my way up from there. First Python, then a touch of Ruby, and then some Scheme, and a bit of C. I picked up shell and Unix along the way.

I have to say the 6502 notable because it was introduced at a price point that enabled a whole bunch of new products. otherwise it was a weird little uP with an odd somewhat limiting instruction set.
I'd go with the Z80. Otherwise you might end up spending a lot of time figuring out how to do something that could be done with one or two Z80 instructions.
6502, mainly because it was affordable (~$25 in 1975 vs at least $175 for other chips in the day) Thus it truly spurred the home and hobbyist computer revolution.

It also performed quite well for its speed with most instructions completing in 1-3 cycles, many CPUs of higher clock rates weren't as efficient as the 6502.

I wish I could give 100 votes (as I get downvotes ha) to this ask! I love hearing old "war stories".
Z80. Mainly because there are still some interesting devices that you can have some fun with that still use them: Gameboy & TI-83 calculators.
Yeah. Although the Gameboy's processor isn't a real Z80: It's more like an 8080 with some of the Z80 extensions (but none of cool ones).
Amstrad and Spectrum personal computers also had Z80 inside.

I remember struggling with LDIR/LDDR instructions with Amsost devpac assembler...

Btw. We called that machine code programming back in the 80s.

Really? many commenters here are talking about actually entering raw hex (and calculating branch offsets by hand (!)).
In my case the pain pointi was loading the assembler from tape drive for about 5 minutes.

Fortunately the assembler did the offset calculation for me.

If you coded something in basic with some machine code, you had to type a lot of DATA statements in decimal or hex. This was then read and POKE'd in memory and CALLed from basic.

Quite tedious.

Yeah, but a lot of people actually didn't have assemblers at the time.
Don't have any experience with the 6502, but I was able to pick up z80 assembly syntax pretty easily. Very user friendly in my opinion, but I've met people who swear it's terrible and awkward in comparison to their preferred instruction set, so ymmv.
Compared to the 6809 or the m68k, it's awkward as all hell. Compared to the 6502, it's still awkward.

Comparing Z80 assembler to 6502 assembler is like comparing CL to Scheme. The Z80 gets some things Right that the 6502 doesn't, but the 6502 does the Right Thing more often, and is very elegant and minimal. However, the Z80 has a ton of useful building blocks that the 6502 sacrifices to keep that elegance.

I prefer Scheme to CL, but I think I like Z80 better than 6502. Go figure...

I'm working on likely the last product we'll ever make with z80 based assembly, so hopefully I'll be trying some alternatives in the next year or so. Thanks for the comparison.
> 6502 or Z80?

It really depends on what you want.

The Z80 is more "corporate". There were lots of embedded systems built with a Z80 at the heart. People used it to get a lot of stuff DONE.

6502 is more of a hackable computer. Because it was used in the Apple ][, there were lots of people trying lots of strange experiments. Some were incredibly good, years ahead of their time. There are games in 64K that were more fun than most bloated multi-GB games on consoles today.

This dichotomy exists to this day. (Search "Visual Z80" vs "Visual 6502" and compare the depth of understanding and/or passion.)

Yeah, the modern 6502 community is way more active than the Z80 community (which is kept afloat by GG, MS, GB/CGB, and Speccy hackers. OTOH, they have better tools: give me sdcc or WLA DX over cc65 or xa any day (and yes, WLA works with either chip, but it came from the GB/GG community, and those were the first chips it supported)).

I'm thinking of starting with the Z80 if I build an SBC, though: It may not be as cool, or popular, or have as elegant in instruction set, but it's a heck of a lot easier to program (especially for a novice asm programmer like me).