HateLace/app/src/main/java/hatelace/ProgramCounter.java
2024-04-16 12:42:57 +02:00

23 lines
413 B
Java

package hatelace;
/** Simple class to represent the Program Counter */
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;
}
}