flat assembler
Message board for the users of flat assembler.

Index > Main > if~ defined - =

Author
Thread Post new topic Reply to topic
uri



Joined: 09 Apr 2004
Posts: 43
Location: L'viv, Ukraine
uri 13 May 2004, 12:46
Good day, all.
please,
Code:
if~     defined VERSION
     VERSION = 0x400
end if
org        100h
main:       nop
    


result:
flat assembler version 1.52
error: code cannot be generated.

why?
Post 13 May 2004, 12:46
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 13 May 2004, 12:59
In first pass "VERSION" constant gets defined after it was referenced, so fasm needs to do the next pass, and this time "defined VERSION" is predicted to be true and "VERSION" doesn't get defined and one more pass is needed and so on.

The correct variant should be:
Code:
if ~ defined VERSION | defined VERSION_DEFINED_HERE
 VERSION = 0x400
 VERSION_DEFINED_HERE = 1
end if    


Last edited by Tomasz Grysztar on 25 May 2004, 15:10; edited 1 time in total
Post 13 May 2004, 12:59
View user's profile Send private message Visit poster's website Reply with quote
uri



Joined: 09 Apr 2004
Posts: 43
Location: L'viv, Ukraine
uri 13 May 2004, 13:03
Thanks, it was so quickly.

I was wrote on masm more than 5 years, and 3 weeks ago i was try to use fasm.
Now i rewrite my masm macroses on fasm. Fasm - very good thing, and i'm glad to see that.

Thanks.
Post 13 May 2004, 13:03
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 May 2004, 18:30
i suggest you macro

Code:
macro ifndef expr
{
   local HERE
   if defined HERE | ~ defined expr
     HERE = 1 
}
    

usgae:
Code:
ifndef a
  a = 5
end if

ifndef (a+5)*c
  a=5
  c=3
end if
    
Post 13 May 2004, 18:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
zjlcc



Joined: 23 Jul 2003
Posts: 32
Location: china
zjlcc 25 May 2004, 19:57
Very Happy Very Happy Very Happy Very Happy Very Happy
oh yeah
Very Happy Very Happy Very Happy Very Happy Very Happy

i made "overlay" !!!

more thanks for Privalov,vid and uri

i like FASM
Post 25 May 2004, 19:57
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.