rubyx/lib/core/kernel.rb

29 lines
776 B
Ruby
Raw Normal View History

module Core
class Kernel
#there are no Kernel instances, only class methods.
2014-05-06 20:36:28 +02:00
# We use this module syntax to avoid the (ugly) self (also eases searching).
module ClassMethods
def main_start
#TODO extract args into array of strings
2014-05-13 16:06:42 +02:00
Vm::CMachine.instance.main_start
end
def main_exit
# Machine.exit mov r7 , 0 + swi 0
2014-05-13 16:06:42 +02:00
Vm::CMachine.instance.main_exit
end
def function_entry f_name
2014-05-13 16:06:42 +02:00
Vm::CMachine.instance.function_entry f_name
end
def function_exit f_name
2014-05-13 16:06:42 +02:00
Vm::CMachine.instance.function_exit f_name
end
2014-05-06 20:36:28 +02:00
def putstring
# should unwrap from string to char*
2014-05-13 16:06:42 +02:00
Vm::CMachine.instance.putstring
end
2014-05-02 07:02:25 +02:00
end
extend ClassMethods
2014-05-02 07:02:25 +02:00
end
end