Why is the x86 undefined instruction called ud2?

Raymond Chen, writing at The Old New Thing, explains the history behind the x86 instruction ud2. It is an architecturally undefined instruction that always raises an invalid opcode exception. Compilers emit it to mark unreachable code. If a function marked [[noreturn]] somehow returns, the compiler…

dev

Sources

Why is the x86 undefined instruction called ud2? · TechNews