flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > What about optional arguments for macros ??

Author
Thread Post new topic Reply to topic
Gambino



Joined: 20 Jul 2003
Posts: 44
Location: Romania
Gambino 26 Jan 2004, 05:49
Idea What about optional arguments for macros ?? Idea

What do you think about that ?

It's good for extending the macros to the MAX

You say it can't be done ?

I'l let you to decide....Think about it Exclamation
Post 26 Jan 2004, 05:49
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 26 Jan 2004, 06:46
you can use

Code:
if arg eq
...
end if    


to determine if some argument passed to macros or not
and optional arguments must be at the end of arguments list
Post 26 Jan 2004, 06:46
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 26 Jan 2004, 08:52
Here's an example:
Code:
macro optional_args name,value {
  name:
  if value eq
    db ?
  else
    db value
  end if
}

optional_args test1     ; => test1: db ?
optional_args test2,15  ; => test2: db 15
optional_args test3     ; => test3: db ?    
Wink
Post 26 Jan 2004, 08:52
View user's profile Send private message Visit poster's website 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.