summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lab1ucode.out2
-rw-r--r--lab1ucode.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/lab1ucode.out b/lab1ucode.out
index 20e9804..3f5e6e8 100644
--- a/lab1ucode.out
+++ b/lab1ucode.out
@@ -28,7 +28,7 @@ prog:
1a: 0130000
1b: 0000180
1c: 0280000
-1d: 0200000
+1d: 0d00000
1e: 0130000
1f: 0000180
20: 0000780
diff --git a/lab1ucode.py b/lab1ucode.py
index 6c74130..e9b0fc1 100644
--- a/lab1ucode.py
+++ b/lab1ucode.py
@@ -89,6 +89,11 @@ def compile(lines):
tb = TB[other]
alu = "0101"
+ if "&" in fr:
+ other = fr.split("&")[0]
+ tb = TB[other]
+ alu = "0110"
+
if inst == "pc++":
p = "1"