Mosa.Compiler.Framework.Context.AppendInstruction C# (CSharp) Метод

AppendInstruction() публичный Метод

Appends the instruction.
public AppendInstruction ( BaseInstruction instruction, InstructionSize size, Operand result, Operand operand1, Operand operand2, Operand operand3, Operand operand4 ) : void
instruction BaseInstruction The instruction.
size InstructionSize The size.
result Operand The result.
operand1 Operand The operand1.
operand2 Operand The operand2.
operand3 Operand The operand3.
operand4 Operand The operand4.
Результат void
        public void AppendInstruction(BaseInstruction instruction, InstructionSize size, Operand result, Operand operand1, Operand operand2, Operand operand3, Operand operand4)
        {
            AppendInstruction();

            Node.SetInstruction(instruction, size, result, operand1, operand2, operand3, operand4);
        }

Same methods

Context::AppendInstruction ( ) : void
Context::AppendInstruction ( BaseInstruction instruction ) : void
Context::AppendInstruction ( BaseInstruction instruction, BasicBlock block ) : void
Context::AppendInstruction ( BaseInstruction instruction, BasicBlock block1, BasicBlock block2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, BasicBlock block ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, Operand result ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, Operand result, Operand operand1 ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, Operand result, Operand operand1, Operand operand2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, Operand result, Operand operand1, Operand operand2, BasicBlock block ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, bool updateStatus, Operand result, Operand operand1 ) : void
Context::AppendInstruction ( BaseInstruction instruction, ConditionCode condition, bool updateStatus, Operand result, Operand operand1, Operand operand2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, InstructionSize size, Operand result, Operand operand1 ) : void
Context::AppendInstruction ( BaseInstruction instruction, InstructionSize size, Operand result, Operand operand1, Operand operand2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, InstructionSize size, Operand result, Operand operand1, Operand operand2, Operand operand3 ) : void
Context::AppendInstruction ( BaseInstruction instruction, MosaMethod target ) : void
Context::AppendInstruction ( BaseInstruction instruction, Operand result ) : void
Context::AppendInstruction ( BaseInstruction instruction, Operand result, Operand operand1 ) : void
Context::AppendInstruction ( BaseInstruction instruction, Operand result, Operand operand1, Operand operand2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, Operand result, Operand operand1, Operand operand2, Operand operand3 ) : void
Context::AppendInstruction ( BaseInstruction instruction, bool updateStatus, Operand result ) : void
Context::AppendInstruction ( BaseInstruction instruction, bool updateStatus, Operand result, Operand operand1 ) : void
Context::AppendInstruction ( BaseInstruction instruction, bool updateStatus, Operand result, Operand operand1, Operand operand2 ) : void
Context::AppendInstruction ( BaseInstruction instruction, byte operandCount, byte resultCount ) : void

Usage Example

Пример #1
0
        /// <summary>
        /// Replaces the intrinsic call site
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="typeSystem">The type system.</param>
        void IIntrinsicMethod.ReplaceIntrinsicCall(Context context, ITypeSystem typeSystem, IList<RuntimeParameter> parameters)
        {
            // Retrieve register context
            //context.SetInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.ESP, new IntPtr(28)));

            // Restore registers (Note: EAX and EDX are NOT restored!)
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EDX), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(28)));
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EBX), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(4)));
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EDI), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(20)));
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.ESI), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(16)));
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.ESP), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(32)));
            //context.AppendInstruction(CPUx86.Instruction.MovInstruction, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EBP), new MemoryOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EAX, new IntPtr(24)));

            //uint ebp, uint esp, int eip

            RegisterOperand edx = new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EDX);
            RegisterOperand ebp = new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.EBP);
            RegisterOperand esp = new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.ESP);

            // Restore registers
            context.AppendInstruction(X86.Mov, new RegisterOperand(BuiltInSigType.UInt32, GeneralPurposeRegister.ESP), context.Operand1);

            // Jmp to EIP (stored in EDX)
            context.AppendInstruction(X86.Jmp, null, edx);
            //context.SetOperand(0, edx);
        }
All Usage Examples Of Mosa.Compiler.Framework.Context::AppendInstruction