handle value type write
This commit is contained in:
parent
e3a803469c
commit
b36389841f
@ -42,8 +42,9 @@ class Ram(object):
|
|||||||
if len(self.output_registers) <= index:
|
if len(self.output_registers) <= index:
|
||||||
self.output_registers.extend([None] * (index + 1 - len(self.output_registers))) # extend with uninitialized values
|
self.output_registers.extend([None] * (index + 1 - len(self.output_registers))) # extend with uninitialized values
|
||||||
self.output_registers[index] = value
|
self.output_registers[index] = value
|
||||||
|
elif type == "value":
|
||||||
|
raise TypeError("cannot write on value")
|
||||||
elif type == "reference":
|
elif type == "reference":
|
||||||
target_index = self.read_register(ref_origin, index)
|
target_index = self.read_register(ref_origin, index)
|
||||||
self.write_register(ref_target, target_index, value)
|
self.write_register(ref_target, target_index, value)
|
||||||
|
|
||||||
# def op(self, type_r1, index_r1, type_r2, index_r2, type_r3, index_r3)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user