Intel and Microsoft implemented 8087 FPU emulation on bare 8086 machines by having linkers replace ESC opcodes with INT stubs, using arithmetic fix-ups from library symbols.
Key Takeaways
The emulation decision was made at link time, not compile time – compilers emitted normal 8087 ESC opcodes plus fix-up metadata, linkers did the opcode rewriting.
Intel used INT 18h-1Fh (8 vectors); Microsoft switched to INT 34h-3Dh (10 vectors) to also emulate FWAIT and handle ES/DS/SS/CS segment overrides.
Fix-up arithmetic was zero-overhead for linkers: library symbols held numeric offsets that, added to the little-endian opcode bytes, arithmetically produced the target INT opcode – no special linker logic required.
Microsoft’s runtime self-patching: if an 8087 was detected at startup, INT stubs overwrote themselves with real ESC instructions on first execution, so 8087-equipped systems ran at full hardware speed from the same binary.
MASM 1.x silently miscompiled FSTSW DS:[BP] (dropped the override) and rejected SS:/CS: overrides entirely; MASM 3.0 (1984) fixed all six segment-override fix-up types: FIDRQQ, FIWRQQ, FIARQQ, FIERQQ, FISRQQ, FICRQQ.
Hacker News Comment Review
The 8086’s lack of native emulation trap support – unlike the 80286’s EM/MP flags – is identified as the architectural root cause forcing the compiler/linker/runtime three-way cooperation described in the article.
Practitioners in the thread confirm the implementation work was non-trivial numerically: at least one commenter wrote 8087 FP emulation for a commercial compiler and cited deep work in Knuth Vol 2 (log division algorithms).
The generic co-processor bus sparked discussion: the 8089 I/O processor used the same interface, but consensus was that almost nothing else meaningfully exploited it beyond the 8087.
Notable Comments
@xattt: Asks whether the 8087’s high price was a deliberate market-segmentation decision or a reflection of chip manufacturing difficulty.
@dehrmann: Intel’s PCI vendor ID is 8086 – a persistent callback to this chip family across decades of hardware.