rubyx/lib/register/instructions/branch.rb
Torsten Ruger f0611e52db work on branches
the concept is different in bosl, move appropriate to virtual
2015-10-07 10:02:51 +03:00

32 lines
462 B
Ruby

module Register
# a branch must branch to a block.
class Branch < Instruction
def initialize source , to
super(source)
raise "No block" unless to
@block = to
end
attr_reader :block
def to_s
"Branch: #{block.name}"
end
alias :inspect :to_s
end
class IsZeroBranch < Branch
end
class IsNegativeBranch < Branch
end
class IsPositiveBranch < Branch
end
class AlwaysBranch < Branch
end
end