minor fixes

This commit is contained in:
Torsten Ruger 2018-04-02 19:31:08 +03:00
parent 65d57c8c7c
commit beb487eb09
4 changed files with 7 additions and 2 deletions

View File

@ -130,6 +130,10 @@ module Arm
ArmMachine.beq( code.label.to_cpu(self) ) ArmMachine.beq( code.label.to_cpu(self) )
end end
def translate_IsNotZero( code )
ArmMachine.bne( code.label.to_cpu(self) )
end
def translate_IsOverflow( code ) def translate_IsOverflow( code )
ArmMachine.bvs( code.label.to_cpu(self)) ArmMachine.bvs( code.label.to_cpu(self))
end end

View File

@ -45,7 +45,7 @@ module Risc
end end
def source_mini def source_mini
return "(no source)" unless source return "(no source)" unless source
return "(from: #{source[0..25]})" if source.is_a?(String) return "(from: #{source[0..35]})" if source.is_a?(String)
"(from: #{source.class.name.split("::").last})" "(from: #{source.class.name.split("::").last})"
end end
end end

View File

@ -79,6 +79,7 @@ module Risc
end end
return if old === val return if old === val
reg = reg.symbol if reg.is_a? Risc::RiscValue reg = reg.symbol if reg.is_a? Risc::RiscValue
val = Parfait.object_space.nil_object if( val == nil) #because that's what real code has
@registers[reg] = val @registers[reg] = val
trigger(:register_changed, reg , old , val) trigger(:register_changed, reg , old , val)
end end

View File

@ -93,7 +93,7 @@ module Risc
# for computationally building code (ie writing assembler) these short cuts # for computationally building code (ie writing assembler) these short cuts
# help to instantiate risc instructions and add them immediately # help to instantiate risc instructions and add them immediately
[:label, :reg_to_slot , :slot_to_reg , :load_constant, :load_data, [:label, :reg_to_slot , :slot_to_reg , :load_constant, :load_data,
:function_return , :function_call, :function_return , :function_call, :op ,
:transfer , :reg_to_slot , :byte_to_reg , :reg_to_byte].each do |method| :transfer , :reg_to_slot , :byte_to_reg , :reg_to_byte].each do |method|
define_method("add_#{method}".to_sym) do |*args| define_method("add_#{method}".to_sym) do |*args|
add_code Risc.send( method , *args ) add_code Risc.send( method , *args )