Package ghidra.pcode.emu

# Interface InstructionDecoder

All Known Implementing Classes:
  `SleighInstructionDecoder`

public interface InstructionDecoder
A means of decoding machine instructions from the bytes contained in the machine state

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `branched(Address address)`
  Inform the decoder that the emulator thread just branched
  `Instruction`
  `decodeInstruction(Address address, RegisterValue context)`
  Decode the instruction starting at the given address using the given context
  `Instruction`
  `getLastInstruction()`
  Get the last instruction decoded
  `int`
  `getLastLengthWithDelays()`
  Get the length of the last decoded instruction, including delay slots

- ## Method Details

  - ### decodeInstruction

    Instruction decodeInstruction(Address address, RegisterValue context)
    Decode the instruction starting at the given address using the given context

    This method cannot return null. If a decode error occurs, it must throw an exception.

    Parameters:
      `address` - the address to start decoding
      `context` - the disassembler/decode context
    Returns:
      the instruction

  - ### branched

    void branched(Address address)
    Inform the decoder that the emulator thread just branched
    Parameters:
      `address` -

  - ### getLastInstruction

    Instruction getLastInstruction()
    Get the last instruction decoded
    Returns:
      the instruction

  - ### getLastLengthWithDelays

    int getLastLengthWithDelays()
    Get the length of the last decoded instruction, including delay slots
    Returns:
      the length