Theme 1 – Preference for a dedicated undefined opcode (UD2) over software interrupts
Many commenters argue that using a specific UD opcode is simpler, smaller, and more portable than invoking an interrupt handler.
- “It's basically a convention. The alternative is to raise interrupts of course, but that might be application specific…” – js8
- “There's a bit of convention and practicality… Needing to set register to identify a fatal error is not great for code size…” – sweetjuly
Theme 2 – Technical reasons for having UD0/UD1/UD2 instead of using INT to trigger #UD
The discussion explains why Intel defined explicit undefined opcodes: they avoid the need to manually set up the stack frame that INT requires and give a guaranteed, OS‑independent exception.
- “Already since Intel 8086, x86 has the instruction 'INT vector_number'… you need to setup the stack in such a way… If Intel had not defined an official opcode that is guaranteed to remain unused forever… reserving an opcode at Intel and AMD was simpler.” – adrian_b
- “Nowadays UD0 UD1 UD2 are in the SDM and APM. We also got UDB (D6), the one‑byte variant that arrived with x86‑64 for 64‑bit mode.” – 349ru3h4f03
Theme 3 – Historical legacy of floppy drives shaping DOS/Windows drive letters
The assignment of A: and B: to floppy disks (and consequently C: to the first hard disk) is explained as a compatibility relic from early PCs.
- “It's like why the first (hard) drive letter is C.” – qbane
- “Yeah it's a relic from when computers booted off floppy and hard disks were rare and expensive.” – alightsoul
- “The floppies got A and B because hard drives were expensive and for a time a lot of people got by without them…” – raldi