[net.micro.pc] 8087 software emulator

lugrin@gvasa.DEC (05/14/84)

Looking for 8087 software emulator:

Some programs and/or languages (like latest microsoft fortran) include
an 0887 emulator.  Some don't.  I am looking for an 8087 emulator
availlable separately,  that I can load in memory or link to my
programs.  I am even considering paying good money for it!  So if you
known one, please send your comments by mail to:

	...decvax!decwrl!rhea!gva01!gvasa!lugrin

P.S.  The emulator is for a DEC Rainbow-100,  but most IBM compilers
work fine on the Rainbow, so an emulator should run fine too.

/jm

broehl@wateng.UUCP (Bernie Roehl) (05/15/84)

The problem with 8087 "emulators" is that they have to be part of the
language; compilers will either generate code to use the 8087 or they
will generate calls to a run-time library of floating-point routines to
perform equivalent functions.

If they generate code to use the 8087 directly, there's no way to "trap"
this; they are instructions like any other, and so can be executed anywhere
and anytime.  Thus no memory-resident emulator is possible; it's *not* like
writing something to field keystrokes and process them before passing them
on to the system.

-- 
        -Bernie Roehl    (University of Waterloo)

ray@vax135.UUCP (Raymond Soneira) (05/16/84)

	The proper way to perform an 8087 software emulation is to
always have the compiler generate the 8087 opcodes and let the linker/loader
search for the opcodes and substitute library function calls that emulate
the 8087 when the hardware isn't there.  It is perfectly transparent.

bet@ecsvax.UUCP (05/17/84)

What happens inside the 8088 when an 8087 instruction is seen, if the
system doesn't have an 8087? Modern, civilized machines provide a special
"invalid instruction" interrupt. I can't find any description of what happens
in my Intel documentation (poorly organized as it is, that isn't saying much).

If an "invalid instruction" interrupt existed, an interrupt handler could
emulate the 8087.

					Bennett Todd
					...{decvax,ihnp4,akgua}!mcnc!ecsvax!bet

jso@edison.UUCP (05/18/84)

The correct way to do 8087 emulation is the way Intel does;
it is not part of the compiler in the sense that it needs
to be known at compile time whether an emulator will be used.
(The suggestion that the linker translate the 8087 opcodes
is strange: how do you tell opcodes from data?)

All Intel translators produce object records that say
"place here the value of the symbol xxx" for the various
8087 instructions. If you have an 8087, you like with a
file that defines them to be the escape codes. If you
don't, you use a similar file that defines interrupts
and codes for the emulator, and also link in the
emulator itself.

-John Owens

kds@intelca.UUCP (Ken Shoemaker) (05/19/84)

>What happens inside the 8088 when an 8087 instruction is seen, if the
>system doesn't have an 8087? Modern, civilized machines provide a special
>"invalid instruction" interrupt. I can't find any description of what happens
>in my Intel documentation (poorly organized as it is, that isn't saying much).

Indeed, the 8088 (and 8086) do nothing out of the ordinary when an 8087
instruction is encountered...they just calculate the operand address and
place it on the bus for the 8087 to read (so it can perform any memory
operations that it requires to finish its operation).  If there is no
8087 there, nothing else happens.  

	The 186 and 286 BOTH provide interrupts such that if
the floating point unit is not present in the system when a floating
point instruction is encountered, the processor traps.  In
addition, a seperate trap occurs when an illegal opcode is
encountered to simplify floating point emulation.  Enhancements such
as these are the reasons why certain ranges of the interrupts were
labeled as "reserved." (are you listening out there, software developers?)
-- 
Ken Shoemaker, Intel, Santa Clara, Ca.
{pur-ee,hplabs,ucbvax!amd70,ogcvax!omsvax}!intelca!kds