Illegal opcode

Illegal opcode

An Illegal Opcode, also called an 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. Illegal opcodes were common on older CPUs designed during the 1970s, such as the MOS Technology 6502, Intel 8086 and the Zilog Z80. They 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.

While most illegal instructions have useless or even highly undesirable effects (such as crashing the computer), a few might by accident do something that can be useful in certain situations. Such instructions were sometimes exploited in computer games of the 1970s and 1980s to speed up certain time-critical sections. Another common use of them was in the ongoing battle between copy protection implementations and cracking. Here, they were a form of security through obscurity, and their secrecy usually didn't last very long.

A danger associated with the use of illegal instructions was that, given the fact that the manufacturer didn't 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. For example, a number of older Apple II games don't work correctly on the newer Apple IIc, because the latter uses a newer CPU revision that does away with illegal opcodes.

Modern CPUs, such as the 80186, 80286 and its descendants or the PowerPC processor, usually don't have illegal opcodes. Their manufacturers guarantee that the CPU will behave in a well-defined way when it finds an unknown opcode in the instruction stream: usually, this means triggering a certain exception or fault condition. The operating system's exception or fault handler will then usually terminate the application that caused the fault. Another, less common way of handling illegal instructions is by defining them to do nothing (equivalent to the CPU's official NOP instruction); this method is used by the 65C02 processor, among others.

Today, the details of these instructions are mainly of interest for exact emulation of older systems.

Sources

*Illegal opcodes on the 6502: http://www.ffd2.com/fridge/docs/6502-NMOS.extra.opcodes

*Illegal opcodes on the Z80: http://www.myquest.nl/z80undocumented/


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Illegal Opcode —   [»Op« Abk. für Operation; dt. »unzulässiger Maschinensprachebefehl«], Anweisung in Maschinensprache, die nicht in dem benutzten Prozessor implementiert ist. Bei der Ausführung tritt ein Fehler auf, die Programmabarbeitung wird gewöhnlich… …   Universal-Lexikon

  • Opcode — In computer science, an opcode (operation code) is the portion of a machine language instruction that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in… …   Wikipedia

  • SIGILL — Infobox Computing signal description = Illegal instruction action = Abnormal termination of the process ILL ILLOPC | illegal opcode ILL ILLOPN | illegal operand ILL ADR | illegal addressing mode ILL ILLTRP | illegal trap ILL PRVOPC | privileged… …   Wikipedia

  • Apple IIe — Mac specs| ProDOS|RAM=64 KB (up to 1 MB+)|RAMtype=| Discontinued=November 1993The Apple IIe is the third model in the Apple II series of personal computers produced by Apple Computer. The e in the name stands for enhanced , referring to the fact… …   Wikipedia

  • Macintosh Toolbox — The Macintosh Toolbox is a set of application programming interfaces with a particular access mechanism. They implement many of the high level features of the Mac OS. The Toolbox is comprised of a number of managers, software components such as… …   Wikipedia

  • Apple IIc — Mac specs| 65C02 CPUspeed=1.023 MHz|OS=ProDOS|RAM=128 KB (up to 1.125 MB)|RAMtype=| Discontinued=August 1988The Apple IIc, the fourth model in the Apple II series of personal computers, was Apple Computer’s first endeavor to produce a portable… …   Wikipedia

  • Zilog Z80 — One of the first Z80 microprocessors manufactured; the date stamp is from June 1976. Produced 1976 Common manufacturer(s) Zilog …   Wikipedia

  • Software cracking — is the modification of software to remove or disable features which are considered undesirable by the person cracking the software, usually related to protection methods: copy protection, trial/demo version, serial number, hardware key, date… …   Wikipedia

  • MOS Technology 6502 — The MOS Technology 6502 is an 8 bit microprocessor that was designed by Chuck Peddle for MOS Technology in 1975. When it was introduced, it was the least expensive full featured CPU on the market by a considerable margin, costing less than one… …   Wikipedia

  • Motorola 68000 — This article is about the CPU. For the computer, see Sharp X68000. Motorola 68000 Designer Motorola Bits 16/32 bit Introduced 1979 Design CISC Endianness Big …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”