flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Macroinstructions > Modular preprocessor for fasmg/fasm2 | 
| Author | 
 | 
| Tomasz Grysztar 05 May 2025, 09:25 My fun little test with all the above packages combined:     Code: mret? fix return = inlinemacro cat(a,b) MRET a bappend b end inlinemacro display cat(9, 'Test') | |||
|  05 May 2025, 09:25 | 
 | 
| Tomasz Grysztar 22 May 2025, 12:42 A new version, since the previous one was breaking apart when INCLUDE statement was called from inside some other macro. This one ignores such INCLUDEs, so at least it should be more resilient:     Code: if ~ defined Preprocessor? define Preprocessor? Preprocessor? = 'Modular' calminstruction Preprocessor? &line& match =include? any, line jyes outside assemble line exit outside: take Preprocessor?.outside, line local hidden initsym Preprocessor?.link, hidden end calminstruction match INCLUDE, Preprocessor?.link define INCLUDE include define Preprocessor?.include? Preprocessor?.include? macro Preprocessor?.init? chain chain calminstruction include? &statement& arrange statement, INCLUDE statement assemble statement end calminstruction macro Preprocessor?.include? file*, head include file, Preprocessor?.init head purge ?, include?, Preprocessor?.include? end macro calminstruction ?! &line& call Preprocessor?, line take line, Preprocessor?.outside jyes outside exit outside: take INCLUDE, Preprocessor?.include? assemble line take Preprocessor?.include?, INCLUDE end calminstruction end macro end match define Preprocessor?.start? Preprocessor?.start? macro Preprocessor?.start? end macro macro Preprocessor?.start? purge Preprocessor?.start? Preprocessor?.init? end macro end if | |||
|  22 May 2025, 12:42 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.