flat assembler
Message board for the users of flat assembler.
Index
> Windows > Why doesn't this work? Please fix this in your next update. |
Author |
|
Tomasz Grysztar 06 Jul 2018, 07:39
A label is not always followed by ":", it can also precede a labeled instruction (like data directive) or some other similar constructions specific to fasm. Since all labels are handled the same way, this restriction was chosen to prevent potential pitfalls. For example "int db +1" could be an INT instruction with "db" as just a label used for its numeric value, or it could be a DB definition labeled as "int".
At the same time fasmg does allow to use the same name for symbols of different classes (like instruction- and expression-class). This is because fasmg focuses more on allowing to re-define and customize everything in language even if this can cause potential traps for unaware. The instruction-class always has a priority, so if you define a macro called "add" you can no longer have definition like "add db ?" because that calls the "add" macro instead - but if you define an "add" label first and only apply the "add" macroinstruction later in the source you can still use "add" in expressions freely. Actually, the same happens when you use macros in fasm 1, but there the preprocessor is a separate layer and a distinct language (while in fasmg everything is unified into a single layer). In fasmg it also possible to use interceptor macros to detect and catch a ":" or "=" definition before the instruction get interpreted, so what you suggested could to some extent be achieved there. PS. Now that I think of it, also the claim that "labels are always used as something other than the first item in a line" is not universally true, consider MASM's syntax of ENDP for example. |
|||
06 Jul 2018, 07:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.