flat assembler
Message board for the users of flat assembler.

Index > Main > Disabling parts of the code

Author
Thread Post new topic Reply to topic
booter



Joined: 08 Dec 2006
Posts: 67
booter 12 Jul 2009, 13:30
While experimenting/debugging we sometime need to disable some code, often several lines.
It would be nice if FASM could provide a simple way to do it.
For example
Code:
/*
some disabled code here
*/    
Post 12 Jul 2009, 13:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 12 Jul 2009, 13:35
Code:
match +,-{
some disabled code here
}    
works if you don't have embedded closing curly brackets ('}') characters.
Post 12 Jul 2009, 13:35
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 15 Jul 2009, 23:02
I prefer something like
Code:
variant = 7
if variant = 0
…some well-formed code…
else if variant = 1
…some well-formed code too…
else if…
…
…
else if variant = 6
…some really good well-formed code…
else
  display "You're crazy, don't you know?", 13, 10
  error
end if    
Well-formedness is defined as all braces are matched, whatever they are (just as in XML)


booter,

In your case simple if 0 … end if will do.
Post 15 Jul 2009, 23:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 16 Jul 2009, 00:12
baldr wrote:
... simple if 0 … end if will do.
This only works if there are no preprocessor directives within the if/endif.
Post 16 Jul 2009, 00:12
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.