412:
165:
63:
22:
227:
551:'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. 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
510:
A 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
473:
in the CPU, and usually combine functions of the CPU that were not intended to be combined. 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.
586:
are both aware of the instruction and its purpose, despite it not appearing in any official specification. Other instructions are specific to manufacturers or specific product lines. The purpose of the majority of x86 undocumented instructions is unknown.
481:
to an error handler. 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.
490:
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. Such instructions were sometimes exploited in
538:
and its descendants, do not have illegal opcodes that are widely known/used. 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
443:
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
571:, memory managers, and operating systems take advantage of this, for example, to let V86 tasks communicate with the underlying system, i.e. BOP (from "BIOS Operation") utilized by the Windows
582:
uncovered a vast number of undocumented instructions in x86 processors as late as 2018. Some of these instructions are shared across processor manufacturers, indicating that Intel and
905:'s also contains some information about undocumented processor opcodes and processor bugs: OPCODES.LST by Alex V. Potemkin and 86BUGS.LST by Harald Feldmann.)
754:
752:
732:
Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and
Windows 3.1
704:
897:
895:
893:
891:
889:
887:
806:
899:
398:
618:
127:
99:
495:
of the 1970s and 1980s to speed up certain time-critical sections. Another common use was in the ongoing battle between
106:
875:
744:
277:
253:
208:
186:
146:
49:
851:
179:
623:
80:
35:
113:
902:
466:
84:
831:
678:
669:
312:
95:
504:
391:
556:
355:
173:
700:
776:
440:
73:
563:
processors, among others. Alternatively, unknown instructions can be emulated in software (e.g.
190:
930:
638:
540:
384:
120:
648:
603:
578:
In spite of Intel's guarantee against such instructions, research using techniques such as
411:
802:
8:
448:
372:
236:
41:
730:
613:
608:
367:
740:
544:
500:
248:
643:
633:
548:
478:
334:
512:
496:
360:
916:
Christian
Ludloff's site sandpile.org also contains info on undocumented opcodes
736:
535:
445:
242:
766:
924:
867:
726:
327:
298:
871:
590:
Today, the details of these instructions are mainly of interest for exact
847:
531:
527:
552:
492:
470:
455:
350:
671:
PDP-10 Reference
Handbook: Programming with the PDP-10 Instruction Set
511:
incompatible with the newer revisions. For example, a number of older
628:
560:
520:
516:
462:
62:
591:
823:
477:
The effect of many illegal opcodes, on many processors, is just a
771:
579:
564:
519:, because the latter used a newer CPU revision –
436:
317:
567:), or even "new" pseudo-instructions can be implemented. Some
718:
572:
459:
452:
915:
568:
724:
583:
729:; Maxey, David; Michels, Raymond J.; Kyle, Jim (1994) .
523: – that did away with illegal opcodes.
848:"Z80 Documentation: The Undocumented Z80 Documented"
507:, and their secrecy usually did not last very long.
234:It has been suggested that this article should be
87:. Unsourced material may be challenged and removed.
922:
290:Undocumented CPU instruction that has an effect
751:(xviii+856+vi pages, 3.5-inch floppy) Errata:
661:
465:. On these older processors, many exist as a
392:
415:A human generated illegal instruction signal
803:"Extra Instructions Of The 65XX Series CPU"
692:
50:Learn how and when to remove these messages
824:"How MOS 6502 Illegal Opcodes really work"
515:games did not work correctly on the newer
399:
385:
758:
555:instruction); this method is used by the
278:Learn how and when to remove this message
209:Learn how and when to remove this message
147:Learn how and when to remove this message
410:
172:This article includes a list of general
698:
923:
828:pagetable.com - Some Assembly Required
735:(2 ed.). Reading, Massachusetts:
866:
845:
821:
800:
764:
619:Gadget (machine instruction sequence)
220:
158:
85:adding citations to reliable sources
56:
15:
13:
818:(NB. Illegal opcodes on the 6502.)
794:
767:"Breaking the x86 Instruction Set"
178:it lacks sufficient corresponding
14:
942:
909:
863:(NB. Illegal opcodes on the Z80.)
765:Domas, Christopher (2017-08-31).
31:This article has multiple issues.
225:
163:
61:
20:
878:from the original on 2017-08-22
854:from the original on 2021-10-09
834:from the original on 2021-11-19
809:from the original on 2021-08-28
779:from the original on 2021-12-19
707:from the original on 2017-03-21
624:Halt and Catch Fire (computing)
72:needs additional citations for
39:or discuss these issues on the
526:More recent CPUs, such as the
1:
822:Steil, Michael (2008-07-29).
699:Ă…kesson, Linus (2013-03-31).
679:Digital Equipment Corporation
654:
681:(DEC). 1969. p. 1-7
503:. Here, they were a form of
7:
903:Ralf Brown's Interrupt List
846:Young, Sean (2005-09-18) .
801:Vardy, Adam (1996-09-27) .
668:"1.2. Instruction Format".
597:
485:
10:
947:
505:security through obscurity
701:"GCR decoding on the fly"
872:"The x86 Interrupt List"
433:undocumented instruction
425:unimplemented operation
193:more precise citations.
416:
870:, ed. (2002-12-29) .
639:Synthetic programming
414:
240:into articles titled
649:Undocumented feature
604:Backdoor (computing)
499:implementations and
81:improve this article
373:Execute instruction
725:Schulman, Andrew;
614:Easter egg (media)
594:of older systems.
417:
368:Repeat instruction
469:of the wiring of
429:unintended opcode
423:, also called an
409:
408:
288:
287:
280:
270:
269:
249:Unintended opcode
219:
218:
211:
157:
156:
149:
131:
54:
938:
886:
884:
883:
862:
860:
859:
842:
840:
839:
817:
815:
814:
788:
787:
785:
784:
762:
756:
750:
722:
716:
715:
713:
712:
696:
690:
689:
687:
686:
676:
665:
644:Trap (computing)
634:Pentium F00F bug
549:operating system
401:
394:
387:
305:General concepts
295:
294:
283:
276:
265:
262:
229:
228:
221:
214:
207:
203:
200:
194:
189:this article by
180:inline citations
167:
166:
159:
152:
145:
141:
138:
132:
130:
96:"Illegal opcode"
89:
65:
57:
46:
24:
23:
16:
946:
945:
941:
940:
939:
937:
936:
935:
921:
920:
912:
881:
879:
874:(61 ed.).
857:
855:
837:
835:
812:
810:
797:
795:Further reading
792:
791:
782:
780:
763:
759:
747:
723:
719:
710:
708:
697:
693:
684:
682:
677:. Vol. 1.
674:
667:
666:
662:
657:
609:Don't-care term
600:
547:condition. The
497:copy protection
488:
405:
361:Indirect branch
313:Instruction set
291:
284:
273:
272:
271:
266:
260:
257:
230:
226:
215:
204:
198:
195:
185:Please help to
184:
168:
164:
153:
142:
136:
133:
90:
88:
78:
66:
25:
21:
12:
11:
5:
944:
934:
933:
919:
918:
911:
910:External links
908:
907:
906:
868:Brown, Ralf D.
864:
843:
819:
796:
793:
790:
789:
757:
745:
737:Addison Wesley
727:Brown, Ralf D.
717:
691:
659:
658:
656:
653:
652:
651:
646:
641:
636:
631:
626:
621:
616:
611:
606:
599:
596:
493:computer games
487:
484:
446:MOS Technology
421:illegal opcode
407:
406:
404:
403:
396:
389:
381:
378:
377:
376:
375:
370:
365:
364:
363:
353:
345:
344:
340:
339:
338:
337:
332:
331:
330:
325:
323:Illegal opcode
315:
307:
306:
302:
301:
289:
286:
285:
268:
267:
243:Invalid opcode
233:
231:
224:
217:
216:
171:
169:
162:
155:
154:
69:
67:
60:
55:
29:
28:
26:
19:
9:
6:
4:
3:
2:
943:
932:
929:
928:
926:
917:
914:
913:
904:
900:
898:
896:
894:
892:
890:
888:
877:
873:
869:
865:
853:
849:
844:
833:
829:
825:
820:
808:
804:
799:
798:
778:
774:
773:
768:
761:
755:
753:
748:
746:0-201-63287-X
742:
738:
734:
733:
728:
721:
706:
702:
695:
680:
673:
672:
664:
660:
650:
647:
645:
642:
640:
637:
635:
632:
630:
627:
625:
622:
620:
617:
615:
612:
610:
607:
605:
602:
601:
595:
593:
588:
585:
581:
576:
574:
570:
566:
562:
558:
554:
550:
546:
542:
537:
533:
529:
524:
522:
518:
514:
508:
506:
502:
498:
494:
483:
480:
475:
472:
468:
464:
461:
457:
454:
450:
447:
442:
438:
434:
430:
426:
422:
413:
402:
397:
395:
390:
388:
383:
382:
380:
379:
374:
371:
369:
366:
362:
359:
358:
357:
354:
352:
349:
348:
347:
346:
342:
341:
336:
333:
329:
326:
324:
321:
320:
319:
316:
314:
311:
310:
309:
308:
304:
303:
300:
297:
296:
293:
282:
279:
264:
261:December 2021
255:
251:
250:
245:
244:
239:
238:
232:
223:
222:
213:
210:
202:
192:
188:
182:
181:
175:
170:
161:
160:
151:
148:
140:
137:December 2010
129:
126:
122:
119:
115:
112:
108:
105:
101:
98: –
97:
93:
92:Find sources:
86:
82:
76:
75:
70:This article
68:
64:
59:
58:
53:
51:
44:
43:
38:
37:
32:
27:
18:
17:
931:Machine code
880:. Retrieved
856:. Retrieved
836:. Retrieved
827:
811:. Retrieved
781:. Retrieved
770:
760:
731:
720:
709:. Retrieved
694:
683:. Retrieved
670:
663:
589:
577:
525:
509:
489:
476:
432:
428:
424:
420:
418:
343:Instructions
328:Opcode table
322:
299:Machine code
292:
274:
258:
247:
241:
235:
205:
196:
177:
143:
134:
124:
117:
110:
103:
91:
79:Please help
74:verification
71:
47:
40:
34:
33:Please help
30:
471:transistors
467:side effect
437:instruction
191:introducing
882:2011-10-14
858:2021-11-18
838:2021-11-18
813:2021-11-18
783:2018-01-03
711:2017-03-21
685:2022-05-13
655:References
458:, and the
174:references
107:newspapers
36:improve it
629:Microcode
592:emulation
541:exception
517:Apple IIc
199:June 2020
42:talk page
925:Category
876:Archived
852:Archived
850:. 0.91.
832:Archived
807:Archived
777:Archived
705:Archived
598:See also
513:Apple II
501:cracking
486:Overview
435:, is an
772:YouTube
580:fuzzing
565:LOADALL
557:TMS9900
335:Operand
254:discuss
187:improve
121:scholar
743:
569:BIOSes
356:Branch
318:Opcode
176:, but
123:
116:
109:
102:
94:
901:(NB.
675:(PDF)
573:NTVDM
561:65C02
545:fault
536:68000
532:80286
528:80186
521:65C02
460:Zilog
453:Intel
439:to a
237:split
128:JSTOR
114:books
741:ISBN
559:and
479:trap
456:8086
449:6502
246:and
100:news
584:AMD
553:NOP
543:or
463:Z80
441:CPU
431:or
419:An
351:NOP
256:)
252:. (
83:by
927::
830:.
826:.
805:.
775:.
769:.
739:.
703:.
575:.
534:,
530:,
451:,
427:,
45:.
885:.
861:.
841:.
816:.
786:.
749:.
714:.
688:.
400:e
393:t
386:v
281:)
275:(
263:)
259:(
212:)
206:(
201:)
197:(
183:.
150:)
144:(
139:)
135:(
125:·
118:·
111:·
104:·
77:.
52:)
48:(
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.