Assembler: a string that spells an instruction is no longer assembled as one
A token is classified after its quotes have been stripped, so a string literal reading "ADD" looked exactly like the ADD instruction and was assembled as one. It failed with "attempting to assemble outside the Program Segment", a message about a mistake nobody had made. The literal and label checks were already guarded against strings and the instruction check was not. Mnemonics match without regard to case, so "or" and "and" were caught by this too, and those are ordinary enough words to want in a message. Third of its family, after a string beginning with '0' being read as a malformed number and a string in the Program Segment being silently discarded. All three have the same root. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
ca34e077ad
commit
be402cc9be
@@ -0,0 +1,3 @@
|
||||
ADD OR and NOP
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
Reference in New Issue
Block a user