The 8087 has many instructions - too many, it seems, to be encoded as part of the 8086 instruction set. How did the Intel 8086 interface with an Intel 8087 FPU that a user added?
Consider the following x86 assembly code sample:
// c = a + b;
fld DWORD PTR [rbp-0xc] // a;
fadd DWORD PTR [rbp-0x8] // b;
fstp DWORD PTR [rbp-0x4] // c;
The instructions fld
, fadd
, and ftsp
I assume are not hardwired into the 8086 circuit. So are they pseudo-instructions that the assembler subsequently converts to command/data instructions for the 8086 to pass onto the 8087 appropriately?
For example fld
might be encoded as command 0
and for data the value of rbp-0xc
is encoded which the 8087 would know is an address in memory holding the value it needs? And then a sequence of OUT
instructions are used by the 8086 to send the command and data to the 8087?