flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
cod3b453 16 Apr 2017, 18:03
You could write a parser using virtual/load macros (I personally gave up on this very quickly due to the grammar) but I've managed to do this the other way round, where the definitions are in FASM and a separate build stage generates C headers:
definition.fash This is the FASM generator Code: macro @define id,val { id equ val } fas2c.fash This is the C generator Code: macro @define id,val { db '#define ' db `id db ' ' db `val db NEWLINE } def.fash This is the shared/common definition Code: @define CONST,1 def.h.fasm This will generate a C header Code: format binary as '' include 'fas2c.fash' db NEWLINE db '#ifndef H_DEF',NEWLINE db '#define H_DEF,NEWLINE db NEWLINE db NEWLINE include 'def.fash' db NEWLINE db '#endif',NEWLINE |
|||
![]() |
|
alorent 18 Apr 2017, 11:59
Thanks a lot! That's hard stuff for me
![]() Thanks! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.