a multi-core 65c02 system upgraded for Forth
Posted: Mon Jun 06, 2016 8:21 am
I'm not much interested in the 65c816 --- I don't know why anybody would program it rather than the modern 16-bit processors such as the MSP-430 and PIC24 that are much more powerful --- other than nostalgia, of course.
I do think the 65c02 has a future, primarily as the processor used in a multi-core FPGA system. You want to have 8-bit registers so you use minimal FPGA resources and hence can have more processors in a particular FPGA than you could if the processors had 16-bit registers. Such a system should be competitive in performance and price to a big (16-bit registers) single-core system --- the Parallax Propeller has had some use in the real-world --- this would be similar.
To make the 65c02 work better with Forth however, you would want some upgrades:
1.) A (zp,X),Y addressing-mode so pointers on the data-stack can be used to to access memory (I am assuming that X is the data-stack pointer)
2.) DNX (double increment X) and DDX (double decrement X) instructions because #1 above assumes a non-split data-stack (low byte and high byte adjacent in memory)
3.) TSY (transfer S to Y) for accessing local variables on the return-stack
4.) LAY (load A from zp,X and Y from zp+1,X) to help the peephole-optimizer
5.) JMP (adr,Y) for jump tables
6.) Bit instructions for I/O ports in zp or for 1-bit variables in zp
7.) An 8x8 multiply
#1 and #3 are the only ones that are really needed --- the rest are helpful but optional.
How difficult would this be?
I do think the 65c02 has a future, primarily as the processor used in a multi-core FPGA system. You want to have 8-bit registers so you use minimal FPGA resources and hence can have more processors in a particular FPGA than you could if the processors had 16-bit registers. Such a system should be competitive in performance and price to a big (16-bit registers) single-core system --- the Parallax Propeller has had some use in the real-world --- this would be similar.
To make the 65c02 work better with Forth however, you would want some upgrades:
1.) A (zp,X),Y addressing-mode so pointers on the data-stack can be used to to access memory (I am assuming that X is the data-stack pointer)
2.) DNX (double increment X) and DDX (double decrement X) instructions because #1 above assumes a non-split data-stack (low byte and high byte adjacent in memory)
3.) TSY (transfer S to Y) for accessing local variables on the return-stack
4.) LAY (load A from zp,X and Y from zp+1,X) to help the peephole-optimizer
5.) JMP (adr,Y) for jump tables
6.) Bit instructions for I/O ports in zp or for 1-bit variables in zp
7.) An 8x8 multiply
#1 and #3 are the only ones that are really needed --- the rest are helpful but optional.
How difficult would this be?