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:
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
invoke InString, 1, lpLine, ADDR MasmErrorText .IF eax>0 ... .ENDIF
Yep, you just gotta thunk ml on the head that zero means zero and such a thing as negative numbers exist.
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!"
.IF SDWORD PTR eax > 0 ; actually will notice when eax < 0
Thanks! looks much better than
or eax, eax jle @aa ... @aa: