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

Public Member Functions

def decode
 
def encode
 
def fromstring
 
def fromstring
 
def check_fbits
 

Public Attributes

 expr
 
 value
 
 fmask
 

Static Public Attributes

int prio = default_prio+1
 
 reg_info = gpregs
 
 parser = sreg_p
 

Detailed Description

Definition at line 422 of file arch.py.

Member Function Documentation

def miasm2.core.cpu.reg_noarg.check_fbits (   self,
  v 
)
inherited

Definition at line 666 of file cpu.py.

667  def check_fbits(self, v):
668  return v & self.fmask == self.fbits
669 
def miasm2.arch.msp430.arch.msp430_dreg_arg.decode (   self,
  v 
)

Definition at line 427 of file arch.py.

428  def decode(self, v):
429  if hasattr(self.parent, 'size'):
430  size = [16, 8][self.parent.size.value]
431  else:
432  size = 16
433 
434  v = v & self.lmask
435  e = self.reg_info.expr[v]
436  if self.parent.a_d.value == 0:
437  self.expr = e
438  elif self.parent.a_d.value == 1:
439  if e == SR:
440  x = ExprInt16(self.parent.off_d.value)
441  else:
442  x = e + ExprInt16(self.parent.off_d.value)
443  self.expr = ExprMem(x, size)
444  else:
445  raise NotImplementedError(
446  "unknown value self.parent.a_d.value = " +
447  "%d" % self.parent.a_d.value)
448  return True
def miasm2.arch.msp430.arch.msp430_dreg_arg.encode (   self)

Definition at line 449 of file arch.py.

450  def encode(self):
451  e = self.expr
452  if e in self.reg_info.expr:
453  self.parent.a_d.value = 0
454  self.value = self.reg_info.expr.index(e)
455  elif isinstance(e, ExprMem):
456  if isinstance(e.arg, ExprId):
457  r, i = e.arg, ExprInt16(0)
458  elif isinstance(e.arg, ExprOp):
459  r, i = e.arg.args[0], e.arg.args[1]
460  elif isinstance(e.arg, ExprInt):
461  r, i = SR, e.arg
462  else:
463  raise NotImplementedError(
464  'unknown instance e.arg = %s' % type(e.arg))
465  self.parent.a_d.value = 1
466  self.value = self.reg_info.expr.index(r)
467  self.parent.off_d.value = int(i.arg)
468  else:
469  raise NotImplementedError('unknown instance e = %s' % type(e))
470  return True
def miasm2.core.cpu.m_arg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 604 of file cpu.py.

605  def fromstring(self, s, parser_result=None):
606  if parser_result:
607  e, start, stop = parser_result[self.parser]
608  self.expr = e
609  return start, stop
610  try:
611  v, start, stop = self.parser.scanString(s).next()
612  except StopIteration:
613  return None, None
614  self.expr = v[0]
615  return start, stop
616 

+ Here is the call graph for this function:

def miasm2.core.cpu.reg_noarg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 636 of file cpu.py.

637  def fromstring(self, s, parser_result=None):
638  if parser_result:
639  e, start, stop = parser_result[self.parser]
640  self.expr = e
641  return start, stop
642  try:
643  v, start, stop = self.parser.scanString(s).next()
644  except StopIteration:
645  return None, None
646  self.expr = v[0]
647  return start, stop

Member Data Documentation

miasm2.arch.msp430.arch.msp430_dreg_arg.expr

Definition at line 436 of file arch.py.

miasm2.core.cpu.reg_noarg.fmask
inherited

Definition at line 667 of file cpu.py.

miasm2.arch.msp430.arch.msp430_dreg_arg.parser = sreg_p
static

Definition at line 425 of file arch.py.

int miasm2.arch.msp430.arch.msp430_dreg_arg.prio = default_prio+1
static

Definition at line 423 of file arch.py.

miasm2.arch.msp430.arch.msp430_dreg_arg.reg_info = gpregs
static

Definition at line 424 of file arch.py.

miasm2.arch.msp430.arch.msp430_dreg_arg.value

Definition at line 453 of file arch.py.


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