2 ms·
> The 6502 only has 56 opcodes In terms of bytes that the original CPU officially recognised as instructions, it was more like ~150 (working from old memories,
by dspillett 3y ago
> The 6502 only has 56 opcodes
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!)
- thristian 3y agoThe original 6502 had exactly 151 opcodes, the same as the number of pokémon in the original Pokémon games.
- dspillett 3y agoThis is a wonderful useless fact. Thanks!
- gabrielsroka 3y ago> pendant I assume you mean pedant.
- dspillett 3y agoAuto-carrot strikes again… I really must stop writing things on the phone. I'm bad enough with a decent keyboard, sometimes I make sense at all via phone input.