Chromatix's point is based on simple assemblers.
My assembler (which is NOT an '816 assembler) will do as he suggests. If the value of the operand is <= $FF, the instruction (if possible) will trend toward a Zero Page addressing mode. For my purposes, this has not been an issue.
If you do:
Code:
LABEL = $0000
LDA LABEL
My assembler just sees zero, and makes it Zero Page.
Mind, my assembler is about a week totals work.
BDDs point is (apparently) that the size of the value of an expression is implicit in how the expression is represented in the assembler.
Code:
$00 = 8 bit
$0000 = 16 bit
$000000 = 24 bit
Much like:
Code:
int i = 100L;
in C will give a warning (because 100L is a long constant), in a "proper" assembler, the argument size should be conveyed based on the constant used.
Thus:
Code:
LABEL1 = $00
LDA LABEL1
LABEL2 = $0000
LDA LABEL2
LABEL3 = $000000
LDA LABEL3
should all "do the right thing".
Chromatix's point, also, is that when you see:
Code:
LDA XXX
You don't know what it will assemble to unless you know the value of XXX. I don't necessarily think that's a bad thing.
I think much of the problems can be mitigated with some type checking and warnings at assembly time, as well as typed expressions. If you add a value to an 8-bit expression, and it overflows, it should, perhaps, cause a warning and truncate rather than promote the value to 16-bits. Base the value of an expression on the type of the first element in the expression.