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
FieldsModifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptiongetAlias
(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.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.default boolean
Test if an operand type isTYPE_IMM
default boolean
Test if an operand type isTYPE_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_REGA register. Value= an opaque register identifier.- See Also:
-
TYPE_IMM
static final int TYPE_IMMImmediate value of at most 64-bit. Value= the value itself. Signedness is auto-determined for immediates whosebitsize
is less than or equal to 63 bits. For 64-bit immediates, unsigned is assumed.- See Also:
-
TYPE_ADDR
static final int TYPE_ADDRAn absolute address. Value= the address.- See Also:
-
TYPE_RELADDR
static final int TYPE_RELADDRAn offset to the instruction address. Value= the relative or absolute address, usinggetOperandValue(instruction_address)
.- See Also:
-
TYPE_MEMREG
static final int TYPE_MEMREGMemory 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_MEMIMMMemory 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_ALIASAn alias for some value, represented as a String. ImplementgetAlias(long)
to display the correct String. Value= TBD.- See Also:
-
TYPE_LIST
static final int TYPE_LISTA list of operands. Child class is specialized, it implementsIInstructionOperandList
. Value= TBD.- See Also:
-
TYPE_CMA
static final int TYPE_CMAA complex memory access operand. Child class is specialized, it implementsIInstructionOperandCMA
. Value= N/A.- See Also:
-
TYPE_SIMM
static final int TYPE_SIMMSigned immediate value of at most 64-bit.- See Also:
-
TYPE_USER_1
static final int TYPE_USER_1Type to be used for specific user entries. Other types can be declared usingTYPE_USER_1 + n
, with0 <= n < 0x1000
.- See Also:
-
-
Method Details
-
getOperandType
int getOperandType()Get the operand type. Used to determine how to interpret the results provided byIInstructionOperandSized.getOperandBitsize()
andgetOperandValue()
.- 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
Get the optional prefix to be prepended to the formatted operand.- Returns:
- optional prefix
-
getSuffix
Get the optional suffix to be appended to the formatted operand.- Parameters:
insn
-- Returns:
- optional suffix
-
getAlias
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 isTYPE_REG
- Returns:
- true for Register
-
isImmediate
default boolean isImmediate()Test if an operand type isTYPE_IMM
- Returns:
- true for Immediate
-