Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Floating point help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Jul 17, 2012 1:04 pm    Post subject: Floating point help Reply with quote

Hey guys,
I'm having some troubles understanding the floating point system.
What are those 8 registers (st0,st1. . .) i couldn't get it Confused

can any of you point me to a good explanation for floating point system? or even better can explain that?

Thanks a lot :]

_________________
Stylo
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jul 20, 2012 7:11 pm    Post subject: Reply with quote

exactly where does your problem lie with your understanding? in x86, there are 8 floating point registers (st0 to st7). in general with the fpu registers, you need to push them onto the fpu stack with some instruction such as fld. then you perform a floating point operation which operates on the top register/s by default or specific registers if you mandate so in the operation operands. for example, if you pushed 1.5 then 2.5 then st0 is 2.5 and st1 is 1.5. as with all stacks, there is the notion of FILO.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri Jul 20, 2012 11:26 pm    Post subject: Reply with quote

There are few things i can't get, is there another stack for the fpu? or the stack is the group of stX registers?
and when you push 1.5 and 2.5 right after, how does it calculate and knows what comes before the dot and what comes after?

_________________
Stylo
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Jul 21, 2012 3:58 am    Post subject: This post has 1 review(s) Reply with quote

yes the stack is a separate one. the numbers are not actually pushed as 1.5 and 2.5. instead they are approximated by a mantissa (also known as significand) and an exponent. see this well known article:
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

alternatively, back in the day i learnt about the fpu from here:
http://216.92.238.133/Webster/www.artofasm.com/Windows/HTML/MoreDataRepresentation.html#1000036

the conversion to this 'representation' is done by the compiler, specifically the assembler
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Jul 24, 2012 1:35 pm    Post subject: Reply with quote

As always Slugsnack, you always have the answer Smile
Thanks. i'll be reading that and will ask you if it'd be necessary.

_________________
Stylo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites