The Mystery of the 6502's Illegal Opcodes
2025-04-23
The MOS 6502, powering classics like the Commodore 64, Apple II, and NES, is famous for its 'illegal' opcodes: 105 undefined instructions out of 256. While many articles document their effects, this one delves into their origins. By analyzing the 6502's internal Programmable Logic Array (PLA), the author reveals how these undocumented instructions arise from the chip's design. Examples like the 'LAX' instruction (a combined LDA and LDX) and the 'KIL' opcodes (which halt the CPU) are explained, showcasing how the 6502's architecture unintentionally created functional, albeit undefined, instructions.
Hardware