Hi,

Does '.if' can make ok makes signed comparaisons ?

Example :

mov eax,-2
mov ebx,0
.if eax < ebx
;ok
.endif

Doesn't work, but :

mov eax,-2
mov ebx,0
cmp eax,ebx
.if SIGN?
;ok
.endif

Works.

Thierry
Posted on 2004-06-14 12:51:56 by golemxiii
you need "sdword ptr" to tell MASM that you are doing a signed comparision.
dword is an unsigned datatype, sdword is signed. There's also sword and sbyte...
Posted on 2004-06-14 12:59:43 by Scali
In MASM you must cast a DWORD to a signed DWORD in order to use the alternate set of comparative instructions:

.IF SDWORD PTR EAX < EBX

.ENDIF

Sorry Scali, we posted at the same time. :)
Posted on 2004-06-14 13:00:18 by donkey
Hi,

Thank u very much both !

Thierry
Posted on 2004-06-14 13:05:21 by golemxiii