flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Help with macro (Reusing macro parameters as "prefix&am |
Author |
|
revolution 15 Oct 2010, 11:37
Is this for a COM interface?
It looks similar to the macros in COM32.INC (in the Windows download) |
|||
15 Oct 2010, 11:37 |
|
alorent 15 Oct 2010, 11:50
Hi revolution,
Well, I'm trying to implement a light "OO" interface. Didn't know there was something similar in COM32.INC. Anyway, I can see such functionality in COM32.INC Any help? Thanks! |
|||
15 Oct 2010, 11:50 |
|
revolution 15 Oct 2010, 12:04
Wel the first one looks easy:
Code: macro c_instance name, type { name <type> _call type#_Init,name } c_instance MyVar, TypeStructVar |
|||
15 Oct 2010, 12:04 |
|
alorent 15 Oct 2010, 14:26
Thanks a lot revolution!
As you can see, the second macro has a dot "." that separates the substring that we need (i.e., "MyVar.Function1"). Does that dot help? Thanks again! |
|||
15 Oct 2010, 14:26 |
|
vid 15 Oct 2010, 14:46
I'd suggest changing macro syntax to something like:
Code: mcall MyVar, method, arg1, arg2, ... That way things will get much simpler. Or, at least use some other character which is not part of symbol name. Something like "MyVar:method". That way you can separate two symbols from single macro argument by using "match" directive. |
|||
15 Oct 2010, 14:46 |
|
alorent 15 Oct 2010, 15:10
Hi vid,
Thanks for the information. Yes, I also afraid the "dot" might lead into troubles. I also like your ":" solution. I'm trying to define as something like: Code: macro mcall instance_method, [params] { match instance:method, instance_method \{ _call instance\#.method\#, params \} } but I get error when I call the macro: Code: mcall MyInstance:MyMethod, eax, ebx It says "undefined symbol "MyInstance.method" Any help? Thanks! |
|||
15 Oct 2010, 15:10 |
|
Tomasz Grysztar 15 Oct 2010, 15:52
It should be:
Code: _call instance\#.\#method, params |
|||
15 Oct 2010, 15:52 |
|
alorent 15 Oct 2010, 17:08
Thanks Tomasz!
That worked as expected! |
|||
15 Oct 2010, 17:08 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.