diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2022-01-27 01:45:11 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2022-01-27 03:01:42 +0100 |
| commit | fa8969c6b0ef432aa2c87dc2d034523cec88e79d (patch) | |
| tree | 5debc77519b8524859f1306ff08570a4f6891f3d /lab1ucode.py | |
| parent | f913518b66fdd0b48420161d4f2114699b466d18 (diff) | |
| download | tsea83-fa8969c6b0ef432aa2c87dc2d034523cec88e79d.tar.gz | |
update makefile
Diffstat (limited to 'lab1ucode.py')
| -rw-r--r-- | lab1ucode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lab1ucode.py b/lab1ucode.py index 07b24f6..19d59c2 100644 --- a/lab1ucode.py +++ b/lab1ucode.py @@ -177,7 +177,9 @@ def write(prog, labels): "bge", "beq", ] - inst_locations = "\n".join([f"{i:02x}: {labels[inst]:02x}" for i, inst in enumerate(insts)]) + inst_pad = 0x10 - len(insts) + inst_locations = "\n".join([f"{i:02x}: {labels[inst]:02x}" for i, inst in enumerate(insts)] + + [f"{n+len(insts):02x}: 00" for n in range(inst_pad)]) print("MyM:") print(ucode) |
