flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
Joshua
or a much easier version:
Code: comment fix macro comment Code: comment { blah blahblah blahblahblah } |
|||
![]() |
|
Ancient One
how about multiline comment that can really comment ANYTHING? e.g
./* macro incomplete { .*/ |
|||
![]() |
|
vid
chris: "." already has somewhat special meaning in "struc", check manual
joshua - maybe it could be improved to purge macro immeadiately after declaration |
|||
![]() |
|
Joshua
As in:
Code: comment fix macro __COMMENT { end_comment fix } purge __COMMENT Usage: Code: comment blah blahblah blahblahblah end_comment |
|||
![]() |
|
vid
yup, but you can also fix "}" symbol to leave usage as it was
Code: comment { ... } (sorry, i am lazy to write it myself, take it as excercise ![]() |
|||
![]() |
|
UCM
Then you get a problem, since any other macros will be messed up.
|
|||
![]() |
|
vid
only those inside comments - which would be messed up with any other way mentioned here, too. maybe you forgot that you can unfix "}" back to original meaning
|
|||
![]() |
|
revolution
I often use 'IF 0' and 'END IF' to temporarily disable parts of code when testing. Using the macro style of commenting has too many problems for my liking. For permanent comments I always use the semi-colon.
|
|||
![]() |
|
vid
revolution: macro style has problem with commenting macros (more precisely: texts conatining "}"). And you can't comment these with "if" anyway.
|
|||
![]() |
|
UCM
vid: Let's see how it would work then, "unfixing" } back to it's original meaning.
|
|||
![]() |
|
vid
sorry, i got wrong, i tried it and now i think it isn't possible
![]() ![]() unfixing "}" is done this way: "} fix }", but i thought i can use something like "\} \fix \}" inside macro, unfortunately fasm's preprocessor works in other way (well... it is stated in manual... my bad) |
|||
![]() |
|
chris
Quote: or a much easier version: yeah, but I like the highlighting effects of the special characters and the flexibility. Unfortunately, you can not comment out macro definitions in this way either: Code: comment fix macro __COMMENT { end_comment fix } purge __COMMENT ; not work comment macro inner{ display 'inner' } end_comment ; unless you modify the inner macros comment macro inner \{ display 'inner' \} end_comment the same thing happens for another version of using 'fix' - all because of the { or } is messed up with the macros you are trying to comment. I don't know a way to comment out the preprocessor things like macros or strucs definitions using preprocessor macros, even if the 'fix' has some priority over other preprocessor directives, as you can see, it just get messed up. Quote:
well, you have to use semicolon. Basically, the comment macro works only at the assembler level, if does not prevent preprocessor from getting into the commentted parts(it does for the assembler!). IMO, I don't comment out a macro definition because if you don't use it anywhere in your code, it has nothing to do with the output file; however, if you do use it somewhere and you wanna disable it for a while, the comment macro plays the role: Code: macro foo { display 'I am alive!' } ... ; still dead ./* foo .*/ Quote:
you are right, I just overlooked it for the first time. Fortunately, fasm seems to "use some extra circuit" to handle the dot within a struc macro: Code: macro . { display 'dot' } struc bar x { . dd x } foobar bar 1 the dot within a struc definition is always replaced with the name of the struc, no matter if it has already some other definitions. In one word, the comment macro is used for the code that if it were outside this macro, it would be assembled into the output file, and not for the pure preprocessor constructions - consider the following situation: Code: macro prolog_comment_inside size { ./* push ebp mov ebp,esp sub esp,size .*/ } macro prolog size { push ebp mov ebp,esp sub esp,size } start_1: prolog_comment_inside 16 ; or start_2: ./* prolog 16 .*/ the comment macro used somewhat differently in the above examples, but the rule is that both of them are used for code that will be assembled into output file. I hope this clarifies some aspects of the code comment macro. |
|||
![]() |
|
Joshua
hmm, maybe a cleaner version would be:
Code: comment fix rept 0 Code: comment { blah blahblah blahblahblah } On a side note, it doesn't appear possible to fix special chars... is it possible to change that in a future fasm version? |
|||
![]() |
|
okasvi
I dont really get it, I see this as problem for editor used to be solved, fasm already provides ';' for commenting, and IF you really need faster way to comment blocks of code, use editor that supports commenting blocks of code with ';'.
edit: I think winasm studio or w/e it's called does that, or then it was radasm, or maybe them both. |
|||
![]() |
|
rugxulo
The comment directive is supported by most other assemblers. I'm not saying that I really need it personally, but if it can't be done easily with macros, maybe Privalov should implement it natively.
![]() |
|||
![]() |
|
vid
honestly, how often are you commenting a complex macro definition?
|
|||
![]() |
|
Nikolay Petrov
vid wrote: honestly, how often are you commenting a complex macro definition? rugxulo wrote: ...implement it natively... _________________ regards |
|||
![]() |
|
Borsuc
Why can't you guys just use ";" at each line? This way you also look and "inspect" that line to see if it really needs to be commented.
Let's not make Fasm bloated design, having 7 different ways to comment a piece of code (I know I exaggerate here). ![]() |
|||
![]() |
|
dead_body
Quote:
and if i must comment a page? it will eat much of time to comment big numbers of lines. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.