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++; }
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); }
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++; }
public override void ExecuteInstruction(YeetCore core, YeetInstruction instr) { core.VMStack.Push(core.VMStack.Count == 0 ? null : core.VMStack.Pop()); core.Index++; }
public override void ExecuteInstruction(YeetCore core, YeetInstruction instr) { core.VMStack.Push((int)instr.Operand); core.Index++; }
public abstract void ExecuteInstruction(YeetCore core, YeetInstruction instr);