Extended Precision FPUDemo
Extended Precision FPUDemo
This program serves as a demo to demonstrate how the new code implemented in the
FPUExtendedCalculator can improve the original 15-digit significant precision of the
Windows system to up to 20 digits.
There is a button for each constant implemented in the FPU code and another one to
enter any real number.
Once a constant button is pressed (or a real number is entered), the value is transformed
into an integer with at least 15 significant digits in the integer part and is stored in the FPU
st(0) register as the original code do.
Next, to see the new code in action, the button 1O with the FPU code must be pressed,
and so on. The changes in the FPU 16-bit registers, the FPU 80-bit registers, and in
memory (if applicable) can be observed.
It is essential to follow the correct order. Otherwise, strange results may be obtained.
However, you can reinitialize the process by pressing a new constant button or the real
number button.
The new code to compile the FPUExtendedCalculator is also available in the file
CodeChanges.txt.
(*) In the original code, the real number that had to be shown, had been
previously rounded and then transform in a integer with at least 15 significant
digits (doubled precision), and it is into the st0 FPU register just ready to be
store in memory in 18 digits BCD (Binary Coded Decimal) format. With the new, if
the flag of precision is not set, we avoid the initial rounded code and then obtain
the decimal part and store it in memory just before do the same with the integer
part to get an extra precision of the real number. Then we avoid again other
rounded made in the original code (in normal asm). Indeed the memory space
used for that is used now to insert the new code.
The Delphi project code, and extensive explanation can be found at:
https://github.com/GutiSoftware/Extended-precision-in-Delphi
GutiSoft
March 2023