Intel's x86 UD2 instruction traces back to two rival undefined opcodes, 0F FF and 0F B9
A Microsoft engineer explains the history behind x86's UD2 instruction, which architecturally guarantees an invalid opcode exception and is used by compilers to mark unreachable code. Before UD2 existed, developers relied on undocumented byte sequences like 0F FF and 0F B9 that happened to trigger the same crash behavior, splitting programmers into informal camps depending on which sequence they used.