fixing and testing operators

This commit is contained in:
Torsten Ruger
2015-10-15 09:32:47 +03:00
parent e436581ce8
commit 3d83f203ca
9 changed files with 69 additions and 33 deletions

View File

@ -184,7 +184,7 @@ module Interpreter
rr = @instruction.right
right = get_register(rr)
case @instruction.operator.to_s
when "add"
when "+"
result = left + right
when "/"
result = left / right
@ -198,7 +198,7 @@ module Interpreter
raise "unimplemented '#{@instruction.operator}' #{@instruction}"
end
puts "#{@instruction} == #{result}"
right = set_register(rr , result)
right = set_register(@instruction.left , result)
true
end
end