flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > suggestion /*Comments*/ (final rev.8 - over for me)

Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2010, 00:06

a suggestion,

Why not include the code of "Mikolaj Hajduk" inside FASM ?
This allows placement of comments on several lines, , or inside a line.

The modification is not large, about twenty lines of code in PREPROCE.INC.
I recompiled FASM and I tried this new feature, it works fine !

The possibilities of FASM about comments are very limited,
The comments are very important in a source code.
Be able to place them where you want, would be really useful.
I think it would be an interesting new feature for FASM.


Tomasz Grysztar, ( the Boss Very Happy )

and all users of FASM, what do you think about this ?



Arrow http://mikhajduk.houa.org/EN/Preproce.php
Code:
like this :

/* comment
comment
         comment
     */

OR,

invoke /* comment */ MyProc, eax, ebx /* comment */ , ecx
    

(sorry for my english, i do my best, it's not easy for me)

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 21 Sep 2010, 20:22; edited 12 times in total
Post 12 Feb 2010, 00:06
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 12 Feb 2010, 01:17
Did you know that we can use the semicolon to insert comments?
Code:
   invoke MyProc, eax, ebx, ecx  ;comment    
A lot of people already don't use even that.
Post 12 Feb 2010, 01:17
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 12 Feb 2010, 01:45
Comments are a waste of time. I'd rather get my code working now without wasting time writing comments than be able to come back in a few months and understand why it works. Smile

Although, I do occasionally go back over my code when I'm done and comment the bits I remember the function of. Laughing

_________________
----> * <---- My star, won HERE
Post 12 Feb 2010, 01:45
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2010, 09:35

revolution :
Quote:

Did you know that we can use the semicolon to insert comments?
a touch of humor revolution ? is this a joke ?
Obviously I know that ! Rolling Eyes

windwakr :
Quote:

Comments are a waste of time.
Comments are a waste of time ? Shocked
perhaps about small projects (in a short period of time),
and especially when we're alone on a project.
Otherwise, comments are necessary, essential !

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Feb 2010, 09:35
View user's profile Send private message Send e-mail Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 12 Feb 2010, 10:53
good one, but when fasmw.exe is based on your preproce.inc and compiles a file the IDE crashes.


Description:
Download
Filename: fasm_forum.zip
Filesize: 63.39 KB
Downloaded: 907 Time(s)

Post 12 Feb 2010, 10:53
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2010, 12:12

it's just a "starting point" ...
To make it completely functional,
it is obviously that the designer of fasm (Tomasz Grysztar) must do it himself.
I'd like he looks this proposal, I think it would be a useful new feature for FASM.
I don't pretend to modify FASM alone, it's just a suggestion for the boss !. Wink
Personally, i don't use Fasmw, but i use UEStudio. (or RadAsm)

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Feb 2010, 12:12
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 12 Feb 2010, 12:56
Post 12 Feb 2010, 12:56
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 12 Feb 2010, 14:57
revolution wrote:
There has been a lot of discussion in the past 582 839 2237 3483 4340 5538 5871 7115 7481 9911 11161


I highly support this nevertheless Smile

Code:
/* 
   LET A=3
   PRINT A
*/
   MOV   EAX, 3
   CALL  DECOUT32 ; Input in EAX
    


http://board.flatassembler.net/topic.php?t=11086


Code:
USE32
/* 83 C0 00    */   ADD  EAX, 0  
/* 66 83 C0 00 */   ADD  AX, 0 ; Bad in USE32 code
/* 0F 0B       */   UD2
    
Post 12 Feb 2010, 14:57
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2010, 15:47

Yes, I know that.
a lot of discussion about this (too much !) ... many solutions with a "macro".

No really nice solution !
Quote:

@revolution : Did you search ?
Yes Wink ... I know all these solutions,
Sorry, just alternatives, nothing really effective in all cases !

and with a "macro", how to do this:
Code:
invoke MyProc, /* comment */ [toto], /* comment */ eax

OR

/* comment */ opcode
    

I think it's high time that FASM Allows a nice solution for this feature !
Mikolaj Hajduk code in an good solution !

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Feb 2010, 15:47
View user's profile Send private message Send e-mail Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2010, 22:19

@serfasm ... (and all those who are interested) Wink

FASMW.exe is ok now with multiline comments.


(I did a small error in the modified "PREPROCE.INC". I also updated my first download above. All is ok now.)


With this modified version of FASMW, I have no problems to compile this:
Code:
/*
comment
*/
            mov     eax, /* comment */ 'halt'
/* comment */    mov     eax , eax ; comment
         nop /*
comment */    ret  /* comment */ 4
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 21 Sep 2010, 20:23; edited 1 time in total
Post 12 Feb 2010, 22:19
View user's profile Send private message Send e-mail Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 13 Feb 2010, 01:56
TomaszTheBoss, will you stay aside :)?


Last edited by edemko on 13 Feb 2010, 03:11; edited 1 time in total
Post 13 Feb 2010, 01:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 13 Feb 2010, 02:35
Does not compile:
Code:
        mov     ecx,'/*'
        mov     edx,'*/'
/*
        cmp     ebx,'/*'
        mov     eax,'*/'
*/
        nop    
Post 13 Feb 2010, 02:35
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 13 Feb 2010, 03:10
We are to achieve an equality:
(TomaszTheBoss * the University) =< (TomaszTheBoss * the Board)
...as it will be much difficult, ouadji, to rewrite the include version a version which might be changed.



{ouadji, you could try Delphi styled comments; it will also decrease modification size}

Post 13 Feb 2010, 03:10
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 13 Feb 2010, 07:50
MHajduk's patch was based on 1.67 codebase. No reasons to inject it into later builds.

Should ";" comments have priority over "/* */"?
Post 13 Feb 2010, 07:50
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Feb 2010, 10:03
revolution wrote:
Does not compile:
Code:
        mov     ecx,'/*'   |
        mov     edx,'*/' | <----- OK

/*                                |
        cmp     ebx,'/*' |
        mov     eax,'*/' | <----- only a problem in this case
*/                           |
        nop    

Razz just trying to be right ? I tease you ! Wink
Obviously ... but as I said, it's a starting point, I am not Tomasz Grysztar.
That being said, it's a very small problem compared to the benefits,
... but i will try to fix it !
Quote:
@baldr : MHajduk's patch was based on 1.67 codebase. No reasons to inject it into later builds.

no problem to inject it into later builds than 1.67 !
Proof, i just do it with 1.69.12 !
i have injected it in the last version of PREPROCE.INC .
(I slightly changed it (optimized) but no change in its functioning)

";" comments have priority over "/* */"? : yes

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 13 Feb 2010, 10:24; edited 1 time in total
Post 13 Feb 2010, 10:03
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 13 Feb 2010, 10:17
ouadji wrote:
just trying to be right ?
Yes, of course. Better than trying to be wrong. Wink

Can you fix it?
Post 13 Feb 2010, 10:17
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Feb 2010, 10:33

yes, i will try to fix it ...

... but I'm not the boss !
I think Tomasz Grysztar should be involved in the subject !
I am not the owner of FASM. Razz
I think I have sufficiently showed the direction of the solution.

there is no more much to do ! Wink
(Apart from this single exception (above) , it works very nice !)

sorry for my english, i do my best.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 13 Feb 2010, 10:33
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 13 Feb 2010, 10:44
There are many cases to consider:

Has a single quote infixed
Code:
/* don't look here */    


Uses a single quote:
Code:
/* mov bx,'*/'  */    


Uses a double quote:
Code:
/* mov bx,"*/"  */    


Comments out a multiline
Code:
 stdcall Something,value1,\
  value2,\
/*  value3,\ */
  value4    


Comments out a comment
Code:
/* xor eax,eax ;zero eax */    


Comments out a comment (2)
Code:
 xor eax,eax ;zero eax /*
ignore me */    


What should be done in all the above cases?
Post 13 Feb 2010, 10:44
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Feb 2010, 11:02
Code:
OK
---

/* don't look here */

stdcall Something,value1,\ 
  value2,\ 
/*  value3,\ */ 
  value4

/* xor eax,eax ;zero eax */



NOT OK
--------

/* mov bx,'*/'  */

/* mov bx,"*/"  */

xor eax,eax ;zero eax /* -------> not ";zero eax /*" but "/* zero eax" (ok)
ignore me */
    

I must go, i will be back to the forum later. Wink

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 13 Feb 2010, 11:10; edited 1 time in total
Post 13 Feb 2010, 11:02
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20309
Location: In your JS exploiting you and your system
revolution 13 Feb 2010, 11:09
Does not compile:
Code:
stdcall Something,value1,\ 
  value2,\
/*  value3,\ */
  value4    
Post 13 Feb 2010, 11:09
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.