flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Projects and Ideas > multi-line comments in FASM

Author
Thread Post new topic Reply to topic
cyberakl



Joined: 18 Apr 2013
Posts: 1
multi-line comments in FASM
Hi, dear friends!

I'd love to see in FASM multi-line comments, like in MASM:


Code:
COMMENT marker

text

marker



or by analogy with the C language:


Code:
/*

text

*/



it would be very nice if the author has implemented the directive....

p.s. I apologize for my bad English.
Post 30 Jul 2013, 08:05
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 773
Location: Jakarta, Indonesia
MHajduk once proposed a patch to enable multiline comments:
http://board.flatassembler.net/topic.php?t=7115

I don't think the patch was accepted.
Post 30 Jul 2013, 08:26
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6303
Location: Kraków, Poland
Post 30 Jul 2013, 08:36
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3415
Location: Bulgaria
cyberakl, multi-line comments are context type, steam construction and in general contradicts the context-less, line based assembly syntax. That is why IMO, such comments are not acceptable.

Of course, working with FASM macros, it is relatively easy to make context dependent structures. (Including multiline comments), but it is not the same and (again IMO) is a little bit more acceptable.


Code:
macro comment {
  match +,- \{
}

end_comment fix }

Post 30 Jul 2013, 08:45
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
dogman



Joined: 18 Jul 2013
Posts: 114
If you have to have this you could probably run the C preprocessor over your source. It also might be interesting to write a preprocessor in fasm. That might be a little better argument for including it in the tools.
Post 30 Jul 2013, 12:49
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1382
Location: Toronto, Canada
I think the IDEs these days have the ability to comment/uncomment blocks of code by
inserting/removing ';' at the beginning of every line in the block.
Post 30 Jul 2013, 14:30
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1907
Post 10 Aug 2013, 08:43
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1173
Location: Unknown
One of the simpler ways to have block comments in FASM is by doing the following:

    1.Backup files.
    2.Run external program to remove comments.
    3.Rename file to original name.
    4.Assemble file with FASM.
    5.Recover from backup file regardless of FASM being executed successfully.

You can download the example implementation by using makefile from here: http://201.46.215.18/download.js?sample.tar.bz2

Remove custom block comments by running: "crm <comment_start> <comment_end> <source_file>".

Example:
bash: crm '/*' '*/' /path/to/source.asm > /path/to/output.asm

Notes:
Comment nesting is ignored.
Input file must be UTF-8 or ordinary ASCII. Detected end of line modes are CR, CRLF or LF.

If there is any problem of using this method, please let me know. I could not find any till now.

I apologize for any inconveniences I may have caused.


Description:
Download
Filename: sample.tar.bz2
Filesize: 35.54 KB
Downloaded: 135 Time(s)

Post 07 Apr 2015, 00:32
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14672
Location: Origae-6

HaHaAnonymous wrote:
One of the simpler ways to have block comments in FASM is by doing the following:

    1.Backup files.
    2.Run external program to remove comments.
    3.Rename file to original name.
    4.Assemble file with FASM.
    5.Recover from backup file regardless of FASM being executed successfully.

Yes, this will work to a point. But for projects that use multiple files it becomes quite cumbersome. And rather than overwriting the original and then recovering it later perhaps you can make a temporary comment-stripped-file instead and assemble that. That way the original is not touched which gives better immunity to crashes and other unexpected events.
Post 07 Apr 2015, 00:59
View user's profile Send private message Visit poster's website Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1173
Location: Unknown

Quote:

That way the original is not touched which gives better immunity to crashes and other unexpected events.


But the original file is not touched in practice... D:
Post 07 Apr 2015, 01:16
View user's profile Send private message Reply with quote
PeExecutable



Joined: 26 Jun 2015
Posts: 181
Write help files instead of huge comments. When you create subroutines that you re-use frequently, put it in a general help file that documents its usage. When you have finished that, drink a cup of coffee.
Post 14 Jul 2015, 20:27
View user's profile Send private message 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.