Class AssemblyOperandState
java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyState
ghidra.app.plugin.assembler.sleigh.sem.AssemblyOperandState
The state corresponding to a non-sub-table operand
This is roughly analogous to ConstructState
, but for assembly. However, it also records
the value of the operand and the actual operand symbol whose value it specifies.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final OperandSymbol
protected final AssemblyTerminal
protected final long
-
Constructor Summary
ConstructorDescriptionAssemblyOperandState
(AbstractAssemblyTreeResolver<?> resolver, List<AssemblyConstructorSemantic> path, int shift, AssemblyTerminal terminal, long value, OperandSymbol opSym) Construct the state for a given operand and selected value -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Compute the size in bits of this operand's valueint
Pre compute this nodes hashboolean
long
getValue()
protected boolean
protected Stream
<AssemblyResolvedPatterns> resolve
(AssemblyResolvedPatterns fromRight, Collection<AssemblyResolvedError> errors) Generate machine (partial) code for this nodeprotected AssemblyResolution
Solve the operand's defining expression set equal to the desired valuetoString()
Methods inherited from class ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyState
getLength, getPath, getResolver, getShift, hashCode
-
Field Details
-
terminal
-
value
protected final long value -
opSym
-
-
Constructor Details
-
AssemblyOperandState
public AssemblyOperandState(AbstractAssemblyTreeResolver<?> resolver, List<AssemblyConstructorSemantic> path, int shift, AssemblyTerminal terminal, long value, OperandSymbol opSym) Construct the state for a given operand and selected value- Parameters:
resolver
- the resolverpath
- the path for diagnosticsshift
- the (right) shift of this operandterminal
- the terminal that generated this statevalue
- the value of the operandopSym
- the operand symbol
-
-
Method Details
-
computeHash
public int computeHash()Description copied from class:AbstractAssemblyState
Pre compute this nodes hash- Specified by:
computeHash
in classAbstractAssemblyState
- Returns:
- the hash
-
partsEqual
-
equals
- Specified by:
equals
in classAbstractAssemblyState
-
toString
-
computeBitsize
protected int computeBitsize()Compute the size in bits of this operand's valueIf this operand does not have a strict size, 0 is returned.
- Returns:
- the size
-
solveNumeric
Solve the operand's defining expression set equal to the desired value- Returns:
- the resolved patterns, an error, or a backfill
-
resolve
protected Stream<AssemblyResolvedPatterns> resolve(AssemblyResolvedPatterns fromRight, Collection<AssemblyResolvedError> errors) Description copied from class:AbstractAssemblyState
Generate machine (partial) code for this node- Specified by:
resolve
in classAbstractAssemblyState
- Parameters:
fromRight
- the accumulated patterns thus far, from the right sibling or left-most childerrors
- a place to collect error reports- Returns:
- the stream of generated patterns, as accumulated
-
getTerminal
-
getValue
public long getValue() -
getOperandSymbol
-