Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
miasm2.arch.sh4.arch.sh4_dgpreg_imm Class Reference
+ Inheritance diagram for miasm2.arch.sh4.arch.sh4_dgpreg_imm:
+ Collaboration diagram for miasm2.arch.sh4.arch.sh4_dgpreg_imm:

Public Member Functions

def decode
 
def encode
 
def fromstring
 

Public Attributes

 expr
 
 value
 

Static Public Attributes

 parser = dgpregs_ir
 

Detailed Description

Definition at line 221 of file arch.py.

Member Function Documentation

def miasm2.arch.sh4.arch.sh4_dgpreg_imm.decode (   self,
  v 
)

Definition at line 224 of file arch.py.

225  def decode(self, v):
226  p = self.parent
227  r = gpregs.expr[v]
228  s = self.sz
229  d = ExprInt32(p.disp.value * s / 8)
230  e = ExprMem(r + d, s)
231  self.expr = e
232  return True

+ Here is the call graph for this function:

def miasm2.arch.sh4.arch.sh4_dgpreg_imm.encode (   self)

Definition at line 233 of file arch.py.

234  def encode(self):
235  e = self.expr
236  p = self.parent
237  s = self.sz
238  if not isinstance(e, ExprMem):
239  return False
240  if isinstance(e.arg, ExprId):
241  v = gpregs.expr.index(e.arg)
242  p.disp.value = 0
243  elif isinstance(e.arg, ExprOp):
244  res = MatchExpr(e, ExprMem(jra + jrb, self.sz), [jra, jrb])
245  if not res:
246  return False
247  if not isinstance(res[jra], ExprId):
248  return False
249  if not isinstance(res[jrb], ExprInt):
250  return False
251  d = int(res[jrb].arg)
252  p.disp.value = d / (s / 8)
253  if not res[jra] in gpregs.expr:
254  return False
255  v = gpregs.expr.index(res[jra])
256  else:
257  return False
258  self.value = v
259  return True
260 

+ Here is the call graph for this function:

def miasm2.arch.sh4.arch.sh4_dgpreg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 158 of file arch.py.

159  def fromstring(self, s, parser_result=None):
160  start, stop = super(sh4_dgpreg, self).fromstring(s, parser_result)
161  if start is None:
162  return start, stop
163  self.expr = ExprMem(self.expr.arg, self.sz)
164  return start, stop

Member Data Documentation

miasm2.arch.sh4.arch.sh4_dgpreg_imm.expr

Definition at line 230 of file arch.py.

miasm2.arch.sh4.arch.sh4_dgpreg_imm.parser = dgpregs_ir
static

Definition at line 222 of file arch.py.

miasm2.arch.sh4.arch.sh4_dgpreg_imm.value

Definition at line 257 of file arch.py.


The documentation for this class was generated from the following file: