flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Append "epilog" for "constant" (EQU) |
Author |
|
Tomasz Grysztar 06 Jan 2017, 19:35
You need to use MATCH to extract the value of FUNCTION_NAME into a parameter, then the value of parameter can be concatenated with #:
Code: match name, FUNCTION_NAME { public name#_Handler } |
|||
06 Jan 2017, 19:35 |
|
alorent 06 Jan 2017, 20:05
Hi Tomasz,
Thanks again! That works as expected! The problem is that I'm using it inside a macro and I don't get it to work. I have tried the following: Code: FUNCTION_NAME EQU FunctionPoly1 macro POLY_FUNCTION { match name, FUNCTION_NAME \{ public name#_handler proc name#_handler param1 \} mov eax, eax ret endp } ; Testing the waters.... POLY_FUNCTION mov eax, FunctionPoly1_handler ; FASM ERROR: undefined symbol 'FunctionPoly1_handler'. mov eax, name_handler ; it assembles correctly!!! When the "match" is inside the macro, it does not get defined as expected. If I put the "match" ouside the "macro" it works fine. How can I make it work from inside the macro? Thanks! |
|||
06 Jan 2017, 20:05 |
|
Tomasz Grysztar 06 Jan 2017, 20:17
You need to escape the "#" operator the same way as you escape the "{" and "}", otherwise it is processed by the outer macro.
|
|||
06 Jan 2017, 20:17 |
|
alorent 07 Jan 2017, 01:19
Thanks a lot! I have it working as expected now
|
|||
07 Jan 2017, 01:19 |
|
alorent 08 Jan 2017, 07:41
Hi,
I have done some changes. When I put in the above example: Code:
...
public name#_handler
...
It's processed correctly and generates "public Function1Poly_handler" But if I put the following: Code: ... public name#_handler as '_name#_handler@8' or public name#_handler as '_#name#_handler@8' it seems to be processed as: public Function1Poly_handler as '_name#_handler@8' That is, the second part is not processed. Any help? Thanks! |
|||
08 Jan 2017, 07:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.