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

24 lines
413 B
Java
Raw Normal View History

2024-04-16 07:19:34 +02:00
package hatelace;
2024-04-16 12:42:57 +02:00
/** Simple class to represent the Program Counter */
2024-04-16 07:19:34 +02:00
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;
}
}