<s>
An	O
illegal	B-Language
opcode	I-Language
,	O
also	O
called	O
an	O
unimplemented	O
operation	O
,	O
unintended	B-Language
opcode	I-Language
or	O
undocumented	B-Language
instruction	I-Language
,	O
is	O
an	O
instruction	B-Language
to	O
a	O
CPU	B-Device
that	O
is	O
not	O
mentioned	O
in	O
any	O
official	O
documentation	O
released	O
by	O
the	O
CPU	B-Device
's	O
designer	O
or	O
manufacturer	O
,	O
which	O
nevertheless	O
has	O
an	O
effect	O
.	O
</s>
<s>
Illegal	B-Language
opcodes	I-Language
were	O
common	O
on	O
older	O
CPUs	B-Device
designed	O
during	O
the	O
1970s	O
,	O
such	O
as	O
the	O
MOS	B-General_Concept
Technology	I-General_Concept
6502	I-General_Concept
,	O
Intel	B-General_Concept
8086	I-General_Concept
,	O
and	O
the	O
Zilog	B-General_Concept
Z80	I-General_Concept
.	O
</s>
<s>
On	O
these	O
older	O
processors	O
,	O
many	O
exist	O
as	O
a	O
side	O
effect	O
of	O
the	O
wiring	O
of	O
transistors	B-Application
in	O
the	O
CPU	B-Device
,	O
and	O
usually	O
combine	O
functions	O
of	O
the	O
CPU	B-Device
that	O
were	O
not	O
intended	O
to	O
be	O
combined	O
.	O
</s>
<s>
The	O
effect	O
of	O
many	O
illegal	B-Language
opcodes	I-Language
,	O
on	O
many	O
processors	O
,	O
is	O
just	O
a	O
trap	B-Application
to	O
an	O
error	B-General_Concept
handler	I-General_Concept
.	O
</s>
<s>
However	O
,	O
some	O
processors	O
that	O
trap	B-Application
for	O
most	O
illegal	B-Language
opcodes	I-Language
do	O
not	O
do	O
so	O
for	O
some	O
illegal	B-Language
opcodes	I-Language
,	O
and	O
some	O
other	O
processors	O
do	O
not	O
check	O
for	O
illegal	B-Language
opcodes	I-Language
,	O
and	O
,	O
instead	O
,	O
perform	O
an	O
undocumented	O
operation	O
.	O
</s>
<s>
While	O
most	O
accidental	O
illegal	B-Language
instructions	I-Language
have	O
useless	O
or	O
even	O
highly	O
undesirable	O
effects	O
(	O
such	O
as	O
crashing	O
the	O
computer	O
)	O
,	O
some	O
can	O
have	O
useful	O
functions	O
in	O
certain	O
situations	O
.	O
</s>
<s>
Another	O
common	O
use	O
was	O
in	O
the	O
ongoing	O
battle	O
between	O
copy	B-Application
protection	I-Application
implementations	O
and	O
cracking	B-Application
.	O
</s>
<s>
A	O
danger	O
associated	O
with	O
the	O
use	O
of	O
illegal	B-Language
instructions	I-Language
was	O
that	O
,	O
given	O
the	O
fact	O
that	O
the	O
manufacturer	O
does	O
not	O
guarantee	O
their	O
existence	O
and	O
function	O
,	O
they	O
might	O
disappear	O
or	O
behave	O
differently	O
with	O
any	O
change	O
of	O
the	O
CPU	B-Device
internals	O
or	O
any	O
new	O
revision	O
of	O
the	O
CPU	B-Device
,	O
rendering	O
programs	O
that	O
use	O
them	O
incompatible	O
with	O
the	O
newer	O
revisions	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
number	O
of	O
older	O
Apple	B-Device
II	I-Device
games	O
did	O
not	O
work	O
correctly	O
on	O
the	O
newer	O
Apple	O
IIc	O
,	O
because	O
the	O
latter	O
used	O
a	O
newer	O
CPU	B-Device
revision	O
65C02	B-General_Concept
that	O
did	O
away	O
with	O
illegal	B-Language
opcodes	I-Language
.	O
</s>
<s>
More	O
recent	O
CPUs	B-Device
,	O
such	O
as	O
the	O
80186	B-Device
,	O
80286	B-General_Concept
,	O
68000	B-Device
and	O
its	O
descendants	O
,	O
do	O
not	O
have	O
illegal	B-Language
opcodes	I-Language
that	O
are	O
widely	O
known/used	O
.	O
</s>
<s>
Ideally	O
,	O
the	O
CPU	B-Device
will	O
behave	O
in	O
a	O
well-defined	O
way	O
when	O
it	O
finds	O
an	O
unknown	O
opcode	B-Language
in	O
the	O
instruction	B-Language
stream	O
,	O
such	O
as	O
triggering	O
a	O
certain	O
exception	B-General_Concept
or	O
fault	B-Application
condition	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
system	I-General_Concept
's	O
exception	B-General_Concept
or	O
fault	B-Application
handler	O
will	O
then	O
usually	O
terminate	O
the	O
application	O
that	O
caused	O
the	O
fault	B-Application
,	O
unless	O
the	O
program	O
had	O
previously	O
established	O
its	O
own	O
exception/fault	O
handler	O
,	O
in	O
which	O
case	O
that	O
handler	O
would	O
receive	O
control	O
.	O
</s>
<s>
Another	O
,	O
less	O
common	O
way	O
of	O
handling	O
illegal	B-Language
instructions	I-Language
is	O
by	O
defining	O
them	O
to	O
do	O
nothing	O
except	O
taking	O
up	O
time	O
and	O
space	O
(	O
equivalent	O
to	O
the	O
CPU	B-Device
's	O
official	O
NOP	B-Language
instruction	B-Language
)	O
;	O
this	O
method	O
is	O
used	O
by	O
the	O
TMS9900	B-General_Concept
and	O
65C02	B-General_Concept
processors	O
,	O
among	O
others	O
.	O
</s>
<s>
Alternatively	O
,	O
unknown	O
instructions	O
can	O
be	O
emulated	B-Application
in	O
software	O
(	O
e.g.	O
</s>
<s>
LOADALL	B-Device
)	O
,	O
or	O
even	O
"	O
new	O
"	O
pseudo-instructions	O
can	O
be	O
implemented	O
.	O
</s>
<s>
Some	O
BIOSes	O
,	O
memory	O
managers	O
,	O
and	O
operating	B-General_Concept
systems	I-General_Concept
take	O
advantage	O
of	O
this	O
,	O
for	O
example	O
,	O
to	O
let	O
V86	O
tasks	O
communicate	O
with	O
the	O
underlying	O
system	O
,	O
i.e.	O
</s>
<s>
BOP	O
(	O
from	O
"	O
BIOS	B-Operating_System
Operation	O
"	O
)	O
utilized	O
by	O
the	O
Windows	O
NTVDM	O
.	O
</s>
<s>
In	O
spite	O
of	O
Intel	O
's	O
guarantee	O
against	O
such	O
instructions	O
,	O
research	O
using	O
techniques	O
such	O
as	O
fuzzing	O
uncovered	O
a	O
vast	O
number	O
of	O
undocumented	B-Language
instructions	I-Language
in	O
x86	O
processors	O
as	O
late	O
as	O
2018	O
.	O
</s>
<s>
Some	O
of	O
these	O
instructions	O
are	O
shared	O
across	O
processor	O
manufacturers	O
,	O
indicating	O
that	O
Intel	O
and	O
AMD	O
are	O
both	O
aware	O
of	O
the	O
instruction	B-Language
and	O
its	O
purpose	O
,	O
despite	O
it	O
not	O
appearing	O
in	O
any	O
official	O
specification	O
.	O
</s>
<s>
The	O
purpose	O
of	O
the	O
majority	O
of	O
x86	O
undocumented	B-Language
instructions	I-Language
is	O
unknown	O
.	O
</s>
<s>
Today	O
,	O
the	O
details	O
of	O
these	O
instructions	O
are	O
mainly	O
of	O
interest	O
for	O
exact	O
emulation	B-Application
of	O
older	O
systems	O
.	O
</s>
