flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Bug (or strange behaviour) with sub macros |
Author |
|
vid 16 Jul 2007, 07:42
of course, because name of sub_test parameter is param, and that is also name of test's parameter.
before "test" is being preprocessed, all occurences of "param" in it's body are replaced by it's value. In your case, line "macro sub_test param" becomes "macro sub_test", and after that it is preprocessed. |
|||
16 Jul 2007, 07:42 |
|
LocoDelAssembly 16 Jul 2007, 14:46
Quote:
I don't believe that. That means that in some moment "macro sub_test param" becomes "macro sub_test 1" because as you said param gets replaced, however the example prints "05", not "00" nor "01" nor error because using 1 as symbol when you can't. [edit]Ahp, you CAN use a number as formal param The code below works always. Sorry for the misunderstood Code: macro test param { macro sub_test 1 \{ display 1+'0' \} sub_test ; Works always sub_test 5 ; Works always } macro test2 param { display "OK, no problem without a param", 13, 10 } test2 ; Works test ; Works, displays "05" |
|||
16 Jul 2007, 14:46 |
|
vid 16 Jul 2007, 21:37
no problem, i hope problem is solved now
|
|||
16 Jul 2007, 21:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.