• Please review our updated Terms and Rules here

8087 emulator for 8088

archeocomp

Experienced Member
Joined
Apr 29, 2012
Messages
416
Location
EU/SK
Hi, I know there was such a thing because I used it 20 years ago on my XT for AutoCAD10. I can not find anymore. I can only find em87 and emul87 but they are for 286/386 CPUs. Does anybody have it ? BTW I have a real 8087 ..
 
What are you trying to achieve?

It seems fairly obvious to me - if you need an 8087 and you don't have one, such a program helps you get around the problem. Sure, you are going to be much slower than if you had the real thing. But that is far better than being blocked entirely.
 
If your object is to run 8087-required software on an 8088/8086 system that isn't equipped with one, I don't know if that's possible, short of a full-blown interpretive emulation. The reason the packages that you cited require an 80286 is because the 286 has a dedicated interrupt for "Processor extension not present" (Interrupt 7)--the 8086 does not. If I recall correctly (and it's been a long time), executing an ESC sequence on an 8086 not equipped with an 8087 results in the execution of a no-op.

At least this is what I remember.
 
There're old usenet posts that mention they did exist and even an old MS KB article mentioning them.

All the ones listed on Simtel mention an AT or higher though.
 
It was the reference to having an 8087 that made me wonder. For AutoCad in particular, wasn't there a choice between Weitech (?) and Intel coprocessors, so maybe the code was modular enough that the software emulation, for that app, was nothing more than a specific overlay or similar.
 
So why doesn't someone just code an FINIT on their 8087-less XT (all of mine are out of reach) and see what happens? My guess is "nothing"; i.e. no interrupts or hangs--code just continues as if the instructions were no-ops. Behavior is very different on a 286.

Let me be clear--there are emulation libraries where the code has the luxury of calling a subroutine in the library (which can determine if an 8087 is present or not--I think Microsoft (or Lattice) C had the option of linking in a "use an 8087 if it's there" library.

I also recall that several ICEs also allowed for trapping of 8087 references. But on a stock PC or XT with no 8087? I don't think so.
 
I will ask some architect guys that work with ACAD since ever. I am not sure if it was Weitec or 8087 emulator on my XT.
 
So why doesn't someone just code an FINIT on their 8087-less XT (all of mine are out of reach) and see what happens? My guess is "nothing"; i.e. no interrupts or hangs--code just continues as if the instructions were no-ops. Behavior is very different on a 286.

As far as I know nothing will happen: 8088 will just do NOPs for FPU instructions. So it is not clear to me how it is possible to emulate 8087, unless the program specifically has an option to use emulation.

BTW, in some cases FPU instructions are prepended with WAIT (aka FWAIT), which causes CPU to wait until FPU finishes current operation. But if I remember correctly there is a pull-up resistor on /WAIT line, so if FPU is not installed, the CPU simply will continue.
 
Exactly, Sergey. You can see code to check for an 8087 using NDP instructions (FSTSW returns the status word, for example)--including in my own code. The 80286 will trap co-processor references and vector to interrupt 7 is no co-processor is there to interpret them, which is why the emulation packages require at least an 80286--it has nothing to do with the instruction set.
 
You can see code to check for an 8087 using NDP instructions (FSTSW returns the status word, for example)--including in my own code.
Yep. Here is the code I use in my Xi 8088 BIOS to detect FPU presence (and later on set the equipment flags):

fninit ; initialize coprocessor
mov cx,3
.wait:
loop .wait ; wait for coprocessor to initialize
; (can't use fwait, since it could
; be no coprocessor at all)
mov cx,word [test_word] ; save test_word to CX
mov word [test_word],0000h ; clear space for control word
fnstcw word [test_word] ; store control word
cmp word [test_word],03FFh ; 8087 sets control word to 03FFh
jne .no_fpu ; after finit

.fpu:

Note that this code basically relies on the assumption that FPU commands will do NOP if FPU is not installed (not hang or crash the system :)).
 
Hello,

I remember years ago reading something about 8087 emulation on 8086/8088, but IIRC I think it's more of a fallback used by some compiler to make fpu codes runnable on fpu-less machine than a real emulator.

fpu instructions are preceded by a wait 9Bh then the first byte op fpu opcode in the range D8h-DFh
I you replace 9Bh by CCh, you turn the fpu instruction into a call to an interrupt.
Then you just have to make handlers for fpu instructions.

In some dos interrupt lists, there is a dedicated range:
Code:
INT 34 - FLOATING POINT EMULATION - OPCODE D8h
INT 35 - FLOATING POINT EMULATION - OPCODE D9h
INT 36 - FLOATING POINT EMULATION - OPCODE DAh
INT 37 - FLOATING POINT EMULATION - OPCODE DBh
INT 38 - FLOATING POINT EMULATION - OPCODE DCh
INT 39 - FLOATING POINT EMULATION - OPCODE DDh
INT 3A - FLOATING POINT EMULATION - OPCODE DEh
INT 3B - FLOATING POINT EMULATION - OPCODE DFh
INT 3C - FLOATING POINT EMULATION - SEGMENT OVERRIDE
INT 3D - FLOATING POINT EMULATION - STANDALONE FWAIT
INT 3E - FLOATING POINT EMULATION - Borland "SHORTCUT" CALL
 
That applies to code that follows the rule of FWAIT-before-every-floating op. However, it isn't necessary for hand-coded routines to place the FWAIT immediately before the 8087 opcode, nor is it necessary to use FWAIT before all 8087 opcodes.
 
Martie, did you look at the first paragraph of the documentation? I quote:

This program fully emulates the 8087 math coprocessor on 80286
and 80386 based computers. This is useful to run software that requires
the 8087/80287/80287. This program does not emulate the 80287/80387
extensions to the 8087 instruction set, but all software I have seen
only uses the 8087 instructions to be PC/XT compatable. Please note that
floating point emulation is MUCH slower than the real thing (but also
much cheaper!).

So it won't work on an 8088--which is what everybody's been saying. Sorry about that.
 
Thanks. As OP I feel obliged to say that I asked some folks here but nobody remembers how they ran ACAD on XT without coprocessor. But it was definitely possible, everebody remembers we were using some emulator.

For those interested I found an interesting article about coprocessors here:
http://wiretap.area.com/Gopher/Library/Techdoc/Cpu/coproc.txt

I do hope that "ACAD on XT (without 8087)" mystery will be answered one day :)
 
It was not an uncommon feature on early C compilers, for example, to detect the presence or absence of the NDP (Intel's term) and use it if present, but otherwise use an alternate library. It is not possible to use the 8088 CPU to trap NDP instructions. I could imagine a low-cost alternative PCB that would plug into the NDP socket and generate an interrupt, but on a stock XT, I think the answer is that "you can't do it without some sort of special provision".
 
I had a look through my original AutoCAD Installation and Performance Guide for release 10 and it only mentions the '87 once, in the hardware requirements. It's a very detailed manual, if there was an option to use an emulator I would have thought it would have been mentioned.

Back in the day all our dozen or so 8088 through '386 AutoCAD workstations were equipped with math coprocessors but I do recall trying a software emulator once as a test and I could not get it to work. My understanding at the time (from hearsay) was that release 10 required the hardware while some older versions could use the emulator. Considering the cost of the AutoCAD software ($2000) and the need for speed, another $250 for the coprocessor was not an issue.

If you have time on your hands and are sufficiently interested founding member John Walker has written an extensive history on the development of AutoCAD. It's great read for those of us who used AutoCAD for many years. At work we designed complicated machines with this version from 1988 through 1995, all in 3-D despite it not being very good for that. This image is of an XY table I designed for an automated PCB inspection machine.
 
Last edited:
Back
Top