wayfarer wrote:
A couple of people have or are working on 'cores' for the 65CE02, I will be studying them for any custom chip/core developments!!
nice find! i made one of those 65CE02/816 hybrid cores. though i haven't worked on it for a while.
Alarm Siren wrote:
Indeed, I have a great fondness for the 65CE02. I think it addresses a lot of the 6502 and 65C02's shortcomings whilst fundamentally remaining true to the original, unlike the more drastic measures of the 65816 (which are mainly in service of the larger address space). And before Garth and BDD jump on me, yes I am fully aware you don't have to use the 65816's additional features if you don't want to: The point is I view the 65CE02 as being fundamentally a 6502 with the flaws fixed, whereas the 65816 is a different beast altogether. I do think its a pity that the 65CE02 saw so little real-world usage, and that the chips are no longer available. a WDC version of the 65CE02 would be great.
yeah, sometimes i feel like the modern day WDC65C02S should've been the WDC65C
E02S instead. BSR/BRL, relocatable stack and zeropage, stack indirect addressing modes, and other useful features... it would've been amazing!
especially for Operating Systems like FUZIX or GeckOS where fully relocatable code and data structures are pretty useful.
but sadly that is not the timeline we live in...
though there are a few things i would change about the 65CE02:
for example i would remove INW, DEW, ASW, and ROW (Word Increment/Decrement/Shift Left/Rotate Left) and replace them with ICC and DCC (Increment/Decrement with Carry) with both Basepage and Absolute addressing modes. ICC and DCC are functionally identical to "LDA ADC #0 STA" and "LDA SBC #0 STA" but don't modify the accumulator. so you can chain them to increment/decrement multi-byte words in memory (also works with BCD).
i would also change the way RTN # works. as described in the datasheet/other sites, RTN pulls # bytes off the stack (and discards them), and then reads the return address. with the idea being that you can easily get rid of a stack frame made during a function's execution.
but i would argue that having it the other way around is more useful. first pull the return address THEN pull # bytes off the stack (and discards them). with the idea being that you can remove function arguments that were pushed before the function was called using a single instruction.
i say it's more useful like that because while you can emulate either functionality manually using a macro, pulling bytes first and then returning is a lot easier to emulate than first getting the return address and then pulling bytes. so by having the instruction implement the more difficult/complex one, it means that if the other way is required it can be replicated much easier and with less code.
cjs wrote:
to keep the implementation as cheap as possible they determined that there would be only eight relative branch instructions, and BRA and BSR one ones that they chose to drop.
honestly if i had the choice between JSR and BSR, i would probably drop JSR and make BSR use a 16-bit relative offset. it's functionally the same (in most scenarios) as JSR but allows for position independent code. same with JMP and BRA or rather BRL (branch always long), i would keep BRL and remove JMP. but i'd keep the Indirect JMP's absolute, so you can still make use of function tables within a ROM regardless of where the code is located in RAM.
but of course i know that with the goal of staying as low cost as possible, having JMPs and JSRs always do a 16-bit addition with the relative offset and the PC would add quite a bit of complexity and cost. but a man can dream