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 


compare 2 double register and a value possible?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
Brian-1337-
Newbie cheater
Reputation: 0

Joined: 01 Jan 2013
Posts: 13
Location: Ph

PostPosted: Sun May 01, 2016 8:27 pm    Post subject: compare 2 double register and a value possible? Reply with quote

example is this -> cmp rdx,20B30D30000.

the result becomes cmp rdx,30D30000 when I run the code and looked at the opcode. I've tried cmp dword rdx,20B30D30000 but gives me error. the result I wanted is to compare it to 20B30D30000 not 30D30000.

can anyone pls help me? thanks in advance Smile
and sorry if i posted in the wrong section. feel free to move it

_________________
3214N
Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Sun May 01, 2016 9:49 pm    Post subject: Reply with quote

There is no addressing mode of the cmp instruction that uses an imm64 operand. You can, however, move an imm64 into another register and compare the two registers:
Code:
mov rcx,20B30D30000
cmp rdx,rcx


Also, a word is 2 bytes long. A double word (dword) is double that, or 4 bytes long. A quad word (qword), as you can guess, is 8 bytes long. The value 0x20B30D30000 takes up 6 bytes. Trying to store it in a dword would throw away the most significant 2 bytes (020B) resulting in the value you see.

_________________
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
Brian-1337-
Newbie cheater
Reputation: 0

Joined: 01 Jan 2013
Posts: 13
Location: Ph

PostPosted: Sun May 01, 2016 9:56 pm    Post subject: Reply with quote

ParkourPenguin wrote:
There is no addressing mode of the cmp instruction that uses an imm64 operand. You can, however, move an imm64 into another register and compare the two registers:
Code:
mov rcx,20B30D30000
cmp rdx,rcx


Also, a word is 2 bytes long. A double word (dword) is double that, or 4 bytes long. A quad word (qword), as you can guess, is 8 bytes long. The value 0x20B30D30000 takes up 6 bytes. Trying to store it in a dword would throw away the most significant 2 bytes (020B) resulting in the value you see.
I see... thank you so much for simple good answer. Smile Smile
_________________
3214N
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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