flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Something macro like collect. How do this?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 15 Jun 2021, 08:09
I write on Fasmw 1.73
I want do this.
Code:
macro IfregMsg reg { local .ee
        test reg,reg
        jz   .ee
        invoke MessageBox,0,reg,0,0
        .ee:
        }

proc Az
        collect { mov eax,msg1} 
        ret
msg1 db 'Working !',0
endp

proc Wz
        collect { mov ebx,msg10} 
        ret
msg10 db 'All done !',0
endp

In code:

call Az
IfregMsg collect.Az ;this get reg eax

call Wz
IfregMsg collect.Wz ;this get reg ebx
    
Post 15 Jun 2021, 08:09
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4039
Location: vpcmpistri
bitRAKE 15 Jun 2021, 18:15
Have you seen baldr's macros for creating lists? The understanding and use of fasm is far beyond anything I ever did. Might benefit one to study his work, name baldr can be put in search.

For your task, I imagine collecting results to list and then assembling list items, but I am confused by the mix of assemble-time and run-time use. It seems like you want to give an attribute to the PROC, and then use that attribute?

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 15 Jun 2021, 18:15
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.