Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 4,393 of 4,675    |
|    R.Wieser to All    |
|    Re: FPU (x87) code debugging.    |
|    07 Aug 21 12:11:43    |
   
   From: address@nospicedham.not.available   
      
   Wolfgang,   
      
   > but how did you check 1)   
      
   I read the Status Word, using FNSTSW. From there I isolated the ST bits.   
      
   Thanks for mentioning FXAM. Something I already thought of being handy to   
   have, but didn't now the name of. :-)   
      
   > FCLEX or FXSAVE followed by FINIT work fine for me to clean up.   
   > and FFREE/r is my way to empty a specific register.   
      
   I already found (and used, just before the code I posted) FNINIT. But that   
   just drops all "left over" variables and error flags. Not something I want   
   to finish a calculation with ...   
      
   As for FFREE ? I'm not sure I understand its worth - other than to perhaps   
   delete the bottom-of-stack variable (and even than), as in all other cases   
   it would create a "hole" on the stack, which I than still would have to   
   recon with. :-|   
      
   > I actually hate this stupid stack-up/dn design, an overall ST(n)   
   > would work just fine with much lesser doubtful quirks.   
      
   :-) Agreed. But as I have to work with what the 'puter offers me I have   
   no other choice than to deal with it.   
      
   [in regard to FSAVE]   
      
   >> It does have a drawback though: it re-initializes the FPU stack, meaning   
   >> it cannot be used while in the middle of a calculation. Any idea to some   
   >> non-destructive probing ?   
   >   
   > FXSAVE   
      
   Thanks again.   
      
      
   Blimy! I just realized (did some "thats quaint, what happens if I do   
   {this}" probing) that the "ST(x)" argument is relative to the "Stack top"   
   (status word, ST bits). In hindsight that makes sense, but wasn't expected.   
   It does make the "Stack Top" value useless for a quick "is it empty" test   
   though.   
      
   Regards,   
   Rudy Wieser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca