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 


Registers follow conventions?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Betaboy
How do I cheat?
Reputation: 0

Joined: 01 Mar 2017
Posts: 2

PostPosted: Thu Mar 02, 2017 3:03 pm    Post subject: Registers follow conventions? Reply with quote

Hey!

Simple question:

Say we have EAX, which "by convention" is used as general purpose/accumulator/result register from what I understand..

How often do games follow this convention? Will I often see an eax after a function call, as it stores the result for example?

Maybe a dumb question but it might make it easier to actually understand what I'm looking at in the disassembler for example Smile

_________________
yeboi
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sat Mar 04, 2017 4:01 am    Post subject: Reply with quote

the conventions depend on the os and programming language/calling convention they use

but in case of eax that seems to be the universally used as result of a function

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Mar 04, 2017 9:48 am    Post subject: Reply with quote

Floating point return values are almost always returned in xmm0 or st(0). Every other data type is almost always returned in eax/rax.

Note that these registers can be used for other stuff as well, so don't assume they will always be a value the caller expects to get back.

_________________
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 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