flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > fasm1: nesting extending syntax with 1 row-action

Author
Thread Post new topic Reply to topic
ProMiNick



Joined: 24 Mar 2012
Posts: 803
Location: Russian Federation, Sochi
ProMiNick 28 Oct 2024, 13:47
Code:
macro extend name,pattern,action { macro name expr& \{ match pattern,expr \\{ action
                rept 0 \\{\\} rept 1 \\{ name expr  \\} \} }    
use example:
Code:
extend dd, <=lo=,=mid=,=hi =of base*idx-num>,<dd (base and $FFFFFFFF *idx) and $FFFFFFFF-num,(base and $FFFFFFFF *idx) shr 32+(base shr 32 *idx) and $FFFFFFFF,(base shr 32 *idx) shr 32>    
extended syntax example
Code:
dd lo,mid,hi of 10000000000000000000*10-1 ; match pattern - extended handling
dd lo,mid,hi of 10000000000000000000*100-1
dd lo,mid,hi of 10000000000000000000*1000-1
dd lo,mid,hi of 10000000000000000000*10000-1
dd lo,mid,hi of 10000000000000000000*100000-1
dd lo,mid,hi of 10000000000000000000*1000000-1
dd lo,mid,hi of 10000000000000000000*10000000-1
dd lo,mid,hi of 10000000000000000000*100000000-1
dd lo,mid,hi of 10000000000000000000*1000000000-1
;dd lo,mid,hi of 10000000000000000000*1000000000+1 ; mismatch pattern - dd error
dd -1,-1,-1 ; mismatch pattern - usual handling    


in case if that isn`t syntax extend is syntax override:
Code:
macro override name,pattern,action { macro name expr& \{ match pattern,expr \\{ action
                rept 0 \\{\\} rept 1 \\{ expr mismatch pattern \\} \} }    

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 28 Oct 2024, 13:47
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.