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 |
|
revolution 13 Feb 2010, 11:13
Does compile:
Code: db 0,\ 1,\ \ 3 Code: db 0,\ 1,\ \/* 2,\ */ 3 |
|||
13 Feb 2010, 11:13 |
|
ouadji 13 Feb 2010, 11:55
Code: db 0,\ 1,\ \x/* 2,\ */ <--- x = space 3 This works. |
|||
13 Feb 2010, 11:55 |
|
MHajduk 13 Feb 2010, 19:46
Thank you ouadji for your support, I really appreciate it.
Yes, this patch (introduction of the C-style multiline comments) was made and presented by me here, on this forum, almost three years ago, so it is fully understandable that this version of 'PREPROCE.INC' should work perfectly with older versions of the FASM compiler and may cause some problems with newer versions. I haven't changed it since 2007 but it isn't too difficult to upgrade it to match also newer versions. I may consider it, however actually making corrections in the FASM sources isn't on the top of my task list. |
|||
13 Feb 2010, 19:46 |
|
ouadji 13 Feb 2010, 22:03
I improved it. Code: Does compile ============ -------------------------------------------ok /* don't look here */ -------------------------------------------ok /* xor eax,eax ;zero eax */ -------------------------------------------ok db 0,\ 1,\ \/* 2,\ */ <----- @revolution : without space now. (with or without) 3 -------------------------------------------ok /* cmp ebx,'/*' */ -------------------------------------------ok stdcall MyProc ,eax,\ ebx,\ /* ecx,*/\ <- "\" is Mandatory. But with ";" and without "\" in the end, edx it does not compile any more ! -------------------------------------------ok for all cases below /* comment */ mov eax, /* comment */ 'halt' /* comment */ mov eax , eax stdcall /* comment */ MyProc, eax, ebx /* comment */ , ecx, edx MyProc /* comment */ : /* comment */ ret struc array /* comment */ [arg] { common match n def, /* comment */ arg \{ /* comment */ rept 1 %:1 \\{ /* comment */ . def \\} /* comment */ rept n-1 %:2 \\{ .\\#_/* comment */\\#% def \\} \} /* comment */ } very many possible variations! and certainly more powerful than just ";" ================================================================= this doesn't compile ==================== /* mov eax,'*/' <--- difficult to solve this, possible, but more complex /* here : --> ; mov eax,'*/' ------------------------------- /* mov bx,"*/" */ <---- identical to previous case here : --> ; mov bx,"*/" ------------------------------- stdcall KeGetCurrentIrql,eax,\ ebx,\ /* ecx,*/ <---- PS : with "; ecx," it doesn't compile any more !! edx <--- but it's normal, "edx" is alone !! PS: with /* ecx,*/\ ... it's ok ! ------------------------------- xor eax,eax ;zero eax /* ignore me */ doesn't compile, normal ... ";" has priority over "/* */" ! therefore, "ignore me */" is alone, without the sign "/*" of the beginning. !! ------------------------------- not convinced yet guys ? The few cases that don't work, are either difficult to solve, or it is logically understandable that they don't work. They are not many compared to others. And in these special cases, we can always use ";". is it no more useful, easy and convenient that the only possibility with ";"? Last edited by ouadji on 21 Sep 2010, 20:25; edited 1 time in total |
|||
13 Feb 2010, 22:03 |
|
SFeLi 14 Feb 2010, 06:47
Why don't you just use macros?
|
|||
14 Feb 2010, 06:47 |
|
revolution 14 Feb 2010, 07:12
Nested comments allowed? I tested it:
Compiles: Code: db /* 0 /**/ */ 1 But, doesn't compile: Code: db /* 0 /* */ */ 1 |
|||
14 Feb 2010, 07:12 |
|
ouadji 14 Feb 2010, 09:03
Quote:
for this ... Code: /* comment */ opcode or, invoke myproc, eax /*comment*/,ebx and a thousand other cases. Code: @revolution : doesn't compile. db /* 0 /* */ */ 1 it's normal and logical that this does not compile, "*/ 1" is alone. I never said that nested comments are allowed. nested comments ... theoretical concept which has the only goal of trying to reverse rotation of the earth this works ----------- db /* 0 /* */ 1 this also works ---------------- db /* 0 /* */1 this, below, doesn't compile any more, it's a pity. Code: db /* /* */ */ /* /* */ */ */ /*/*/***/*/*/ */ 1 if you want absolutely nested comments, it's quite possible. Simply use a counter of nesting. (Perhaps "n+1" counters for "n" levels of nesting) But why to do ? To comment the comments ? and the comments about comments of comments ? it makes no sense and even less useful ! |
|||
14 Feb 2010, 09:03 |
|
ouadji 14 Feb 2010, 19:45
Code: Nested comments ---------------- everything below compiles without problem ------------------------------------------ db 0,1,\/*comment <-- ps: "\/*" (non-nested) == "\;" 1,\ /*comment*/ 3 /* /*comment2*/comment1 */ /* don't look here */ ;' /* xor /*?*/eax,eax ;zero eax */ mov eax, /* comment - /*stop*/*/ 'halt' /* comment */ mov eax , eax stdcall /* comment /* A/*B/*C*/D*/E*/ */ MyProc, eax, ebx /* comment */ , ecx, edx MyProc /* comment */ : /* /*C*/ comment */ ret stdcall KeGetCurrentIrql,eax,\ ebx,\ /* ecx/*C/*not D*//*not E */*/,*/\ edx /* cmp ebx,"/*" - cmp ecx,'/*' - '*/' but ? */ /* comment *//* comment */ mov ecx,/*comment/*comment2*/*/'/*' mov edx,'*/' dw/* 1 '/*' */'/*',/*null*/0 mov /*a<-b/*not b<-a*/*/al,0/*but not/*al,'*/' */ok?*/ mov ecx,'/*' /* movhlt edx,"*/" /* mov ecx,'/*' */*/ the simpler cases also work ! (the boss is still not interested ? this would be yet useful for FASM) Last edited by ouadji on 21 Sep 2010, 20:27; edited 1 time in total |
|||
14 Feb 2010, 19:45 |
|
ouadji 15 Feb 2010, 20:41
It's pretty amazing to have no answers, or interest, from the boss about this proposal. However, this is a real need CLIC 49%. First, I started with the code of "MHajduk". I have optimized it, and then, to go even further, i have modified it in particular to include nested comments. (thanks "revolution" ) What is proposed here (MHajduk and me) is really an effective solution for multiline comments It allows easily place comments (basic or multiline, nested or not) and in almost all cases. Shame not to have more interest about this proposal. Tomasz Grysztar certainly has his reasons to react this way, but I don't understand! Last edited by ouadji on 15 Feb 2010, 21:29; edited 1 time in total |
|||
15 Feb 2010, 20:41 |
|
revolution 15 Feb 2010, 20:48
Maybe Tomasz has not seen this topic.
|
|||
15 Feb 2010, 20:48 |
|
ouadji 15 Feb 2010, 20:57
Yes revolution, it is indeed possible ! |
|||
15 Feb 2010, 20:57 |
|
ouadji 15 Feb 2010, 21:18
Last edited by ouadji on 16 Feb 2010, 10:16; edited 1 time in total |
|||
15 Feb 2010, 21:18 |
|
edemko 16 Feb 2010, 04:25
moderate liberalism ;Tomasz
& person suppression ;we & indifference ;a baby out talent approaches oddity |
|||
16 Feb 2010, 04:25 |
|
edemko 16 Feb 2010, 09:55
At least /**/ recognition begged from you, Tomasz.
Graphic aspect is not on the time. |
|||
16 Feb 2010, 09:55 |
|
ouadji 16 Feb 2010, 10:16
sorry, but i'm perfectionistic no difference in operation, but, more nice-looking code in PREPROCE.INC (about "preserve line numbering", "Preserve_LineNum:" in PREPROCE.INC) i modified the code of MHajduki about this. i like the nice code, but it must also be perfectly logical. I think it'll be the last release ! I don't see what I could still improve. comment your sources just for the fun now ! but, if you, you see something, tell me ! feedback and results of your tests are welcome ! (bad english ... i do my best) Last edited by ouadji on 21 Sep 2010, 20:19; edited 1 time in total |
|||
16 Feb 2010, 10:16 |
|
MHajduk 16 Feb 2010, 11:07
Good work ouadji but seems that there some corrections have to be made.
I've just tested fasmw editor modified by you. Hmm... this simple code causes problems when compiled (Error: Invalid expression) Code: format PE GUI 4.0 include '%fasminc%/win32wx.inc' .code start: invoke /***/ ExitProcess, 0 .end start Code: format PE GUI 4.0 include '%fasminc%/win32wx.inc' .code start: invoke /* **/ ExitProcess, 0 .end start Code: format PE GUI 4.0 include '%fasminc%/win32wx.inc' .code start: invoke /** */ ExitProcess, 0 .end start |
|||
16 Feb 2010, 11:07 |
|
ouadji 16 Feb 2010, 11:30
thank you MHajduk, i will try to fix this ! it should certainly be possible ! but now, it's time to eat here 12.30 hrs ! |
|||
16 Feb 2010, 11:30 |
|
MHajduk 16 Feb 2010, 11:34
ouadji wrote: but now, it's time to eat here 12.30 hrs ! Eet smakelijk, ouadji! |
|||
16 Feb 2010, 11:34 |
|
ouadji 16 Feb 2010, 11:51
ok, I saw where the problem was. (with syser) I need a little time to solve it. Quote:
|
|||
16 Feb 2010, 11:51 |
|
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.