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 


Checking for a NAN value

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
nero1232
Advanced Cheater
Reputation: 0

Joined: 08 Mar 2017
Posts: 56

PostPosted: Fri Mar 17, 2017 5:45 pm    Post subject: Checking for a NAN value Reply with quote

Hi,

Is it possible to check if an address contains a NAN float value? I am doing some assembly coding and occasionally my float address will contain NAN, so in this case I want to rewrite it.

Thanks
Back to top
View user's profile Send private message
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 44

Joined: 06 Jul 2014
Posts: 1649
Location: Arcadian Suburbia

PostPosted: Fri Mar 17, 2017 6:24 pm    Post subject: Reply with quote

There are a few ways. ucomiss is probably the easiest:
Code:
movss xmm0,[addr]
ucomiss xmm0,xmm0
jnp @f
  // NaN, do something
  jmp exit
@@:
  // not NaN, do something else
exit:

You could also look at how the float is encoded. See IEEE standard 754 (namely binary32 and binary64) for a brief overview.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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 Gamehacking 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