Implemented RB0-Interrupt, added Interrupt check at step

This commit is contained in:
WickedJack99
2022-05-03 23:18:06 +02:00
parent a9c63d5603
commit 5e2987e226
4 changed files with 25 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -758,6 +758,20 @@ public class Ram {
//Bank0 PortB
public synchronized void set_RB0_INT(boolean value) {
int portB = get_PORTB();
boolean bOldRB0 = get_RB0_INT();
//If INTEDG is set, check if rising edge appeared
if (get_INTEDG()) {
//If rising edge appeared, set INT-Interrupt-Flag
if ((!bOldRB0) && value) {
set_INTF(true);
}
//If INTEDG is clear, check if falling edge appeared
} else {
//If falling edge appeared, set INT-Interrupt-Flag
if (bOldRB0 && (!value)) {
set_INTF(true);
}
}
if (value) {
portB |= 0b00000001;
} else {

View File

@@ -61,6 +61,7 @@ public class MyModel extends Thread {
}
//Check if interrupt was acknowledged
if (oPIC.interruptAcknowledged()) {
qDataToView.add(oPIC);
//Execute ISR
oPIC.InterruptServiceRoutine();
} else {
@@ -113,11 +114,16 @@ public class MyModel extends Thread {
//Check if breakpoints are initialized
if (abBreakpoints != null) {
//Check if breakpoint is set
int iProgC = oPIC.getRam().get_Programcounter();
iProgC &= abBreakpoints.length;
if (!abBreakpoints[iProgC]) {
step();
qDataToView.add(oPIC);
if (!abBreakpoints[oPIC.getRam().get_Programcounter()]) {
//Check if interrupt acknowledged
if (oPIC.interruptAcknowledged()) {
qDataToView.add(oPIC);
//Execute ISR
oPIC.InterruptServiceRoutine();
} else {
step();
qDataToView.add(oPIC);
}
}
} else {
System.out.println("Please load file!");