Hi,

I'd like to do a 64-bit compare. I'm sure there's some trick using adc edx, 0 or something.
So I have
a dq 0 is a 64-bit value
edx:eax is a 64-bit value
and would like to know which is greater (needs to work on .386)
Posted on 2004-08-04 19:48:25 by grv575
It's:
``````
cmp eax,[a]
push edx
sbb edx,[a+4]
pop edx
``````
Posted on 2004-08-04 21:24:18 by Sephiroth3
Another way...

cmp eax,
jne @F
cmp edx,
@@:

...but I like Sephiroth3's way! :alright:
Posted on 2004-08-04 21:48:28 by bitRAKE
oh sorry I forgot to specify: i don't want to test for equality. I need to jump if a >= b (jae i believe). Do both of those do that? Well what worries me is the jne...suppose it overflowed so that edx = 1 whereas = 0. Then a smaller eax (compared to ) would look like a smaller 64-bit # when actually it is larger...right?
Posted on 2004-08-05 00:57:14 by grv575

Another way...

cmp eax,
jne @F
cmp edx,
@@:

...but I like Sephiroth3's way! :alright:

Hi bitRAKE,

Shouldn't it be

cmp edx,
jne @F
cmp eax,
@@:

Check the high order first, otherwise 0FF00000000h would be less than 01h.
Posted on 2004-08-05 01:02:40 by donkey
Yeah that makes sense. The high order decides it unless they are equal. Then it's just a 32-bit compare.
Posted on 2004-08-05 01:12:00 by grv575
donkey, thanks for the correction.
Yes, high order word should be compared first.
Posted on 2004-08-05 10:26:54 by bitRAKE