
public class CaseJump implements Instruction {
	int jump;
	
	public CaseJump(int jump) {
		super();
		this.jump = jump;
	}

	@Override
	public void execute(Kellermaschine kellermaschine) {
		int top = kellermaschine.keller.pop();
		if (top==0) kellermaschine.pc=kellermaschine.pc+jump;
		else kellermaschine.pc=kellermaschine.pc+1;
	}
	@Override
	public String toString() {
		return super.toString()+" "+jump;
	}

}
