You can do whatever you want! The question is how much compatibility you'd like to offer
but what if the changes don't really effect backwards compatibility with existing 65C02 code?
what i'm getting at is new instructions... again.
just this time they will be less... extreme...
so no multiply or extra registers or anything like that...
i have a few in mind that i can somewhat easily add that i would like some feedback on.
because it takes a real programmer to judge the usefulness of instructions.
SXY - Swap X and Y
same as before, simply swaps the contents of the X and Y Register
ICC and DCC - Increment with Carry, Decrement with Carry (or borrow?)
these are a bit more interesting. they take a byte from Memory, add/subtract the carry to/from it, and store it back into Memory.
they can use the same logic as ADC and SBC, only differences being that instead of "A + M + C -> A" it would be "0 + C + M -> M"
this means that unlike other Increment and Decrement instructions these would also set/clear the Carry flag, allowing you to inc/dec multibyte values in Memory without having to modify the Accumulator.
another interesting side effect is that these would work in Decimal mode... allowing you to inc/dec multibyte BCD Numbers...
it takes like 2 less bytes than a regular 16 bit inc/dec function but therefore works with BCD and can also easily scale to 24, 32, etc bit numbers without even more branches.
as for addresing modes, i thought about these: Absolute, Absolute X-Indexed, and Zeropage.
SEV - Set Overflow flag
because why not?
and lastly, this is more of a joke, though it would be easy to implement
you all know the different indirect addressing modes for LDA/STA...
Code: Select all
LDA/STA (LABEL) Indirect
LDA/STA (LABEL,X) X-Indexed, Indirect
LDA/STA (LABEL),Y Indirect, Y-Indexed
but you know which one is missing?
Code: Select all
LDA/STA (LABEL,X),Y X-Indexed, Indirect, Y-Indexed
D O U B L E
I N D E X I N G !
.
but besides that i'll still be finishing the "pure" 65c02 Verilog code like i originally said
but i might also add this other version of it with the additional instructions.
anyways, as always tahnks for all the help i get on here. without this forum i would've never gotten this far into a single existing CPU....