Just improved the FSTENV and FSAVE non-existing FPU instructions a bit: Now when any FPU instruction that's not one of the FSAVE/FSTENV or status word saving instructions is executed with memory operands, the CPU does the following:
- Save the protected mode or real mode CS, EIP of the instruction and the used data segment and offset of the modr/m (the calculated offset and the data selector value) into the CPU register state for those instruction to read.
- Calculate the linear address of EIP and the modr/m offset and save those into the CPU register state too (for the real mode versions of the store state instructions).
Then when FSTENV ofr FSAVE is executed:
- If protected mode, store the saved CS, EIP, data segment selector and data offset.
- If real mode, store the FIP as the linear address of that last instruction executed and FDP as the linear address of the modr/m data last used (which may not be the last instruction).
FXSAVE also (after writing the state to memory) clears both the instruction/data pointers as well as the real mode versions of it (but leaves the selectors (FCS/FDS) alone, as it isn't documented to be cleared).
That should complete the whole documented behaviour of the non-connected FPU in UniPCemu, as far as (un)documented documentation is concerned (https://www.os2museum.com/wp/learn-something- … detection-work/).