Class AbstractInstructionOperandGeneric
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.AbstractInstructionOperandGeneric
- All Implemented Interfaces:
IInstructionOperandGeneric,IInstructionOperandRegisterBased,IInstructionOperandSized,IInstructionOperand
- Direct Known Subclasses:
AbstractInstructionOperandList,Operand
@Ser
public abstract class AbstractInstructionOperandGeneric
extends Object
implements IInstructionOperandGeneric
Reference implementation for
IInstructionOperandGeneric.-
Field Summary
FieldsFields inherited from interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric
TYPE_ADDR, TYPE_ALIAS, TYPE_CMA, TYPE_IMM, TYPE_LIST, TYPE_MEMIMM, TYPE_MEMREG, TYPE_REG, TYPE_RELADDR, TYPE_SIMM, TYPE_USER_1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanformat(IInstruction insn, long address) Format the operand, assuming it is used by an instruction at the provided address.protected CharSequenceformatOperand(IInstruction insn, long address) getAlias(long v) Get the optional alias string to be displayed instead of a given integer value.intGet the operand size in bits.intGet the operand type.longGet the value of the operand.longgetOperandValue(long address) Get the value of the operand, adjusted (if relevant) for an instruction located at the provided address.getPrefix(IInstruction insn) Get the optional prefix to be prepended to the formatted operand.getSuffix(IInstruction insn) Get the optional suffix to be appended to the formatted operand.inthashCode()protected final StringReturns an inner representation of this object, where address is unknowntoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric
isImmediate, isRegisterMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandRegisterBased
getRegisterName
-
Field Details
-
type
protected int type -
bitsize
protected int bitsize -
value
protected long value
-
-
Constructor Details
-
AbstractInstructionOperandGeneric
public AbstractInstructionOperandGeneric(int type, int bitsize, long value)
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getOperandType
public int getOperandType()Description copied from interface:IInstructionOperandGenericGet the operand type. Used to determine how to interpret the results provided byIInstructionOperandSized.getOperandBitsize()andIInstructionOperandGeneric.getOperandValue().- Specified by:
getOperandTypein interfaceIInstructionOperandGeneric- Returns:
- one of the
TYPE_Xxxconstants
-
getOperandBitsize
public int getOperandBitsize()Description copied from interface:IInstructionOperandSizedGet the operand size in bits.- Specified by:
getOperandBitsizein interfaceIInstructionOperandSized- Returns:
-
getOperandValue
public long getOperandValue()Description copied from interface:IInstructionOperandGenericGet the value of the operand. The interpretation of the value depends on the operand type and the underlying implementation.- Specified by:
getOperandValuein interfaceIInstructionOperandGeneric- Returns:
- the opaque operand value
-
getOperandValue
public long getOperandValue(long address) Description copied from interface:IInstructionOperandGenericGet 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".- Specified by:
getOperandValuein interfaceIInstructionOperandGeneric- Returns:
- the address-adjusted operand value
-
format
Description copied from interface:IInstructionOperandFormat the operand, assuming it is used by an instruction at the provided address.- Specified by:
formatin interfaceIInstructionOperand- Parameters:
insn- optional instruction using this operand. Note that this operand may not be directly returned byinsn.getOperands(), e.g., in the case of instructions with nested operandsaddress- 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
-
formatOperand
-
getPrefix
Description copied from interface:IInstructionOperandGenericGet the optional prefix to be prepended to the formatted operand.- Specified by:
getPrefixin interfaceIInstructionOperandGeneric- Returns:
- optional prefix
-
getSuffix
Description copied from interface:IInstructionOperandGenericGet the optional suffix to be appended to the formatted operand.- Specified by:
getSuffixin interfaceIInstructionOperandGeneric- Returns:
- optional suffix
-
getAlias
Description copied from interface:IInstructionOperandGenericGet the optional alias string to be displayed instead of a given integer value.- Specified by:
getAliasin interfaceIInstructionOperandGeneric- Returns:
- optional alias
-
toString
-
innerFormat
Returns an inner representation of this object, where address is unknown- Returns:
-