From 692e75d0d7976e6a3ea6562dda55830b5da176b1 Mon Sep 17 00:00:00 2001 From: Astha Shah Date: Fri, 12 Jan 2024 23:04:44 +0545 Subject: [PATCH] Added eor, lsl, rsl --- .DS_Store | Bin 0 -> 6148 bytes pyssemble/pyInstruction.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1a7006dde69ed1ce6671a9f49517e06bab7f57cb GIT binary patch literal 6148 zcmeHKO^ee&7=EYCx`~UBgTh{ffY(yDEa(<5-F_Sv)Wb&fpi-Mn(O{aXO}bqvg`V}t zh&TU;{ufXByfd?~on7%FA~J88dFJDJCe1U+OooU=cb>M0LL%~!7`^Mrt_beubSY}4 zWd|sDjH6thB)Lpb=K)BWidTQ}LTD$jt!vx9@9+38<2P~kdB%f?>G3T<+g*H==`kt46eJwGLX1sJ-7_tpfkn zox2Z?hi~&qAwS?Q5CSW!iW>&cfql8ci_>^k>>DkeTgR6?iM&MN)yjhzr1u U!L>%TAl!$5vcYA}fxqg&Pxs}**8l(j literal 0 HcmV?d00001 diff --git a/pyssemble/pyInstruction.py b/pyssemble/pyInstruction.py index 5600978..c503aa8 100644 --- a/pyssemble/pyInstruction.py +++ b/pyssemble/pyInstruction.py @@ -100,3 +100,33 @@ def __init__(self, *args): def execute(self): self.regs[self.rd] = self.val self.pc.step() + +class eor(RegInstruction): + func = lambda _, arg1, arg2: 0 if arg1 == arg2 else 1 + +class lsl(RegInstruction): + func = lambda _, __, arg, amt: arg << amt + +class rsl(RegInstruction): + func = lambda _, __, arg, amt: arg >> amt + +class asr(RegInstruction): + def func(_, arg, amt): + if arg >= 0: + return arg >> amt + else: + +class mul(RegInstruction): + func = lambda _, arg1, arg2: arg1 * arg2 #CHECK + +# class smull(RegInstruction) #INCOMPLETE + +# class umull(RegInstruction) + +# class B.cond(RegInstruction) + + + + + +