flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > backports of reequ & redefine to fasm1

Author
Thread Post new topic Reply to topic
ProMiNick



Joined: 24 Mar 2012
Posts: 688
Location: Russian Federation, Sochi
ProMiNick
Code:
struc reequ value { local tmp
        tmp equ value ; preserve value for case where "restore ." will trash parts of value
        restore .
        . equ tmp }    


Code:
macro redefine statement { local tmp,tmp2
        tmp equ
        tmp2 equ
        irps n,statement \{
                match any,tmp \\{ tmp2 equ tmp2 \n \\}
                match ,tmp \\{ define tmp n\\} \}
        match tmp3,tmp \{
                match tmp4,tmp2 \\{
                        restore tmp3
                        define tmp3 tmp4 \\} \} }    

test both of them - works(tested on macroset "struct" where previous value used as part of reequalition/redefinition - in "endp" macro when "match any, sub@struct" tested - content of match block replaced with "redefine field@struct field@struct>" & "field@struct reequ field@struct>").
but maybe second one could be simplified?

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 02 Jul 2022, 09:11
View user's profile Send private message Send e-mail 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.