Couldn't think how to phrase the title :/
I'm writing a generic parser for 6502 assembler. The assembler I'm most familiar with is asm6 so it's based on that as much as anything. Anyway, the question I'd like to ask is whether it ever makes sense to accept syntax like:
that is, with the operand length being "excessive". It seems like every time I assume something must be completely wrong, someone provides a use (or should I say, abuse) case. I guess you could maybe use this to force bytes into the binary? In that case though you'd just use a directive.
Just asking because I'm writing the operand parts of the parser and I'm unsure whether to put a hard limit on operand lengths for operators -- $FFFF for most addressing modes and $FF for zero page modes. The latter I'm not as unsure about because the operand length is practically the definition of the addressing mode, and without it you'd be unable to distinguish from absolute and zero page.
Thanks
I'm writing a generic parser for 6502 assembler. The assembler I'm most familiar with is asm6 so it's based on that as much as anything. Anyway, the question I'd like to ask is whether it ever makes sense to accept syntax like:
Code:
LDA $42424242
that is, with the operand length being "excessive". It seems like every time I assume something must be completely wrong, someone provides a use (or should I say, abuse) case. I guess you could maybe use this to force bytes into the binary? In that case though you'd just use a directive.
Just asking because I'm writing the operand parts of the parser and I'm unsure whether to put a hard limit on operand lengths for operators -- $FFFF for most addressing modes and $FF for zero page modes. The latter I'm not as unsure about because the operand length is practically the definition of the addressing mode, and without it you'd be unable to distinguish from absolute and zero page.
Thanks