1 package jrre.instructionset.controlflow;
2
3 import jrre.Stack;
4 import jrre.types.ReferenceType;
5
6 public class Goto extends jrre.instructionset.Instruction {
7
8 int operandOne;
9 int operandTwo;
10
11 public Goto(int operandOne, int operandTwo){
12
13 this.operandOne = operandOne;
14 this.operandTwo = operandTwo;
15
16 name = "goto";
17 description = "foo foo moo poo";
18 length = 2;
19 }
20
21 public void execute(){
22
23 int offset = (operandOne << 8) | operandTwo;
24
25 Stack.branch(offset - 2);
26
27 }
28
29 public String toString(){
30 return "goto: "+((operandOne << 8) | operandTwo);
31 }
32 }
This page was automatically generated by Maven