add more functionality to get while to work (not there yet)

This commit is contained in:
Torsten Ruger
2014-05-14 11:33:23 +03:00
parent 2230a4f25e
commit d50c38f5ad
6 changed files with 46 additions and 23 deletions

View File

@ -13,13 +13,17 @@ module Vm
def load_args into
args.each_with_index do |arg , index|
puts "load " + arg.inspect
arg.load( into , index )
if arg.is_a? IntegerConstant
Vm::Integer.new(index).load into , arg
else
raise "no #{arg.inspect}" if arg.register != index
#arg.load( into , index )
end
end
end
def do_call into
into.add_code CMachine.instance.function_call into , self
CMachine.instance.function_call into , self
end
end
end

View File

@ -66,6 +66,9 @@ module Vm
def plus block , right
CMachine.instance.integer_plus block , self , right
end
def minus block , right
CMachine.instance.integer_minus block , self , right
end
def load block , right
CMachine.instance.integer_load block , self , right