flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > change the macro if

Author
Thread Post new topic Reply to topic
Asmprogz



Joined: 26 Aug 2010
Posts: 3
Asmprogz
hello,sorry for my BAD English
I want to change the macro .if for allowing me to do something like this:

.if [style] contain WS_VISIBLE

(do something)

.endif

the code that i want to generate :

test [style] ,WS_VISIBLE
jz @F

(do something)
@@:




help me plz

thx.
Post 26 Aug 2010, 14:12
View user's profile Send private message Reply with quote
Asmprogz



Joined: 26 Aug 2010
Posts: 3
Asmprogz
i add this code

match =COND v1 contain v2, COND c
\\\{
test v1,v2
jz label
define COND
\\\}



in the IF macro after

match =COND v, COND c
\\\{
if v eqtype 0
if ~ v
jmp label
end if
else if v eqtype eax
test v,v
jz label
else
cmp v,0
je label
end if
\\\}


but i get errors
Post 26 Aug 2010, 14:41
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
First, to match a token that is not a special character you need to prepend it with "=". So it should be "v1 =contain v2".
Second, put this block BEFORE the "match =COND v, COND c", as it is the final block that catches everything that has not been matched earlier.
Post 26 Aug 2010, 16:03
View user's profile Send private message Visit poster's website Reply with quote
Asmprogz



Joined: 26 Aug 2010
Posts: 3
Asmprogz
Tomasz thank you so much for your help works now without problems.
Post 28 Aug 2010, 17:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.