Class BinaryOperatorHandlerBase
- Namespace
- Echo.Platforms.AsmResolver.Emulation.Dispatch.Arithmetic
- Assembly
- Echo.Platforms.AsmResolver.dll
Provides a base for binary operator instruction handlers.
public abstract class BinaryOperatorHandlerBase : FallThroughOpCodeHandler, ICilOpCodeHandler
- Inheritance
-
BinaryOperatorHandlerBase
- Implements
- Derived
- Inherited Members
Methods
DispatchInternal(CilExecutionContext, CilInstruction)
Evaluates a CIL instruction in the provided execution context, without increasing the program counter.
protected override CilDispatchResult DispatchInternal(CilExecutionContext context, CilInstruction instruction)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
instructionCilInstructionThe instruction to dispatch and evaluate.
Returns
- CilDispatchResult
A value indicating whether the dispatch was successful or caused an error.
Evaluate(CilExecutionContext, CilInstruction, StackSlot, StackSlot)
Evaluates the binary operation on two arguments.
protected abstract CilDispatchResult Evaluate(CilExecutionContext context, CilInstruction instruction, StackSlot argument1, StackSlot argument2)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
instructionCilInstructionThe instruction to dispatch and evaluate.
argument1StackSlotThe first argument that also receives the output.
argument2StackSlotThe second argument.
Returns
- CilDispatchResult
A value indicating whether the dispatch was successful or caused an error.
Force32BitResult(CilInstruction)
Gets a value indicating whether the instruction always pushes a 32-bit value.
protected abstract bool Force32BitResult(CilInstruction instruction)
Parameters
instructionCilInstructionThe instruction to classify.
Returns
- bool
trueif a 32-bit value is always pushed,falseotherwise.
IsSignedOperation(CilInstruction)
Gets a value indicating whether the instruction is a signed operation or not.
protected abstract bool IsSignedOperation(CilInstruction instruction)
Parameters
instructionCilInstructionThe instruction to classify.
Returns
- bool
trueif signed,falseotherwise.