move all arm instructions to own folder and fold inheritance
This commit is contained in:
27
lib/arm/instruction.rb
Normal file
27
lib/arm/instruction.rb
Normal 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"
|
Reference in New Issue
Block a user