HateLace/app/src/main/java/hatelace/ProgramCounter.java

23 lines
360 B
Java
Raw Normal View History

2024-04-16 07:19:34 +02:00
package hatelace;
public class ProgramCounter {
private int PC;
public ProgramCounter() {
this.PC = 0;
}
public ProgramCounter(int PC) {
this.PC = PC;
}
public int getPC() {
return this.PC;
}
public int incPC() {
this.PC = this.PC + 1 <= 0 ? 0 : this.PC + 1;
return this.PC;
}
}