flat assembler
Message board for the users of flat assembler.

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

Goto page Previous  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

hi,
the last version, the best.
this version is the "Rolls-Royce" of fasm multiline comment.
a nice piece of code. (a few sleepless nights) Wink
solutions based on using macro have become useless,
original fasm 83,9Ko, with my code 84,5Ko, only 0,6Ko.
and what I propose is far more powerful ! no limits !
You can place comments as you want.
skeptical? try it, it's very nice to use.

Thank you for giving me the results of your tests. Razz

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


Last edited by ouadji on 21 Sep 2010, 20:26; edited 1 time in total
Post 24 Feb 2010, 01:52
View user's profile Send private message Send e-mail Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
Although it is probably great to have multi-line comments (and comments between line code), if this is accepted for the official package it will introduce an incompatibility (match is currently able to find /* and */).

Probably this will hardly be a problem for existing code though, and there was a change in the past with the processing of the curly braces that affected backward compatibility much more seriously (this time lots of written code affected), but yet I wanted to point out this problem.
Post 24 Feb 2010, 03:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16733
Location: In your JS exploiting you and your system
LocoDelAssembly, I doubt that Tomasz will include it in the official releases. But it is good for people that want to make their own version and have this feature. Personally I don't need it in my code.
Post 24 Feb 2010, 03:20
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium

Quote:

it will introduce an incompatibility
(match is currently able to find /* and */).

I can change the sequence of characters in 30 seconds.
"/**/" Is no more appropriate? ... "!@@!", "§°°§", "<[]>", "+()+"
or any others.
Quote:

I doubt that Tomasz will include it in the official releases

and why?

This would be pity to deny this type of improvement for Fasm.
This last version is perfect and would deserve a little interest from Tomasz.

All good compilers have a advanced management comments,
FASM is a good compiler and deserves to have management of comments
more advanced than only the sign ";" at the end of sentences.
I ask nothing, I give it ... a finished product, efficient, powerful.

if my code contains elements that Tomasz do not like, I can modify it according to his choice.
I'm open to any requests from him about possible changes, modifications, or others..

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 24 Feb 2010, 07:07
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: 16733
Location: In your JS exploiting you and your system
ouadji wrote:
Quote:

I doubt that Tomasz will include it in the official releases

and why?

This would be pity to deny this type of improvement for Fasm.
This last version is perfect and would deserve a little interest from Tomasz.

All good compilers have a advanced management comments,
FASM is a good compiler and deserves to have management of comments
more advanced than only the sign ";" at the end of sentences.
I ask nothing, I give it ... a finished product, efficient, powerful.

if my code contains elements that Tomasz do not like, I can modify it according to his choice.
I'm open to any requests from him about possible changes, modifications, or others..
[/color][/size]
Your arguments are specious at best. Good compilers, or not, do not have anything to do with "comments
more advanced than ;". Good compilers do what the user needs without bugs (or unnecessary bloat).

If you want Tomasz to consider including this in the official sources then I expect you have to show where this is necessary and useful beyond the current methods. What problem does it solve that cannot be solved in the current version? Give a good reason to show where it is needed and the rest is easy, it would happen. But without a compelling reason it is just extra fluff.
Post 24 Feb 2010, 07:19
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium

A good compiler is a compiler that compiles well,
who builds a good code, which does not have a bugs ... I totally agree with you!
A good compiler, or rather a complete compiler, is a compiler that has "also" a good
management of comments and provides developers with good features about it.
To develop a project alone in "his corner", no need many features about this.
A sheet of paper beside the keyboard is perfect.
"in his corner', in french, it means "alone" ! Wink
When developing in a team, and for a long time, a advanced management comments is essential.
It's amazing, usually we debate things to improve them,
and here, we discuss to try that things do not change !

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


Last edited by ouadji on 24 Feb 2010, 08:51; edited 1 time in total
Post 24 Feb 2010, 08:11
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: 16733
Location: In your JS exploiting you and your system
ouadji: You still have not given any example of where your comment style is vital and solves a current problem. I am not trying to say that it has no merit, I am trying to help you to convince Tomasz.
Post 24 Feb 2010, 08:51
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
Code:
@Intercept       dw 1 dup (\
/*
A -
B -

Table_A : Direct interception
--------
*/
/*targetA1*/ 0, /*targetA2*/ 0, /*targetA3*/ 0,\
/*
Table_B : indirect interception
--------
*/
/*targetB1*/ 0, /*targetB2*/ 0, /*targetB3*/ 0,\
/*
below : priority target
-----------------------
comments, objectives and description
a)
b)
... ... 
*/
/* level_0 */ 0)
    

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



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium

or more simply this:

Code:
@Intercept      dw 1 dup (\ 
\
/*targetA1*/ 0, /*targetA2*/ 0, /*targetA3*/ 0,\
/*targetB1*/ 0, /*targetB2*/ 0, /*targetB3*/ 0,\
/*targetC1*/ 0, /*targetC2*/ 0, /*targetC3*/ 0,\
/*targetD1*/ 0, /*targetD2*/ 0, /*targetD3*/ 0)
    

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



Joined: 30 Mar 2006
Posts: 6023
Location: Poland
I think that there is a one big advantage which multiline comments give us: when you need to comment large piece of code. With C-style /*...*/ comments you can do it very quickly adding only 4 symbols (/* just before the block and */ after it). With "classical" assembler comments you need to precede every single line of this large piece of code with semicolon ';', so amount of work you have to do is noticeable bigger in such case.

I don't agree with those who claim that FASM preprocessor is just ideal and there is no need to change. Referring to the macros mechanism we may say euphemistically that it's "highly inconvenient", however one can use another, more relevant, epithetes here. Wink Yes, FASM preprocessor should be completely rewritten to be more elastic and, what is the most important, easily extensible.

We should appreciate ouadji's attempts in this matter because he revived old but anyway actual question and did it with impressive enthusiasm and consequence. Wink
Post 24 Feb 2010, 10:24
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16733
Location: In your JS exploiting you and your system
Alternative?
Code:
@Intercept   dw 1 dup (\
            \
          0,\    ;targetA1
           0,\    ;targetA2
           0,\    ;targetA3
           \
          0,\    ;targetB1
           0,\    ;targetB2
           0,\    ;targetB3
           \
          0,\    ;targetC1
           0,\    ;targetC2
           0,\    ;targetC3
           \
          0,\    ;targetD1
           0,\    ;targetD2
           0)  ;targetD3    
Post 24 Feb 2010, 10:25
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium


it has no resemblance to the example I proposed.
This is absolutely not the same presentation.
The concept of a Table disappeared.
your presentation distorts and does not show the function of the object
I don't talk about to manage to put comments "in spite of everything",
I talk about a real feature to do this.
It's not the programmer who must adjust to the program, but the reverse.
Better clarity, better readability,
a presentation that reflects the function of the object.
This ensures a comfortable development.
Comment a program is more than just put comments.

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


Last edited by ouadji on 24 Feb 2010, 11:03; edited 1 time in total
Post 24 Feb 2010, 10:56
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 754
Location: Massachusetts, USA
MHajduk wrote:
I think that there is a one big advantage which multiline comments give us: when you need to comment large piece of code...

Why not like this?
Code:
if 0
...
... a whole bunch of code ...
...
end if    

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 24 Feb 2010, 11:00
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium

We could not see things ... a little more professional ?

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


Last edited by ouadji on 24 Feb 2010, 11:17; edited 2 times in total
Post 24 Feb 2010, 11:09
View user's profile Send private message Send e-mail Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6023
Location: Poland
bitshifter wrote:
MHajduk wrote:
I think that there is a one big advantage which multiline comments give us: when you need to comment large piece of code...

Why not like this?
Code:
if 0
...
... a whole bunch of code ...
...
end if    
This case was discussed before in some of the threads (listed by revolution in one of the posts in this topic). Wink If I remember correctly, such construction doesn't disable some definitions of the constants and macros placed inside the "envelope" made of 'if 0 ... end if'.
Post 24 Feb 2010, 11:12
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
Quote:

We should appreciate ouadji's attempts in this matter
because he revived old but anyway actual question
and did it with impressive enthusiasm and consequence

yes, but with your help MHajduk.
My final code is totally different from yours,
but without it , I could not succeed!

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



Joined: 30 Mar 2006
Posts: 6023
Location: Poland
ouadji wrote:
My final code is totally different from yours
Yes, I've noticed it. Wink Keep up the good work! Very Happy
Post 24 Feb 2010, 12:08
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16733
Location: In your JS exploiting you and your system
I find that if/when I need to disable a large portion of code that an 'if 0'/'end if' block would often work but it is not clear to me in the editor window that each line has been disabled. Instead, for that situation I usually highlight the section and do a search and replace to replace all line-starts (^) with a semi-colon (;). This way if the first and last lines of the block are not visible on the screen then each individual line is clearly marked and has proper colouring.

eg. pretend that this code box below is in your editor view window, with code above and below not currently visible:
Code:
  mov eax,aValue
  add ecx,[aLocation]
  ror edx,14
  cmp byte[esi],0xef
  jpo .label    
Can you tell at first glance whether or not if this code has been commented out? There is nothing on screen to indicate that it is in, or not in, a comment block.

If instead you saw this
Code:
;  mov eax,aValue
;  add ecx,[aLocation]
;  ror edx,14
;  cmp byte[esi],0xef
;  jpo .label    
Now can you tell if this code is commented out?

ouadji: Can you make your code properly highlight/lowlight/recolour the commented text blocks in the view screen?
Post 24 Feb 2010, 13:24
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium

"highlight/lowlight" is not a feature of the compiler, but a feature of the text editor.
This is not a special feature of FASMW. I have this feature also with UEStudio.
I must just specify what is the symbol that marks the beginning of a comment.
FASMW is a "integrated product" (text editor + fasm).
FASMW does not have this option (choice of symbol)


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



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
revolution wrote:
eg. pretend that this code box below is in your editor view window, with code above and below not currently visible:
Code:
  mov eax,aValue
  add ecx,[aLocation]
  ror edx,14
  cmp byte[esi],0xef
  jpo .label    
syntax coloring friend Wink

_________________
Previously known as The_Grey_Beast
Post 24 Feb 2010, 15:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  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-2019, Tomasz Grysztar.

Powered by rwasa.