I just came across a little problem with the comparison run-time operators of masm. I used InString from the masm lib and tested if the value it returned was greater than zero to see if it has found the substring. InString returns either 0, -1, -2 or the index of the found string. I used this the first time:

invoke  InString, 1, lpLine, ADDR MasmErrorText
.IF     eax>0
 ...
.ENDIF
But that doesn't work because eax>0 is an unsigned compare. Of course I can do it manually with jle but I was wondering if masm does have signed comparison operators? Thomas Thomas
Posted on 2001-03-18 10:17:00 by Thomas
Yep, you just gotta thunk ml on the head that zero means zero and such a thing as negative numbers exist.

.IF SDWORD PTR eax > 0  ; actually will notice when eax < 0
Should eax actually BE a pointer, you wrap it in , of course. --------------------------------- "I'm normally not a praying man, but if you're up there, please save me Superman!"
Posted on 2001-03-18 12:26:00 by Ernie
Thanks! looks much better than

or eax, eax
jle @aa
  ...
@aa:
;) Thomas
Posted on 2001-03-18 12:56:00 by Thomas