rubyx/lib/register/instructions/set_slot.rb

17 lines
521 B
Ruby

module Register
# offset memory set access
# so the value must be given as the first register
# the second argument holds the base address
# and the third a possible (small) offset into the "object"
#
# if for example the value is pointed to by a register, a VariableGet (load) is needed first
class SetSlot < Instruction
def initialize value , reference , index = 0
@value = value
@reference = reference
@index = index
end
attr_accessor :value , :reference , :index
end
end