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

AppendInstruction() приватный Метод

Appends an (empty) instruction after the current index.
private AppendInstruction ( ) : void
Результат void
        private void AppendInstruction()
        {
            Debug.Assert(!IsBlockEndInstruction);
            Debug.Assert(Block != null);

            var node = new InstructionNode();
            node.Label = Label;

            Node.Insert(node);

            Node = node;
        }

Same methods

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, InstructionSize size, Operand result, Operand operand1, Operand operand2, Operand operand3, Operand operand4 ) : 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