You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understood, constants defined with const keyword are replaced directly by their value inside ASM, there is no labeled value used. This then means that they cannot be used inside ASM("...") nor inside BuildTable statements.
On the other hand, preprocessor defines (made with @define) can be used in both, but they do not offer computation, e.g.
So, my request would be, if possible, to define real ASM constants for anything defined with const keyword, in the same way as with variables. That would enable the usage of those constants inside ASM and BuildTable statements, e.g.:
As I understood, constants defined with const keyword are replaced directly by their value inside ASM, there is no labeled value used. This then means that they cannot be used inside ASM("...") nor inside BuildTable statements.
On the other hand, preprocessor defines (made with @define) can be used in both, but they do not offer computation, e.g.
@define FOO 1
@define BAR 42
@define BAZ (FOO+BAR) // generates an error
So, my request would be, if possible, to define real ASM constants for anything defined with const keyword, in the same way as with variables. That would enable the usage of those constants inside ASM and BuildTable statements, e.g.:
const FOO: byte = 1;
const BAR: byte = 42;
const BAZ: byte = FOO+BAR;
something: array[25] of byte = BuildTable("(BAZ + (i*40)) & 0xFF");
ASM("
lda #BAZ
");
If inside unit, the same rules could apply as for variables, e.g. UnitName_ConstName.
The text was updated successfully, but these errors were encountered: