I have been wanting to work on a 32 bit version of an FPGA based 6502, but have been a bit unsure exactly how far to go. Here are my thoughts:
1. Revamp the whole addressing scheme - see below
2. Add only minimal instructions to the 65Org16 set - a 32X32 bit multiply and 64/32 divide would be what I was thinking. Most modern FPGAs have Wallace-Tree multipliers for DSP, so they cost almost nothing in the fabric. The dividers can be somewhat expensive but, if the FPGA is big enough, why not? These peripherals could also be conditionally compiled to allow for minimal/faster implementations.
Now for the "non-6502" additions:
3. Modify the architecture for maximal orthogonality - PC and SP would be treated as any other register in all ALU/memory operation. This would make jump tables a snap: LD PC,(whatEver).
4. Add a BSR - branch subroutine with the relative address as part of the instruction - with 32 bits and an 8 bit instruction, 16M reach is attainable
5. Branch instructions would have the relative address as part of the instruction
6. For stack based languages, add at least 3 more index registers that can be used as base pointers. These registers would also participate in all ALU/memory operations
7. Modify the increment/decrement instruction to use unused instruction bits to allow for fast adjustment of register values - useful for stack frames, etc
8. Add at least 2 more registers to assist with ALU operations - especially necessary if MULT and DIV instructions are added
9. Add either fast shift (using a barrel shifter) or SWAP instructions to make accessing byte data easier. SWAPs would allow any two bytes in the 32 bit word to be non-destructively interchanged. The barrel shifter method would work just as well (or better), but I am not sure how expensive it would be in an FPGA.
10. Add addressing modes such as (Base,reg), (Base,shortLiteral), (Base,longLiteral). shortLiteral would be a value in the instruction word (likely 16 bits due to number of available bits) and longLiteral would be 32 bits read from memory.
Obviously, the binary code would be completely incompatible with a bog standard 6502.
I have not been able to give this as much time as I would like, and have just translated the 65Org16 to VHDL. I can read Verilog, but if I try to use it I will only injure myself or those around me