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_dpc32imm Class Reference
+ Inheritance diagram for miasm2.arch.sh4.arch.sh4_dpc32imm:
+ Collaboration diagram for miasm2.arch.sh4.arch.sh4_dpc32imm:

Public Member Functions

def decode
 
def calcdisp
 
def encode
 
def fromstring
 

Public Attributes

 expr
 
 value
 

Static Public Attributes

 parser = deref_pcimm
 

Detailed Description

Definition at line 335 of file arch.py.

Member Function Documentation

def miasm2.arch.sh4.arch.sh4_dpc32imm.calcdisp (   self,
  v 
)

Definition at line 343 of file arch.py.

344  def calcdisp(self, v):
345  v = (int(v.arg) - 4) / 4
346  if not 0 < v <= 0xff:
347  return None
348  return v
def miasm2.arch.sh4.arch.sh4_dpc32imm.decode (   self,
  v 
)

Definition at line 338 of file arch.py.

339  def decode(self, v):
340  self.expr = ExprMem(
341  (PC & ExprInt32(0xfffffffc)) + ExprInt32(v * 4 + 4))
342  return True
def miasm2.arch.sh4.arch.sh4_dpc32imm.encode (   self)

Definition at line 349 of file arch.py.

350  def encode(self):
351  res = MatchExpr(
352  self.expr, ExprMem((PC & ExprInt32(0xFFFFFFFC)) + jra, 32), [jra])
353  if not res:
354  return False
355  if not isinstance(res[jra], ExprInt):
356  return False
357  v = self.calcdisp(res[jra])
358  if v is None:
359  return False
360  self.value = v
361  return True
362 

+ 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_dpc32imm.expr

Definition at line 339 of file arch.py.

miasm2.arch.sh4.arch.sh4_dpc32imm.parser = deref_pcimm
static

Definition at line 336 of file arch.py.

miasm2.arch.sh4.arch.sh4_dpc32imm.value

Definition at line 359 of file arch.py.


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