View Single Post
Old 2nd Jun 2019, 6:12 am   #3
TonyDuell
Dekatron
 
Join Date: Jun 2015
Location: Biggin Hill, London, UK.
Posts: 5,213
Default Re: Fun with Z80 Assembler

I really started with the Z80, but was glad when I discovered the 6809 which I found a lot easier to design with and to program. The 6809 didn't have many of the 6502 dislikes metioned in the first post (it had 16 bit registers, 2 16 bit stack pointers, 'zero page' became direct page and you could set the top 8 bits of the address to anything you liked, etc)

On 6502/6800 systems it was not unheard-of to put a couple of I/O devices at the very start of memory (so they took part of page 0) as this meant you could use the shorter/faster page zero addressing mode to access them. Take a look at the HP9815 calculator, a 6800-based machine.

Anyway, as for the Z80, one thing I hated about it was the indexed addressing modes. To me it was plain 'wrong' for the 8 bit 'offset' to be fixed (one of the instruction bytes) and the 16 bit 'base' to be in a register.

There were a number of little-used features. The I/O instructions that used 'C' as the port address put 'B' on the upper 8 address lines, this meant you could easily have more than the normal 256 I/O ports. Similalrly during refresh time (when RFSH/ was asserted), the R register appeared on the bottom 8 address lines (and I never forgave them for only making that a 7 bit counter, the kludge to extend it to 8 bits was a mess) and I (interrupt vector) on the top 8 address lines. At least one of my designs, which didn't use vectored interrupts, used that as a memory paging register.

Of course there were also a number of undocumented instructions. In general anything that used 'H' or 'L' could be prefixed by 'DD' or 'FD' to use the appropriate half of IX or IY, for example.
TonyDuell is offline