Gunnar68080 wrote: Fri Apr 05, 2024 6:45 pm
Did you wonder why the 68000 CPU needs minimum 4 cycle per instruction? This can be easy explained.
In fact the 68000 is not a true/REAL CISC. The 68000 has inside a RISC like core which kind of emulates the good CISC instruction set doing this in several cycles. How this is done is called microcode.
Now that things seems to be more quite, this is something I wanted to address a few days ago already. Perhaps just for the record because it is not very significant to the discussion. But I think this is, at least, not exact.
There are more than one reason why instructions on the 68000 take at least 4 cycles. But the most fundamental reason is because a bus cycle takes 4 clock cycles.
The 68K is not superscalar, it doesn't perform pipeline overlapping like the 020, not even the 010 loop mode, and of course it has no cache. Therefore, every instructions (well, except
STOP) must perform at least one bus cycle to refill the prefetch queue. That means that even if, say,
NOP would have dedicated hardware support and wouldn't execute from microcode, it would still take 4 cycles anyway.
This is why the fastest instructions in the
68020 (still a fully microcode based CPU) take now only 3 cycles in the "worst" case. Because the 020 bus cycle is shorter than the 68K and can be as fast as 3 clock cycles. And this is also why the "cache case" of those instructions is only two cycles. Even when they always execute from the same microcode.
Now, of course that mircocode plays its role. The 68K needs a minimum of two cycles to execute a single microinstruction. And also a macro instruction needs at least two microinstructions. This means that any instruction in the 68K would need at least 4 clock cycles anyway, even if it wouldn't perform any bus cycle at all. But this likely could have been optimized if it would have been useful, as it was implemented on the 020. But on the 68K, as explained above, it wouldn't help.
Btw, Gunnar probably already knows that, but the 68K microcode is not anything like RISC. The micrcocode operates at a much lower level, much closer to the hardware than a typical RISC code.