adding sources to register instructions
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user