flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Only assembling a function when it will be used

Author
Thread Post new topic Reply to topic
FlashBurn



Joined: 06 Jan 2005
Posts: 87
FlashBurn
I wanted to write some macros so that I can write library code which will be only assembled into the program when it will be used. I have written these macros:

Code:
libif fix if
libendif fix end if

macro libproc name, [pars]
{
        label name
        if ~ used name
                libif 0
        else
                libif 1
        end if
        proc name, [pars]
}

macro libendp
{
        libendif
}
    


But it seems that there is a problem with the parameter passing to the macro "proc" from inside the macro "libproc". How can I do this?
Post 26 Mar 2005, 11:59
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Standard "proc" macro from FASMW package (stdcall.inc) and "proc" macro from Fresh (StdCallEx.inc), both will assemble the code only if it is used in the source. You simply don't need to create new macroses for this.

Regards.
Post 26 Mar 2005, 12:04
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
FlashBurn



Joined: 06 Jan 2005
Posts: 87
FlashBurn
Thanks, this solved my problem!
Post 27 Mar 2005, 12:38
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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.