codong RegisterSlot with reg and slot

This commit is contained in:
2020-03-01 12:42:28 +02:00
parent 64d860b2bf
commit 4643be0ae6
6 changed files with 74 additions and 69 deletions

View File

@ -14,8 +14,9 @@ module Risc
end
# Produce a SlotToReg instruction.
# Array and to are registers
# Array is a register
# index may be a Symbol in which case is resolves with resolve_index.
# a new regsister will be created as the result, ie the reg part for slot_to_reg
def self.slot_to_reg( source , array , index )
raise "Register #{array}" if RegisterValue.look_like_reg(array.symbol)
index = array.resolve_index(index) if index.is_a?(Symbol)