flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar
It still can be more compact anyway:
Code: irp value,a,a1,b,b2,c,c3,d,d4,e,e5,f,f6,g,g7,h,h8 { common a__ = 0 forward a__ = a__ + 1 if a__ mod 2 add [Hashes.#value],eax else mov eax,[work.#value] end if } |
|||
![]() |
|
LocoDelAssembly
is that documented? I can't find were the documentation says that I can use "common" and "forward" in an IRP.
Anyway, good feature ![]() |
|||
![]() |
|
dead_body
thanks Tomasz!
maybe it will be useful to add it to document.(common in irp) |
|||
![]() |
|
Tomasz Grysztar
Remember that REPT, IRP, IRPS and even MATCH are simply a special kinds of macros.
Manual, section 2.3.5 wrote: The rept directive is a special kind of macroinstruction (...) See also the (well, not finished yet) "Intantaneous macroinstructions" section in the Understanding fasm article. |
|||
![]() |
|
LocoDelAssembly
![]() Sorry ![]() |
|||
![]() |
|
Tomasz Grysztar
Actually perhaps the best would be to use the regular macro instead of IRP here:
Code: macro _t [value,value1] { mov eax,[work.#value] add [Hashes.#value1],eax } _t a,a1,b,b2,c,c3,d,d4,e,e5,f,f6,g,g7,h,h8 IRP itself is in some way redundant directive, I provided it more for the completness that real need. |
|||
![]() |
|
LocoDelAssembly
But does that works fine when the amount of parameters is not even?
|
|||
![]() |
|
Tomasz Grysztar
The last pair of "value,value1" then has an empty value of "value1", just like when you define macro that takes two parameters but provide only one. To make preprocessor complain when the count of parameters is not even, do it like:
Code: macro _t [value*,value1*] |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.