Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: help spot t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 9 Topic 4580 of 4728
Post > Topic >>

Re: help spot the error in this floating point code

by "Wolfgang Kern" <spamtrap@[EMAIL PROTECTED] > Apr 17, 2008 at 01:28 PM

"Bin Xin" wrote:
[...]
> So I try to follow the stack state after each call to my_pow,  it
> looks ok for a few calls (9), then I see a weird thing: when "fld1" is
> executed at some point, it loads a "nan" instead of "1" into st0:
>
> (gdb) ni
> 0x08048397      270
> 8: $st7 = 15
> 7: $st6 = 14
> 6: $st5 = 13
> 5: $st4 = 12
> 4: $st3 = 2
> 3: $st2 = 0
> 2: $st1 = 2
> 1: $st0 = 0
> (gdb) ni
> 0x08048399      270
> 8: $st7 = 14
> 7: $st6 = 13
> 6: $st5 = 12
> 5: $st4 = 2
> 4: $st3 = 0
> 3: $st2 = 2
> 2: $st1 = 0
> 1: $st0 = -nan(0xc000000000000000)
>
> So what am I missing here?

A classical stack-overrun ?
I'd try to insert a FFREE %st(7) before the FLD1
__
wolfgang
 




 9 Posts in Topic:
help spot the error in this floating point code
Bin Xin <spamtrap@[EM  2008-03-18 15:26:40 
Re: help spot the error in this floating point code
Tim Roberts <spamtrap  2008-03-19 05:13:52 
Re: help spot the error in this floating point code
Terje Mathisen <spamt  2008-03-19 14:02:16 
Re: help spot the error in this floating point code
nbaker2328 <spamtrap@[  2008-03-18 23:08:55 
Re: help spot the error in this floating point code
Bin Xin <spamtrap@[EM  2008-04-16 15:23:00 
Re: help spot the error in this floating point code
"Wolfgang Kern"  2008-04-17 13:28:18 
Re: help spot the error in this floating point code
Jentje Goslinga <spam  2008-04-17 18:25:15 
Re: help spot the error in this floating point code
Bin Xin <spamtrap@[EM  2008-04-18 13:47:00 
Re: help spot the error in this floating point code
Jentje Goslinga <spam  2008-04-18 19:08:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:43:14 CDT 2008.