flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Use name on code.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 30 Aug 2022, 12:35
I not shoore. But i am looking in fasmw 1.73 macro or some like equ method, for using current name.
Code:
somName = SpriteHero
Moved somName.pos,1,1 ;each frame xy + 1
Draw somName.pos,somName.color

somName = SpriteEnemy1
Moved somName.pos,1,0 ;each frame xy + 1
Draw somName.pos,somName.color

somName = SpriteEnemy2
Moved somName.pos,0,1 ;each frame xy + 1
Draw somName.pos,somName.color
    


And if this absent in fasmw add new method curDef.
I know match for equ. But its not always convenient.
Code:
T equ SpriteHero
match T, T {
        Mov eax, T
        Mov eax, T#.pos
} 
    
Post 30 Aug 2022, 12:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18963
Location: In your JS exploiting you and your system
revolution 30 Aug 2022, 12:45
The dot (.) is not a special character so you are always forced to use the hash (#).

Therefore match is required to do the join.
Post 30 Aug 2022, 12:45
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 587
Location: Ukraine
Overclick 30 Aug 2022, 15:04
You can redefine your macros inside parent one. Those macros can use that parent-macro names for own definitions. Example you can find on multisection-examples. My goto and goend macros using that mechanics.
Post 30 Aug 2022, 15:04
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.