flat assembler
Message board for the users of flat assembler.

Index > Main > match and " symbol

Author
Thread Post new topic Reply to topic
Dimas



Joined: 02 Sep 2010
Posts: 17
Dimas
How in match directive cut quotes?
=' or =" don't work.
Post 09 Sep 2010, 12:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17343
Location: In your JS exploiting you and your system
revolution
I think the following six symbols cannot be matched
Code:
{ } # ` ' "    
Post 09 Sep 2010, 12:49
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
It is not that they cannot be matched - however some of them have a special meaning for some of the line makers (they are explained in the section "Tokenization of source and line makers" of Understanding fasm article For example ' and " are interpreted by source reader when they occur in the beginning of symbol and they create a single quoted string symbol. Thus any quoted text is a single token and that's why you cannot split it into parts with "match" (as "match" cannot operate on entities smaller than one token).

As for the other characters revolution listed, only the "{" cannot be matched, because it is used to denote the beginning of macro block. The other ones are no problem, however:
Code:
match },} {display '} matched',13,10}
match #,# {display '# matched',13,10}
match `,` {display '` matched',13,10}    
(but if you want to do it inside some macro, you need to remember to escape the # and ` accordingly, otherwise they get interpreted by macro line maker)

Dimas: as for your problem, please specify what exactly do you need to do. If you need to extract some data from inside quoted string, perhaps you could do it at assembly time, not in preprocessor (as with fasm's preprocessor it's currently impossible)?
Post 09 Sep 2010, 12:58
View user's profile Send private message Visit poster's website Reply with quote
Dimas



Joined: 02 Sep 2010
Posts: 17
Dimas
My macro:
macro include_ file {
define filename file
include file
}

In some include files present this line:
filename:
But filename replaced with 'file.inc' instead file.inc and in this case label wrong.
Post 09 Sep 2010, 13:17
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 YouTube, Twitter.

Website powered by rwasa.