public abstract class

AbstractInstructionOperandGeneric

extends Object
implements IInstructionOperandGeneric
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.processor.AbstractInstructionOperandGeneric
Known Direct Subclasses

Class Overview

Reference implementation for IInstructionOperandGeneric.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric
Fields
protected int size
protected int type
protected long value
Public Constructors
AbstractInstructionOperandGeneric(int type, int size, long value)
Public Methods
boolean equals(Object obj)
String format(IInstruction insn, long address)
Format the operand, assuming it is used by an instruction at the provided address.
String getAlias(long v)
Get the optional alias string to be displayed instead of a given integer value.
int getOperandBitsize()
Get the operand size in bits.
int getOperandType()
Get the operand type.
long getOperandValue()
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.
String getPrefix(IInstruction insn)
Get the optional prefix to be prepended to the formatted operand.
String getSuffix(IInstruction insn)
Get the optional suffix to be appended to the formatted operand.
int hashCode()
String toString()
Protected Methods
CharSequence formatOperand(IInstruction insn, long address)
final String innerFormat()
Returns an inner representation of this object, where address is unknown
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.units.code.IInstructionOperand
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandRegisterBased
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandSized

Fields

protected int size

protected int type

protected long value

Public Constructors

public AbstractInstructionOperandGeneric (int type, int size, long value)

Public Methods

public boolean equals (Object obj)

public String format (IInstruction insn, long address)

Format the operand, assuming it is used by an instruction at the provided address.

Parameters
insn optional instruction using this operand. Note that this operand may not be directly returned by insn.getOperands(), e.g., in the case of instructions with nested operands
address optional instruction address, 0 if none. The instruction address is sometimes necessary to properly render PC-dependent operands
Returns
  • simple string representation of the operand

public String getAlias (long v)

Get the optional alias string to be displayed instead of a given integer value.

Returns
  • optional alias

public int getOperandBitsize ()

Get the operand size in bits.

public int getOperandType ()

Get the operand type. Used to determine how to interpret the results provided by getOperandBitsize() and getOperandValue().

Returns
  • one of the TYPE_Xxx constants

public 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

public 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

public String getPrefix (IInstruction insn)

Get the optional prefix to be prepended to the formatted operand.

Returns
  • optional prefix

public String getSuffix (IInstruction insn)

Get the optional suffix to be appended to the formatted operand.

Returns
  • optional suffix

public int hashCode ()

public String toString ()

Protected Methods

protected CharSequence formatOperand (IInstruction insn, long address)

protected final String innerFormat ()

Returns an inner representation of this object, where address is unknown