diff --git a/src/ram.py b/src/ram.py index 6f2ede0..97c51ba 100644 --- a/src/ram.py +++ b/src/ram.py @@ -42,8 +42,9 @@ class Ram(object): if len(self.output_registers) <= index: self.output_registers.extend([None] * (index + 1 - len(self.output_registers))) # extend with uninitialized values self.output_registers[index] = value + elif type == "value": + raise TypeError("cannot write on value") elif type == "reference": target_index = self.read_register(ref_origin, index) self.write_register(ref_target, target_index, value) - # def op(self, type_r1, index_r1, type_r2, index_r2, type_r3, index_r3)