diff --git a/lib/asm/arm_assembler.rb b/lib/asm/arm_assembler.rb index 3ae83479..6bde6312 100644 --- a/lib/asm/arm_assembler.rb +++ b/lib/asm/arm_assembler.rb @@ -11,7 +11,7 @@ module Asm class ArmAssembler - InstructionTools::REGISTERS.each do |reg , number| + ArmMachine::REGISTERS.each do |reg , number| define_method(reg) { Asm::Register.new(reg , number) } end @@ -50,7 +50,7 @@ module Asm define_method(inst.to_s+'s') do |*args| instruction clazz , inst.to_s+'s' , *args end - InstructionTools::COND_CODES.keys.each do |cond_suffix| + ArmMachine::COND_CODES.keys.each do |cond_suffix| suffix = cond_suffix.to_s define_method(inst.to_s + suffix) do |*args| instruction clazz , inst + suffix , *args diff --git a/lib/asm/instruction_tools.rb b/lib/asm/arm_machine.rb similarity index 99% rename from lib/asm/instruction_tools.rb rename to lib/asm/arm_machine.rb index a6368110..1298c88f 100644 --- a/lib/asm/instruction_tools.rb +++ b/lib/asm/arm_machine.rb @@ -1,6 +1,6 @@ module Asm - module InstructionTools + module ArmMachine OPCODES = { :adc => 0b0101, :add => 0b0100, :and => 0b0000, :bic => 0b1110, diff --git a/lib/asm/instruction.rb b/lib/asm/instruction.rb index 6f7484a7..cab56ff4 100644 --- a/lib/asm/instruction.rb +++ b/lib/asm/instruction.rb @@ -1,6 +1,6 @@ require_relative "label" require_relative "assembly_error" -require_relative "instruction_tools" +require_relative "arm_machine" module Asm @@ -13,7 +13,7 @@ module Asm # Argurments are registers or labels or string/num Literals class Instruction < Code - include InstructionTools + include ArmMachine COND_POSTFIXES = Regexp.union( COND_CODES.keys.collect{|k|k.to_s} ).source @@ -37,7 +37,7 @@ module Asm attr_reader :opcode, :args # Many arm instructions may be conditional, where the default condition is always (al) - # InstructionTools::COND_CODES names them, and this attribute reflects it + # ArmMachine::COND_CODES names them, and this attribute reflects it attr_reader :cond attr_reader :operand diff --git a/lib/asm/logic_instruction.rb b/lib/asm/logic_instruction.rb index 0432d6eb..790a8d06 100644 --- a/lib/asm/logic_instruction.rb +++ b/lib/asm/logic_instruction.rb @@ -3,7 +3,6 @@ module Asm # Logic ,Maths, Move and compare instructions (last three below) class LogicInstruction < Instruction - include Asm::InstructionTools def initialize( opcode , args) super(opcode , args) diff --git a/lib/asm/memory_instruction.rb b/lib/asm/memory_instruction.rb index cda69313..884b065e 100644 --- a/lib/asm/memory_instruction.rb +++ b/lib/asm/memory_instruction.rb @@ -4,7 +4,6 @@ module Asm # ADDRESSING MODE 2 # Implemented: immediate offset with offset=0 class MemoryInstruction < Instruction - include Asm::InstructionTools def initialize(opcode , args) super( opcode , args ) diff --git a/lib/asm/stack_instruction.rb b/lib/asm/stack_instruction.rb index ce31130f..80a6c477 100644 --- a/lib/asm/stack_instruction.rb +++ b/lib/asm/stack_instruction.rb @@ -3,7 +3,6 @@ require "asm/instruction" module Asm # ADDRESSING MODE 4 class StackInstruction < Instruction - include Asm::InstructionTools def initialize(opcode , args) super(opcode,args)