This commit is contained in:
2024-04-23 22:31:39 +02:00
parent 59c77f8b8a
commit 0356ec9f01
4 changed files with 270 additions and 53 deletions

View File

@ -0,0 +1,25 @@
package fabrik.simulator.pic16f84;
import java.util.ArrayDeque;
import java.util.Deque;
public class ProgramStack {
private static Deque<Integer> returnStack = new ArrayDeque<>();
public static void push(int value) {
if (returnStack.size() != 7)
returnStack.push(value);
else {
System.out.println("Stack overflow");
}
}
public static int pop() {
return returnStack.pop();
}
public static Deque<Integer> getStack() {
return returnStack;
}
}