flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > don't understand "if ~ defined x / restore x / define x" |
Author |
|
Tomasz Grysztar 13 Feb 2017, 19:21
zhak wrote: `if ~ defined x` checks whether a symbol is NOT defined anywhere in code (either backwards or forward referenced RESTORE is a "nop" when a symbol has not yet been assigned any value, but "touching" a symbol with RESTORE forces it to become a variable symbol, ensuring that it cannot be forward-referenced. So you should interpret that "restore x" line as meaning "treat x as a variable (and disallow forward-referencing it)". To make this snippet clearer you could make a macro with a name suggesting the purpose of this construction: Code: macro var? name
define name
restore name
end macro
if ~ defined x
var x
define x
end if |
|||
13 Feb 2017, 19:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.