flat assembler
Message board for the users of flat assembler.

flat assembler > Programming Language Design > fasmg preprocessing options

Thread Post new topic Reply to topic
Tomasz Grysztar
Assembly Artist

Joined: 16 Jun 2003
Posts: 6902
Location: Kraków, Poland
With the new experimental updates I have added a couple of directives that assist in handling a wider array of syntaxes with fasmg.

By default, fasmg's preprocessor strips comments (the ones that start with semicolon) from the lines before allowing them to be processed further. Therefore it was impossible to parse with macros any syntax that would use semicolons for a different purpose.

The new RETAINCOMMENTS directive switches preprocessor into mode where it no longer does that. It is then possible to use semicolon as any other special characters, and process them with MATCH to handle any syntax that need to interpret them:

macro ? line&
        local v
        define v line
        while 1
                match first ; rest, v
                        redefine v rest
                else match any, v
                end match
        end while
end macro

db 1 ; dw 2 ; dd 3    

The preprocessor of fasmg also combines the lines when the line break is preceded by a backslash (just like preprocessor of fasm 1 did) and also might sometimes be a obstacle when parsing a specific syntax. So I also added a ISOLATELINES directive that disables it. You can use these two directives combined to switch fasmg's preprocessor into mode that allows to process just raw tokenized text.
Post 06 Jul 2018, 13:39
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-2018, Tomasz Grysztar.

Powered by rwasa.