As Garth already posted this sort of question and the following "discussion" had happened frequently - everytime with much emotion as we're all in love with this little beast and its limitations and we all dream of Sweet16 or more
Acting a little bit as an Advocatus Diaboli
I take your introduction a bit more literally:
Alarm Siren wrote:
For the purposes of this discussion, imagine you are in circa 1980, and that the 65C02, 65816, and all the other subsequent extensions are variants do not exist. The 6502 has been a smashing success, but its time to give it a backwards-compatible upgrade. How would you upgrade it? What modes, instructions, extra pins, etc would you give it? 16 bit? 32 bit? hybrid? Stack? Movable direct page? more registers? Why?
Well I could remember that time but I took a look into some old Byte magazines to recall the RAM situation and the prices of the CPU and I/O circuitry. In 1980 a 6502 costs about 6..10$, a 6502A twice as much, Z80A in between, MC6809 <40$. Static RAM was 1Kx4 (5$) and 16Kx1 dynamic RAMs becomes payable (8 pcs. 50$). Beside the MC6809 the MC68000, the Z8000, and the i8086/88 appears in the advertising (seldom as chips, usually on cards or as a system) - any of them really expensive.
Now, if you emphase the backwards-compatibility then this could only mean the upgrade requires to be transparent under all circumstances - even for the usage of unimplemented opcodes. Then things becomes very difficult, as any improvement within the CPU architecture could change the behaviour of these "illegal" opcodes. Is it acceptable to repair the JMP [indirect] bug? That repair could cause incompatibilities!
Staying compatible means leaving all bugs untouched. Then only the twelve so-called "KIL" instructions are free as they most likely never used intentionally. Further there are a few more NOPs ($1A, $3A, $5A, $7A, $DA, $FA) that may be usable as well. This would allow to implement 18 new opcodes. Some welcomed extensions like PHX, PLX, PHY, PLY, SWP (nibble swap), INC A, and DEC A were possible. A further addressing mode like (ZP) without index would eat up 8 opcodes (ADC/AND/CMP/EOR/LDA/ORA/SBC/STA) leaving no room for goodies like BRA/LBRA, BSR/LBSR
Kicking SWP (sorry, Daryl) would allow the latter four but nothing else.
Of course, dropping INC/DEC A would allow to implement two different prebytes to extend the opcode map ad infinitum
But
implementing these additions
without affecting the original behaviour appears to me as a very costly adventure. It would probably require much more silicon to implement that around (outside) the core than to enhance the core with the risk of altering the behaviour of some "illegal" opcodes. Beside the NRE costs - assuming it would increase the chip size somewhere between 50..100% this would double the market price - for gaining what benfit in terms of speed?
A different approach could be just to use one "KIL" opc to implement a "BOOST" function: turning on the 65org16. Then 8 bits becomes 16 bits everywhere. (=> a "page" is then 65K x 16bit, an absolute address covers 2^32 16bit "bytes", ...). Perhaps it would be possible to rearrange the core in a way that all these upper 8 bits are ignored/untouched unless boosted, this may roughly double the required transistors. Again the chip could perhaps require not more than twice the area.
The 16 additional address lines plus 8 additional data lines would just fit into a 64 pin package -
or you may use 1 of the 3 "NC" pins to multiplex the address bus and another "NC" pin to select high or low byte access as a secondary multiplexing for the data. (This would cost an additional cycle -
).
Would anyone in 1980 buy such a CPU paying twice or more money for just staying compatible and then having to double all RAM/ROM (and perhaps I/O) to use the booster - meaning new hardware, not something to plug in? In the dawn of the new 16bit CPUs mentioned above I have my doubts.
my 2 cents