From: "John Herbster" Subject: Re: Set8087CW and floating point Date: 19 Nov 1999 00:00:00 GMT Message-ID: <813ni3$piv18@forums.borland.com> References: <811ij4$9d17@forums.borland.com> <812clp$gr92@forums.borland.com> <8136op$lq19@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.winapi Here is a little routine that I use for getting last and changing the control word: function SetX87CW (NewCW: Word): word; { returns old and sets new FPU control word. } asm {Part of this copied from D5 System.pas.} FNCLEX // Don't raise pending exceptions enabled by the new flags. MOV Default8087CW,AX // Copy new value to location in System unit. FStCW [Result] // Copy old value for returning to caller. FLDCW Default8087CW // Change the X87 control word here. end; You can use it like this: Var Sav87CW: word; ... Sav87CW := SetX87CW (); ... your special work ... SetX87CW (Sav87CW);