News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

.if eax < 0 / zeroflag , noob question

Started by kermit, November 28, 2006, 07:18:33 PM

Previous topic - Next topic

kermit

hello,

i recently made a mistake in my code trying to use
.if eax<0
   ...
which wasn't working as expected, because eax was always treated as positive number, even though i explicitly moved -1 to eax  :P
is there a different way than coding:
.if eax<=-1
   ...

?
And i wondered if there is a way to check the flags with the .if/.elseif constructs, somehow like this:

.if zeroflag
...

?

oliver

hutch--

Hi Oliver,

Welcome on board. Try something like this.

.if SDWORD PTR eax < 0
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

P1

Oliver,

Welcome  :U

I nice learning tool is to use Svin tttn for op code jump decisions.

Regards,  P1  :8)



[attachment deleted by admin]

Ehtyar

I think you're looking for ".IF (ZERO?)"?

kermit

thanx for the welcome and the suggestions,
i'll give them a try

@ehtyar yes, that was what i was looking for, i guess there is an ".if (SIGN?) " also

thx,

oliver

Ehtyar

You will find all of these operators in the masm32.hlp file that comes with masm32. The available flags are:
CARRY?
OVERFLOW?
PARITY?
SIGN?
ZERO?

Hope this helps, Ehtyar.