public interface

IInstructionOperandGeneric

implements IInstructionOperandRegisterBased IInstructionOperandSized
com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric
Known Indirect Subclasses

Class Overview

This interface is used to represent the most common types of operands: immediate values, registers, direct addresses (absolute or relative), memory access, etc.

Summary

Constants
int TYPE_ADDR An absolute address.
int TYPE_ALIAS An alias for some value, represented as a String.
int TYPE_CMA A complex memory access operand.
int TYPE_IMM Immediate value of at most 64-bit.
int TYPE_LIST A list of operands.
int TYPE_MEMIMM Memory access via absolute address.
int TYPE_MEMREG Memory access via register.
int TYPE_REG A register.
int TYPE_RELADDR An offset to the instruction address.
int TYPE_SIMM Signed immediate value of at most 64-bit.
int TYPE_USER_1 Type to be used for specific user entries.
Public Methods
abstract String getAlias(long value)
Get the optional alias string to be displayed instead of a given integer value.
abstract int getOperandType()
Get the operand type.
abstract long getOperandValue()
Get the value of the operand.
abstract long getOperandValue(long address)
Get the value of the operand, adjusted (if relevant) for an instruction located at the provided address.
abstract String getPrefix(IInstruction insn)
Get the optional prefix to be prepended to the formatted operand.
abstract String getSuffix(IInstruction insn)
Get the optional suffix to be appended to the formatted operand.
abstract boolean isImmediate()
Test if an operand type is TYPE_IMM
abstract boolean isRegister()
Test if an operand type is TYPE_REG
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.IInstructionOperand
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandRegisterBased
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandSized

Constants

public static final int TYPE_ADDR

An absolute address. Value= the address.

Constant Value: 2 (0x00000002)

public static final int TYPE_ALIAS

An alias for some value, represented as a String. Implement getAlias(long) to display the correct String. Value= TBD.

Constant Value: 6 (0x00000006)

public static final int TYPE_CMA

A complex memory access operand. Child class is specialized, it implements IInstructionOperandCMA. Value= N/A.

Constant Value: 8 (0x00000008)

public 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.

Constant Value: 1 (0x00000001)

public static final int TYPE_LIST

A list of operands. Child class is specialized, it implements IInstructionOperandList. Value= TBD.

Constant Value: 7 (0x00000007)

public 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.

Constant Value: 5 (0x00000005)

public 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.

Constant Value: 4 (0x00000004)

public static final int TYPE_REG

A register. Value= an opaque register identifier.

Constant Value: 0 (0x00000000)

public static final int TYPE_RELADDR

An offset to the instruction address. Value= the relative or absolute address, using getOperandValue(instruction_address).

Constant Value: 3 (0x00000003)

public static final int TYPE_SIMM

Signed immediate value of at most 64-bit.

Constant Value: 9 (0x00000009)

public 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 .

Constant Value: 4096 (0x00001000)

Public Methods

public abstract String getAlias (long value)

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

Returns
  • optional alias

public abstract 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 abstract 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 abstract 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 abstract String getPrefix (IInstruction insn)

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

Returns
  • optional prefix

public abstract String getSuffix (IInstruction insn)

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

Returns
  • optional suffix

public abstract boolean isImmediate ()

Test if an operand type is TYPE_IMM

Returns
  • true for Immediate

public abstract boolean isRegister ()

Test if an operand type is TYPE_REG

Returns
  • true for Register