flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How use if.inc macros?

Author
Thread Post new topic Reply to topic
beatsspam



Joined: 30 Dec 2016
Posts: 2
beatsspam 30 Dec 2016, 11:45
I included if.inc file, but
Code:
.if EAX == 5
    invoke MessageBox,NULL,HelloMessage,"MesHeader",MB_OK
.endif  
    

and
Code:
if EAX == 5
    invoke MessageBox,NULL,HelloMessage,"MesHeader",MB_OK
end if  
    

errors(
Post 30 Dec 2016, 11:45
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 31 Dec 2016, 08:41
.if... .endif is a runtime object. It evaluates EAX at runtime

if ... end if is an assembly time object. It evaluates before runtime.

Not good at macro but I think that should answer it at some point. Just guessing Very Happy
Post 31 Dec 2016, 08:41
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8265
Location: Kraków, Poland
Tomasz Grysztar 31 Dec 2016, 09:46
fasm's logical comparisons use Pascal-like syntax, so it should be ".if EAX = 5" not ".if EAX == 5".
Post 31 Dec 2016, 09:46
View user's profile Send private message Visit poster's website Reply with quote
beatsspam



Joined: 30 Dec 2016
Posts: 2
beatsspam 31 Dec 2016, 13:29
Tomasz, Thanks so really works
system error, Thank you, this information was also useful for me
issue has been resolved. Cool
Post 31 Dec 2016, 13:29
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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.