1. 34
    1. 2

      I’ve had nights like that.

      1. 1
        What WIN87EM.DLL Does

        The IRQ 13 handler in WIN87EM.DLL performs the following steps:

        • Disable interrupts (CLI)
        • PUSH and POP the AX register 70 times, maybe it will slow things down
        • Write zero to I/O port F0h to clear the PC/AT FPU error latch
        • Mask a selection of interrupts
        • Write an EOI to the master interrupt controller (but not slave)
        • Execute the FNSTSW instruction to store the FPU status word (but only that)
        • PUSH and POP the AX register 16 times, because speed kills
        • Write zero to I/O port F0h again, in case it didn’t work the first time
        • Execute the FNCLEX instruction to clear pending FPU exceptions
        • Write zero to I/O port F0h again, because third time’s the charm
        • PUSH and POP the AX register 16 times, because it was so much fun last time
        • Execute the FNCLEX instruction again, just to be really sure
        • PUSH and POP the AX register 16 times, because it’s the thing to do
        • Write zero to I/O port F0h again, because three times might not have been enough
        • Finally jump to code that doesn’t look crazy

        Wow.