rubyx/lib/arm/logic_instruction.rb

26 lines
634 B
Ruby
Raw Normal View History

require_relative "logic_helper"
2014-05-03 21:18:04 +02:00
module Arm
class LogicInstruction < Vm::LogicInstruction
include Arm::Constants
include LogicHelper
2014-05-07 13:58:38 +02:00
def initialize(attributes)
super(attributes)
@attributes[:update_status_flag] = 0 if @attributes[:update_status_flag] == nil
@attributes[:condition_code] = :al if @attributes[:condition_code] == nil
@operand = 0
@rn = nil
@i = 0
@rd = @attributes[:left]
end
attr_accessor :i, :rn, :rd
2014-05-06 20:36:28 +02:00
# Build representation for source value
def build
@rn = @attributes[:right]
do_build @attributes[:extra]
2014-05-06 20:36:28 +02:00
end
end
end