Guillaume <
mes...@bottle.org> writes:
>I guess using a completely different architecture, based on a very
>simple RISC instruction set, you might be able to do something a bit
>more "powerful" with the same amount of logic, and being able to run at
>much higher frequencies even on old processes. But using such a CPU with
>simple dev tools as they were available at them time would be very
>clunky. Only decent compilers can make efficient use of such simple RISC
>architectures while not making the developers' life a hell. I guess.
You guess wrong. RISCs are easy to program in assembly. It's more
the other way round: Assembly programmers can cope with irregular
register sets like the one of the 6502, while compilers have a hard
time with them; they benefit from the regularity of register machines,
both CISC (e.g., PDP-11, VAX, AMD64), and RISC (all of them).
Concerning a "very simple RISC instruction set", the NOVA has a
load/store architecture. The National Semiconductor IPC-16A/520 PACE
seems to be the first single-chip implementation of an instruction set
similar to the Nova (and the first single-chip 16-bit CPU), announced
in 1974 <
https://www.cpu-world.com/CPUs/PACE/index.html>, so maybe
with a similar transistor budget as the 6502. It took 10us per
instruction on average (1MHz 6502 2-7us), somewhat negating the 16-bit
advantage. That's apparently also the case for the other
Nova-inspired microprocessors (microNova and Fairchild 9440), and is
probably the reason why they were not successful; it's unclear to me
why they came out this way, but if it is to be a "better 6502", it
must be avoided.
Concerning the "much higher frequencies", a 6502 in a computer of its
time does not really benefit from a higher clock frequency, because it
accesses memory in most cycles, so a higher-clocked 6502 would
effectively run at the same speed.
So if we want to design something better, we need to design something
that needs fewer memory accesses. The 6502 needs many instructions
and many memory accesses because it has so few registers. It also
needs many instructions because one needs to synthesize 16-bit
operations from several 8-bit instructions.
OTOH, unlike load/store architectures the 6502 has load-op
instructions (and even a few read-modify-write instructions) that
reduce the number of instructions executed compared to an otherwise
similar load/store instruction set.
Still, if I wanted to rise to the challenge, my first pick would be a
16-bit load/store architecture, with as many registers as fit in the
transistor budget. Use an 8-bit ALU to save transistors (you already
need the sequencing logic for 16-bit memory accesses anyway); or
alternatively, use a 16-bit ALU, and perform 8-bit loads and 8-bit
stores programmatically to avoid the sequencing.
My guess is that 3 general-purpose registers should fit (can be
addressed in 2 bits, and have one option for zero/discard-result).
That's of course very tight, especially because you have no additional
stack pointer. If we can fit more registers, it would be better.
Instructions should fit into 8 bits (plus immediate operands/offsets),
so we can afford only one or two register addresses in each
instruction. Would be an interesting exercise for the instruction-set
designers here. Auto-increment/decrement would be cool, but probably
does not fit in the instruction size or transistor size limit.
Calls store the return address in a register, and return is an
indirect jump through that register.
An extra special-purpose register would be needed for holding the
interrupt return address.