flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > CALM question: check if 2 variables hold same sym value |
Author |
|
Tomasz Grysztar 17 May 2023, 14:13
There is no operation that would do this directly. You would have to manually split one of the values to convert it into MATCH pattern consisting of all literals. I guess I never encountered a problem that would require this kind of operation, that's why I never thought of this before.
|
|||
17 May 2023, 14:13 |
|
fabbel 17 May 2023, 14:34
I reckon for case sensitive compare, i cud do sthg like
calminstruction test arg1, arg2 transform arg1 stringify arg1 transform arg2 stringify arg2 check arg1=arg2 jyes same ... handle case when diff... same ... handle case when same... end calminstruction test A, B test A, C ... ... But was checking to see if there cud be some other / more efficient way ... Plus obv, does not work for case insensitive... |
|||
17 May 2023, 14:34 |
|
fabbel 17 May 2023, 14:41
Read same: in calminstruction
|
|||
17 May 2023, 14:41 |
|
bitRAKE 17 May 2023, 17:22
I'm learning these things too; but here are some thoughts:
Case-insensitive matching only effect literals like MATCH =VALUE?, symbol; but the VALUE could be replaced by wrapping the calminstruction at a higher level. Another way is to transform case insensitive values in a namespace: Code: define tester? define tester?.FOO? foo calminstruction test arg1, arg2 transform arg1,tester? transform arg2,tester? ... Maybe this doesn't fix your use though? [I would look at how fasmg supports registers for x86 implementation with algebraic terms - this prevents the need to stringify the arguments.] _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
17 May 2023, 17:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.