adds set_byte interpreter test

This commit is contained in:
Torsten Ruger
2016-12-16 01:43:54 +02:00
parent b2579a2b82
commit 190a0ffa47
4 changed files with 73 additions and 13 deletions

View File

@ -134,11 +134,8 @@ module Register
index = get_register(@instruction.index)
end
if object.is_a?(Symbol)
if( index == 2 )
value = object.to_s.length
else
raise "Unsupported action, must convert symbol to word:#{object}"
end
raise "Must convert symbol to word:#{object}" unless( index == 2 )
value = object.to_s.length
else
value = object.get_internal_word( index )
end
@ -167,11 +164,8 @@ module Register
else
index = get_register(@instruction.index)
end
if object.is_a?(Symbol)
raise "Unsupported action, must convert symbol to word:#{object}"
else
value = object.get_char( index )
end
raise "Unsupported action, must convert symbol to word:#{object}" if object.is_a?(Symbol)
value = object.get_char( index )
#value = value.object_id unless value.is_a? Fixnum
set_register( @instruction.register , value )
true
@ -185,7 +179,7 @@ module Register
else
index = get_register(@instruction.index)
end
object.set_internal_byte( index , value )
object.set_char( index , value )
trigger(:object_changed, @instruction.array , index / 4 )
true
end