﻿using System;
using SharpJVM.SharpJVM.Runtime.Instructions.Base;
using SharpJVM.SharpJVM.Runtime.DataArea;

namespace SharpJVM.SharpJVM.Runtime.Instructions.Stack
{
	public class Swap:NoOperandsInstrucation
	{
		public Swap()
		{
		}
		public override void Execute(Frame frame)
		{
			OperandStack stack = frame.operandStack;
			Slot slot1 = stack.PopSlot();
			Slot slot2 = stack.PopSlot();
			stack.PushSlot(slot1);
			stack.PushSlot(slot2);
		}
	}
}