flat assembler
Message board for the users of flat assembler.
Index
> Main > Is DEFINE defined? Goto page Previous 1, 2 |
Author |
|
ProMiNick 10 Jan 2024, 22:32
revolution wrote: Let's review. yes in unsuccess match - match preprocessor block acts as every other preprocessor block - match closed at first valid closed bracket for that nesting level of preprocessor blocks. why it acts differ in success match? _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
10 Jan 2024, 22:32 |
|
revolution 11 Jan 2024, 00:00
Let's review the result after successful match:
Code: mov reg, num + 5 ; match outputs this line rept 0 { ; match outputs this line rept 1 { ; <--- extra open brace has no effect. mov args } ; <--- rept 0 closes here |
|||
11 Jan 2024, 00:00 |
|
ProMiNick 11 Jan 2024, 00:17
revolution wrote: Let's review the result after successful match: Code: } ; where this one, how rest goes if here is match closed or rept closed revolution wrote:
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
11 Jan 2024, 00:17 |
|
revolution 11 Jan 2024, 00:29
I showed the next five lines encountered after match has finished. The preprocessor simply continues on to process those five lines as if you had typed then exactly like that.
|
|||
11 Jan 2024, 00:29 |
|
ProMiNick 11 Jan 2024, 00:42
Question not answered. Why preprocessing of success match differ from documentation, differ from behavior of any other preprocessor block, differ from match itself in unsuccess state?
Where missed } that I point - why it not closes match or rept? |
|||
11 Jan 2024, 00:42 |
|
revolution 11 Jan 2024, 00:47
It doesn't differ from the docs. It works exactly as described. Same behaviour.
Code: match a,b { ; something rept 0 { } ; finish match rept 1 { ; other thing } ; close either rept 0 or rept 1 |
|||
11 Jan 2024, 00:47 |
|
ProMiNick 11 Jan 2024, 00:53
behavior as described has only unsuccess match case.
Why in one case } - closes match and its inner block content, in other case same } not closes match and its inner block content? |
|||
11 Jan 2024, 00:53 |
|
revolution 11 Jan 2024, 00:59
If match fails then the output is
Code: rept 1 { ; other thing } ; close rept 1 Code: ; something rept 0 { rept 1 { ; other thing } ; close rept 0 |
|||
11 Jan 2024, 00:59 |
|
ProMiNick 11 Jan 2024, 01:06
revolution wrote: If match succeeds then the output is: why succes match case inner block parsed differently from everithing else that exist in preprocessor stage? Code: ; something rept 0 { } ;where gone this one bracket? rept 1 { ; other thing } ; close rept 0 _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
11 Jan 2024, 01:06 |
|
revolution 11 Jan 2024, 01:11
";where gone this one bracket?"
That is the closing brace for the match block. Macros don't output their own braces. Code: ; match a,b { ; starting match opening brace, not outputted only things inside the braces are output ; something rept 0 { ; } ; finish match closing brace not outputted rept 1 { ; other thing } ; close either rept 0 or rept 1 |
|||
11 Jan 2024, 01:11 |
|
pfranz 11 Jan 2024, 03:49
Thanks for your replies, but maybe I wasn't clear.
I used "mov" as an example, but I would need functions to be used with every instruction that takes parameters, without having to re-define each of them. |
|||
11 Jan 2024, 03:49 |
|
revolution 11 Jan 2024, 04:51
Code: irp inst,mov,cmp,xor,add,... { macro inst ... \{ ;... \} } |
|||
11 Jan 2024, 04:51 |
|
Tomasz Grysztar 11 Jan 2024, 08:49
pfranz wrote: Thanks for your replies, but maybe I wasn't clear. Works with fasm 2, too. There is no such easy solution for fasm 1, though (see above post). |
|||
11 Jan 2024, 08:49 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.