flat assembler
Message board for the users of flat assembler.

flat assembler > Heap > A problem about back-slash escaping

Author
Thread Post new topic Reply to topic
imgcre



Joined: 06 Sep 2018
Posts: 2
I want to output back-slash after pre-processing in order to combine lines.
The code is like that:
Code:
macro imports name,[label]
{
        common
        import name \\
        forward
        if ~ label eq
                ,label, `label
        end if
}
    

If I use this instruction with parameters like:
Code:
imports kernel32, ExitProcess
    

I expect that the output is:
Code:
import kernel32\
   ,ExitProcess,'ExitProcess'
    

But it doesn't work, it seems that before the pre-process is start, fasm get a fault because it can't recognize '\\'.
Just use one back-slash also can't slove this problem.The back-slash is been a part of the code of macro.
Any way to slove it?
Post 06 Sep 2018, 16:29
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6966
Location: Kraków, Poland
As it is explained in the Understanding fasm article (see the section titled "Tokenization of source and line makers"), there are two different "line makers" that prepare source lines that get preprocessed. One reads the lines from the source text, the other produces them from a macro. Only the first one recognizes and processes the line-continuation backslash. So when you produce a line from a macro, it cannot use this feature, because it is made by a different "line maker" (one that, on the other hand, processes operations like #).
Post 06 Sep 2018, 16:39
View user's profile Send private message Visit poster's website Reply with quote
imgcre



Joined: 06 Sep 2018
Posts: 2
Tomasz Grysztar wrote:
As it is explained in the Understanding fasm article (see the section titled "Tokenization of source and line makers"), there are two different "line makers" that prepare source lines that get preprocessed. One reads the lines from the source text, the other produces them from a macro. Only the first one recognizes and processes the line-continuation backslash. So when you produce a line from a macro, it cannot use this feature, because it is made by a different "line maker" (one that, on the other hand, processes operations like #).

Thanks a lot.Forgive me for not reading the document carefully.
Post 06 Sep 2018, 23:48
View user's profile Send private message Send e-mail 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.