Ejemplo n.º 1
0
 def op_01(self, params, label_dict):
     reg_b_name = params[0][1:]
     reg_b_idx = reg_name_to_idx.get(reg_b_name)
     if reg_b_idx is None:
         raise DumpError('reg_b name wrong: %s' % reg_b_name)
     if not params[1].startswith('%'):
         raise DumpError('reg_a is not start with %')
     reg_a_name = params[1][1:]
     reg_a_idx = reg_name_to_idx.get(reg_a_name)
     if reg_a_idx is None:
         raise DumpError('reg_a name wrong: %s' % reg_a_name)
     option = 0x1
     immediate = 0
     return InsInfo(self.op_code, option, reg_a_idx, reg_b_idx, immediate)
Ejemplo n.º 2
0
 def op_01(self, params, label_dict):
     reg_a_name = params[0][1:]
     reg_a_idx = reg_name_to_idx.get(reg_a_name)
     if reg_a_idx is None:
         raise DumpError('reg_a name wrong: %s' % reg_a_name)
     reg_b_idx = 0
     option = 0x1
     immediate = 0
     return InsInfo(self.op_code, option, reg_a_idx, reg_b_idx, immediate)
Ejemplo n.º 3
0
 def op_10(self, params, label_dict):
     immediate_str = params[0][1:]
     immediate = label_dict.get(immediate_str)
     if immediate is None:
         try:
             immediate = int(immediate_str)
         except ValueError:
             raise DumpError('invalid immediate: %s' % immediate_str)
     reg_a_name = params[1][1:]
     reg_a_idx = reg_name_to_idx.get(reg_a_name)
     if reg_a_idx is None:
         raise DumpError('reg_a name wrong: %s' % reg_a_name)
     option = 0x2
     reg_b_idx = 0
     return InsInfo(self.op_code, option, reg_a_idx, reg_b_idx, immediate)