View Single Post
Old 03 December 2020, 11:22   #11
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
Quote:
Originally Posted by meynaf View Post
The 6502, huh ? There programs are small. Too different to validate anything regarding the 68k.
And your point is? Using proper labels and includes is even more important with larger programs on the 68k. If this holds true on the 6502, it holds true on the 68K as well.



Quote:
Originally Posted by meynaf View Post
I am using proper tools. Always have. We just don't agree on what proper tools are.
It is not you agaist me. It is more like "you against the rest of the world". The rest of the world uses include files, and makefiles to structure projects.




Quote:
Originally Posted by meynaf View Post
Again, this is amiga asm, not big corpo project.
So you are sloppy? Why not do it the right way right away?



Quote:
Originally Posted by meynaf View Post
And now, makefiles. This is leading nowhere.
Makefiles are a great tool. Not only to structure code, but also generate various targets and even documenation. Seems you never used them, or never had a project that was complex enough.





Quote:
Originally Posted by meynaf View Post

Praticioners of other languages are irrelevant here.
So, in how far does it matter whether it is 6502 assembler or 68K assembler? The problem is all the same. A low level language needs better tools. Writing out label names helps.




Quote:
Originally Posted by meynaf View Post
I was speaking about the program itself, not the assembling process.
Don't you think that the program gets *larger* by introducing a lot of obvious, but useless comments if you would have used proper style in first place?




Quote:
Originally Posted by meynaf View Post
Should be very easy - something makes me think you're not doing a lot of asm anyway.
Just the reverse. Because I am doing a lot of asm, I know what works. Putting numbers instead of labels is a big no-no. Actually, I started with asm. First 6502, then 68K.




Quote:
Originally Posted by meynaf View Post
But i can do the same for you for this whole story : the information is there, and its location (instruction or comment) is totally irrelevant.
(It would be important in a strong typed language, but here we're doing asm.)
No, the label information is *not* irrelevant. It is relevant to the reader. The resulting *binary* is identical, it is just more obvious why it does what it does, plus it is easier to change.




Quote:
Originally Posted by meynaf View Post
Me, inexperienced ? What a garbage you've just written.
Well, apparently, now that you talk such a lot of "garbadge". This is not only against "my wisdom", but against the wisdom of many others.




Quote:
Originally Posted by meynaf View Post
If i find a bug, i hunt the bug. No problem.
So either your algorithms are trivial ,or you spend a lot of time with hunting down "the right numbers".




Quote:
Originally Posted by meynaf View Post
Professional code that's easy to maintain ? I want to see that.
That is the *professional* part of it, right? Not only getting things working, but also getting it done efficiently. Apparently, you haven't done that either?




Quote:
Originally Posted by meynaf View Post
In the same way it is better to do :
 jsr -$228(a6)            ; OpenLibrary

than :
 jsr LVOOpenLibrary(a6)
*puke*.


Drop the comment. Put the name right into the call.





Quote:
Originally Posted by meynaf View Post
And this, because it is more readable.
No, harder. Because there is useless information in the code such as the offset. Why should I bother about the -$228? That's useless information.








Quote:
Originally Posted by meynaf View Post
Another benefit of using the numbers is that you end up knowing the most common ones.
And why is that relevant for anything?





Quote:
Originally Posted by meynaf View Post
And this is invaluable when debugging code you don't have the sources for.
Any debugger worth its money will put in the right names for the LVOs. So it is even less useful in this case.




Quote:
Originally Posted by meynaf View Post
On the Amiga i am able to enter any program and do alterations in it.

This counts a lot against the small detail of using the name in the instruction or in the comment.
No, it just means that you confuse "reverse engineering" with "engineering".








Quote:
Originally Posted by meynaf View Post
There are things you regard as good practices and things you regard as bad practices.
But you seem to be overgeneralizing this.
That is not "me regarding something as...", but "the field in general. More than just me. Actually, almost everybody writing programs. Just take a book on assembly, read it there. Like the one I quoted. You seem like a person running on the same side of the road, and wondering why everybody else is doing wrong. Sorry, *you* are on the wrong side.




Quote:
Originally Posted by meynaf View Post
Me, i am more pragmatic.
This is exactly not pragmatic. It is "I am used to it because I started from the wrong end and cannot change my style anymore". Try to change, and you will see the advantage.




Quote:
Originally Posted by meynaf View Post
When something is the right tool for the current job, i use it.
Nope.




Quote:
Originally Posted by meynaf View Post
This is what differentiates good programmers from average or bad ones.
Yup, here we have a prime example of a bad one. You not using the tools properly.




Quote:
Originally Posted by meynaf View Post
I started on 6502 and i do now know of this guy's work.
Anyway, 6502 and 68k are different beasts.
Sure they are different from the architecture, but general style rules apply to both. So what's wrong with Zaks' advice to use "telling names" instead of numbers? Did you actually read this?




Quote:
Originally Posted by meynaf View Post
Apparently the users of my programs don't agree with this.
So, what are your programs anyhow? And how can the users tell what you did in your assembler.





Quote:
Originally Posted by meynaf View Post
You just don't know how to code and you want to teach lessons to me ? Beat it.
*Cough* I guess I did enough for this platform.




Quote:
Originally Posted by meynaf View Post
You think you know better ? Explain. Why would it be so bad ?
I already said. Harder to read, harder to maintain.





Quote:
Originally Posted by meynaf View Post
(And it is what will figure in the executable anyway.)
The name does not give any info the comment does not give.
So drop the comment and let the code speak for itself. Use the comment for things worth commenting. I already said that. Comment on *why* you are doing things, not *what* you are doing. That is exactly the advice you find in Zaks' book, in case you care.




Quote:
Originally Posted by meynaf View Post

We are not dependent on external includes, which can not have bad consequences.
So what exactly is the *bad part* about includes? If they change, you reassemble the program. Actually, the makefile does. That is the point. Assemble-time does not matter these days.






Quote:
Originally Posted by meynaf View Post
Frankly, i've just put a number instead of a name and this is gonna have a catastrophic impact ? This is totally irrealistic.
It can become catastrophic if the number is wrong, or you got confused. How do you know that the numbers are all correct? How do you extract these numbers? Why not just let the computer do that job, and get it done without errors?
Thomas Richter is offline  
 
Page generated in 0.08065 seconds with 11 queries