Comparing the Z80 and 6502 to Their Relatives
19 points by hoistbypetard
19 points by hoistbypetard
My first assembly language was the 6502, and I didn't program in 6800 (not 6809, mind you) until many years later. I liked having a 16-bit index register on the 6800, but not having to stash it all the time for move routines where I could just use another zero page pointer on the 6502. I also didn't use the B accumulator nearly as much as I thought I would.
You should try the 6809. It has the same two accumulators as the 6800, but it has four 16bit index registers (X, Y, S, U) that all work the same. The S register is also the stack register (used to push/pop registers, store return addresses) and the U register can also be used to push/pop registers (or not, you can use it like you'd use X or Y). Also, you can set the direct page anywhere in memory (well, on any 256-byte boundary actually). You can also load memory relative to the program counter, so position independent code is trivial. Of all the 8-bit CPUs, it's my favorite.
I had a z80 running inside my 6502 (Apple ][+) ... it was the Microsoft Z-80 SoftCard. And the Apple ][ OS ("Applesoft BASIC" maybe?) was at least partially licensed from Microsoft as well. Fun times...
relative addressing is much more common on the 6809, meaning that it’s significantly more viable to write position-independent code on it than any of the other chips we’ve looked at here.
The Radio Shack Color Computer III used a 6809 CPU. You could run a multi-tasking OS called "OS-9" on it. I recall that you had to write position-independent code because of the way OS-9 divided the 64Kb of memory each process got via bank switching. It was also a matter of pride to write "thread safe" and "re-enterable" code.
All the Color Computers used a 6809 (well, the mini used a 6803?). The 6809 was a great chip to learn assembly on.
Everything could be done PC Relative--that's how you got relocatable code. You had a bunch of 16 bit registers (X, Y, U, S) with all the indexing modes you could want and even auto-increment/decrement.
Although, bank-switching was mostly to swap out ROM for RAM in the upper 32K.