Bregalad wrote:
I've always used [] for indirection.
Could this be because you started with assemblers like nesasm that have funky syntax? I'm willing to bet that's why. Which is another reason why I don't like nesasm for this: it encourages people to fall into nonstandard practices.
My first introduction to 6502 came when I made my first NSF player, and in all documentation I read, in other sources I checked, and debuggers and trace logs I examined... not once did I ever see any indication that [] was for indirection.
This was my original point, actually. You said that "most" assemblers use [] for indirection, yet so far you've only listed two. I can list two that don't (ca65, x816) and can link you to countless other programs (debuggers, tracers, disassemblers) that don't, as well as page after page of documentation that don't.
Quote:
Altough it's true that an assembler can detect if an expression is surrounded by () and have no math arround it it means indirection, but the leads confusion.
[snip]
lda (3*4+12),Y would be ambigus. Is it math parenthesis (useless) or indirection parenthesis ? Most likely it's the second because there is no point in putting parenthesis, but well...
There's no perfect solution to this problem. But this is a somewhat unrealistic and not really that confusing. Nobody really encases
entire expressions in parenthesis because there's no point (or at least, nobody should). Like you say, math parenthesis here is useless.
And this is the only way there could be this confusion. Either parenthesis are totally useless, or they're indirection. So the simple way to avoid this confusion is just to not have totally useless parenthesis.
Quote:
Anyway I don't think either way makes that much difference. A '[' it to a '(' what a 'Z' is to a 'z' if you see what I mean.
It actually kind of does matter, because in other areas of the 65xx series, [] means something else entirely (long indirection)
lda (blah),Y ; normal indirection
lda [blah],Y ; long indirection
Both are legal in 65c816, and they both mean something different. Normal indirection () reads a 2 byte pointer, and long indirection [] reads a 3 byte pointer.
Granted this isn't applicable to the NES. But it enforces my point that ()
is the standard.
Quote:
The only real consern that comes into situation when comparing assembler is their features, such details shouldn't bother anyone who is at leastt *a little* open minded.
There's a lot to be said for following standards. And there's a lot of grief to be had for needlessly breaking them. () is the standard for indirection pretty much everywhere in the 6502 universe. For an assembler to stubbornly go against the standard for no real reason other than to avoid potential confusion is somewhat silly, and a big turnoff to me, personally.
; is standard for comments
. is standard for assembler directives
() is standard for indirection
Standards are a good thing. Breaking them is bad.
Can you imagine the flack a C compiler would get if it started breaking syntax standards like this? What if a C compiler came out that flipped the functionality of the [] and () symbols? What if a web browser came out that used {} instead of <> for html tags? They'd be burned at the stake... nobody would use them.