flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Stop macro and continue.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1363
Roman 19 Mar 2023, 07:14
Fasmw 1.73
How do this?
Code:
Macro ee {} 
ee Tom, 1,2,3,\\ ;mean stop macro ee
  db  'Tom address',0,\ 
  db 10 dup(5,3),\\ ;mean continue macro ee
   5,4,1

    

Or only way is using two macros ee and ee2?
Code:
ee Tom, 1,2,3
   db  'Tom address',0
   db 10 dup(5,3)
ee2  5,4,1
    


Last edited by Roman on 21 Mar 2023, 10:13; edited 2 times in total
Post 19 Mar 2023, 07:14
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 606
Location: Ukraine
Overclick 21 Mar 2023, 06:09
It is not clear what exactly you want.
If you want to insert some string into middle of macro-body then you can do it by a lot of different ways:
equ, macro, .stream(multisection)
Post 21 Mar 2023, 06:09
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1363
Roman 21 Mar 2023, 10:14
Not only string.
Any asm commands or any macros.
Post 21 Mar 2023, 10:14
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 606
Location: Ukraine
Overclick 21 Mar 2023, 20:58
Quote:

Any asm commands or any macros.

So why not?
Code:
macro ee ...
{   ...
     inject
     ...   }

.data
...
macro inject
{   db  'Tom address',0
     db 10 dup(5,3)   }
ee ...

         

Code:
macro ee ...
{   ...
     inject1
     inject2
     inject3
     inject4
     inject5
     ...   }
     inject1 equ
     inject2 equ
     inject3 equ
     inject4 equ
     inject5 equ

.data
...
inject1 equ db  'Tom address',0
inject2 equ db 10 dup(5,3)
ee ...
    

.stream solution is better when you need to combine peaces into the block from different parts of project
Code:
macro ee ...
{   ...
     .stream Inject
     ...   }
.data
  ...
.frame Inject
   db  'Tom address',0
   db 10 dup(5,3)
.data
   ee ...
    
Post 21 Mar 2023, 20:58
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1363
Roman 22 Mar 2023, 02:23
Quote:

macro inject
{ db 'Tom address',0
db 10 dup(5,3) }


For any other case I needed write another inject macro.
Not handful.
Easy have macro ee and ee_
Post 22 Mar 2023, 02:23
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-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.