flat assembler
Message board for the users of flat assembler.

flat assembler > Macroinstructions > How check if macro is defined ?

Author
Thread Post new topic Reply to topic
foxz



Joined: 09 Aug 2005
Posts: 5
Location: france
How check if macro is defined

macro totor {
...
}

macro chk a {
if defined a
...
endif
}

chk totor ; that doesn't work Sad(

_________________
Syl
Post 11 Aug 2005, 08:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
always define some equate along with macro and check for it... but i quess there is a better solution for what you want do, be more specific please
Post 11 Aug 2005, 14:34
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
foxz



Joined: 09 Aug 2005
Posts: 5
Location: france
vid wrote:
always define some equate along with macro and check for it...

Ok that's I do now...
But it's not nice Sad

vid wrote:
but i quess there is a better solution for what you want do, be more specific please


Well... I try to make a "poo like" via macro only
for the moment I coded

struc toto {
dd ?
}

macro clss.totor.set {
...
}

var f,totor ; the magic macro Wink
set f, 1 ; call clss.totor.set

I coded getter too

macro clss.totor.get {
...
}

var f, totor
var s, totor
set f,s ; call clss.totor.get for f & clss.totor.set for s

I can do

macro var.set.s {
...
}

for define individual setter.

it's like operator in c++
or property on fpc

so... I coded other stupide stuff like


start:
var x1,dw, x2,db

byval x1 ; push val of x1
byref x2 ; push pointer of x2
call foo

proc foo t1, t2
var f,dw , g,db ; make stack -> virtual ebp; enter etc
...
endp ; leave retn etc

after 3 days of working that's run !

_________________
Syl
Post 11 Aug 2005, 17:14
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
ehm, why are you coding assembly then?
Anyway, if you are only trying to learn macrosyntax it's okay.
that's the nicest possible solution, if FASM had all operators for stuff like checking if macro is defined then FASM itself wouldn't be so nice. But you can (maybe, i'm not sure) "overload" keyword "macro" to always define macro + equate you'll check for. And you can make macro to check that equate.. etc. etc.
Post 15 Aug 2005, 09:57
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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-2019, Tomasz Grysztar.

Powered by rwasa.