class Metasm::OpenRisc::Memref

Attributes

base[RW]
msz[RW]
offset[RW]

Public Class Methods

new(base, offset, msz) click to toggle source
# File metasm/cpu/openrisc/main.rb, line 39
def initialize(base, offset, msz)
        @base = base
        @offset = offset
        @msz = msz
end

Public Instance Methods

render() click to toggle source
# File metasm/cpu/openrisc/render.rb, line 24
def render
        off = @offset
        off = nil if off == Expression[0]
        r = []
        r << { 1 => 'byte ', 2 => 'word ', 4 => 'dword ', 8 => 'qword ' }[@msz]
        r << '['
        r << @base if @base
        r << '+' if @base and off
        r << off if off
        r << ']'
end
symbolic(di) click to toggle source
# File metasm/cpu/openrisc/main.rb, line 45
def symbolic(di)
        p = Expression[@base.symbolic] if base
        p = Expression[p, :+, @offset] if offset
        Indirection[p.reduce, @msz, (di.address if di)]
end