flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > macro and % how using ? |
Author |
|
macomics 11 Apr 2023, 14:04
What does % (cycle counter) and match or macro have to do with it?
|
|||
11 Apr 2023, 14:04 |
|
revolution 11 Apr 2023, 14:12
% is an assembler variable.
The preprocessor doesn't process it at all. |
|||
11 Apr 2023, 14:12 |
|
revolution 11 Apr 2023, 14:13
To use % you need an assembler loop:
Code: while % <= 6 display % + '0' end while |
|||
11 Apr 2023, 14:13 |
|
Roman 11 Apr 2023, 14:28
Sad.
After while % <= 6 end while %=0 Not %=6 |
|||
11 Apr 2023, 14:28 |
|
revolution 11 Apr 2023, 15:06
You can use that to know if your code is inside a loop. Since % is 1 based the only time you see 0 is outside a loop.
Code: if % = 0 display 'I am not inside a loop', 13, 10 else display 'I am inside a loop. Do you see me multiple times?', 13, 10 end if |
|||
11 Apr 2023, 15:06 |
|
Hrstka 11 Apr 2023, 15:15
What about this?
Code: macro oo [c] { common local v v = 0 forward v = v + 1 mov al,c mov ah,v } |
|||
11 Apr 2023, 15:15 |
|
Roman 11 Apr 2023, 15:23
Hrstka
This variant I know. |
|||
11 Apr 2023, 15:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.