Skip to content

Commit

Permalink
[cocoemu] Add exception support functions for debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelix8996 committed Aug 26, 2024
1 parent bc215e2 commit bad11ba
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,28 @@ protected boolean clockSuspended() {
waitLatch.getValue();
}

// Debugger support
public boolean exceptionHappened() {
return ecuSignals.exc_triggered();
}

public int exceptionNumber() {
int instruction = FetchUnit.fetchInstruction(
busD.getValue(),
inputs.int_number,
internalExceptionVectorRegister.getValue(),
externalExceptionVectorRegister.getValue(),
inputs.exc_number,
ecuSignals.latch_double_fault(),
inputs.exc,
ecuSignals.exc_triggered(),
ecuSignals.latch_int(),
startupLatch.getValue()
);

return instruction & 0b111111;
}

public static class ALU_InstructionGroups {
public static final int ALU_3 = 1;
public static final int ALU_2 = 1 << 1;
Expand Down

0 comments on commit bad11ba

Please sign in to comment.