LOADALL), or even "new" pseudo-instructions can be implemented. Alternatively, unknown instructions can be emulated in software (e.g. Another, less common way of handling illegal instructions is by defining them to do nothing except taking up time and space (equivalent to the CPU's official NOP instruction) this method is used by the TMS9900 and 65C02 processors, among others. The operating system's exception or fault handler will then usually terminate the application that caused the fault, unless the program had previously established its own exception/fault handler, in which case that handler would receive control. ![]() Ideally, the CPU will behave in a well-defined way when it finds an unknown opcode in the instruction stream, such as triggering a certain exception or fault condition. More recent CPUs, such as the 80186, 80286, 68000 and its descendants, do not have illegal opcodes that are widely known/used. For example, a number of older Apple II games did not work correctly on the newer Apple IIc, because the latter used a newer CPU revision – 65C02 – that did away with illegal opcodes. Here, they were a form of security through obscurity, and their secrecy usually did not last very long.Ī danger associated with the use of illegal instructions was that, given the fact that the manufacturer does not guarantee their existence and function, they might disappear or behave differently with any change of the CPU internals or any new revision of the CPU, rendering programs that use them incompatible with the newer revisions. Another common use was in the ongoing battle between copy protection implementations and cracking. Such instructions were sometimes exploited in computer games of the 1970s and 1980s to speed up certain time-critical sections. While most accidental illegal instructions have useless or even highly undesirable effects (such as crashing the computer), some can have useful functions in certain situations. However, some processors that trap for most illegal opcodes do not do so for some illegal opcodes, and some other processors do not check for illegal opcodes, and, instead, perform an undocumented operation. The effect of many illegal opcodes, on many processors, is just a trap to an error handler. On old and modern processors, there are also instructions intentionally included in the processor by the manufacturer, but that are not documented in any official specification. On these older processors, many exist as a side effect of the wiring of transistors in the CPU, and usually combine functions of the CPU that were not intended to be combined. ![]() ![]() Illegal opcodes were common on older CPUs designed during the 1970s, such as the MOS Technology 6502, Intel 8086, and the Zilog Z80. A human generated illegal instruction signalĪn illegal opcode, also called an unimplemented operation, unintended opcode or undocumented instruction, is an instruction to a CPU that is not mentioned in any official documentation released by the CPU's designer or manufacturer, which nevertheless has an effect.
0 Comments
Leave a Reply. |