flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Nested macro problem: T nop, <T cli, sti> |
Author |
|
revolution 12 Nov 2015, 00:58
You can't have a macro call itself. But you can make another macro of the same name and call that:
Code: macro T op1, op2 { op1 op2 } macro T op1, op2 { op1 op2 } T clc, cld T nop, <T cli, sti> Code: macro make_T { macro T op1, op2 \{ make_T op1 op2 purge T \} }make_T T clc, cld T nop, <T cli, <T int3, <mov eax,ebx>>> |
|||
12 Nov 2015, 00:58 |
|
Devel99 12 Nov 2015, 02:17
revolution damn that's awesome! you're the best macro engineer ever
T <T <T iret, db 0xCC>, cld>, <T cli, <T int3, <mov eax,ebx>>> yay thanks a lot, you rock! |
|||
12 Nov 2015, 02:17 |
|
revolution 12 Nov 2015, 02:28
You don't need to limit yourself to two opcodes.
Code: macro make_T { macro T [ops] \{ \common make_T \forward ops \common purge T \} }make_T T clc T iret, cld, int3, inc eax, stosb, jmp $ T nop, <T cli, <T int3, <mov eax,ebx>, <T cmpsb, <T retn, <aam>,<T db 1, db 2>>>>> |
|||
12 Nov 2015, 02:28 |
|
revolution 12 Nov 2015, 02:35
Devel99 wrote: revolution damn that's awesome! you're the best macro engineer ever |
|||
12 Nov 2015, 02:35 |
|
Devel99 12 Nov 2015, 03:14
yeah, but my program's logic implicates using only two macro parameters where each one is an argument in two-operand instruction like add x1, x2 ))
|
|||
12 Nov 2015, 03:14 |
|
l4m2 09 Dec 2015, 01:48
Code: rept 1 {mov ax, 3 } mov bx, 2 |
|||
09 Dec 2015, 01:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.