BigEd wrote:
So, my idea is:
16 registers, including A, X, Y and S
all can function as accumulators (for logic and arithmetic operations)
all can function as index registers
Perhaps name them A, B, C, D, E, F, G, H, I, J, K, V, W, X, Y, S
Long distance shift
[...]
As for the instruction encoding, it's simple:
two 4-bit fields in the top of the instruction. One selects the destination register for those opcodes which need it. The other selects the index register for those opcodes which need it.
Hi, Ed! I like the notion of destination and index fields in the top of the instruction. It seems a tidy way to add functionality to the design: extra registers, and (via the alternative indexes) extra address modes. Then I got thinking...
If the PLA and PHA instructions are among those that get destination and index fields, then that means you could (for example) Push or Pull register G using register K as the SP, is that right?
And... if the RTS instruction is among those that get destination and index fields, then that means you could RTS using register L (for example) as the SP, is that right?
My observation is that this is shaping up to be a very powerful processor for running FORTH -- far more so than the 6502 or even the 65816! FORTH is stack-oriented, of course, so the benefits of PHA/PLA variants are pretty obvious. For starters, you could have an implementation that was free to use dedicated registers for the Parameter Stack pointer, the Return Stack pointer and/or the Interpretive Pointer.
Even more exciting, the benefit of RTS variants is that you could base the FORTH threaded interpreter on
dclxvi's six-cycle NEXT. This is a super-fast scheme that unfortunately, on 65816, is problematic with regard to interrupts (which make use of SP in a conflicting way). But your proposed 65ORG16.c core avoids the difficulty because it allows various registers to act as SP, eliminating the conflict.
Here I have posted a simple illustration of how RTS can thread together a list of subroutines. (This is part of a topic I created regarding a hardware work-around for the interrupt problem. The threading illustration is the only part relevant to 65ORG16.c.)
cheers,
Jeff
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html