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,947 of 4,675   
   Bart to Terje Mathisen   
   Re: I'm looking for a mathematical libra   
   19 Sep 19 11:42:38   
   
   From: bc@nospicedham.freeuk.com   
      
   On 19/09/2019 07:21, Terje Mathisen wrote:   
   > Rick C. Hodgin wrote:   
      
   >> 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 faster option was to compile the program so that each 8087   
   > instruction was compiled into a CALL to the emulator routine:   
   >   
   > If the 8087 hw was available, the emulator would patch the call site   
   > into the actual 8087 opcodes plus any NOPs needed to fill up the   
   > typically 3-byte call. If the opcode was in fact longer than the call,   
   > then the call would in fact be padded so that it could be replaced.   
      
      
   The OP mentioned a Pascal compiler. If so, then it might be easier to   
   let that generate different output depending on whether an 8087 was   
   available or not.   
      
   Alternatively, all code could use function calls for each FP op. Then   
   one of two libraries for those calls could be included: either one that   
   just uses the 8087, or one that does the software emulation.   
      
   If the software is expected to work well enough with emulation, then   
   those call overheads will not be significant.   
      
   --- 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