class Ronin::ASM::Instruction

Represents an instruction.

Public Class Methods

new(name,operands) click to toggle source

Initializes the instruction.

@param [Symbol] name

The instruction name.

@param [Array<MemoryOperand, Register, Symbo, Integer>] operands

Operands for the instruction.
Calls superclass method
# File lib/ronin/asm/instruction.rb, line 40
def initialize(name,operands)
  operands = operands.map do |op|
    case op
    when Integer, nil then ImmediateOperand.new(op)
    else                   op
    end
  end

  super(name,operands)
end

Public Instance Methods

width() click to toggle source

The word size of the instruction.

@return [Integer, nil]

The word size in bytes.
# File lib/ronin/asm/instruction.rb, line 57
def width
  self.operands.map { |op|
    op.width if op.respond_to?(:width)
  }.compact.max
end