get plus (+) working

alas, new integer is not created yet
This commit is contained in:
Torsten Ruger
2018-03-31 19:37:24 +03:00
parent a2173645b3
commit 5b92b6b785
3 changed files with 48 additions and 29 deletions

View File

@ -20,8 +20,8 @@ module Risc
compiler = compiler_for(:Integer,:+ ,{other: :Integer})
me , other = self_and_int_arg(compiler,source + "1")
# reduce me and other to integers
compiler.add_slot_to_reg( source + "2" , me , 2 , me)
compiler.add_slot_to_reg( source + "3", other , 2 , other)
compiler.add_slot_to_reg( source + "2" , me , Parfait::Integer.integer_index , me)
compiler.add_slot_to_reg( source + "3", other , Parfait::Integer.integer_index , other)
compiler.add_code Risc.op( source + "4", :+ , me , other)
#TODO must get an Integer and put the value there then return the integer (object not value)
# and put it back into the return value