flat assembler
Message board for the users of flat assembler.
Index
> Main > Add block-comments into Fasm? Goto page 1, 2, 3 Next |
Add block-comments into Fasm? | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
Total Votes : 66 |
Author |
|
MCD 07 Dec 2004, 17:27
Write me also what this block comment should look like.
something like Code: comment ... end comment or rather C-style Code: /* ... */ PASCAL-style would cause problems with macros. What about his one Code: ;_ ... _; |
|||
07 Dec 2004, 17:27 |
|
Matrix 07 Dec 2004, 17:40
good idea, i was missing comment blocks a bit too
an alternative for {} from pascal is from c : comment {i 'm a comment block} |
|||
07 Dec 2004, 17:40 |
|
f0dder 07 Dec 2004, 18:14
Block comments would be nice... and would there be any reason to *not* use the C style block comments, apart from "blah blah it's highlevel"?
|
|||
07 Dec 2004, 18:14 |
|
Frank 07 Dec 2004, 18:33
A simple pseudo-macro can do the trick. Why bloat the assembler unnecessarily?
Code: macro comment { proc MyPreviousVersionOfTheProc enter return endp } |
|||
07 Dec 2004, 18:33 |
|
Madis731 07 Dec 2004, 19:40
Aren't the block comments dangerous, error-prone?
It's just what my teachers say - I don't believe it. |
|||
07 Dec 2004, 19:40 |
|
MCD 07 Dec 2004, 20:00
I have heard this, too. But I had never had any problems with block comments in PASCAL/Delphi/C/C++ yet. Especially when you don't use nested comment blocks.
Like Code: { some kind of your code {something else } } |
|||
07 Dec 2004, 20:00 |
|
Matrix 07 Dec 2004, 20:12
well if i think over { means begin, } means end, but what if you enter this without any macros?
{ comment? } this special case could be considered as comment too, as for the macros, well, its not that good in macros, you'd be forced to use for example comment{ i 'm a comment block } or /* i'm a comment block */ there is no problem using begin comment in comment, but if you begin { then it should be counted like {nested commenting level 1{nested commenting level 2{nested commenting level 3}eof nested commenting level 3}eof nested commenting level 2}eof nested commenting level 1 Code: <begin {=1>nested commenting level 1<begin {=2>nested commenting level 2<begin {=3>nested commenting level 3<end }=3>eof nested commenting level 3<end }=2>eof nested commenting level 2<end }=1>eof nested commenting level 1 it could be implemented, though i see no advantage of using nested comments it whould brobably be an unused advanced feature |
|||
07 Dec 2004, 20:12 |
|
MCD 07 Dec 2004, 20:21
I fully agree with you, Matrix in terms of nested comments.
Another thing, Mamatrix. I discovered a bug in the FasmW IDE editor. Look for "IDE Development > Bug in FasmW's paste" to get the details. |
|||
07 Dec 2004, 20:21 |
|
rea 07 Dec 2004, 20:24
I am in the side that comments are not part of the source of a programm, then instead of use comments, delete the suport for them . (OK, that is only my case... I guess)
|
|||
07 Dec 2004, 20:24 |
|
MCD 07 Dec 2004, 20:33
So, you would move every part of your code to another, say temporary, file just because you wanna try/test something new? Man, this would be to complicated for me!!!
|
|||
07 Dec 2004, 20:33 |
|
mike.dld 07 Dec 2004, 21:29
Maybe
Code: ; few ; commented ; lines Or maybe Code: ;{ some comments here ;} |
|||
07 Dec 2004, 21:29 |
|
Matrix 07 Dec 2004, 21:45
i'm having an idea,
fasm could be more than any other again with not just a simple Code: mov ax,3 /* comment block mov ax,2 */ but in addition it could do : comment rectangle block : where first byte of /*/ defines top left beginning of comment block and first byte of */* defines lower rght corner of comment block /*/------- label: mov ax,3 mov ax,2 mov al,4 mov al,5 stosb mov [es:di],al ---------- */* ret in this case, the first column whould be comment, and the one near whould be actual code so this whould be the comment ------- mov ax,3 mov al,4 stosb ---------- and this whould compile: label: mov ax,2 mov al,5 mov [es:di],al ret what do you think of this? |
|||
07 Dec 2004, 21:45 |
|
JohnFound 07 Dec 2004, 22:55
block comments having "stream" structure (not "line" structure) interfere with the one of the main principles of assembly languages - "line-based" structure of the source.
Of course it is not so much work to make such comments for FASM (for example FASM's macroses and some preprocessor directives have "stream" structure as well) , but there will be some problems with readability of the code. Also, as far as, the assembly language editors (I am talking about FASMW and Fresh) are line based. So, it will be hard to provide syntax highlighing for block comments without big rebuild of AsmEdit control. Without syntax highlighting, big block comments (more than one screen) can impact the readability of the source, because there is no way to determine that this is a commented block other than syntax highlighting. On the other hand, Fresh have functions for block comment/uncoment of group of lines. IMHO, such function can be very decent replacement for block comments, without changing of FASM syntax and without negative effects. Regards. |
|||
07 Dec 2004, 22:55 |
|
Matrix 08 Dec 2004, 00:25
i saw fasmw using vertical selection, and comments could be highlighted in the same way, so readability could stay, and this could reduce the time needed to replace a little code snipplet and comment it out at the same time.
why are you sticked to that line based thing? we live in a 3d world and we see stripes on the monitor below each other displaying close to each other. |
|||
08 Dec 2004, 00:25 |
|
rea 08 Dec 2004, 01:10
MCD wrote: So, you would move every part of your code to another, say temporary, file just because you wanna try/test something new? Man, this would be to complicated for me!!! I am in the side that such things are not part of the assembler , even the language, such comments, for programers, for understand the code should be handled by the editor, also a editor that can switch easely to add a comment, for example, I hve watched sources in C that use some like /* FIXME */ /* TODO: */ and a lot of other things, even comments like: // This function is called when...., now let see the called automatic documentaion, aca Doxygem and others ones, they exige you tah you learn a new sintaxis, even that you can have a editor for do the work, and the more impactant at less for me is that they need to be inserted in your code!!!! I will not explain all that I have in mind, but sure if some time you see a compiler, assembler or some like that developed by me, it will not allow comments in the source code of X language . Butlike I say, that is only my case . Now following your pool, I consider that is more easy selection and do a automatic block of comments . Extra... by the way, I will have a new signature "A language should be understable, not commentable and a derivation of the language should continue being understable" _________________ A language should be understable, not commentable and a derivation of the language should continue being understable |
|||
08 Dec 2004, 01:10 |
|
JohnFound 08 Dec 2004, 03:01
FASMW and Fresh are open source.
|
|||
08 Dec 2004, 03:01 |
|
Madis731 08 Dec 2004, 09:46
JohnFound wrote: FASMW and Fresh are open source. It has nothing to do with the topic we are discussing. Of course anyone can make their macros compile BASIC or C code with FASM, but are the block comments needed in the main distro? THAT is the REAL question. My opinion is that an option to comment more than one line with an ";" is better that block comments. The main reasons are: 1)readability - think of comments over pages long. Highlighter would have to search forward and backward in the document. 2)the syntax didn't seem to be agreed on amongst some posters here. The offered variants were all odd - didn't seem right. 3)and it IS error-prone - I was thinking of removing blockcomments. When you remove one end, you must immediately remove the other end too, because otherwise you'd have the rest of the source commented. |
|||
08 Dec 2004, 09:46 |
|
vbVeryBeginner 08 Dec 2004, 14:56
i have been thinking on this comment feature sometime ago.
i guess it is quite hard to decide a new comment syntax or ...whatsover coz asm has been traditionally in single line comment mode. well, i do love multiline comment feature. my suggestion is, since fasm in so much influence using the dot i guess it should be nice to use dot to represent comment. and possibly change the trandition of using the ";" and create own fasm style, and reshape the asm history :p Code: .. single line comment .. dot dot start, whatsover here is comment until it met another 'dot dot' which must at the end of line .. .. comment line 1 line 2 line 3 .. line 4 line 5 line 6 .. in the above example, line 1 till line 6 would be commented i guess i like this :p, remove line 6 dot dot and only line 1 till line 3 are commented when encounter first dot dot, comment mark start until it reach another dot dot which must at the end of line before [line / carriage return], and comment marks end. .. automatically mark single line comment, but if dot dot before [ret] found, line starting from .. to current would be commented. Code: we didn't start our comment using the dot dot whatsover comment and we use dot dot at the end .. <----------------------- line 56 the above line should generate error at line 56 sincerely, sulaiman chang :p |
|||
08 Dec 2004, 14:56 |
|
f0dder 08 Dec 2004, 15:01
Madis,
#1 - comments that long should be moved to external documentation #2 - C-style block comments are fine #3 - is that really a problem? And removing the begin-comment was never a problem with C-style comments, at least if you use the /* /**/ trick... I think supporting block comments is a good idea, I've always missed them in assemblers that don't support them. It should be trivial to code, and in no way "Bloat" FASM - there's a difference between adding a nice feature and adding bloat. How much would the support be, a couple hundred bytes of code at most if sloppily coded? And would it affect speed? Doubtfully. As for people saying code shouldn't be commented, that's your choice - no reason to remove commenting support just because *you* don't like it . Rectangle comment blocks are an interesting idea, and I've had the thought myself... but I'm afraid it would be way too confusing to be actually useful. Perhaps if it was tightly coupled with a syntax-coloring IDE, but I don't think it's a good idea tying a language so closely to it's IDE that you can't use it without. |
|||
08 Dec 2004, 15:01 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.