flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Curious about proc macro

Author
Thread Post new topic Reply to topic
quiveror



Joined: 20 Jun 2003
Posts: 34
quiveror
I looked in 'proc' macro and wonder about the symbol 'first@args'. What is this used for ? Why should we need this ? I only found its use in 'endp' macro, just to construct and purge an empty macro like:
macro rstargs#first@args _% %_
rstargs all@args
purge rstargs#first@args
Can it erase these from the source file ?
Cheers,
Post 03 Jul 2004, 22:14
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
quiveror wrote:
I looked in 'proc' macro and wonder about the symbol 'first@args'. What is this used for ? Why should we need this ? I only found its use in 'endp' macro, just to construct and purge an empty macro like:



Code:
   macro rstargs#first@args _% %_
   rstargs all@args
   purge rstargs#first@args
    


The trick is deep here. Smile
If "first@args" is equal to empty string (in case you define procedure with zero arguments) the first row will redefine the macro "rstargs" to empty macro that do nothing - so the next line "rstargs all@args" will do nothing too.
The third row purges the so defined macro.

Regards.
Post 03 Jul 2004, 22:53
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
quiveror



Joined: 20 Jun 2003
Posts: 34
quiveror
what a nice trick! Thank you V. much
Post 04 Jul 2004, 16:46
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-2019, Tomasz Grysztar.

Powered by rwasa.