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