# Why is the x86 undefined instruction called ud2? Why 2?

DevFeed: [Why is the x86 undefined instruction called ud2? Why 2?](<https://devfeed.tech/articles/why-is-the-x86-undefined-instruction-called-ud2-why-2-21760.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20260910-00/?p=112689>)

Author: Raymond Chen

Published: 2026-09-10T14:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [x86](<https://devfeed.tech/topics/x86.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [intel](<https://devfeed.tech/topics/intel.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [exception](<https://devfeed.tech/tags/exception.md>), [intel](<https://devfeed.tech/tags/intel.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [other](<https://devfeed.tech/tags/other.md>), [processor](<https://devfeed.tech/tags/processor.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

The article explains why the x86 undefined instruction is called ud2. It describes how software used byte sequences that reliably raised an invalid opcode exception, how Intel later provided a standardized instruction, and how compiler output can use it to mark unreachable code and cause a deliberate crash.

## Source excerpt

It came after ud0 and ud1. The post Why is the x86 undefined instruction called <CODE>ud2</CODE>? Why 2? appeared first on The Old New Thing.