diff --git a/assembler.py b/assembler.py index 3c4be15..87e0177 100644 --- a/assembler.py +++ b/assembler.py @@ -33,6 +33,10 @@ def _parse_asm_file(self, file: TextIOWrapper) -> Generator[list, None, None]: tokens = line.split() mnemonic = tokens[0].upper() + + if mnemonic in ArgOpcode.__members__ and len(tokens)>2: + raise UnexpectedArgumentError(mnemonic, raw_line_num) + argument = tokens[1] if len(tokens) >= 2 else None yield [raw_line_num, line_num, mnemonic, argument]