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

Public Member Functions

def decode
 
def encode
 
def fromstring
 
def fromstring
 
def check_fbits
 

Public Attributes

 expr
 
 value
 
 fmask
 

Static Public Attributes

 parser = armt_gpreg_shift_off
 
 reg_info = None
 

Detailed Description

Definition at line 2023 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.arm.arch.armt_gpreg_rm_shift_off.decode (   self,
  v 
)

Definition at line 2026 of file arch.py.

2027  def decode(self, v):
2028  v = v & self.lmask
2029  if v >= len(gpregs_nosppc.expr):
2030  return False
2031  r = gpregs_nosppc.expr[v]
2032 
2033  i = int(self.parent.imm5_3.value) << 2
2034  i |= int(self.parent.imm5_2.value)
2035 
2036  if self.parent.stype.value < 3 or i != 0:
2037  shift = allshifts_armt[self.parent.stype.value]
2038  else:
2039  shift = allshifts_armt[4]
2040  self.expr = ExprOp(shift, r, ExprInt32(i))
2041  return True
def miasm2.arch.arm.arch.armt_gpreg_rm_shift_off.encode (   self)

Definition at line 2042 of file arch.py.

2043  def encode(self):
2044  e = self.expr
2045  if isinstance(e, ExprId):
2046  self.value = gpregs_nosppc.index(e)
2047  self.parent.stype.value = 0
2048  self.parent.imm5_3.value = 0
2049  self.parent.imm5_2.value = 0
2050  return True
2051  shift = e.op
2052  r = gpregs_nosppc.expr.index(e.args[0])
2053  self.value = r
2054  i = int(e.args[1].arg)
2055  if shift == 'rrx':
2056  if i != 1:
2057  log.debug('rrx shift must be 1')
2058  return False
2059  self.parent.imm5_3.value = 0
2060  self.parent.imm5_2.value = 0
2061  self.parent.stype.value = 3
2062  return True
2063  self.parent.stype.value = allshifts_armt.index(shift)
2064  self.parent.imm5_2.value = i & 3
2065  self.parent.imm5_3.value = i >> 2
2066  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.arm.arch.armt_gpreg_rm_shift_off.expr

Definition at line 2039 of file arch.py.

miasm2.core.cpu.reg_noarg.fmask
inherited

Definition at line 667 of file cpu.py.

miasm2.arch.arm.arch.armt_gpreg_rm_shift_off.parser = armt_gpreg_shift_off
static

Definition at line 2024 of file arch.py.

miasm2.core.cpu.reg_noarg.reg_info = None
staticinherited

Definition at line 633 of file cpu.py.

miasm2.arch.arm.arch.armt_gpreg_rm_shift_off.value

Definition at line 2045 of file arch.py.


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