//FPU:浮点运算器,Floating Point Unit的简写,浮点运算单元是专门用于浮点运算的处理器,集成于CPU之内,效率高、执行快
//Set8087CW(开关FPU)
//Set8087CW($1372):开FPU,默认值
//Set8087cw($133f):闭FPU
//Procedure Set8087CW(NewCW: Word);
//Default8087CW: Word = $1332;

procedure TForm1.Button1Click(Sender: TObject);
begin

    Edit1.Text:=FloatToStr(100.123*123.456/788.88);

end;

procedure TForm1.FormCreate(Sender: TObject);
begin

RadioGroup1.Items.Add('Open FPU');
RadioGroup1.Items.Add('Close FPU');
Edit2.Text:=IntToStr(System.Default8087CW);

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin

System.Set8087CW($1372);

end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin

if RadioGroup1.ItemIndex=0 then
   System.Set8087CW($1372);
if RadioGroup1.ItemIndex=1 then
   System.Set8087CW($133f);

end;

Last modification:November 18th, 2014 at 10:55 am
如果觉得我的文章对你有用,请随意赞赏