flat assembler
Message board for the users of flat assembler.

Index > Main > Problem with '.' in struc

Author
Thread Post new topic Reply to topic
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 05 Dec 2005, 20:44
I wanted to create a struc which after defining all data in it would also create a constant which consists of dot. I found it impossible. Code:
Code:
struc name data {
 . dd data
 .#\.size = $-. }

test1   name 100    
I got "Error: Illegal instruction" test1 .size=$-test1
So it seems that fasm puts space (20h) before the dot in constant name and it cannot define such constant then. Any other option like .#.size = $-. or .#=.size = $-. didn't work. I couldn't also get it done using match anyhow. Is there any solution for this?
Post 05 Dec 2005, 20:44
View user's profile Send private message Visit poster's website Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 05 Dec 2005, 20:48
Ooops. Sorry. Nearly equal example is shown in documentation. I checked it now. Should be:
Code:
struc name data {
 . dd data
 .size = $-. }

test1   name 100    
Shame on me Neutral for not looking into documentation before posting ne thread.
Post 05 Dec 2005, 20:48
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 05 Dec 2005, 22:02
i think you don't need to escape "." when used inside name, it is regular part of name just like any other character, only some of whole names have special meaning. So i believe this should work too (and is closer to what you wanted with your original macro, because it leaves with another global label than in your 2nd post)
Code:
struc name data { 
 . dd data 
 .#.size = $-. } 

test1   name 100    


correct me if i am wrong
Post 05 Dec 2005, 22:02
View user's profile Send private message Visit poster's website AIM Address MSN Messenger 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.