rubyx/lib/virtual/instruction.rb

29 lines
922 B
Ruby
Raw Normal View History

module Virtual
2015-05-06 07:55:14 +02:00
# Instruction is an abstract for all the code of the object-machine.
# Derived classes make up the actual functionality of the machine.
# All functions on the machine are captured as instances of instructions
#
# It is actually the point of the virtual machine layer to express oo functionality in the set of
# instructions, thus defining a minimal set of instructions needed to implement oo.
2015-05-06 07:55:14 +02:00
2015-05-24 15:55:03 +02:00
class Instruction
2015-05-24 18:59:19 +02:00
def to_s
2015-06-19 11:29:41 +02:00
Sof.write(self)
2015-05-24 18:59:19 +02:00
end
end
end
2015-05-06 07:55:14 +02:00
require_relative "instructions/branch"
require_relative "instructions/halt"
require_relative "instructions/instance_get"
require_relative "instructions/message_send"
require_relative "instructions/method_call"
require_relative "instructions/method_enter"
require_relative "instructions/method_return"
require_relative "instructions/new_frame"
require_relative "instructions/new_message"
require_relative "instructions/set"