flat assembler
Message board for the users of flat assembler.
Index
> Windows > Symbol already defined. How come? |
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 |
|||
27 Jun 2003, 06:05 |
|
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. |
|||
27 Jun 2003, 09:21 |
|
comrade 27 Jun 2003, 21:38
So what should I do? |
|||
27 Jun 2003, 21:38 |
|
Tomasz Grysztar 27 Jun 2003, 21:53
It depends on what do you want to do.
|
|||
27 Jun 2003, 21:53 |
|
comrade 27 Jun 2003, 23:28
Should I follow JohnFound's code?
|
|||
27 Jun 2003, 23:28 |
|
Tomasz Grysztar 28 Jun 2003, 08:49
Well, it was intended to be used just in that way.
|
|||
28 Jun 2003, 08:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.