flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 27 Jun 2003, 06:05
Hi.
Look at "proc" macro definition. It's simply not correct to use "pointed" labels as procedure parameters, but only as local variables Code: ;########################################################################## proc cacheMX,pszAddress,addr enter xor eax,eax return ;########################################################################## proc getMX,pszDomain,lpServers,dwDepth .addr rd 02h enter ....... return |
|||
![]() |
|
Tomasz Grysztar 27 Jun 2003, 09:21
Yeah, playing with macro may cause things that look illogical but it will become clear why did it happen when look closer at what preprocessor feeds into parser. In the proc macro you have the following lines:
Code: local ..arg ..arg dd ? arg equ ..arg So for each argument macro generates some name like ..arg?000008BD, which will be available globally, but won't break the locals. Then it declares the virtual variable of that name, and then declares the symbolic constant of the name given by you to be equal to that generated name (for example addr equ ..arg?000008BD). I've made it this way to allow you to use names for arguments not beginning with dot, while still being allowed to define local variables and labels for the proc. Symbolic constant is declared for the rest of the source (unless it is redefined or cleared with restore directive), so in the next proc your .addr symbol is just replaced with the global name (beginning with two dots) that was already used as a label - that is where the error comes from. |
|||
![]() |
|
comrade 27 Jun 2003, 21:38
![]() ![]() ![]() ![]() ![]() So what should I do? ![]() |
|||
![]() |
|
Tomasz Grysztar 27 Jun 2003, 21:53
It depends on what do you want to do.
|
|||
![]() |
|
comrade 27 Jun 2003, 23:28
Should I follow JohnFound's code?
|
|||
![]() |
|
Tomasz Grysztar 28 Jun 2003, 08:49
Well, it was intended to be used just in that way.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.