move all arm instructions to own folder and fold inheritance

This commit is contained in:
Torsten Ruger
2014-10-02 22:28:34 +03:00
parent 9923eb0b07
commit 1be71918a5
7 changed files with 158 additions and 36 deletions

27
lib/arm/instruction.rb Normal file
View File

@@ -0,0 +1,27 @@
module Arm
# The arm machine has following instruction classes
# - Memory
# - Stack
# - Logic
# - Math
# - Control/Compare
# - Move
# - Call class Instruction
class Instruction
def initialize options
@attributes = options
end
attr_reader :attributes
def opcode
@attributes[:opcode]
end
end
end
require_relative "constants"
require_relative "instructions/call_instruction"
require_relative "instructions/compare_instruction"
require_relative "instructions/logic_instruction"
require_relative "instructions/memory_instruction"
require_relative "instructions/move_instruction"
require_relative "instructions/stack_instruction"