flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Is there a way to overload simple labels?

Author
Thread Post new topic Reply to topic
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 01 May 2006, 14:04
It's just a minor question.

Well, say I want to overload the labels. I can use a macro to overload the "label" directive, it's no problem.

but what if I wanna overload simple labels like:

Code:
just_a_label:
  ; some code    
I know I can use
Code:
label just_a_label:
  ; some code    
but the code gets a bit messy with all that "label" there.

I tried with 'struc', but I can't use the name ':'.
Post 01 May 2006, 14:04
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7103
Location: Slovakia
vid 01 May 2006, 21:12
i believe structure cannot be named ":" so you can't. you must find other solution
Post 01 May 2006, 21:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 02 May 2006, 00:07
What exactly do you mean by "overload" ?
Post 02 May 2006, 00:07
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 03 May 2006, 15:43
Well, you can 'overload' instructions if you use the same name.

Code:
macro mov p1*, p2*
{
 ; ...
}    

And of course, you can overload the 'label' directive too (if you use the name 'label'). I want to add some things there, but I don't know how to do it with simple labels, like:
Code:
simple_label:    
instead of
Code:
label just_a_label    
or something like that Smile
Post 03 May 2006, 15:43
View user's profile Send private message Reply with quote
Ancient One



Joined: 28 Feb 2005
Posts: 55
Ancient One 22 May 2006, 07:54
Quote:

Well, you can 'overload' instructions if you use the same name.

Code:
Code: 
macro mov p1*, p2* 
{ 
 ; ... 
} 
    


this is "override" since we can only call the latest "mov" definition.
Post 22 May 2006, 07:54
View user's profile Send private message MSN Messenger Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 22 May 2006, 15:24
Ancient One wrote:
this is "override" since we can only call the latest "mov" definition.

Not really, since you can use some ifs inside the instruction and use the previous definition according to that condition, etc..

anyway, override, overload... I don't really make differences between them Very Happy
Post 22 May 2006, 15:24
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 22 May 2006, 15:49
I assume you're using the c++ terms and if so I think override would be the better term. I think we can say the mov instruction and most if not all instructions are already overloaded. They work with different parameters, registers, memory etc.

_________________
silkodyssey
Post 22 May 2006, 15:49
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.