rubyx/lib/risc/instructions/operator_instruction.rb
Torsten Ruger aa79e41d1c rename register to risc
seems to fit the layer much better as we really have a very reduced
instruction set
2017-01-19 09:02:29 +02:00

22 lines
450 B
Ruby

module Risc
class OperatorInstruction < Instruction
def initialize source , operator , left , right
super(source)
@operator = operator
@left = left
@right = right
end
attr_reader :operator, :left , :right
def to_s
"OperatorInstruction: #{left} #{operator} #{right}"
end
end
def self.op source , operator , left , right
OperatorInstruction.new source , operator , left , right
end
end