flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 26 Mar 2006, 14:23
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 26 Mar 2006, 15:02
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 26 Mar 2006, 17:13
thanks Tomasz!
maybe it will be useful to add it to document.(common in irp) |
|||
![]() |
|
Tomasz Grysztar 26 Mar 2006, 17:16
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 26 Mar 2006, 17:25
![]() Sorry ![]() |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2006, 18:04
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 28 Mar 2006, 20:45
But does that works fine when the amount of parameters is not even?
|
|||
![]() |
|
Tomasz Grysztar 28 Mar 2006, 21:31
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.