Fix div10 and test

fix and use load_data (similar to load_constant)
and integrate into load_object when appropriate (ie for integers)
This commit is contained in:
2020-03-08 12:05:25 +02:00
parent bd02f69824
commit eed9ba082f
6 changed files with 85 additions and 45 deletions

View File

@ -22,7 +22,10 @@ module Risc
end
end
def self.load_data( source , constant , register )
LoadData.new( source , constant , register)
def self.load_data( source , value , register = nil )
raise "can only load integers, not #{value}" unless value.is_a?(Integer)
type = Parfait.object_space.get_type_by_class_name(:Integer)
register = RegisterValue.new( "fix_#{value}".to_sym , type ) unless register
LoadData.new( source , value , register)
end
end