diff --git a/src/ram.py b/src/ram.py index 605aa0f..f28caa8 100644 --- a/src/ram.py +++ b/src/ram.py @@ -103,9 +103,10 @@ class Ram(object): Run machine to completion ''' while self.current < len(self.instr): - print(self.current) - print(*self.instr[self.current]['args']) + print(self.current+2) + #print(*self.instr[self.current]['args']) self.instr[self.current]['op'](self, *self.instr[self.current]['args']) + print(self.work_registers) def generate_graph(self): ''' diff --git a/src/stack.asm b/src/stack.asm index 9c06274..74b1047 100644 --- a/src/stack.asm +++ b/src/stack.asm @@ -58,7 +58,7 @@ JUMP(-38) // restart loop SUB(r6, 1, r9) // address symbol to copy on stack JE(r9, r5, -40) // inner loop condition, restart outer loop ADD(r11, 1, r11) -ADD(i@r11, i@r9) +ADD(i@r9, 0, r@r11) SUB(r9, 1, r9) JUMP(-4)