Class OperandType

java.lang.Object
ghidra.program.model.lang.OperandType

public final class OperandType extends Object
Helper class for testing operand related flags in an integer.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Bit set if the operand is used as an address.
    static final int
    Bit set if the operand is a bit value
    static final int
    Bit set if the operand is a byte value
    static final int
    Bit set it the address referred to contains code.
    static final int
    Bit set if the operand is a co-processor value
    static final int
    Bit set if the address referred to contains data.
    static final int
    Bit set if the operand is dynamically defined given some processorContext.
    static final int
    Bit set if the operand is a flag.
    static final int
    Bit set if the operand is a float value
    static final int
    Bit set if operand is an immediate value.
    static final int
    Bit set if operand is implicit.
    static final int
    Bit set if operand is an indirect reference.
    static final int
    Bit set if the operand is a list.
    static final int
    Bit set if the operand is a port.
    static final int
    Bit set if the operand is a 8 byte value
    static final int
    Bit set if operand refers to an address being read
    static final int
    Bit set if the operand is a register.
    static final int
    Bit set if operand depends on the instruction's address.
    static final int
    Bit set if the operand is a scalar value
    static final int
    Bit set if the operand is a signed value
    static final int
    Bit set if the operand is text.
    static final int
    Bit set if the operand is a 2 byte value
    static final int
    Bit set if operand refers to an address being written to
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    doesRead(int operandType)
    check the READ flag.
    static boolean
    doesWrite(int operandType)
    check the WRITE flag.
    static boolean
    isAddress(int operandType)
    check ADDRESS flag.
    static boolean
    isBit(int operandType)
    check the BIT flag.
    static boolean
    isByte(int operandType)
    check the BYTE flag.
    static boolean
    isCodeReference(int operandType)
    check the CODE flag.
    static boolean
    isCoProcessor(int operandType)
    check the COPROCESSOR flag.
    static boolean
    isDataReference(int operandType)
    check the DATA flag.
    static boolean
    isDynamic(int operandType)
    check the DYNAMIC flag.
    static boolean
    isFlag(int operandType)
    check the CONDITION FLAG flag.
    static boolean
    isFloat(int operandType)
    check the FLOAT flag.
    static boolean
    isImmediate(int operandType)
    check the IMMEDIATE flag.
    static boolean
    isImplicit(int operandType)
    check the IMPLICIT flag.
    static boolean
    isIndirect(int operandType)
    check the INDIRECT flag.
    static boolean
    isList(int operandType)
    check the LIST flag.
    static boolean
    isPort(int operandType)
    check the PORT flag.
    static boolean
    isQuadWord(int operandType)
    check the QUADWORD flag.
    static boolean
    isRegister(int operandType)
    check the REGISTER flag.
    static boolean
    isRelative(int operandType)
    check the RELATIVE flag.
    static boolean
    isScalar(int operandType)
    check SCALAR flag.
    static boolean
    isScalarAsAddress(int operandType)
    check if both a scalar and an address
    static boolean
    isSigned(int operandType)
    check the SIGNED flag.
    static boolean
    isText(int operandType)
    check the TEXT flag.
    static boolean
    isWord(int operandType)
    check the WORD flag.
    static String
    toString(int operandType)
    returns a string representation of the given operandType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • READ

      public static final int READ
      Bit set if operand refers to an address being read
      See Also:
    • WRITE

      public static final int WRITE
      Bit set if operand refers to an address being written to
      See Also:
    • INDIRECT

      public static final int INDIRECT
      Bit set if operand is an indirect reference.
      See Also:
    • IMMEDIATE

      public static final int IMMEDIATE
      Bit set if operand is an immediate value.
      See Also:
    • RELATIVE

      public static final int RELATIVE
      Bit set if operand depends on the instruction's address.
      See Also:
    • IMPLICIT

      public static final int IMPLICIT
      Bit set if operand is implicit.
      See Also:
    • CODE

      public static final int CODE
      Bit set it the address referred to contains code.
      See Also:
    • DATA

      public static final int DATA
      Bit set if the address referred to contains data.
      See Also:
    • PORT

      public static final int PORT
      Bit set if the operand is a port.
      See Also:
    • REGISTER

      public static final int REGISTER
      Bit set if the operand is a register.
      See Also:
    • LIST

      public static final int LIST
      Bit set if the operand is a list.
      See Also:
    • FLAG

      public static final int FLAG
      Bit set if the operand is a flag.
      See Also:
    • TEXT

      public static final int TEXT
      Bit set if the operand is text.
      See Also:
    • ADDRESS

      public static final int ADDRESS
      Bit set if the operand is used as an address. If this is not set, assume it is a scalar value.
      See Also:
    • SCALAR

      public static final int SCALAR
      Bit set if the operand is a scalar value
      See Also:
    • BIT

      public static final int BIT
      Bit set if the operand is a bit value
      See Also:
    • BYTE

      public static final int BYTE
      Bit set if the operand is a byte value
      See Also:
    • WORD

      public static final int WORD
      Bit set if the operand is a 2 byte value
      See Also:
    • QUADWORD

      public static final int QUADWORD
      Bit set if the operand is a 8 byte value
      See Also:
    • SIGNED

      public static final int SIGNED
      Bit set if the operand is a signed value
      See Also:
    • FLOAT

      public static final int FLOAT
      Bit set if the operand is a float value
      See Also:
    • COP

      public static final int COP
      Bit set if the operand is a co-processor value
      See Also:
    • DYNAMIC

      public static final int DYNAMIC
      Bit set if the operand is dynamically defined given some processorContext. If bit is set then the SCALAR or ADDRESS bit must be set.
      See Also:
  • Constructor Details

    • OperandType

      public OperandType()
  • Method Details

    • doesRead

      public static boolean doesRead(int operandType)
      check the READ flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the READ flag is set.
    • doesWrite

      public static boolean doesWrite(int operandType)
      check the WRITE flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the WRITE flag is set.
    • isIndirect

      public static boolean isIndirect(int operandType)
      check the INDIRECT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the INDIRECT flag is set.
    • isImmediate

      public static boolean isImmediate(int operandType)
      check the IMMEDIATE flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the IMMEDIATE flag is set.
    • isRelative

      public static boolean isRelative(int operandType)
      check the RELATIVE flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the RELATIVE flag is set.
    • isImplicit

      public static boolean isImplicit(int operandType)
      check the IMPLICIT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the IMPLICIT flag is set.
    • isCodeReference

      public static boolean isCodeReference(int operandType)
      check the CODE flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the CODE flag is set.
    • isDataReference

      public static boolean isDataReference(int operandType)
      check the DATA flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the DATA flag is set.
    • isPort

      public static boolean isPort(int operandType)
      check the PORT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the PORT flag is set.
    • isRegister

      public static boolean isRegister(int operandType)
      check the REGISTER flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the REGISTER flag is set.
    • isList

      public static boolean isList(int operandType)
      check the LIST flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the LIST flag is set.
    • isFlag

      public static boolean isFlag(int operandType)
      check the CONDITION FLAG flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the CONDITION flag is set.
    • isText

      public static boolean isText(int operandType)
      check the TEXT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the TEXT flag is set.
    • isAddress

      public static boolean isAddress(int operandType)
      check ADDRESS flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the ADDRESS flag is set
    • isScalar

      public static boolean isScalar(int operandType)
      check SCALAR flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the SCALAR flag is set
    • isBit

      public static boolean isBit(int operandType)
      check the BIT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the BIT flag is set.
    • isByte

      public static boolean isByte(int operandType)
      check the BYTE flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the BYTE flag is set.
    • isWord

      public static boolean isWord(int operandType)
      check the WORD flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the WORD flag is set.
    • isQuadWord

      public static boolean isQuadWord(int operandType)
      check the QUADWORD flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the QUADWORD flag is set.
    • isSigned

      public static boolean isSigned(int operandType)
      check the SIGNED flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the SIGNED flag is set.
    • isFloat

      public static boolean isFloat(int operandType)
      check the FLOAT flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the FLOAT flag is set.
    • isCoProcessor

      public static boolean isCoProcessor(int operandType)
      check the COPROCESSOR flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the COPROCESSOR flag is set.
    • isDynamic

      public static boolean isDynamic(int operandType)
      check the DYNAMIC flag.
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if the DYNAMIC flag is set.
    • isScalarAsAddress

      public static boolean isScalarAsAddress(int operandType)
      check if both a scalar and an address
      Parameters:
      operandType - the bit field to examine.
      Returns:
      true if it is both a scalar and an address
    • toString

      public static String toString(int operandType)
      returns a string representation of the given operandType
      Parameters:
      operandType - the operandType bits
      Returns:
      the string rep