Interface IInstructionOperandGeneric

All Superinterfaces:
IInstructionOperand, IInstructionOperandRegisterBased, IInstructionOperandSized
All Known Subinterfaces:
IInstructionOperandCMA, IInstructionOperandList
All Known Implementing Classes:
AbstractInstructionOperandGeneric, AbstractInstructionOperandList, Operand

@Ser public interface IInstructionOperandGeneric extends IInstructionOperandSized, IInstructionOperandRegisterBased
This interface is used to represent the most common types of operands: immediate values, registers, direct addresses (absolute or relative), memory access, etc.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    An absolute address.
    static final int
    An alias for some value, represented as a String.
    static final int
    A complex memory access operand.
    static final int
    Immediate value of at most 64-bit.
    static final int
    A list of operands.
    static final int
    Memory access via absolute address.
    static final int
    Memory access via register.
    static final int
    A register.
    static final int
    An offset to the instruction address.
    static final int
    Signed immediate value of at most 64-bit.
    static final int
    Type to be used for specific user entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    getAlias(long value)
    Get the optional alias string to be displayed instead of a given integer value.
    int
    Get the operand type.
    long
    Get the value of the operand.
    long
    getOperandValue(long address)
    Get the value of the operand, adjusted (if relevant) for an instruction located at the provided address.
    Get the optional prefix to be prepended to the formatted operand.
    Get the optional suffix to be appended to the formatted operand.
    default boolean
    Test if an operand type is TYPE_IMM
    default boolean
    Test if an operand type is TYPE_REG

    Methods inherited from interface com.pnfsoftware.jeb.core.units.code.IInstructionOperand

    format

    Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandRegisterBased

    getRegisterName

    Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandSized

    getOperandBitsize
  • Field Details

    • TYPE_REG

      static final int TYPE_REG
      A register. Value= an opaque register identifier.
      See Also:
    • TYPE_IMM

      static final int TYPE_IMM
      Immediate value of at most 64-bit. Value= the value itself. Signedness is auto-determined for immediates whose bitsize is less than or equal to 63 bits. For 64-bit immediates, unsigned is assumed.
      See Also:
    • TYPE_ADDR

      static final int TYPE_ADDR
      An absolute address. Value= the address.
      See Also:
    • TYPE_RELADDR

      static final int TYPE_RELADDR
      An offset to the instruction address. Value= the relative or absolute address, using getOperandValue(instruction_address).
      See Also:
    • TYPE_MEMREG

      static final int TYPE_MEMREG
      Memory access via register. The operand size identifies the size of the accessed data. Value= register identifier that determines the memory access address.
      See Also:
    • TYPE_MEMIMM

      static final int TYPE_MEMIMM
      Memory access via absolute address. The operand size identifies the size of the accessed data. Value= immediate value that corresponds to the memory access address.
      See Also:
    • TYPE_ALIAS

      static final int TYPE_ALIAS
      An alias for some value, represented as a String. Implement getAlias(long) to display the correct String. Value= TBD.
      See Also:
    • TYPE_LIST

      static final int TYPE_LIST
      A list of operands. Child class is specialized, it implements IInstructionOperandList. Value= TBD.
      See Also:
    • TYPE_CMA

      static final int TYPE_CMA
      A complex memory access operand. Child class is specialized, it implements IInstructionOperandCMA. Value= N/A.
      See Also:
    • TYPE_SIMM

      static final int TYPE_SIMM
      Signed immediate value of at most 64-bit.
      See Also:
    • TYPE_USER_1

      static final int TYPE_USER_1
      Type to be used for specific user entries. Other types can be declared using TYPE_USER_1 + n, with 0 <= n < 0x1000 .
      See Also:
  • Method Details

    • getOperandType

      int getOperandType()
      Get the operand type. Used to determine how to interpret the results provided by IInstructionOperandSized.getOperandBitsize() and getOperandValue().
      Returns:
      one of the TYPE_Xxx constants
    • getOperandValue

      long getOperandValue()
      Get the value of the operand. The interpretation of the value depends on the operand type and the underlying implementation.
      Returns:
      the opaque operand value
    • getOperandValue

      long getOperandValue(long address)
      Get the value of the operand, adjusted (if relevant) for an instruction located at the provided address. Example: If the operand is a memory access, this method may return "address + operand value".
      Returns:
      the address-adjusted operand value
    • getPrefix

      String getPrefix(IInstruction insn)
      Get the optional prefix to be prepended to the formatted operand.
      Returns:
      optional prefix
    • getSuffix

      String getSuffix(IInstruction insn)
      Get the optional suffix to be appended to the formatted operand.
      Parameters:
      insn -
      Returns:
      optional suffix
    • getAlias

      String getAlias(long value)
      Get the optional alias string to be displayed instead of a given integer value.
      Parameters:
      value -
      Returns:
      optional alias
    • isRegister

      default boolean isRegister()
      Test if an operand type is TYPE_REG
      Returns:
      true for Register
    • isImmediate

      default boolean isImmediate()
      Test if an operand type is TYPE_IMM
      Returns:
      true for Immediate