flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > feature request: left justified comments

Author
Thread Post new topic Reply to topic
daluca



Joined: 05 Nov 2005
Posts: 86
daluca
hello: I would like to request the ability to make left justified comments.

when i fill some structure like WNDCLASS is hard for me to remember all the elements and where do they go,so I have to switch from window to window to see where I should put a style or an offset to a classname.

I have partialy solved this difficulty making a text like:

Code:

wc WNDCLASS \
    \    ;style
  , \    ;lpfnWndProc
  , \    ;cbClsExtra
  , \    ;cbWndExtra
  , \    ;hInstance
  , \    ;hIcon
  , \    ;hCursor
  , \    ;hbrBackground
  , \    ;lpszMenuName
  ,      ;lpszClassName     

    


so now I can see directly in the sorce the names of the fiels.
but when I put some values between the "," and the "\" the coments well...

Code:

 wc WNDCLASS \
    0 \     ;style
  ,WindowProc \    ;lpfnWndProc
  ,0 \    ;cbClsExtra
  ,0 \    ;cbWndExtra
  ,NULL \    ;hInstance
  ,NULL \    ;hIcon
  ,NULL \    ;hCursor
  ,COLOR_BTNFACE+1 \    ;hbrBackground
  ,NULL \    ;lpszMenuName
  ,_class      ;lpszClassName

    


the alignment gets all messed up.. I know that I could use "insert" for not
to push the comments, but with some text like all those WINDOW_STYLES joined with multiples "or" I would have to put all comments way to far to the right and they would be out of sight.
so I Would like to have this feature or maybe a "hack" (like the one that is use to permit multiple instructions in one line)
maybe the colon could be used to mark the end of comment like:

Code:

wc WNDCLASS \
;style         :    0\
;lpfnWndProc   :   ,WindowProc\
;cbClsExtra    :   ,0\
;cbWndExtra    :   ,0\
;hInstance     :   ,NULL\
;hIcon         :   ,NULL\
;hCursor       :   ,NULL\
;hbrBackground :   ,COLOR_BTNFACE+1\
;lpszMenuName  :   ,NULL\
;lpszClassName :   ,_class      

    


here everything looks highlighted like a coment but the idea is that the text from ";" to ":" is highlighted like a comment (and obviously treated as one).

or maybe something familiar like: /* ------------*/ <instructions here>

well I dont know if it is feasible or difficult to implement but this is my request.

thank you.
Post 21 May 2007, 06:11
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
Quote:

or maybe something familiar like: /* ------------*/ <instructions here>
well I dont know if it is feasible or difficult to implement


Agree !!! Rolling Eyes

Actually also intended to ask for this Shocked ... A wish for next FASM version
... besides my " format binary .EXE " request ... "official" label listing
support ... and some improvements in FASMD Smile

/* bla bla junk */ xor eax,eax ; mov eax,0

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 21 May 2007, 13:46
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yeah
Code:
/*
*/    

Code:
;/*
;*/    

Code:
/*;/*
;*/
*/    
Post 21 May 2007, 13:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Why not this:
Code:
; ... comment ... ;    
(semicolon as a sign for begin and the end of comment)Question
Post 25 May 2007, 08:37
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
because it would break already existing apps thats use ";" inside comments freely
Post 25 May 2007, 09:17
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
OK. We can introduce multiline comments in FASM using fix directive:
Code:
_B fix macro _ {
_E fix }    
Set '_B' at the beginning of commented block and '_E' at the end:
Code:
_B
  ...
 commented instructions
      ...
_E    
it would be replaced by definition of macro named '_' and never used. Block of instructions inside this macro is ignored (i.e. cutted off). This construction could be used securely many times. Smile
Post 25 May 2007, 10:15
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
but you cannot include many macro-features inside such "comment". especially "}"
Post 25 May 2007, 10:37
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
What about
Code:
_B fix virtual at 0
_E fix end virtual    
Question Smile
Post 25 May 2007, 10:57
View user's profile Send private message Visit poster's website Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat
That's not really a comment, though - labels and preprocessor commands inside it will still work.
Post 25 May 2007, 15:22
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Code:
;;
mov eax,0
;;
    


AFAIK, this is what both Octasm and Rosasm (?) both use for multi-line comments. (And I doubt Tomasz will find this a necessary addition.)
Post 29 May 2007, 01:42
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
funny
i lately decided to use double comments (;Wink for in-source documentation (like DoxyGen). They seemed to be natural solution compared to C's /// or /** **/
Post 29 May 2007, 04:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Just FYI (corrections welcome):

Code:
Pascal:       (*  *) or {}
C:            /*  */ or //
Ada:          --
assembly:     ;
BASIC:        '
Perl:         #
T3X:          !
.BAT:         REM or ::
HTML:         <!-- -->
Forth:        ( ) or \
Erlang:       %
Snobol:       *
Turbo PL:     >
VIM script:   "
    
Post 29 May 2007, 13:42
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:  


< 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-2020, Tomasz Grysztar.

Powered by rwasa.