flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Annonymous...

Author
Thread Post new topic Reply to topic
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 22 Dec 2006, 19:58
We can specify an annonymous forward, and annonymous backwards, we can declare the annonymous ones, but how do we go ahead and delete an annonymous label...? Anyone want to take a stab at this one? i searched high and low in the fasm docs, but found nothing.
Post 22 Dec 2006, 19:58
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Dec 2006, 22:07
there is no such posibility, and i bet you don't even really need it
Post 22 Dec 2006, 22:07
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 23 Dec 2006, 15:08
"Don't need" are the keyword, but it does help with nested macro. Since it's not actually doable (rather than undocumented), i'll drop the subject.
Post 23 Dec 2006, 15:08
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Dec 2006, 15:39
how does it help?
Post 23 Dec 2006, 15:39
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 23 Dec 2006, 16:51
If you're having trouble comming up with unique names... Take the following for example...

Code:
macro loopingthing args {
      @@:
      [insert code here]
      loop @@ }

@@:
[random code here]
loopingthing
[more random code here]
jmp @@ ;for the interface    


But, like said, it's not really needed but it can help. That thing using loopything could also have been a macro as well.

Now, of course, there is no real point to implimenting this if it's not already implimented. I was asking incase there was something i missed and it was already implimented.
Post 23 Dec 2006, 16:51
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Dec 2006, 17:01
Code:
macro loopingthing args {
local ..interfase, ..l2
      ..interfase: 
      [insert code here] 
      loop ..interfase} 

..l2: 
[random code here] 
loopingthing 
[more random code here] 
jmp ..interfase;for the interface}    


This macro will not interfere with any other label nor affect the scope. Some time ago there was a discution about adding even more annonymous label to be able to do thing like
Code:
@@:nop
@@@: xor eax, eax
jmp @b ; jumps to nop
jmp @@b ; jumps to xor eax, eax    
If you need it search it because I haven't got the link to it now Sad
Post 23 Dec 2006, 17:01
View user's profile Send private message Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 23 Dec 2006, 17:16
... hm... I just came up with an idea to use my passgen to come up with things as well... Local.... i think i read about it before and forgot about it. Setting anonymous (or something else) by local, it shouldn't become global, and then it dosn't loop to the internal part of the macro when using an annonymous label.

Quote:
The label whose name begins with dot is treated as local label, and its name is attached to the name of last global label (with name beginning with anything but dot) to make the full name of this label. So you can use the short name (beginning with dot) of this label anywhere before the next global label is defined, and in the other places you have to use the full name. Label beginning with two dots are the exception - they are like global, but they don't become the new prefix for local labels.


That is a bit unclear... Suppose i made a macros, and prefixed it with a . Would the new lable of the variable be "[insertmacronamehere].[insertnameofvariablehere]" or would it be something other than the macro name as a prefix label?

I guess we have two ways of going about this. lol It often helps to try to come up with more than one way to solve a problem.
Post 23 Dec 2006, 17:16
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Dec 2006, 17:30
The quoted text means this
Code:
jmp a    ; Works
; jmp .b ; Does not work
jmp a.b  ; Works
jmp ..c  ; Works
jmp a.d  ; Works
a:
.b:
jmp .d   ; Works
..c:
.d:    


If you just need that your labels inside the macro becomes invisible then use local and use labels prefixed with double dot to not break the current scope. The macro name doesn't define a label by itself so the macro name is not required to start with any dot.
Post 23 Dec 2006, 17:30
View user's profile Send private message Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 24 Dec 2006, 07:45
Well, i didn't know if the macro name counted as a label or not, thus why i asked.
Post 24 Dec 2006, 07:45
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.