The obvious and sensible thing to have done is to have based the
Megaprocessor on an existing microprocessor. The main reasons are:
- it'll work
- there will already be a set of tools to use (compilers etc)
So I started by researching what was around. Ones I remember
looking at were
- 6502 (I used this a lot in the past, I had a BBC micro),
- 8051 (very popular and there are VHDL descriptions
- Z80 (used on ZX80 which I also had),
- 68000 (my all time favourite processor),
- transputer (I'd played with these once and it seems simple)
The full-on 16 bit processors were obviously infeasible.
But I had an issue with the 8 bit processors. My plan was to build
the memory as well as the processor from discrete parts so that
not only could you see inside the processor but also inside the
memory to see the program and the data. A quick calculation shows
that building even a very small amount of memory in this way might
be more of a task than the processor itself. So you really want to
get as much bang as possible from your memory byte. But one of the
darker memories seared on my soul is the yards of assembler code
you need to write to for an 8 bit processor to do not much at all.
Which pushes you to selecting a 16 bit processor. I went round in
circles for a while on this question and then decided on the
compromise of a SMALL 16 bit processor with some of the more
helpful addressing modes, but only 8 bit opcodes. As this didn't
seem to exist I designed my own.
If I had my time again what would I do ?
Well I now know that as well as the discrete RAM I'd be adding on
a "normal" block of memory, 32KB. So the driver for memory
efficiency is diminished.
On the other hand it was quite fun designing my own and exploring
the tradeoffs between various features.
So I'd probably still design my own. Still 16 bit, but this time
with 16 bit opcodes. But instead of using the extra opcode space
to add more functions I'd use it to make the decoding easier and
so reduce logic complexity and so make the processor easier for me
to build and easier for others to understand.
(Might also add a couple more general purpose registers; and
re-structure the multi-cycle instructions; and .....)