flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > conditional assembly

Author
Thread Post new topic Reply to topic
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 28 Feb 2007, 14:47
Let's say we have got following code:
Code:
.....
mov     eax, str1
mov     eax, str2
......
str1 db "string1",0
str2 db "striffng1",0
str3 db "striffng1",0
str4 db "strifng1",0
     db "asdsad",0
str5 db "strifngs",0
    

Is there any way to force fasm to strip (obviously without any `external` help) unreferenced strings, like str3, str4 and str5 in the above example?
Post 28 Feb 2007, 14:47
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 28 Feb 2007, 14:55
Code:
struc db [args]{
common
  if used .
    . db args
  end if}    


The code above doesn't works?
Post 28 Feb 2007, 14:55
View user's profile Send private message Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 28 Feb 2007, 15:04
works perfectly. thanks!
Post 28 Feb 2007, 15:04
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Feb 2007, 15:39
arafael: sounds like you are doing some serious project in FASM? Wink
Post 28 Feb 2007, 15:39
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 28 Feb 2007, 15:45
nah, just fooling around Twisted Evil
Post 28 Feb 2007, 15:45
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Feb 2007, 16:01
personally i don't think this is a good idea. db should work as expected. i suggest to make another macro for this purpose, like:

Code:
struc string [text] {
common
  if used .
    . db text,0
  end if
}
string "I'm not a string"
string "hovno",10,13,"frndzalica"
    


Prevents lot of confusion and stupid bugs
Post 28 Feb 2007, 16:01
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 28 Feb 2007, 16:13
thanks! i'll try this as well.
Post 28 Feb 2007, 16:13
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Feb 2007, 16:21
sorry, example was wrong. usage should look like this:
Code:
_not_a_string string "I'm not a string" 
_hovno string "hovno",10,13,"frndzalica"
    
Post 28 Feb 2007, 16:21
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.