flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
comrade 27 Oct 2005, 05:45
what are you expecting and what are you getting?
|
|||
![]() |
|
comrade 27 Oct 2005, 05:46
If you are talking about refering to .teste instead of Aloha.teste, then you might want to try the "local" keyword. However, I am not sure if it works outside of a macro
|
|||
![]() |
|
vid 27 Oct 2005, 08:21
comrade: it doesn't, there's no "local" for virtual.
but you shouldn't declare virtual inside some code namespace, place it somwhere where it doesn't matter. |
|||
![]() |
|
revolution 27 Oct 2005, 09:09
Try this:
Code: mov eax , .teste virtual at 0 ..Aloha: dd ? end virtual .teste: mov ebx,[..Aloha] |
|||
![]() |
|
Ancient One 27 Oct 2005, 13:22
that's not a bug.. label define inside virtual has the same rules outside it.. rev's solution should work.
|
|||
![]() |
|
KronosRJ 27 Oct 2005, 15:39
I was thinking of something like:
xpto: ;//This would be my function mov eax , .ret ;//In here, I would use some macros for parameters and local variables, using virtual virtual at 0 Aloha: .data1 dd ? end virtual .ret: ret[/quote][/code] |
|||
![]() |
|
KronosRJ 27 Oct 2005, 15:40
What does the '..' do to the label definition inside the virtual declaration?
|
|||
![]() |
|
vid 27 Oct 2005, 21:28
".." means that label won't overwrite current namespace:
Code: a: ..b: .c: ;this is a.c, not ..b.c i still don't know what you want. are you sure you understand "virtual" right? |
|||
![]() |
|
KronosRJ 30 Oct 2005, 02:31
Yes, but, since virtual stablishes a new section, it's labels should not 'break' the proc's labels...
I am inside a proc, named MyProc ... I created a macro that uses virtual to create local labels (Yes, I know that it has already been done, but I wanted to create use only code I could be sure to understand), and they use a pure label and the dot notation internally... I imagined that, since the label inside the virtual isn't really there (it is outside the proc's address), it should not cut the proc's label mechanism... Have I been clear enough? |
|||
![]() |
|
Tomasz Grysztar 30 Oct 2005, 09:28
The "." mechanism (like "@@", too) is processed by the parser, before the assembly stage - the "virtual" and other such directives have no meaning yet at that time. The parser just attaches name beginning with dot to the last "global label" - that is the one not starting with dot - it met to be defined. At the assembly stage it may become modified in many different ways, but the parsing is already done. For example:
Code: if 0 Alpha: end if .a: virtual .b: end virtual after parsing becomes something like: Code: if 0 Alpha: end if Alpha.a: virtual Alpha.b: end virtual and even though when the assembler processes it "Alpha" itself never actually gets defined, the parsing has already been done this way. This mechanism of "locals" was taken from NASM for its simplicity; for "true" locals you might look for some macro solutions (like the "proc" macro package for Win32, or something like http://board.flatassembler.net/topic.php?t=3744) |
|||
![]() |
|
KronosRJ 03 Nov 2005, 01:05
Thanks everybody.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.