HateLace/app/src/main/java/hatelace/instructions/Jump.java
2024-04-16 14:58:51 +02:00

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};
}
}