flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > 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: 5

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

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: 15382
Location: Monstropolis

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 argparam \{
    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: 5

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
Assembly Artist


Joined: 16 Jun 2003
Posts: 6717
Location: Kraków, Poland

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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2017, Tomasz Grysztar.