finally change List to derive from data object
can’t derive from data16 as some lists are longer have to get the delegation to work first
This commit is contained in:
@ -119,7 +119,7 @@ module Risc
|
||||
def super_class_names
|
||||
{ Data4: :DataObject , Data8: :DataObject ,Data16: :DataObject ,
|
||||
BinaryCode: :Data16 , Integer: :Data4, Word: :Data8 ,
|
||||
Object: :BasicObject}
|
||||
Object: :BasicObject , List: :Data16}
|
||||
end
|
||||
|
||||
# the function really just returns a constant (just avoiding the constant)
|
||||
|
@ -11,14 +11,14 @@ module Parfait
|
||||
|
||||
# 0 -based index
|
||||
def get_internal_word(index)
|
||||
return super if index < data_start
|
||||
return super if index < self.class.type_length
|
||||
@memory[index]
|
||||
end
|
||||
|
||||
# 1 -based index
|
||||
def set_internal_word(index , value)
|
||||
return super if index < data_start
|
||||
raise "Word[#{index}] = nil" if( value.nil? )
|
||||
return super if index < self.class.type_length
|
||||
raise "Word[#{index}] = nil" if( value.nil? and self.class != List)
|
||||
@memory[index] = value
|
||||
value
|
||||
end
|
||||
|
Reference in New Issue
Block a user