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
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
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...
dword is an unsigned datatype, sdword is signed. There's also sword and sbyte...
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. :)
.IF SDWORD PTR EAX < EBX
.ENDIF
Sorry Scali, we posted at the same time. :)
Hi,
Thank u very much both !
Thierry
Thank u very much both !
Thierry