Example #1
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     operands_dict = dict(zip(self.operands, operands))
     getattr(functions, self.function_name)(*operands)
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(joint_functions.set_flag, joint.j_to,
                        getattr(flag_functions, joint.j_to.function),
                        result)
Example #2
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     operands_dict = dict(zip(self.operands, operands))
     getattr(functions, self.function_name)(*operands)
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(
                 joint_functions.set_flag,
                 joint.j_to,
                 getattr(flag_functions, joint.j_to.function),
                 result
             )
Example #3
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     size = None
     for operand in operands:
         if isinstance(operand, register.Register):
             size = operand.size
     # Hack - need at least one register
     #if not size:
     #    raise AttributeError
     operands_dict = dict(zip(self.operands, operands))
     getattr(functions, self.function_name)(*operands)
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(joint_functions.set_flag, joint.j_to,
                        getattr(flag_functions, joint.j_to.function),
                        result)
Example #4
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     operands_dict = dict(zip(self.operands, operands))
     refined_operands = []
     for op in operands:
         if isinstance(op, register.Register):
             refined_operands.append(op.value)
         else:
             refined_operands.append(op)
     result = getattr(functions, self.function_name)(*refined_operands)
     if self.result:
         operands_dict[self.result].value = result
         operands_dict[self.result].fit()
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(joint_functions.set_flag, joint.j_to,
                        getattr(flag_functions, joint.j_to.function),
                        result)
Example #5
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     size = None
     for operand in operands:
         if isinstance(operand, register.Register):
             size = operand.size
     # Hack - need at least one register
     #if not size:
     #    raise AttributeError
     operands_dict = dict(zip(self.operands, operands))
     getattr(functions, self.function_name)(*operands)
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(
                 joint_functions.set_flag,
                 joint.j_to,
                 getattr(flag_functions, joint.j_to.function),
                 result
             )
Example #6
0
 def execute(self, *operands):
     if len(operands) != len(self.operands):
         raise ValueError
     operands_dict = dict(zip(self.operands, operands))
     refined_operands = []
     for op in operands:
         if isinstance(op, register.Register):
             refined_operands.append(op.value)
         else:
             refined_operands.append(op)
     result = getattr(functions, self.function_name)(*refined_operands)
     if self.result:
         operands_dict[self.result].value = result
         operands_dict[self.result].fit()
     for joint_name, joint in self.joints.iteritems():
         if isinstance(joint.j_to, flag.Flag):
             joint.bend(
                 joint_functions.set_flag,
                 joint.j_to,
                 getattr(flag_functions, joint.j_to.function),
                 result
             )