home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,944 of 4,675   
   Rick C. Hodgin to Bart   
   Re: I'm looking for a mathematical libra   
   18 Sep 19 23:58:38   
   
   From: rick.c.hodgin@gmail.com   
      
   On 9/18/2019 7:50 PM, Bart wrote:   
   > On 18/09/2019 13:05, Rick C. Hodgin wrote:   
   >> I searched for it but couldn't find it.  There used to be an 8087.asm   
   >> app that worked with DOS.  It would install a software emulator for   
   >> the 8086/8088 CPUs so it would work with native x87 FPU instructions.   
   >> I may still have it on one of my Programmer's Heaven CDs from back in   
   >> the BBS days.   
   >>   
   >> It was fully IEEE-754 compliant and could be adapted.  In fact, IIRC,   
   >> a version of that program was used to find the famous Pentium FDIV   
   >> bug, as the software version was reporting correctly, and the Pentium   
   >> was reporting incorrectly, over a particular range of inputs.   
   >   
   > If emulating 8087 then that puts extra demands on the emulation library,   
   > especially if emulating its internal 64-bit calculations.   
      
   Yes.  The x86 CPU has a feature to allow software emulation of the   
   full x87 instruction set.  Whenever an x87 instruction is encountered   
   in x87 emulation mode, it signals an interrupt which dispatches to a   
   handler.  There the software simulates the operation, and then iret   
   back and it keeps going.  Slow, but it provides an easy x87 operation   
   when all you have is an 8086 or 8088.   
      
   The 80286, 80386, and 80486SX allowed those abilities as well.  All   
   CPUs 80486DX and later have built-in FPUs.   
      
   > When I was coding this stuff (sorry source code long since lost), I   
   > coded to my own specifications, and did little checking other than for   
   > divide-by-zero. To make it easier, and a bit faster, I think I arranged   
   > for the exponent+sign to fit exactly into the top byte of 32 bits.   
   >   
   > (While an older version for the 8-bit Z80, which had very limited 16-bit   
   > capability, used a 24-bit format: 8-bit exponent/sign, and 16-bit   
   > mantissa.)   
      
   IEEE-754 compliance is difficult.  If you don't go for 100% compliance   
   it's not so hard, but then it's really only good for what you want to   
   use it for.   
      
   Some people have used the emulation ability to install ISA support for   
   alternate hardware.  They re-purpose the x87 FPU opcodes to be their   
   own operations, which can access a card, send data to it, allow a co-   
   processor to handle some computation, read back the result, and then   
   maintain the alternate environment state.   
      
   Very flexible design if you don't need the FPU.   
      
   --   
   Rick C. Hodgin   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca