From 09e77a2437eaef1883c330abe21c4287a9c3093a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 26 Jan 2022 21:46:46 +0100 Subject: ar & --- lab1ucode.out | 2 +- lab1ucode.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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" -- cgit v1.2.1