[Final synthesis, an American comparison]
Before to read this article, please remove any faction flag. I decided to go deeper into the topic already discussed in the article [ Aleph-Proect: the choice of the CPU(Italian)]. Simply because I believe that the last article did not provide a clear example, and never focuses which are the real differences, that should characterize this choice.
Although in that article I showed, in broad terms those information concerning the architecture of the processor, those features do not translate into readily understandable informations (for non-experts).
The devil is hidden in the details
When, in a technical manual it is said that a CPU 6502 performs an operation in a lower number of machine cycles than the Z80, in reality it is not said that the 6502, only performs elementary operations “all in eight-bit mode only”. So to perform a sum between two 16-bit numbers such as: 8960 + 2132, you cannot use ADD HL, BC, but you must make a small “program” that twice sums the eight-bit registers and the carryover must be considered for each sum added over the calculus made.
– This means that working with such a CPU means having to do “long encodings” like you do on RISC processors. – Instead, the Z80 CPU already has numerous instructions for executing 16-bit sums, and instructions for loops and moving memory blocks. In short, whoever chooses a MOS 6502 CPU, chooses a more “stupid” CPU to which everything must be explained.
The advantage of the CPU 6502 consists in the fact that, once the problem is broken down, the MOS 6502 manages to deal with it, with a lower number of machine cycles compared to the ZILOG Z80 counterpart. But this value never materializes in a faster calculation speed, because the MOS 6502, which started with a maximum speed of 1 Mhz, was then brought to 2 Mhz, in the HCMOS version. But remember that the ZILOG Z80 was designed to operate at 4 Mhz, in the Z80A version, and then subsequently reached the speed of 20 Mhz in the HCMOS or Z80C version.
PLEASE NOTE: the NEC D780C at 3.5 MHz of the Zx-Spectrum was an inefficient clone of the Zilog Z80 and had inferior characteristics if compared with the Zilog Z80A.
Considering what told above, here is the situation that unfolds for the programmer who wants to move a 16K bytes buffer from one memory location to another. Those who choose a CISC type of architecture make a more compact assembly coding, because the processor has its specific instructions for managing even more complex operations. On the other hand, those who decide to program “a sort of RISC CPU” but with a slower clock, in terms of Mhz, find themselves having to make long encodings in which every single intermediate data passage must be explained. And this major work will not be rewarded by a greater speed of execution. This is the evidence of the facts and this is the true question that appears when it has been private of nostalgia for disappeared brands, of the years gone by. – Today, in the time that I write, the fastest processor in the world is a CISC processor built by INTEL that is backwards compatible with the i8088’s, and that is compatible with a close relative of the Zilog Z80. –
FOLLOWS AN ASSEMBLY CODING EXAMPLE: the test code, copies all the data starting from the address 8000 HEX to the address BFFF HEX in the area included by the interval [C000 HEX … FFFF HEX].
– The Z80 employs 86 mSeconds at 4Mhz (minimum speed).
– MOS 6502 takes 131.5 mSeconds.
The Z80 is true that it uses more machine cycles for an equivalent complex operation, but these cycles can run at a higher frequency, just because the processor has a longer pipe-line, and an internal clock different from the one applied at the entrance. The Z80Cs I tried were not affected by any problems even if they were over-charged by 30% of cpu clock frequency. In summary, all the 10Mhz Z80s I have tested have worked for at least 5 years at 13.5 MHz, without any anomaly found.
The same cannot be said of MOS 6502, which mounted at 4 Mhz, in the Apple it was necessary to slow it down to 1 Mhz, for the input / output with the peripherals. – Also note that the devices on MOS 6502, “can only be mapped in RAM”, losing memory addresses useful to the system. – Instead the Z80 can address 256 I / O devices without losing a single byte of memory, because it manages the INPUT / OUTPUT in a separate address space.
[There are not many known bugs on the Z80 cpu, its reliability is beyond doubt]
Even the unpublished op-codes seems to work well on all the cpu I tried. The only op-codes that show abnormal behavior are: OTIR,
OTDRs that would not update the carry-flag as documented.
[The BUG chapter of 6502, is full of cases where the programmer just has to give up]
[Wikipedia-English [bug of processor 6502]