flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Pb matching trailing part of symbol starting with a dot '.'

Author
Thread Post new topic Reply to topic
fabbel



Joined: 30 Oct 2012
Posts: 84
fabbel 05 Jan 2018, 17:14
Hello

Pls help little noobie struggling with fasm (not fasmg) macros...

Am having hard time trying to build macro to parse symbol starting with dot ('.') :
basically i wud like to pass param such as : .somelabel (note the leading dot .),
to some macro and strip out the leading dot internally to keep only the trailing part,
i.e. only 'somelabel'.
Can't find a way around this.

typ., e.g.:

----
macro dummy param {
match =.arg, param \{
arg equ foo
\}
}

dummy .somelabel
----

=> compiles but does not work : symbolic constant doesn't get defined

Desperate to find a way around this...
(i have tried a number of other alternatives .. with no more luck)


Would any of you experts out there pls kindly help me with this... ?
Tx


for ref. same thing using leading colon ':' i/o dot '.' works perfectly :
----
macro dummy param {
match =:arg, param \{
arg equ foo
\}
}

dummy :somelabel
----
=> this correctly define symbolic constant 'somelabel' with value = foo

Tx
Regards
Post 05 Jan 2018, 17:14
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20338
Location: In your JS exploiting you and your system
revolution 05 Jan 2018, 22:58
The problem you have is that the dots are not special. They are simply part of the name. So just pretend that they are a normal letter in a label.
Code:
macro dummy param {
  match arg, param \{
    arg equ foo
  \}
}     
Post 05 Jan 2018, 22:58
View user's profile Send private message Visit poster's website Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 84
fabbel 06 Jan 2018, 15:43
Tx but that doesnt answer my question : i am looking to get only the part following the dot. Is there no way around this?
Post 06 Jan 2018, 15:43
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 06 Jan 2018, 16:43
Because "." is not treated as a special character by fasm 1 and the preprocessor does not have an ability to split or alter the name tokens, it is not possible. It is one of the limitations that led to the design of the successor engine (fasmg).
Post 06 Jan 2018, 16:43
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.