metasm/cpu/mcs51/main.rb in metasm-1.0.3 vs metasm/cpu/mcs51/main.rb in metasm-1.0.4

- old
+ new

@@ -35,20 +35,27 @@ def self.from_str(s) new(S_TO_I[s]) end + def symbolic(di=nil) + to_s.to_sym + end end class Immediate def initialize(value) @value = value end def to_s "#" + @value.to_s end + + def symbolic(di=nil) + Expression[@value] + end end class Memref attr_accessor :base, :offset def initialize(base, offset) @@ -56,9 +63,13 @@ @offset = offset end def to_s @base ? "@" + @base.to_s : @offset.to_s + end + + def symbolic(di=nil) + Indirection[(@base || @offset), 1, (di.address if di)] end end def initialize super()