示例#1
0
        public override void ExecuteInstruction(YeetCore core, YeetInstruction instr)
        {
            object x = core.VMStack.Pop();
            object y = core.VMStack.Pop();

            core.VMStack.Push((int)y + (int)x);
            core.Index++;
        }
示例#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 ExecuteInstruction(YeetCore core, YeetInstruction instr)
        {
            if (core.VMStack.Count == 0)
            {
                core.VMStack.Push(null);
            }

            object ret = core.VMStack.Pop();

            core.VMStack.Push(ret);
            core.Index++;
        }
示例#4
0
 public override void ExecuteInstruction(YeetCore core, YeetInstruction instr)
 {
     core.VMStack.Push(core.VMStack.Count == 0 ? null : core.VMStack.Pop());
     core.Index++;
 }
示例#5
0
 public override void ExecuteInstruction(YeetCore core, YeetInstruction instr)
 {
     core.VMStack.Push((int)instr.Operand);
     core.Index++;
 }
示例#6
0
 public abstract void ExecuteInstruction(YeetCore core, YeetInstruction instr);