flat assembler
Message board for the users of flat assembler.
Index
> Main > [fasmg] Using "?" with arrange |
Author |
|
Tomasz Grysztar 26 Jan 2021, 08:30
Adding "?" at the end of identifier on use is just another way of calling the case-insensitive symbol:
Code: macro show tokens& display `tokens,13,10 end macro calminstruction try t,s arrange cmd, =macro t#=globalblock#s? assemble cmd arrange cmd, =show cmd assemble cmd arrange cmd, =end =macro assemble cmd end calminstruction try A,0 ; these all call the same macro: Aglobalblock0 aglobalblock0 aglobalblock0? When you have a case-insensitive symbol, you can always to refer to it directly by using an identifier followed by "?". This allows, for example, to call the case-insensitive macro even when there is another, case-sensitive one that would override it for the specific combination of characters that you used: Code: macro A#globalblock#1? display '1: case insensitive',10 end macro macro A#globalblock#1 display '2: case sensitive',10 end macro Aglobalblock1 ; calls the second one aglobalblock1 ; calls the first one Aglobalblock1? ; calls the first one |
|||
26 Jan 2021, 08:30 |
|
Calanor 26 Jan 2021, 11:56
Well, that's interesting! Thanks for the information, Tomasz. I had no problems running your code, so there's something odd going on at my end.
To clarify: as soon as I add "#=?", "#?" or "?" at the end of the line, I get a cascade of error messages. The line that constructs the macro does show up in the error log, but it looks perfectly fine. I'm quite confused, but I'll experiment a bit and see if I can figure things out before posting a wall of code. |
|||
26 Jan 2021, 11:56 |
|
Calanor 26 Jan 2021, 13:34
Tomasz: Oh, I've realised what went wrong. The problem was when I later use purge on the macro defined in the CALM-instruction. I didn't include the "?" when purging, which obviously was a bad idea! It's mentioned in the manual that symbols can be defined/used in the way you did here, but for some reason I keep associating symbols with "variables". I better study my code in case I've made any similar mistake somewhere. Thanks again Tomasz!
|
|||
26 Jan 2021, 13:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.