flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > nested rept counter -- bug or feature? |
Author |
|
revolution 26 Jul 2014, 08:48
Firstly remove the backticks (`).
Secondly when using the concatenation operator (#) you need to escape it with a backslash (\) to the proper level: Code: .L\#num2: |
|||
26 Jul 2014, 08:48 |
|
RIxRIpt 26 Jul 2014, 09:59
revolution wrote: Firstly remove the backticks (`). Thank you. Removing backticks (`) wasn't required. Escaping inner iterator helped. The following code works fine for me Code: rept 4 j { rept 3 i \{ if i + 1 = j display \`i, ' ', `j, 13, 10 display '0' + i, ' ', '0' + j, 13, 10 .L\#i: db i dup '0' + i .sizeof.L\#i = $ - .L\#i display 'Curr size: ', '0' + .sizeof.L\#i, 13, 10 if j < 4 display 'Next size: ', '0' + .sizeof.L#j, 13, 10 end if end if \} } Output: Code: flat assembler version 1.71.21 (1048576 kilobytes memory) 1 2 1 2 Curr size: 1 Next size: 2 2 3 2 3 Curr size: 2 Next size: 3 3 4 3 4 Curr size: 3 2 passes, 6 bytes. But is there any other way to access the label that is defined in the next rept iteration? _________________ Привет =3 Admins, please activate my account "RIscRIpt" |
|||
26 Jul 2014, 09:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.