4 ms·
> illegal instructions... were often used by programmers Intentionally, with an expected effect? I'd need a citation for that.
by zahlman 6mo ago
> illegal instructions... were often used by programmers
Intentionally, with an expected effect? I'd need a citation for that.
- chuckadams 6mo agoSome desultory googling turned up: * https://www.nesdev.org/wiki/CPU_unofficial_opcodes#Games_using_unofficial_opcodes https://www.nesdev.org/wiki/CPU_unofficial_opcodes#Games_usi... * https://hitmen.c02.at/files/docs/c64/NoMoreSecrets-NMOS6510UnintendedOpcodes-20162412.pdf https://hitmen.c02.at/files/docs/c64/NoMoreSecrets-NMOS6510U... (doesn't name any software, but some copy protection schemes were already known to use them)
- boomlinde 6mo agoYes, many of those are perfectly stable. For example, the 6502 has an undocumented instruction commonly known as "LAX" which loads both the A and X registers at the same time in a predictable manner in most addressing modes, in the same time and space it would otherwise take to load either of those registers on their own. The benefits of being able to do stuff like this when you need to conserve resources are obvious, and common idioms have formed around their use. Check out https://csdb.dk/release/?id=198357 https://csdb.dk/release/?id=198357
- vardump 6mo agoSome instructions were very useful and they were simply discovered by programmers who tried out what each instruction did. People did not necessarily have access to documentation those days! So any instruction or hardware feature would get used, whether it's "officially" documented or not.