From da14e7ca7f31cb4b9a975dbe349fb4d385592b9c Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 11 Apr 2023 14:05:41 +0300 Subject: Fix bugs --- src/asm_pass4.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/asm_pass4.py') diff --git a/src/asm_pass4.py b/src/asm_pass4.py index 96d9e65..926b354 100644 --- a/src/asm_pass4.py +++ b/src/asm_pass4.py @@ -9,6 +9,7 @@ class Result4Line: address: int word: int text: str + original_text: str @dataclass class Result4: @@ -35,6 +36,7 @@ def pass_4(result3: Result3) -> Result4: args = list(map(lambda a: translate_opt(a, result3.options), args)) text = " ".join([keyword, *args]) + original_text = " ".join(line.original_parts) if keyword in operations: fn = operations[keyword] @@ -44,6 +46,7 @@ def pass_4(result3: Result3) -> Result4: address=line.address, word=word, text=text, + original_text=original_text, )) else: try: @@ -52,10 +55,13 @@ def pass_4(result3: Result3) -> Result4: address=line.address, word=eval_expr(result3.labels, keyword), text=text, + original_text=original_text, )) except: raise Exception(f"Invalid assembly at {line.line_num + 1}\n\n{line}") + address += 1 + return Result4( operations=result3.operations, labels=result3.labels, -- cgit v1.3