flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Specifying the separators for arguments for macro

Author
Thread Post new topic Reply to topic
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 08 Aug 2004, 11:57
Privalov wrote:
Maybe some other idea I had from the beginning of fasm project (but never implemented it) would be useful for such purpose. This is the idea of specifying the separators for arguments for macro, like in the following example (each example macro finally produce the same code)
Code:
; WARNING: EXAMPLES OF UNIMPLEMENTED FEATURE:

macro mv arg1,arg2
 { mv arg1,arg2 }

mv al,1

macro mv arg1 arg2
 { mv arg1,arg2 }

mv al 1

macro mv arg1->arg2
 { mv arg2,arg1 }

mv 1 -> al

macro mv (arg1=arg2)
 { mv arg1,arg2 }

mv (al=1)    
As I said, this is the idea I had when I was designing the macroinstructions system for fasm, but it has never got implemented, maybe in future... (some version 2.0?)

I've found this on the old forum. Shocked
No, I'm not sure is it useful for something or not. Embarassed
I'm just curious..
Is this idea still alive and reserved for some version 2.0 ? Rolling Eyes
Cool
Post 08 Aug 2004, 11:57
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 08 Aug 2004, 12:08
if it could be inplemented without bigger problems / speed loss, it would be nice.
Post 08 Aug 2004, 12:08
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
VitalOne



Joined: 29 Jul 2003
Posts: 54
Location: USA
VitalOne 11 Aug 2004, 03:12
this macroinstruction feature sounds great
Post 11 Aug 2004, 03:12
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 11 Aug 2004, 06:33
I agree! Such a feature would be cool! Cool
Post 11 Aug 2004, 06:33
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 11 Jun 2005, 19:06
And finally I have made such things possible with the new "match" directive. Just the very simple example:
Code:
macro mv arg
 {
   match arg1->arg2 ,arg
   \{
      mov arg2,arg1
   \}
   match (arg1==arg2) ,arg
   \{
      mov arg1,arg2
   \}
 }

mv 1 -> al

mv (al=1)    
Post 11 Jun 2005, 19:06
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 11 Jun 2005, 22:27
privalov: wouldn't it be possible to choose different char than "=" to mark matching following symbol literaly? It looks really weird. Something less used, like ":" or "!" or something unused "~","@" etc. All these fits me better than "=".
Post 11 Jun 2005, 22:27
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 11 Jun 2005, 22:36
I've chosen it because it actually suggests what it means. As for the ones you've proposed - the ":" is also very frequently used, so wouldn't be any better choice, "!" and "@" are not special characters (you can use them in names), the "~" is used for negation in conditional expressions and this meaning doesn't coincide well with the operator meaning literality.
Post 11 Jun 2005, 22:36
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 12 Jun 2005, 10:36
This is even greater than was expected from fasm 2.0 Cool
Thanks a lot!
Post 12 Jun 2005, 10:36
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.