Live data from Hacker News

The Zilog Z80 has turned 50

goliath32.com

81–90 of 131 posts

Re: The Zilog Z80 has turned 50

#81
post #80
post #74

Earlier quoted context omitted.

RISC-V has no overflow flag? That's fascinating. I'll have to dig into that!

It doesn't have a carry flag either. Multiprecision integer operations absolutely suck in RISC-V, you need three operations (SLT and two adds, with an awful dependency chain too) to do an add with carry, and op fusion can only do so much. At least add an instruction that computes the carry out, like "Rd = Cout(Rs1 + Rs2)" and the similar one for overflow... https://gmplib.org/list-archives/gmp-devel/2021-September/00…

Unfortunately the criticism from that link is absolutely correct.

Moreover, at that link it is shown only the ugly way in which RISC-V does multi-word addition.

Checking the standard arithmetic operations for overflow is much more horrible and inefficient than that, and checking for overflows must be done in any program that claims to follow safe practices.

Unlike in software, computing the carry and overflow flags in hardware is absolutely trivial and the extra gates needed for this add a cost that is below a rounding error in the total chip cost.

With Z80, it was much easier to compute arithmetic expressions than it is with RISC-V, especially when working with big numbers and especially when mandating correct computations, with no undetected errors.

Re: The Zilog Z80 has turned 50

#82
Being too poor to buy professional software, with Rodney Zack's book in hand I wrote myself a Z80 assembly in MSX BASIC in 1986/87 :) That was my first tough programming stint ever...

Re: The Zilog Z80 has turned 50

#85
post #74

Earlier quoted context omitted.

Making the parity flag not perfectly compatible was a wise choice. In legacy programs the parity flag was seldom tested and practically never after the instructions where in Z80 it behaved differently. This allowed the repurposing of the parity flag as an overflow flag, which was an extremely useful extension of Z80. The instruction sets of Datapoint 2200, Intel 8008 and Intel 8080 share with that of RISC-V the disti…

RISC-V has no overflow flag? That's fascinating. I'll have to dig into that!

risc-v has no flags period

modern out-of-order execution gets hindered by such non-parallel cpu state, so it wasn't included

Re: The Zilog Z80 has turned 50

#86
post #56
post #54

The Z80 has a relative jump. Teenage me was loading a hand-assembled search function as an initialised array of integers in Basic, and relative jumps didn't need to be adjusted for the load location, which reduced the amount of post-load adjusting of addresses. It was +100x faster than Basic, just a straight scan.

jr?

yes, that looks like the one. I think I was using the conditional jump, so it could have been djnz, but I think it was jr. 1 byte jump offset, and I recall my little function bumping against that limit - I might have re-arranged it. http://z80-heaven.wikidot.com/instructions-set:jr

Re: The Zilog Z80 has turned 50

#88
post #80
post #74

Earlier quoted context omitted.

RISC-V has no overflow flag? That's fascinating. I'll have to dig into that!

It doesn't have a carry flag either. Multiprecision integer operations absolutely suck in RISC-V, you need three operations (SLT and two adds, with an awful dependency chain too) to do an add with carry, and op fusion can only do so much. At least add an instruction that computes the carry out, like "Rd = Cout(Rs1 + Rs2)" and the similar one for overflow... https://gmplib.org/list-archives/gmp-devel/2021-September/00…

taking architecture that explicitly removed carry flag for performance and then trying to to emulate carry flag anyway was stupid in 2021 and is still stupid today

even on x64 you get better performance when you don't use carry flag and just use limbs https://www.chosenplaintext.ca/articles/radix-2-51-trick.htm... - risc-v is even more so

and experimentally gmp bench results show performance in line with arm https://old.reddit.com/r/RISCV/comments/1jsnbdr/gnu_mp_bignu... so panic was for nothing

Re: The Zilog Z80 has turned 50

#89

Earlier quoted context omitted.

It depends on the country I guess. In Spain I never saw a person using Texas Instruments calculators. Casio and HP are way more popular.

and nobody enforces a calculator model

We were specifically told to buy TI-84 Plus. Also, there was a list of specific brands and specific models that were approved for use on math exams.

If someone wanted to use a Casio instead, they could. But the teachers also said that if you buy a different brand and model other than TI-84 Plus, you are on your own to figure out how to use it for all the different things we needed graphing calculators for.

Everyone in my class did the sensible thing given that they told us this, and bought the TI-84 Plus. There was no reason to buy a different one when our classes assumed the TI-84 Plus. Only making extra problems for oneself.

Re: The Zilog Z80 has turned 50

#90
post #75
post #9

Two of my favorite Z80 anecdotes. First, my Father wanted to try to add some peripherals to the original TRS-80 Model 1. So, what he was interested in doing was asserting the BUSREQ pin to tell the Z80 to get ready so that he could have the bus, ideally waiting for the BUSACK signal to know when it was his. Unfortunately, on the Model 1, when you assert the BUSREQ pin, it is tied directly to the tri-state buffers tha…

Are you sure about that anecdote around the GBA? It would make more sense that they used the Sharp SM83 core - which is pretty far from a Z80 considering it's missing IX, IY and the entire alternate register set. It certainly does have some Z80 instructions and even some SM83 specific instructions. On the dial between 8080 and Z80 it feels closer to 8080 to me.

Wikipedia[0] does have it as the SM83

[0] https://en.wikipedia.org/wiki/Game_Boy_Advance - "Manufactured by the Sharp Corporation, the SoC contains two processors: the ARM7TDMI running at a clock rate of 16.776 megahertz (MHz) for GBA games, and the Sharp SM83 running at 4.194 MHz or 8.389 MHz for backward compatibility with Game Boy and Game Boy Color games."

Post reply on HN