flat assembler
Message board for the users of flat assembler.
Index
> Main > restore label Goto page Previous 1, 2 |
Author |
|
DimonSoft 24 Aug 2020, 21:27
Roman wrote:
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? |
|||
24 Aug 2020, 21:27 |
|
revolution 24 Aug 2020, 22:53
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? |
|||
24 Aug 2020, 22:53 |
|
bitRAKE 25 Aug 2020, 05:28
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 _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
25 Aug 2020, 05:28 |
|
revolution 25 Aug 2020, 05:33
bitRAKE wrote:
Code: MyFunc: .ok: .done: |
|||
25 Aug 2020, 05:33 |
|
bitRAKE 25 Aug 2020, 05:38
revolution wrote: In fasm it is even simpler Having both is handy. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
25 Aug 2020, 05:38 |
|
DimonSoft 25 Aug 2020, 07:56
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. |
|||
25 Aug 2020, 07:56 |
|
Overclick 01 Oct 2020, 09:51
I fixed Tomasz's example:
Code: macro @@@ [t] { local anonymous label @f1 @b5 equ @b4 @b4 equ @b3 @b3 equ @b2 @b2 equ @b1 @b1 equ @f1 @f1 equ @f2 @f2 equ @f3 @f3 equ @f4 @f4 equ @f5 @f5 equ anonymous } Usage: Code: @@@: jmp @f2 @@@: jmp @f3 @@@: jmp @b2 @@@ ;colon is not necessary @@@: |
|||
01 Oct 2020, 09:51 |
|
bitRAKE 02 Oct 2020, 04:31
UTF8 is fun too, we can get graphic ...
Code: macro ↕ T& match L,↓ L T ↑. equ ↓ end match local A ↓. equ A end macro define ↓ ↕ _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
02 Oct 2020, 04:31 |
|
bitRAKE 02 Oct 2020, 13:57
DimonSoft wrote: 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. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
02 Oct 2020, 13:57 |
|
Overclick 02 Oct 2020, 17:19
bitRAKE wrote: UTF8 is fun too, we can get graphic ... Classical @@ is simple, but how simple is to use such symbols? Code: macro ↕ [t] { local anonymous label ↓ ↑ equ ↓ ↓ equ anonymous } Updated version of my one: Code: macro @@@ t& { local anonymous @f1=$ ;prevent mixing global and local labels that used dot @b5 equ @b4 @b4 equ @b3 @b3 equ @b2 @b2 equ @b1 @b1 equ @f1 @f1 equ @f2 @f2 equ @f3 @f3 equ @f4 @f4 equ @f5 @f5 equ anonymous match =: arg,t \{ arg \} } ; allow to run instruction next to label in line |
|||
02 Oct 2020, 17:19 |
|
bitRAKE 02 Oct 2020, 19:23
Overclick wrote: Classical @@ is simple, but how simple is to use such symbols? _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
02 Oct 2020, 19:23 |
|
Overclick 03 Oct 2020, 02:55
Every single IDE have some issues. The best for me is RadAsm 3 at the moment. Even if this project is dead for many years already it still doing exactly what I need. Not sure how programmable it is. Of course it is but nobody will tell me how ))
Why RadAsm: 1) Build in resource editor, almost the best one. 2) Compiles everything include resources at same time. 3) Most stable, less annoying bugs. 4) Editable colour scheme, grouping, autocomplete etc. 5) Some useful tools on the board. ... Back to arrows... Isn't it too small to recognise on the code even if coloured? I was thinking to use single @ for the labels, but classical @@ have a sense on its size as it's the same as the caller's argument. Now I have triple jump to triple labels and it easy to read. |
|||
03 Oct 2020, 02:55 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.