flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Macro get from label name number. |
Author |
|
Roman 02 Dec 2022, 09:58
Fasmw 1.73
Code: lLoop_8: MacroNum lLoop_ ;get me mov ecx,8 DLoop_5: MacroNum DLoop_ ;get me mov ecx,5 |
|||
02 Dec 2022, 09:58 |
|
Roman 02 Dec 2022, 12:29
Thanks Tomasz !
Its amazing and awesome ! |
|||
02 Dec 2022, 12:29 |
|
Roman 02 Dec 2022, 12:36
I write:
label lloop_160 MacroNum lloop_ and get ecx =3Dh not A0h |
|||
02 Dec 2022, 12:36 |
|
Tomasz Grysztar 02 Dec 2022, 13:24
Oh, I messed up the direction, it was parsing 061 instead of 160. It should be:
Code: load d byte from 2*i+%-1 Code: load d byte from $-% |
|||
02 Dec 2022, 13:24 |
|
Roman 04 Dec 2022, 08:47
Code: macro MacroNum prefix { local i,c,d virtual at 0 db `prefix ; i not understood why this needed ? i = $ match label, $label \{ db \`label \} ; i not understood why this needed ? repeat i load c byte from %-1 load d byte from i+%-1 if c <> d err 'the last label does not fit the current prefix' end if end repeat c = 0 repeat $-2*i load d byte from 2*i+%-1 if d < '0' | d > '9' err 'the label number contains incorrect digits' end if c = c * 10 + d - '0' end repeat end virtual mov ecx,c } And not understood why needed prefix ? If $label almost the same. |
|||
04 Dec 2022, 08:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.