# Interface: com.pnfsoftware.jeb.core.units.code.asm.simulator.IInsnEmulator

High Level design for an instruction emulator: it indicates if the PC is updated \(meaning a jump will be done, see [#getBranchType()](#getBranchType()) for jump type\) and is able to compute the result of the operation. Please note that the [#compute(byte[], long, int, IInstructionOperand[], IMachineContext)](#compute(byte[], long, int, IInstructionOperand[], IMachineContext)) implementation is not guaranteed, plus it can depends on context \(register values, memory access\).

## Method: compute
- parameter: `code`, type: `byte[]`
- parameter: `instructionAddress`, type: `long`
- parameter: `mode`, type: `int`
- parameter: `armOperands`, type: `T[]`
- parameter: `context`, type: `com.pnfsoftware.jeb.core.units.code.asm.IMachineContext`
- return type: `java.lang.Long`

Description: Compute the result of the instruction \(ADD, SUB...\). When the context is not provided or has missing entries, this method will return null as result or raise a ProcessorException. If this operation is not implemented, an [UnsupportedOperationException](UnsupportedOperationException) will be raised.
parameter: code: instruction bytes
parameter: instructionAddress: instruction address
parameter: mode: processor mode
parameter: armOperands: instruction operands
parameter: context: optional machine context
return: computed result, or null if it cannot be computed
throws: if the result cannot be computed

## Method: getBranchType
- return type: `com.pnfsoftware.jeb.core.units.code.asm.simulator.IInsnEmulator.BranchType`

Description: Return BranchType \(JUMP or LINK\). See later if more is needed.
return: branch type, or null if the instruction does not branch

## Method: isPCUpdated
- return type: `boolean`

Description: Indicate if the instruction can update the PC \(by another address than the following one\).
return: true if the instruction may update the program counter

