renamed program to boot_space, as in object_space at boot time. thats the way its going

This commit is contained in:
Torsten Ruger
2014-05-31 12:52:29 +03:00
parent c9c484f353
commit 3713d08748
16 changed files with 110 additions and 27 deletions

36
lib/core/array.rb Normal file
View File

@ -0,0 +1,36 @@
# this is not a "normal" ruby file, ie it is not required by crystal
# instead it is parsed by crystal to define part of the crystal that runs
class BaseObject
def _set_instance_variable(name , value)
end
def _get_instance_variable( name )
end
def _get_singleton_method(name )
end
def _add_singleton_method(method)
end
def initialize
end
end
class Array < BaseObject
def initialize size
end
def at(index)
end
def set(index , value)
end
end

View File

@ -35,10 +35,10 @@ module Core
def putint context , arg = Vm::Integer
putint_function = Vm::Function.new(:putint , [arg] , arg )
buffer = Vm::StringConstant.new(" ") # create a buffer
context.program.add_object buffer # and save it (function local variable: a no no)
context.object_space.add_object buffer # and save it (function local variable: a no no)
int = putint_function.args.first
moved_int = putint_function.new_local
utoa = context.program.get_or_create_function(:utoa)
utoa = context.object_space.get_or_create_function(:utoa)
b = putint_function.body
b.mov( moved_int , int ) #move arg up
#b.a buffer => int # string to write to