flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Concatenating symbols

Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
IMHO it is impossible, but maybe I am dumb:
Code:
koko equ
macro catsym sym {
  match any, koko \{ koko equ koko\\#sym \}
  match ,koko \{ koko equ sym \}
}

catsym lolo
catsym .momo
catsym .dodo

koko:    


The above code is expected to define label with name: lolo.momo.dodo:
But it fails with "lolo#.momo#.dodo:"
Removing the backslashes before "#" defines wrong label: "koko.dodo:"

Any ideas?

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 22 Feb 2012, 00:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
The symbol "koko" is not going to be expanded just because you concatenate it. You should use it's expanded value "any".
Post 22 Feb 2012, 00:40
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Yes! And one backslash less:
Code:
match any, koko \{ koko equ any\#sym \}    


Thanks!
Post 22 Feb 2012, 00:52
View user's profile Send private message Visit poster's website ICQ Number 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.

Powered by rwasa.