Fix precedence bugs, test on homework

This commit is contained in:
Jan-Niclas Loosen
2025-12-09 19:58:11 +01:00
parent 4e6f93b353
commit b3e20a52eb
6 changed files with 122 additions and 38 deletions

View File

@@ -145,10 +145,11 @@ class const(Instruction):
def toString(self): return super().toString()+"CONST "+str(self.k)
class store(Instruction):
def __init__(self, k, assigned_label=None):
def __init__(self, k, d, assigned_label=None):
super().__init__(assigned_label=assigned_label)
self.k=k
self.d=d
self.k = k
self.d = d
def execute(self,tram):
tram.stack[tram.spp(self.d,tram.pp,tram.fp)+self.k]=tram.stack[tram.top]