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

Public Member Functions

def decode
 
def calcdisp
 
def encode
 
def fromstring
 

Public Attributes

 expr
 
 value
 

Static Public Attributes

 parser = deref_pc
 

Detailed Description

Definition at line 286 of file arch.py.

Member Function Documentation

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

Definition at line 293 of file arch.py.

294  def calcdisp(self, v):
295  v = (int(v.arg) - 4) / 2
296  if not 0 < v <= 0xff:
297  return None
298  return v

+ Here is the caller graph for this function:

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

Definition at line 289 of file arch.py.

290  def decode(self, v):
291  self.expr = ExprMem(PC + ExprInt32(v * 2 + 4), 16)
292  return True
def miasm2.arch.sh4.arch.sh4_dpc16imm.encode (   self)

Definition at line 299 of file arch.py.

300  def encode(self):
301  res = MatchExpr(self.expr, ExprMem(PC + jra, 16), [jra])
302  if not res:
303  return False
304  if not isinstance(res[jra], ExprInt):
305  return False
306  v = self.calcdisp(res[jra])
307  if v is None:
308  return False
309  self.value = v
310  return True
311 

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

Definition at line 290 of file arch.py.

miasm2.arch.sh4.arch.sh4_dpc16imm.parser = deref_pc
static

Definition at line 287 of file arch.py.

miasm2.arch.sh4.arch.sh4_dpc16imm.value

Definition at line 308 of file arch.py.


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