What is the correct way to create an array in Asm6?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: What is the correct way to create an array in Asm6?

Post by koitsu » Thu May 16, 2019 6:30 pm

My firm view is that no, the tool (assembler) should fail to assemble in the case it encounters a byte it cannot parse / is outside of allowed range.

Users, especially programmers, DO NOT like it when programs silently ignore things that cause problems or are invalid. The tool telling you "I can't deal with this; fix it!" is absolutely the way to go. Likewise, the tool (assembler) documentation should outline this fact by stating what its permitted byte range is for labels/values/whatever. (Decent software describes such things using what's called a BNF or ABNF -- you've probably seen at least one example in something somewhere, but they're common in RFCs. But it's perfectly OK to just say something like, for example: Labels must use alphanumeric and underscore bytes only (ASCII [0-9A-Za-z_]).)

Silent filtering of invalid data leads to an almost infinitesimal number of problem reports. Furthermore, failure to actually fix the problem (of invalid bytes/characters) in the code/file means that this file filled with issues can end up spreading from one person to the next via sharing file/code, resulting in a problem that would continue to exist throughout the rest of humanity's existence. (That got a little deep there, hahaha. Sorry. But it's actually quite true -- we're STILL dealing with aspects of this in other ways in computing today.)

That said: I certainly would agree that a vague/nebulous error message if invalid bytes/characters are used is not helpful. "Character/byte out of range", along with the hex value of the byte that was invalid and line number, are useful.

Post Reply