I decided to present, in a form of stream of thought, some of my ideas for tweaks in syntax of fasm (both g and 1, as many of their syntactical choices overlap) that have been haunting me for years but I never included them in the assemblers as I never really liked the syntax options I was coming up with.
There never was any urgency in implementing these ideas, since they are not really crucial. They could make macro development easier in some specific cases, but any problems they solve can usually be solved some other way. I present them mainly to preserve the thoughts, though we could also discuss what could be done to make the syntax more appealing. Or perhaps you would like it more that I do?
It starts with this: fasmg, just like the preprocessor of fasm 1, has separate directives for removing the most recent value of symbols of various classes. RESTORE is for the expression-class, PURGE for instructions, and RESTRUC for labeled instructions (structures).
I've been sometimes considering additional syntactical features for RESTORE directive that would allow it to restore instructions. It could look like:
restore db, :db, /db
; equivalent to:
restore db
purge db
restruc db
This could be easily made into a macro. But if such syntax was officially introduced in one internal directive, it could as well be used in others. An example follows.
Another feature that I keep reconsidering is the IFDEF/IFNDEF directive. Such directive could be useful even if applied just to the expression-class symbols, because IF DEFINED construction does not allow to check for symbolic variables, neither in fasmg nor in fasm 1, as in both the assemblers symbolic variables are replaced with their values before the condition that is an argument to IF is evaluated.
If for this reason I decided to add IFDEF/IFNDEF, a logical extension of this idea would be allow to check for definitions of macroinstructions and structures. One way to do it would be to add more directives, like IFDEFI, IFDEFS, etc. But if there already existed a syntax for RESTORE like described above, it could also be adapted to IFDEF. And then
would check whether there is a macro named "mov".