flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Match - not defined constant [SOLVED]

Author
Thread Post new topic Reply to topic
Kazyaka



Joined: 10 Oct 2011
Posts: 62
Location: Earth
Kazyaka
Is there some way to check if the constant is defined in the preprocessor?

I tried with match but it doesn't work.
Code:
i equ 0
MyConst equ 7

match ,MyConst{i equ i+1}
match define,MyConst{i equ i+2}

display i+'0'
err      


What is wrong?


Last edited by Kazyaka on 02 Jan 2013, 18:17; edited 1 time in total
Post 02 Jan 2013, 17:16
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Code:
def equ

match =MyConst, MyConst ; Won't work with "MyConst equ MyConst"
{
      display "not defined"
      restore def
}

match , def
{
      display "defined"
}    
Post 02 Jan 2013, 17:49
View user's profile Send private message Reply with quote
Kazyaka



Joined: 10 Oct 2011
Posts: 62
Location: Earth
Kazyaka
That's what I meant. It works fine.
Thank you.
Post 02 Jan 2013, 18:17
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.

Powered by rwasa.