rubyx/lib/mom/instruction/jump.rb
Torsten Ruger 65d57c8c7c removing unconditional
just Branch is fine
2018-04-02 19:30:34 +03:00

21 lines
381 B
Ruby

module Mom
# Branch jump to the Label given
# Eg used at the end of while or end of if_true branch
#
# Risc equivalent is the same really, called Branch there.
#
class Jump < Instruction
attr_reader :label
def initialize(label)
@label = label
end
def to_risc(compiler)
Risc::Branch.new(self , @label.to_risc(compiler))
end
end
end