Class TokenField
java.lang.Object
ghidra.app.plugin.processors.sleigh.expression.PatternExpression
ghidra.app.plugin.processors.sleigh.expression.PatternValue
ghidra.app.plugin.processors.sleigh.expression.TokenField
A contiguous set of bits within instruction stream, interpreted
as an integer value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
byteSwap
(long val, int size) Swap the least sig -size- bytes in -val-void
decode
(Decoder decoder, SleighLanguage lang) boolean
int
int
int
int
int
getShift()
long
getValue
(ParserWalker walker) int
hashCode()
boolean
boolean
long
maxValue()
long
minValue()
static long
signExtend
(long val, int bit) Sign extend -val- above -bit-toString()
static long
zeroExtend
(long val, int bit) Clear all bits in -val- above -bit-Methods inherited from class ghidra.app.plugin.processors.sleigh.expression.PatternExpression
decodeExpression
-
Constructor Details
-
TokenField
public TokenField()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
minValue
public long minValue()- Specified by:
minValue
in classPatternValue
-
maxValue
public long maxValue()- Specified by:
maxValue
in classPatternValue
-
getValue
- Specified by:
getValue
in classPatternExpression
- Throws:
MemoryAccessException
-
getBitStart
public int getBitStart() -
getBitEnd
public int getBitEnd() -
getByteStart
public int getByteStart() -
getByteEnd
public int getByteEnd() -
decode
- Specified by:
decode
in classPatternExpression
- Throws:
DecoderException
-
hasSignbit
public boolean hasSignbit() -
signExtend
public static long signExtend(long val, int bit) Sign extend -val- above -bit-- Parameters:
val
- value to extendbit
- bit specifying sign- Returns:
- the extended value
-
zeroExtend
public static long zeroExtend(long val, int bit) Clear all bits in -val- above -bit-- Parameters:
val
- value to zero extendbit
- bit above which to zero extend- Returns:
- the extended value
-
byteSwap
public static long byteSwap(long val, int size) Swap the least sig -size- bytes in -val-- Parameters:
val
- value to be byte swappedsize
- number of bytes involved in swap- Returns:
- the byte swapped value
-
isBigEndian
public boolean isBigEndian() -
getShift
public int getShift() -
toString
- Specified by:
toString
in classPatternExpression
-