flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > suggestion /*Comments*/ (final rev.8 - over for me) Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next |
Author |
|
ouadji 05 Mar 2010, 08:04
I just saw this, I use UEStudio clic here and with it, no problem with block and multiline comment. it has a configuration file (fasm.uew) where you can specify the symbols start/end of block comment. Quote:
with my fasm code (/**/), it's really a nice work environment for comments |
|||
05 Mar 2010, 08:04 |
|
edemko 05 Mar 2010, 08:28
Quote:
do you have a crack |
|||
05 Mar 2010, 08:28 |
|
booter 07 Mar 2010, 08:59
There is another problem with current processing of comments.
It's impossible to comment multi-line constants. Code: longexample db \ ; doesn't work here "aaaa aaaaaaa aaaaaaaa",10,13,\ ; doesn't work here "aaaa aaaaaaa aaaaaaaa",10,13,\ ; doesn't work here "aaaa aaaaaaa aaaaaaaa",10,13 ; here it does |
|||
07 Mar 2010, 08:59 |
|
ouadji 07 Mar 2010, 09:58
This, below, compiles without problem. where is the problem ? Give me a specific example that does not compile. thank you. Code: this, below, compiles without problem, longexample db \ /* comment */ ;fasm /* comment */ /* comment */ "aaaa aaaaaaa aaaaaaaa",/* comment */ 10,13,\ /* comment */ ;fasm /* comment */ /* comment */ "aaaa aaaaaaa aaaaaaaa",/* comment */ 10,13,\ /* comment */ ;fasm /* comment */ "aaaa aaaaaaa aaaaaaaa",/* comment */ 10,13 /* comment */ ;fasm and more simply this too, longexamplex db \ ; does compile "aaaa aaaaaaa aaaaaaaa",10,13,\ ; does compile "aaaa aaaaaaa aaaaaaaa",10,13,\ ; does compile "aaaa aaaaaaa aaaaaaaa",10,13 ; does compile sorry, I don't understand your comment about that ! |
|||
07 Mar 2010, 09:58 |
|
baldr 07 Mar 2010, 12:16
ouadji,
Probably booter is talking about regular ; comments that indeed break line continuation. __________ booter, How do you expect FASM to interpret that lines if you've commented out db directive? Second and third lines can be easily commented out with \;. |
|||
07 Mar 2010, 12:16 |
|
ouadji 07 Mar 2010, 12:36
i don't understand (my english ... "about regular" ? ... ) like this ? Code: longexamplex db \ "aaaa aaaaaaa aaaaaaaa",10,13,\ ; fasm comment "aaaa aaaaaaa aaaaaaaa",10,13,\ "aaaa aaaaaaa aaaaaaaa",10,13 |
|||
07 Mar 2010, 12:36 |
|
ouadji 07 Mar 2010, 14:56
with regular fasm 1.69.12, this does compile without problem. Code: longexample db \ ; fasm comment "aaaa aaaaaaa aaaaaaaa",10,13,\ ; fasm comment "aaaa aaaaaaa aaaaaaaa",10,13,\ ; fasm comment "aaaa aaaaaaa aaaaaaaa",10,13 ; fasm comment |
|||
07 Mar 2010, 14:56 |
|
baldr 07 Mar 2010, 16:57
ouadji,
Something like that: Code: longexample db \ ; doesn't work here ; "aaaa aaaaaaa aaaaaaaa",10,13,\ ; doesn't work here "aaaa aaaaaaa aaaaaaaa",10,13,\ ; doesn't work here "aaaa aaaaaaa aaaaaaaa",10,13 ; here it does ; This is my method which works: longexample db \ \; "aaaa aaaaaaa aaaaaaaa",10,13,\ \; "aaaa aaaaaaa aaaaaaaa",10,13,\ "aaaa aaaaaaa aaaaaaaa",10,13 |
|||
07 Mar 2010, 16:57 |
|
edfed 07 Mar 2010, 18:16
cool
thanks baldr, it was a big problem for me since i use a macro and multiline for this kind of code: Code: screens: Gnode 0,0,4000,3000,\ \; .8_5,.cga,.wxga,.wsxgap,.wuxga,.wqxga,\ .4_3,.qvga,.vga,.pal,.svga,.xga,.sxgap,.uxga,.qxga,\ .5_4,.sxga,.qsxga,\ .5_3,.wvgap,.wxgap,\ .16_9,.hd480,.hd720,.hd1080 very cool trick that should be referenced in the official fasm user manual, isn't it TG? |
|||
07 Mar 2010, 18:16 |
|
ouadji 07 Mar 2010, 20:59
baldr wrote: ouadji, with my multiline-comment code, it's ok. The backslash effect "jumps over" comment. Code: longexample db \ ; doesn't work here /* ; "aaaa aaaaaaa aaaaaaaa",10,13,\ ; doesn't work here */ "aaaa aaaaaaa aaaaaaaa",10,13,\ "aaaa aaaaaaa aaaaaaaa",10,13 |
|||
07 Mar 2010, 20:59 |
|
ouadji 08 Mar 2010, 19:22
my last code (release __4) perfect code, flawless operation. (edit : below, release __5) Code: ;<version 5> 09 Mar 2010 sorry ... my release 5 is not good. I'm working on release 6. Last edited by ouadji on 21 Sep 2010, 20:29; edited 20 times in total |
|||
08 Mar 2010, 19:22 |
|
edemko 08 Mar 2010, 19:47
where to place it?
|
|||
08 Mar 2010, 19:47 |
|
ouadji 08 Mar 2010, 20:00
at the very end of "PREPROCE.INC" (release __5 above) |
|||
08 Mar 2010, 20:00 |
|
baldr 09 Mar 2010, 23:41
ouadji,
Few comments: or eax, 05000005h don't have to be hardcoded: xor eax, "'..'" xor '".."' is (almost) self-commenting and does not depend on whether '"'<"'". Similar trick could be used for CR/LF pair testing: Code: CRLF_: cmp al, 0Dh je .next cmp al, 0Ah je .next clc ret .next: xor al, 0Ah xor 0Dh cmp al, byte [esi] jne .done inc esi .done: inc edx stc ret St_symbol should begin with symbol from symbol_characters (minus control characters, space and ';') - not a big limitation though, only !$%.?@^_ aren't there. Error in line that is continued from previous line incorrectly being reported as contained in the first line: Code: db \ /* error is reported here */ \ \ \ x; error is here Code: db \; FASM reports an error and shows only this line, verbatim \ \ \ x ; FASMW selects entire block and shows preprocessed "db x" as a source of an error Code: \/ fix * \* fix / macro A { B equ \/* Hello C equ \*/ world } macro display_s v { match vv,v \{ irps s,vv \\{ display \\`s \\} display 13, 10 \} } A display_s B; should display **Hello display_s C; should display //world |
|||
09 Mar 2010, 23:41 |
|
ouadji 10 Mar 2010, 02:02
Code: A -- or eax, 05000005h don't have to be hardcoded: but .... xor eax, "'..'" xor '".."' B -- Similar trick could be used for CR/LF pair testing: ... xor al, 0Ah xor 0Dh A : very good idea, very good comment, thank you B : very good idea too, thank you Quote:
I don't quite understand what you mean. Please, can you explain with "other words". with symbol from "symbol_characters" ? from PREPROCE.INC, is that right? sorry, but here, I don't understand the meaning of your remark. Code: \/ fix * \* fix / macro A { B equ \/* Hello C equ \*/ world } macro display_s v { match vv,v \{ irps s,vv \\{ display \\`s \\} display 13, 10 \} } A display_s B; should display **Hello display_s C; should display //world ... with "my" fasm, the problem is here : B equ \/* Hello C equ \*/ world /* Hello C equ \*/ ..... == comment ! and the result is : B equ \ word display for me : word C I'll think about that problem ... a little extreme , but there is a solution to every problem. Quote:
yes, indeed ! but here too, i will think about this, maybe it's possible to find a better solution and better result. I do not know, i will see. Quote: Keep up the good work! thank you very much for your feedback It helps me to improve my code. it's very nice of you. PS : ".next: xor al, 0Ah xor 0Dh" ... it's great this ! i like it ! |
|||
10 Mar 2010, 02:02 |
|
baldr 10 Mar 2010, 07:31
ouadji,
Yes, symbol_characters. I mean that if you try to change comment start to "!(" for example, it won't work because "!", as non-symbol character, will be handled before symbol_character: is reached (at convert_symbol: ). The whole \/ issue is artificial. ';' comments are handled specifically after '\' (only \; is allowed, with intervening linear whitespace), probably it won't worth to resolve this (deserves note in mod documentation though). I've been tinkering with textequ macro and decide to split it in two: Code: struc textequ [arg] { common . equ irps s,arg \{ match v,.\\#\\`s \\{ restore . . equ v \\} \} } struc ! [arg] { common match v,arg \{ . v \} } macro ! [arg] { common match v,arg \{ v \} } ; Usage: @S_ ! textequ Start_symbol @E_ ! textequ End_symbol |
|||
10 Mar 2010, 07:31 |
|
ouadji 10 Mar 2010, 09:56
Quote:
"artificial" ... yes, but the séquence "\/" is not a problem ! Code: with : ..... \/ fix * .... or : ..... B equ \/* Hello ... my code reacts well, (reacts ??? perhaps ... "my code is behaving normally") and simply detects the comment that must detect. B equ \/* Hello C equ \*/ world In fact, a ghost comment here ... But "\/" isn't a problem in itself. Quote:
very nice ! After a while of thinking, i understood how it works (ouéééé ) yes, very powerful. But this power is not really necessary in my case. I prefer to keep your first solution but nice work ! Quote:
in both cases just above, i think there are ways to find a good solution. maybe handle the FASM code earlier, to handle "non-symbol" character. It's possible and it should not be a problem ... but is it necessary? yes, why not ... I'll try that. and for "ghost comment" (for very difficult and complex cases) maybe, a command that allow to disable "multiline comments" on a piece of code. It's possible to do this, it's not a big problem. (for very complex cases, and ... baldr's cases ... I tease you). but, jokes aside, e.g. : "stop_com/go_com" you would be able to place this command anywhere, even inside "struc" or "macro", why not ? like this: Code: \/ fix * \* fix / macro A { B equ \stop_com/* Hello C equ \*/go_com world } macro display_s v { match vv,v \{ irps s,vv \\{ display \\`s \\} display 13, 10 \} } or else, for those who don't really know where is the problem stop_com \/ fix * \* fix / macro A { B equ \stop_com/* Hello C equ \*/go_com world } macro display_s v { match vv,v \{ irps s,vv \\{ display \\`s \\} display 13, 10 \} } go_com thank a lot, have a good day. |
|||
10 Mar 2010, 09:56 |
|
ouadji 12 Mar 2010, 17:29
baldr, look at this below : i'm working on revision 6. I allow some control words (format: /*name!! + data) Code: - to disable/enable multiline comment. /*idle!! (no data) - to change the symbols start/stop. /*init!!xxxx (xxxx = data = new start/stop) "!()!" will be allowed too. like this: Quote:
Last edited by ouadji on 12 Mar 2010, 23:35; edited 3 times in total |
|||
12 Mar 2010, 17:29 |
|
edfed 12 Mar 2010, 19:14
mov /*comment*/ eax,/*comment*/ebx ;comments?
no comment. i don't see the use of such a feature, even in 2010. |
|||
12 Mar 2010, 19:14 |
|
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.