Re:The 6502 instruction set as a database
by thristian on Monday April 08, 2024 @10:52PM
(#39975863)
The original 6502 had exactly 151 opcodes, the same as the number of pokémon in the original Pokémon games.
Re:The 6502 instruction set as a database
by dspillett on Tuesday April 09, 2024 @08:29PM
(#39985731)
This is a wonderful useless fact. Thanks!
Re:The 6502 instruction set as a database
by gabrielsroka on Monday April 08, 2024 @11:29PM
(#39975993)
> pendant
I assume you mean pedant.
In terms of bytes that the original CPU officially recognised as instructions, it was more like ~150 (working from old memories, I may be off by one or few there). Some of the other ~106 did something unofficially, and a number were valid instructions on later versions of the design.
That ~150 were grouped into 56 instructions, many with multiple addressing modes (so "load A immediate", "load A direct", "load A indexed", etc, were different opcodes but considered the same instruction).
Because register use was far from orthogonal (one accumulator, two index registers, and a flags register), instructions for them were considered different (LDA, LDX, & LDY, for load for instance) where in other instruction sets (for chips with multiple general purpose registers) they might be considered the same instruction affecting a different register, though considering them the same instruction didn't reduce the opcode count just the instruction group count.
(Apologies for failing to keep my inner pendant properly inner!)