flat assembler
Message board for the users of flat assembler.
Index
> Main > comment feature? |
Author |
|
crc 12 Sep 2004, 08:00
You could always do something like this:
Code:
if 0
This is a comment with multiple lines
It will not be assembled by FASM
end if
|
|||
12 Sep 2004, 08:00 |
|
mike.dld 12 Sep 2004, 09:44
Code: comment fix macro _comment { endc fix } comment Comments here endc |
|||
12 Sep 2004, 09:44 |
|
iklin 12 Sep 2004, 10:37
Thanx!
I'm so stupid time to time... _________________ O, tempora! O, mores! |
|||
12 Sep 2004, 10:37 |
|
Madis731 12 Sep 2004, 11:22
Multi-line comments are sometimes errorprone when no nesting is
implemented(C-style): Code: Useful code /* Some code not needed right now */ Useful code ok, nice but what if you wanted to comment out these *useful* lines Code: /* Useful code /* Some code not needed right now */ <==ok, what happens here is that comments end Useful code */ <==this has no use here |
|||
12 Sep 2004, 11:22 |
|
crc 12 Sep 2004, 12:43
Quote: but what if you wanted to comment out these *useful* lines My solution would work |
|||
12 Sep 2004, 12:43 |
|
silkodyssey 12 Sep 2004, 12:48
crc,
How does your solution work? _________________ silkodyssey |
|||
12 Sep 2004, 12:48 |
|
crc 12 Sep 2004, 12:53
Here's an example:
Code: if 0 Forth code: drop swap . end if add si, 2 xchg ax, [si] call print The if's can be nested, so it doesn't require any macros, and is fairly clean (I prefer to prefix comments by a ; though) |
|||
12 Sep 2004, 12:53 |
|
silkodyssey 12 Sep 2004, 13:59
crc.
I haven't tried the code but I am curious about the logic behind it. When you write "if 0" what are you testing? _________________ silkodyssey |
|||
12 Sep 2004, 13:59 |
|
crc 12 Sep 2004, 16:44
You're testing if "0" is defined (at least in NASM). As far as I can tell, this is never met, so it works well for block comments. (At least this has worked under NASM and FASM during the six years I've been writing assembly programs.)
|
|||
12 Sep 2004, 16:44 |
|
Imagist 12 Sep 2004, 18:59
I remember seeing somewhere that you can do this:
Code: comment ! .... anything except exclamation point ! The ! could be replaced by any symbol. I don't remember this too clearly though, so it might be from MASM, or it might be "bloc_comment" or something. |
|||
12 Sep 2004, 18:59 |
|
mike.dld 12 Sep 2004, 19:15
Code: comment fix if 0=1 ; something familiar, yea endc fix end if comment useful code 1 comment mike.dld endc useful code 2 endc |
|||
12 Sep 2004, 19:15 |
|
decard 12 Sep 2004, 19:49
actually solution with defining unused macro should be better, as it throws away unnecessary text on preprocessing stage.
|
|||
12 Sep 2004, 19:49 |
|
uri 12 Oct 2005, 11:42
like this:
Code: macro comment [dummy] { if defined blablabla 'error: you must do not use blablabla' } macro endc [dummy] { end if } if user defines elsewhere 'blablabla' it will have error, but not an unexpected compilation of commented block. |
|||
12 Oct 2005, 11:42 |
|
tom tobias 12 Oct 2005, 12:31
Imagist wrote: ...The ! could be replaced by any symbol. I don't remember this too clearly though, so it might be from MASM, or it might be "bloc_comment" or something. You are right. It is from TASM, and the symbol is the caret: ^ comment ^ whatever.... endcomment ^ everything between the two carets is ignored. |
|||
12 Oct 2005, 12:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.