flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 15 Nov 2005, 01:40
Code: macro label a,b,c { nop } |
|||
![]() |
|
KronosRJ 15 Nov 2005, 03:51
I wanted to do something like
Code: struc MyClass{ .m_pvTable dd ? .m_cRefs dd ? } MyProc QueryInterface , ... (my proc flags)... MYLOCAL xpto MyClass ENDLOCAL I know that Privalov has already developed this solution, and it must work great... I also know that this code inside the MYLOCAL ... ENDLOCAL will work with new structures on db , dw , dd , etc... The thing is, the code inside MYLOCAL ... ENDLOCAL will also generate a xpto label, which I will need to capture and treat in a macro, otherwise this will 'break' my main label (ie any .label after MYLOCAL ... ENDLOCAL will not work; it will be xpto.label instead of QueryInterface.label). I know fasm is working as expected (and as explained by Privalov). I just wanted to understand what mechanism tells the preprocessor to use the label macro to preprocess labels, instead of just placing the label there... In my code, I tried copying the macro label, but it is not working (the db , dw , dd ... structures are working just fine - my problem is with the labels). Code: macro label name \\\\{ deflocal a_strClass , a_strProc, t_strStack , . , : , \\\\} struc dp [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , dp , val \\\\} struc dq [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , dq , val \\\\} struc dt [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , dt , val \\\\} struc dd [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , dd , val \\\\} struc dw [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , dw , val \\\\} struc db [val] \\\\{ \\\\common deflocal a_strClass , a_strProc , t_strStack , . , db , val \\\\} I would like to remember you that, in the example above, the db , dw, dd ... structures are doing their job just fine... My problem is with the label macro... Thanks for any clue you might give me. |
|||
![]() |
|
revolution 15 Nov 2005, 05:29
I think I see your problem. Look at the "struct" macro in the FASM package. That may answer your question as to how it all works. If you use the basic "struc" then it will fail to work the way you want.
|
|||
![]() |
|
Tomasz Grysztar 15 Nov 2005, 10:00
That's right. "struct" uses the "label" to define its main label, so it can be then overriden by the "label" definition provided by "local". With "struc" it won't work.
This thread belongs to the "Macroinstructions", not "Compiler internals", thus I'm moving it. |
|||
![]() |
|
KronosRJ 16 Nov 2005, 01:07
I took some time to understand you guys, but I finally did it...
My classes are based on strucs, not virtuals, and now I can do local variables as well... THANK YOU!!!!! U GUYS DA MEN!!!! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.