コード例 #1
0
        public override void ExecuteOpCode(VMStack stack, Instruction instruction)
        {
            var x = stack.VM.Pop();
            var y = stack.VM.Pop();

            stack.VM.Push(y & x);
        }
コード例 #2
0
 public object Execute()
 {
     while (instructions.Count > Index)
     {
         YeetInstruction   instruction          = instructions[Index];
         YeetOpCodeHandler registredInstruction = RegisteredHandlers[instruction.OpCode];
         registredInstruction.ExecuteInstruction(this, instruction);
     }
     return(VMStack.Count != 0 ? VMStack.Pop() : null);
 }
コード例 #3
0
 public override void ExecuteOpCode(VMStack stack, Instruction instruction)
 {
     if (stack.VM.Count == 0)
     {
         stack.VM.Push(null);
     }
     else
     {
         stack.VM.Push(stack.VM.Pop());
     }
 }
コード例 #4
0
ファイル: LdcI8.cs プロジェクト: congviet/VMachine
 public override void ExecuteOpCode(VMStack stack, Instruction instruction)
 {
     stack.VM.Push((long)instruction.Operand);
 }
コード例 #5
0
 public abstract void ExecuteOpCode(VMStack stack, Instruction instruction);
コード例 #6
0
 public override void ExecuteOpCode(VMStack stack, Instruction instruction)
 {
     stack.VM.Push((sbyte)instruction.GetLdcI4Value());
 }
コード例 #7
0
 public override void ExecuteOpCode(VMStack stack, Instruction instruction)
 {
     stack.VM.Push(-1);
 }