flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [fasmg] "include!" why?

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4075
Location: vpcmpistri
bitRAKE 29 Jan 2021, 09:31
Seeing "include! 'api/kernel32.inc'" within the default packages has me puzzled as to the reasoning. The manual says the file is included unconditionally, but that doesn't make sense to me either. This topic is rather difficult to search the board for - I was hoping to find more examples.

I searched for:

include!
unconditional include

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 29 Jan 2021, 09:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 29 Jan 2021, 09:40
Just like any other "unconditional" command in fasmg, this variant of INCLUDE is evaluated even if inside a block like IF with false condition or inside a macro definition, etc.

For example, if you define a macro and put INCLUDE somewhere inside its body, it simply becomes part of the text of the macro. However, if you use INCLUDE! instead, it is evaluated during the definition of the macro, and you end up with a macro that has the entire contents of included file inside its body.
Post 29 Jan 2021, 09:40
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4075
Location: vpcmpistri
bitRAKE 29 Jan 2021, 21:01
So the result of using it for the api files is that the file paths are resolved eariler? I don't understand the use in the _end macro. _end becomes a collection of import and api invocations. I thought it might have something to do with the definition of import or api, but I couldn't see any effect in changing them.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 29 Jan 2021, 21:01
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.