just checking, how are these macros used i've looked thru the if.inc but i'm still new to macros so ya.....

I've tried various things but none have worked like

.if eax,=,

;sum stuff here


;sum other stuff


could some1 please tell me where I'm going wrong.....should the conditional operator be in quotes? eg

.if eax,'=',

or wat?

Posted on 2003-01-13 17:26:08 by keyoke
I think it should work like

.if eax,e,

at least this is how it works with .if in NASM, the e standing for equals, or you could try "equ" in place of the e. Hope this helps.
Posted on 2003-01-13 17:32:18 by kairon
.if eax,e,

works but becomes

cmp eax,
jnz sumwhere

if e = equal

shouldnt it be a jz or je? after cmp
Posted on 2003-01-13 17:41:20 by keyoke
I'm not quite sure but my IF.INC from FASM 1.44 beta 2 has the .if macro like this:

macro .if v1,c,v2

__IF equ
local ..endif
__ENDIF equ ..endif
local ..else
__ELSE equ ..else
if v2 eq & c eq
cmp v1,0
je __ELSE
cmp v1,v2
jn#c __ELSE
end if

It's je there, maybe you should try updating your if.inc to a newer version (Like from 1.44 beta 2). Hope this helps. :)
Posted on 2003-01-13 17:51:21 by kairon
i have the same version u got so cant be that!
if i change the condition to '.if eax,ne,' the jump becomes a 'je' strange?
thanks for the help
Posted on 2003-01-13 17:57:44 by keyoke
No, it works as it's supposed to. The "je" jump in that macro is for the case of ".if" with only one argument, it then checks whether it's not zero, so ".if eax" is the same as ".if eax,ne,0". And ".if eax,e,0" uses "jn#c" jump, which becomes "je", because in case of eax<>0 we should skip the code that has to be executed when eax is 0. And so the condition is always reversed (".if eax,a,0" will generate "jna"="jbe" jump, etc.).
Posted on 2003-01-13 18:00:06 by Tomasz Grysztar
oh thnx once again :)
Posted on 2003-01-13 18:04:47 by keyoke