flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > another FASMG question: odd behavior (XCALM) asm mvstruc.. |
Author |
|
Tomasz Grysztar 07 Jul 2023, 12:25
The "mvstruc STEST2, STEST1" command is interpreted within the local context of "test" instruction, and therefore it's target is interpreted as a symbol in that local namespace, not the global one. Naming the target of "mvstruc" is like defining a new instruction - it therefore creates a new symbol locally. You can observe the same effect with a simple assignment, too:
Code: STEST1 = '* STEST1' STEST2 = '* STEST2' calminstruction test asm STEST2 = STEST1 ; defines a local STEST2 end calminstruction test display STEST2 Code: _test equ mvstruc STEST2, STEST1 calminstruction test local _cmd assemble _test arrange _cmd, =foo =STEST2 assemble _cmd end calminstruction test A more sophisticated option would be to create a symbolic link to symbol in the right context and then use the value of that link to embed the chosen context exactly at the point where you need it: Code: link_to_global_STEST2 equ STEST2 match global_STEST2, link_to_global_STEST2 calminstruction test local _cmd asm mvstruc global_STEST2, STEST1 arrange _cmd, =foo =STEST2 assemble _cmd end calminstruction end match test |
|||
07 Jul 2023, 12:25 |
|
fabbel 07 Jul 2023, 14:04
ok ok .. tx
.. last point though.. ... cudn't i simply use # prefix ? typ: asm mvstruc #STEST2, STEST1 ? |
|||
07 Jul 2023, 14:04 |
|
Tomasz Grysztar 07 Jul 2023, 14:56
fabbel wrote: ok ok .. tx It would work the other way around if you used it in the last example, though: Code: asm mvstruc #global_STEST2, STEST1 |
|||
07 Jul 2023, 14:56 |
|
fabbel 07 Jul 2023, 15:35
ok tx for clarifying
|
|||
07 Jul 2023, 15:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.