BigEd wrote:
There are one or two very fast emulators which run 6502 code on ARM, in the PiTubeDirect project.
This could be a way to see this. ARM is a different hardware architecture. By using an emulator, that is, an intermediate layer between the binary code and the hardware, ARM can run the 65xx instruction set. It's not emulating the processor, but
reading the binary file,
parsing it,
extracting what is 65xx instructions, what is arguments to those instructions and what is data, and then in a memory location
simulating what the instructions originally tells what has to be done. Sort of following a cooking recipe.
What is the way to do that by hardware? By using a FPGA, that also
simulate what the real hardware should be doing. It's not that a FPGA contains resistors, capacitors and transistors like the real CPU has, but programmable logic that
behaves like the original hardware does.
So those two could be a way to implement my wrongly called
HAL. Those two are ways to separate the 65xx instruction set from the hardware it runs on.
BigEd wrote:
In your original post and some followups you were also talking about extending the 6502 - that makes it a much different conversation, because not only must the implementation have the extra registers and operations, but the machine code also needs to encode them. (And of course the programmer or the compiler also needs to make use of them.) (And everything needs to be well-tested and documented.)
Of course that that would be the way to go.
Dr Jefyll wrote:
The architecture is the defining factor. It says what's possible, and (by omission) what's not. For example, there's no ability to arbitrarily add more accumulators (as you suggested upstream, iirc).
At some point in the interview with Chuck Peddle, AFAIK he says that he talked with engineers of companies about the instructions they used most and what they didn't use at all, and thought about its CPU project and the instruction set he would implement, and then, from that, designed the hardware. -- Please correct me if I'm wrong (as with any other thing as you have done - thanks)
So... at this point, about extending the 6502, I think it would be better to think about extending
the 65xx instruction set and from there redesigning or enhancing the CPU hardware design itself.
Would be useful to extend the 6502 instruction set?
Would be useful to expand or extend what the CPU has to offer to the instruction set, with things like (but not limited to)...
two accumulators or
zero and first page implemented directly in the core die?
Would be useful to separate the 65xx logical instruction set from the hardware it runs on, like what happens in the x86, where there are several manufacturers of x86 compatible CPUs, but that works differently at hardware level?
...or is it all of that pointless because the 65xx architecture is
perfect as it is?