flat assembler
Message board for the users of flat assembler.

Index > Main > restore label

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 197
Overclick
New unusual names is always getting pain. I don't think you have to worry about malfunction as you don't do anything extraordinary with it. It's simple macros to correct some things and it will work as default when your special parameter is not recognised jmp param.
Look at fasm include files, there is a real headache )) Especially proc which I wish to redesign someday. Especially ret inside that. Actually it have one exception like ret 0 to work as normal ret but your macros inside procedures never know abut that. You can use ZERO extension for all the time of course but I think it needs to be fixed.
Post 24 Aug 2020, 11:32
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 807
Location: Belarus
DimonSoft
Roman wrote:
Quote:

But I was more concerned about attempts to extend the anonymous labels feature and the consequences for the maintainability of the code that uses such extensions.

For this reason we need old style @f and @@
And new style %0 or %1 or %10000

Old code work fine because used old style @f and @@.
New code work good because used new style %
PS: And all happy Smile

And i test now in fasmw 1.73 this:
Code:
%2:
        jmp %2 
    

Work fine.

But not work if:
Code:
%2:
        jmp %2 
%2:
        jmp %2 
    

But what do you gain? Moving back in the direction of Basic or Focal language with meaningless line numbers? The world has moved 60 years forward from there by now and learned that identifiers serve better.

What would be a more useful thing, IMHO, is to have another kind of labels that allow duplication and are always resolved to the nearest one. In fact, that’s exactly what you suggest but without limiting them to numbers. But:
1) Nearest forward or backward one? (Note that even your example is ambiguous)
2) The same problems within macros as we now have with anonymous labels.
3) I guess, it could break the mechanism used by FASM to resolve the values.

And then there’s the rule of –100 points. How many real world tasks can not be solved with labels we have? And how many real world tasks will get solved if we have something like that implemented?
Post 24 Aug 2020, 21:27
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17624
Location: In your JS exploiting you and your system
revolution
I think it all stems from the fact that people are lazy to assign proper names.

So the solution is to stop being lazy, right?
Post 24 Aug 2020, 22:53
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3018
Location: vpcmipstrm
bitRAKE
I'm lazy. So, I enjoy the scoping features that fasmg has available. If I write some function and use common labels like "ok", "done", etc. I can just wrap it in a namespace to eliminate conflict in most cases:
Code:
MyFunc:
namespace MyFunc

ok:

done:

end namespace ; MyFunc    
I don't even need to think about labels - use single letters when I'm really lazy. I can always document in the future and give long_verbose_names - it has to work first. If I engineer an algorithm from the inside-out, or move stuff around names don't often make sense until the end anyway.

_________________
¯\(°_o)/¯ unlicense.org
Post 25 Aug 2020, 05:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17624
Location: In your JS exploiting you and your system
revolution
bitRAKE wrote:
Code:
MyFunc:
namespace MyFunc

ok:

done:

end namespace ; MyFunc    
In fasm it is even simpler:
Code:
MyFunc:

  .ok:

  .done:    
Use the dots folks.
Post 25 Aug 2020, 05:33
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3018
Location: vpcmipstrm
bitRAKE
revolution wrote:
In fasm it is even simpler
Same in fasmg.
Having both is handy.

_________________
¯\(°_o)/¯ unlicense.org
Post 25 Aug 2020, 05:38
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 807
Location: Belarus
DimonSoft
bitRAKE wrote:
I can always document in the future and give long_verbose_names - it has to work first. If I engineer an algorithm from the inside-out, or move stuff around names don't often make sense until the end anyway.

It’s not about long_verbose_names, it’s about MeaningfulNames. And since 1970s people tend to respect structured programming, so it’s highly unlikely any of the names changes significantly when some piece of code moves.

However, there’re 3 big problems in programming: proper naming and off-by-one errors.
Post 25 Aug 2020, 07:56
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.