Macros Keys  ..


The macro keys are:


(#  stands for  'parameter number')

           

#1    means   'moveable first parameter' (1 to 9, but 9 is not true last limit).

#F    means   'fixed first parameter'.

#L    means   'fixed last parameter'.

#N    means   'parameters Number'.

#+1  means   'loop from start and add 1 to all parameters numbers' (not to F nor L).

#-2  means   'loop from start and sub 2 to all parameters numbers'.

#5>8 means   'copy parameter 5, 6, 7, 8'               (always '>' never '<' here).

#L>2 means   'copy parameters from Last to second one' (always '>' never '<' here).

#x means   'loop number'.

#=5 means   'Evocation must have 5 Parameters, if not, send me an error message'.

#1!  means   Same as #1, but strip last Character (to build symbols from Labels).

#1!!  means   Same as #1, but strip the two first Chars (For Size Substitutions in CM).

&1=  means   'store what follows in internal Macro Parser Var1'.

&2    means    'replace with internal Macro Parser Var2'.

&0:  means    'I want an Automatic Label here'

&0    means    'replace this by last declared Automatic Label evocation'

NOPE    means    'do nothing here' (Dummy Macros. In fact Dummy Mnemonic: NOPE).



What I call here 'moveable' or 'fixed' is to be understood inside a Macro 'Loop'. Example, :


[Fill_With | mov #2  #F | #+1 ]


 Fill_With  2, eax ebx ecx

>>>

mov eax 2

mov ebx 2

mov ecx 2


#F, for 'First Parameter', is fixed. This is to say remains really the first of transmitted parameters all along the Macro loop unfolding, whereas, #2 is moveable, this is to say that it is increased by '#+1' at each Macro loop unfolding.


Such a '#+1'  notation produces as many loop repetitions of the Macro a number of times equal to the transmitted number of parameters.



#=5 must be written alone, at first and as is, without any space:


[MacroName | #=5 | ... ]

          

         

Limit for expressed numbers is 9 (from 1 to 9); limit for transmitted parameters is 127.

          


'#x' is actually of little use. It is nothing but the internal loop number. Example: 


[ProgressVal | mov D§Value#1 #x | #+1]


ProgressVal a b c d

>>>

mov  D§ValueA  0 | mov  D§ValueB  1

mov  D§ValueC  2 | mov  D§ValueD  3



         

RosAsm macros do not implement conditionnal assembly. In a specific production oriented assembler, this feature would be of little use. If really wanted, I will add it later, but I do not like it. Many programmers go on using it for optimizing old 16 bits like operations, which is a bit out of purpose today.



That's all. This tiny set of writing conventions is enough to realize really great things, including HLL styles:

          

~~~~~~~