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/assembler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/assembler.py') diff --git a/src/assembler.py b/src/assembler.py index fc7bc45..4e82deb 100755 --- a/src/assembler.py +++ b/src/assembler.py @@ -67,7 +67,10 @@ for line in result4.lines: if len(result) < 2 * line.address + 1: result.extend((2 * line.address + 1 - len(result)) * nop) - print(f"{line.address:>08x} 0x{line.word:>04x} {line.text}") + out_line = f"{line.address:>08x} 0x{line.word:>04x} {line.text}" + out_spaces_n = (42 - len(out_line)) + out_spaces = out_spaces_n * " " if out_spaces_n > 0 else 4 * " " + print(f"{out_line}{out_spaces}{line.original_text}") result[2 * line.address + 0] = ((line.word >> 8) & 0xff) result[2 * line.address + 1] = ((line.word >> 0) & 0xff) -- cgit v1.3