[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



Am 18.05.2006, 16:14 Uhr, schrieb Paul Schlyter <pausch@saaf.se>:

Could you point at one single case where use of undocumented opcodes did
significantly speed up an application on the 6502 platform?

Bresenham interpolation.

Without illegal opcodes:

STA $12
TXA
STA $FE00,Y
TAX
LDA $12
SBC $10
BCS .skip
ADC $11
INX
.skip

With illegal opcodes:

SHX $FE00,Y
SBC $10
BCS .skip
ADC $11
INX
.skip

Best case: 21 vs 11 clock cycles (almost 2x speed with illegal)
Worst case: 25 vs 15 clock cycles (still 1.67x speed)