Class InvalidPrototype

    • Constructor Detail

      • InvalidPrototype

        public InvalidPrototype​(Language lang)
        Construct a new invalid instruction prototype.
    • Method Detail

      • hasDelaySlots

        public boolean hasDelaySlots()
        Specified by:
        hasDelaySlots in interface InstructionPrototype
        Returns:
        true if instruction prototype expects one or more delay slotted instructions to exist.
      • hasCrossBuildDependency

        public boolean hasCrossBuildDependency()
        Specified by:
        hasCrossBuildDependency in interface InstructionPrototype
        Returns:
        true if instruction semantics have a CrossBuild instruction dependency which may require a robust InstructionContext with access to preceding instructions
      • getInstructionMask

        public Mask getInstructionMask()
        Description copied from interface: InstructionPrototype
        Get a Mask that describe which bits of this instruction determine the opcode.
        Specified by:
        getInstructionMask in interface InstructionPrototype
        Returns:
        a Mask for the opcode bits or null if unknown.
      • getOperandValueMask

        public Mask getOperandValueMask​(int operandIndex)
        Description copied from interface: InstructionPrototype
        Get a Mask that describe which bits of this instruction determine the operand value.
        Specified by:
        getOperandValueMask in interface InstructionPrototype
        Returns:
        a Mask for the operand bits or null if unknown.
      • getFlowType

        public FlowType getFlowType​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the flow type of this instruction. Used for analysis purposes. i.e., how this instruction flows to the next instruction.
        Specified by:
        getFlowType in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        flow type.
      • getDelaySlotDepth

        public int getDelaySlotDepth​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the number of delay slot instructions for this argument. This should be 0 for instructions which don't have a delay slot. This is used to support the delay slots found on some RISC processors such as SPARC and the PA-RISC. This returns an integer instead of a boolean in case some other processor executes more than one instruction from a delay slot.
        Specified by:
        getDelaySlotDepth in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        the number of delay slot instructions for this instruction.
      • getOpType

        public int getOpType​(int opIndex,
                             InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the type of a specific operand.
        Specified by:
        getOpType in interface InstructionPrototype
        Parameters:
        opIndex - the index of the operand. (zero based)
        context - the instruction context.
        Returns:
        the type of the operand.
      • getFallThroughOffset

        public int getFallThroughOffset​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the byte offset to the default flow after instruction. If this instruction does not have a fall-through due to flow behavior, this method will still return an offset which accounts for the instruction length including delay slotted instructions if applicable.
        Specified by:
        getFallThroughOffset in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        int how much to add to the current address to get the fall through address.
      • getFlows

        public Address[] getFlows​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get an array of Address objects for all flows other than a fall-through, null if no flows.
        Specified by:
        getFlows in interface InstructionPrototype
        Parameters:
        context - the instruction context.
        Returns:
        an array of Address objects for all flows other than a fall-through, null if no flows.
      • getOpRepresentation

        public java.lang.String getOpRepresentation​(int opIndex,
                                                    MemBuffer buf,
                                                    ProcessorContextView context,
                                                    java.lang.String label)
      • getOpRepresentationList

        public java.util.ArrayList<java.lang.Object> getOpRepresentationList​(int opIndex,
                                                                             InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get a List of Objects that can be used to render an operands representation.
        Specified by:
        getOpRepresentationList in interface InstructionPrototype
        Parameters:
        opIndex - operand to get the Representation List
        context - the instruction context
        Returns:
        ArrayList of Register, Address, Scalar, VariableOffset and Character objects of null if the operation isn't supported
      • getAddress

        public Address getAddress​(int opIndex,
                                  InstructionContext context)
        Description copied from interface: InstructionPrototype
        If the indicated operand is an address, this gets the address value for that operand
        Specified by:
        getAddress in interface InstructionPrototype
        Parameters:
        opIndex - index of the operand.
        context - the instruction context.
        Returns:
        the address indicated by the operand
      • getScalar

        public Scalar getScalar​(int opIndex,
                                InstructionContext context)
        Description copied from interface: InstructionPrototype
        If the indicated operand is a scalar, this gets the scalar value for that operand
        Specified by:
        getScalar in interface InstructionPrototype
        Parameters:
        opIndex - index of the operand.
        context - the instruction context
        Returns:
        the scalar for the indicated operand
      • getRegister

        public Register getRegister​(int opIndex,
                                    InstructionContext context)
        Description copied from interface: InstructionPrototype
        If the indicated operand is a register, this gets the register value for that operand
        Specified by:
        getRegister in interface InstructionPrototype
        Parameters:
        opIndex - index of the operand.
        context - the instruction context
        Returns:
        a register description for the indicated operand
      • getOpObjects

        public java.lang.Object[] getOpObjects​(int opIndex,
                                               InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get objects used by this operand (Address, Scalar, Register ...)
        Specified by:
        getOpObjects in interface InstructionPrototype
        Parameters:
        opIndex - the index of the operand. (zero based)
        context - the instruction context
        Returns:
        an array of objects found at this operand.
      • hasDelimeter

        public boolean hasDelimeter​(int opIndex)
        Description copied from interface: InstructionPrototype
        Return true if the operand at opIndex should have a delimiter following it.
        Specified by:
        hasDelimeter in interface InstructionPrototype
        Parameters:
        opIndex - the index of the operand to test for having a delimiter.
      • getInputObjects

        public java.lang.Object[] getInputObjects​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the Result objects produced/affected by this instruction These would probably only be Register or Address
        Specified by:
        getInputObjects in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        an array of objects that are used by this instruction
      • getResultObjects

        public java.lang.Object[] getResultObjects​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the Result objects produced/affected by this instruction These would probably only be Register or Address
        Specified by:
        getResultObjects in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        an array of objects that are affected by this instruction
      • getPcode

        public PcodeOp[] getPcode​(InstructionContext context,
                                  PcodeOverride override,
                                  UniqueAddressFactory uniqueFactory)
        Description copied from interface: InstructionPrototype
        Get an array of PCode operations (micro code) that this instruction performs.
        Specified by:
        getPcode in interface InstructionPrototype
        Parameters:
        context - the instruction context
        override - if not null, may indicate that different elements of the pcode generation are overridden
        uniqueFactory - must be specified if flowOverride is not null
        Returns:
        array of PCODE, zero length array if language doesn't support PCODE for this instruction
      • getPcodePacked

        public PackedBytes getPcodePacked​(InstructionContext context,
                                          PcodeOverride override,
                                          UniqueAddressFactory uniqueFactory)
        Description copied from interface: InstructionPrototype
        Same as getPcode but returns the operations in a packed format to optimize transfer to other processes
        Specified by:
        getPcodePacked in interface InstructionPrototype
        Parameters:
        context - the instruction context
        override - if not null, may indicate that different elements of the pcode generation are overridden
        uniqueFactory - must be specified if flowOverride is not null
        Returns:
      • getPcode

        public PcodeOp[] getPcode​(InstructionContext context,
                                  int opIndex)
        Description copied from interface: InstructionPrototype
        Get an array of PCode operations (micro code) that a particular operand performs to compute its value.
        Specified by:
        getPcode in interface InstructionPrototype
        Parameters:
        context - the instruction context
        opIndex - the index of the operand for which to get PCode.
        Returns:
        array of PCODE, zero length array if language doesn't support PCODE for this instruction
      • getMnemonic

        public java.lang.String getMnemonic​(InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the mnemonic for this CodeProtype. Examples: "MOV" and "CALL" for instructions and "DB" and "DA" for data.
        Specified by:
        getMnemonic in interface InstructionPrototype
        Parameters:
        context - the instruction context
        Returns:
        the mnemonic for this CodePrototype.
      • getSeparator

        public java.lang.String getSeparator​(int opIndex,
                                             InstructionContext context)
        Description copied from interface: InstructionPrototype
        Get the separator strings between an operand. The separator string for 0 are the characters before the first operand. The separator string for numOperands+1 are the characters after the last operand.
        Specified by:
        getSeparator in interface InstructionPrototype
        Parameters:
        opIndex - valid values are 0 thru numOperands+1
        context - the instruction context
        Returns:
        separator string, or null if there is no string
      • getOperandRefType

        public RefType getOperandRefType​(int opIndex,
                                         InstructionContext context,
                                         PcodeOverride override,
                                         UniqueAddressFactory uniqueFactory)
        Description copied from interface: InstructionPrototype
        Get the suggested operand reference type.
        Specified by:
        getOperandRefType in interface InstructionPrototype
        Parameters:
        opIndex - the index of the operand. (zero based)
        context - the instruction context
        override - if not null, steers local overrides of pcode generation
        uniqueFactory - must be specified if flowOverride is not null
        Returns:
        reference type.
      • getDelaySlotByteCount

        public int getDelaySlotByteCount()
        Specified by:
        getDelaySlotByteCount in interface InstructionPrototype
        Returns:
        the number of delay-slot instruction bytes which correspond to this prototype.