rubyx/lib/mom/instruction/instruction.rb

34 lines
716 B
Ruby
Raw Normal View History

module Mom
# Base class for MOM instructions
class Instruction
include Common::List
def to_risc(m)
Risc::Label.new(self.class.name, self.class.name + "_todo")
end
end
# A label with a name
class Label < Instruction
2017-08-30 16:21:13 +02:00
attr_reader :name
def initialize(name)
@name = name
end
def to_risc(compiler)
Risc::Label.new(self,name)
end
2017-08-30 16:21:13 +02:00
end
end
2018-03-13 08:00:51 +01:00
require_relative "basic_values"
require_relative "simple_call"
2017-09-14 15:07:02 +02:00
require_relative "dynamic_call"
2017-08-30 16:21:13 +02:00
require_relative "truth_check"
2017-09-14 15:07:02 +02:00
require_relative "not_same_check"
2017-08-30 16:21:13 +02:00
require_relative "jump"
require_relative "slot_load"
require_relative "return_sequence"
require_relative "message_setup"
require_relative "argument_transfer"