extern __fpmath:far mov bx, Function ; floating-point function call __fpmath ; floating-point math |
The __fpmath function is the control function for Windows 80x87 floating-point emulation.
Function
Specifies the floating-point function to execute. The Function parameter can be one of the following values:
Value | Meaning |
0 | Initializes the floating-point emulator. An application calls this function when it starts. If an error occurs, the function sets the carry flag. Otherwise, it clears the flag. |
1 | Resets the floating-point emulator. The action carried out by this function is similar to the action carried out by the finit instruction. |
2 | Stops the floating-point emulator. An application called this function just before it ended. |
3 | Sets the handler for the coprocessor error exception (Interrupt 16). The DS:AX registers must contain the 32-bit address of the exception handler. The emulator calls the handler whenever an unmasked floating-point exception occurs. The exception handler can carry out any action—it does not have to return. |
10 | Retrieves a count of the elements on the floating-point stack, copying the count to the AX register. The number of elements is equal to the number of floating-point values on the floating-point coprocessor (if one is present) plus any additional values stored by the emulator. |
11 | Indicates whether a floating-point coprocessor is present. This function returns 1 in the AX register if a coprocessor is present. Otherwise, it returns 0. |
Function values 4 through 9 are not used.
The following example initializes the floating-point emulator:
xor bx, bx ; bx = 0 to initialize floating point
call __fpmath