Article View: comp.os.msdos.programmer
Article #7955Re: Q about Borland C interas: what is FIERQQ,...?
From: Erich Hermann
Date: Thu, 17 Aug 1995 07:44
Date: Thu, 17 Aug 1995 07:44
54 lines
2816 bytes
2816 bytes
Hi Frank,
this is how far I got.
I found interresting material in
Windows SDK 3.1, Prog. Ref., Chapter 13 ("Emulation Methods")
and
MDL, Technical Articles: kernel and Drivers for Windows (16-bit)
"Floating Point in MS Windows"
So what's the mystery about symbols like FIERQQ, FIDRQQ, FIWRQQ, ...?
Programs that use floating point operations, are supposed to make use
of the 80x87-numerical Coprocessor (FPU). You can compile your code
and link it with math-libraries that include use of FPU. But what will
happen if your program is about to run on another computer having no
FPU?
No Problem with Windows 80x87 floating-point emulation: a
Windows-based application contains calls to floating-point
instructions for all floating-point operations, but the application
also includes fixup records for each instruction (OSFIXUPs). When the
kernel loads an application, it checks to see if floating-point
hardware is present. If a coprocessor is not present, the kernel uses
the fixup records to replace the actual floating-point instructions
with Interrupt 3x calls to emaulation code in WIN87EM.DLL (code
patching!).
Where do the values come from? No problem. This is easyly the new
opcode minus old opcode. This value added to the old opcode will give
the new opcode in the supposed location. This calculation is done on
word-base, i.e. 2 bytes a time.
What about FastFP improvement by Windows 3.1?
One small speed improvement that Windows version 3.1 makes over
previous versions is in the handling of FWAIT instructions. Normally,
each 8087 floating-point instruction needs to be preceded by FWAIT
instructions so that the floating-point unit (FPU) and central
processing unit (CPU) can synchronize with each other. Beginning with
the 80286/80287-equipped machine, these preliminary FWAITs are not
needed. Because Windows version 3.1 does not run in real mode and,
therefore, requires an 80286 or higher central processing unit (CPU),
the new kernel replaces these FWAITs with no-operation instructions
(NOPs) when loading the code segments. Table 1 gives an example of
this transformation.
Where is this handled and how can I gain access to that? Or should I
just calculate new values for the magic FIERQQ, ...'s and use them?
Any additional source of information, or any tips or help appreciated,
have a nice day,
Erich
Technical Details
Message-ID:
<40urrf$sa9@el1srv.rt.bosch.de>Path:
arc1-ca.pugleaf.net!el1srv.rt.bosch.de!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!el1srv.rt.bosch.de!usenet From: erherman@si.bosch.de (Erich Hermann) Newsgroups: comp.os.msdos.programmer,comp.programming,de.comp.lang.c Subject: Re: Q about Borland C interas: what is FIERQQ,...? Date: Thu, 17 Aug 1995 07:44:34 GMT Organization: ETAS Message-ID: <40urrf$sa9@el1srv.rt.bosch.de> Reply-To: erherman@si.bosch.de NNTP-Posting-Host: si2712.si.bosch.de X-Newsreader: Forte Free Agent 1.0.82