class Metasm::Instruction

an instruction: opcode name + arguments

Attributes

args[RW]

arguments (cpu-specific objects)

cpu[RW]

reference to the cpu which issued this instruction (used for rendering)

opname[RW]

name of the associated opcode

prefix[RW]

hash of prefixes (unused in simple cpus)

Public Class Methods

new(cpu, opname=nil, args=[], pfx=nil, backtrace=nil) click to toggle source
# File metasm/main.rb, line 188
def initialize(cpu, opname=nil, args=[], pfx=nil, backtrace=nil)
        @cpu = cpu
        @opname = opname
        @args = args
        @prefix = pfx if pfx
        @backtrace = backtrace
end

Public Instance Methods

dup() click to toggle source

duplicates the argument list and prefix hash

# File metasm/main.rb, line 197
def dup
        Instruction.new(@cpu, (@opname.dup if opname), @args.dup, (@prefix.dup if prefix), (@backtrace.dup if backtrace))
end
render() click to toggle source
# File metasm/render.rb, line 37
def render
        @cpu.render_instruction(self)
end