flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > macro number how do ? |
Author |
|
Roman 23 Jul 2020, 15:55
Code: macro mM2 { mov eax,1 } In code: zz EQU 2 mM#zz Get fasm error. I expect get mM2 |
|||
23 Jul 2020, 15:55 |
|
DimonSoft 23 Jul 2020, 16:06
AFAIR, # doesn’t work outside macros.
|
|||
23 Jul 2020, 16:06 |
|
DimonSoft 24 Jul 2020, 11:29
Isn’t mM2 an illegal instruction?
|
|||
24 Jul 2020, 11:29 |
|
Roman 24 Jul 2020, 11:37
O! This work !
Code: macro mM2 { mov eax,1 } macro mMmm chTp { mM#chTp } In code: mMmm 2 But not work if: Code:
Rr EQU 2
mMmm Rr
|
|||
24 Jul 2020, 11:37 |
|
revolution 24 Jul 2020, 12:34
You misunderstand the rules for EQU. Macros arguments don't translate EQUs.
If you insist upon using EQU then use match to translate the EQU arguments. Code: macro mM2 { mov eax,1 } macro mMmm chTp { mM#chTp } mMmm 2 Rr EQU 2 match x,Rr{mMmm x} |
|||
24 Jul 2020, 12:34 |
|
Roman 24 Jul 2020, 13:08
I write this:
Code: macro mM2 { mov eax,1 } macro mMmm chTp { match dst src, chTp \{ mM#dst \} } In code: zz EQU 2 mMmm zz Compile but nothing asm code get ! Empty ! I check in IDA Pro. Must be mov eax,1 What i do wrong ? |
|||
24 Jul 2020, 13:08 |
|
revolution 24 Jul 2020, 13:15
That match fails because you asked for two parameters (dst and src) but only provided one (zz).
|
|||
24 Jul 2020, 13:15 |
|
Roman 24 Jul 2020, 13:17
Fasm get error illegal instruction mMdst:
Code: macro mMmm chTp { match dst, chTp \{ mM#dst \} } dds EQU 2 mMmm dds |
|||
24 Jul 2020, 13:17 |
|
revolution 24 Jul 2020, 13:25
You need to escape the #
Code: mM\#dst |
|||
24 Jul 2020, 13:25 |
|
Roman 24 Jul 2020, 13:39
Thanks ! Work !
Its magic ! I got into a fairy tale |
|||
24 Jul 2020, 13:39 |
|
DimonSoft 24 Jul 2020, 15:57
PREPSRC should help a lot.
|
|||
24 Jul 2020, 15:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.