flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Compiler Internals > Multiline /* ... */ comments in FASM. | 
  
| Author | 
  | 
              
| 
                  
                   MHajduk 27 May 2007, 17:54 
                  I've just added two little blocks of instructions to the 'PREPROCE.INC' file to allow multiline C-style comments (i.e. /* .... */):
 
        Added fragments: Code: symbol_character: cmp al,3Bh je ignore_comment ; ; Looking for '/*' symbols (begin of multiline comment block). ; \ ; ; \ ; | ; Looking for '/'. ; | ; ; | cmp al, 2Fh ; | jne @f ; | lods byte [esi] ; | ; | ; Looking for '*'. ; | ; ; | cmp al, 2Ah ; \ Lines added by je multiline_comment ; / Mikolaj Hajduk ; | 27.05.2007. ; Reloading previous value of esi register if read pair differs ; | ; from '/*'. ; | ; ; | dec esi ; | dec esi ; | lods byte [esi] ; | ; / @@: ; / cmp al,5Ch Code: ; ; \ ; Cutting off multiline comment block. ; \ ; ; | multiline_comment: ; | lods byte [esi] ; | or al, al ; | jz line_end ; | ; | cmp al, 1Ah ; | je line_end ; | ; \ Lines added by ; Looking for '*/' symbols (end of multiline comment block). ; / Mikolaj Hajduk ; ; | 27.05.2007. ; | ; Looking for '*'. ; | ; ; | cmp al, 2Ah ; | jne multiline_comment ; | ; | ; Looking for '/'. ; | ; ; | lods byte [esi] ; | cmp al, 2Fh ; | jne multiline_comment ; / jmp convert_line_data ; / ignore_comment: [EDIT]Added version of 'PREPROCE.INC' with my & Mr_Silent's improvements.[/EDIT] 
 
 Last edited by MHajduk on 28 May 2007, 13:13; edited 3 times in total  | 
              |||||||||||||||||||||
                  
  | 
              
| 
                  
                   Ehtyar 27 May 2007, 21:22 
                  Oh that is just sexy, what else can i say. Thank you Mikolaj. For those not bothered to recompile fasm, the topic of multiline comments in fasm has been solved using macros here.
 
                Ehtyar.  | 
              |||
                  
  | 
              
| 
                  
                   vid 27 May 2007, 23:27 
                  nice job, it going to be highlighted.
 
                Someone could also provide diff file for future compatibility  | 
              |||
                  
  | 
              
| 
                  
                   Mr_Silent 28 May 2007, 10:43 
                  Tried to fix those issues I mentioned above.
 
        I wonder how many bugs are still left 
  | 
              |||||||||||
                  
  | 
              
| 
                  
                   MHajduk 28 May 2007, 10:47 
                  Thanks to all of you for good words.  
                 | 
              |||
                  
  | 
              
| 
                  
                   MHajduk 28 May 2007, 11:27 
                  Mr_Silent
 
                I've just tested 'PREPROCE.INC' with your changes - also good work. [EDIT]I've added to the first post in this thread 'PREPROCE.INC' with your improvements.[/EDIT]  | 
              |||
                  
  | 
              
| 
                  
                   DOS386 06 Aug 2007, 06:31 
                  Making this official would be my wish for 1.67.23  
                 | 
              |||
                  
  | 
              
| 
                  
                   MHajduk 06 Aug 2007, 06:40 
                  NTOSKRNL_VXE wrote: Making this official would be my wish for 1.67.23  | 
              |||
                  
  | 
              
| 
                  
                   Tomasz Grysztar 06 Aug 2007, 08:44 
                  There are some other reasons why it has not been done. 
                 | 
              |||
                  
  | 
              
| 
                  
                   DOS386 06 Aug 2007, 10:46 
                  Some more hints about them available ? 
                 | 
              |||
                  
  | 
              
| 
                  
                   rugxulo 31 Aug 2007, 05:22 
                  Tomasz Grysztar wrote: There are some other reasons why it has not been done. /* Like what? Just ignore /* or */ inside any string literals and behind normal ; comment lines. (Sorry, I know it's not quite that simple, just saying ...) */  | 
              |||
                  
  | 
              
| 
                  
                   comrade 06 Apr 2009, 16:36 
                  What's the status on official support of this? Just wondering 
                 | 
              |||
                  
  | 
              
| 
                  
                   rxantos 22 Jun 2009, 15:31 
                  This is useful as it would allow to use doxygen to comment assembly sourcecode. Of course, you will still need to use @fn, @struct, @typedef in the comment, but at least you can have the comment at the same place as the code. Instead of a different tile.
 
                I hope it makes it to be official.  | 
              |||
                  
  | 
              
| 
                  
                   MHajduk 23 Jun 2009, 09:53 
                  rxantos wrote: I hope it makes it to be official.  | 
              |||
                  
  | 
              
| 
                  
                   Azu 19 Aug 2009, 09:35 
                  Tomasz Grysztar wrote: There are some other reasons why it has not been done.  | 
              |||
                  
  | 
              
| 
                  
                   MHajduk 19 Aug 2009, 10:30 
                  Azu wrote: 
  | 
              |||
                  
  | 
              
| 
                  
                   Plue 19 Aug 2009, 19:33 
                  What is wrong with if 0 .. end if? 
                 | 
              |||
                  
  | 
              
| 
                  
                   Azu 19 Aug 2009, 21:03 
                  Try to compile this and find out.
 
                Code: blah equ db 0 if 0 blah equ db error macro foo bar{ if bar eq 1 db 3 else dd 12345678 end if } foo 1 end if blah  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.