Interrupts/Call

This commit is contained in:
2024-06-02 20:58:20 +02:00
parent 2294f81766
commit 8bc6d5cfd0
6 changed files with 28 additions and 37 deletions

View File

@ -47,7 +47,7 @@ public class Commands {
switch (instruction & 0x3800){
case 0b10000000000000:
System.out.println("CALL: " + j);
CALL (j, true);
CALL (j);
addExecutionTime(2);
return;
case 0b10100000000000:
@ -271,13 +271,9 @@ public class Commands {
DataRegister.setPC(jump-1);
}
public static void CALL(int jump, boolean normalUse) {
public static void CALL(int jump) {
ProgramStack.push(DataRegister.getPC()+1);
if (normalUse)
DataRegister.setPC(jump-1);
else
DataRegister.setPC(jump);
DataRegister.setPC(jump-1);
addExecutionTime(1);
}