Package ghidra.app.plugin.assembler.sleigh.sem

# Class AssemblyOperandState

java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyState
ghidra.app.plugin.assembler.sleigh.sem.AssemblyOperandState

public class AssemblyOperandState extends AbstractAssemblyState
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

  Fields
  Modifier and Type
  Field
  Description
  `protected final OperandSymbol`
  `opSym`
  `protected final AssemblyTerminal`
  `terminal`
  `protected final long`
  `value`

  ### Fields inherited from class ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyState

  `DBG, hash, length, path, resolver, shift`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssemblyOperandState(AssemblyTreeResolver 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 Type
  Method
  Description
  `protected int`
  `computeBitsize()`
  Compute the size in bits of this operand's value
  `int`
  `computeHash()`
  Pre compute this nodes hash
  `boolean`
  `equals(Object obj)`
  `protected Stream<AssemblyResolvedPatterns>`
  `resolve(AssemblyResolvedPatterns fromRight, Collection<AssemblyResolvedError> errors)`
  Generate machine (partial) code for this node
  `protected AssemblyResolution`
  `solveNumeric()`
  Solve the operand's defining expression set equal to the desired value
  `String`
  `toString()`

  ### Methods inherited from class ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyState

  `getLength, hashCode`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### terminal

    protected final AssemblyTerminal terminal

  - ### value

    protected final long value

  - ### opSym

    protected final OperandSymbol opSym

- ## Constructor Details

  - ### AssemblyOperandState

    public AssemblyOperandState(AssemblyTreeResolver 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 resolver
      `path` - the path for diagnostics
      `shift` - the (right) shift of this operand
      `terminal` - the terminal that generated this state
      `value` - the value of the operand
      `opSym` - the operand symbol

- ## Method Details

  - ### computeHash

    public int computeHash()
    Description copied from class: `AbstractAssemblyState`
    Pre compute this nodes hash
    Specified by:
      `computeHash` in class `AbstractAssemblyState`
    Returns:
      the hash

  - ### equals

    public boolean equals(Object obj)
    Specified by:
      `equals` in class `AbstractAssemblyState`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### computeBitsize

    protected int computeBitsize()
    Compute the size in bits of this operand's value

    If this operand does not have a strict size, 0 is returned.

    Returns:
      the size

  - ### solveNumeric

    protected AssemblyResolution 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 class `AbstractAssemblyState`
    Parameters:
      `fromRight` - the accumulated patterns thus far, from the right sibling or left-most child
      `errors` - a place to collect error reports
    Returns:
      the stream of generated patterns, as accumulated