use compiler to generate methods and their instructions

This commit is contained in:
Torsten Ruger
2015-10-28 21:37:42 +02:00
parent 99a695907c
commit 191be8d2f6
4 changed files with 33 additions and 33 deletions

View File

@ -3,10 +3,10 @@ module Register
module Word
module ClassMethods
def putstring context
function = MethodSource.create_method(:Word , :putstring , [] )
function.source.add_code Register.get_slot( function , :message , :receiver , :new_message )
Kernel.emit_syscall( function , :putstring )
function
compiler = Soml::Compiler.new.create_method(:Word , :putstring , [] ).init_method
compiler.add_code Register.get_slot( "putstring" , :message , :receiver , :new_message )
Kernel.emit_syscall( compiler , :putstring )
compiler.method
end
end
extend ClassMethods