Live data from Hacker News

Z80 – The 1970s Microprocessor Still Alive (2021)

computer.org

61–70 of 78 posts

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#62
post #4

Due to its simplicity it's a fun little processor to program. Hacking on some assembly on a ZX spectrum emulator is a nice way to stay sane in this high abstraction LLM age.

"Simple" is really not a word I would associate with the Z80 ;) The ISA is quite messy because of the backward compatibility requirement with the Intel 8080 (e.g. the Z80 had to fill undocumented gaps in the 8080 opcode encoding map with new instructions, four of which were prefix instructions to unlock additional instruction 'subsets' (DD/FD for replacing instructions involving the HL register pair with indexed addr…

> I still prefer programming the Z80 over the 6502 though :)

I really don't.

There are some few things you can fit into and get working fast in the Z80's A + 6 registers (IX and IY are not useful if speed is the aim), but for anything complicated the 6502's 256 Zero page locations — any pair of which can hold a pointer you can index off — is far superior.

The Z80 is awful at accessing memory for anything other than a simple absolute address or sequential access or push/pop of a register pair. It's better for manipulating 16 bit values, but not as much as you'd think especially once you run out of three register pairs plus ToS.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#63
post #26

> Then, as a young engineer, I worked in a large mainframe computer system based on Z80. This sentence threw me a little bit. Which mainframes were based on the Z80? I'd love to know more about that.

Morrow systems ran on a Unix flavor, could address 16MB all on Z80, had memory protection and could have up to 6 simultaneous users. Micronix was the only Unix-like multiuser system ever to run on an 8 bit processor.

https://ia902902.us.archive.org/20/items/mame0.211manualsful...

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#64

Earlier quoted context omitted.

"Simple" is really not a word I would associate with the Z80 ;) The ISA is quite messy because of the backward compatibility requirement with the Intel 8080 (e.g. the Z80 had to fill undocumented gaps in the 8080 opcode encoding map with new instructions, four of which were prefix instructions to unlock additional instruction 'subsets' (DD/FD for replacing instructions involving the HL register pair with indexed addr…

> I still prefer programming the Z80 over the 6502 though :) I really don't. There are some few things you can fit into and get working fast in the Z80's A + 6 registers (IX and IY are not useful if speed is the aim), but for anything complicated the 6502's 256 Zero page locations — any pair of which can hold a pointer you can index off — is far superior. The Z80 is awful at accessing memory for anything other than a…

The 6502 doesn't even have much of a stack.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#66

Earlier quoted context omitted.

> I still prefer programming the Z80 over the 6502 though :) I really don't. There are some few things you can fit into and get working fast in the Z80's A + 6 registers (IX and IY are not useful if speed is the aim), but for anything complicated the 6502's 256 Zero page locations — any pair of which can hold a pointer you can index off — is far superior. The Z80 is awful at accessing memory for anything other than a…

The 6502 doesn't even have much of a stack.

The 256 byte hardware stack is plenty for function return addresses and temporary use within a function. How deep are you planning to nest function calls anyway?

You can create as many other stacks as you want using pairs of Zero Page locations as stack pointers.

Best practice for recursive/reentrant code (e.g. compiling C) is to follow modern RISC/x86_64 practice and reserve a few (16 maybe) Zero Page locations as argument/working registers, a few (16 maybe) as callee-save registers, and have prolog and epilog utility functions that create/destroy a stack frame and save/restore N bytes of callee-save ZP locations.

You can unroll those into a sequence of elements like...

    lda $1F
    dey
    sta (SP),y
    lda $1E
    dey
    sta (SP),y
    :
    lda $10
    dey
    sta (SP),y
... at 5 bytes and 11 cycles per byte saved. And of course jump into the appropriate part of the sequence.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#67

Ironically (and sadly) the Z80 was discontinued not very long after this piece was published.

There are a number of efforts to make low volume production of compatible parts - see https://github.com/rejunity/z80-open-silicon

There are also FPGA emulated versions.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#68
post #26

> Then, as a young engineer, I worked in a large mainframe computer system based on Z80. This sentence threw me a little bit. Which mainframes were based on the Z80? I'd love to know more about that.

Morrow systems ran on a Unix flavor, could address 16MB all on Z80, had memory protection and could have up to 6 simultaneous users. Micronix was the only Unix-like multiuser system ever to run on an 8 bit processor. https://ia902902.us.archive.org/20/items/mame0.211manualsful...

Until Fuzix of course.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#69
post #6

Tom Jennings, the creator of fidenet, is producing a nice modern Z80 computer[0] 0. https://www.ebay.ie/itm/206496219323

RC2014 is the real deal: https://rc2014.co.uk Why I have not picked one up yet… I think I just have a sweet spot for the 6502 and keep putting together KIM-1 kits. (EDIT: Finally after years, I just pulled the trigger on their Classic II kit.)

It's actually fairly easy and interesting to design your own z80 computer. I went from knowing about assembly and pcb design to a z80 computer with a serial interface and memory banking. Learnt a lot on the way an went on to build pcbs for other projects with the knowledge I had gained from that.

Re: Z80 – The 1970s Microprocessor Still Alive (2021)

#70

The Z80 was my "first" microprocessor, in an odd way. I've never touched one. It was the early 80s, and my mom was getting Byte Magazine, which I devoured. I had taken a high school programming class in BASIC, and was interested in electronics. Radio Shack had a shelf of books, and I was going through them one by one as I could afford them. They had William Barden's book on the Z80, published by Howard Sams, because…

I only went through the partially rat–soiled magazines my dad "stored" in his in-laws root cellar many decades later but I still love the CPU.
Post reply on HN