Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        """Supported forms:

            * NACLSSP(r32)
            * NACLSSP(imm32)
        """

        origin = kwargs.get("origin")
        prototype = kwargs.get("prototype")
        if origin is None and prototype is None and peachpy.x86_64.options.get_debug_level(
        ) > 0:
            origin = inspect.stack()
        super(NACLSSP, self).__init__("NACLSSP",
                                      origin=origin,
                                      prototype=prototype)
        self.operands = tuple(map(check_operand, args))
        if len(self.operands) != 1:
            raise SyntaxError("Instruction \"NACLSSP\" requires 1 operand")
        self.in_regs = (True, )
        self.out_regs = (False, )
        self.out_operands = (True, )
        self._gas_name = "naclssp"
        if not is_r32(self.operands[0]) and not is_imm32(self.operands[0]):
            raise SyntaxError(
                "Invalid operand types: NACLSSP" +
                ", ".join(map(format_operand_type, self.operands)))
        if peachpy.stream.active_stream is not None:
            peachpy.stream.active_stream.add_instruction(self)
Exemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        """Supported forms:

            * NACLSSP(r32)
            * NACLSSP(imm32)
        """

        origin = kwargs.get("origin")
        prototype = kwargs.get("prototype")
        if origin is None and prototype is None and peachpy.x86_64.options.get_debug_level() > 0:
            origin = inspect.stack()
        super(NACLSSP, self).__init__("NACLSSP", origin=origin, prototype=prototype)
        self.operands = tuple(map(check_operand, args))
        if len(self.operands) != 1:
            raise SyntaxError("Instruction \"NACLSSP\" requires 1 operand")
        self.in_regs = (True,)
        self.out_regs = (False,)
        self.out_operands = (True,)
        self._gas_name = "naclssp"
        if not is_r32(self.operands[0]) and not is_imm32(self.operands[0]):
            raise SyntaxError("Invalid operand types: NACLSSP" + ", ".join(map(format_operand_type, self.operands)))
        if peachpy.stream.active_stream is not None:
            peachpy.stream.active_stream.add_instruction(self)