flat assembler
Message board for the users of flat assembler.
Index
> Main > Problem with string conversion |
Author |
|
pfranz 22 Oct 2023, 15:05
This doesn't work for me:
Code: macro show par {display `par} show [hello] |
|||
22 Oct 2023, 15:05 |
|
revolution 22 Oct 2023, 15:41
Each symbol needs its own backtick (`)
Code: macro show par { irps p,par \{ display \`p \} } show [hello] |
|||
22 Oct 2023, 15:41 |
|
revolution 22 Oct 2023, 18:23
There are three symbols "[", "hello", and "]".
Using irps isn't a workaround it is a requirement to apply ` to each symbol. Otherwise only the first symbol is converted to a string and the final two symbols can't be displayed as they are. I moved to "main" because this isn't about the internal details of the assembler, but rather it is about writing the code it assembles. |
|||
22 Oct 2023, 18:23 |
|
pfranz 22 Oct 2023, 19:23
I thought the symbol was the argument name.
This problem comes from passing values by reference to functions, such as [PointerToX], and trying to display them inside macro calls for debugging. [PointerToX] is a single parameter, like ValueX, so should be a single symbol to be converted to string, correct? |
|||
22 Oct 2023, 19:23 |
|
revolution 22 Oct 2023, 19:34
A parameter is not a symbol. They are different.
Macro parameters are separated by commas (,). Symbols are any run of characters separated by: Code: symbol_characters db 27 db 9,0Ah,0Dh,1Ah,20h,'+-/*=<>()[]{}:,|&~#`;\' |
|||
22 Oct 2023, 19:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.