Board index » delphi » 8087CW

8087CW


2003-11-03 08:25:20 AM
delphi272
Why do Default8087CW and Get8087CW give different values?
Get8087CW returns a value $40 greater than Default8087CW.
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
begin
Writeln(Format('Default8087CW = %x',[Default8087CW]));
Writeln(Format('Get8087CW = %x',[Get8087CW]));
Set8087CW($133F);
Writeln(Format('Default8087CW = %x',[Default8087CW]));
Writeln(Format('Get8087CW = %x',[Get8087CW]));
Readln;
end.
 
 

Re:8087CW

Quote
Why do Default8087CW and Get8087CW give different values?

Get8087CW returns a value $40 greater than Default8087CW.
It's not understandable, cause setting the 8087CW results first in
setting the Default8087CW.... (System.pas)
(and AFAIK ":=" should be an assignment)
But the comment says: "CAUTION: Setting this to an invalid value could
cause unpredictable behavior."
Is the value you set absolutely correct?
Maybe you should try to set and read back the value with assembler code
yourself and look if the behaviour is the same....
If not ->Something wrong with system.pas/.dcu ->QC
If it is the same behaviour .... hmmmm contact processor manufacturer???
Good luck
 

Re:8087CW

"Cruxy" <cruxyATcruxyDOTnet>writes:
Quote
>Why do Default8087CW and Get8087CW give different values?
>
>Get8087CW returns a value $40 greater than Default8087CW.

It's not understandable, cause setting the 8087CW results first in
setting the Default8087CW.... (System.pas)
Yes, that is true.
But Default8087CW is a variable, whereas Get8087CW is a function that
returns a value, and it doesn't do something obvious like Result :=
Default8087CW; it does some assembler magic.
Why does Set8087CW use {$IFDEF PIC} and Get8087CW doesn't?
What does PIC mean?
Quote
(and AFAIK ":=" should be an assignment)

But the comment says: "CAUTION: Setting this to an invalid value could
cause unpredictable behavior."
Is the value you set absolutely correct?
Yes.
$1332 is the "default" Delphi setting, and $133F is the OpenGL setting
(see the Help for Set8087CW)
Quote

Maybe you should try to set and read back the value with assembler code
yourself and look if the behaviour is the same....
If not ->Something wrong with system.pas/.dcu ->QC
If it is the same behaviour .... hmmmm contact processor manufacturer???

Good luck

 

Re:8087CW

Quote
What does PIC mean?
Portable Independent Code or the like. The Linux loader does not fix
addresses when loading a library, therefore library code must be written to
use addresses relative to BX - that "def" is set by the compiler.
--
Luigi D. Sandon