rubyx/lib/risc/instructions/reg_to_byte.rb
Torsten Ruger 4cc04787e9 remove Risc.resolve_to_index
mostly by using better typed registers,
which cleans up the code where it was used
2018-07-16 19:00:04 +03:00

21 lines
507 B
Ruby

module Risc
# RegToByte moves a byte into memory from a register.
# indexes are 1 based !
class RegToByte < Setter
end
# Produce a RegToByte instruction.
# from and to are translated (from symbol to register if neccessary)
# but index is left as is.
def self.reg_to_byte( source , from , to , index)
raise "Not register #{to}" unless RegisterValue.look_like_reg(to)
index = to.resolve_index(index) if index.is_a?(Symbol)
RegToByte.new( source, from , to , index)
end
end