flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Idea. Put macro in macro.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 06 Apr 2020, 06:25
Code:
macro A Dig { mov eax,Dig }
macro B Dig { shl eax,Dig }
macro C Dig { add eax,Dig }

macro D Dig,Pr { 
cmp eax,Dig
jnz @f
Call Pr
@@:
 }

In code i want to combine different macros:
 A 10,< B 2 >,< C 220>,< D 320,Proc1>,< B 3 >,< C 12 >,< D 520,Proc2>
    


Or
Code:
macro A Dig { mov rcx,Dig }
macro D Dig,Pr { 
cmp eax,Dig
jnz @f
/ .. / ;in this place must put macro A or B or any else macro.
Call Pr
@@:
 }
In code:
D 10,<A 20, B 2>
    



How do this ?
Post 06 Apr 2020, 06:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 07 Apr 2020, 01:44
Roman wrote:
Code:
macro A Dig { mov eax,Dig }
macro B Dig { shl eax,Dig }
macro C Dig { add eax,Dig }

macro D Dig,Pr { 
cmp eax,Dig
jnz @f
Call Pr
@@:
 }

In code i want to combine different macros:
 A 10,< B 2 >,< C 220>,< D 320,Proc1>,< B 3 >,< C 12 >,< D 520,Proc2>
    
You can use irp
Code:
macro A Dig { mov eax,Dig }
macro B Dig { shl eax,Dig }
macro C Dig { add eax,Dig }

macro D Dig,Pr {
cmp eax,Dig
jnz @f
Call Pr
@@:
 }

;In code i want to combine different macros:
irp p, A 10,< B 2 >,< C 220>,< D 320,Proc1>,< B 3 >,< C 12 >,< D 520,Proc2> {p}

Proc1:
Proc2:    
Post 07 Apr 2020, 01:44
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 07 Apr 2020, 08:05
Thanks
Post 07 Apr 2020, 08:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.