24 lines
469 B
Java
24 lines
469 B
Java
package hatelace.instructions;
|
|
|
|
import hatelace.*;
|
|
|
|
public class Jump extends Instruction {
|
|
private int index;
|
|
|
|
/** Unconditional jump, non-relative */
|
|
public Jump(int index) {
|
|
this.index = index;
|
|
}
|
|
|
|
public void execute(Memory memory, ProgramCounter PC) {
|
|
PC.setPC(this.index);
|
|
}
|
|
|
|
protected String opcode() {
|
|
return "jump";
|
|
}
|
|
|
|
protected Object[] operands() {
|
|
return new Object[] {this.index};
|
|
}
|
|
}
|