9ab3de234d
for when i started the assembler div10 in the end i did the div10 in some, so no need
22 lines
460 B
Ruby
22 lines
460 B
Ruby
module Register
|
|
|
|
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
|
|
|
|
def self.op source , operator , left , right
|
|
OperatorInstruction.new source , operator , left , right
|
|
end
|
|
end
|
|
|
|
end
|