adding sources to register instructions

This commit is contained in:
Torsten Ruger
2015-07-27 12:13:39 +03:00
parent f91c9fabe8
commit 36f635f7c1
16 changed files with 55 additions and 47 deletions

View File

@ -17,7 +17,8 @@ module Register
# If you had a c array and index offset
# the instruction would do array[index] = register
# So SetSlot means the register (first argument) moves to the slot (array and index)
def initialize register , array , index
def initialize source , register , array , index
super(source)
@register = register
@array = array
@index = index
@ -35,11 +36,11 @@ module Register
# Produce a SetSlot instruction.
# From and to are registers or symbols that can be transformed to a register by resolve_to_register
# index resolves with resolve_index.
def self.set_slot from , to , index
index = resolve_index( to , index)
def self.set_slot source , from , to , index
from = resolve_to_register from
index = resolve_index( to , index)
to = resolve_to_register to
SetSlot.new( from , to , index)
SetSlot.new( source, from , to , index)
end
end