6502 redundant, missed, and suggested features
Posted: Sat Aug 13, 2016 11:09 am
6502 has the fastest and most convenient way to handle BCD. It uses the decimal mode which about twice as fast as its BCD correction analogues for 8080, 6800, z80, 6809, 80x86. 680x0 uses 5 special instructions for this type of data - such a waste of the code space.
IMHO the support of BCD data is redundant. The only advantage for BCD for 6502 is fast decimal data input from text and output to text. However the division and the multiplication for BCD are twice slower than for binary data. It is because
must be replaced by the sequence
BCD allow fast multiplication only by 10 and fast division only by 10 and 5. It is common to use the division and the multiplication much more often than the input/output operations which usually work with the slow peripheral devices. So it is generally much faster to use binaries as the main type and to convert it to decimal only for input and output.
It is possible to dream what could be made instead of these redundant operations?... I'd like to see the second accumulator like at 6800 or/and a block memory copy instruction like at 65816.
It is curious why BCD are supported even at 80x86 or 680x0 which have hardware multiplication and division? The modern CPU architectures like x86-64 or ARM have no hardware BCD support at all. It is worth to note that DEC CPU architectures also had no such support even at 70s or 80s. However DEC architectures had a lot of other redundancies.
The other redundant feature of 6502 IMHO is the overflow flag. The discussion at http://www.stardot.org.uk/forums/viewto ... =4&t=11543 shows that almost all programs do not use it. This flag is usable only to catch the errors which are not even considered as the errors in the modern programming languages by default. IMHO it would be better to have odd/even flag (bit 0 of result) instead of V-flag.
The question: are there other 6502 redundancies?
IMHO the support of BCD data is redundant. The only advantage for BCD for 6502 is fast decimal data input from text and output to text. However the division and the multiplication for BCD are twice slower than for binary data. It is because
Code: Select all
ASL/ROL memCode: Select all
LDA mem
ADC mem
STA memIt is possible to dream what could be made instead of these redundant operations?... I'd like to see the second accumulator like at 6800 or/and a block memory copy instruction like at 65816.
It is curious why BCD are supported even at 80x86 or 680x0 which have hardware multiplication and division? The modern CPU architectures like x86-64 or ARM have no hardware BCD support at all. It is worth to note that DEC CPU architectures also had no such support even at 70s or 80s. However DEC architectures had a lot of other redundancies.
The other redundant feature of 6502 IMHO is the overflow flag. The discussion at http://www.stardot.org.uk/forums/viewto ... =4&t=11543 shows that almost all programs do not use it. This flag is usable only to catch the errors which are not even considered as the errors in the modern programming languages by default. IMHO it would be better to have odd/even flag (bit 0 of result) instead of V-flag.
The question: are there other 6502 redundancies?