Interrupts

This commit is contained in:
2024-06-02 16:37:53 +02:00
parent c49a073cfd
commit 2294f81766
10 changed files with 83 additions and 54 deletions

View File

@ -47,7 +47,7 @@ public class Commands {
switch (instruction & 0x3800){
case 0b10000000000000:
System.out.println("CALL: " + j);
CALL (j);
CALL (j, true);
addExecutionTime(2);
return;
case 0b10100000000000:
@ -258,6 +258,7 @@ public class Commands {
}
public static void RETFIE() {
DataRegister.setBit(DataRegister.getINTCON(), 7); // GIE wieder setzen
DataRegister.setPC(ProgramStack.pop());
}
@ -270,12 +271,14 @@ public class Commands {
DataRegister.setPC(jump-1);
}
public static void CALL(int jump) {
public static void CALL(int jump, boolean normalUse) {
ProgramStack.push(DataRegister.getPC()+1);
DataRegister.setPC(jump-1);
if (normalUse)
DataRegister.setPC(jump-1);
else
DataRegister.setPC(jump);
addExecutionTime(1);
}
public static void MOVWF(int file) {