Ideas
More ideas
And some more ideas...
BigEd has successfully modified Arlet's verilog Core of the original NMOS 6502, for 16-bit functionality by multiplying the data bus width by 2 (to 16-bits), and the address bus width by 2 (to 32-bits) for direct access to 4.3GB of memory. All original NMOS6502 instructions are intact, meaning their original 8-bit values are now the LSB of the 16-bit opcode***. The NMI/RESET/IRQ vectors are now at $FFFF_FFFA, $FFFF_FFFC, $FFFF_FFFE, respectively.
Features of the .b core:
-- 90+MHz operation in a Spartan 6 environment.
-- 16 Accumulators
-- Another index register called 'W', that functions like the Y-index register. All associated addressing modes, Pushes, Pulls and Transfers are there.
--Transfers are allowed amongst all Accumulators, and from the 3 indexes to/from any accumulator.
-- Some 65C02 opcode additions like PHX, PHY, etc., and INC A, DEC A have the same value for current 65Org16 Assembler*** compatibility, although INC/DEC also apply to the other accumulators.
-- Shifting, Rotating can be done on any 1 of the 1st 4 accumulators (i.e A..D) and the result stored in another of the 1st 4 accumulators (i.e. A..D) utilizing a barrel shifter* for a maximum of 15 <shifts,rotates> instantaneously. Shifting, Rotating the contents of memory can be done in this same manner, for all other addressing modes.
-- 2 zeropage and stackpage relocation pointers have been added, allowing the 64K zeropage and 64K stackpage to be placed anywhere within the 4GB addressable memory space.
-- Logic (AND, ORA, EOR) or Math (ADC, SBC) functions can be done to any accumulator and the result stored in another accumulator**, for all addressing modes.
-- 32 opcodes are present to transfer any accumulator value to the stackpage pointer or the zeropage pointer.
-- 32 opcodes are present to transfer zeropage pointer or stackpage pointer to any accumulator.
Here are the macro definitions for some of the new opcodes.
First .b 65O16 core spec is here in zipped RTF format.
Updated spec v2 is here, including the opcode matrix.
* Thanks to BigEd's Verilog code for the barrel shifter on his GitHub page.
**Thanks to Arlet for his idea which I call 'Transposing Stores' on the accumulators.
***Many thanks as well to TT & Bitwise for their HXA and As65 65Org16 compatible Assemblers.
Also, a great many thanks to Bruce, who has contributed his C'mon which is also 65Org16 compatible.
It all started here:
- You'll need to widen the [1:0] regsel path, e.g. to [2:0] regsel. This allows 4 more registers. Widen src_reg and dst_reg the same way.
- Change SEL_A .. SEL_Y to 3'd0 .. 3'd3, and add SEL_B 3'd4.
To use the register B, all you need is extra decoding. The data path is already there. And the only decoding you need to use the B register instead of the A register, is to add a line for 'dst_reg <= SEL_B' and 'src_reg <=SEL_B ', when the IR matches your new instruction pattern. All the instructions that work for A (EOR, ADC, ROL, STA,...) then work automatically the same way for B.
The same thing applies to reg-reg transfers. To add a 'TBX' instruction, you'll need: load_reg <= 1, dst_reg <= SEL_X, src_reg <= SEL_B, and state <= REG when IR==TBX and state == DECODE.
EDIT(3/28/2012): Clarified more details.
EDIT(4/24/2012): Finishing the .b core spec's.
EDIT(5/14/2012): Added some links for reference, and link for new Macros.
EDIT(2/13/2013): Added link for "it all started here" comment