Posted: Sun May 01, 2016 8:27 pm Post subject: compare 2 double register and a value possible?
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
and sorry if i posted in the wrong section. feel free to move it _________________
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.
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. _________________
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