fix ret_to_byte

by the now familiar unwrapping of args and wrapping of return
This commit is contained in:
Torsten Ruger
2018-04-01 22:16:17 +03:00
parent 1a19683e7d
commit 9efeb58061
3 changed files with 47 additions and 68 deletions

View File

@ -21,10 +21,12 @@ module Risc
compiler = compiler_for(:Word , :get_internal_byte , {at: :Integer})
source = "get_internal_byte"
me , index = compiler.self_and_int_arg(source)
compiler.reduce_int( source + " fix arg", index )
# reduce me to me[index]
compiler.add_byte_to_reg( source , me , index , me)
compiler.add_new_int(source, me , index)
# and put it back into the return value
compiler.add_reg_to_slot( source , me , :message , :return_value)
compiler.add_reg_to_slot( source , index , :message , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler.method
end